FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
hwcontext_dxva2.c File Reference
#include <windows.h>
#include <d3d9.h>
#include <dxva2api.h>
#include <initguid.h>
#include "avassert.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_dxva2.h"
#include "hwcontext_internal.h"
#include "imgutils.h"
#include "pixdesc.h"
#include "pixfmt.h"

Go to the source code of this file.

Data Structures

struct  DXVA2FramesContext
 
struct  DXVA2DevicePriv
 

Macros

#define _WIN32_WINNT   0x0600
 
#define DXVA2API_USE_BITFIELDS
 
#define COBJMACROS
 

Typedefs

typedef IDirect3D9 *WINAPI pDirect3DCreate9 (UINT)
 
typedef HRESULT WINAPI pCreateDeviceManager9 (UINT *, IDirect3DDeviceManager9 **)
 

Functions

 DEFINE_GUID (video_decoder_service, 0xfc51a551, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02)
 
 DEFINE_GUID (video_processor_service, 0xfc51a552, 0xd5e7, 0x11d9, 0xaf, 0x55, 0x00, 0x05, 0x4e, 0x43, 0xff, 0x02)
 
static void dxva2_frames_uninit (AVHWFramesContext *ctx)
 
static AVBufferRefdxva2_pool_alloc (void *opaque, int size)
 
static int dxva2_init_pool (AVHWFramesContext *ctx)
 
static int dxva2_frames_init (AVHWFramesContext *ctx)
 
static int dxva2_get_buffer (AVHWFramesContext *ctx, AVFrame *frame)
 
static int dxva2_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
 
static int dxva2_transfer_data (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
 
static void dxva2_device_free (AVHWDeviceContext *ctx)
 
static int dxva2_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
 

Variables

struct {
   D3DFORMAT   d3d_format
 
   enum AVPixelFormat   pix_fmt
 
supported_formats []
 
const HWContextType ff_hwcontext_type_dxva2
 

Macro Definition Documentation

#define _WIN32_WINNT   0x0600

Definition at line 23 of file hwcontext_dxva2.c.

#define DXVA2API_USE_BITFIELDS

Definition at line 25 of file hwcontext_dxva2.c.

#define COBJMACROS

Definition at line 26 of file hwcontext_dxva2.c.

Typedef Documentation

typedef IDirect3D9* WINAPI pDirect3DCreate9(UINT)

Definition at line 41 of file hwcontext_dxva2.c.

typedef HRESULT WINAPI pCreateDeviceManager9(UINT *, IDirect3DDeviceManager9 **)

Definition at line 42 of file hwcontext_dxva2.c.

Function Documentation

DEFINE_GUID ( video_decoder_service  ,
0xfc51a551  ,
0xd5e7  ,
0x11d9  ,
0xaf  ,
0x55  ,
0x00  ,
0x05  ,
0x4e  ,
0x43  ,
0xff  ,
0x02   
)
DEFINE_GUID ( video_processor_service  ,
0xfc51a552  ,
0xd5e7  ,
0x11d9  ,
0xaf  ,
0x55  ,
0x00  ,
0x05  ,
0x4e  ,
0x43  ,
0xff  ,
0x02   
)
static void dxva2_frames_uninit ( AVHWFramesContext ctx)
static

Definition at line 75 of file hwcontext_dxva2.c.

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

Definition at line 104 of file hwcontext_dxva2.c.

Referenced by dxva2_init_pool().

static int dxva2_init_pool ( AVHWFramesContext ctx)
static

Definition at line 119 of file hwcontext_dxva2.c.

Referenced by dxva2_frames_init().

static int dxva2_frames_init ( AVHWFramesContext ctx)
static

Definition at line 186 of file hwcontext_dxva2.c.

static int dxva2_get_buffer ( AVHWFramesContext ctx,
AVFrame frame 
)
static

Definition at line 213 of file hwcontext_dxva2.c.

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

Definition at line 227 of file hwcontext_dxva2.c.

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

Definition at line 245 of file hwcontext_dxva2.c.

static void dxva2_device_free ( AVHWDeviceContext ctx)
static

Definition at line 303 of file hwcontext_dxva2.c.

Referenced by dxva2_device_create().

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

Definition at line 329 of file hwcontext_dxva2.c.

Variable Documentation

D3DFORMAT d3d_format

Definition at line 65 of file hwcontext_dxva2.c.

Referenced by txd_decode_frame().

enum AVPixelFormat pix_fmt

Definition at line 66 of file hwcontext_dxva2.c.

const { ... } supported_formats[]
Initial value:
= {
{ MKTAG('N', 'V', '1', '2'), AV_PIX_FMT_NV12 },
{ MKTAG('P', '0', '1', '0'), AV_PIX_FMT_P010 },
}
#define AV_PIX_FMT_P010
Definition: pixfmt.h:384
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
#define MKTAG(a, b, c, d)
Definition: common.h:342

Referenced by dxva2_init_pool().

const HWContextType ff_hwcontext_type_dxva2
Initial value:
= {
.name = "DXVA2",
.device_hwctx_size = sizeof(AVDXVA2DeviceContext),
.frames_hwctx_size = sizeof(AVDXVA2FramesContext),
.frames_priv_size = sizeof(DXVA2FramesContext),
.device_create = dxva2_device_create,
.frames_init = dxva2_frames_init,
.frames_uninit = dxva2_frames_uninit,
.frames_get_buffer = dxva2_get_buffer,
.transfer_get_formats = dxva2_transfer_get_formats,
.transfer_data_to = dxva2_transfer_data,
.transfer_data_from = dxva2_transfer_data,
}
This struct is allocated as AVHWFramesContext.hwctx.
static int dxva2_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int dxva2_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
static int dxva2_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
static int dxva2_frames_init(AVHWFramesContext *ctx)
static void dxva2_frames_uninit(AVHWFramesContext *ctx)
static int dxva2_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
Definition: pixfmt.h:148
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
This struct is allocated as AVHWDeviceContext.hwctx.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 422 of file hwcontext_dxva2.c.