28#include <libavutil/hwcontext.h>
68 const std::string& name,
88 const std::string&
getName()
const {
return name_; };
159 bool initDevice(
const std::string& device);
168 bool linked_ {
false};
171 bool dynBitrate_ {
false};
176 int init_device(
const char* name,
const char* device,
int flags);
177 int init_device_type(std::string&
dev);
179 std::list<std::pair<std::string, DeviceState>>* possible_devices_;
Provides an abstraction layer to the hardware acceleration APIs in FFmpeg.
AVPixelFormat getSoftwareFormat() const
Software format.
bool linkHardware(AVBufferRef *framesCtx)
Links this HardwareAccel's frames context with the passed in context.
static std::list< HardwareAccel > getCompatibleAccel(AVCodecID id, int width, int height, CodecType type)
static std::unique_ptr< VideoFrame > transferToMainMemory(const VideoFrame &frame, AVPixelFormat desiredFormat)
Transfers hardware frame to main memory.
std::string getCodecName() const
Gets the name of the codec.
std::unique_ptr< VideoFrame > transfer(const VideoFrame &frame)
Transfers a frame to/from the GPU memory.
const std::string & getName() const
Name of the hardware layer/API being used.
void setDetails(AVCodecContext *codecCtx)
Set some extra details in the codec context.
bool isLinked() const
If hardware decoder can feed hardware encoder directly.
~HardwareAccel()
Dereferences hardware contexts.
AVPixelFormat getFormat() const
Hardware format.
AVCodecID getCodecId() const
Codec that is being accelerated.
int initAPI(bool linkable, AVBufferRef *framesCtx)
void emitSignal(Args... args)