9#ifdef USE_ADTF_MEDIA_DESCRIPTION_LEGACY
10 #ifndef NO_ADTF_MEDIA_DESCRIPTION_LEGACY
58#ifndef NO_ADTF_MEDIA_DESCRIPTION_LEGACY
211 return getDecoder()->template getElementValue<T>(oCodecIndex);
213 catch (
const std::exception&)
245 return getDecoder()->template getElementValue<T>(oLeafCodecIndex);
247 catch (
const std::exception&)
336 return m_pBuffer->GetPtr();
345 return m_pBuffer->GetSize();
353 m_oStaticDecoder(std::move(oDecoder)), m_pBuffer(std::move(pBuffer))
391#ifndef NO_ADTF_MEDIA_DESCRIPTION_LEGACY
487 getCodec()->template setElementValue<T>(oCodecIndex, oValue);
489 catch (
const std::exception&)
526 getCodec()->template setElementValue<T>(oLeafCodecIndex, oValue);
528 catch (
const std::exception&)
597 return m_pBuffer->GetPtr();
605 return m_pBuffer->GetPtr();
614 return m_pBuffer->GetSize();
622 m_oStaticCodec(std::move(oDecoder)), m_pBuffer(std::move(pBuffer)), m_oFirstElement(
tCodecIndex(), *this)
676 return m_pBuffer->GetPtr();
685 return m_pBuffer->GetSize();
693 m_oDecoder(std::move(oDecoder)), m_pBuffer(std::move(pBuffer))
730#ifndef NO_ADTF_MEDIA_DESCRIPTION_LEGACY
766 getCodec()->template setElementValue<T>(oCodecIndex, oValue);
768 catch (
const std::exception&)
805 getCodec()->template setElementValue<T>(oLeafCodecIndex, oValue);
807 catch (
const std::exception&)
937 return m_pBuffer->GetPtr();
945 return m_pBuffer->GetPtr();
954 return m_pBuffer->GetSize();
961 m_oCodec(std::move(oDecoder)), m_pBuffer(std::move(pBuffer)), m_oFirstElement(
tCodecIndex(), *this)
996 const char* strMediaDescription,
1055#ifndef NO_ADTF_MEDIA_DESCRIPTION_LEGACY
1323 return MakeCodecFor(oSample, m_eDefaultDataRepresentation);
1344template<
typename ElementsType>
1345using element_callback = std::function<void(std::conditional_t<std::is_const<ElementsType>::value,
1346 const typename ElementsType::element_type,
1347 typename ElementsType::element_type>&)>;
1352template<
typename ElementsType>
1354 const typename ElementsType::element_type,
1355 typename ElementsType::element_type>&)>;
1361template<
typename ElementsType>
1363 const typename ElementsType::element_type,
1364 typename ElementsType::element_type>&,
1370template<
typename ElementsType>
1372 const typename ElementsType::element_type,
1373 typename ElementsType::element_type>&,
1413template<
typename ElementsType>
1416 for (
auto& oCurrentElement : oElements)
1418 if (oCurrentElement.hasChildren())
1420 if (oCurrentElement.isArray())
1422 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1424 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1425 auto& children = oArrayElement.getChildElements();
1431 auto& children = oCurrentElement.getChildElements();
1437 if (oCurrentElement.isArray())
1439 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1441 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1442 fnCallback(oArrayElement);
1447 fnCallback(oCurrentElement);
1462 std::vector<tCodecIndex> oIndices;
1464 [&oIndices](
const auto& oElement) { oIndices.push_back(oElement.getIndex()); });
1512template<
typename ElementsType>
1515 for (
auto& oCurrentElement : oElements)
1517 fnCallback(oCurrentElement);
1518 if (oCurrentElement.hasChildren())
1536template<
typename ElementsType>
1544 for (
auto& oCurrentElement : oElements)
1546 if (fnEnterMemberCallback(oCurrentElement))
1548 if (oCurrentElement.hasChildren())
1550 if (oCurrentElement.isArray())
1552 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1554 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1555 if (fnEnterArrayMemberCallback(oArrayElement, szArrayPos))
1557 auto& children = oArrayElement.getChildElements();
1559 fnLeaveMemberCallback, fnEnterArrayMemberCallback,
1560 fnLeaveArrayMemberCallback);
1561 fnLeaveArrayMemberCallback(oArrayElement, szArrayPos);
1567 auto& children = oCurrentElement.getChildElements();
1569 fnEnterArrayMemberCallback, fnLeaveArrayMemberCallback);
1574 if (oCurrentElement.isArray())
1576 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1578 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1579 if (fnEnterArrayMemberCallback(oArrayElement, szArrayPos))
1581 fnLeafCallback(oArrayElement);
1582 fnLeaveArrayMemberCallback(oArrayElement, szArrayPos);
1588 fnLeafCallback(oCurrentElement);
1591 fnLeaveMemberCallback(oCurrentElement);
1608 switch (oCodecIndex.
getType())
1623 return adtf_util::cVariant();
1634template<
typename ElementsType>
1635using element_callback = std::function<void(std::conditional_t<std::is_const<ElementsType>::value,
1636 const typename ElementsType::element_type,
1637 typename ElementsType::element_type>&,
1643template<
typename ElementsType>
1645 const typename ElementsType::element_type,
1646 typename ElementsType::element_type>&,
1653template<
typename ElementsType>
1655 const typename ElementsType::element_type,
1656 typename ElementsType::element_type>&,
1663template<
typename ElementsType>
1665 const typename ElementsType::element_type,
1666 typename ElementsType::element_type>&,
1685template<
typename ElementsType>
1699template<
typename ElementsType>
1701 const typename ElementsType::element_type,
1702 typename ElementsType::element_type>& oCurrentElement,
1711 if (fnEnterMemberCallback(oCurrentElement, oModelElement))
1713 if (oCurrentElement.hasChildren())
1715 const auto& oChildModelElements =
1718 if (oCurrentElement.isArray())
1720 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1722 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1723 if (fnEnterArrayMemberCallback(oArrayElement, szArrayPos, oModelElement))
1726 oArrayElement.getChildElements(), oChildModelElements, oDataDefinition, fnLeafCallback,
1727 fnEnterMemberCallback, fnLeaveMemberCallback, fnEnterArrayMemberCallback,
1728 fnLeaveArrayMemberCallback);
1730 fnLeaveArrayMemberCallback(oArrayElement, szArrayPos, oModelElement);
1737 oDataDefinition, fnLeafCallback, fnEnterMemberCallback,
1738 fnLeaveMemberCallback, fnEnterArrayMemberCallback,
1739 fnLeaveArrayMemberCallback);
1744 if (oCurrentElement.isArray())
1746 for (
size_t szArrayPos = 0; szArrayPos < oCurrentElement.getArraySize(); ++szArrayPos)
1748 auto oArrayElement = oCurrentElement.getArrayElement(szArrayPos);
1749 if (fnEnterArrayMemberCallback(oArrayElement, szArrayPos, oModelElement))
1751 fnLeafCallback(oArrayElement, oModelElement);
1752 fnLeaveArrayMemberCallback(oArrayElement, szArrayPos, oModelElement);
1758 fnLeafCallback(oCurrentElement, oModelElement);
1761 fnLeaveMemberCallback(oCurrentElement, oModelElement);
1768template<
typename ElementsType>
1779 if (oElements.size() > oModelElements.
getSize())
1782 "The amount of the model elements does not match the amount of the codec elements.");
1785 auto itModelElement = oModelElements.
begin();
1787 for (
auto& oCurrentElement : oElements)
1789 detail::for_each_element_infix<ElementsType>(oCurrentElement, *itModelElement->get(), oDataDefinition,
1790 fnLeafCallback, fnEnterMemberCallback, fnLeaveMemberCallback,
1791 fnEnterArrayMemberCallback, fnLeaveArrayMemberCallback);
1798using osborn::cStaticSampleDecoder;
1799using osborn::cStaticSampleCodec;
1800using osborn::cSampleDecoder;
1801using osborn::cSampleCodec;
1802using osborn::cSampleCodecFactory;
#define THROW_ERROR_DESC(_code,...)
throws a tResult exception
Definition result.h:85
#define RETHROW_CURRENT_EXCEPTION()
rethrows the current exception as a tResult, use it in a catch block.
Definition result.h:117
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
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
Utility class for a complete valid data definition of one StructType and its dependencies....
Definition ddstructure.h:57
Iteratable container type for the given Element type in ElementAccessType::element_type.
Definition codec_iterator.h:257
A CodecElement to get and set values.
Definition codec_iterator.h:1221
Definition codec_factory.h:31
ElementType getType() const
Get the elements type if CodecIndex is valid.
A DecoderElement to get values.
Definition codec_iterator.h:969
A FactoryElement.
Definition codec_iterator.h:560
Definition static_codec.h:328
Definition static_codec.h:38
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
Definition dd.h:92
DataDefinition Datamodel This datamodel is observable for any change of:
Definition datamodel_datadefinition.h:64
const StructTypes & getStructTypes() const
Get the Struct Types object.
observable DataDefinition object class for a Element of a StructType.
Definition datamodel_types.h:736
const std::string & getTypeName() const
Get the Type Name.
utility::TypeAccessList< Element, StructType > Elements
container of elements for the StructType::Element.
Definition datamodel_types.h:1177
size_t getSize() const
Get the Size.
Definition access_list.h:504
iterator begin()
the range based begin iterator
Definition access_list.h:514
std::shared_ptr< const DDL_TYPE_TO_ACCESS > get(const std::string &type_name) const
get the item with the given name type_name
Definition access_map.h:202
ddl::codec::LeafCodecIndex tLeafCodecIndex
redefitnion for a ddl::codec::LeafCodecIndex
Definition leaf_sample_codec_access.h:21
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
@ cet_float
Variant type is float.
Definition codec_type_info.h:41
@ cet_int16
Variant type is std::int16_t.
Definition codec_type_info.h:35
@ cet_int8
Variant type is std::int8_t.
Definition codec_type_info.h:33
@ cet_uint64
Variant type is std::uint64_t.
Definition codec_type_info.h:40
@ cet_uint8
Variant type is std::uint8_t.
Definition codec_type_info.h:34
@ cet_uint32
Variant type is std::uint32_t.
Definition codec_type_info.h:38
@ cet_bool
Variant type is bool.
Definition codec_type_info.h:32
@ cet_uint16
Variant type is std::uint16_t.
Definition codec_type_info.h:36
@ cet_int32
Variant type is std::int32_t.
Definition codec_type_info.h:37
@ cet_int64
Variant type is std::int64_t.
Definition codec_type_info.h:39
@ cet_double
Variant type is double.
Definition codec_type_info.h:42
datamodel::StructType StructType
Definition dd.h:59
@ Deserialized
alias names for legacy reasons
Definition data_representation.h:29
DataRepresentation tDataRepresentation
Typedef provided for compatibility reasons.
Definition data_representation.h:32