ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
md_sample_data< T >

Template to provide media description based access to Sample data. More...

#include <md_sample_data_legacy.h>

Detailed Description

template<typename T>
class adtf::mediadescription::flash::md_sample_data< T >

Template to provide media description based access to Sample data.

The MD Generator Tool will generate specializations of this template that provide access methods for all members of the given struct.

Template Parameters
TThe type af the Sample content.

Example Usage

test_struct.description:

<structs>
<struct name="tChild" alignment="4" version="1">
<element name="nA" type="tUInt32" arraysize="1">
<deserialized alignment="4"/>
<serialized bytepos="0" byteorder="LE"/>
</element>
<element name="nB" type="tUInt32" arraysize="1">
<deserialized alignment="4"/>
<serialized bytepos="4" byteorder="LE"/>
</element>
</struct>
<struct name="tTest" alignment="4" version="1">
<element name="nValue" type="tUInt32" arraysize="1">
<deserialized alignment="4"/>
<serialized bytepos="0" byteorder="LE"/>
</element>
<element name="aArray" type="tUInt32" arraysize="2">
<deserialized alignment="4"/>
<serialized bytepos="4" byteorder="LE"/>
</element>
<element name="sChild" type="tChild" arraysize="1">
<deserialized alignment="4"/>
<serialized bytepos="12" byteorder="LE"/>
</element>
<element name="aChildren" type="tChild" arraysize="2">
<deserialized alignment="4"/>
<serialized bytepos="20" byteorder="LE"/>
</element>
</struct>
</structs>
// include the generated header
#include <test_struct.h>
class cMyFilter: public adtf::filter::cFilter
{
public:
ADTF_CLASS_ID_NAME(cMyFilter, "my_filter.filter.example.cid", "My Filter");
cMyFilter()
{
}
{
}
{
auto oSampleData = m_oSampleDataFactory.Make(pSample);
LOG_INFO("received a sample:\n"
" nValue = %u\n"
" aArray[0] = %u\n"
" sChild.nA = %u\n"
" aChildren[0].nA = %u",
oSampleData.nValue(),
oSampleData.aArray()[0],
oSampleData.sChild().nA(),
oSampleData.aChildren()[0].nB());
}
private:
};
Copyright © Audi Electronics Venture GmbH.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Common macro to enable correct treatment of class identifier AND Class Name by IClassInfo.
Definition class_id.h:33
ReaderType * CreateInputPin(const char *strName, bool bDataInTrigger=true, bool bForwardTriggerViaOutputPins=true)
Creates a new input pin with an anonymous stream type.
virtual tResult AcceptType(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Called whenever a new type is read from a reader that has no other accept type callback (SetAcceptTyp...
virtual tResult ProcessInput(base::flash::tNanoSeconds tmTrigger, streaming::flash::ISampleReader *pReader)
Provides access to the reader of incoming data.
Base class for ADTF filters.
Definition filter.h:460
This factory provides instances of md_sample_data for incoming samples.
Interface for sample reads that read from sample streams via input pins.
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Template to provide struct name and definition for a generated struct.

Definition at line 64 of file md_sample_data_legacy.h.

Constructor & Destructor Documentation

◆ md_sample_data()

template<typename T>
md_sample_data ( )
inline

Definition at line 67 of file md_sample_data_legacy.h.