FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hwcontext_vaapi.c File Reference
#include "config.h"
#include <fcntl.h>
#include "avassert.h"
#include "buffer.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_internal.h"
#include "hwcontext_vaapi.h"
#include "mem.h"
#include "pixdesc.h"
#include "pixfmt.h"

Go to the source code of this file.

Data Structures

struct  VAAPIDevicePriv
 
struct  VAAPISurfaceFormat
 
struct  VAAPIDeviceContext
 
struct  VAAPIFramesContext
 
struct  VAAPIMapping
 

Macros

#define MAP(va, rt, av)
 

Functions

static enum AVPixelFormat vaapi_pix_fmt_from_fourcc (unsigned int fourcc)
 
static int vaapi_get_image_format (AVHWDeviceContext *hwdev, enum AVPixelFormat pix_fmt, VAImageFormat **image_format)
 
static int vaapi_frames_get_constraints (AVHWDeviceContext *hwdev, const void *hwconfig, AVHWFramesConstraints *constraints)
 
static int vaapi_device_init (AVHWDeviceContext *hwdev)
 
static void vaapi_device_uninit (AVHWDeviceContext *hwdev)
 
static void vaapi_buffer_free (void *opaque, uint8_t *data)
 
static AVBufferRefvaapi_pool_alloc (void *opaque, int size)
 
static int vaapi_frames_init (AVHWFramesContext *hwfc)
 
static void vaapi_frames_uninit (AVHWFramesContext *hwfc)
 
static int vaapi_get_buffer (AVHWFramesContext *hwfc, AVFrame *frame)
 
