112 device_hwctx = device_ctx->
hwctx;
138 av_log(
NULL, loglevel,
"VDPAU init failed for stream #%d:%d.\n",
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
This struct is allocated as AVHWDeviceContext.hwctx.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
This structure describes decoded (raw) audio or video data.
int coded_width
Bitstream width / height, may be different from width/height e.g.
VdpGetProcAddress * get_proc_address
int index
stream index in AVFormatContext
int width
The allocated dimensions of the frames in this pool.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
Public libavcodec VDPAU header.
AVBufferRef * hw_frames_ctx
An API-specific header for AV_HWDEVICE_TYPE_VDPAU.
int vdpau_init(AVCodecContext *s)
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
void * hwaccel_context
Hardware accelerator context.
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
int av_hwdevice_ctx_create(AVBufferRef **pdevice_ref, enum AVHWDeviceType type, const char *device, AVDictionary *opts, int flags)
Open a device of the specified type and create an AVHWDeviceContext for it.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int vdpau_alloc(AVCodecContext *s)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
static int vdpau_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
reference-counted frame API
int av_hwframe_transfer_data(AVFrame *dst, const AVFrame *src, int flags)
Copy data to or from a hw surface.
main external API structure.
uint8_t * data
The data buffer.
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
This struct describes a set or pool of "hardware" frames (i.e.
refcounted data buffer API
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc, unsigned flags)
Associate a VDPAU device with a codec context for hardware acceleration.
A reference to a data buffer.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
static int vdpau_retrieve_data(AVCodecContext *s, AVFrame *frame)
static void vdpau_uninit(AVCodecContext *s)
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
void * opaque
Private data of the user, can be used to carry app specific stuff.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.