ADTF
Loading...
Searching...
No Matches
sample_codec_access_types.h
Go to the documentation of this file.
1
7#pragma once
8
9#include "ddl_usage.h"
10#include <string>
11#include <string_view>
12
13namespace adtf
14{
15namespace mediadescription
16{
17namespace osborn
18{
19
25using tCodecLeafIndex = size_t;
26
34
40template<typename AccessType>
42{
43public:
47 typedef AccessType access_type;
64 static element_type getElement(access_type& access, std::string_view full_element_name)
65 {
66 return access.GetElement(full_element_name);
67 }
68
76 static element_type
77 getChildElement(const access_type& access, const index_type& parent_index, std::string_view element_path)
78 {
79 return access.GetChildElement(parent_index, element_path);
80 }
81
88 static element_type getElement(access_type& access, const index_type& index)
89 {
90 return access.GetElement(index);
91 }
92
99 static size_t getChildCount(access_type& access, const index_type& index)
100 {
101 return access.GetElementChildCount(index);
102 }
103
113 static std::string getFullName(access_type& access, const index_type& index)
114 {
115 return access.GetElementFullName(index);
116 }
117
126 static std::string getName(access_type& access, const index_type& index)
127 {
128 return access.GetElementName(index);
129 }
130
140 static std::string getBaseName(access_type& access, const index_type& index)
141 {
142 return access.GetElementBaseName(index);
143 }
144
153 template<typename T>
154 static T getValue(access_type& access, const index_type& index)
155 {
156 return access.template GetElementValue<T>(index);
157 }
158
166 {
167 return access.GetElementVariantValue(index);
168 }
169
177 static std::string getStringValue(access_type& access, const index_type& index)
178 {
179 return access.GetElementStringValue(index);
180 }
181
189 static void getRawValue(access_type& access, const index_type& index, void* value, size_t value_size)
190 {
191 access.GetElementRawValue(index, value, value_size);
192 }
193
200 static const void* getAddress(access_type& access, const index_type& index)
201 {
202 return access.GetElementAddress(index);
203 }
204
212 static void resolve(access_type& access, index_type& index)
213 {
214 return access.Resolve(index);
215 }
216};
217
223template<typename AccessType>
225{
226public:
230 typedef AccessType access_type;
247 static element_type getElement(access_type& access, std::string_view full_element_name)
248 {
249 return access.GetElement(full_element_name);
250 }
251
259 static element_type
260 getChildElement(const access_type& access, const index_type& parent_index, std::string_view element_path)
261 {
262 return access.GetChildElement(parent_index, element_path);
263 }
264
271 static element_type getElement(access_type& access, const index_type& index)
272 {
273 return access.GetElement(index);
274 }
275
284 template<typename T>
285 static void setValue(access_type& access, const index_type& index, const T& value)
286 {
287 access.template SetElementValue<T>(index, value);
288 }
289
296 static void setVariantValue(access_type& access, const index_type& index, const a_util::variant::Variant& value)
297 {
298 access.SetElementVariantValue(index, value);
299 }
300
307 static void setStringValue(access_type& access, const index_type& index, const std::string& value)
308 {
309 access.SetElementStringValue(index, value);
310 }
311
320 static void setRawValue(access_type& access, const index_type& index, const void* value, size_t value_size)
321 {
322 access.SetElementRawValue(index, value, value_size);
323 }
324
331 static void* getAddress(access_type& access, const index_type& index)
332 {
333 return access.GetElementAddress(index);
334 }
335};
336
342template<typename AccessType>
344{
345public:
349 typedef AccessType access_type;
366 static element_type getElement(const access_type& access, std::string_view full_element_name)
367 {
368 return access.GetElement(full_element_name);
369 }
370
378 static element_type
379 getChildElement(const access_type& access, const index_type& parent_index, std::string_view element_path)
380 {
381 return access.GetChildElement(parent_index, element_path);
382 }
383
390 static element_type getElement(const access_type& access, const index_type& index)
391 {
392 return access.GetElement(index);
393 }
394
402 static size_t getChildCount(const access_type& access, const index_type& index)
403 {
404 return access.GetElementChildCount(index);
405 }
406
416 static std::string getFullName(access_type& access, const index_type& index)
417 {
418 return access.GetElementFullName(index);
419 }
420
429 static std::string getName(const access_type& access, const index_type& index)
430 {
431 return access.GetElementName(index);
432 }
433
443 static std::string getBaseName(const access_type& access, const index_type& index)
444 {
445 return access.GetElementBaseName(index);
446 }
447
455 static void resolve(access_type& access, index_type& index)
456 {
457 return access.Resolve(index);
458 }
459};
460
461} // namespace osborn
462
471
472} // namespace mediadescription
473} // namespace adtf
Definition variant.h:46
Implementation for codec access concept (ddl::codec::CodecElementAccess).
Definition sample_codec_access_types.h:225
static void setVariantValue(access_type &access, const index_type &index, const a_util::variant::Variant &value)
Sets the value from value as variant.
Definition sample_codec_access_types.h:296
static element_type getElement(access_type &access, const index_type &index)
Get a element object for the given index.
Definition sample_codec_access_types.h:271
ddl::codec::CodecElement< sample_codec_access< AccessType > > element_type
supported element type.
Definition sample_codec_access_types.h:238
static element_type getElement(access_type &access, std::string_view full_element_name)
Get a element object for the given full_element_name.
Definition sample_codec_access_types.h:247
static element_type getChildElement(const access_type &access, const index_type &parent_index, std::string_view element_path)
Get a child element object for the given index.
Definition sample_codec_access_types.h:260
static void setRawValue(access_type &access, const index_type &index, const void *value, size_t value_size)
Set the value by copying from a value buffer.
Definition sample_codec_access_types.h:320
AccessType access_type
used access type.
Definition sample_codec_access_types.h:230
static void setStringValue(access_type &access, const index_type &index, const std::string &value)
Sets the value from value as string.
Definition sample_codec_access_types.h:307
tCodecIndex index_type
used index type.
Definition sample_codec_access_types.h:234
static void setValue(access_type &access, const index_type &index, const T &value)
Set the value from the given value.
Definition sample_codec_access_types.h:285
static void * getAddress(access_type &access, const index_type &index)
Get the address (with write access)
Definition sample_codec_access_types.h:331
Implementation for codec access concept (ddl::codec::FactoryElementAccess).
Definition sample_codec_access_types.h:344
static size_t getChildCount(const access_type &access, const index_type &index)
Get the Child Count.
Definition sample_codec_access_types.h:402
static std::string getFullName(access_type &access, const index_type &index)
Get the full name of the element within its main structure. If the element is an array you get the el...
Definition sample_codec_access_types.h:416
static element_type getElement(const access_type &access, std::string_view full_element_name)
Get a element object for the given full_element_name.
Definition sample_codec_access_types.h:366
static std::string getBaseName(const access_type &access, const index_type &index)
Get the name of the element within its level structure. If the element is an array you get the elemen...
Definition sample_codec_access_types.h:443
static void resolve(access_type &access, index_type &index)
Resolves the given CodecIndex and set the layout information.
Definition sample_codec_access_types.h:455
static std::string getName(const access_type &access, const index_type &index)
Get the name of the element within its level structure. If the element is an array you get the elemen...
Definition sample_codec_access_types.h:429
static element_type getChildElement(const access_type &access, const index_type &parent_index, std::string_view element_path)
Get a child element object for the given index.
Definition sample_codec_access_types.h:379
static element_type getElement(const access_type &access, const index_type &index)
Get a element object for the given index.
Definition sample_codec_access_types.h:390
ddl::codec::FactoryElement< sample_codec_factory_access< AccessType > > element_type
supported element type.
Definition sample_codec_access_types.h:357
tCodecIndex index_type
Used index type.
Definition sample_codec_access_types.h:353
AccessType access_type
Used access type.
Definition sample_codec_access_types.h:349
Implementation for decoder access concept (ddl::codec::DecoderElementAccess).
Definition sample_codec_access_types.h:42
static T getValue(access_type &access, const index_type &index)
Get the value.
Definition sample_codec_access_types.h:154
static void resolve(access_type &access, index_type &index)
Resolves the given CodecIndex and set the layout information.
Definition sample_codec_access_types.h:212
static element_type getElement(access_type &access, std::string_view full_element_name)
Get a element object for the given full_element_name.
Definition sample_codec_access_types.h:64
static const void * getAddress(access_type &access, const index_type &index)
Get the address.
Definition sample_codec_access_types.h:200
static element_type getChildElement(const access_type &access, const index_type &parent_index, std::string_view element_path)
Get a child element object for the given index.
Definition sample_codec_access_types.h:77
static a_util::variant::Variant getVariantValue(access_type &access, const index_type &index)
Get the value as variant.
Definition sample_codec_access_types.h:165
static std::string getStringValue(access_type &access, const index_type &index)
Get the value as string.
Definition sample_codec_access_types.h:177
static std::string getName(access_type &access, const index_type &index)
Get the name of the element within its level structure. If the element is an array you get the elemen...
Definition sample_codec_access_types.h:126
static std::string getFullName(access_type &access, const index_type &index)
Get the full name of the element within its main structure. If the element is an array you get the el...
Definition sample_codec_access_types.h:113
static size_t getChildCount(access_type &access, const index_type &index)
Get the Child Count.
Definition sample_codec_access_types.h:99
static std::string getBaseName(access_type &access, const index_type &index)
Get the base name of the element within its level structure. If the element is an array you get the e...
Definition sample_codec_access_types.h:140
static void getRawValue(access_type &access, const index_type &index, void *value, size_t value_size)
Get the value by copy to the given value buffer.
Definition sample_codec_access_types.h:189
static element_type getElement(access_type &access, const index_type &index)
Get a element object for the given index.
Definition sample_codec_access_types.h:88
ddl::codec::DecoderElement< sample_decoder_access< AccessType > > element_type
supported element type.
Definition sample_codec_access_types.h:55
tCodecIndex index_type
used index type.
Definition sample_codec_access_types.h:51
AccessType access_type
used access type.
Definition sample_codec_access_types.h:47
A CodecElement to get and set values.
Definition codec_iterator.h:1221
Definition codec_index.h:276
A DecoderElement to get values.
Definition codec_iterator.h:969
A FactoryElement.
Definition codec_iterator.h:560
Namespace for all functionality of the ADTF Mediadescription SDK provided since v3....
Definition codec_sample_streamer.h:24
ddl::codec::CodecIndex tCodecIndex
Definition sample_codec_access_types.h:33
size_t tCodecLeafIndex
Definition sample_codec_access_types.h:25
Namespace for the ADTF Mediadescription SDK.
Definition codec_sample_streamer.h:22
osborn::tCodecIndex tCodecIndex
Definition sample_codec_access_types.h:470
osborn::tCodecLeafIndex tCodecLeafIndex
Definition sample_codec_access_types.h:466
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14