The ISample interface sets and retrieves properties on samples .
More...
|
| ~ISample ()=default |
| not destructable
|
|
| ~IObject ()=default |
| Protected destructor --> Use implemented Destroy() instead of delete!
|
|
The ISample interface sets and retrieves properties on samples .
For information on realtime safety please have a look at the documentation of the default implementation adtf::streaming::ant::cSample.
- See also
- Sample.
Definition at line 34 of file sample_intf.h.
◆ eFlags
serval flags are defined All undefined bits are reserved for future and internal use.
Enumerator |
---|
SF_None | No flags are set.
|
SF_SyncPoint | Determines if the sample marks a synchronization point.
Synchronization points can be used to seek inside the sample stream for things like key video frames. This flag will only be recognized by the HarddiskRecorder at the moment. Samples with this flag set will be set as IndexTable entry within the DAT File.
Use this flag with care!
|
SF_AbsoluteTime | This flag has no effect and is only remaining due to code and binary compatibility purpose!
|
SF_DataFromADTF1 | If old ADTF V1.x data is stored, this flag will be set.
For own Sample implementations, the data has to be converted to ADTF V2 format After conversion, this flag has to be removed.
|
SF_VideoKeyFrame | This flag marks key frames in video streams.
|
SF_SampleLogEnabled | This flag marks that sample supports ISampleLog interface and it is enabled.
|
SF_SampleLogPresent | This flag marks the sample supports the ISampleLog interface and a trace is present from Deserialization! (from network or DAT File !)
|
SF_SampleInfoPresent | This flag marks the sample has the SampleInfo present.
|
SF_AllowBufferSharing | mark that the buffer of this sample can be shared
|
Definition at line 48 of file sample_intf.h.
◆ Get()
Deep copy this sample (source) to the given sample (destination).
- Parameters
-
[out] | oSample | Destination sample |
- Returns
- Standard Result Code
- Return values
-
ERR_ACCESS_DENIED | given oSample is marked as readonly (see ISample::eFlags::SF_ReadOnly) |
◆ GetFlags()
virtual uint32_t GetFlags |
( |
| ) |
const |
|
pure virtual |
Query sample flags.
The flags are XORed.
- Returns
- Flags specified for samples. See ISample::eFlags.
◆ GetSampleBufferFactory()
Gets the SampleBufferFactory the Sample will ask for SampleBuffer to allocate.
- See also
- Default implementation in cSample.
- Parameters
-
[out] | oFactory | The buffer factory of the sample |
- Returns
- Standard Result Code
◆ GetSampleInfo() [1/2]
Gets the ISampleInfo of the sample.
- Parameters
-
[out] | oSampleInfo | The sample info of the buffer |
- Returns
- Standard Result Code
◆ GetSampleInfo() [2/2]
Gets the ISampleInfo of the sample.
- Parameters
-
[out] | oSampleInfo | The sample info of the buffer |
- Returns
- Standard Result Code
◆ GetTime()
Retrieves the SampleTimeS (of StreamTime) of this sample.
The GetTime method retrieves the SampleTimeS (of StreamTime) of this sample.
- Returns
- Returns the SampleTimeS (of StreamTime) of this sample (see also Clock Concept for further infomation).
- See also
- Clock Concept
◆ Lock()
Obtains a valid read-only reference to the sample buffer.
The Lock method obtains a valid reference to the sample buffer.
- Parameters
-
[out] | oSampleBuffer | reference to set the buffer |
- Return values
-
ERR_POINTER | oSampleBuffer.Reset failed |
ERR_NOERROR | everything is OK |
Referenced by adtf::streaming::ant::read_from_sample().
◆ Reset()
Resets the whole sample content.
- Returns
- Standard Result Code
- Return values
-
ERR_ACCESS_DENIED | given sample is marked as readonly (see ISample::eFlags::SF_ReadOnly) |
◆ Set() [1/2]
Deep copy the given sample (source) to this sample (destination).
- Parameters
-
[in] | oSample | Source sample. |
- Returns
- Standard Result Code
- Return values
-
ERR_ACCESS_DENIED | sample is marked as readonly (see ISample::eFlags::SF_ReadOnly) |
◆ Set() [2/2]
virtual tResult Set |
( |
tTimeStamp |
tmTimeStamp, |
|
|
const void * |
pData, |
|
|
size_t |
szSize, |
|
|
uint32_t |
ui32Flags = 0 |
|
) |
| |
|
pure virtual |
Sets the internal sample data and timestamp.
The method sets the internal data structures to new values. This is mainly used to deliver buffered sample data using preallocated sample objects.
- Parameters
-
tmTimeStamp | [in] SampleTimestamp of (should be StreamTime). |
pData | [in] Pointer to the sample data which will be copied to it buffer. |
szSize | [in] Size of sample data, in bytes. |
ui32Flags | [in] Specifies the sample flags XORed. |
- Return values
-
ERR_ACCESS_DENIED | ISample::eFlags::SF_ReadOnly is set. |
ERR_NOERROR | everything is OK |
- See also
- Clock Concept
◆ SetFlags()
virtual tResult SetFlags |
( |
uint32_t |
ui32Flags | ) |
|
|
pure virtual |
Specify sample flags.
The flags are XORed.
- Parameters
-
ui32Flags | [in] Flag that specifies if the sample is a sync point or not. See ISample::eFlags. |
- Return values
-
ERR_NOERROR | everything is OK |
ERR_ACCESS_DENIED | ISample::eFlags::SF_ReadOnly is set. |
◆ SetTime()
Sets the SampleTimeStamp (of StreamTime).
- Parameters
-
[in] | tmTimeStamp | given timestamp (see also Clock Concept for further information on Times and StreamTime) |
- Return values
-
ERR_ACCESS_DENIED | ISample::eFlags::SF_ReadOnly is set |
ERR_NOERROR | Time set |
- See also
- Clock Concept
◆ WriteLock()
Obtains a valid reference to the sample buffer for writing access.
The WriteLock method obtains a valid reference to the sample buffer.
- Warning
- You must unlock the sample buffer before calling any write/flush call to the cSampleWriter. Otherwise it could be possible on synchronous calls the write lock is still valid while a reader wants to read from the buffer. This would fail.
- Parameters
-
[out] | pSampleBuffer | reference to the current sample buffer with writing access |
[in] | szPreAllocateSize | If unequal to 0, will resize the the sample buffer to this size immediately. Otherwise the buffer is not modified at all. |
- Return values
-
ERR_POINTER | pSampleBuffer is not valid |
ERR_ACCESS_DENIED | sample is marked as readonly (see ISample::eFlags::SF_ReadOnly) |
ERR_NOERROR | everything is OK |
Referenced by adtf::streaming::ant::write_to_sample().