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

Sample Writer that provides samples that can be updated via a Codec. More...

#include <codec_sample_streamer_legacy.h>

Inheritance diagram for encoding_sample_writer< WriterImplementation >:
[legend]

Public Member Functions

cSampleWithCodec MakeSample (base::flash::tNanoSeconds tmTimeStamp)
 Creates a new Sample with an attached Sample Codec.
 
tResult SetType (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType) override
 Sets the initial stream type of a streamer.
 
tResult ChangeType (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType) override
 Communicates a type change for all following samples.
 
tResult Write (cSampleWithCodec &oSampleWithCodec)
 Write a sample to the attached Sample Stream.
 
- Public Member Functions inherited from cSampleWriter
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.
 
tResult Write (const ucom::ant::iobject_ptr< const ant::ISample > &pSample) override
 Writes a sample to the connected sample stream.
 
virtual tResult Transmit (const ucom::ant::iobject_ptr< const ant::ISample > &pSample)
 For compatibility purposes, call Write() instead.
 
tResult Flush () override
 Flushes the writer.
 
tResult SetStreamError (tResult oError) override
 Reports and handles an error via the sample stream.
 
tResult ManualTrigger (base::flash::tNanoSeconds tmActivationTime=base::flash::tNanoSeconds {-1}) override
 Calls all connected runners synchronously in this call.
 
- Public Member Functions inherited from cSampleCodecFactory
 cSampleCodecFactory (const cStructureType &oTypeDefinition)
 
 cSampleCodecFactory (const streaming::ant::IStreamType &oStreamType)
 
 cSampleCodecFactory (const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pStreamType)
 
size_t FindIndex (const char *strElementName) const
 
size_t FindArrayIndex (const char *strArrayName) const
 
size_t FindStructIndex (const char *strStructName) const
 
const adtf_ddl::tStructElementGetStaticElement (size_t nElementIndex) const
 
 cSampleCodecFactory (const char *strStructName, const char *strMediaDescription, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that take a DDL string for initialization.
 
 cSampleCodecFactory (const adtf_ddl::cDDLComplex *pStruct, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that uses an OO-DDL struct for initialization.
 
 cSampleCodecFactory (cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (const cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (cSampleCodecFactory &&)=default
 Move constructor.
 
tResult GetStaticElement (size_t nIndex, const adtf_ddl::tStructElement *&pElement) const
 Access information about an element.
 
- Public Member Functions inherited from cSampleCodecFactory
 cSampleCodecFactory ()=default
 Empty constructor.
 
 cSampleCodecFactory (const char *strStructName, const char *strMediaDescription, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that take a DDL string for initialization.
 
 cSampleCodecFactory (const adtf_ddl::cDDLComplex *pStruct, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
 Constructor that uses an OO-DDL struct for initialization.
 
 cSampleCodecFactory (cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (const cSampleCodecFactory &)=default
 Copy constructor.
 
 cSampleCodecFactory (cSampleCodecFactory &&)=default
 Move constructor.
 
cSampleCodecFactoryoperator= (cSampleCodecFactory &)=default
 assignment operator
 
cSampleCodecFactoryoperator= (cSampleCodecFactory &&)=default
 Move assignment operator.
 
tResult IsValid () const
 Check if the factory is in a valid state.
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static decoder for the given sample.
 
cStaticSampleCodec MakeStaticCodecFor (adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static codec for the given sample.
 
cSampleDecoder MakeDecoderFor (const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a decoder for the given sample.
 
cSampleCodec MakeCodecFor (adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a codec for the given sample.
 
size_t GetStaticElementCount () const
 
tResult GetStaticElement (size_t nIndex, const adtf_ddl::tStructElement *&pElement) const
 Access information about an element.
 
size_t GetStaticBufferSize (adtf_ddl::tDataRepresentation eRep=adtf_ddl::tDataRepresentation::Deserialized) const
 
adtf_ddl::tDataRepresentation GetDefaultDataRepresentation () const
 
cStaticSampleDecoder MakeStaticDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static decoder for the given sample.
 
cSampleDecoder MakeDecoderFor (const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a decoder for the given sample.
 
cStaticSampleCodec MakeStaticCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
 Creates a static codec for the given sample.
 
cSampleCodec MakeCodecFor (const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_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.
 

Additional Inherited Members

- Public Types inherited from cSampleCodecFactory
typedef adtf_ddl::tStructElement DefinedStructElementType
 
- Static Public Member Functions inherited from cSampleCodecFactory
static const char * GetStaticStructElementName (const adtf_ddl::tStructElement *pElement)
 add for legacy reason
 
- Protected Attributes inherited from cSampleWriter
std::unique_ptr< cImplementation > m_pImplementation
 

Detailed Description

template<typename WriterImplementation = streaming::flash::cSampleWriter>
class adtf::mediadescription::flash::encoding_sample_writer< WriterImplementation >

Sample Writer that provides samples that can be updated via a Codec.

See Media Description Data Generator Filter Plugin for an example usage.

Definition at line 198 of file codec_sample_streamer_legacy.h.

Member Function Documentation

◆ ChangeType()

template<typename WriterImplementation = streaming::flash::cSampleWriter>
tResult ChangeType ( const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > & pType)
inlineoverridevirtual

Communicates a type change for all following samples.

Parameters
[in]pTypeThe new stream type
Returns
Standard result. Errors will be reported via the associated sample stream.

Reimplemented from cSampleWriter.

Definition at line 232 of file codec_sample_streamer_legacy.h.

References adtf::mediadescription::get_codec_factory_from_stream_type(), RETURN_IF_FAILED, and RETURN_NOERROR.

◆ MakeSample()

template<typename WriterImplementation = streaming::flash::cSampleWriter>
cSampleWithCodec MakeSample ( base::flash::tNanoSeconds tmTimeStamp)
inline

Creates a new Sample with an attached Sample Codec.

Parameters
[in]tmTimeStampThe sample timestamp.
Returns
The new sample with an attached Sample Codec.

Definition at line 208 of file codec_sample_streamer_legacy.h.

References adtf::streaming::alloc_sample(), cSampleCodecFactory::MakeCodecFor(), and THROW_IF_FAILED.

◆ SetType()

template<typename WriterImplementation = streaming::flash::cSampleWriter>
tResult SetType ( const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > & pStreamType)
inlineoverridevirtual

Sets the initial stream type of a streamer.

Parameters
[in]pStreamTypeThe stream type
Returns
Standard result.

Reimplemented from cSampleWriter.

Definition at line 217 of file codec_sample_streamer_legacy.h.

References adtf::mediadescription::get_codec_factory_from_stream_type(), RETURN_IF_FAILED, and RETURN_NOERROR.

◆ Write()

template<typename WriterImplementation = streaming::flash::cSampleWriter>
tResult Write ( cSampleWithCodec & oSampleWithCodec)
inline

Write a sample to the attached Sample Stream.

Parameters
[in]oSampleWithCodecThe sample that you created with MakeSample(). This calls cSampleWithCodec::Release(), so do not call any further methods of the sample afterwards.
Returns
Standard result.

Definition at line 248 of file codec_sample_streamer_legacy.h.

References cSampleWithCodec::Release(), and Write().

Referenced by Write().