34 static void destroy_buffers(VADisplay display, VABufferID *buffers,
unsigned int n_buffers)
37 for (i = 0; i < n_buffers; i++) {
39 vaDestroyBuffer(display, buffers[i]);
47 VABufferID va_buffers[3];
48 unsigned int n_va_buffers = 0;
64 surface) != VA_STATUS_SUCCESS)
68 va_buffers, n_va_buffers) != VA_STATUS_SUCCESS)
84 VABufferID *slice_buf_ids;
85 VABufferID slice_param_buf_id, slice_data_buf_id;
98 slice_param_buf_id = 0;
100 VASliceParameterBufferType,
103 &slice_param_buf_id) != VA_STATUS_SUCCESS)
107 slice_data_buf_id = 0;
109 VASliceDataBufferType,
112 &slice_data_buf_id) != VA_STATUS_SUCCESS)
128 type, size, 1,
NULL, buf_id) == VA_STATUS_SUCCESS)
129 vaMapBuffer(vactx->
display, *buf_id, &data);
152 VASliceParameterBufferBase *slice_param;
171 slice_param->slice_data_size =
size;
173 slice_param->slice_data_flag = VA_SLICE_DATA_FLAG_ALL;
196 #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG1_VAAPI_HWACCEL || \ 197 CONFIG_MPEG2_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL || \ 198 CONFIG_VC1_VAAPI_HWACCEL || CONFIG_WMV3_VAAPI_HWACCEL const uint8_t * slice_data
Pointer to slice data buffer base.
uint32_t iq_matrix_buf_id
VAIQMatrixBuffer ID.
uint32_t bitplane_buf_id
VABitPlaneBuffer ID (for VC-1 decoding)
uint32_t context_id
Context ID (video decode pipeline)
int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
This structure is used to share data between the Libav library and the client video application...
unsigned int slice_params_alloc
Size of pre-allocated slice_params.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h)
void * hwaccel_context
Hardware accelerator context.
static void * alloc_buffer(struct vaapi_context *vactx, int type, unsigned int size, uint32_t *buf_id)
uint32_t slice_data_size
Current size of slice data.
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.
void * ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
Allocate a new picture parameter buffer.
static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers)
Picture * current_picture_ptr
pointer to the current picture
static VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
Extract VASurfaceID from an AVFrame.
unsigned int slice_param_size
Size of a VASliceParameterBuffer element.
H.264 / AVC / MPEG-4 part10 codec.
void * display
Window system dependent data.
main external API structure.
VASliceParameterBufferBase * ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size)
Allocate a new slice descriptor for the input slice.
uint32_t * slice_buf_ids
Slice parameter/data buffer IDs.
unsigned int slice_count
Number of slices currently filled in.
unsigned int slice_buf_ids_alloc
Size of pre-allocated slice_buf_ids.
struct AVCodecContext * avctx
int ff_vaapi_commit_slices(struct vaapi_context *vactx)
void * ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
Allocate a new IQ matrix buffer.
unsigned int n_slice_buf_ids
Number of effective slice buffer IDs to send to the HW.
void * slice_params
Pointer to VASliceParameterBuffers.
uint8_t * ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
Allocate a new bit-plane buffer.
int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
uint32_t pic_param_buf_id
VAPictureParameterBuffer ID.