Commit ef3712b4 authored by David Schleef's avatar David Schleef

Revert "video: Remove the extensive checkings from switch"

This reverts commit 500d14c3.
parent 86f679aa
...@@ -1061,6 +1061,27 @@ gboolean ...@@ -1061,6 +1061,27 @@ gboolean
gst_video_format_is_rgb (GstVideoFormat format) gst_video_format_is_rgb (GstVideoFormat format)
{ {
switch (format) { switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_v210:
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_v308:
case GST_VIDEO_FORMAT_UYVP:
case GST_VIDEO_FORMAT_A420:
case GST_VIDEO_FORMAT_YUV9:
case GST_VIDEO_FORMAT_YVU9:
case GST_VIDEO_FORMAT_IYU1:
case GST_VIDEO_FORMAT_AYUV64:
return FALSE;
case GST_VIDEO_FORMAT_RGBx: case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx: case GST_VIDEO_FORMAT_BGRx:
case GST_VIDEO_FORMAT_xRGB: case GST_VIDEO_FORMAT_xRGB:
...@@ -1121,6 +1142,24 @@ gst_video_format_is_yuv (GstVideoFormat format) ...@@ -1121,6 +1142,24 @@ gst_video_format_is_yuv (GstVideoFormat format)
case GST_VIDEO_FORMAT_IYU1: case GST_VIDEO_FORMAT_IYU1:
case GST_VIDEO_FORMAT_AYUV64: case GST_VIDEO_FORMAT_AYUV64:
return TRUE; return TRUE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
case GST_VIDEO_FORMAT_xRGB:
case GST_VIDEO_FORMAT_xBGR:
case GST_VIDEO_FORMAT_RGBA:
case GST_VIDEO_FORMAT_BGRA:
case GST_VIDEO_FORMAT_ARGB:
case GST_VIDEO_FORMAT_ABGR:
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_RGB16:
case GST_VIDEO_FORMAT_BGR16:
case GST_VIDEO_FORMAT_RGB15:
case GST_VIDEO_FORMAT_BGR15:
case GST_VIDEO_FORMAT_RGB8_PALETTED:
case GST_VIDEO_FORMAT_ARGB64:
case GST_VIDEO_FORMAT_r210:
return FALSE;
default: default:
return FALSE; return FALSE;
} }
...@@ -1166,6 +1205,26 @@ gboolean ...@@ -1166,6 +1205,26 @@ gboolean
gst_video_format_has_alpha (GstVideoFormat format) gst_video_format_has_alpha (GstVideoFormat format)
{ {
switch (format) { switch (format) {
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_YUY2:
case GST_VIDEO_FORMAT_YVYU:
case GST_VIDEO_FORMAT_UYVY:
case GST_VIDEO_FORMAT_Y41B:
case GST_VIDEO_FORMAT_Y42B:
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_v210:
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_v308:
case GST_VIDEO_FORMAT_Y800:
case GST_VIDEO_FORMAT_Y16:
case GST_VIDEO_FORMAT_UYVP:
case GST_VIDEO_FORMAT_YUV9:
case GST_VIDEO_FORMAT_YVU9:
case GST_VIDEO_FORMAT_IYU1:
return FALSE;
case GST_VIDEO_FORMAT_AYUV: case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_RGBA: case GST_VIDEO_FORMAT_RGBA:
case GST_VIDEO_FORMAT_BGRA: case GST_VIDEO_FORMAT_BGRA:
...@@ -1176,6 +1235,18 @@ gst_video_format_has_alpha (GstVideoFormat format) ...@@ -1176,6 +1235,18 @@ gst_video_format_has_alpha (GstVideoFormat format)
case GST_VIDEO_FORMAT_ARGB64: case GST_VIDEO_FORMAT_ARGB64:
case GST_VIDEO_FORMAT_AYUV64: case GST_VIDEO_FORMAT_AYUV64:
return TRUE; return TRUE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
case GST_VIDEO_FORMAT_xRGB:
case GST_VIDEO_FORMAT_xBGR:
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_RGB16:
case GST_VIDEO_FORMAT_BGR16:
case GST_VIDEO_FORMAT_RGB15:
case GST_VIDEO_FORMAT_BGR15:
case GST_VIDEO_FORMAT_r210:
return FALSE;
default: default:
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment