|
avcpp 3.2.1
Wrapper for the FFmpeg that simplify usage from C++ projects.
|
Owner of an AVHWDeviceContext. More...
#include <hwcontext.h>
Public Member Functions | |
| bool | isValid () const noexcept |
| Whether the wrapper holds a device. | |
| DeviceType | type () const noexcept |
| The type of the device. | |
| AVHWDeviceContext * | raw () const noexcept |
| The underlying FFmpeg context. | |
| AVBufferRef * | bufferRef () const noexcept |
| The reference-counted buffer that owns the context. | |
Static Public Member Functions | |
| static DeviceContext | create (DeviceType type, const char *device=nullptr, const Dictionary &options={}, OptionalErrorCode ec=throws()) |
| Create and open a hardware device. | |
| static DeviceContext | create (DeviceType type, const std::string &device, const Dictionary &options={}, OptionalErrorCode ec=throws()) |
| Create and open a hardware device from a std::string selector. | |
| static DeviceContext | derive (const DeviceContext &source, DeviceType type, const Dictionary &options={}, OptionalErrorCode ec=throws()) |
| Create a device derived from an existing one. | |
| static DeviceContext | wrap (AVBufferRef *ref) noexcept |
| Take a reference to an existing AVBufferRef. | |
Friends | |
| class | FramesContext |
The context is reference counted with AVBufferRef. Copying the wrapper only adds a reference. Use raw() or bufferRef() to pass the context to FFmpeg.
|
noexcept |
|
static |
| type | the device type to create |
| device | backend-specific selector: a path for VAAPI/DRM, an index for CUDA, an adapter name for D3D11VA, or nullptr for the default device |
| options | backend-specific options passed to FFmpeg |
| ec | holder for the error code; throws() raises av::Exception |
|
static |
| type | the device type to create |
| device | backend-specific selector; may be empty for the default |
| options | backend-specific options passed to FFmpeg |
| ec | holder for the error code |
|
static |
A typical use is an OpenCL device on top of a VAAPI device, so both APIs share the same frames. Do not derive a QSV device: the libmfx path can crash.
| source | the device to derive from; must be valid |
| type | the type of the derived device |
| options | backend-specific options |
| ec | holder for the error code |
|
noexcept |
|
noexcept |
|
noexcept |
|
staticnoexcept |
The reference count is incremented, so the caller keeps ownership of its pointer and must still unref it. Never free a pointer that was passed here and then keep using the returned context.
| ref | the buffer to reference; may be null |