37 for (i = 0; i < n_buffers; i++) {
38 if (buffers[i] != VA_INVALID_ID) {
39 vaDestroyBuffer(display, buffers[i]);
40 buffers[i] = VA_INVALID_ID;
51 av_log(avctx,
AV_LOG_ERROR,
"Hardware acceleration context (hwaccel_context) does not exist.\n");
73 VABufferID va_buffers[3];
74 unsigned int n_va_buffers = 0;
93 surface) != VA_STATUS_SUCCESS)
97 va_buffers, n_va_buffers) != VA_STATUS_SUCCESS)
114 VABufferID slice_param_buf_id, slice_data_buf_id;
127 slice_param_buf_id = VA_INVALID_ID;
129 VASliceParameterBufferType,
132 &slice_param_buf_id) != VA_STATUS_SUCCESS)
136 slice_data_buf_id = VA_INVALID_ID;
138 VASliceDataBufferType,
141 &slice_data_buf_id) != VA_STATUS_SUCCESS)
155 *buf_id = VA_INVALID_ID;
157 type, size, 1,
NULL, buf_id) == VA_STATUS_SUCCESS)
158 vaMapBuffer(vactx->
display, *buf_id, &data);
181 VASliceParameterBufferBase *slice_param;
200 slice_param->slice_data_size =
size;
202 slice_param->slice_data_flag = VA_SLICE_DATA_FLAG_ALL;
225 #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG1_VAAPI_HWACCEL || \
226 CONFIG_MPEG2_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL || \
227 CONFIG_VC1_VAAPI_HWACCEL || CONFIG_WMV3_VAAPI_HWACCEL
VASliceParameterBufferBase * ff_vaapi_alloc_slice(FFVAContext *vactx, const uint8_t *buffer, uint32_t size)
Allocate a new slice descriptor for the input slice.
int ff_vaapi_context_fini(AVCodecContext *avctx)
Common AVHWAccel.uninit() implementation.
VAContextID context_id
Context ID (video decode pipeline)
const uint8_t * slice_data
Pointer to slice data buffer base.
ptrdiff_t const GLvoid * data
int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface)
VABufferID pic_param_buf_id
Picture parameter buffer.
uint32_t context_id
Context ID (video decode pipeline)
This structure is used to share data between the FFmpeg library and the client video application...
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
void * hwaccel_context
Hardware accelerator context.
unsigned int slice_param_size
Size of a slice parameter element.
VADisplay display
Windowing system dependent handle.
void * ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size)
Allocate a new IQ matrix buffer.
static FFVAContext * ff_vaapi_get_context(AVCodecContext *avctx)
Extract vaapi_context from an AVCodecContext.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
VABufferID iq_matrix_buf_id
Inverse quantiser matrix buffer.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
void ff_vaapi_common_end_frame(AVCodecContext *avctx)
Common AVHWAccel.end_frame() implementation.
int ff_vaapi_context_init(AVCodecContext *avctx)
Common AVHWAccel.init() implementation.
static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers)
unsigned int n_slice_buf_ids
Number of effective slice buffers.
unsigned int slice_params_alloc
Number of allocated slice parameters.
Picture * current_picture_ptr
pointer to the current picture
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
Extract VASurfaceID from an AVFrame.
VABufferID * slice_buf_ids
Slice parameter/data buffers.
void * slice_params
Pointer to slice parameter buffers.
unsigned int slice_buf_ids_alloc
Number of allocated slice buffers.
void * display
Window system dependent data.
attribute_deprecated uint32_t * slice_buf_ids
Slice parameter/data buffer IDs.
main external API structure.
int ff_vaapi_commit_slices(FFVAContext *vactx)
void * ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size)
Allocate a new picture parameter buffer.
unsigned int slice_data_size
Current size of slice data.
attribute_deprecated void * slice_params
Pointer to VASliceParameterBuffers.
struct AVCodecContext * avctx
unsigned int slice_count
Number of slices currently filled in.
VABufferID bitplane_buf_id
Bitplane buffer (for VC-1 decoding)
VAConfigID config_id
Configuration ID.
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
uint8_t * ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size)
Allocate a new bit-plane buffer.
static void * alloc_buffer(FFVAContext *vactx, int type, unsigned int size, uint32_t *buf_id)
uint32_t config_id
Configuration ID.