ADTF
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
adtf::mediadescription Namespace Reference

Namespace for the ADTF Media Description SDK. More...

Namespaces

namespace  adtf_ddl_legacy
 Namespace for collect all classes valid before DDL Library switch from the internal to the open source variant.
 
namespace  ant
 Namespace for all functionality provided since v3.0.
 
namespace  flash
 Namespace for all functionality provided since v3.5.
 
namespace  hollow
 Namespace for all functionality provided since v3.7.
 
namespace  osborn
 Namespace for all functionality provided since v3.14.
 
namespace  penguin
 Namespace for all functionality provided since v3.15.
 
namespace  quiet
 Namespace for all functionality provided since v3.16.
 

Classes

class  cDDLPrinter
 Generates a DDL description from a structure definition. More...
 
class  cDumper
 Dumps a structure definition to an output stream. More...
 
class  cSampleCodec
 Codec for samples with static and/or dynamic data. More...
 
class  cSampleCodecFactory
 Factory class for ddl codecs for samples. More...
 
class  cSampleDecoder
 Decoder for samples with static and/or dynamic data. More...
 
class  cStaticSampleCodec
 Codec for samples with static data content. More...
 
class  cStaticSampleDecoder
 Decoder for samples with static data content. More...
 
class  cType
 Base class for types. More...
 
class  decoding_sample_reader
 This reader uses the media description to decode sample data. More...
 
struct  description
 Template to provide struct name and definition for a generated struct. More...
 
class  encoding_sample_writer
 Sample Writer that provides samples that can be updated via a Codec. More...
 
class  enumeration
 This is used to create an enumeration ytpe from an existing c++ enum. More...
 
class  md_array
 This class is used to wrap access to arrays of plain and enum types. More...
 
class  md_sample_data
 Template to provide media description based access to Sample data. More...
 
class  md_sample_data_factory
 This factory provides instances of md_sample_data for incoming samples. More...
 
class  md_struct_array
 This class is used to wrap access to arrays of struct types. More...
 
struct  stream_meta_type_default
 Use this Stream Meta Type if your sample data are structured and the memory layout can be described via DDL Specification - see also Usage of Stream Meta Type "adtf/default". More...
 
class  stream_type_default
 Generator template to create an instance of the stream_meta_type_default. More...
 
class  stream_type_default_array
 Generator template to create an instance of the stream_meta_type_default. More...
 
class  structure
 This is used to create a structure type from an existing c++ struct definition. More...
 

Typedefs

using tCodecLeafIndex = osborn::tCodecLeafIndex
 
using tCodecIndex = osborn::tCodecIndex
 
using tLeafCodecIndex
 redefitnion for a LeafCodecIndex
 

Functions

template<typename T>
std::vector< tLeafCodecIndexget_leaf_codec_indices (const T &oDecoderOrFactory, ddl::DataRepresentation rep)
 Get the leaf indices object.
 
template<typename READER>
tResult make_sample_reader (READER &oReader, const char *strNameOfReader, const char *strDDLStructType)
 Helper template to setup a sample reader with a stream type set from the media description service.
 
template<typename WRITER>
tResult make_sample_writer (WRITER &oWriter, const char *strNameOfWriter, const char *strDDLStructType)
 Helper template to setup a sample writer with a stream type set from the media description service.
 
template<typename ElementsType>
void for_each_leaf_element (ElementsType &oElements, const element_callback< ElementsType > &fnCallback)
 Iterates ALL leaf elements within ALL array elements.
 
template<typename ElementsType>
void for_each_element (ElementsType &oElements, const element_callback< ElementsType > &fnCallback)
 Iterates elements without array elements (also structures).
 
template<typename T>
adtf_util::cVariant get_value_as_variant (const T &oDecoder, const tCodecIndex &oCodecIndex)
 Get value as variant.
 
template<typename T>
std::vector< tCodecIndexget_codec_indices (const T &oDecoderOrFactory)
 Get the codec indices object.
 
template<typename ElementsType>
void for_each_element_infix (ElementsType &oElements, const element_callback< ElementsType > &fnLeafCallback, const element_control_callback< ElementsType > &fnEnterMemberCallback, const element_callback< ElementsType > &fnLeaveMemberCallback, const array_element_control_callback< ElementsType > &fnEnterArrayMemberCallback, const array_element_callback< ElementsType > &fnLeaveArrayMemberCallback)
 Iterates elements and array elements in a callback-controlled fashion.
 
