}
}
+#define PACK_INVZ16_LE GST_VIDEO_FORMAT_AYUV64, unpack_INVZ16_LE, 1, pack_INVZ16_LE
+static void
+unpack_INVZ16_LE (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+ gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES],
+ const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width)
+{
+ int i;
+ const guint16 *restrict s = GET_LINE (y);
+ guint16 *restrict d = dest;
+
+ s += x;
+
+ for (i = 0; i < width; i++) {
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = GST_READ_UINT16_LE (s + i);
+ d[i * 4 + 2] = 0x8000;
+ d[i * 4 + 3] = 0x8000;
+ }
+}
+
+static void
+pack_INVZ16_LE (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+ const gpointer src, gint sstride, gpointer data[GST_VIDEO_MAX_PLANES],
+ const gint stride[GST_VIDEO_MAX_PLANES], GstVideoChromaSite chroma_site,
+ gint y, gint width)
+{
+ int i;
+ guint16 *restrict d = GET_LINE (y);
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i++) {
+ GST_WRITE_UINT16_LE (d + i, s[i * 4 + 1]);
+ }
+}
+
typedef struct
{
guint32 fourcc;
#define MAKE_GRAY_C_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
{ 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_DEPTH_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+
static const VideoFormat formats[] = {
{0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
PSTR0, PLANE_NA, OFFS0}},
MAKE_YUV_FORMAT (I420, "raw video", GST_MAKE_FOURCC ('I', '4', '2', '0'),
DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+ MAKE_YUV_FORMAT (S420, "raw video", GST_MAKE_FOURCC ('S', '4', '2', '0'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
MAKE_YUV_FORMAT (YV12, "raw video", GST_MAKE_FOURCC ('Y', 'V', '1', '2'),
DPTH888, PSTR111, PLANE021, OFFS0, SUB420, PACK_420),
MAKE_YUV_FORMAT (YUY2, "raw video", GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
DPTH888, PSTR244, PLANE0, OFFS013, SUB422, PACK_YUY2),
MAKE_YUV_FORMAT (UYVY, "raw video", GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'),
DPTH888, PSTR244, PLANE0, OFFS102, SUB422, PACK_UYVY),
+ MAKE_YUV_FORMAT (ITLV, "raw video", GST_MAKE_FOURCC ('I', 'T', 'L', 'V'),
+ DPTH888, PSTR244, PLANE0, OFFS012, SUB422, PACK_UYVY),
MAKE_YUVA_PACK_FORMAT (AYUV, "raw video", GST_MAKE_FOURCC ('A', 'Y', 'U',
'V'), DPTH8888, PSTR4444, PLANE0, OFFS1230, SUB4444, PACK_AYUV),
MAKE_RGB_FORMAT (RGBx, "raw video", DPTH888, PSTR444, PLANE0, OFFS012,
SUB4444, PACK_RGBA),
MAKE_RGBA_FORMAT (BGRA, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS2103,
SUB4444, PACK_BGRA),
+ MAKE_RGBA_FORMAT (SR32, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS2103,
+ SUB4444, PACK_BGRA),
MAKE_RGBA_PACK_FORMAT (ARGB, "raw video", DPTH8888, PSTR4444, PLANE0,
OFFS1230, SUB4444, PACK_ARGB),
MAKE_RGBA_FORMAT (ABGR, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS3210,
DPTH16_16_16, PSTR488, PLANE0, OFFS204, SUB422, PACK_v216),
MAKE_YUV_FORMAT (NV12, "raw video", GST_MAKE_FOURCC ('N', 'V', '1', '2'),
DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
+ MAKE_YUV_FORMAT (SN12, "raw video", GST_MAKE_FOURCC ('S', 'N', '1', '2'),
+ DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
+ MAKE_YUV_FORMAT (ST12, "raw video", GST_MAKE_FOURCC ('S', 'T', '1', '2'),
+ DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
MAKE_YUV_FORMAT (NV21, "raw video", GST_MAKE_FOURCC ('N', 'V', '2', '1'),
DPTH888, PSTR122, PLANE011, OFFS010, SUB420, PACK_NV21),
+ MAKE_YUV_FORMAT (SN21, "raw video", GST_MAKE_FOURCC ('S', 'N', '2', '1'),
+ DPTH888, PSTR122, PLANE011, OFFS010, SUB420, PACK_NV21),
MAKE_GRAY_FORMAT (GRAY8, "raw video", DPTH8, PSTR1, PLANE0, OFFS0, SUB4,
PACK_GRAY8),
MAKE_RGBA_LE_PACK_FORMAT (BGR10A2_LE, "raw video", DPTH10_10_10_2, PSTR4444,
PLANE0,
OFFS0, SUB4444, PACK_BGR10A2_LE),
+ MAKE_DEPTH_FORMAT (INVZ, "raw video", GST_MAKE_FOURCC ('I', 'N', 'V', 'Z'),
+ DPTH16, PSTR2, PLANE0, OFFS0, SUB4, PACK_INVZ16_LE),
+#ifdef TIZEN_PROFILE_TV
+ MAKE_YUV_FORMAT (STV0, "raw video", GST_MAKE_FOURCC ('S', 'T', 'V', '0'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+ MAKE_YUV_FORMAT (STV1, "raw video", GST_MAKE_FOURCC ('S', 'T', 'V', '1'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+#endif
};
static GstVideoFormat
switch (fourcc) {
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
return GST_VIDEO_FORMAT_I420;
+ case GST_MAKE_FOURCC ('S', '4', '2', '0'):
+ return GST_VIDEO_FORMAT_S420;
+#ifdef TIZEN_PROFILE_TV
+ case GST_MAKE_FOURCC ('S', 'T', 'V', '0'):
+ return GST_VIDEO_FORMAT_STV0;
+ case GST_MAKE_FOURCC ('S', 'T', 'V', '1'):
+ return GST_VIDEO_FORMAT_STV1;
+#endif
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
return GST_VIDEO_FORMAT_YV12;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
return GST_VIDEO_FORMAT_YVYU;
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
return GST_VIDEO_FORMAT_UYVY;
+ case GST_MAKE_FOURCC ('I', 'T', 'L', 'V'):
+ return GST_VIDEO_FORMAT_ITLV;
case GST_MAKE_FOURCC ('V', 'Y', 'U', 'Y'):
return GST_VIDEO_FORMAT_VYUY;
case GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'):
return GST_VIDEO_FORMAT_Y210;
case GST_MAKE_FOURCC ('N', 'V', '1', '2'):
return GST_VIDEO_FORMAT_NV12;
+ case GST_MAKE_FOURCC ('S', 'N', '1', '2'):
+ return GST_VIDEO_FORMAT_SN12;
+ case GST_MAKE_FOURCC ('S', 'T', '1', '2'):
+ return GST_VIDEO_FORMAT_ST12;
case GST_MAKE_FOURCC ('N', 'V', '2', '1'):
return GST_VIDEO_FORMAT_NV21;
+ case GST_MAKE_FOURCC ('S', 'N', '2', '1'):
+ return GST_VIDEO_FORMAT_SN21;
case GST_MAKE_FOURCC ('N', 'V', '1', '6'):
return GST_VIDEO_FORMAT_NV16;
case GST_MAKE_FOURCC ('N', 'V', '6', '1'):
return GST_VIDEO_FORMAT_VUYA;
case GST_MAKE_FOURCC ('A', 'R', '3', '0'):
return GST_VIDEO_FORMAT_BGR10A2_LE;
-
+ case GST_MAKE_FOURCC ('I', 'N', 'V', 'Z'):
+ return GST_VIDEO_FORMAT_INVZ;
default:
return GST_VIDEO_FORMAT_UNKNOWN;
}