|
NVIDIA DeepStream SDK API Reference
|
8.0 Release
|
Go to the documentation of this file.
21 #ifndef DEEPSTREAM_BUFFER_HPP
22 #define DEEPSTREAM_BUFFER_HPP
84 Buffer(
const std::vector<uint8_t>);
112 operator bool()
const;
121 int32_t
chunkId(
unsigned int batchId)
const;
132 virtual size_t read(std::function<
size_t(
const void* data,
size_t len)> callable);
140 virtual size_t write(std::function<
size_t(
void* data,
size_t len)> callable);
178 virtual size_t read(std::function<
size_t(
const void* data,
size_t len)>);
180 virtual size_t write(std::function<
size_t(
void* data,
size_t len)>);
BatchMetadata getBatchMetadata()
virtual size_t read(std::function< size_t(const void *data, size_t len)>)
virtual size_t read(std::function< size_t(const void *data, size_t len)> callable)
Read data from the buffer.
Buffer()
empty buffer constructor
Buffer & operator=(const Buffer &)
Copy assignment.
std::vector< Latency > measureLatency() const
Return latency data of the buffer.
VideoBuffer clone() const
virtual size_t write(std::function< size_t(void *data, size_t len)>)
struct deepstream::_NvDsSourceMeta NvDsSourceMeta
unsigned int source_id
Indicating the source from which the buffer is generated.
size_t size() const
Size of the buffer in bytes.
virtual ~Buffer()
Destructor.
struct _GstBuffer OpaqueBuffer
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
static void wrap(Tensor *)
wrap the tensor to a new buffer
std::vector< int > chunk_ids_
chunk ids, optional
NvBufSurfaceColorFormat format_
Unified definition of latency for a buffer.
int32_t chunkId(unsigned int batchId) const
Chunk id of the buffer.
virtual size_t write(std::function< size_t(void *data, size_t len)> callable)
Write data to the buffer.
OpaqueBuffer * buffer_
opaque buffer pointer
struct deepstream::Buffer::_Latency Latency
Unified definition of latency for a buffer.
virtual Tensor * extract(unsigned int batchId)
create a tensor object with the buffer data
virtual size_t batchSize()
get the batch size of the buffer, 1 for un-batched buffer
unsigned int frame_num
Indicating the frame to which the buffer belongs.
double latency
Latency data.
const NvBufSurfaceColorFormat format() const
VideoBuffer(size_t width, size_t height, NvBufSurfaceColorFormat video_format, NvBufSurfaceMemType memtype, void *mem=nullptr, int gpu_id=0)
void(*)(void *) FreeFunction
Signature of customized function for freeing data in a buffer.
OpaqueBuffer * give()
Give up the ownership of this buffer and return the opaque buffer pointer.
NvBufSurfaceColorFormat
Defines color formats for NvBufSurface.
uint64_t timestamp() const
Timestamp of the buffer.