template<typename ElementsType>
void for_each_element_infix (ElementsType &oElements, const ddl::dd::datamodel::StructType::Elements &oModelElements, const ddl::dd::datamodel::DataDefinition &oDataDefinition, const element_callback< ElementsType > &fnLeafCallback, const element_control_callback< ElementsType > &fnEnterMemberCallback, const element_callback< ElementsType > &fnLeaveMemberCallback, const array_element_control_callback< ElementsType > &fnEnterArrayMemberCallback, const array_element_callback< ElementsType > &fnLeaveArrayMemberCallback)
 Iterates elements and array elements in a callback-controlled fashion.
 
void set_stream_type_media_description (streaming::ant::IStreamType &oStreamType, const ddl::DDStructure &type_definition)
 Adds the media description properties to a stream type.
 
tResult set_stream_type_media_description_from_service (adtf::streaming::IStreamType &oStreamType, const char *strStructName, ddl::tDataRepresentation eRep=ddl::tDataRepresentation::Deserialized)
 Set the media description properties of a stream type.
 
tResult set_media_description_properties (base::ant::IProperties &oProperties, const char *strStructName, const char *strMediaDescription, ddl::tDataRepresentation eRep=ddl::tDataRepresentation::Deserialized)
 Adds the media description properties to a properties object.
 
tResult get_codec_factory_from_stream_type (const adtf::streaming::IStreamType &oStreamType, cSampleCodecFactory &oFactory)
 Create a sample codec factory from a given stream type.
 
std::tuple< std::string, std::string, ddl::tDataRepresentationget_media_description_from_stream_type (const adtf::streaming::IStreamType &oStreamType)
 Extract the media description information from stream type.
 

Variables

template<typename T>
constexpr bool has_description_v
 

Detailed Description

Namespace for the ADTF Media Description SDK.

Within this namespace all interfaces, classes and functions always refer to their last revised implementation. When using types defined within this namespace it is guaranteed to always use the latest version of the types.

Typedef Documentation

◆ tCodecIndex

Definition at line 419 of file sample_codec_access_types.h.

◆ tCodecLeafIndex

using tCodecLeafIndex = osborn::tCodecLeafIndex

Definition at line 418 of file sample_codec_access_types.h.

◆ tLeafCodecIndex

redefitnion for a LeafCodecIndex

Definition at line 21 of file leaf_sample_codec_access.h.

Function Documentation

◆ for_each_element()

template<typename ElementsType>
void for_each_element ( ElementsType & oElements,
const element_callback< ElementsType > & fnCallback )

Iterates elements without array elements (also structures).

Usage:

//strDescription contains a data description where "my_struct" is defined
struct my_sub_struct
{
uint32_t sub_element[3];
uint32_t sub_element_after;
}
struct my_struct
{
my_sub_struct element[2];
}
cSampleCodecFactory oFactory("my_struct", strDescription);
for_each_element(oFactory.GetElements(),
[](const auto& oElement) {
std::cout << oElement.getFullName() << std::endl;
std::cout << oElement.getName() << std::endl;
std::cout << oElement.getBaseName() << std::endl;
std::cout << oElement.getArraySize() << std::endl;
});
//following output:
//"element[0]"
//"element[0]"
//"element"
//"2"
//"element[0].sub_element[0]"
//"sub_element[0]"
//"sub_element"
//"3"
//"element[0].sub_element_after"
//"sub_element_after"
//"sub_element_after"
//"1"
void for_each_element(ElementsType &oElements, const element_callback< ElementsType > &fnCallback)
Iterates elements without array elements (also structures).
Template Parameters
ElementsTypeThe type of elements.
Parameters
elementsThe elements.
funcThe function to call per leaf element.
See also
GetElements, GetElements, GetElements, GetElements, GetElements
The Codec Index and the Element Iterator

Definition at line 1469 of file sample_codec.h.

◆ for_each_element_infix() [1/2]

template<typename ElementsType>
void for_each_element_infix ( ElementsType & oElements,
const ddl::dd::datamodel::StructType::Elements & oModelElements,
const ddl::dd::datamodel::DataDefinition & oDataDefinition,
const element_callback< ElementsType > & fnLeafCallback,
const element_control_callback< ElementsType > & fnEnterMemberCallback,
const element_callback< ElementsType > & fnLeaveMemberCallback,
const array_element_control_callback< ElementsType > & fnEnterArrayMemberCallback,
const array_element_callback< ElementsType > & fnLeaveArrayMemberCallback )

