![]() |
VR-Forces 5.0.1 Developer's Guide
|
The EncoderIO class is responsible to initialize CUDA and NVidia encoder then will be responsible to submit the Pixel Buffer Object to the GPU for encoding.
Public Types | |
| enum | DtHwEncoderFormat { UNKNOWN = 0, H264 = 1, H265 = 2 } |
Public Member Functions | |
| DtEncoderIO (DtDe &de) | |
| virtual | ~DtEncoderIO () |
| virtual void | deinitialize () |
| virtual bool | initialize (const osg::ref_ptr< osg::Image > &image, unsigned int frameRate, const std::string &encodingFormat) |
| virtual void | submitPBO (unsigned int pboId, int width, int height, int rowSizeInBytes, unsigned int frameRate, DtEncoderIOCallback *callback) |
| virtual bool | registerGlResourceIfNecessary (unsigned int pboId) |
Protected Member Functions | |
| virtual void | deinitCUDA () |
| virtual bool | initCUDA (const osg::ref_ptr< osg::Image > &image, unsigned int frameRate) |
| virtual void | deinitNVidiaEncoder () |
| virtual bool | initNVidiaEncoder () |
| virtual void | unmapDeviceBuffer () |
| virtual bool | flipVertically (DtEncodeInputBuffer *inputBuffer, DtRegisteredCudaGlResource *val, int rowSizeInBytes, int imageHeight) |
| virtual bool | registerInputAndOutputResourcesIfNecessary (int width, int height, int rowSizeInBytes) |
| virtual bool | fillDefaultEncoderParams (NV_ENC_INITIALIZE_PARAMS &encoderParams) |
| virtual DtHwEncoderFormat | toFormat (const std::string &format) const |
| virtual void | getEncodedPackets () |
| virtual void | doWork () |
Protected Attributes | |
| int | myCudaDeviceId |
| int | myHcuDevice |
| CUcontext | myHcuContext |
| std::vector< DtEncodeOutputBuffer > | myOutputBuffer |
| std::vector< DtEncodeInputBuffer > | myInputBuffer |
| void * | myNVEncoder |
| uint64_t | myEncodeIdx |
| CUdeviceptr | myCUDATempDevicePtr |
| unsigned int | myCUDATempDeviceSize |
| uint32_t | myTempStride |
| unsigned int | myFrameRate |
| DtHwEncoderFormat | myEncodingFormat |
| DtDe & | myDe |
| int | myWidth = 0 |
| int | myHeight = 0 |
| int | myToSendFrames = 0 |
| int | myGotFrames = 0 |
| std::vector< std::vector < uint8_t > > | myHwEncodedPackets |
| std::unordered_map< unsigned int, DtRegisteredCudaGlResource * > | myRegisteredPbos |
| tbb::concurrent_queue < DtEncoderSubmitPboWork > | myWork |
| std::thread | myWorkerThread |
| bool | myWorkerInitialized = false |
| bool | myWorkerToQuit = false |
| bool | myInputOutputResourcesRegistered = false |
| int | myId = 0 |
Static Protected Attributes | |
| static int | theRunningId |
| static const int | theDebugLevel |
Friends | |
| class | DtEncoderIOGetEncodedPacketsTask |
| makVrv::DtEncoderIO::DtEncoderIO | ( | DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
virtual |
Shutdown all (CUDA / NVIDIA encoder)
|
virtual |
Initialize all (CUDA / NVIDIA encoder)
|
virtual |
Submit Pixel Buffer Object.
register the input pbo with cuda if necessary
|
protectedvirtual |
Shutdown CUDA.
|
protectedvirtual |
Initialize CUDA.
|
protectedvirtual |
Shutdown NVIDIA encoder.
|
protectedvirtual |
Initialize NVIDIA encoder.
|
protectedvirtual |
Unmap CUDA buffer.
|
protectedvirtual |
Flip the input to the encoder buffer on the device with CUDA.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
helper
|
protectedvirtual |
Internal function to get the encoded packets.
|
protectedvirtual |
This is done on another thread.
|
friend |
|
protected |
CUDA device ID use for the encoding.
|
protected |
CUDA device handle.
|
protected |
CUDA device context.
|
protected |
|
protected |
|
protected |
encoding pointer
|
protected |
encoding index
|
protected |
Temp buffer on CUDA device.
|
protected |
Temp buffer on CUDA device.
|
protected |
Encoding Data format.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
This is the list of pbos registered with this encoder. It corresponds to a ring buffer of pbos on the client side (the one calling the encoder) that are reading fbo asynchronously.
|
protected |
This is the work queue.
|
protected |
This is the worker thread which processes the work queue.
|
protected |
Whether the worker thread has been initialized.
|
protected |
boolean used to indicate to the worker thread that it must quit and join the main thread
|
protected |
The registered resources.
|
protected |
|
staticprotected |
|
staticprotected |