[FFmpeg-devel] [PATCH][VAAPI][2/6] Add common data structures and helpers (take 7)
Diego Biurrun
diego
Wed Mar 11 17:44:54 CET 2009
On Wed, Mar 11, 2009 at 05:33:43PM +0100, Gwenole Beauchesne wrote:
> On Wed, 11 Mar 2009, Diego Biurrun wrote:
>
> >> @@ -0,0 +1,219 @@
> >> + 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]));
> >
> > weird indentation
>
> Copy-pasted from VDPAU.
> + 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]));
> >> + 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 could be aligned.
>
> 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.
> >> +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.
Diego
More information about the ffmpeg-devel
mailing list