![]() |
ApraPipes 1.0
|
Helper class for H264 encoding using NVCodec. More...
#include <H264EncoderNVCodecHelper.h>
Classes | |
class | Detail |
Public Member Functions | |
H264EncoderNVCodecHelper (uint32_t _bitRateKbps, apracucontext_sp &_cuContext, uint32_t _gopLength, uint32_t _frameRate, H264EncoderNVCodecProps::H264CodecProfile _profile, bool enableBFrames) | |
Constructor for H264EncoderNVCodecHelper. | |
H264EncoderNVCodecHelper (uint32_t _bitRateKbps, apracucontext_sp &_cuContext, uint32_t _gopLength, uint32_t _frameRate, H264EncoderNVCodecProps::H264CodecProfile _profile, bool enableBFrames, uint32_t _bufferThres) | |
Constructor for H264EncoderNVCodecHelper with buffer threshold. | |
~H264EncoderNVCodecHelper () | |
Destructor for H264EncoderNVCodecHelper. | |
bool | init (uint32_t width, uint32_t height, uint32_t pitch, ImageMetadata::ImageType imageType, std::function< frame_sp(size_t)> makeFrame, std::function< void(frame_sp &, frame_sp &)> send) |
Initialize the encoder. | |
bool | process (frame_sp &frame) |
Process a frame. | |
void | endEncode () |
End encoding. | |
bool | getSPSPPS (void *&buffer, size_t &size, int &width, int &height) |
Get SPS and PPS data. | |
Private Attributes | |
boost::shared_ptr< Detail > | mDetail |
Shared pointer to the internal detail class. | |
Helper class for H264 encoding using NVCodec.
H264EncoderNVCodecHelper::H264EncoderNVCodecHelper | ( | uint32_t | _bitRateKbps, |
apracucontext_sp & | _cuContext, | ||
uint32_t | _gopLength, | ||
uint32_t | _frameRate, | ||
H264EncoderNVCodecProps::H264CodecProfile | _profile, | ||
bool | enableBFrames ) |
Constructor for H264EncoderNVCodecHelper.
_bitRateKbps | Bit rate in kilobits per second. |
_cuContext | CUDA context. |
_gopLength | Group of Pictures (GOP) length. |
_frameRate | Frame rate. |
_profile | Video profile from H264EncoderNVCodecProps::H264CodecProfile enum. |
enableBFrames | Enable or disable B-frames. |
H264EncoderNVCodecHelper::H264EncoderNVCodecHelper | ( | uint32_t | _bitRateKbps, |
apracucontext_sp & | _cuContext, | ||
uint32_t | _gopLength, | ||
uint32_t | _frameRate, | ||
H264EncoderNVCodecProps::H264CodecProfile | _profile, | ||
bool | enableBFrames, | ||
uint32_t | _bufferThres ) |
Constructor for H264EncoderNVCodecHelper with buffer threshold.
_bitRateKbps | Bit rate in kilobits per second. |
_cuContext | CUDA context. |
_gopLength | Group of Pictures (GOP) length. |
_frameRate | Frame rate. |
_profile | Video profile from H264EncoderNVCodecProps::H264CodecProfile enum. |
enableBFrames | Enable or disable B-frames. |
_bufferThres | Buffer threshold. |
H264EncoderNVCodecHelper::~H264EncoderNVCodecHelper | ( | ) |
Destructor for H264EncoderNVCodecHelper.
void H264EncoderNVCodecHelper::endEncode | ( | ) |
End encoding.
bool H264EncoderNVCodecHelper::getSPSPPS | ( | void *& | buffer, |
size_t & | size, | ||
int & | width, | ||
int & | height ) |
Get SPS and PPS data.
buffer | Pointer to buffer to store SPS and PPS data. |
size | Size of the buffer. |
width | Width of the frame. |
height | Height of the frame. |
bool H264EncoderNVCodecHelper::init | ( | uint32_t | width, |
uint32_t | height, | ||
uint32_t | pitch, | ||
ImageMetadata::ImageType | imageType, | ||
std::function< frame_sp(size_t)> | makeFrame, | ||
std::function< void(frame_sp &, frame_sp &)> | send ) |
Initialize the encoder.
width | Frame width. |
height | Frame height. |
pitch | Frame pitch. |
imageType | Type of the image from ImageMetadata::ImageType. |
makeFrame | Function to create a frame. |
send | Function to send a frame. |
bool H264EncoderNVCodecHelper::process | ( | frame_sp & | frame | ) |
Process a frame.
frame | Frame to process. |
|
private |
Shared pointer to the internal detail class.