Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
H264EncoderNVCodecHelper.h
1#pragma once
2
3#include <boost/shared_ptr.hpp>
4#include "ImageMetadata.h"
5#include "CommonDefs.h"
6#include "CudaCommon.h"
7#include "H264EncoderNVCodec.h"
8
13{
14public:
25 H264EncoderNVCodecHelper(uint32_t _bitRateKbps, apracucontext_sp& _cuContext, uint32_t _gopLength, uint32_t _frameRate,H264EncoderNVCodecProps::H264CodecProfile _profile, bool enableBFrames);
26
38 H264EncoderNVCodecHelper(uint32_t _bitRateKbps, apracucontext_sp& _cuContext, uint32_t _gopLength, uint32_t _frameRate,H264EncoderNVCodecProps::H264CodecProfile _profile, bool enableBFrames, uint32_t _bufferThres);
39
44
56 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);
57
64 bool process(frame_sp &frame);
65
69 void endEncode();
70
80 bool getSPSPPS(void*& buffer, size_t& size, int& width, int& height);
81
82private:
86 class Detail;
87
91 boost::shared_ptr<Detail> mDetail;
92};
Definition H264EncoderNVCodecHelper.cpp:193
Helper class for H264 encoding using NVCodec.
Definition H264EncoderNVCodecHelper.h:13
boost::shared_ptr< Detail > mDetail
Shared pointer to the internal detail class.
Definition H264EncoderNVCodecHelper.h:91
void endEncode()
End encoding.
Definition H264EncoderNVCodecHelper.cpp:710
~H264EncoderNVCodecHelper()
Destructor for H264EncoderNVCodecHelper.
Definition H264EncoderNVCodecHelper.cpp:695
H264EncoderNVCodecHelper(uint32_t _bitRateKbps, apracucontext_sp &_cuContext, uint32_t _gopLength, uint32_t _frameRate, H264EncoderNVCodecProps::H264CodecProfile _profile, bool enableBFrames)
Constructor for H264EncoderNVCodecHelper.
Definition H264EncoderNVCodecHelper.cpp:684
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.
Definition H264EncoderNVCodecHelper.cpp:700
bool process(frame_sp &frame)
Process a frame.
Definition H264EncoderNVCodecHelper.cpp:705
bool getSPSPPS(void *&buffer, size_t &size, int &width, int &height)
Get SPS and PPS data.
Definition H264EncoderNVCodecHelper.cpp:715
H264CodecProfile
Enum representing different H.264 codec profiles.
Definition H264EncoderNVCodec.h:17
ImageType
Definition ImageMetadata.h:11