Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
H264EncoderNVCodecHelper Class Reference

Helper class for H264 encoding using NVCodec. More...

#include <H264EncoderNVCodecHelper.h>

Collaboration diagram for H264EncoderNVCodecHelper:
Collaboration graph

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< DetailmDetail
 Shared pointer to the internal detail class.
 

Detailed Description

Helper class for H264 encoding using NVCodec.

Constructor & Destructor Documentation

◆ H264EncoderNVCodecHelper() [1/2]

H264EncoderNVCodecHelper::H264EncoderNVCodecHelper ( uint32_t _bitRateKbps,
apracucontext_sp & _cuContext,
uint32_t _gopLength,
uint32_t _frameRate,
H264EncoderNVCodecProps::H264CodecProfile _profile,
bool enableBFrames )

Constructor for H264EncoderNVCodecHelper.

Parameters
_bitRateKbpsBit rate in kilobits per second.
_cuContextCUDA context.
_gopLengthGroup of Pictures (GOP) length.
_frameRateFrame rate.
_profileVideo profile from H264EncoderNVCodecProps::H264CodecProfile enum.
enableBFramesEnable or disable B-frames.

◆ H264EncoderNVCodecHelper() [2/2]

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.

Parameters
_bitRateKbpsBit rate in kilobits per second.
_cuContextCUDA context.
_gopLengthGroup of Pictures (GOP) length.
_frameRateFrame rate.
_profileVideo profile from H264EncoderNVCodecProps::H264CodecProfile enum.
enableBFramesEnable or disable B-frames.
_bufferThresBuffer threshold.

◆ ~H264EncoderNVCodecHelper()

H264EncoderNVCodecHelper::~H264EncoderNVCodecHelper ( )

Destructor for H264EncoderNVCodecHelper.

Member Function Documentation

◆ endEncode()

void H264EncoderNVCodecHelper::endEncode ( )

End encoding.

◆ getSPSPPS()

bool H264EncoderNVCodecHelper::getSPSPPS ( void *& buffer,
size_t & size,
int & width,
int & height )

Get SPS and PPS data.

Parameters
bufferPointer to buffer to store SPS and PPS data.
sizeSize of the buffer.
widthWidth of the frame.
heightHeight of the frame.
Returns
True if SPS and PPS data was retrieved successfully, false otherwise.

◆ init()

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.

Parameters
widthFrame width.
heightFrame height.
pitchFrame pitch.
imageTypeType of the image from ImageMetadata::ImageType.
makeFrameFunction to create a frame.
sendFunction to send a frame.
Returns
True if initialization was successful, false otherwise.

◆ process()

bool H264EncoderNVCodecHelper::process ( frame_sp & frame)

Process a frame.

Parameters
frameFrame to process.
Returns
True if the frame was processed successfully, false otherwise.

Member Data Documentation

◆ mDetail

boost::shared_ptr<Detail> H264EncoderNVCodecHelper::mDetail
private

Shared pointer to the internal detail class.


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