FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
hwcontext_qsv.c File Reference
#include <stdint.h>
#include <string.h>
#include <mfx/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"

Go to the source code of this file.

Data Structures

struct  QSVDevicePriv
 
struct  QSVDeviceContext
 
struct  QSVFramesContext
 

Functions

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 AVBufferRefqsv_pool_alloc (void *opaque, int 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_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_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 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_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
 
static void qsv_device_free (AVHWDeviceContext *ctx)
 
static mfxIMPL choose_implementation (const char *device)
 
static int qsv_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
 

Variables

struct {
   mfxHandleType   handle_type
 
   enum AVHWDeviceType   device_type
 
   enum AVPixelFormat   pix_fmt
 
supported_handle_types []
 
struct {
   enum AVPixelFormat   pix_fmt
 
   uint32_t   fourcc
 
supported_pixel_formats []
 
const HWContextType ff_hwcontext_type_qsv
 

Function Documentation

static int qsv_device_init ( AVHWDeviceContext ctx)
static

Definition at line 97 of file hwcontext_qsv.c.

static void qsv_frames_uninit ( AVHWFramesContext ctx)
static

Definition at line 131 of file hwcontext_qsv.c.

static void qsv_pool_release_dummy ( void opaque,
uint8_t data 
)
static

Definition at line 153 of file hwcontext_qsv.c.

Referenced by qsv_pool_alloc().

static AVBufferRef* qsv_pool_alloc ( void opaque,
int  size 
)
static

Definition at line 157 of file hwcontext_qsv.c.

Referenced by qsv_init_pool().

static int qsv_init_child_ctx ( AVHWFramesContext ctx)
static

Definition at line 172 of file hwcontext_qsv.c.

Referenced by qsv_init_pool().

static int qsv_init_pool ( AVHWFramesContext ctx,
uint32_t  fourcc 
)
static

Definition at line 275 of file hwcontext_qsv.c.

Referenced by qsv_frames_init().

static mfxStatus frame_alloc ( mfxHDL  pthis,
mfxFrameAllocRequest *  req,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 337 of file hwcontext_qsv.c.

Referenced by qsv_init_internal_session().

static mfxStatus frame_free ( mfxHDL  pthis,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 365 of file hwcontext_qsv.c.

Referenced by qsv_init_internal_session().

static mfxStatus frame_lock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 370 of file hwcontext_qsv.c.

Referenced by qsv_init_internal_session().

static mfxStatus frame_unlock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 375 of file hwcontext_qsv.c.

Referenced by qsv_init_internal_session().

static mfxStatus frame_get_hdl ( mfxHDL  pthis,
mfxMemId  mid,
mfxHDL *  hdl 
)
static

Definition at line 380 of file hwcontext_qsv.c.

Referenced by qsv_init_internal_session().

static int qsv_init_internal_session ( AVHWFramesContext ctx,
mfxSession *  session,
int  upload 
)
static

Definition at line 386 of file hwcontext_qsv.c.

Referenced by qsv_frames_init().

static int qsv_frames_init ( AVHWFramesContext ctx)
static

Definition at line 462 of file hwcontext_qsv.c.

static int qsv_get_buffer ( AVHWFramesContext ctx,
AVFrame frame 
)
static

Definition at line 530 of file hwcontext_qsv.c.

static int qsv_transfer_get_formats ( AVHWFramesContext ctx,
enum AVHWFrameTransferDirection  dir,
enum AVPixelFormat **  formats 
)
static

Definition at line 544 of file hwcontext_qsv.c.

static int qsv_map_from ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src,
int  flags 
)
static

Definition at line 562 of file hwcontext_qsv.c.

static int qsv_transfer_data_child ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 598 of file hwcontext_qsv.c.

Referenced by qsv_transfer_data_from(), and qsv_transfer_data_to().

static int qsv_transfer_data_from ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 632 of file hwcontext_qsv.c.

static int qsv_transfer_data_to ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 679 of file hwcontext_qsv.c.

static int qsv_frames_get_constraints ( AVHWDeviceContext ctx,
const void hwconfig,
AVHWFramesConstraints constraints 
)
static

Definition at line 726 of file hwcontext_qsv.c.

static void qsv_device_free ( AVHWDeviceContext ctx)
static

Definition at line 751 of file hwcontext_qsv.c.

Referenced by qsv_device_create().

static mfxIMPL choose_implementation ( const char *  device)
static

Definition at line 763 of file hwcontext_qsv.c.

Referenced by qsv_device_create().

static int qsv_device_create ( AVHWDeviceContext ctx,
const char *  device,
AVDictionary opts,
int  flags 
)
static

Definition at line 795 of file hwcontext_qsv.c.

Variable Documentation

mfxHandleType handle_type
enum AVHWDeviceType device_type

Definition at line 76 of file hwcontext_qsv.c.

enum AVPixelFormat pix_fmt

Definition at line 77 of file hwcontext_qsv.c.

Referenced by qsv_frames_init().

const { ... } supported_handle_types[]
Initial value:
= {
{ 0 },
}

Referenced by qsv_device_init().

uint32_t fourcc
const { ... } supported_pixel_formats[]
Initial value:
= {
{ AV_PIX_FMT_NV12, MFX_FOURCC_NV12 },
{ AV_PIX_FMT_P010, MFX_FOURCC_P010 },
{ AV_PIX_FMT_PAL8, MFX_FOURCC_P8 },
}
#define AV_PIX_FMT_P010
Definition: pixfmt.h:394
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:73
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:90

Referenced by qsv_frames_get_constraints(), and qsv_frames_init().

const HWContextType ff_hwcontext_type_qsv
Initial value:
= {
.name = "QSV",
.device_hwctx_size = sizeof(AVQSVDeviceContext),
.device_priv_size = sizeof(QSVDeviceContext),
.frames_hwctx_size = sizeof(AVQSVFramesContext),
.frames_priv_size = sizeof(QSVFramesContext),
.device_create = qsv_device_create,
.device_init = qsv_device_init,
.frames_get_constraints = qsv_frames_get_constraints,
.frames_init = qsv_frames_init,
.frames_uninit = qsv_frames_uninit,
.frames_get_buffer = qsv_get_buffer,
.transfer_get_formats = qsv_transfer_get_formats,
.transfer_data_to = qsv_transfer_data_to,
.transfer_data_from = qsv_transfer_data_from,
.map_from = qsv_map_from,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_QSV, AV_PIX_FMT_NONE },
}
static int qsv_frames_get_constraints(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
This struct is allocated as AVHWFramesContext.hwctx.
Definition: hwcontext_qsv.h:42
static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int qsv_map_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags)
static int qsv_frames_init(AVHWFramesContext *ctx)
This struct is allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_qsv.h:35
static int qsv_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
static int qsv_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int qsv_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
static void qsv_frames_uninit(AVHWFramesContext *ctx)
static int qsv_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
Definition: pixfmt.h:236
static int qsv_device_init(AVHWDeviceContext *ctx)
Definition: hwcontext_qsv.c:97
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 861 of file hwcontext_qsv.c.