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 int vdpau_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
 
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
 
   enum AVPixelFormat   frames_sw_format
 
   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"); \
} \
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:279
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:71
static uint8_t tmp[11]
Definition: aes_ctr.c:26

Definition at line 131 of file hwcontext_vdpau.c.

Referenced by vdpau_device_init().

Function Documentation

static int count_pixfmts ( const VDPAUPixFmtMap map)
static

Definition at line 90 of file hwcontext_vdpau.c.

Referenced by vdpau_init_pixmfts().

static int vdpau_init_pixmfts ( AVHWDeviceContext ctx)
static

Definition at line 100 of file hwcontext_vdpau.c.

Referenced by vdpau_device_init().

static int vdpau_device_init ( AVHWDeviceContext ctx)
static

Definition at line 142 of file hwcontext_vdpau.c.

static void vdpau_device_uninit ( AVHWDeviceContext ctx)
static

Definition at line 165 of file hwcontext_vdpau.c.

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

Definition at line 174 of file hwcontext_vdpau.c.

static void vdpau_buffer_free ( void opaque,
uint8_t data 
)
static

Definition at line 203 of file hwcontext_vdpau.c.

Referenced by vdpau_pool_alloc().

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

Definition at line 212 of file hwcontext_vdpau.c.

Referenced by vdpau_frames_init().

static int vdpau_frames_init ( AVHWFramesContext ctx)
static

Definition at line 240 of file hwcontext_vdpau.c.

static int vdpau_get_buffer ( AVHWFramesContext ctx,
AVFrame frame 
)
static

Definition at line 275 of file hwcontext_vdpau.c.

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

Definition at line 289 of file hwcontext_vdpau.c.

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

Definition at line 313 of file hwcontext_vdpau.c.

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

Definition at line 364 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:89
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66

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:81
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:67
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:201

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:71

Definition at line 75 of file hwcontext_vdpau.c.

VdpChromaType chroma_type

Definition at line 81 of file hwcontext_vdpau.c.

enum AVPixelFormat frames_sw_format

Definition at line 82 of file hwcontext_vdpau.c.

Referenced by vdpau_frames_init().

const VDPAUPixFmtMap* map
const { ... } vdpau_pix_fmts[]
Initial value:
= {
{ VDP_CHROMA_TYPE_420, AV_PIX_FMT_YUV420P, pix_fmts_420 },
{ VDP_CHROMA_TYPE_422, AV_PIX_FMT_YUV422P, pix_fmts_422 },
{ VDP_CHROMA_TYPE_444, AV_PIX_FMT_YUV444P, pix_fmts_444 },
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
static const VDPAUPixFmtMap pix_fmts_422[]
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
static const VDPAUPixFmtMap pix_fmts_444[]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
static const VDPAUPixFmtMap pix_fmts_420[]

Referenced by vdpau_frames_get_constraints(), 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_get_constraints = vdpau_frames_get_constraints,
.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:192
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)
static int vdpau_frames_get_constraints(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
Definition: pixfmt.h:197
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:266
static void vdpau_device_uninit(AVHWDeviceContext *ctx)
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64

Definition at line 480 of file hwcontext_vdpau.c.