[Mesa-dev] [PATCH 5/9] vl/video_buffer: add YUYV and UYVY support

Jose Fonseca jfonseca at vmware.com
Thu Mar 8 13:36:35 PST 2012



----- Original Message -----
> This gets xine working with VDPAU.
> 
> v2: some minor bugfixes.
> v3: create the resource with the subsampled
>     format to avoid tilling problems
> 
> Signed-off-by: Christian König <deathsimple at vodafone.de>
[...]
> @@ -269,18 +307,21 @@ vl_video_buffer_sampler_view_components(struct
> pipe_video_buffer *buffer)
>  
>     pipe = buf->base.context;
>  
> +   sampler_format = vl_video_buffer_formats(pipe->screen,
> buf->base.buffer_format);
>     plane_order =
>     vl_video_buffer_plane_order(buf->base.buffer_format);
>  
>     for (component = 0, i = 0; i < buf->num_planes; ++i ) {
>        struct pipe_resource *res = buf->resources[plane_order[i]];
>        unsigned nr_components =
>        util_format_get_nr_components(res->format);
> +      if (util_format_is_subsampled(res->format))

Please, no more of this sort of helpers functions such as  util_format_get_nr_components() and util_format_is_subsampled() which do nothing more than invoking util_format_description() and read a member variable.

Please invoke util_format_description() only once here and then access any info as you please.



More information about the mesa-dev mailing list