Iterates elements and array elements in a callback-controlled fashion.

This version also provides access to the corresponding elements in the data model. This can be used to access min/max and/or the element description.

Template Parameters
ElementsTypeThe type of elements.
Parameters
oElementsThe elements.
oModelElementsThe corresponding elements from the data model.
oDataDefinitionThe data definition that contains the data model.
fnLeafCallbackThe function to call per leaf element.
fnEnterMemberCallbackThe function to call per named member (leaf and intermediate). Controlls traversal of this member.
fnLeaveMemberCallbackThe function to call when leaving a member.
fnEnterArrayMemberCallbackThe function to call per array element. Controlls traversal of this element.
fnLeaveArrayMemberCallbackThe function to call when leaving an array element.

Definition at line 1735 of file sample_codec.h.

◆ for_each_element_infix() [2/2]

template<typename ElementsType>
void for_each_element_infix ( ElementsType & oElements,
const element_callback< ElementsType > & fnLeafCallback,
const element_control_callback< ElementsType > & fnEnterMemberCallback,
const element_callback< ElementsType > & fnLeaveMemberCallback,
const array_element_control_callback< ElementsType > & fnEnterArrayMemberCallback,
const array_element_callback< ElementsType > & fnLeaveArrayMemberCallback )

Iterates elements and array elements in a callback-controlled fashion.

Template Parameters
ElementsTypeThe type of elements.
Parameters
oElementsThe elements.
fnLeafCallbackThe function to call per leaf element.
fnEnterMemberCallbackThe function to call per named member (leaf and intermediate). Controlls traversal of this member.
fnLeaveMemberCallbackThe function to call when leaving a member.
fnEnterArrayMemberCallbackThe function to call per array element. Controlls traversal of this element.
fnLeaveArrayMemberCallbackThe function to call when leaving an array element.

Definition at line 1492 of file sample_codec.h.

◆ for_each_leaf_element()

template<typename ElementsType>
void for_each_leaf_element ( ElementsType & oElements,
const element_callback< ElementsType > & fnCallback )

Iterates ALL leaf elements within ALL array elements.

Usage:

//strDescription contains a data description where "my_struct" is defined
struct my_sub_struct
{
uint32_t sub_element[3];
uint32_t sub_element_after;
}
struct my_struct
{
my_sub_struct element[2];
}
cSampleCodecFactory oFactory("my_struct", strDescription);
for_each_leaf_element(oFactory.GetElements(),
[](const auto& oElement) {
std::cout << oElement.getFullName() << std::endl;
});
//following output:
//"element[0].sub_element[0]"
//"element[0].sub_element[1]"
//"element[0].sub_element[2]"
//"element[0].sub_element_after"
//"element[1].sub_element[0]"
//"element[1].sub_element[1]"
//"element[1].sub_element[2]"
//"element[1].sub_element_after"
void for_each_leaf_element(ElementsType &oElements, const element_callback< ElementsType > &fnCallback)
Iterates ALL leaf elements within ALL array elements.
Template Parameters
ElementsTypeThe type of elements.
Parameters
oElementsThe elements
fnCallbackThe function to call per leaf element
See also
GetElements, GetElements, GetElements, GetElements, GetElements
The Codec Index and the Element Iterator

Definition at line 1367 of file sample_codec.h.

Referenced by adtf::mediadescription::penguin::get_leaf_codec_indices().

◆ get_codec_factory_from_stream_type()

tResult get_codec_factory_from_stream_type ( const adtf::streaming::IStreamType & oStreamType,
cSampleCodecFactory & oFactory )

Create a sample codec factory from a given stream type.

Parameters
[in]oStreamTypeThe stream type.
[out]oFactoryThe new factory.
Returns
Standard result.

Referenced by decoding_sample_reader< ReaderImplementation >::decoding_sample_reader(), encoding_sample_writer< WriterImplementation >::ChangeType(), decoding_sample_reader< ReaderImplementation >::SetType(), and encoding_sample_writer< WriterImplementation >::SetType().

◆ get_codec_indices()

template<typename T>
std::vector< tCodecIndex > get_codec_indices ( const T & oDecoderOrFactory)

Get the codec indices object.

