NVIDIA DeepStream SDK API Reference

8.0 Release
deepstream::VideoBuffer Class Reference

Detailed Description

Definition at line 169 of file buffer.hpp.

Inheritance diagram for deepstream::VideoBuffer:
Collaboration diagram for deepstream::VideoBuffer:

Public Types

typedef struct deepstream::Buffer::_Latency Latency
 Unified definition of latency for a buffer. More...
 
using FreeFunction = void(*)(void *)
 Signature of customized function for freeing data in a buffer. More...
 

Public Member Functions

 VideoBuffer (size_t width, size_t height, NvBufSurfaceColorFormat video_format, NvBufSurfaceMemType memtype, void *mem=nullptr, int gpu_id=0)
 
 VideoBuffer (const Buffer &)
 
virtual size_t read (std::function< size_t(const void *data, size_t len)>)
 
virtual size_t write (std::function< size_t(void *data, size_t len)>)
 
BatchMetadata getBatchMetadata ()
 
size_t width () const
 
size_t height () const
 
const NvBufSurfaceColorFormat format () const
 
VideoBuffer clone () const
 
 operator bool () const
 If the buffer is null. More...
 
size_t size () const
 Size of the buffer in bytes. More...
 
uint64_t timestamp () const
 Timestamp of the buffer. More...
 
int32_t chunkId (unsigned int batchId) const
 Chunk id of the buffer. More...
 
std::vector< LatencymeasureLatency () const
 Return latency data of the buffer. More...
 
OpaqueBuffergive ()
 Give up the ownership of this buffer and return the opaque buffer pointer. More...
 
virtual size_t batchSize ()
 get the batch size of the buffer, 1 for un-batched buffer More...
 
virtual Tensorextract (unsigned int batchId)
 create a tensor object with the buffer data More...
 

Static Public Member Functions

static void wrap (Tensor *)
 wrap the tensor to a new buffer More...
 

Protected Attributes

size_t width_ = 0
 
size_t height_ = 0
 
NvBufSurfaceColorFormat format_
 
OpaqueBufferbuffer_
 opaque buffer pointer More...
 
std::vector< int > chunk_ids_ = { 0 }
 chunk ids, optional More...
 

Member Typedef Documentation

◆ FreeFunction

using deepstream::Buffer::FreeFunction = void(*)(void*)
inherited

Signature of customized function for freeing data in a buffer.

Definition at line 59 of file buffer.hpp.

◆ Latency

Unified definition of latency for a buffer.

Constructor & Destructor Documentation

◆ VideoBuffer() [1/2]

deepstream::VideoBuffer::VideoBuffer ( size_t  width,
size_t  height,
NvBufSurfaceColorFormat  video_format,
NvBufSurfaceMemType  memtype,
void *  mem = nullptr,
int  gpu_id = 0 
)

◆ VideoBuffer() [2/2]

deepstream::VideoBuffer::VideoBuffer ( const Buffer )

Member Function Documentation

◆ batchSize()

virtual size_t deepstream::Buffer::batchSize ( )
virtualinherited

get the batch size of the buffer, 1 for un-batched buffer

◆ chunkId()

int32_t deepstream::Buffer::chunkId ( unsigned int  batchId) const
inherited

Chunk id of the buffer.

◆ clone()

VideoBuffer deepstream::VideoBuffer::clone ( ) const

◆ extract()

virtual Tensor* deepstream::Buffer::extract ( unsigned int  batchId)
virtualinherited

create a tensor object with the buffer data

◆ format()

const NvBufSurfaceColorFormat deepstream::VideoBuffer::format ( ) const
inline

Definition at line 186 of file buffer.hpp.

References format_.

◆ getBatchMetadata()

BatchMetadata deepstream::VideoBuffer::getBatchMetadata ( )

◆ give()

OpaqueBuffer* deepstream::Buffer::give ( )
inherited

Give up the ownership of this buffer and return the opaque buffer pointer.

Referenced by deepstream::EnsembleRender::consume().

◆ height()

size_t deepstream::VideoBuffer::height ( ) const
inline

Definition at line 185 of file buffer.hpp.

References height_.

◆ measureLatency()

std::vector<Latency> deepstream::Buffer::measureLatency ( ) const
inherited

Return latency data of the buffer.

Referenced by deepstream::NvDsMeasureLatency::handleBuffer().

◆ operator bool()

deepstream::Buffer::operator bool ( ) const
inherited

If the buffer is null.

◆ read()

virtual size_t deepstream::VideoBuffer::read ( std::function< size_t(const void *data, size_t len)>  )
virtual

Reimplemented from deepstream::Buffer.

◆ size()

size_t deepstream::Buffer::size ( ) const
inherited

Size of the buffer in bytes.

◆ timestamp()

uint64_t deepstream::Buffer::timestamp ( ) const
inherited

Timestamp of the buffer.

◆ width()

size_t deepstream::VideoBuffer::width ( ) const
inline

Definition at line 184 of file buffer.hpp.

References width_.

◆ wrap()

static void deepstream::Buffer::wrap ( Tensor )
staticinherited

wrap the tensor to a new buffer

◆ write()

virtual size_t deepstream::VideoBuffer::write ( std::function< size_t(void *data, size_t len)>  )
virtual

Reimplemented from deepstream::Buffer.

Referenced by deepstream::FileDataSource::read().

Field Documentation

◆ buffer_

OpaqueBuffer* deepstream::Buffer::buffer_
protectedinherited

opaque buffer pointer

Definition at line 164 of file buffer.hpp.

Referenced by deepstream::DS3DBuffer::DS3DBuffer().

◆ chunk_ids_

std::vector<int> deepstream::Buffer::chunk_ids_ = { 0 }
protectedinherited

chunk ids, optional

Definition at line 166 of file buffer.hpp.

◆ format_

NvBufSurfaceColorFormat deepstream::VideoBuffer::format_
protected

Definition at line 193 of file buffer.hpp.

Referenced by format().

◆ height_

size_t deepstream::VideoBuffer::height_ = 0
protected

Definition at line 192 of file buffer.hpp.

Referenced by height().

◆ width_

size_t deepstream::VideoBuffer::width_ = 0
protected

Definition at line 191 of file buffer.hpp.

Referenced by width().


The documentation for this class was generated from the following file: