ADTF
Loading...
Searching...
No Matches
samplebuffer_intf.h
Go to the documentation of this file.
1
7#pragma once
10
11namespace adtf
12{
13namespace streaming
14{
15namespace ant
16{
17
22{
23 protected:
25 ~ISampleBuffer() = default;
26 public:
28 ADTF_IID(ISampleBuffer, "samplebuffer.ant.streaming.adtf.iid");
29 public:
30
40 virtual tResult Write(const base::ant::IRawMemory& oBufferWrite) = 0;
41
51 virtual tResult Read(base::ant::IRawMemory&& oBufferRead) const = 0;
52
60 virtual void* GetPtr() = 0;
61
68 virtual const void* GetPtr() const = 0;
72 virtual size_t GetSize() const = 0;
76 virtual size_t GetCapacity() const = 0;
77
87 virtual tResult Reserve(size_t szSize) = 0;
88
98 virtual tResult Resize(size_t szSize) = 0;
99};
100
105{
106 protected:
109 public:
111 ADTF_IID(ISampleBufferFactory, "samplebufferfactory.ant.streaming.adtf.iid");
112
113 public:
122 virtual tResult GetBuffer(ucom::ant::iobject_ptr<ISampleBuffer>& pBuffer, size_t szPreAllocateSize) = 0;
123};
124
125} //namespace ant
130} //namespace streaming
131
132namespace base
133{
134namespace ant
135{
136
139template <>
141{
142 static tResult Assign(const ::adtf::streaming::ant::ISampleBuffer* /* pAssignValue */,
143 const size_t /* szStaticSize */,
144 const void* /* pValueToSet */,
145 const size_t /* szSizeToSet */)
146 {
147 RETURN_ERROR_DESC(ERR_ACCESS_DENIED, "Const Variant. NoAssignment possible");
148 }
149 static const void* GetPtr(const ::adtf::streaming::ant::ISampleBuffer* pAssignValue)
150 {
151 return pAssignValue->GetPtr();
152 }
153 static size_t GetSize(const ::adtf::streaming::ant::ISampleBuffer* pAssignValue, const size_t /* szStaticSize */)
154 {
155 return pAssignValue->GetSize();
156 }
157};
158
159} // namespace ant
160} // namespace base
161} // namespace adtf
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
Definition result.h:44
Definition rawmemory_base.h:23
Definition samplebuffer_intf.h:105
~ISampleBufferFactory()=default
not destructable
virtual tResult GetBuffer(ucom::ant::iobject_ptr< ISampleBuffer > &pBuffer, size_t szPreAllocateSize)=0
ADTF_IID(ISampleBufferFactory, "samplebufferfactory.ant.streaming.adtf.iid")
defintion of interfac id
Definition samplebuffer_intf.h:22
ADTF_IID(ISampleBuffer, "samplebuffer.ant.streaming.adtf.iid")
Defintion of interface ID.
virtual tResult Reserve(size_t szSize)=0
virtual size_t GetSize() const =0
virtual tResult Read(base::ant::IRawMemory &&oBufferRead) const =0
~ISampleBuffer()=default
not destructable
virtual tResult Write(const base::ant::IRawMemory &oBufferWrite)=0
virtual tResult Resize(size_t szSize)=0
virtual size_t GetCapacity() const =0
virtual const void * GetPtr() const =0
Definition object_intf.h:33
Definition lockedobject_intf.h:60
Base object pointer to realize binary compatible reference counting in interface methods.
Definition object_ptr_intf.h:112
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for all functionality of the ADTF Streaming SDK provided since v3.0.
Definition bindingproxyoutport.h:16
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
Definition rawmemory_base.h:91
static size_t GetSize(const T *pAssignValue, const size_t szStaticSize)
Definition rawmemory_base.h:137
static tResult Assign(T *pAssignValue, const size_t szStaticSize, const void *pValueToSet, const size_t szSizeToSet)
Definition rawmemory_base.h:105
static const void * GetPtr(const T *pAssignValue)
Definition rawmemory_base.h:121