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

Go to the source code of this file.

Data Structures

struct  VDPAUDeviceContext
 
struct  VDPAUFramesContext
 
struct  VDPAUPixFmtMap
 

Macros

#define GET_CALLBACK(id, result)
 

Functions

static int count_pixfmts (const VDPAUPixFmtMap *map)
 
static int vdpau_init_pixmfts (AVHWDeviceContext *ctx)
 
static int vdpau_device_init (AVHWDeviceContext *ctx)
 
static void vdpau_device_uninit (AVHWDeviceContext *ctx)
 
static void vdpau_buffer_free (void *opaque, uint8_t *data)
 
static AVBufferRefvdpau_pool_alloc (void *opaque, int size)
 
static int vdpau_frames_init (AVHWFramesContext *ctx)
 
static int vdpau_get_buffer (AVHWFramesContext *ctx, AVFrame *frame)
 
static int vdpau_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
 
static int vdpau_transfer_data_from (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
 
static int vdpau_transfer_data_to (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
 

Variables

static const VDPAUPixFmtMap pix_fmts_420 []
 
static const VDPAUPixFmtMap pix_fmts_422 []
 
static const VDPAUPixFmtMap pix_fmts_444 []
 
struct {
   VdpChromaType   chroma_type
 
   const VDPAUPixFmtMap *   map
 
vdpau_pix_fmts []
 
const HWContextType ff_hwcontext_type_vdpau
 

Macro Definition Documentation

#define GET_CALLBACK (   id,
  result 
)
Value:
do { \
err = hwctx->get_proc_address(hwctx->device, id, &tmp); \
if (err != VDP_STATUS_OK) { \
av_log(ctx, AV_LOG_ERROR, "Error getting the " #id " callback.\n"); \
} \
priv->result = tmp; \
} while (0)
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
return
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
AVFormatContext * ctx
Definition: movenc.c:48
if(ret< 0)
Definition: vf_mcdeint.c:282
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:71
static uint8_t tmp[8]
Definition: des.c:38

Referenced by vdpau_device_init().

Function Documentation

static int count_pixfmts ( const VDPAUPixFmtMap map)
static

Definition at line 89 of file hwcontext_vdpau.c.

Referenced by vdpau_init_pixmfts().

static int vdpau_init_pixmfts ( AVHWDeviceContext ctx)
static

Definition at line 99 of file hwcontext_vdpau.c.

Referenced by vdpau_device_init().

static int vdpau_device_init ( AVHWDeviceContext ctx)
static

Definition at line 130 of file hwcontext_vdpau.c.

static void vdpau_device_uninit ( AVHWDeviceContext ctx)
static

Definition at line 164 of file hwcontext_vdpau.c.

static void vdpau_buffer_free ( void opaque,
uint8_t data 
)
static

Definition at line 173 of file hwcontext_vdpau.c.

Referenced by vdpau_pool_alloc().

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

Definition at line 182 of file hwcontext_vdpau.c.

Referenced by vdpau_frames_init().

static int vdpau_frames_init ( AVHWFramesContext ctx)
static

Definition at line 210 of file hwcontext_vdpau.c.

static int vdpau_get_buffer ( AVHWFramesContext ctx,
AVFrame frame 
)
static

Definition at line 253 of file hwcontext_vdpau.c.

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

Definition at line 267 of file hwcontext_vdpau.c.

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

Definition at line 291 of file hwcontext_vdpau.c.

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

Definition at line 342 of file hwcontext_vdpau.c.

Variable Documentation

const VDPAUPixFmtMap pix_fmts_420[]
static
Initial value:
= {
{ VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV12 },
{ VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV420P },
{ 0, AV_PIX_FMT_NONE, },
}
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
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62

Definition at line 61 of file hwcontext_vdpau.c.

const VDPAUPixFmtMap pix_fmts_422[]
static
Initial value:
= {
{ VDP_YCBCR_FORMAT_NV12, AV_PIX_FMT_NV16 },
{ VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV422P },
{ VDP_YCBCR_FORMAT_UYVY, AV_PIX_FMT_UYVY422 },
{ VDP_YCBCR_FORMAT_YUYV, AV_PIX_FMT_YUYV422 },
{ 0, AV_PIX_FMT_NONE, },
}
packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
Definition: pixfmt.h:82
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:63
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:212

Definition at line 67 of file hwcontext_vdpau.c.

const VDPAUPixFmtMap pix_fmts_444[]
static
Initial value:
= {
{ VDP_YCBCR_FORMAT_YV12, AV_PIX_FMT_YUV444P },
{ 0, AV_PIX_FMT_NONE, },
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67

Definition at line 75 of file hwcontext_vdpau.c.

VdpChromaType chroma_type

Definition at line 81 of file hwcontext_vdpau.c.

Referenced by vdpau_frames_init().

const VDPAUPixFmtMap* map
const { ... } vdpau_pix_fmts[]
Initial value:
= {
{ VDP_CHROMA_TYPE_420, pix_fmts_420 },
{ VDP_CHROMA_TYPE_422, pix_fmts_422 },
{ VDP_CHROMA_TYPE_444, pix_fmts_444 },
}
static const VDPAUPixFmtMap pix_fmts_422[]
static const VDPAUPixFmtMap pix_fmts_444[]
static const VDPAUPixFmtMap pix_fmts_420[]

Referenced by vdpau_frames_init(), vdpau_init_pixmfts(), vdpau_transfer_data_from(), and vdpau_transfer_data_to().

const HWContextType ff_hwcontext_type_vdpau
Initial value:
= {
.name = "VDPAU",
.device_hwctx_size = sizeof(AVVDPAUDeviceContext),
.device_priv_size = sizeof(VDPAUDeviceContext),
.frames_priv_size = sizeof(VDPAUFramesContext),
.device_uninit = vdpau_device_uninit,
.frames_init = vdpau_frames_init,
.frames_get_buffer = vdpau_get_buffer,
.transfer_get_formats = vdpau_transfer_get_formats,
.transfer_data_to = vdpau_transfer_data_to,
.transfer_data_from = vdpau_transfer_data_from,
}
This struct is allocated as AVHWDeviceContext.hwctx.
static int device_init(AVFormatContext *ctx, int *width, int *height, uint32_t pixelformat)
Definition: v4l2.c:186
static int vdpau_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
static int vdpau_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
static int vdpau_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int vdpau_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int vdpau_device_init(AVHWDeviceContext *ctx)
static int vdpau_frames_init(AVHWFramesContext *ctx)
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:208
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
static void vdpau_device_uninit(AVHWDeviceContext *ctx)
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 469 of file hwcontext_vdpau.c.