FFmpeg
Files | Data Structures | Typedefs | Functions
VDPAU Decoder and Renderer

Files

file  vdpau.h
 

Data Structures

struct  AVVDPAUContext
 This structure is used to share data between the libavcodec library and the client video application. More...
 

Typedefs

typedef int(* AVVDPAU_Render2) (struct AVCodecContext *, struct AVFrame *, const VdpPictureInfo *, uint32_t, const VdpBitstreamBuffer *)
 

Functions

attribute_deprecated AVVDPAUContextav_alloc_vdpaucontext (void)
 allocation function for AVVDPAUContext More...
 
attribute_deprecated AVVDPAU_Render2 av_vdpau_hwaccel_get_render2 (const AVVDPAUContext *)
 
attribute_deprecated void av_vdpau_hwaccel_set_render2 (AVVDPAUContext *, AVVDPAU_Render2)
 
int av_vdpau_bind_context (AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc_address, unsigned flags)
 Associate a VDPAU device with a codec context for hardware acceleration. More...
 
int av_vdpau_get_surface_parameters (AVCodecContext *avctx, VdpChromaType *type, uint32_t *width, uint32_t *height)
 Gets the parameters to create an adequate VDPAU video surface for the codec context using VDPAU hardware decoding acceleration. More...
 
attribute_deprecated AVVDPAUContextav_vdpau_alloc_context (void)
 Allocate an AVVDPAUContext. More...
 

Detailed Description

VDPAU hardware acceleration has two modules

The VDPAU decoding module parses all headers using FFmpeg parsing mechanisms and uses VDPAU for the actual decoding.

As per the current implementation, the actual decoding and rendering (API calls) are done as part of the VDPAU presentation (vo_vdpau.c) module.

Typedef Documentation

◆ AVVDPAU_Render2

typedef int(* AVVDPAU_Render2) (struct AVCodecContext *, struct AVFrame *, const VdpPictureInfo *, uint32_t, const VdpBitstreamBuffer *)

Definition at line 62 of file vdpau.h.

Function Documentation

◆ av_alloc_vdpaucontext()

attribute_deprecated AVVDPAUContext* av_alloc_vdpaucontext ( void  )

allocation function for AVVDPAUContext

Allows extending the struct without breaking API/ABI

Deprecated:
use av_vdpau_bind_context() instead

Definition at line 68 of file vdpau.c.

◆ av_vdpau_hwaccel_get_render2()

attribute_deprecated AVVDPAU_Render2 av_vdpau_hwaccel_get_render2 ( const AVVDPAUContext )
Deprecated:
render2 is public and can be accessed directly

◆ av_vdpau_hwaccel_set_render2()

attribute_deprecated void av_vdpau_hwaccel_set_render2 ( AVVDPAUContext ,
AVVDPAU_Render2   
)
Deprecated:
render2 is public and can be accessed directly

◆ av_vdpau_bind_context()

int av_vdpau_bind_context ( AVCodecContext avctx,
VdpDevice  device,
VdpGetProcAddress *  get_proc_address,
unsigned  flags 
)

Associate a VDPAU device with a codec context for hardware acceleration.

This function is meant to be called from the get_format() codec callback, or earlier. It can also be called after avcodec_flush_buffers() to change the underlying VDPAU device mid-stream (e.g. to recover from non-transparent display preemption).

Note
get_format() must return AV_PIX_FMT_VDPAU if this function completes successfully.
Parameters
avctxdecoding context whose get_format() callback is invoked
deviceVDPAU device handle to use for hardware acceleration
get_proc_addressVDPAU device driver
flagszero of more OR'd AV_HWACCEL_FLAG_* flags
Returns
0 on success, an AVERROR code on failure.

Definition at line 414 of file vdpau.c.

◆ av_vdpau_get_surface_parameters()

int av_vdpau_get_surface_parameters ( AVCodecContext avctx,
VdpChromaType *  type,
uint32_t *  width,
uint32_t *  height 
)

Gets the parameters to create an adequate VDPAU video surface for the codec context using VDPAU hardware decoding acceleration.

Note
Behavior is undefined if the context was not successfully bound to a VDPAU device using av_vdpau_bind_context().
Parameters
avctxthe codec context being used for decoding the stream
typestorage space for the VDPAU video surface chroma type (or NULL to ignore)
widthstorage space for the VDPAU video surface pixel width (or NULL to ignore)
heightstorage space for the VDPAU video surface pixel height (or NULL to ignore)
Returns
0 on success, a negative AVERROR code on failure.

Definition at line 81 of file vdpau.c.

Referenced by ff_vdpau_common_frame_params(), and ff_vdpau_common_init().

◆ av_vdpau_alloc_context()

attribute_deprecated AVVDPAUContext* av_vdpau_alloc_context ( void  )

Allocate an AVVDPAUContext.

Returns
Newly-allocated AVVDPAUContext or NULL on failure.
Deprecated:
use av_vdpau_bind_context() instead

Definition at line 408 of file vdpau.c.

Referenced by av_alloc_vdpaucontext().