ADTF
Loading...
Searching...
No Matches
samplestream.h
Go to the documentation of this file.
1
7#pragma once
8#include "samplestream_intf.h"
11#include "streamtype.h"
14#include "triggerpipe_intf.h"
15#include "triggerpipe.h"
17
18#include <adtfbase/adtf_base.h>
20
21#include <memory>
22
23namespace adtf
24{
25namespace streaming
26{
27namespace ant
28{
29namespace detail
30{
39 public adtf::base::ant::runnable<adtf::base::IRunnable::RUN_TRIGGER>
40{
42 A_UTILS_D(cSampleStreamBase)
43
45
46protected:
55
56public:
60 virtual ~cSampleStreamBase() override;
61
67
68public:
71 tResult Open(const char* strName,
73 const adtf::ucom::ant::iobject_ptr<const IStreamType>& pInitialAcceptedStreamType,
74 ISampleStream::IPushReadEventSink*& pPushEventSink,
76 size_t szQueueSize,
98 tResult Open(const char* strName,
101 size_t szQueueSize,
102 adtf::ucom::ant::IObject* pParent);
103
106
113 tTimeStamp GetTime() const;
120
126 tResult SetFullName(const char* strName);
127
131 tResult RunTrigger(tTimeStamp tmActivationTime);
132
139
144 void SetSubStreamFilter(const char* strSubStream);
145
149 uint64_t GetItemCount();
150
157 void BlockSampleStreaming(bool bBlock);
158
165
171
177 void EnableSampleSizeStatistics(bool bEnable);
178
183
188 void LogInputTrigger(tTimeStamp tmTrigger);
189
194 void LogOutputTrigger(tTimeStamp tmTrigger);
195};
196} // namespace detail
197
202template<typename INTERFACE = ISampleStream>
203class sample_stream : public trigger_pipe_item<ant::INamedGraphObject, ISampleStream, INTERFACE>
204{
206
207protected:
208 sample_stream(sample_stream&&) = delete;
209 sample_stream(const sample_stream&) = delete;
210 sample_stream& operator=(sample_stream&&) = delete;
211 sample_stream& operator=(const sample_stream&) = delete;
212
213public:
214 sample_stream()
215 {
216 base_type::SetRunnable(static_cast<base::ant::IRunnable&>(m_oBase));
217 }
218 sample_stream(const char* strName): sample_stream()
219 {
220 SetName(strName);
221 }
222 ~sample_stream() = default;
223
224 tResult SetName(const char* strName) override
225 {
226 RETURN_IF_FAILED(base_type::SetName(strName));
227 return m_oBase.SetFullName(strName);
228 }
229
230 tResult SetParent(const ucom::ant::IObject* oParentObject) override
231 {
232 RETURN_IF_FAILED(base_type::SetParent(oParentObject));
233 return m_oBase.SetFullName(get_named_graph_object_full_name(*this));
234 }
235
236 tResult Open(const char* strName,
238 const adtf::ucom::ant::iobject_ptr<const IStreamType>& pInitialAcceptedStreamType,
239 ISampleStream::IPushReadEventSink*& pPushEventSink,
241 size_t szQueueSize) override
242 {
243 return m_oBase.Open(strName, pInStream, pInitialAcceptedStreamType, pPushEventSink, ui32Mode, szQueueSize,
245 }
246
247 tResult Open(const char* strName,
250 size_t szQueueSize) override
251 {
252 return m_oBase.Open(strName, pOutStream, ui32Mode, szQueueSize,
254 }
255
256 tResult GetType(adtf::ucom::ant::iobject_ptr<const IStreamType>& pStreamType) const override
257 {
258 return m_oBase.GetType(pStreamType);
259 }
260
265 tTimeStamp GetTime() const override
266 {
267 return m_oBase.GetTime();
268 }
269
270 tResult SetStreamError(const tResult& oError) override
271 {
272 return m_oBase.SetStreamError(oError);
273 }
274
276 {
277 return m_oBase.AttachRouting(pSampleStreamTo);
278 }
279
281 {
282 return m_oBase.DetachRouting(pSampleStreamTo);
283 }
284
285private:
287};
288
292class cSampleStream : public sample_stream<ISampleStream>
293{
295 A_UTILS_D(cSampleStream)
296
297public:
299 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
300
301public:
303 template<typename T>
305
306protected:
308 cSampleStream(const cSampleStream&) = delete;
315
316public:
318 cSampleStream() = default;
320 cSampleStream(const char* strName)
321 {
322 sample_stream::SetName(strName);
323 }
324
325 virtual ~cSampleStream() = default;
326};
327
328} // namespace ant
329
330namespace flash
331{
332
333class cSampleStream :
334 public trigger_pipe_item<ant::INamedGraphObject, hollow::IInternalBindingProxy, ant::ISampleStream>
335{
336public:
337 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
338
339public:
340 cSampleStream();
341 cSampleStream(const char* strName);
342
343 ~cSampleStream() override;
344
345public:
346 tResult GetStreamError();
347 tResult GetType(ucom::ant::iobject_ptr<const ant::IStreamType>& pStreamType) const override;
348 tTimeStamp GetTime() const override;
349 tResult SetStreamError(const tResult& oError) override;
350 tResult AttachRouting(const ucom::ant::iobject_ptr<ant::ISampleStream>& pSampleStreamTo) override;
351 tResult DetachRouting(const ucom::ant::iobject_ptr<ant::ISampleStream>& pSampleStreamTo) override;
352 tResult Open(const char* strName,
354 const ucom::ant::iobject_ptr<const ant::IStreamType>& pInitialAcceptedStreamType,
357 size_t szQueueSize) override;
358 tResult Open(const char* strName,
361 size_t szQueueSize) override;
362
363 tResult GetInternalBindingProxy(ucom::ant::iobject_ptr<ant::IBindingProxy>& pBindingProxy) override;
364 void SetSubStreamFilter(const char* strSubStream);
365 void SetForwardAllTriggers(bool bForwardAll);
366
367public:
368 tResult SetName(const char* strName);
369 tResult SetParent(const ucom::ant::IObject* oParentObject);
370
371protected:
372 class cImplementation;
373 std::unique_ptr<cImplementation> m_pImplementation;
374};
375
376} // namespace flash
377
378namespace quiet
379{
380
382
383} // namespace quiet
384
385namespace vision
386{
387
388class cSampleStream : public ucom::catwo::object<quiet::cSampleStream, IBlockableSampleStream>
389{
390public:
391 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
392
393public:
394 cSampleStream();
395 cSampleStream(const char* strName);
396
397 ~cSampleStream() override;
398
399 void BlockSampleStreaming(bool bBlock) override;
400 bool IsSampleStreamingBlocked() const override;
401};
402
403} // namespace vision
404
405namespace wolverine
406{
407
408class cSampleStream : public ucom::catwo::object<vision::cSampleStream, ISampleStreamStatistics>
409{
410public:
411 ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream");
412
413public:
414 cSampleStream();
415 cSampleStream(const char* strName);
416
417 ~cSampleStream() override;
418
419public: // implements ISampleStreamStatistics
420 tSampleStreamStatistic GetStatistics() override;
421 void EnableSampleSizeStatistics(bool bEnable) override;
422 void ResetStatistics() override;
423};
424
425} // namespace wolverine
426
428using wolverine::cSampleStream;
429using ant::sample_stream;
430
431} // namespace streaming
432} // namespace adtf
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Definition class_id.h:33
Definition runnable_intf.h:27
adtf::services::wolverine::ISampleStreamTracer::tTraceData tSampleStreamStatistic
structure containing the current samplestream statistics for samplestream input and output
Definition samplestream_statistics_intf.h:34
tMode
Definition samplestreamaccess_intf.h:26
virtual ~cSampleStream()=default
DTOR.
cSampleStream(const cSampleStream &)=delete
deleted copy CTOR
cSampleStream(cSampleStream &&)=delete
deleted move CTOR
adtf::ucom::ant::iobject_ptr< T > iobject_ptr
used type for iobject_ptr
Definition samplestream.h:304
cSampleStream & operator=(const cSampleStream &)=delete
deleted copy operator
ADTF_CLASS_ID_NAME(cSampleStream, "sample_stream.streaming.adtf.cid", "Sample Stream")
private d-pointer
cSampleStream(const char *strName)
CTOR initializes the name of the stream.
Definition samplestream.h:320
cSampleStream & operator=(cSampleStream &&)=delete
deleted move operator
tResult GetInternalBindingProxy(ucom::ant::iobject_ptr< ant::IBindingProxy > &pBindingProxy)
tResult GetType(adtf::ucom::ant::iobject_ptr< const IStreamType > &pStreamType) const
tResult Open(const char *strName, adtf::ucom::ant::iobject_ptr< ISampleInStream > &pInStream, const adtf::ucom::ant::iobject_ptr< const IStreamType > &pInitialAcceptedStreamType, ISampleStream::IPushReadEventSink *&pPushEventSink, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
tResult Open(const char *strName, adtf::ucom::ant::iobject_ptr< ISampleOutStream > &pOutStream, ISampleStreamAccess::tMode ui32Mode, size_t szQueueSize, adtf::ucom::ant::IObject *pParent)
tResult RunTrigger(tTimeStamp tmActivationTime)
tResult DetachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
cSampleStreamBase & operator=(cSampleStreamBase &&)=delete
deleted move operator
tResult GetStreamError()
Getter for the last forwarded stream error.
tResult SetStreamError(const tResult &oError)
cSampleStreamBase & operator=(const cSampleStreamBase &)=delete
deleted copy operator
tResult SetFullName(const char *strName)
ISampleStreamStatistics::tSampleStreamStatistic GetStatistics()
cSampleStreamBase(const cSampleStreamBase &)=delete
deleted copy CTOR
void SetSubStreamFilter(const char *strSubStream)
tResult AttachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo)
cSampleStreamBase(cSampleStreamBase &&)=delete
deleted move CTOR
tResult DetachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) override
Definition samplestream.h:280
tTimeStamp GetTime() const override
Definition samplestream.h:265
tResult AttachRouting(const adtf::ucom::ant::iobject_ptr< ISampleStream > &pSampleStreamTo) override
Definition samplestream.h:275
tResult SetStreamError(const tResult &oError) override
Definition samplestream.h:270
Definition samplestream.h:335
tResult SetName(const char *strName)
Definition triggerpipe.h:422
tResult SetParent(const ucom::ant::IObject *oParentObject)
Definition triggerpipe.h:427
void SetRunnable(adtf::base::ant::IRunnable &oRunnable)
Definition triggerpipe.h:286
Definition object_intf.h:33
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
Definition object.h:397
adtf::base::runnable< DEFAULT_ACTIVATION_TYPE, ANT_INTERFACE, flash::IRunnable, CALLABLE > runnable
Definition runnable.h:231
Namespace for all internally used functionality implemented.
Definition filtergraphport.h:28
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
adtf_util::cString get_named_graph_object_full_name(const INamedGraphObject &oGraphObject)
Namespace for all functionality of the ADTF Streaming SDK provided since v3.5.
Definition filterbase.h:255
Namespace for all functionality of the ADTF Streaming SDK provided since v3.16.
Definition filtergraphport.h:487
Namespace for all functionality of the ADTF Streaming SDK provided since v3.22.
Definition samplestream.h:406
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
InterfacePointerType ucom_cast(ObjectPointerType i_pObject) noexcept
Definition ucom_cast.h:157
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14