video: API: Add GST_VIDEO_FORMAT_v308 for packed 4:4:4 YUV

This commit is contained in:
Sebastian Dröge 2010-04-23 15:22:07 +02:00
parent 838d76dc4b
commit 25c1a331be
2 changed files with 16 additions and 1 deletions

View file

@ -733,6 +733,8 @@ gst_video_format_from_fourcc (guint32 fourcc)
return GST_VIDEO_FORMAT_NV12;
case GST_MAKE_FOURCC ('N', 'V', '2', '1'):
return GST_VIDEO_FORMAT_NV21;
case GST_MAKE_FOURCC ('v', '3', '0', '8'):
return GST_VIDEO_FORMAT_v308;
default:
return GST_VIDEO_FORMAT_UNKNOWN;
}
@ -782,6 +784,8 @@ gst_video_format_to_fourcc (GstVideoFormat format)
return GST_MAKE_FOURCC ('N', 'V', '1', '2');
case GST_VIDEO_FORMAT_NV21:
return GST_MAKE_FOURCC ('N', 'V', '2', '1');
case GST_VIDEO_FORMAT_v308:
return GST_MAKE_FOURCC ('v', '3', '0', '8');
default:
return 0;
}
@ -887,6 +891,7 @@ gst_video_format_is_rgb (GstVideoFormat format)
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_v308:
return FALSE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
@ -931,6 +936,7 @@ gst_video_format_is_yuv (GstVideoFormat format)
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_v308:
return TRUE;
case GST_VIDEO_FORMAT_RGBx:
case GST_VIDEO_FORMAT_BGRx:
@ -998,6 +1004,7 @@ gst_video_format_has_alpha (GstVideoFormat format)
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_v308:
return FALSE;
case GST_VIDEO_FORMAT_AYUV:
case GST_VIDEO_FORMAT_RGBA:
@ -1067,6 +1074,7 @@ gst_video_format_get_row_stride (GstVideoFormat format, int component,
return width * 4;
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_v308:
return GST_ROUND_UP_4 (width * 3);
case GST_VIDEO_FORMAT_Y41B:
if (component == 0) {
@ -1146,6 +1154,7 @@ gst_video_format_get_pixel_stride (GstVideoFormat format, int component)
return 4;
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_v308:
return 3;
case GST_VIDEO_FORMAT_v210:
/* v210 is packed at the bit level, so pixel stride doesn't make sense */
@ -1227,6 +1236,7 @@ gst_video_format_get_component_width (GstVideoFormat format, int component,
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_v308:
case GST_VIDEO_FORMAT_NV12:
case GST_VIDEO_FORMAT_NV21:
case GST_VIDEO_FORMAT_GRAY8:
@ -1289,6 +1299,7 @@ gst_video_format_get_component_height (GstVideoFormat format, int component,
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_v210:
case GST_VIDEO_FORMAT_v216:
case GST_VIDEO_FORMAT_v308:
case GST_VIDEO_FORMAT_GRAY8:
case GST_VIDEO_FORMAT_GRAY16_BE:
case GST_VIDEO_FORMAT_GRAY16_LE:
@ -1426,6 +1437,7 @@ gst_video_format_get_component_offset (GstVideoFormat format, int component,
return 0;
return 0;
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_v308:
if (component == 0)
return 0;
if (component == 1)
@ -1538,6 +1550,7 @@ gst_video_format_get_size (GstVideoFormat format, int width, int height)
return width * 4 * height;
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_v308:
return GST_ROUND_UP_4 (width * 3) * height;
case GST_VIDEO_FORMAT_Y41B:
/* simplification of ROUNDUP4(w)*h + 2*((ROUNDUP16(w)/4)*h */

View file

@ -56,6 +56,7 @@ G_BEGIN_DECLS
* @GST_VIDEO_FORMAT_GRAY8: 8-bit grayscale (Since: 0.10.29)
* @GST_VIDEO_FORMAT_GRAY16_BE: 16-bit grayscale, most significant byte first (Since: 0.10.29)
* @GST_VIDEO_FORMAT_GRAY16_LE: 16-bit grayscale, least significant byte first (Since: 0.10.29)
* @GST_VIDEO_FORMAT_v308: packed 4:4:4 YUV (Since: 0.10.29)
*
* Enum value describing the most common video formats.
*/
@ -86,7 +87,8 @@ typedef enum {
GST_VIDEO_FORMAT_NV21,
GST_VIDEO_FORMAT_GRAY8,
GST_VIDEO_FORMAT_GRAY16_BE,
GST_VIDEO_FORMAT_GRAY16_LE
GST_VIDEO_FORMAT_GRAY16_LE,
GST_VIDEO_FORMAT_v308
} GstVideoFormat;
#define GST_VIDEO_BYTE1_MASK_32 "0xFF000000"