ADTF
Loading...
Searching...
No Matches
streammetatypeaudio.h
Go to the documentation of this file.
1
7#pragma once
9#include <adtfbase/property.h>
10#include "streamtype.h"
11
13
14namespace adtf
15{
16namespace streaming
17{
18namespace ant
19{
20
21
29{
31 static constexpr const tChar *const MetaTypeName = "adtf/audio";
32
37 static constexpr const tChar *const FormatName = "format_name";
42 static constexpr const tChar *const ChannelCount = "channel_count";
47 static constexpr const tChar *const SampleRateHz = "sample_rate_hz";
52 static constexpr const tChar *const BitsPerSample = "bits_per_sample";
57 static constexpr const tChar *const SampleCount = "sample_count";
58
64 {
65 pProperties->SetProperty(adtf::base::property<adtf_util::cString>(FormatName, ""));
66 pProperties->SetProperty(adtf::base::property<unsigned int>(ChannelCount, 0));
67 pProperties->SetProperty(adtf::base::property<unsigned int>(SampleRateHz, 0));
68 pProperties->SetProperty(adtf::base::property<unsigned int>(BitsPerSample, 0));
69 pProperties->SetProperty(adtf::base::property<unsigned int>(SampleCount, 0));
70 }
71};
72
73}
74
75namespace lucky
76{
82{
86 adtf_util::cString m_strFormatName;
90 unsigned int m_ui32ChannelCount = 0;
94 unsigned int m_ui32SampleRateHz = 0;
98 unsigned int m_ui32BitsPerSample = 0;
102 unsigned int m_ui32SampleCount = 0;
103};
104
112inline bool operator==(const tStreamAudioFormat& oLeft, const tStreamAudioFormat& oRight)
113{
114 return (oLeft.m_strFormatName == oRight.m_strFormatName)
115 && (oLeft.m_ui32BitsPerSample == oRight.m_ui32BitsPerSample)
116 && (oLeft.m_ui32ChannelCount == oRight.m_ui32ChannelCount)
117 && (oLeft.m_ui32SampleCount == oRight.m_ui32SampleCount)
118 && (oLeft.m_ui32SampleRateHz == oRight.m_ui32SampleRateHz);
119}
120
128inline bool operator!=(const tStreamAudioFormat& oLeft, const tStreamAudioFormat& oRight)
129{
130 return !(oLeft == oRight);
131}
132
133
160
187
193ADTF3_DEPRECATED("Use adtf::ucom::make_object_ptr<stream_type_audio<>>() instead.")
198
206ADTF3_DEPRECATED("Use adtf::ucom::make_object_ptr<stream_type_audio<>>(const tStreamAudioFormat&) instead.")
214
215} //namespace lucky
216
217namespace penguin
218{
226template<typename T = lucky::tStreamAudioFormat>
227class stream_type_audio : public ant::cStreamType
228{
229 static_assert(std::is_same_v<lucky::tStreamAudioFormat, T>,
230 "Currently only T=lucky::tStreamAudioFormat is possible."
231 "To support your own type you need to specialize this template stream_type_audio<T>");
232
233public:
234 stream_type_audio():
236 {
237 }
238 stream_type_audio(const T& sAudioFormat):
240 {
242 }
243};
244} // namespace penguin
245
252
253}
254}
255
256
#define ADTF3_DEPRECATED(_depr_message_)
Definition adtf_base_deprecated.h:27
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
Definition result.h:42
#define THROW_IF_FAILED(s)
throws if the expression returns a failed tResult
Definition result.h:88
Definition properties_v2.h:283
Defines access methods for the interface of a Stream Type.
Definition streamtype_intf.h:96
virtual tResult GetMetaTypeName(base::ant::IString &&strTypeName) const =0
Get the meta type name of this instance.
Definition streamtype.h:276
Generator template to create an instance of a ant::IStreamType class for ant::stream_meta_type_audio ...
Definition streammetatypeaudio.h:228
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
Namespace for all functionality of the ADTF Streaming SDK provided since v3.11.
Definition streammetatypeaudio.h:76
ucom::ant::object_ptr< ant::IStreamType > create_adtf_audio_stream_type()
Definition streammetatypeaudio.h:194
tResult set_stream_type_audio_format(IStreamType &oType, const tStreamAudioFormat &sFormat)
Definition streammetatypeaudio.h:142
bool operator==(const tStreamAudioFormat &oLeft, const tStreamAudioFormat &oRight)
Definition streammetatypeaudio.h:112
bool operator!=(const tStreamAudioFormat &oLeft, const tStreamAudioFormat &oRight)
Definition streammetatypeaudio.h:128
tResult get_stream_type_audio_format(tStreamAudioFormat &sFormat, const IStreamType &oType)
Definition streammetatypeaudio.h:169
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
VALUETYPE get_property(const IStreamType &oStreamType, const char *strNameOfValue, VALUETYPE oDefaultValue)
Definition streamtype_intf.h:287
tResult set_property(IStreamType &oStreamType, const char *strNameOfValue, VALUETYPE oValue)
Definition streamtype_intf.h:257
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:129
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
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
#define adtf_string_intf(__string__)
Definition string_intf.h:465
Use this Stream Meta Type for describing a audio stream with samples and sample rate.
Definition streammetatypeaudio.h:29
static constexpr const tChar *const SampleCount
Name for the Property for number of samples.
Definition streammetatypeaudio.h:57
static constexpr const tChar *const MetaTypeName
StreamMetaTypeName for audiotype (audio stream).
Definition streammetatypeaudio.h:31
static constexpr const tChar *const SampleRateHz
Name for the Property for the sample rate in hz.
Definition streammetatypeaudio.h:47
static void SetProperties(const adtf::ucom::iobject_ptr< adtf::base::IProperties > &pProperties)
Definition streammetatypeaudio.h:63
static constexpr const tChar *const FormatName
Name for the Property of the format name.
Definition streammetatypeaudio.h:37
static constexpr const tChar *const ChannelCount
Name for the Property for the amount of channels.
Definition streammetatypeaudio.h:42
static constexpr const tChar *const BitsPerSample
Name for the Property for number of bits per sample.
Definition streammetatypeaudio.h:52
Definition streammetatypeaudio.h:82
unsigned int m_ui32SampleCount
Definition streammetatypeaudio.h:102
adtf_util::cString m_strFormatName
Definition streammetatypeaudio.h:86
unsigned int m_ui32BitsPerSample
Definition streammetatypeaudio.h:98
unsigned int m_ui32ChannelCount
Definition streammetatypeaudio.h:90
unsigned int m_ui32SampleRateHz
Definition streammetatypeaudio.h:94