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

Gwenole Beauchesne gbeauchesne
Wed Mar 11 17:55:38 CET 2009


On Wed, 11 Mar 2009, Diego Biurrun wrote:

>> + it looks better as is anyway, otherwise, we end up post 80 chars, but I
>> don't really care.
>
> Doesn't look like it:
>
>    slice_buf_ids = av_fast_realloc(rdsp->slice_buf_ids,
>                                    &rdsp->slice_buf_ids_alloc,
>                                    (rdsp->n_slice_buf_ids + 2) *
>                                    sizeof(slice_buf_ids[0]));
>
> or
>
>    slice_buf_ids = av_fast_realloc(rdsp->slice_buf_ids,
>                                    &rdsp->slice_buf_ids_alloc,
>                                    (rdsp->n_slice_buf_ids + 2) *
>                                        sizeof(slice_buf_ids[0]));

Also had this one which looks more like existing code in lavc.

     slice_buf_ids =
         av_fast_realloc(rdsp->slice_buf_ids,
                         &rdsp->slice_buf_ids_alloc,
                         (rdsp->n_slice_buf_ids + 2) * sizeof(slice_buf_ids[0]));

will probably wait for Michael in case there other changes to make 
around...

>> There would be a line (av_freep) in the middle, which would make it look
>> weird and I want to correlate resets.
>
> So?
>
>    rdsp->n_slice_buf_ids     = 0;
>    rdsp->slice_buf_ids_alloc = 0;
>    av_freep(&rdsp->slice_params);
>    rdsp->slice_count         = 0;
>    rdsp->slice_params_alloc  = 0;
>
> This still looks better.

Sure, for those, but you skipped the above two av_freep(), you cheated. 
;-)

>>>> +struct vaapi_render_state {
>>>> +    struct vaapi_context *va_context;   ///< Pointer to display-dependent data
>>>> +    uint32_t    surface;                ///< Rendering surface, never changed
>>>> +};
>>>
>>> Is there a better name for this struct?
>>
>> Did not find any and this would require updating all others (xvmc, vdpau)
>> for consistency + have an impact on existing code for no real advantage.
>
> xvmc already uses a better name.

If a new name is really needed, I'd prefer struct thing_hwaccel since that 
struct is extracted from Picture.data[3] (which could have been 
Picture.hwaccel_data) and it may have a companion struct 
thing_hwaccel_private for Picture.hwaccel_data_private.




More information about the ffmpeg-devel mailing list