[Mesa-dev] [PATCH 5/6] st/vdpau: add new formats to OutputSurface rendering

gurketsky gurketsky at googlemail.com
Wed Oct 9 09:38:18 CEST 2013


On 09.10.2013 02:23, Grigori Goronzy wrote:
> +static inline enum pipe_video_chroma_format
> +FormatYCBCRToPipeChroma(VdpYCbCrFormat vdpau_format)
> +{
> +   switch (vdpau_format) {
> +      case VDP_YCBCR_FORMAT_NV12:
> +         return PIPE_VIDEO_CHROMA_FORMAT_420;
> +      case VDP_YCBCR_FORMAT_YV12:
> +         return PIPE_VIDEO_CHROMA_FORMAT_420;
> +      case VDP_YCBCR_FORMAT_UYVY:
> +         return PIPE_VIDEO_CHROMA_FORMAT_422;
> +      case VDP_YCBCR_FORMAT_YUYV:
> +         return PIPE_VIDEO_CHROMA_FORMAT_422;
> +      case VDP_YCBCR_FORMAT_Y8U8V8A8:
> +         return PIPE_VIDEO_CHROMA_FORMAT_444;
> +      case VDP_YCBCR_FORMAT_V8U8Y8A8:
> +         return PIPE_VIDEO_CHROMA_FORMAT_444;
> +      default:
> +         assert(0);
> +   }
> +
> +   return PIPE_FORMAT_NONE;
> +}

PIPE_FORMAT_NONE (0) is the same as PIPE_VIDEO_CHROMA_FORMAT_420 (0), is that intentional?
Isn't it better to return -1 or PIPE_VIDEO_CHROMA_FORMAT_420 in that case?

  



More information about the mesa-dev mailing list