![]() |
Jetson Inference
DNN Vision Library
|
gstBufferManager recieves GStreamer buffers from appsink elements and unpacks/maps them into CUDA address space, and handles colorspace conversion into RGB format. More...
#include <gstBufferManager.h>
Public Member Functions | |
| gstBufferManager (videoOptions *options) | |
| Constructor. More... | |
| ~gstBufferManager () | |
| Destructor. More... | |
| bool | Enqueue (GstBuffer *buffer, GstCaps *caps) |
| Enqueue a GstBuffer from GStreamer. More... | |
| int | Dequeue (void **output, imageFormat format, uint64_t timeout=UINT64_MAX) |
| Dequeue the next frame. More... | |
| uint64_t | GetLastTimestamp () const |
| Get timestamp of the latest dequeued frame. More... | |
| imageFormat | GetRawFormat () const |
| Get raw image format. More... | |
| uint64_t | GetFrameCount () const |
| Get the total number of frames that have been recieved. More... | |
Protected Attributes | |
| imageFormat | mFormatYUV |
| The YUV colorspace format coming from appsink (typically NV12 or YUY2) More... | |
| RingBuffer | mBufferYUV |
| Ringbuffer of CPU-based YUV frames (non-NVMM) that come from appsink. More... | |
| RingBuffer | mTimestamps |
| Ringbuffer of timestamps that come from appsink. More... | |
| RingBuffer | mBufferRGB |
| Ringbuffer of frames that have been converted to RGB colorspace. More... | |
| uint64_t | mLastTimestamp |
| Timestamp of the latest dequeued frame. More... | |
| Event | mWaitEvent |
| Event that gets triggered when a new frame is recieved. More... | |
| videoOptions * | mOptions |
| Options of the gstDecoder / gstCamera object. More... | |
| uint64_t | mFrameCount |
| Total number of frames that have been recieved. More... | |
| bool | mNvmmUsed |
| Is NVMM memory actually used by the stream? More... | |
gstBufferManager recieves GStreamer buffers from appsink elements and unpacks/maps them into CUDA address space, and handles colorspace conversion into RGB format.
It can handle both normal CPU-based GStreamer buffers and NVMM memory which can be mapped directly to the GPU without requiring memory copies using the CPU.
To disable the use of NVMM memory, set -DENABLE_NVMM=OFF when building with CMake:
cmake -DENABLE_NVMM=OFF ../
| gstBufferManager::gstBufferManager | ( | videoOptions * | options | ) |
Constructor.
| gstBufferManager::~gstBufferManager | ( | ) |
Destructor.
| int gstBufferManager::Dequeue | ( | void ** | output, |
| imageFormat | format, | ||
| uint64_t | timeout = UINT64_MAX |
||
| ) |
Dequeue the next frame.
Returns 1 on success, 0 on timeout, -1 on error.
| bool gstBufferManager::Enqueue | ( | GstBuffer * | buffer, |
| GstCaps * | caps | ||
| ) |
Enqueue a GstBuffer from GStreamer.
|
inline |
Get the total number of frames that have been recieved.
|
inline |
Get timestamp of the latest dequeued frame.
|
inline |
Get raw image format.
|
protected |
Ringbuffer of frames that have been converted to RGB colorspace.
|
protected |
Ringbuffer of CPU-based YUV frames (non-NVMM) that come from appsink.
|
protected |
The YUV colorspace format coming from appsink (typically NV12 or YUY2)
|
protected |
Total number of frames that have been recieved.
|
protected |
Timestamp of the latest dequeued frame.
|
protected |
Is NVMM memory actually used by the stream?
|
protected |
Options of the gstDecoder / gstCamera object.
|
protected |
Ringbuffer of timestamps that come from appsink.
|
protected |
Event that gets triggered when a new frame is recieved.