|
avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
|
Hardware devices, hardware frames and hardware codec configuration.
#include <cstddef>#include <iterator>#include <memory>#include <optional>#include <string>#include <system_error>#include <vector>#include "avcompat.h"#include "averror.h"#include "buffer.h"#include "codec.h"#include "dictionary.h"#include "pixelformat.h"#include <libavutil/hwcontext.h>Go to the source code of this file.
Classes | |
| class | av::hw::DeviceType |
| Wrapper for AVHWDeviceType. More... | |
| class | av::hw::DeviceContext |
| Owner of an AVHWDeviceContext. More... | |
| class | av::hw::FramesContext |
| Owner of an AVHWFramesContext. More... | |
| class | av::hw::RangeView< T > |
| Non-owning view over a contiguous array. More... | |
| class | av::hw::DeviceTypeRange |
| Non-owning iterator over AVHWDeviceType values. More... | |
| class | av::hw::DeviceTypeRange::iterator |
| Forward iterator over the device types FFmpeg was built with. More... | |
| struct | av::hw::DeviceProbe |
| Result of probing one device type: whether it could be created, and why not. More... | |
| class | av::hw::DeviceProbeRange |
| Lazy range that probes every compiled device type. More... | |
| class | av::hw::DeviceProbeRange::iterator |
| Forward iterator that creates and destroys one device per step. More... | |
| class | av::hw::PixelFormatRange |
| Non-owning view over a null-terminated AVPixelFormat array. More... | |
| class | av::hw::PixelFormatRange::iterator |
| Forward iterator over a null-terminated AVPixelFormat array. More... | |
| class | av::hw::PixelFormatList |
| Owner of an AVPixelFormat array allocated by FFmpeg. More... | |
| class | av::hw::FrameConstraints |
| Owner of AVHWFramesConstraints. More... | |
| class | av::hw::CodecConfigRange |
| Non-owning iterator over AVCodecHWConfig entries of a codec. More... | |
| class | av::hw::CodecConfigRange::iterator |
| Forward iterator over the hardware configurations of a codec. More... | |
| class | av::hw::CodecRange |
| Non-owning range over codecs found with av_codec_iterate(). More... | |
| class | av::hw::CodecRange::iterator |
| Forward iterator over the codecs FFmpeg was built with. More... | |
Namespaces | |
| namespace | av |
| Root namespace of the library. | |
Enumerations | |
| enum class | av::hw::EncodingMode { Auto , Frames , Device } |
| How an encoder receives hardware frames. More... | |
Functions | |
| DeviceTypeRange | av::hw::allDeviceTypes () noexcept |
| All hardware device types compiled into FFmpeg. | |
| DeviceProbeRange | av::hw::probeDevices (const char *device=nullptr) |
| Probe every compiled device type with a borrowed selector. | |
| DeviceProbeRange | av::hw::probeDevices (const std::string &device) |
| Probe every compiled device type, keeping a copy of the selector. | |
| bool | av::hw::isDeviceAvailable (DeviceType type, const char *device=nullptr) |
| Check whether one device type can be created. | |
| bool | av::hw::isDeviceAvailable (DeviceType type, const std::string &device) |
| Check whether one device type can be created. | |
| FrameConstraints | av::hw::frameConstraints (const DeviceContext &device, OptionalErrorCode ec=throws()) |
| Query hardware frames constraints for a device. | |
| CodecConfigRange | av::hw::codecConfigs (const Codec &codec) noexcept |
| All hardware configurations of a codec. | |
| std::optional< AVCodecHWConfig > | av::hw::findCodecConfig (const Codec &codec, DeviceType type, int methodsMask=AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX|AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX) |
| The first hardware configuration that matches a device type. | |
| CodecRange | av::hw::findDecoders (AVCodecID id, DeviceType type) noexcept |
| All decoders for a codec identifier that support a device type. | |
| CodecRange | av::hw::findEncoders (AVCodecID id, DeviceType type) noexcept |
| All encoders for a codec identifier that support a device type. | |
| Codec | av::hw::findDecoder (AVCodecID id, DeviceType type) noexcept |
| The first decoder for a codec identifier that supports a device type. | |
| Codec | av::hw::findEncoder (AVCodecID id, DeviceType type) noexcept |
| The first encoder for a codec identifier that supports a device type. | |
| PixelFormat | av::hw::hwPixelFormat (DeviceType type) noexcept |
| Hardware pixel format used by a device type. | |
|
strong |
|
noexcept |
This lists compiled backends, not present hardware. Use probeDevices() or isDeviceAvailable() to check whether a device can actually be created.
|
noexcept |
| codec | the codec to inspect |
| std::optional< AVCodecHWConfig > av::hw::findCodecConfig | ( | const Codec & | codec, |
| DeviceType | type, | ||
| int | methodsMask = AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX|AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX ) |
| codec | the codec to inspect |
| type | the device type to match |
| methodsMask | configuration methods to accept; by default both the device-context and the frames-context methods qualify |
|
noexcept |
| id | the codec identifier |
| type | the device type the decoder must support |
|
noexcept |
The search covers every codec with the identifier, which matters for QSV: the generic h264 decoder cannot use QSV, h264_qsv can.
| id | the codec identifier |
| type | the device type the decoder must support |
|
noexcept |
| id | the codec identifier |
| type | the device type the encoder must support |
|
noexcept |
| id | the codec identifier |
| type | the device type the encoder must support |
| FrameConstraints av::hw::frameConstraints | ( | const DeviceContext & | device, |
| OptionalErrorCode | ec = throws() ) |
The returned object owns the FFmpeg constraints; hwFormats() and swFormats() are non-owning views into it.
| device | the device to query |
| ec | holder for the error code |
|
noexcept |
The lookup is name based, so the function does not depend on enum values that may be missing in older FFmpeg versions.
| type | the device type |
| bool av::hw::isDeviceAvailable | ( | DeviceType | type, |
| const char * | device = nullptr ) |
| type | the device type to probe |
| device | backend-specific selector; nullptr asks for the default |
| bool av::hw::isDeviceAvailable | ( | DeviceType | type, |
| const std::string & | device ) |
| type | the device type to probe |
| device | backend-specific selector |
| DeviceProbeRange av::hw::probeDevices | ( | const char * | device = nullptr | ) |
Each step creates a device and destroys it immediately, which is the only reliable availability check: FFmpeg lists compiled backends, not hardware.
| device | backend-specific selector, for example "/dev/dri/renderD128" or "1"; nullptr asks for the default device |
| DeviceProbeRange av::hw::probeDevices | ( | const std::string & | device | ) |
| device | backend-specific selector; a copy is stored in the range |