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

Michael Niedermayer michaelni
Fri Mar 20 03:24:11 CET 2009


On Thu, Mar 19, 2009 at 05:02:01PM +0100, Gwenole Beauchesne wrote:
> Le 18 mars 09 ? 19:37, Michael Niedermayer a ?crit :
>
>> [...]
>>> +static int render_picture(AVCodecContext *avctx, Picture *pic)
>>> +{
>>> +    const struct vaapi_context * const va_context = 
>>> avctx->hwaccel_context;
>>> +    struct vaapi_picture_private * const pp = pic->hwaccel_data_private;
>>> +    VABufferID va_buffers[3];
>>> +    unsigned int n_va_buffers = 0;
>>> +
>>> +    if (pp->n_slice_buf_ids == 0)
>>> +        return -1;
>>
>> the only point from where this is called checks n_slice_buf_ids > 0 before
>
> Dropped. New patch attached to also fix memory leak, cosmetics (docs, 
> renaming).

[...]
> +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

[...]
> +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 * ?

anyway the rest of the patch looks ok, you can commit it after 
fixing these 2, but note, iam not 100% happy about the read only
context vs putting local vars in each Pic

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090320/c3339428/attachment.pgp>



More information about the ffmpeg-devel mailing list