ADTF  3.13.0
md_sample_data< T >

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

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 spezializations 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()
{
CreateInputPin("input", adtf::mediadescription::description<tTest>());
}
tResult AcceptType(adtf::streaming::ISampleReader* /*pReader*/,
{
}
tResult ProcessInput(adtf::streaming::ISampleReader* /*pReader*/,
{
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:
};

Definition at line 71 of file md_sample_data.h.


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Tue Sep 28 2021 by doxygen 1.8.14)