[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers (take 13)

Gwenole Beauchesne gbeauchesne
Fri Mar 20 15:06:49 CET 2009


On Fri, 20 Mar 2009, Gwenole Beauchesne wrote:

> Le 20 mars 09 ? 03:24, Michael Niedermayer a ?crit :
>
>> [...]
>>> +static int commit_slices(AVCodecContext *avctx, Picture *pic)
>>> +{
>>> +    const struct vaapi_context * const va_context = avctx-
>>>> hwaccel_context;
>>> +    struct vaapi_picture_private * const pp = pic-
>>>> hwaccel_picture_private;
>>> +    VABufferID *slice_buf_ids;
>>> +    VABufferID slice_param_buf_id, slice_data_buf_id;
>>
>> shouldnt this take vaapi_picture_private as argument instead of
>> Picture ?
>> also this might apply to other functions too
>
> OK for commit_slices() but I can hardly see how I could pass a
> vaapi_picture_private only instead of a Picture in the other function
> because I need Picture.data[3] in render_picture() for example.

This could give:
static int render_picture(struct vaapi_context *vactx, struct vaapi_picture_private *pp, VASurfaceID surface)
static int commit_slices(struct vaapi_context *vactx, struct vaapi_picture_private *pp)

IMHO, that's not really pretty. I have attached a diff against the 
previous patch for you to checkout.

>> [...]
>>> +void *ff_vaapi_alloc_slice(AVCodecContext *avctx, const uint8_t
>>> *buffer, uint32_t size)
>>> +{
>>> +    MpegEncContext * const s = avctx->priv_data;
>>> +    struct vaapi_picture_private *pp = s->current_picture_ptr-
>>>> hwaccel_picture_private;
>>> +    uint8_t *slice_params;
>>> +    VASliceParameterBufferBase *slice_param;
>>
>> shouldnt the return type be VASliceParameterBufferBase * ?
>
> Keeping it void * will avoid a cast to VASliceParameterBufferCODEC *
> in any vaapi_CODEC.c file. Do you really want an explicit cast in the
> callers?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg.hwaccel.vaapi.common.13.cosmetics.patch
Type: text/x-diff
Size: 6113 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090320/c0273300/attachment.patch>



More information about the ffmpeg-devel mailing list