FFmpeg
|
#include <stdatomic.h>
#include <stdint.h>
#include <string.h>
#include <mfxvideo.h>
#include "config.h"
#include "buffer.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_internal.h"
#include "hwcontext_qsv.h"
#include "mem.h"
#include "pixfmt.h"
#include "pixdesc.h"
#include "time.h"
#include "imgutils.h"
#include "avassert.h"
Go to the source code of this file.
Data Structures | |
struct | QSVDevicePriv |
struct | QSVDeviceContext |
struct | QSVFramesContext |
struct | QSVSurface |
Macros | |
#define | COBJMACROS |
#define | QSV_VERSION_ATLEAST(MAJOR, MINOR) |
#define | QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) |
#define | MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl)) |
#define | QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) |
#define | QSV_HAVE_OPAQUE !QSV_ONEVPL |
#define | MFXUnload(a) do { } while(0) |
Functions | |
int | ff_qsv_get_surface_base_handle (mfxFrameSurface1 *surf, enum AVHWDeviceType base_dev_type, void **base_handle) |
Caller needs to allocate enough space for base_handle pointer. More... | |
static int | qsv_init_surface (AVHWFramesContext *ctx, mfxFrameSurface1 *surf) |
static uint32_t | qsv_fourcc_from_pix_fmt (enum AVPixelFormat pix_fmt) |
static uint16_t | qsv_shift_from_pix_fmt (enum AVPixelFormat pix_fmt) |
static int | qsv_fill_border (AVFrame *dst, const AVFrame *src) |
static int | qsv_device_init (AVHWDeviceContext *ctx) |
static void | qsv_frames_uninit (AVHWFramesContext *ctx) |
static void | qsv_pool_release_dummy (void *opaque, uint8_t *data) |
static void | qsv_pool_release (void *opaque, uint8_t *data) |
static AVBufferRef * | qsv_fixed_pool_alloc (void *opaque, size_t size) |
static AVBufferRef * | qsv_dynamic_pool_alloc (void *opaque, size_t size) |
static AVBufferRef * | qsv_pool_alloc (void *opaque, size_t size) |
static int | qsv_init_child_ctx (AVHWFramesContext *ctx) |
static int | qsv_init_pool (AVHWFramesContext *ctx, uint32_t fourcc) |
static mfxStatus | frame_alloc (mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameAllocResponse *resp) |
static mfxStatus | frame_free (mfxHDL pthis, mfxFrameAllocResponse *resp) |
static mfxStatus | frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) |
static mfxStatus | frame_unlock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr) |
static mfxStatus | frame_get_hdl (mfxHDL pthis, mfxMemId mid, mfxHDL *hdl) |
static int | qsv_create_mfx_session (void *ctx, mfxHDL handle, mfxHandleType handle_type, mfxIMPL implementation, mfxVersion *pver, mfxSession *psession, void **ploader) |
static int | qsv_init_internal_session (AVHWFramesContext *ctx, mfxSession *session, int upload) |
static int | qsv_frames_init (AVHWFramesContext *ctx) |
static int | qsv_get_buffer (AVHWFramesContext *ctx, AVFrame *frame) |
static int | qsv_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats) |
static int | qsv_frames_derive_from (AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags) |
static int | qsv_map_from (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags) |
static int | qsv_transfer_data_child (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) |
static int | map_frame_to_surface (const AVFrame *frame, mfxFrameSurface1 *surface) |
static int | qsv_internal_session_check_init (AVHWFramesContext *ctx, int upload) |
static int | qsv_transfer_data_from (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) |
static int | qsv_transfer_data_to (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) |
static int | qsv_dynamic_frames_derive_to (AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags) |
static int | qsv_fixed_frames_derive_to (AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags) |
static int | qsv_frames_derive_to (AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags) |
static int | qsv_fixed_pool_map_to (AVHWFramesContext *dst_ctx, AVFrame *dst, const AVFrame *src, int flags) |
static void | qsv_dynamic_pool_unmap (AVHWFramesContext *ctx, HWMapDescriptor *hwmap) |
static int | qsv_dynamic_pool_map_to (AVHWFramesContext *dst_ctx, AVFrame *dst, const AVFrame *src, int flags) |
static int | qsv_map_to (AVHWFramesContext *dst_ctx, AVFrame *dst, const AVFrame *src, int flags) |
static int | qsv_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints) |
static void | qsv_device_free (AVHWDeviceContext *ctx) |
static mfxIMPL | choose_implementation (const char *device, enum AVHWDeviceType child_device_type) |
static int | qsv_device_derive_from_child (AVHWDeviceContext *ctx, mfxIMPL implementation, AVHWDeviceContext *child_device_ctx, int flags) |
static int | qsv_device_derive (AVHWDeviceContext *ctx, AVHWDeviceContext *child_device_ctx, AVDictionary *opts, int flags) |
static int | qsv_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) |
Variables | |
struct { | |
enum AVPixelFormat pix_fmt | |
uint32_t fourcc | |
uint16_t mfx_shift | |
} | supported_pixel_formats [] |
const HWContextType | ff_hwcontext_type_qsv |
#define COBJMACROS |
Definition at line 31 of file hwcontext_qsv.c.
#define QSV_VERSION_ATLEAST | ( | MAJOR, | |
MINOR | |||
) |
Definition at line 55 of file hwcontext_qsv.c.
#define QSV_RUNTIME_VERSION_ATLEAST | ( | MFX_VERSION, | |
MAJOR, | |||
MINOR | |||
) |
Definition at line 59 of file hwcontext_qsv.c.
#define MFX_IMPL_VIA_MASK | ( | impl | ) | (0x0f00 & (impl)) |
Definition at line 63 of file hwcontext_qsv.c.
#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) |
Definition at line 64 of file hwcontext_qsv.c.
#define QSV_HAVE_OPAQUE !QSV_ONEVPL |
Definition at line 65 of file hwcontext_qsv.c.
Definition at line 70 of file hwcontext_qsv.c.
int ff_qsv_get_surface_base_handle | ( | mfxFrameSurface1 * | surf, |
enum AVHWDeviceType | base_dev_type, | ||
void ** | base_handle | ||
) |
Caller needs to allocate enough space for base_handle pointer.
Definition at line 181 of file hwcontext_qsv.c.
|
static |
Definition at line 669 of file hwcontext_qsv.c.
Referenced by qsv_dynamic_frames_derive_to(), qsv_dynamic_pool_alloc(), qsv_dynamic_pool_map_to(), qsv_fixed_frames_derive_to(), and qsv_init_pool().
|
static |
Definition at line 208 of file hwcontext_qsv.c.
Referenced by qsv_frames_init(), and qsv_init_surface().
|
static |
Definition at line 218 of file hwcontext_qsv.c.
Referenced by qsv_init_surface().
Definition at line 245 of file hwcontext_qsv.c.
Referenced by qsv_transfer_data_to().
|
static |
Definition at line 293 of file hwcontext_qsv.c.
|
static |
Definition at line 349 of file hwcontext_qsv.c.
|
static |
Definition at line 382 of file hwcontext_qsv.c.
Referenced by qsv_fixed_pool_alloc().
|
static |
Definition at line 386 of file hwcontext_qsv.c.
Referenced by qsv_dynamic_pool_alloc().
|
static |
Definition at line 411 of file hwcontext_qsv.c.
Referenced by qsv_pool_alloc().
|
static |
Definition at line 426 of file hwcontext_qsv.c.
Referenced by qsv_pool_alloc().
|
static |
Definition at line 512 of file hwcontext_qsv.c.
Referenced by qsv_init_pool().
|
static |
Definition at line 524 of file hwcontext_qsv.c.
Referenced by qsv_init_pool().
|
static |
Definition at line 705 of file hwcontext_qsv.c.
Referenced by qsv_frames_init().
|
static |
Definition at line 775 of file hwcontext_qsv.c.
Referenced by qsv_init_internal_session().
|
static |
Definition at line 803 of file hwcontext_qsv.c.
Referenced by qsv_init_internal_session().
|
static |
Definition at line 808 of file hwcontext_qsv.c.
Referenced by qsv_init_internal_session().
|
static |
Definition at line 813 of file hwcontext_qsv.c.
Referenced by qsv_init_internal_session().
|
static |
Definition at line 818 of file hwcontext_qsv.c.
Referenced by qsv_init_internal_session().
|
static |
Definition at line 1229 of file hwcontext_qsv.c.
Referenced by qsv_device_derive_from_child(), and qsv_init_internal_session().
|
static |
Definition at line 1288 of file hwcontext_qsv.c.
Referenced by qsv_internal_session_check_init().
|
static |
Definition at line 1407 of file hwcontext_qsv.c.
|
static |
Definition at line 1479 of file hwcontext_qsv.c.
|
static |
Definition at line 1493 of file hwcontext_qsv.c.
|
static |
Definition at line 1511 of file hwcontext_qsv.c.
|
static |
Definition at line 1587 of file hwcontext_qsv.c.
|
static |
Definition at line 1690 of file hwcontext_qsv.c.
Referenced by qsv_transfer_data_from(), and qsv_transfer_data_to().
|
static |
Definition at line 1724 of file hwcontext_qsv.c.
Referenced by qsv_transfer_data_from(), and qsv_transfer_data_to().
|
static |
Definition at line 1793 of file hwcontext_qsv.c.
Referenced by qsv_transfer_data_from(), and qsv_transfer_data_to().
|
static |
Definition at line 1819 of file hwcontext_qsv.c.
|
static |
Definition at line 1902 of file hwcontext_qsv.c.
|
static |
Definition at line 1995 of file hwcontext_qsv.c.
Referenced by qsv_frames_derive_to().
|
static |
Definition at line 2035 of file hwcontext_qsv.c.
Referenced by qsv_frames_derive_to().
|
static |
Definition at line 2132 of file hwcontext_qsv.c.
|
static |
Definition at line 2145 of file hwcontext_qsv.c.
Referenced by qsv_map_to().
|
static |
Definition at line 2205 of file hwcontext_qsv.c.
Referenced by qsv_dynamic_pool_map_to().
|
static |
Definition at line 2237 of file hwcontext_qsv.c.
Referenced by qsv_map_to().
|
static |
Definition at line 2321 of file hwcontext_qsv.c.
|
static |
Definition at line 2332 of file hwcontext_qsv.c.
|
static |
Definition at line 2357 of file hwcontext_qsv.c.
Referenced by qsv_device_create(), and qsv_device_derive().
|
static |
Definition at line 2371 of file hwcontext_qsv.c.
Referenced by qsv_device_create(), and qsv_device_derive().
|
static |
Definition at line 2410 of file hwcontext_qsv.c.
Referenced by qsv_device_create(), and qsv_device_derive().
|
static |
Definition at line 2483 of file hwcontext_qsv.c.
|
static |
Definition at line 2502 of file hwcontext_qsv.c.
enum AVPixelFormat pix_fmt |
Definition at line 132 of file hwcontext_qsv.c.
Referenced by qsv_device_init(), qsv_fourcc_from_pix_fmt(), and qsv_shift_from_pix_fmt().
uint32_t fourcc |
Definition at line 133 of file hwcontext_qsv.c.
Referenced by qsv_frames_init(), and qsv_init_surface().
uint16_t mfx_shift |
Definition at line 134 of file hwcontext_qsv.c.
const { ... } supported_pixel_formats[] |
Referenced by qsv_fourcc_from_pix_fmt(), qsv_frames_get_constraints(), and qsv_shift_from_pix_fmt().
const HWContextType ff_hwcontext_type_qsv |
Definition at line 2624 of file hwcontext_qsv.c.