static int vaapi_transfer_get_formats (AVHWFramesContext *hwfc, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
 
static void vaapi_unmap_frame (AVHWFramesContext *hwfc, HWMapDescriptor *hwmap)
 
static int vaapi_map_frame (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
 
static int vaapi_transfer_data_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
 
static int vaapi_transfer_data_to (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
 
static int vaapi_map_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
 
static void vaapi_device_free (AVHWDeviceContext *ctx)
 
static int vaapi_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
 

Variables

struct {
   unsigned int   fourcc
 
   unsigned int   rt_format
 
   enum AVPixelFormat   pix_fmt
 
vaapi_format_map []
 
struct {
   const char *   friendly_name
 
   const char *   match_string
 
   unsigned int   quirks
 
vaapi_driver_quirks_table []
 
const HWContextType ff_hwcontext_type_vaapi
 

Macro Definition Documentation

#define MAP (   va,
  rt,
  av 
)
Value:
{ \
VA_FOURCC_ ## va, \
VA_RT_FORMAT_ ## rt, \
AV_PIX_FMT_ ## av \
}

Definition at line 80 of file hwcontext_vaapi.c.

Function Documentation

static enum AVPixelFormat vaapi_pix_fmt_from_fourcc ( unsigned int  fourcc)
static

Definition at line 119 of file hwcontext_vaapi.c.

Referenced by vaapi_device_init(), and vaapi_frames_get_constraints().

static int vaapi_get_image_format ( AVHWDeviceContext hwdev,
enum AVPixelFormat  pix_fmt,
VAImageFormat **  image_format 
)
static

Definition at line 128 of file hwcontext_vaapi.c.

Referenced by vaapi_frames_init(), vaapi_map_frame(), and vaapi_map_from().

static int vaapi_frames_get_constraints ( AVHWDeviceContext hwdev,
const void hwconfig,
AVHWFramesConstraints constraints 
)
static

Definition at line 145 of file hwcontext_vaapi.c.

static int vaapi_device_init ( AVHWDeviceContext hwdev)
static

Definition at line 278 of file hwcontext_vaapi.c.

static void vaapi_device_uninit ( AVHWDeviceContext hwdev)
static

Definition at line 360 of file hwcontext_vaapi.c.

static void vaapi_buffer_free ( void opaque,
uint8_t data 
)
static

Definition at line 367 of file hwcontext_vaapi.c.

Referenced by vaapi_pool_alloc().

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

Definition at line 383 of file hwcontext_vaapi.c.

Referenced by vaapi_frames_init().

static int vaapi_frames_init ( AVHWFramesContext hwfc)
static

Definition at line 427 of file hwcontext_vaapi.c.

static void vaapi_frames_uninit ( AVHWFramesContext hwfc)
static

Definition at line 580 of file hwcontext_vaapi.c.

static int vaapi_get_buffer ( AVHWFramesContext hwfc,
AVFrame frame 
)
static

Definition at line 589 of file hwcontext_vaapi.c.

static int vaapi_transfer_get_formats ( AVHWFramesContext hwfc,
enum AVHWFrameTransferDirection  dir,
enum AVPixelFormat **  formats 
)
static

Definition at line 603 of file hwcontext_vaapi.c.

static void vaapi_unmap_frame ( AVHWFramesContext hwfc,
HWMapDescriptor hwmap 
)
static

Definition at line 632 of file hwcontext_vaapi.c.

Referenced by vaapi_map_frame().

static int vaapi_map_frame ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src,
int  flags 
)
static
static int vaapi_transfer_data_from ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 805 of file hwcontext_vaapi.c.

static int vaapi_transfer_data_to ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 836 of file hwcontext_vaapi.c.

static int vaapi_map_from ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src,
int  flags 
)
static

Definition at line 867 of file hwcontext_vaapi.c.

static void vaapi_device_free ( AVHWDeviceContext ctx)
static

Definition at line 889 of file hwcontext_vaapi.c.

Referenced by vaapi_device_create().

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

Definition at line 908 of file hwcontext_vaapi.c.

Variable Documentation

unsigned int fourcc
unsigned int rt_format

Definition at line 89 of file hwcontext_vaapi.c.

Referenced by vaapi_frames_init().

enum AVPixelFormat pix_fmt
struct { ... } vaapi_format_map[]
Initial value:
= {
MAP(NV12, YUV420, NV12),
MAP(YV12, YUV420, YUV420P),
MAP(IYUV, YUV420, YUV420P),
MAP(422H, YUV422, YUV422P),
MAP(UYVY, YUV422, UYVY422),
MAP(YUY2, YUV422, YUYV422),
MAP(Y800, YUV400, GRAY8),
MAP(BGRA, RGB32, BGRA),
MAP(BGRX, RGB32, BGR0),
MAP(RGBA, RGB32, RGBA),
MAP(RGBX, RGB32, RGB0),
MAP(ARGB, RGB32, ARGB),
MAP(XRGB, RGB32, 0RGB),
}
#define RGBA(r, g, b, a)
Definition: dvbsubdec.c:96
#define MAP(va, rt, av)
#define H
Definition: pixlet.c:37

Referenced by vaapi_frames_init(), and vaapi_pix_fmt_from_fourcc().

const char* friendly_name

Definition at line 262 of file hwcontext_vaapi.c.

Referenced by vaapi_device_init().

const char* match_string

Definition at line 263 of file hwcontext_vaapi.c.

Referenced by vaapi_device_init().

unsigned int quirks

Definition at line 264 of file hwcontext_vaapi.c.

const { ... } vaapi_driver_quirks_table[]
Initial value:
= {
{
"Intel i965 (Quick Sync)",
"i965",
},
{
"Intel iHD",
"ubit",
},
}
The driver does not support the VASurfaceAttribMemoryType attribute, so the surface allocation code w...
The driver does not destroy parameter buffers when they are used by vaRenderPicture().

Referenced by vaapi_device_init().

const HWContextType ff_hwcontext_type_vaapi
Initial value:
= {
.name = "VAAPI",
.device_hwctx_size = sizeof(AVVAAPIDeviceContext),
.device_priv_size = sizeof(VAAPIDeviceContext),
.device_hwconfig_size = sizeof(AVVAAPIHWConfig),
.frames_hwctx_size = sizeof(AVVAAPIFramesContext),
.frames_priv_size = sizeof(VAAPIFramesContext),
.device_create = &vaapi_device_create,
.device_uninit = &vaapi_device_uninit,
.frames_get_constraints = &vaapi_frames_get_constraints,
.frames_init = &vaapi_frames_init,
.frames_uninit = &vaapi_frames_uninit,
.frames_get_buffer = &vaapi_get_buffer,
.transfer_get_formats = &vaapi_transfer_get_formats,
.transfer_data_to = &vaapi_transfer_data_to,
.transfer_data_from = &vaapi_transfer_data_from,
.map_to = NULL,
.map_from = &vaapi_map_from,
.pix_fmts = (const enum AVPixelFormat[]) {
},
}
#define NULL
Definition: coverity.c:32
VAAPI-specific data associated with a frame pool.
static int device_init(AVFormatContext *ctx, int *width, int *height, uint32_t pixelformat)
Definition: v4l2.c:188
static int vaapi_get_buffer(AVHWFramesContext *hwfc, AVFrame *frame)
static int vaapi_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
static int vaapi_device_init(AVHWDeviceContext *hwdev)
static void vaapi_frames_uninit(AVHWFramesContext *hwfc)
VAAPI hardware pipeline configuration details.
static int vaapi_transfer_get_formats(AVHWFramesContext *hwfc, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
static int vaapi_transfer_data_to(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
static int vaapi_map_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
static int vaapi_frames_init(AVHWFramesContext *hwfc)
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
static void vaapi_device_uninit(AVHWDeviceContext *hwdev)
static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
static int vaapi_frames_get_constraints(AVHWDeviceContext *hwdev, const void *hwconfig, AVHWFramesConstraints *constraints)
VAAPI connection details.
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 991 of file hwcontext_vaapi.c.