ADTF
Loading...
Searching...
No Matches
sample_codec_legacy.h
Go to the documentation of this file.
1
7#pragma once
11#ifdef ADTF3_NO_DEPRECATED_WARNING
12 #ifndef PKG_ADTF_DDL_NO_DEPRECATED_WARNING
13 #define PKG_ADTF_DDL_NO_DEPRECATED_WARNING
14 #endif
15#endif
16#include <pkg_ddl.h>
17
18namespace adtf
19{
20namespace mediadescription
21{
22namespace ant
23{
27class cStaticSampleDecoder : public adtf_ddl::cStaticDecoder
28{
29public:
34
43
44private:
45 friend class cSampleCodecFactory;
47 cStaticSampleDecoder(adtf_ddl::cStaticDecoder&& oDecoder,
49 cStaticDecoder(std::move(oDecoder)), m_pBuffer(std::move(pBuffer))
50 {
51 }
52
53private:
56};
57
61class cStaticSampleCodec : public adtf_ddl::cStaticCodec
62{
63public:
67 cStaticSampleCodec() = default;
68
77
78private:
79 friend class cSampleCodecFactory;
81 cStaticSampleCodec(adtf_ddl::cStaticCodec&& oCodec,
83 cStaticCodec(std::move(oCodec)), m_pBuffer(std::move(pBuffer))
84 {
85 }
86
87private:
90};
91
95class cSampleDecoder : public adtf_ddl::cDecoder
96{
97public:
101 cSampleDecoder() = default;
102
111
112 using adtf_ddl::cDecoder::GetElementValue;
113 adtf::util::cVariant GetElementValue(size_t nElementIndex) const;
114 adtf::util::cVariant GetElementValue(const char* strElementName) const;
115 adtf::util::cString GetElementValueString(size_t nElementIndex) const;
116 adtf::util::cString GetElementValueString(const char* strElementName) const;
117
118 using adtf_ddl::cDecoder::GetElement;
119 const adtf_ddl::tStructElement& GetElement(size_t nElementIndex) const;
120
121private:
122 friend class cSampleCodecFactory;
124 cSampleDecoder(adtf_ddl::cDecoder&& oDecoder,
126 cDecoder(std::move(oDecoder)), m_pBuffer(std::move(pBuffer))
127 {
128 }
129
130private:
133};
134
138class cSampleCodec : public adtf_ddl::cCodec
139{
140public:
144 cSampleCodec() = default;
145
154
155 using adtf_ddl::cCodec::SetElementValue;
156 void SetElementValue(const char* strElementName, const adtf::util::cVariant& oValue);
157
158private:
159 friend class cSampleCodecFactory;
162 cCodec(std::move(oCodec)), m_pBuffer(std::move(pBuffer))
163 {
164 }
165
166private:
169};
170
175{
176public:
182
192 const char* strStructName,
193 const char* strMediaDescription,
194 adtf_ddl::tDataRepresentation eDefaultDataRepresentation = adtf_ddl::tDataRepresentation::Deserialized);
203 const adtf_ddl::cDDLComplex* pStruct,
204 adtf_ddl::tDataRepresentation eDefaultDataRepresentation = adtf_ddl::tDataRepresentation::Deserialized);
205
210
211#ifndef WIN32
212 // the missing const above was an oversight and lead to problems with older GCCs when storing
213 // cSampleCodecFactory in STL containers and pairs.
218#endif
219
224
229
234
240
249 adtf_ddl::tDataRepresentation eDataRepresentation) const;
250
259 adtf_ddl::tDataRepresentation eDataRepresentation) const;
260
269 adtf_ddl::tDataRepresentation eDataRepresentation) const;
270
279 adtf_ddl::tDataRepresentation eDataRepresentation) const;
280
284 size_t GetStaticElementCount() const;
285
292 tResult GetStaticElement(size_t nIndex, const adtf_ddl::tStructElement*& pElement) const;
293
298 size_t GetStaticBufferSize(adtf_ddl::tDataRepresentation eRep = adtf_ddl::tDataRepresentation::Deserialized) const;
299
303 adtf_ddl::tDataRepresentation GetDefaultDataRepresentation() const;
304
305public: // convenience methods
315 adtf_ddl::tDataRepresentation eDataRepresentation) const
316 {
317 return MakeStaticDecoderFor(*pSample.Get(), eDataRepresentation);
318 }
319
328 adtf_ddl::tDataRepresentation eDataRepresentation) const
329 {
330 return MakeDecoderFor(*pSample.Get(), eDataRepresentation);
331 }
332
341 adtf_ddl::tDataRepresentation eDataRepresentation) const
342 {
343 return MakeStaticCodecFor(*pSample.Get(), eDataRepresentation);
344 }
345
354 adtf_ddl::tDataRepresentation eDataRepresentation) const
355 {
356 return MakeCodecFor(*pSample.Get(), eDataRepresentation);
357 }
358
367 {
368 return MakeStaticDecoderFor(*pSample.Get(), m_eDefaultDataRepresentation);
369 }
370
378 {
379 return MakeDecoderFor(*pSample.Get(), m_eDefaultDataRepresentation);
380 }
381
389 {
390 return MakeStaticCodecFor(*pSample.Get(), m_eDefaultDataRepresentation);
391 }
392
400 {
401 return MakeCodecFor(*pSample.Get(), m_eDefaultDataRepresentation);
402 }
403
411 {
412 return MakeStaticDecoderFor(oSample, m_eDefaultDataRepresentation);
413 }
414
422 {
423 return MakeDecoderFor(oSample, m_eDefaultDataRepresentation);
424 }
425
433 {
434 return MakeStaticCodecFor(oSample, m_eDefaultDataRepresentation);
435 }
436
444 {
445 return MakeCodecFor(oSample, m_eDefaultDataRepresentation);
446 }
447
448private:
450 adtf_ddl::cCodecFactory m_oFactory;
452 adtf_ddl::tDataRepresentation m_eDefaultDataRepresentation;
453};
454
455} // namespace ant
456
457namespace flash
458{
462class cSampleCodecFactory : public ant::cSampleCodecFactory
463{
464public:
465 typedef adtf_ddl::tStructElement DefinedStructElementType;
466
467 cSampleCodecFactory() = default;
469
470 cSampleCodecFactory(const cStructureType& oTypeDefinition);
471 cSampleCodecFactory(const streaming::ant::IStreamType& oStreamType);
472 cSampleCodecFactory(const ucom::ant::iobject_ptr<const streaming::ant::IStreamType>& pStreamType);
473
474 size_t FindIndex(const char* strElementName) const;
475 size_t FindArrayIndex(const char* strArrayName) const;
476 size_t FindStructIndex(const char* strStructName) const;
477
479 const adtf_ddl::tStructElement& GetStaticElement(size_t nElementIndex) const;
481 static const char* GetStaticStructElementName(const adtf_ddl::tStructElement* pElement);
482};
483
484} // namespace flash
485
487{
488using flash::cType;
492using flash::structure;
493
499} // namespace adtf_ddl_legacy
500} // namespace mediadescription
501} // namespace adtf
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Definition sample_codec_legacy.h:175
cStaticSampleDecoder MakeStaticDecoderFor(const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
Definition sample_codec_legacy.h:314
cSampleCodecFactory & operator=(cSampleCodecFactory &)=default
cSampleCodecFactory(const adtf_ddl::cDDLComplex *pStruct, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
cSampleDecoder MakeDecoderFor(const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
Definition sample_codec_legacy.h:377
cSampleCodec MakeCodecFor(const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
Definition sample_codec_legacy.h:399
cSampleDecoder MakeDecoderFor(const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
cStaticSampleCodec MakeStaticCodecFor(const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
Definition sample_codec_legacy.h:340
cStaticSampleDecoder MakeStaticDecoderFor(const adtf::streaming::ISample &oSample) const
Definition sample_codec_legacy.h:410
cStaticSampleCodec MakeStaticCodecFor(adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
cSampleCodec MakeCodecFor(adtf::streaming::ISample &oSample) const
Definition sample_codec_legacy.h:443
cStaticSampleCodec MakeStaticCodecFor(adtf::streaming::ISample &oSample) const
Definition sample_codec_legacy.h:432
cSampleCodec MakeCodecFor(adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
cStaticSampleCodec MakeStaticCodecFor(const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample) const
Definition sample_codec_legacy.h:388
cSampleCodecFactory(cSampleCodecFactory &)=default
size_t GetStaticBufferSize(adtf_ddl::tDataRepresentation eRep=adtf_ddl::tDataRepresentation::Deserialized) const
cSampleCodecFactory(const char *strStructName, const char *strMediaDescription, adtf_ddl::tDataRepresentation eDefaultDataRepresentation=adtf_ddl::tDataRepresentation::Deserialized)
cSampleCodec MakeCodecFor(const adtf::ucom::iobject_ptr< adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
Definition sample_codec_legacy.h:353
cSampleCodecFactory & operator=(cSampleCodecFactory &&)=default
cStaticSampleDecoder MakeStaticDecoderFor(const adtf::streaming::ISample &oSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
cSampleCodecFactory(cSampleCodecFactory &&)=default
cStaticSampleDecoder MakeStaticDecoderFor(const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample) const
Definition sample_codec_legacy.h:366
cSampleDecoder MakeDecoderFor(const adtf::ucom::iobject_ptr< const adtf::streaming::ISample > &pSample, adtf_ddl::tDataRepresentation eDataRepresentation) const
Definition sample_codec_legacy.h:327
cSampleCodecFactory(const cSampleCodecFactory &)=default
adtf_ddl::tDataRepresentation GetDefaultDataRepresentation() const
tResult GetStaticElement(size_t nIndex, const adtf_ddl::tStructElement *&pElement) const
cSampleDecoder MakeDecoderFor(const adtf::streaming::ISample &oSample) const
Definition sample_codec_legacy.h:421
Definition sample_codec_legacy.h:139
cSampleCodec & operator=(cSampleCodec &&)=default
cSampleCodec(cSampleCodec &&)=default
Definition sample_codec_legacy.h:96
cSampleDecoder & operator=(cSampleDecoder &&)=default
cSampleDecoder(cSampleDecoder &&)=default
Definition sample_codec_legacy.h:62
cStaticSampleCodec(cStaticSampleCodec &&)=default
cStaticSampleCodec & operator=(cStaticSampleCodec &&)=default
Definition sample_codec_legacy.h:28
cStaticSampleDecoder & operator=(cStaticSampleDecoder &&)=default
cStaticSampleDecoder(cStaticSampleDecoder &&)=default
Definition type_reflection_legacy.h:140
Definition sample_codec_legacy.h:463
static const char * GetStaticStructElementName(const adtf_ddl::tStructElement *pElement)
add for legacy reason
Definition type_reflection_legacy.h:289
Definition type_reflection_legacy.h:87
Definition type_reflection_legacy.h:222
Definition type_reflection_legacy.h:387
Definition sample_intf.h:34
Defines access methods for the interface of a Stream Type.
Definition streamtype_intf.h:96
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
Definition lockedobject_intf.h:207
Definition lockedobject_intf.h:273
Namespace for collect all classes valid before DDL Library switch from the internal to the open sourc...
Definition sample_codec_legacy.h:487
Namespace for all functionality of the ADTF Mediadescription SDK provided since v3....
Definition media_description_type_legacy.h:31
Namespace for the ADTF Mediadescription SDK.
Definition codec_sample_streamer.h:22
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14