Template Parameters
TThe type of the decoder or factory to retrieve all indices from.
Parameters
oDecoderOrFactoryThe decoder or factory to retrieve all indices from.
Returns
std::vector<tCodecIndex>

Definition at line 1413 of file sample_codec.h.

◆ get_leaf_codec_indices()

template<typename T>
std::vector< tLeafCodecIndex > get_leaf_codec_indices ( const T & oDecoderOrFactory,
ddl::DataRepresentation rep )

Get the leaf indices object.

Template Parameters
TThe type of the decoder or factory to retrieve all leaf indices from.
Parameters
oDecoderOrFactoryThe decoder or factory to retrieve all indices from.
repDatarepresentation of the leaf layout to extract from codec index
Returns
std::vector<LeafCodecIndex>

Definition at line 31 of file leaf_sample_codec_access.h.

◆ get_media_description_from_stream_type()

std::tuple< std::string, std::string, ddl::tDataRepresentation > get_media_description_from_stream_type ( const adtf::streaming::IStreamType & oStreamType)

Extract the media description information from stream type.

Parameters
[in]oStreamTypeThe stream type containing the media description information.
Returns
A tuple containing the struct name, the struct description and the struct representation.
Exceptions
tResultin case the description could not be retrieved.

◆ get_value_as_variant()

template<typename T>
adtf_util::cVariant get_value_as_variant ( const T & oDecoder,
const tCodecIndex & oCodecIndex )

Get value as variant.

This is for your convenience!

Template Parameters
TThe decoder type
Parameters
oDecoderThe decoder to retrieve the value from
oCodecIndexthe codec index for the value
Returns
adtf_util::cVariant

Definition at line 1563 of file sample_codec.h.

◆ make_sample_reader()

template<typename READER>
tResult make_sample_reader ( READER & oReader,
const char * strNameOfReader,
const char * strDDLStructType )
inline

Helper template to setup a sample reader with a stream type set from the media description service.

Parameters
[in,out]oReaderThe reader that should be setup.
[in]strNameOfReaderThe name of the reader, which will be used to create an input pin.
[in]strDDLStructTypeThe name of the struct that the description should be retrieved from the media description service.
Returns
Standard result.

Definition at line 28 of file make_sample_reader_default.h.

◆ make_sample_writer()

template<typename WRITER>
tResult make_sample_writer ( WRITER & oWriter,
const char * strNameOfWriter,
const char * strDDLStructType )
inline

Helper template to setup a sample writer with a stream type set from the media description service.

Parameters
[in,out]oWriterThe writer that should be setup.
[in]strNameOfWriterThe name of the writer, which will be used to create an output pin.
[in]strDDLStructTypeThe name of the struct that the description should be retrieved from the media description service.
Returns
Standard result.

Definition at line 27 of file make_sample_writer_default.h.

◆ set_media_description_properties()

tResult set_media_description_properties ( base::ant::IProperties & oProperties,
const char * strStructName,
const char * strMediaDescription,
ddl::tDataRepresentation eRep = ddl::tDataRepresentation::Deserialized )

Adds the media description properties to a properties object.

Parameters
[out]oPropertiesThe properties object where the properties should be added/set to.
[in]strStructNameThe name of the struct.
[in]strMediaDescriptionThe media description containing the struct definition.
[in]eRepThe data representation of the struct that samples contain.
Returns
Standard result.

◆ set_stream_type_media_description()

void set_stream_type_media_description ( streaming::ant::IStreamType & oStreamType,
const ddl::DDStructure & type_definition )

Adds the media description properties to a stream type.

Parameters
[out]oStreamTypeThe stream type where the properties should be added/set to.
[in]type_definitionA structure type definition.
Exceptions
tResultin case of error.

◆ set_stream_type_media_description_from_service()

tResult set_stream_type_media_description_from_service ( adtf::streaming::IStreamType & oStreamType,
const char * strStructName,
ddl::tDataRepresentation eRep = ddl::tDataRepresentation::Deserialized )

Set the media description properties of a stream type.

Retrieves the media description from the media description service.

Parameters
[out]oStreamTypeThe stream type.
[in]strStructNameThe name of the media description struct.
[in]eRepRepresentation of the data (serialized or deserialized)
Returns
Standard result.

Variable Documentation

◆ has_description_v

template<typename T>
bool has_description_v
constexpr

Definition at line 55 of file md_sample_data.h.