This reader uses the media description to decode sample data. More...
#include <codec_sample_streamer.h>
Public Member Functions | |
decoding_sample_reader () | |
Default Constructor. | |
tResult | SetType (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType) override |
Sets the initial stream type of a streamer. | |
void | SetAcceptTypeCallback (const std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType)> &fnAcceptTypeCallback) |
Sets a callback that will be called for each new Stream Type. | |
bool | GetNextDecoder (cSampleDecoder &oDecoder) |
Returns a decoder for the next available Sample. | |
bool | GetNextDecoder (cSampleDecoder &oDecoder, base::flash::tNanoSeconds &tmSampleTime) |
Returns a decoder for the next available Sample. | |
bool | GetLastDecoder (cSampleDecoder &oDecoder) |
Returns a decoder for the last Sample currently available. | |
bool | GetLastDecoder (cSampleDecoder &oDecoder, base::flash::tNanoSeconds &tmSampleTime) |
Returns a decoder for the last Sample currently available. | |
![]() | |
cSampleReader (ant::ISampleReaderQueue &oQueue, ant::ISampleStreamAccess::tMode eAccessMode, bool bStoreLastSample) | |
void | SetName (const char *strName) override |
Sets the name of the streamer. | |
tResult | GetName (base::ant::IString &&strName) override |
Retrieves the name of the streamer. | |
tResult | GetType (ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType) const override |
Returns the initial stream type of the streamer. | |
tResult | BeginStreaming (ISampleStream &oSampleStream) override |
Begin streaming on the given sample stream. | |
tResult | EndStreaming () override |
End streaming. | |
tResult | SetStreamerPin (const ucom::ant::iobject_ptr< IStreamerPin > &pStreamerPin) override |
Sets the pin that the streamer is associated with. | |
void | SetAcceptTypeCallback (const std::function< tResult(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType)> &fnAcceptTypeCallback) |
Sets a callback function which is called while a Stream Type is received - see also AcceptType and IsCompatible implementations. | |
void | SetStreamErrorCallback (const std::function< tResult(tResult oStreamError)> &fnStreamErrorCallback) |
A callback function to react on stream errors. | |
tResult | SetStreamError (tResult oError) override |
Sets an error on the associated sample stream. | |
tResult | GetLastType (ucom::ant::iobject_ptr< const ant::IStreamType > &pType) override |
Returns the last stream type that was read from the sample stream. | |
tResult | GetNextSample (ucom::ant::iobject_ptr< const ant::ISample > &pSample) override |
Reads the next available sample from the associated sample stream. | |
tResult | GetLastSample (ucom::ant::iobject_ptr< const ant::ISample > &pSample) override |
Reads the latest available sample from the associated sample stream. | |
void | Reset () |
tResult | ReadAllAvailableItems () override |
Reads all available items from the sample stream into internal queues. | |
tResult | RequestSamples (ucom::ant::iobject_ptr< hollow::IStreamingRequest > &pRequest, uint32_t nSubStreamId, const base::ant::IProperties *pRequestProperties=nullptr) |
RequestSamples of the given Substream to be generated and/or transmitted. | |
void | SetSynchronousTypeUpdateCallback (const std::function< tResult(const ucom::ant::iobject_ptr< const ant::IStreamType > &pStreamType)> &fnRequestTypeUpdateCallback) |
![]() | |
cSampleCodecFactory () | |
Empty constructor. | |
cSampleCodecFactory (const char *strStructName, const char *strMediaDescription, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized) | |
Constructor that take a DDL string for initialization. | |
cSampleCodecFactory (const ddl::dd::StructType &oStruct, const ddl::dd::DataDefinition &oParentDD, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized) | |
Constructor that uses an OO-DDL struct for initialization. | |
cSampleCodecFactory (const std::pair< std::string, std::string > &oMDDescription, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized) | |
Construct a new c Sample Codec Factory. | |
cSampleCodecFactory (const ddl::DDStructure &oTypeDefinition, ddl::tDataRepresentation eDefaultDataRepresentation=ddl::tDataRepresentation::Deserialized) | |
Construct a new c Sample Codec Factory. | |
cSampleCodecFactory (const streaming::ant::IStreamType &oStreamType) | |
Construct a new c Sample Codec Factory. | |
cSampleCodecFactory (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType) | |
Construct a new c Sample Codec Factory. | |
cSampleCodecFactory (const cSampleCodecFactory &) | |
Copy constructor. | |
cSampleCodecFactory (cSampleCodecFactory &&) | |
Move constructor. | |
cSampleCodecFactory & | operator= (const cSampleCodecFactory &) |
assignment operator | |
cSampleCodecFactory & | operator= (cSampleCodecFactory &&) |
Move assignment operator. | |
tResult | IsValid () const |
Check if the factory is in a valid state. | |
cStaticSampleDecoder | MakeStaticDecoderFor (const adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a static decoder for the given sample. | |
cStaticSampleCodec | MakeStaticCodecFor (adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a static codec for the given sample. | |
cSampleDecoder | MakeDecoderFor (const adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a decoder for the given sample. | |
cSampleCodec | MakeCodecFor (adtf::streaming::ISample &oSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a codec for the given sample. | |
tElement | GetElement (const tCodecIndex &oCodecIndex) const |
Retrieves an element for the codec index. | |
tElement | GetElement (const std::string &strElementFullName) const |
Retrieves an element for the given name. | |
const tElements & | GetElements () const |
Retrieves the elements of the factory to get element information. | |
size_t | GetElementChildCount (const tCodecIndex &oCodecIndex) const |
Retrieves the amount of child elements for the given codec index. | |
std::string | GetElementFullName (const tCodecIndex &oCodecIndex) const |
Retrieves the full name of the element within its main structure. | |
std::string | GetElementName (const tCodecIndex &oCodecIndex) const |
Retrieves the name of the element within its structured element. | |
const std::string & | GetElementBaseName (const tCodecIndex &oCodecIndex) const |
Retrieves the base name of the element within its structured element. | |
size_t | GetStaticBufferSize (ddl::tDataRepresentation eRep=ddl::tDataRepresentation::Deserialized) const |
Gets the static buffer size in bytes for the structure. | |
ddl::tDataRepresentation | GetDefaultDataRepresentation () const |
Returns the current default data representation whuke creating codec or decoder. | |
cStaticSampleDecoder | MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a static decoder for the given sample. | |
cSampleDecoder | MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a decoder for the given sample. | |
cStaticSampleCodec | MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a static codec for the given sample. | |
cSampleCodec | MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, ddl::tDataRepresentation eDataRepresentation) const |
Creates a codec for the given sample. | |
cStaticSampleDecoder | MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const |
Creates a static decoder for the given sample using the default data representation. | |
cSampleDecoder | MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const |
Creates a decoder for the given sample using the default data representation. | |
cStaticSampleCodec | MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const |
Creates a static codec for the given sample using the default data representation. | |
cSampleCodec | MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const |
Creates a codec for the given sample using the default data representation. | |
cStaticSampleDecoder | MakeStaticDecoderFor (const adtf::streaming::ISample &oSample) const |
Creates a static decoder for the given sample using the default data representation. | |
cSampleDecoder | MakeDecoderFor (const adtf::streaming::ISample &oSample) const |
Creates a decoder for the given sample using the default data representation. | |
cStaticSampleCodec | MakeStaticCodecFor (adtf::streaming::ISample &oSample) const |
Creates a static codec for the given sample using the default data representation. | |
cSampleCodec | MakeCodecFor (adtf::streaming::ISample &oSample) const |
Creates a codec for the given sample using the default data representation. | |
void | Resolve (tCodecIndex &oCodecIndex) const |
retrieves the lyoutinformation for the given codec index. | |
tCodecIndex | Resolve (tCodecLeafIndex nElementIndex) const |
Legacy: Retrieves a codec index with element information for the given leaf index. | |
![]() | |
tCodecIndex | Resolve (tCodecLeafIndex nElementIndex) const |
Legacy: Retrieves a codec index with element information for the given leaf index. | |
size_t | GetStaticElementCount () const |
Legacy: Gets the leaf count. | |
tResult | GetStaticElement (tCodecLeafIndex nElementLeafIndex, const ddl::StructElement *&pElement) const |
Legacy: Access information about an element. | |
tCodecLeafIndex | FindIndex (const char *strElementName) const |
Legacy: Retrieves the leaf index of the first element in the given element path. | |
tCodecLeafIndex | FindArrayIndex (const char *strArrayName) const |
Legacy: Retrieves the leaf index of the first element in the given element path. | |
tCodecLeafIndex | FindStructIndex (const char *strStructName) const |
Legacy: Retrieves the leaf index of the first element in the given element path. | |
Private Attributes | |
std::function< tResult(const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType)> | m_fnAcceptCallback |
Additional Inherited Members | |
![]() | |
typedef ddl::codec::FactoryElement< sample_codec_factory_access< const cSampleCodecFactory > > | tElement |
Iterator value element type for the factory to get element information. | |
typedef ddl::codec::ChildElements< sample_codec_factory_access< const cSampleCodecFactory > > | tElements |
Iterator container to iterate all elements of the factory. | |
![]() | |
typedef ddl::StructElement | DefinedStructElementType |
type definition for the old access_element API. | |
![]() | |
static const char * | GetStaticStructElementName (const ddl::StructElement *pElement) |
Legacy helper funtion to support old adtf_ddl::element_access::find_* functions. | |
![]() | |
ant::cDynamicSampleReaderQueue | m_oQueue |
ant::cDynamicSampleReaderQueue | m_oQueue |
ant::cDynamicSampleReaderQueue | m_oQueue |
ant::cDynamicSampleReaderQueue | m_oQueue |
![]() | |
std::unique_ptr< cImplementation > | m_pImplementation |
This reader uses the media description to decode sample data.
Just use it instead of the usual adtf::streaming::flash::cDynamicSampleReader implementation.
Definition at line 31 of file codec_sample_streamer.h.
|
inline |
Default Constructor.
Definition at line 39 of file codec_sample_streamer.h.
References cSampleCodecFactory::cSampleCodecFactory(), adtf::mediadescription::osborn::get_codec_factory_from_stream_type(), RETURN_IF_FAILED, and RETURN_NOERROR.
|
inline |
Returns a decoder for the last Sample currently available.
[out] | oDecoder | This will be updated to decode the last sample. |
true | A sample was available and the oDecoder instance has been updated. |
false | No sample was available. |
Definition at line 119 of file codec_sample_streamer.h.
References GetLastDecoder().
Referenced by GetLastDecoder().
|
inline |
Returns a decoder for the last Sample currently available.
[out] | oDecoder | This will be updated to decode the last sample. |
[out] | tmSampleTime | Theis will be updated to the Sample timestamp |
true | A sample was available and the oDecoder instance has been updated. |
false | No sample was available. |
Definition at line 132 of file codec_sample_streamer.h.
References adtf::streaming::get_sample_time(), IS_FAILED, cSampleDecoderBase::IsValid(), cSampleCodecFactory::MakeDecoderFor(), and THROW_IF_FAILED.
|
inline |
Returns a decoder for the next available Sample.
[out] | oDecoder | This will be updated to decode the next sample. |
true | A sample was available and the oDecoder instance has been updated. |
false | No sample was available. |
Definition at line 81 of file codec_sample_streamer.h.
References GetNextDecoder().
Referenced by GetNextDecoder().
|
inline |
Returns a decoder for the next available Sample.
[out] | oDecoder | This will be updated to decode the next Sample. |
[out] | tmSampleTime | Theis will be updated to the Sample timestamp |
true | A sample was available and the oDecoder instance has been updated. |
false | No sample was available. |
Definition at line 94 of file codec_sample_streamer.h.
References adtf::streaming::get_sample_time(), IS_FAILED, cSampleDecoderBase::IsValid(), cSampleCodecFactory::MakeDecoderFor(), and THROW_IF_FAILED.
|
inline |
Sets a callback that will be called for each new Stream Type.
[in] | fnAcceptTypeCallback | The callback. If you do not accept the new Stream Type return an error from this. The reader will discard samples until you accept a Stream Type. |
Definition at line 70 of file codec_sample_streamer.h.
|
inlineoverridevirtual |
Sets the initial stream type of a streamer.
[in] | pStreamType | The stream type |
Reimplemented from cSampleReader.
Definition at line 53 of file codec_sample_streamer.h.
References cSampleCodecFactory::cSampleCodecFactory(), adtf::mediadescription::osborn::get_codec_factory_from_stream_type(), RETURN_IF_FAILED, and RETURN_NOERROR.
|
private |
Definition at line 152 of file codec_sample_streamer.h.