'gstphysmemory.h',
'gstdmabuf.h',
]
++
++if tbm_dep.found()
++ gst_allocators_headers += [
++ 'gsttizenmemory.h',
++ 'gsttizenbufferpool.h',
++ ]
++endif
install_headers(gst_allocators_headers, subdir : 'gstreamer-1.0/gst/allocators/')
gst_allocators_sources = [ 'gstdmabuf.c', 'gstfdmemory.c', 'gstphysmemory.c']
++if tbm_dep.found()
++ gst_allocators_sources += ['gsttizenmemory.c', 'gsttizenbufferpool.c']
++endif
++
gstallocators = library('gstallocators-@0@'.format(api_version),
gst_allocators_sources,
c_args : gst_plugins_base_args + ['-DBUILDING_GST_ALLOCATORS'],
soversion : soversion,
darwin_versions : osxversion,
install : true,
-- dependencies : [gst_dep],
++ dependencies : [gst_dep, video_dep, tbm_dep],
+)
+
+pkgconfig.generate(gstallocators,
+ libraries : [gst_dep],
+ variables : pkgconfig_variables,
+ subdirs : pkgconfig_subdirs,
+ name : 'gstreamer-allocators-1.0',
+ description : 'Allocators implementation',
)
allocators_gen_sources = []
allocators_dep = declare_dependency(link_with: gstallocators,
include_directories : [libsinc],
-- dependencies : [gst_dep],
++ dependencies : [gst_dep, video_dep, tbm_dep],
sources : allocators_gen_sources)
+
+meson.override_dependency('gstreamer-allocators-1.0', allocators_dep)
#include <glib.h>
#include <string.h>
#include <math.h>
+ #ifdef USE_TBM
+ #include <gst/allocators/gsttizenmemory.h>
+ #endif
+#include <gst/base/base.h>
#include "video-orc.h"
case GST_VIDEO_FORMAT_NV16_10LE32:
case GST_VIDEO_FORMAT_NV12_10LE40:
case GST_VIDEO_FORMAT_BGR10A2_LE:
+ #ifdef USE_TBM
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12:
+ #endif
+ case GST_VIDEO_FORMAT_RGB10A2_LE:
+ case GST_VIDEO_FORMAT_Y444_16BE:
+ case GST_VIDEO_FORMAT_Y444_16LE:
+ case GST_VIDEO_FORMAT_P016_BE:
+ case GST_VIDEO_FORMAT_P016_LE:
+ case GST_VIDEO_FORMAT_P012_BE:
+ case GST_VIDEO_FORMAT_P012_LE:
+ case GST_VIDEO_FORMAT_Y212_BE:
+ case GST_VIDEO_FORMAT_Y212_LE:
+ case GST_VIDEO_FORMAT_Y412_BE:
+ case GST_VIDEO_FORMAT_Y412_LE:
res = format;
g_assert_not_reached ();
break;
-
+ #ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ default:
+ break;
+ #endif
}
return res;
}
}
}
-typedef struct
+ #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]);
+ }
+ }
+
+#define PACK_RGB10A2_LE GST_VIDEO_FORMAT_ARGB64, unpack_rgb10a2_le, 1, pack_rgb10a2_le
+static void
+unpack_rgb10a2_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)
{
- guint32 fourcc;
- GstVideoFormatInfo info;
-} VideoFormat;
+ int i;
+ const guint8 *restrict s = GET_LINE (y);
+ guint16 *restrict d = dest;
+ guint32 ARGB;
+ guint16 A, R, G, B;
-/* depths: bits, n_components, shift, depth */
-#define DPTH0 0, 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
-#define DPTH8 8, 1, { 0, 0, 0, 0 }, { 8, 0, 0, 0 }
-#define DPTH8_32 8, 2, { 0, 0, 0, 0 }, { 8, 32, 0, 0 }
-#define DPTH888 8, 3, { 0, 0, 0, 0 }, { 8, 8, 8, 0 }
-#define DPTH8888 8, 4, { 0, 0, 0, 0 }, { 8, 8, 8, 8 }
-#define DPTH8880 8, 4, { 0, 0, 0, 0 }, { 8, 8, 8, 0 }
-#define DPTH10 10, 1, { 0, 0, 0, 0 }, { 10, 0, 0, 0 }
-#define DPTH10_10_10 10, 3, { 0, 0, 0, 0 }, { 10, 10, 10, 0 }
-#define DPTH10_10_10_10 10, 4, { 0, 0, 0, 0 }, { 10, 10, 10, 10 }
-#define DPTH10_10_10_HI 16, 3, { 6, 6, 6, 0 }, { 10, 10, 10, 0 }
-#define DPTH10_10_10_2 10, 4, { 0, 0, 0, 0 }, { 10, 10, 10, 2}
-#define DPTH12_12_12 12, 3, { 0, 0, 0, 0 }, { 12, 12, 12, 0 }
-#define DPTH12_12_12_12 12, 4, { 0, 0, 0, 0 }, { 12, 12, 12, 12 }
-#define DPTH16 16, 1, { 0, 0, 0, 0 }, { 16, 0, 0, 0 }
-#define DPTH16_16_16 16, 3, { 0, 0, 0, 0 }, { 16, 16, 16, 0 }
-#define DPTH16_16_16_16 16, 4, { 0, 0, 0, 0 }, { 16, 16, 16, 16 }
-#define DPTH555 16, 3, { 10, 5, 0, 0 }, { 5, 5, 5, 0 }
-#define DPTH565 16, 3, { 11, 5, 0, 0 }, { 5, 6, 5, 0 }
+ s += x * 4;
-/* pixel strides */
-#define PSTR0 { 0, 0, 0, 0 }
-#define PSTR1 { 1, 0, 0, 0 }
-#define PSTR14 { 1, 4, 0, 0 }
-#define PSTR111 { 1, 1, 1, 0 }
-#define PSTR1111 { 1, 1, 1, 1 }
-#define PSTR122 { 1, 2, 2, 0 }
-#define PSTR2 { 2, 0, 0, 0 }
-#define PSTR222 { 2, 2, 2, 0 }
-#define PSTR2222 { 2, 2, 2, 2 }
-#define PSTR244 { 2, 4, 4, 0 }
-#define PSTR444 { 4, 4, 4, 0 }
-#define PSTR4444 { 4, 4, 4, 4 }
-#define PSTR333 { 3, 3, 3, 0 }
-#define PSTR488 { 4, 8, 8, 0 }
-#define PSTR8888 { 8, 8, 8, 8 }
+ for (i = 0; i < width; i++) {
+ ARGB = GST_READ_UINT32_LE (s + 4 * i);
-/* planes, in what plane do we find component N */
-#define PLANE_NA 0, { 0, 0, 0, 0 }
-#define PLANE0 1, { 0, 0, 0, 0 }
-#define PLANE01 2, { 0, 1, 0, 0 }
-#define PLANE011 2, { 0, 1, 1, 0 }
-#define PLANE012 3, { 0, 1, 2, 0 }
-#define PLANE0123 4, { 0, 1, 2, 3 }
-#define PLANE021 3, { 0, 2, 1, 0 }
-#define PLANE201 3, { 2, 0, 1, 0 }
-#define PLANE2013 4, { 2, 0, 1, 3 }
+ R = ((ARGB >> 0) & 0x3ff) << 6;
+ G = ((ARGB >> 10) & 0x3ff) << 6;
+ B = ((ARGB >> 20) & 0x3ff) << 6;
+ A = ((ARGB >> 30) & 0x03) << 14;
-/* offsets */
-#define OFFS0 { 0, 0, 0, 0 }
-#define OFFS013 { 0, 1, 3, 0 }
-#define OFFS102 { 1, 0, 2, 0 }
-#define OFFS1230 { 1, 2, 3, 0 }
-#define OFFS012 { 0, 1, 2, 0 }
-#define OFFS210 { 2, 1, 0, 0 }
-#define OFFS123 { 1, 2, 3, 0 }
-#define OFFS321 { 3, 2, 1, 0 }
-#define OFFS0123 { 0, 1, 2, 3 }
-#define OFFS2103 { 2, 1, 0, 3 }
-#define OFFS3210 { 3, 2, 1, 0 }
-#define OFFS031 { 0, 3, 1, 0 }
-#define OFFS204 { 2, 0, 4, 0 }
-#define OFFS001 { 0, 0, 1, 0 }
-#define OFFS010 { 0, 1, 0, 0 }
-#define OFFS104 { 1, 0, 4, 0 }
-#define OFFS2460 { 2, 4, 6, 0 }
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ R |= (R >> 10);
+ G |= (G >> 10);
+ B |= (B >> 10);
+ A |= (A >> 10);
+ }
-/* subsampling, w_sub, h_sub */
-#define SUB410 { 0, 2, 2, 0 }, { 0, 2, 2, 0 }
-#define SUB411 { 0, 2, 2, 0 }, { 0, 0, 0, 0 }
-#define SUB420 { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
-#define SUB422 { 0, 1, 1, 0 }, { 0, 0, 0, 0 }
-#define SUB4 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
-#define SUB44 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
-#define SUB444 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
-#define SUB4444 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
-#define SUB4204 { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
-#define SUB4224 { 0, 1, 1, 0 }, { 0, 0, 0, 0 }
+ d[4 * i + 0] = A;
+ d[4 * i + 1] = R;
+ d[4 * i + 2] = G;
+ d[4 * i + 3] = B;
+ }
+}
-/* tile_mode, tile_width, tile_height */
-#define TILE_64x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 6, 5
+static void
+pack_rgb10a2_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;
+ guint32 *restrict d = GET_LINE (y);
+ const guint16 *restrict s = src;
+ guint32 ARGB;
+ guint16 A, R, G, B;
-#define MAKE_YUV_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUV_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUVA_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUVA_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUVA_PACK_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUVA_LE_PACK_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUV_C_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUV_C_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_YUV_T_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack, tile) \
- { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_TILED, depth, pstride, plane, offs, sub, pack, tile } }
+ for (i = 0; i < width; i++) {
+ A = s[4 * i] & 0xc000;
+ R = s[4 * i + 1] & 0xffc0;
+ G = s[4 * i + 2] & 0xffc0;
+ B = s[4 * i + 3] & 0xffc0;
-#define MAKE_RGB_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGB_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGBA_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGBA_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGBAP_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_PALETTE, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGBA_PACK_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_RGBA_LE_PACK_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+ ARGB = (R >> 6) | (G << 4) | (B << 14) | (A << 16);
-#define MAKE_GRAY_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
- { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY, depth, pstride, plane, offs, sub, pack } }
-#define MAKE_GRAY_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_LE, depth, pstride, plane, offs, sub, pack } }
-#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 } }
+ GST_WRITE_UINT32_LE (d + i, ARGB);
+ }
+}
-static const VideoFormat formats[] = {
- {0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
- PSTR0, PLANE_NA, OFFS0}},
- {0x00000000, {GST_VIDEO_FORMAT_ENCODED, "ENCODED", "encoded video",
- GST_VIDEO_FORMAT_FLAG_COMPLEX, DPTH0, PSTR0, PLANE_NA, OFFS0}},
+ #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 } }
+
+#define PACK_Y444_16BE GST_VIDEO_FORMAT_AYUV64, unpack_Y444_16BE, 1, pack_Y444_16BE
+static void
+unpack_Y444_16BE (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;
+ guint16 *restrict sy = GET_Y_LINE (y);
+ guint16 *restrict su = GET_U_LINE (y);
+ guint16 *restrict sv = GET_V_LINE (y);
+ guint16 *restrict d = dest, Y, U, V;
- 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),
+ sy += x;
+ su += x;
+ sv += x;
+
+ for (i = 0; i < width; i++) {
+ Y = GST_READ_UINT16_BE (sy + i);
+ U = GST_READ_UINT16_BE (su + i);
+ V = GST_READ_UINT16_BE (sv + i);
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_Y444_16BE (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 dy = GET_Y_LINE (y);
+ guint16 *restrict du = GET_U_LINE (y);
+ guint16 *restrict dv = GET_V_LINE (y);
+ guint16 Y, U, V;
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i++) {
+ Y = s[i * 4 + 1];
+ U = s[i * 4 + 2];
+ V = s[i * 4 + 3];
+
+ GST_WRITE_UINT16_BE (dy + i, Y);
+ GST_WRITE_UINT16_BE (du + i, U);
+ GST_WRITE_UINT16_BE (dv + i, V);
+ }
+}
+
+#define PACK_Y444_16LE GST_VIDEO_FORMAT_AYUV64, unpack_Y444_16LE, 1, pack_Y444_16LE
+static void
+unpack_Y444_16LE (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;
+ guint16 *restrict sy = GET_Y_LINE (y);
+ guint16 *restrict su = GET_U_LINE (y);
+ guint16 *restrict sv = GET_V_LINE (y);
+ guint16 *restrict d = dest, Y, U, V;
+
+ sy += x;
+ su += x;
+ sv += x;
+
+ for (i = 0; i < width; i++) {
+ Y = GST_READ_UINT16_LE (sy + i);
+ U = GST_READ_UINT16_LE (su + i);
+ V = GST_READ_UINT16_LE (sv + i);
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_Y444_16LE (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 dy = GET_Y_LINE (y);
+ guint16 *restrict du = GET_U_LINE (y);
+ guint16 *restrict dv = GET_V_LINE (y);
+ guint16 Y, U, V;
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i++) {
+ Y = s[i * 4 + 1];
+ U = s[i * 4 + 2];
+ V = s[i * 4 + 3];
+
+ GST_WRITE_UINT16_LE (dy + i, Y);
+ GST_WRITE_UINT16_LE (du + i, U);
+ GST_WRITE_UINT16_LE (dv + i, V);
+ }
+}
+
+#define PACK_P016_BE GST_VIDEO_FORMAT_AYUV64, unpack_P016_BE, 1, pack_P016_BE
+static void
+unpack_P016_BE (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;
+ gint uv = GET_UV_420 (y, flags);
+ const guint16 *restrict sy = GET_PLANE_LINE (0, y);
+ const guint16 *restrict suv = GET_PLANE_LINE (1, uv);
+ guint16 *restrict d = dest, Y0, Y1, U, V;
+
+ sy += x;
+ suv += (x & ~1);
+
+ if (x & 1) {
+ Y0 = GST_READ_UINT16_BE (sy);
+ U = GST_READ_UINT16_BE (suv);
+ V = GST_READ_UINT16_BE (suv + 1);
+
+ d[0] = 0xffff;
+ d[1] = Y0;
+ d[2] = U;
+ d[3] = V;
+ width--;
+ d += 4;
+ sy += 1;
+ suv += 2;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_BE (sy + 2 * i);
+ Y1 = GST_READ_UINT16_BE (sy + 2 * i + 1);
+ U = GST_READ_UINT16_BE (suv + 2 * i);
+ V = GST_READ_UINT16_BE (suv + 2 * i + 1);
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = GST_READ_UINT16_BE (sy + i);
+ U = GST_READ_UINT16_BE (suv + i);
+ V = GST_READ_UINT16_BE (suv + i + 1);
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_P016_BE (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;
+ gint uv = GET_UV_420 (y, flags);
+ guint16 *restrict dy = GET_PLANE_LINE (0, y);
+ guint16 *restrict duv = GET_PLANE_LINE (1, uv);
+ guint16 Y0, Y1, U, V;
+ const guint16 *restrict s = src;
+
+ if (IS_CHROMA_LINE_420 (y, flags)) {
+ for (i = 0; i < width / 2; i++) {
+ Y0 = s[i * 8 + 1];
+ Y1 = s[i * 8 + 5];
+ U = s[i * 8 + 2];
+ V = s[i * 8 + 3];
+
+ GST_WRITE_UINT16_BE (dy + i * 2 + 0, Y0);
+ GST_WRITE_UINT16_BE (dy + i * 2 + 1, Y1);
+ GST_WRITE_UINT16_BE (duv + i * 2 + 0, U);
+ GST_WRITE_UINT16_BE (duv + i * 2 + 1, V);
+ }
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = s[i * 4 + 1];
+ U = s[i * 4 + 2];
+ V = s[i * 4 + 3];
+
+ GST_WRITE_UINT16_BE (dy + i, Y0);
+ GST_WRITE_UINT16_BE (duv + i + 0, U);
+ GST_WRITE_UINT16_BE (duv + i + 1, V);
+ }
+ } else {
+ for (i = 0; i < width; i++) {
+ Y0 = s[i * 4 + 1];
+ GST_WRITE_UINT16_BE (dy + i, Y0);
+ }
+ }
+}
+
+#define PACK_P016_LE GST_VIDEO_FORMAT_AYUV64, unpack_P016_LE, 1, pack_P016_LE
+static void
+unpack_P016_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;
+ gint uv = GET_UV_420 (y, flags);
+ const guint16 *restrict sy = GET_PLANE_LINE (0, y);
+ const guint16 *restrict suv = GET_PLANE_LINE (1, uv);
+ guint16 *restrict d = dest, Y0, Y1, U, V;
+
+ sy += x;
+ suv += (x & ~1);
+
+ if (x & 1) {
+ Y0 = GST_READ_UINT16_LE (sy);
+ U = GST_READ_UINT16_LE (suv);
+ V = GST_READ_UINT16_LE (suv + 1);
+
+ d[0] = 0xffff;
+ d[1] = Y0;
+ d[2] = U;
+ d[3] = V;
+ width--;
+ d += 4;
+ sy += 1;
+ suv += 2;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_LE (sy + 2 * i);
+ Y1 = GST_READ_UINT16_LE (sy + 2 * i + 1);
+ U = GST_READ_UINT16_LE (suv + 2 * i);
+ V = GST_READ_UINT16_LE (suv + 2 * i + 1);
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = GST_READ_UINT16_LE (sy + i);
+ U = GST_READ_UINT16_LE (suv + i);
+ V = GST_READ_UINT16_LE (suv + i + 1);
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_P016_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;
+ gint uv = GET_UV_420 (y, flags);
+ guint16 *restrict dy = GET_PLANE_LINE (0, y);
+ guint16 *restrict duv = GET_PLANE_LINE (1, uv);
+ guint16 Y0, Y1, U, V;
+ const guint16 *restrict s = src;
+
+ if (IS_CHROMA_LINE_420 (y, flags)) {
+ for (i = 0; i < width / 2; i++) {
+ Y0 = s[i * 8 + 1];
+ Y1 = s[i * 8 + 5];
+ U = s[i * 8 + 2];
+ V = s[i * 8 + 3];
+
+ GST_WRITE_UINT16_LE (dy + i * 2 + 0, Y0);
+ GST_WRITE_UINT16_LE (dy + i * 2 + 1, Y1);
+ GST_WRITE_UINT16_LE (duv + i * 2 + 0, U);
+ GST_WRITE_UINT16_LE (duv + i * 2 + 1, V);
+ }
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = s[i * 4 + 1];
+ U = s[i * 4 + 2];
+ V = s[i * 4 + 3];
+
+ GST_WRITE_UINT16_LE (dy + i, Y0);
+ GST_WRITE_UINT16_LE (duv + i + 0, U);
+ GST_WRITE_UINT16_LE (duv + i + 1, V);
+ }
+ } else {
+ for (i = 0; i < width; i++) {
+ Y0 = s[i * 4 + 1];
+ GST_WRITE_UINT16_LE (dy + i, Y0);
+ }
+ }
+}
+
+#define PACK_P012_BE GST_VIDEO_FORMAT_AYUV64, unpack_P012_BE, 1, pack_P012_BE
+static void
+unpack_P012_BE (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;
+ gint uv = GET_UV_420 (y, flags);
+ const guint16 *restrict sy = GET_PLANE_LINE (0, y);
+ const guint16 *restrict suv = GET_PLANE_LINE (1, uv);
+ guint16 *restrict d = dest, Y0, Y1, U, V;
+
+ sy += x;
+ suv += (x & ~1);
+
+ if (x & 1) {
+ Y0 = GST_READ_UINT16_BE (sy);
+ U = GST_READ_UINT16_BE (suv);
+ V = GST_READ_UINT16_BE (suv + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[0] = 0xffff;
+ d[1] = Y0;
+ d[2] = U;
+ d[3] = V;
+ width--;
+ d += 4;
+ sy += 1;
+ suv += 2;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_BE (sy + 2 * i);
+ Y1 = GST_READ_UINT16_BE (sy + 2 * i + 1);
+ U = GST_READ_UINT16_BE (suv + 2 * i);
+ V = GST_READ_UINT16_BE (suv + 2 * i + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ Y1 |= (Y1 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = GST_READ_UINT16_BE (sy + i);
+ U = GST_READ_UINT16_BE (suv + i);
+ V = GST_READ_UINT16_BE (suv + i + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_P012_BE (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;
+ gint uv = GET_UV_420 (y, flags);
+ guint16 *restrict dy = GET_PLANE_LINE (0, y);
+ guint16 *restrict duv = GET_PLANE_LINE (1, uv);
+ guint16 Y0, Y1, U, V;
+ const guint16 *restrict s = src;
+
+ if (IS_CHROMA_LINE_420 (y, flags)) {
+ for (i = 0; i < width / 2; i++) {
+ Y0 = s[i * 8 + 1] & 0xfff0;
+ Y1 = s[i * 8 + 5] & 0xfff0;
+ U = s[i * 8 + 2] & 0xfff0;
+ V = s[i * 8 + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_BE (dy + i * 2 + 0, Y0);
+ GST_WRITE_UINT16_BE (dy + i * 2 + 1, Y1);
+ GST_WRITE_UINT16_BE (duv + i * 2 + 0, U);
+ GST_WRITE_UINT16_BE (duv + i * 2 + 1, V);
+ }
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ U = s[i * 4 + 2] & 0xfff0;
+ V = s[i * 4 + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_BE (dy + i, Y0);
+ GST_WRITE_UINT16_BE (duv + i + 0, U);
+ GST_WRITE_UINT16_BE (duv + i + 1, V);
+ }
+ } else {
+ for (i = 0; i < width; i++) {
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ GST_WRITE_UINT16_BE (dy + i, Y0);
+ }
+ }
+}
+
+#define PACK_P012_LE GST_VIDEO_FORMAT_AYUV64, unpack_P012_LE, 1, pack_P012_LE
+static void
+unpack_P012_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;
+ gint uv = GET_UV_420 (y, flags);
+ const guint16 *restrict sy = GET_PLANE_LINE (0, y);
+ const guint16 *restrict suv = GET_PLANE_LINE (1, uv);
+ guint16 *restrict d = dest, Y0, Y1, U, V;
+
+ sy += x;
+ suv += (x & ~1);
+
+ if (x & 1) {
+ Y0 = GST_READ_UINT16_LE (sy);
+ U = GST_READ_UINT16_LE (suv);
+ V = GST_READ_UINT16_LE (suv + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[0] = 0xffff;
+ d[1] = Y0;
+ d[2] = U;
+ d[3] = V;
+ width--;
+ d += 4;
+ sy += 1;
+ suv += 2;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_LE (sy + 2 * i);
+ Y1 = GST_READ_UINT16_LE (sy + 2 * i + 1);
+ U = GST_READ_UINT16_LE (suv + 2 * i);
+ V = GST_READ_UINT16_LE (suv + 2 * i + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ Y1 |= (Y1 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = GST_READ_UINT16_LE (sy + i);
+ U = GST_READ_UINT16_LE (suv + i);
+ V = GST_READ_UINT16_LE (suv + i + 1);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_P012_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;
+ gint uv = GET_UV_420 (y, flags);
+ guint16 *restrict dy = GET_PLANE_LINE (0, y);
+ guint16 *restrict duv = GET_PLANE_LINE (1, uv);
+ guint16 Y0, Y1, U, V;
+ const guint16 *restrict s = src;
+
+ if (IS_CHROMA_LINE_420 (y, flags)) {
+ for (i = 0; i < width / 2; i++) {
+ Y0 = s[i * 8 + 1] & 0xfff0;
+ Y1 = s[i * 8 + 5] & 0xfff0;
+ U = s[i * 8 + 2] & 0xfff0;
+ V = s[i * 8 + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_LE (dy + i * 2 + 0, Y0);
+ GST_WRITE_UINT16_LE (dy + i * 2 + 1, Y1);
+ GST_WRITE_UINT16_LE (duv + i * 2 + 0, U);
+ GST_WRITE_UINT16_LE (duv + i * 2 + 1, V);
+ }
+ if (width & 1) {
+ gint i = width - 1;
+
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ U = s[i * 4 + 2] & 0xfff0;
+ V = s[i * 4 + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_LE (dy + i, Y0);
+ GST_WRITE_UINT16_LE (duv + i + 0, U);
+ GST_WRITE_UINT16_LE (duv + i + 1, V);
+ }
+ } else {
+ for (i = 0; i < width; i++) {
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ GST_WRITE_UINT16_LE (dy + i, Y0);
+ }
+ }
+}
+
+#define PACK_Y212_BE GST_VIDEO_FORMAT_AYUV64, unpack_Y212_BE, 1, pack_Y212_BE
+static void
+unpack_Y212_BE (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 guint8 *restrict s = GET_LINE (y);
+ guint16 *restrict d = dest;
+ guint Y0, Y1, U, V;
+
+ s += GST_ROUND_DOWN_2 (x) * 4;
+
+ if (x & 1) {
+ Y1 = GST_READ_UINT16_BE (s + 4);
+ U = GST_READ_UINT16_BE (s + 2);
+ V = GST_READ_UINT16_BE (s + 6);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y1 |= (Y1 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[0] = 0xffff;
+ d[1] = Y1;
+ d[2] = U;
+ d[3] = V;
+ s += 8;
+ d += 4;
+ width--;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_BE (s + i * 8 + 0);
+ U = GST_READ_UINT16_BE (s + i * 8 + 2);
+ V = GST_READ_UINT16_BE (s + i * 8 + 6);
+ Y1 = GST_READ_UINT16_BE (s + i * 8 + 4);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ i = width - 1;
+
+ Y0 = GST_READ_UINT16_BE (s + i * 4 + 0);
+ U = GST_READ_UINT16_BE (s + i * 4 + 2);
+ V = GST_READ_UINT16_BE (s + i * 4 + 6);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_Y212_BE (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 Y0, Y1, U, V;
+ guint8 *restrict d = GET_LINE (y);
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i += 2) {
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ U = s[i * 4 + 2] & 0xfff0;
+ V = s[i * 4 + 3] & 0xfff0;
+ if (i == width - 1)
+ Y1 = s[i * 4 + 1] & 0xfff0;
+ else
+ Y1 = s[(i + 1) * 4 + 1] & 0xfff0;
+
+ GST_WRITE_UINT16_BE (d + i * 4 + 0, Y0);
+ GST_WRITE_UINT16_BE (d + i * 4 + 2, U);
+ GST_WRITE_UINT16_BE (d + i * 4 + 4, Y1);
+ GST_WRITE_UINT16_BE (d + i * 4 + 6, V);
+ }
+}
+
+#define PACK_Y212_LE GST_VIDEO_FORMAT_AYUV64, unpack_Y212_LE, 1, pack_Y212_LE
+static void
+unpack_Y212_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 guint8 *restrict s = GET_LINE (y);
+ guint16 *restrict d = dest;
+ guint Y0, Y1, U, V;
+
+ s += GST_ROUND_DOWN_2 (x) * 4;
+
+ if (x & 1) {
+ Y1 = GST_READ_UINT16_LE (s + 4);
+ U = GST_READ_UINT16_LE (s + 2);
+ V = GST_READ_UINT16_LE (s + 6);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y1 |= (Y1 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[0] = 0xffff;
+ d[1] = Y1;
+ d[2] = U;
+ d[3] = V;
+ s += 8;
+ d += 4;
+ width--;
+ }
+
+ for (i = 0; i < width / 2; i++) {
+ Y0 = GST_READ_UINT16_LE (s + i * 8 + 0);
+ U = GST_READ_UINT16_LE (s + i * 8 + 2);
+ V = GST_READ_UINT16_LE (s + i * 8 + 6);
+ Y1 = GST_READ_UINT16_LE (s + i * 8 + 4);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 8 + 0] = 0xffff;
+ d[i * 8 + 1] = Y0;
+ d[i * 8 + 2] = U;
+ d[i * 8 + 3] = V;
+
+ d[i * 8 + 4] = 0xffff;
+ d[i * 8 + 5] = Y1;
+ d[i * 8 + 6] = U;
+ d[i * 8 + 7] = V;
+ }
+
+ if (width & 1) {
+ i = width - 1;
+
+ Y0 = GST_READ_UINT16_LE (s + i * 4 + 0);
+ U = GST_READ_UINT16_LE (s + i * 4 + 2);
+ V = GST_READ_UINT16_LE (s + i * 4 + 6);
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ Y0 |= (Y0 >> 12);
+ U |= (U >> 12);
+ V |= (V >> 12);
+ }
+
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = Y0;
+ d[i * 4 + 2] = U;
+ d[i * 4 + 3] = V;
+ }
+}
+
+static void
+pack_Y212_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 Y0, Y1, U, V;
+ guint8 *restrict d = GET_LINE (y);
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i += 2) {
+ Y0 = s[i * 4 + 1] & 0xfff0;
+ U = s[i * 4 + 2] & 0xfff0;
+ V = s[i * 4 + 3] & 0xfff0;
+ if (i == width - 1)
+ Y1 = s[i * 4 + 1] & 0xfff0;
+ else
+ Y1 = s[(i + 1) * 4 + 1] & 0xfff0;
+
+ GST_WRITE_UINT16_LE (d + i * 4 + 0, Y0);
+ GST_WRITE_UINT16_LE (d + i * 4 + 2, U);
+ GST_WRITE_UINT16_LE (d + i * 4 + 4, Y1);
+ GST_WRITE_UINT16_LE (d + i * 4 + 6, V);
+ }
+}
+
+#define PACK_Y412_BE GST_VIDEO_FORMAT_AYUV64, unpack_Y412_BE, 1, pack_Y412_BE
+static void
+unpack_Y412_BE (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;
+ guint16 A, Y, U, V;
+
+ s += x * 4;
+
+ for (i = 0; i < width; i++) {
+ U = GST_READ_UINT16_BE (s + 4 * i + 0) & 0xfff0;
+ Y = GST_READ_UINT16_BE (s + 4 * i + 1) & 0xfff0;
+ V = GST_READ_UINT16_BE (s + 4 * i + 2) & 0xfff0;
+ A = GST_READ_UINT16_BE (s + 4 * i + 3) & 0xfff0;
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ U |= (U >> 12);
+ Y |= (Y >> 12);
+ V |= (V >> 12);
+ A |= (A >> 12);
+ }
+
+ d[4 * i + 0] = A;
+ d[4 * i + 1] = Y;
+ d[4 * i + 2] = U;
+ d[4 * i + 3] = V;
+ }
+}
+
+static void
+pack_Y412_BE (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;
+ guint16 A, Y, U, V;
+
+ for (i = 0; i < width; i++) {
+ A = s[4 * i + 0] & 0xfff0;
+ Y = s[4 * i + 1] & 0xfff0;
+ U = s[4 * i + 2] & 0xfff0;
+ V = s[4 * i + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_BE (d + 4 * i + 0, U);
+ GST_WRITE_UINT16_BE (d + 4 * i + 1, Y);
+ GST_WRITE_UINT16_BE (d + 4 * i + 2, V);
+ GST_WRITE_UINT16_BE (d + 4 * i + 3, A);
+ }
+}
+
+#define PACK_Y412_LE GST_VIDEO_FORMAT_AYUV64, unpack_Y412_LE, 1, pack_Y412_LE
+static void
+unpack_Y412_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;
+ guint16 A, Y, U, V;
+
+ s += x * 4;
+
+ for (i = 0; i < width; i++) {
+ U = GST_READ_UINT16_LE (s + 4 * i + 0) & 0xfff0;
+ Y = GST_READ_UINT16_LE (s + 4 * i + 1) & 0xfff0;
+ V = GST_READ_UINT16_LE (s + 4 * i + 2) & 0xfff0;
+ A = GST_READ_UINT16_LE (s + 4 * i + 3) & 0xfff0;
+
+ if (!(flags & GST_VIDEO_PACK_FLAG_TRUNCATE_RANGE)) {
+ U |= (U >> 12);
+ Y |= (Y >> 12);
+ V |= (V >> 12);
+ A |= (A >> 12);
+ }
+
+ d[4 * i + 0] = A;
+ d[4 * i + 1] = Y;
+ d[4 * i + 2] = U;
+ d[4 * i + 3] = V;
+ }
+}
+
+static void
+pack_Y412_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;
+ guint16 A, Y, U, V;
+
+ for (i = 0; i < width; i++) {
+ A = s[4 * i + 0] & 0xfff0;
+ Y = s[4 * i + 1] & 0xfff0;
+ U = s[4 * i + 2] & 0xfff0;
+ V = s[4 * i + 3] & 0xfff0;
+
+ GST_WRITE_UINT16_LE (d + 4 * i + 0, U);
+ GST_WRITE_UINT16_LE (d + 4 * i + 1, Y);
+ GST_WRITE_UINT16_LE (d + 4 * i + 2, V);
+ GST_WRITE_UINT16_LE (d + 4 * i + 3, A);
+ }
+}
+
+#define PACK_RGBP GST_VIDEO_FORMAT_ARGB, unpack_RGBP, 1, pack_RGBP
+static void
+unpack_RGBP (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)
+{
+ const guint8 *restrict sr = GET_R_LINE (y);
+ const guint8 *restrict sg = GET_G_LINE (y);
+ const guint8 *restrict sb = GET_B_LINE (y);
+
+ sr += x;
+ sg += x;
+ sb += x;
+
+ video_orc_unpack_Y444 (dest, sr, sg, sb, width);
+}
+
+static void
+pack_RGBP (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)
+{
+ guint8 *restrict dr = GET_R_LINE (y);
+ guint8 *restrict dg = GET_G_LINE (y);
+ guint8 *restrict db = GET_B_LINE (y);
+
+ video_orc_pack_Y444 (dr, dg, db, src, width);
+}
+
+#define PACK_BGRP GST_VIDEO_FORMAT_ARGB, unpack_BGRP, 1, pack_BGRP
+static void
+unpack_BGRP (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)
+{
+ const guint8 *restrict sr = GET_R_LINE (y);
+ const guint8 *restrict sg = GET_G_LINE (y);
+ const guint8 *restrict sb = GET_B_LINE (y);
+
+ sr += x;
+ sg += x;
+ sb += x;
+
+ video_orc_unpack_Y444 (dest, sr, sg, sb, width);
+}
+
+static void
+pack_BGRP (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)
+{
+ guint8 *restrict dr = GET_R_LINE (y);
+ guint8 *restrict dg = GET_G_LINE (y);
+ guint8 *restrict db = GET_B_LINE (y);
+
+ video_orc_pack_Y444 (dr, dg, db, src, width);
+}
+
+typedef struct
+{
+ guint32 fourcc;
+ GstVideoFormatInfo info;
+} VideoFormat;
+
+/* depths: bits, n_components, shift, depth */
+#define DPTH0 0, 0, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+#define DPTH8 8, 1, { 0, 0, 0, 0 }, { 8, 0, 0, 0 }
+#define DPTH8_32 8, 2, { 0, 0, 0, 0 }, { 8, 32, 0, 0 }
+#define DPTH888 8, 3, { 0, 0, 0, 0 }, { 8, 8, 8, 0 }
+#define DPTH8888 8, 4, { 0, 0, 0, 0 }, { 8, 8, 8, 8 }
+#define DPTH8880 8, 4, { 0, 0, 0, 0 }, { 8, 8, 8, 0 }
+#define DPTH10 10, 1, { 0, 0, 0, 0 }, { 10, 0, 0, 0 }
+#define DPTH10_10_10 10, 3, { 0, 0, 0, 0 }, { 10, 10, 10, 0 }
+#define DPTH10_10_10_10 10, 4, { 0, 0, 0, 0 }, { 10, 10, 10, 10 }
+#define DPTH10_10_10_HI 16, 3, { 6, 6, 6, 0 }, { 10, 10, 10, 0 }
+#define DPTH10_10_10_2 10, 4, { 0, 0, 0, 0 }, { 10, 10, 10, 2}
+#define DPTH12_12_12 12, 3, { 0, 0, 0, 0 }, { 12, 12, 12, 0 }
+#define DPTH12_12_12_HI 16, 3, { 4, 4, 4, 0 }, { 12, 12, 12, 0 }
+#define DPTH12_12_12_12 12, 4, { 0, 0, 0, 0 }, { 12, 12, 12, 12 }
+#define DPTH12_12_12_12_HI 16, 4, { 4, 4, 4, 4 }, { 12, 12, 12, 12 }
+#define DPTH16 16, 1, { 0, 0, 0, 0 }, { 16, 0, 0, 0 }
+#define DPTH16_16_16 16, 3, { 0, 0, 0, 0 }, { 16, 16, 16, 0 }
+#define DPTH16_16_16_16 16, 4, { 0, 0, 0, 0 }, { 16, 16, 16, 16 }
+#define DPTH555 5, 3, { 10, 5, 0, 0 }, { 5, 5, 5, 0 }
+#define DPTH565 6, 3, { 11, 5, 0, 0 }, { 5, 6, 5, 0 }
+
+/* pixel strides */
+#define PSTR0 { 0, 0, 0, 0 }
+#define PSTR1 { 1, 0, 0, 0 }
+#define PSTR14 { 1, 4, 0, 0 }
+#define PSTR111 { 1, 1, 1, 0 }
+#define PSTR1111 { 1, 1, 1, 1 }
+#define PSTR122 { 1, 2, 2, 0 }
+#define PSTR1221 { 1, 2, 2, 1 }
+#define PSTR2 { 2, 0, 0, 0 }
+#define PSTR222 { 2, 2, 2, 0 }
+#define PSTR2222 { 2, 2, 2, 2 }
+#define PSTR244 { 2, 4, 4, 0 }
+#define PSTR444 { 4, 4, 4, 0 }
+#define PSTR4444 { 4, 4, 4, 4 }
+#define PSTR333 { 3, 3, 3, 0 }
+#define PSTR488 { 4, 8, 8, 0 }
+#define PSTR8888 { 8, 8, 8, 8 }
+
+/* planes, in what plane do we find component N */
+#define PLANE_NA 0, { 0, 0, 0, 0 }
+#define PLANE0 1, { 0, 0, 0, 0 }
+#define PLANE01 2, { 0, 1, 0, 0 }
+#define PLANE011 2, { 0, 1, 1, 0 }
+#define PLANE0112 3, { 0, 1, 1, 2 }
+#define PLANE012 3, { 0, 1, 2, 0 }
+#define PLANE0123 4, { 0, 1, 2, 3 }
+#define PLANE021 3, { 0, 2, 1, 0 }
+#define PLANE201 3, { 2, 0, 1, 0 }
+#define PLANE2013 4, { 2, 0, 1, 3 }
+#define PLANE210 3, { 2, 1, 0, 0 }
+
+/* offsets */
+#define OFFS0 { 0, 0, 0, 0 }
+#define OFFS013 { 0, 1, 3, 0 }
+#define OFFS102 { 1, 0, 2, 0 }
+#define OFFS1230 { 1, 2, 3, 0 }
+#define OFFS012 { 0, 1, 2, 0 }
+#define OFFS210 { 2, 1, 0, 0 }
+#define OFFS123 { 1, 2, 3, 0 }
+#define OFFS321 { 3, 2, 1, 0 }
+#define OFFS0123 { 0, 1, 2, 3 }
+#define OFFS2103 { 2, 1, 0, 3 }
+#define OFFS3210 { 3, 2, 1, 0 }
+#define OFFS031 { 0, 3, 1, 0 }
+#define OFFS204 { 2, 0, 4, 0 }
+#define OFFS001 { 0, 0, 1, 0 }
+#define OFFS010 { 0, 1, 0, 0 }
+#define OFFS104 { 1, 0, 4, 0 }
+#define OFFS2460 { 2, 4, 6, 0 }
+
+/* subsampling, w_sub, h_sub */
+#define SUB410 { 0, 2, 2, 0 }, { 0, 2, 2, 0 }
+#define SUB411 { 0, 2, 2, 0 }, { 0, 0, 0, 0 }
+#define SUB420 { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
+#define SUB422 { 0, 1, 1, 0 }, { 0, 0, 0, 0 }
+#define SUB4 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+#define SUB44 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+#define SUB444 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+#define SUB4444 { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
+#define SUB4204 { 0, 1, 1, 0 }, { 0, 1, 1, 0 }
+#define SUB4224 { 0, 1, 1, 0 }, { 0, 0, 0, 0 }
+
+/* tile_mode, tile_ws (width shift), tile_hs (height shift) */
+#define TILE_4x4(mode) GST_VIDEO_TILE_MODE_ ##mode, 2, 2
+#define TILE_32x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 5, 5
+#define TILE_64x32(mode) GST_VIDEO_TILE_MODE_ ##mode, 6, 5
+
+#define MAKE_YUV_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUV_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUVA_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUVA_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack ) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUVA_PACK_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUVA_LE_PACK_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUV_C_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUV_C_LE_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_YUV_T_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack, tile) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_YUV | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_TILED, depth, pstride, plane, offs, sub, pack, tile } }
+
+#define MAKE_RGB_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGB_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGBA_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGBA_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGBAP_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_PALETTE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGBA_PACK_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_RGBA_LE_PACK_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_RGB | GST_VIDEO_FORMAT_FLAG_ALPHA | GST_VIDEO_FORMAT_FLAG_UNPACK | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+
+#define MAKE_GRAY_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
+ { 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_GRAY_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_LE, depth, pstride, plane, offs, sub, pack } }
+#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 } }
+
+static const VideoFormat formats[] = {
+ {0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
+ PSTR0, PLANE_NA, OFFS0}},
+ {0x00000000, {GST_VIDEO_FORMAT_ENCODED, "ENCODED", "encoded video",
+ GST_VIDEO_FORMAT_FLAG_COMPLEX, 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'),
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
+ MAKE_RGBA_LE_PACK_FORMAT (RGB10A2_LE, "raw video", DPTH10_10_10_2, PSTR4444,
+ PLANE0, OFFS0, SUB4444, PACK_RGB10A2_LE),
+ MAKE_YUV_FORMAT (Y444_16BE, "raw video", 0x00000000, DPTH16_16_16,
+ PSTR222, PLANE012, OFFS0, SUB444, PACK_Y444_16BE),
+ MAKE_YUV_LE_FORMAT (Y444_16LE, "raw video", 0x00000000, DPTH16_16_16,
+ PSTR222, PLANE012, OFFS0, SUB444, PACK_Y444_16LE),
+ MAKE_YUV_FORMAT (P016_BE, "raw video", 0x00000000, DPTH16_16_16,
+ PSTR244, PLANE011, OFFS001, SUB420, PACK_P016_BE),
+ MAKE_YUV_LE_FORMAT (P016_LE, "raw video", 0x00000000, DPTH16_16_16,
+ PSTR244, PLANE011, OFFS001, SUB420, PACK_P016_LE),
+ MAKE_YUV_FORMAT (P012_BE, "raw video", 0x00000000, DPTH12_12_12_HI,
+ PSTR244, PLANE011, OFFS001, SUB420, PACK_P012_BE),
+ MAKE_YUV_LE_FORMAT (P012_LE, "raw video", 0x00000000, DPTH12_12_12_HI,
+ PSTR244, PLANE011, OFFS001, SUB420, PACK_P012_LE),
+ MAKE_YUV_FORMAT (Y212_BE, "raw video", 0x00000000, DPTH12_12_12_HI,
+ PSTR488, PLANE0, OFFS0, SUB422, PACK_Y212_BE),
+ MAKE_YUV_LE_FORMAT (Y212_LE, "raw video", 0x00000000, DPTH12_12_12_HI,
+ PSTR488, PLANE0, OFFS0, SUB422, PACK_Y212_LE),
+ MAKE_YUV_FORMAT (Y412_BE, "raw video", 0x00000000, DPTH12_12_12_12_HI,
+ PSTR8888, PLANE0, OFFS0, SUB4444, PACK_Y412_BE),
+ MAKE_YUV_LE_FORMAT (Y412_LE, "raw video", 0x00000000, DPTH12_12_12_12_HI,
+ PSTR8888, PLANE0, OFFS0, SUB4444, PACK_Y412_LE),
+ MAKE_YUV_T_FORMAT (NV12_4L4, "raw video",
+ GST_MAKE_FOURCC ('V', 'T', '1', '2'), DPTH888, PSTR122, PLANE011,
+ OFFS001, SUB420, PACK_NV12_TILED, TILE_4x4 (LINEAR)),
+ MAKE_YUV_T_FORMAT (NV12_32L32, "raw video",
+ GST_MAKE_FOURCC ('S', 'T', '1', '2'), DPTH888, PSTR122, PLANE011,
+ OFFS001, SUB420, PACK_NV12_TILED, TILE_32x32 (LINEAR)),
+ MAKE_RGB_FORMAT (RGBP, "raw video", DPTH888, PSTR111, PLANE012, OFFS0, SUB444,
+ PACK_RGBP),
+ MAKE_RGB_FORMAT (BGRP, "raw video", DPTH888, PSTR111, PLANE210, OFFS0, SUB444,
+ PACK_BGRP),
+ MAKE_YUV_FORMAT (AV12, "raw video", GST_MAKE_FOURCC ('A', 'V', '1', '2'),
+ DPTH8888, PSTR1221, PLANE0112, OFFS001, SUB4204, PACK_AV12),
};
static GstVideoFormat
GST_VIDEO_FORMAT_Y410,
GST_VIDEO_FORMAT_VUYA,
GST_VIDEO_FORMAT_BGR10A2_LE,
+ GST_VIDEO_FORMAT_INVZ,
+ GST_VIDEO_FORMAT_STV0, /* TIZEN_PROFILE_TV */
+ GST_VIDEO_FORMAT_STV1, /* TIZEN_PROFILE_TV */
+ GST_VIDEO_FORMAT_RGB10A2_LE,
+ GST_VIDEO_FORMAT_Y444_16BE,
+ GST_VIDEO_FORMAT_Y444_16LE,
+ GST_VIDEO_FORMAT_P016_BE,
+ GST_VIDEO_FORMAT_P016_LE,
+ GST_VIDEO_FORMAT_P012_BE,
+ GST_VIDEO_FORMAT_P012_LE,
+ GST_VIDEO_FORMAT_Y212_BE,
+ GST_VIDEO_FORMAT_Y212_LE,
+ GST_VIDEO_FORMAT_Y412_BE,
+ GST_VIDEO_FORMAT_Y412_LE,
+ /**
+ * GST_VIDEO_FORMAT_NV12_4L4:
+ *
+ * NV12 with 4x4 tiles in linear order.
+ *
+ * Since: 1.18
+ */
+ GST_VIDEO_FORMAT_NV12_4L4,
+ /**
+ * GST_VIDEO_FORMAT_NV12_32L32:
+ *
+ * NV12 with 32x32 tiles in linear order.
+ *
+ * Since: 1.18
+ */
+ GST_VIDEO_FORMAT_NV12_32L32,
+
+ /**
+ * GST_VIDEO_FORMAT_RGBP:
+ *
+ * Planar 4:4:4 RGB, R-G-B order
+ *
+ * Since: 1.20
+ */
+ GST_VIDEO_FORMAT_RGBP,
+
+ /**
+ * GST_VIDEO_FORMAT_BGRP:
+ *
+ * Planar 4:4:4 RGB, B-G-R order
+ *
+ * Since: 1.20
+ */
+ GST_VIDEO_FORMAT_BGRP,
+
+ /**
+ * GST_VIDEO_FORMAT_AV12:
+ *
+ * Planar 4:2:0 YUV with interleaved UV plane with alpha as
+ * 3rd plane.
+ *
+ * Since: 1.20
+ */
+ GST_VIDEO_FORMAT_AV12,
} GstVideoFormat;
#define GST_VIDEO_MAX_PLANES 4
# define GST_VIDEO_OE(s) G_STRINGIFY(s)"_LE"
#endif
-#define GST_VIDEO_FORMATS_ALL "{ I420, S420, YV12, YUY2, UYVY, ITLV, AYUV, " \
- "RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, SR32, ARGB, ABGR, RGB, BGR, Y41B, " \
- "Y42B, YVYU, Y444, v210, v216, NV12, SN12, ST12, NV21, SN21, GRAY8, GRAY16_BE, " \
- "GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, " \
- "IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, " \
- "Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, " \
- "A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, " \
- "VYUY, GBRA, GBRA_10BE, GBRA_10LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, " \
- "I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, " \
- "NV12_10LE32, NV16_10LE32, NV12_10LE40, Y210, Y410, VUYA, BGR10A2_LE, INVZ, STV0, STV1 }"
+/**
+ * GST_VIDEO_FORMATS_ALL:
+ *
+ * List of all video formats, for use in template caps strings.
+ *
+ * Formats are sorted by decreasing "quality", using these criteria by priority:
+ * - number of components
+ * - depth
+ * - subsampling factor of the width
+ * - subsampling factor of the height
+ * - number of planes
+ * - native endianness preferred
+ * - pixel stride
+ * - poffset
+ * - prefer non-complex formats
+ * - prefer YUV formats over RGB ones
+ * - prefer I420 over YV12
+ * - format name
+ */
+#if G_BYTE_ORDER == G_BIG_ENDIAN
+#define GST_VIDEO_FORMATS_ALL "{ AYUV64, ARGB64, GBRA_12BE, GBRA_12LE, Y412_BE, " \
+ "Y412_LE, A444_10BE, GBRA_10BE, A444_10LE, GBRA_10LE, A422_10BE, A422_10LE, " \
+ "A420_10BE, A420_10LE, Y410, RGB10A2_LE, BGR10A2_LE, GBRA, ABGR, VUYA, BGRA, " \
+ "AYUV, ARGB, RGBA, A420, AV12, Y444_16BE, Y444_16LE, v216, P016_BE, P016_LE, Y444_12BE, " \
+ "GBR_12BE, Y444_12LE, GBR_12LE, I422_12BE, I422_12LE, Y212_BE, Y212_LE, I420_12BE, " \
+ "I420_12LE, P012_BE, P012_LE, Y444_10BE, GBR_10BE, Y444_10LE, GBR_10LE, r210, " \
+ "I422_10BE, I422_10LE, NV16_10LE32, Y210, v210, UYVP, I420_10BE, I420_10LE, " \
+ "P010_10BE, P010_10LE, NV12_10LE32, NV12_10LE40, Y444, RGBP, GBR, BGRP, NV24, xBGR, BGRx, " \
+ "xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
+ "YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
++ "S420, ITLV, SN12, ST12, SN21, INVZ, STV0, STV1, " \
+ "BGR16, RGB15, BGR15, RGB8P, GRAY16_BE, GRAY16_LE, GRAY10_LE32, GRAY8 }"
+#elif G_BYTE_ORDER == G_LITTLE_ENDIAN
+#define GST_VIDEO_FORMATS_ALL "{ AYUV64, ARGB64, GBRA_12LE, GBRA_12BE, Y412_LE, " \
+ "Y412_BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, " \
+ "A420_10LE, A420_10BE, RGB10A2_LE, BGR10A2_LE, Y410, GBRA, ABGR, VUYA, BGRA, " \
+ "AYUV, ARGB, RGBA, A420, AV12, Y444_16LE, Y444_16BE, v216, P016_LE, P016_BE, Y444_12LE, " \
+ "GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, " \
+ "I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, " \
+ "I422_10LE, I422_10BE, NV16_10LE32, Y210, v210, UYVP, I420_10LE, I420_10BE, " \
+ "P010_10LE, NV12_10LE32, NV12_10LE40, P010_10BE, Y444, RGBP, GBR, BGRP, NV24, xBGR, BGRx, " \
+ "xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, " \
+ "YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, " \
++ "S420, ITLV, SN12, ST12, SN21, INVZ, STV0, STV1, " \
+ "BGR16, RGB15, BGR15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }"
+#endif
+
+GST_VIDEO_API
+const GstVideoFormat * gst_video_formats_raw (guint * len);
/**
* GST_VIDEO_CAPS_MAKE:
if (GST_VIDEO_INFO_IS_INTERLACED (info))
cr_h = GST_ROUND_UP_2 (cr_h);
info->size = info->offset[1] + info->stride[0] * cr_h;
+ #endif
break;
+ case GST_VIDEO_FORMAT_AV12:
+ info->stride[0] = GST_ROUND_UP_4 (width);
+ info->stride[1] = info->stride[0];
+ info->stride[2] = info->stride[0];
+ info->offset[0] = 0;
+ info->offset[1] = info->stride[0] * GST_ROUND_UP_2 (height);
+ info->offset[2] =
+ info->offset[1] + (info->stride[1] * GST_ROUND_UP_2 (height) / 2);
+ info->size = info->offset[2] + info->stride[2] * GST_ROUND_UP_2 (height);
+ break;
case GST_VIDEO_FORMAT_NV16:
case GST_VIDEO_FORMAT_NV61:
info->stride[0] = GST_ROUND_UP_4 (width);
gboolean shutdown; /* if we are shutting down */
GList *blocked_pads; /* pads that have set to block */
- gboolean expose_allstreams; /* Whether to expose unknow type streams or not */
+ gboolean expose_allstreams; /* Whether to expose unknown type streams or not */
+ #ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use trustzone flag*/
+ gboolean use_trustzone;
+ #endif
GList *filtered; /* elements for which error messages are filtered */
GList *filtered_errors; /* filtered error messages */
*/
gst_decodebin3_signals[SIGNAL_ABOUT_TO_FINISH] =
g_signal_new ("about-to-finish", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
- 0, G_TYPE_NONE);
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0, G_TYPE_NONE);
+ #ifdef TIZEN_FEATURE_RESOURCE_MANAGER
+ gst_decodebin3_signals[SIGNAL_REQUEST_RESOURCE] =
+ g_signal_new ("request-resource", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstDecodebin3Class, request_resource),
+ _gst_boolean_accumulator, NULL, g_cclosure_marshal_generic,
+ G_TYPE_BOOLEAN, 2, GST_TYPE_STREAM_COLLECTION, GST_TYPE_STREAM);
+ #endif
element_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_decodebin3_request_new_pad);
dbin->decodable_factories = NULL;
for (tmp = dbin->factories; tmp; tmp = tmp->next) {
GstElementFactory *fact = (GstElementFactory *) tmp->data;
-
if (gst_element_factory_list_is_type (fact,
- GST_ELEMENT_FACTORY_TYPE_DECODER))
- dbin->decoder_factories = g_list_append (dbin->decoder_factories, fact);
- else
+ GST_ELEMENT_FACTORY_TYPE_DECODER)) {
+ #ifdef TIZEN_FEATURE_FORCE_SW_DECODER
+ if (!(dbin->force_sw_decoders_for_video &&
+ gst_element_factory_list_is_type (fact, GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO) &&
+ gst_element_factory_list_is_type (fact, GST_ELEMENT_FACTORY_TYPE_HARDWARE)) &&
+ !(dbin->force_sw_decoders_for_audio &&
+ gst_element_factory_list_is_type (fact, GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO) &&
+ gst_element_factory_list_is_type (fact, GST_ELEMENT_FACTORY_TYPE_HARDWARE))) {
+ dbin->decoder_factories =
+ g_list_append (dbin->decoder_factories, fact);
+ } else {
+ GST_WARNING("%s is skipped", GST_OBJECT_NAME(fact));
+ }
+ #else
+ if (!(dbin->force_sw_decoders
+ && gst_element_factory_list_is_type (fact,
+ GST_ELEMENT_FACTORY_TYPE_HARDWARE))) {
+ dbin->decoder_factories =
+ g_list_append (dbin->decoder_factories, fact);
+ }
+ #endif
+ } else {
dbin->decodable_factories =
g_list_append (dbin->decodable_factories, fact);
+ }
}
}
}
/* If a decoder is required, create one */
if (needs_decoder) {
- /* If we don't have a decoder yet, instantiate one */
- output->decoder = create_decoder (dbin, slot->active_stream);
- if (output->decoder == NULL) {
- GstCaps *caps;
+ GList *factories, *next_factory;
- SELECTION_UNLOCK (dbin);
- /* FIXME : Should we be smarter if there's a missing decoder ?
- * Should we deactivate that stream ? */
- caps = gst_stream_get_caps (slot->active_stream);
- gst_element_post_message (GST_ELEMENT_CAST (dbin),
- gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps));
- gst_caps_unref (caps);
- SELECTION_LOCK (dbin);
- goto cleanup;
- }
- if (!gst_bin_add ((GstBin *) dbin, output->decoder)) {
- GST_ERROR_OBJECT (dbin, "could not add decoder to pipeline");
- goto cleanup;
- }
- output->decoder_sink = gst_element_get_static_pad (output->decoder, "sink");
- output->decoder_src = gst_element_get_static_pad (output->decoder, "src");
- if (output->type & GST_STREAM_TYPE_VIDEO) {
- GST_DEBUG_OBJECT (dbin, "Adding keyframe-waiter probe");
- output->drop_probe_id =
- gst_pad_add_probe (slot->src_pad, GST_PAD_PROBE_TYPE_BUFFER,
- (GstPadProbeCallback) keyframe_waiter_probe, output, NULL);
- }
- if (gst_pad_link_full (slot->src_pad, output->decoder_sink,
- GST_PAD_LINK_CHECK_NOTHING) != GST_PAD_LINK_OK) {
- GST_ERROR_OBJECT (dbin, "could not link to %s:%s",
- GST_DEBUG_PAD_NAME (output->decoder_sink));
- goto cleanup;
+ factories = next_factory = create_decoder_factory_list (dbin, new_caps);
+ while (!output->decoder) {
+ gboolean decoder_failed = FALSE;
+
+ /* If we don't have a decoder yet, instantiate one */
+ if (next_factory) {
++#ifdef TIZEN_FEATURE_RESOURCE_MANAGER
++ if (gst_element_factory_list_is_type (next_factory->data,
++ GST_ELEMENT_FACTORY_TYPE_HARDWARE)) {
++ gboolean result = FALSE;
++ g_signal_emit (G_OBJECT (dbin),
++ gst_decodebin3_signals[SIGNAL_REQUEST_RESOURCE], 0, dbin->collection, slot->active_stream,
++ &result);
++ if (!result) {
++ GstCaps *caps;
++ GST_WARNING_OBJECT (dbin, "Failed to get HW resource.");
++ SELECTION_UNLOCK (dbin);
++ caps = gst_stream_get_caps (slot->active_stream);
++ gst_element_post_message (GST_ELEMENT_CAST (dbin),
++ gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps));
++ gst_caps_unref (caps);
++ SELECTION_LOCK (dbin);
++ goto cleanup;
++ }
++ }
++#endif
+ output->decoder = gst_element_factory_create ((GstElementFactory *)
+ next_factory->data, NULL);
+ GST_DEBUG ("Created decoder '%s'", GST_ELEMENT_NAME (output->decoder));
+ } else
+ GST_DEBUG ("Could not find an element for caps %" GST_PTR_FORMAT,
+ new_caps);
+
+ if (output->decoder == NULL) {
+ GstCaps *caps;
+
+ SELECTION_UNLOCK (dbin);
+ /* FIXME : Should we be smarter if there's a missing decoder ?
+ * Should we deactivate that stream ? */
+ caps = gst_stream_get_caps (slot->active_stream);
+ gst_element_post_message (GST_ELEMENT_CAST (dbin),
+ gst_missing_decoder_message_new (GST_ELEMENT_CAST (dbin), caps));
+ gst_caps_unref (caps);
+ SELECTION_LOCK (dbin);
+ goto cleanup;
+ }
+ if (!gst_bin_add ((GstBin *) dbin, output->decoder)) {
+ GST_ERROR_OBJECT (dbin, "could not add decoder to pipeline");
+ goto cleanup;
+ }
+ output->decoder_sink =
+ gst_element_get_static_pad (output->decoder, "sink");
+ output->decoder_src = gst_element_get_static_pad (output->decoder, "src");
+ if (output->type & GST_STREAM_TYPE_VIDEO) {
+ GST_DEBUG_OBJECT (dbin, "Adding keyframe-waiter probe");
+ output->drop_probe_id =
+ gst_pad_add_probe (slot->src_pad, GST_PAD_PROBE_TYPE_BUFFER,
+ (GstPadProbeCallback) keyframe_waiter_probe, output, NULL);
+ }
+ if (gst_pad_link_full (slot->src_pad, output->decoder_sink,
+ GST_PAD_LINK_CHECK_NOTHING) != GST_PAD_LINK_OK) {
+ GST_ERROR_OBJECT (dbin, "could not link to %s:%s",
+ GST_DEBUG_PAD_NAME (output->decoder_sink));
+ goto cleanup;
+ }
+ if (gst_element_set_state (output->decoder,
+ GST_STATE_READY) == GST_STATE_CHANGE_FAILURE) {
+ GST_DEBUG_OBJECT (dbin,
+ "Decoder '%s' failed to reach READY state, trying the next type",
+ GST_ELEMENT_NAME (output->decoder));
+ decoder_failed = TRUE;
+ }
+ if (!gst_pad_query_accept_caps (output->decoder_sink, new_caps)) {
+ GST_DEBUG_OBJECT (dbin,
+ "Decoder '%s' did not accept the caps, trying the next type",
+ GST_ELEMENT_NAME (output->decoder));
+ decoder_failed = TRUE;
+ }
+ if (decoder_failed) {
+ gst_pad_unlink (slot->src_pad, output->decoder_sink);
+ if (output->drop_probe_id) {
+ gst_pad_remove_probe (slot->src_pad, output->drop_probe_id);
+ output->drop_probe_id = 0;
+ }
+
+ gst_element_set_locked_state (output->decoder, TRUE);
+ gst_element_set_state (output->decoder, GST_STATE_NULL);
+
+ gst_bin_remove ((GstBin *) dbin, output->decoder);
+ output->decoder = NULL;
+ }
+ next_factory = next_factory->next;
}
+ gst_plugin_feature_list_free (factories);
} else {
output->decoder_src = gst_object_ref (slot->src_pad);
output->decoder_sink = NULL;
#include "tmplayerparse.h"
#include "mpl2parse.h"
#include "qttextparse.h"
-
-GST_DEBUG_CATEGORY (sub_parse_debug);
+#include "gstsubparseelements.h"
+ #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ #define SUBPARSE_SEEK_GET_LOCK(elem) (&elem->seek_lock)
+ #define SUBPARSE_SEEK_LOCK(elem) g_mutex_lock(SUBPARSE_SEEK_GET_LOCK(elem))
+ #define SUBPARSE_SEEK_TRYLOCK(elem) g_mutex_trylock(SUBPARSE_SEEK_GET_LOCK(elem))
+ #define SUBPARSE_SEEK_UNLOCK(elem) g_mutex_unlock(SUBPARSE_SEEK_GET_LOCK(elem))
+ #endif
#define DEFAULT_ENCODING NULL
#define ATTRIBUTE_REGEX "\\s?[a-zA-Z0-9\\. \t\\(\\)]*"
static const gchar *allowed_srt_tags[] = { "i", "b", "u", NULL };
encoding, err->message);
g_clear_error (&err);
- ret = gst_convert_to_utf8 (str, len, encoding, consumed, &err);
- } else {
-#endif
- /* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */
- GST_LOG_OBJECT (self, "use ISO-8859-15 as fallback");
- ret = gst_convert_to_utf8 (str, len, "ISO-8859-15", consumed, NULL);
-#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
- }
+ #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (!g_strcmp0 (self->encoding, "EUC-KR")) {
+ GST_LOG_OBJECT (self, "use CP949 as fallback");
+ g_free (self->encoding);
+ self->encoding = g_strdup ("CP949");
+ encoding = self->encoding;
++ ret = gst_sub_parse_gst_convert_to_utf8 (str, len, encoding, consumed, &err);
++ } else
+ #endif
+ /* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */
+ ret =
+ gst_sub_parse_gst_convert_to_utf8 (str, len, "ISO-8859-15", consumed,
+ NULL);
}
GST_LOG_OBJECT (self,
handle_buffer (GstSubParse * self, GstBuffer * buf)
{
GstFlowReturn ret = GST_FLOW_OK;
-#ifndef TIZEN_FEATURE_UPSTREAM
- GstCaps *caps = NULL;
-#endif
gchar *line, *subtitle;
gboolean need_tags = FALSE;
+ #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GstMessage *m = NULL;
+ #endif
+ #ifdef TIZEN_FEATURE_HLS_WEBVTT
+ GstClockTime fragment_timestamp = GST_CLOCK_TIME_NONE;
+ #endif
if (self->first_buffer) {
GstMapInfo map;
line + offset);
subtitle = self->parse_line (&self->state, line + offset);
g_free (line);
-
+ #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (!self->state.langlist_msg_posted && self->state.language_list) {
+ m = gst_message_new_element (GST_OBJECT_CAST (self),
+ gst_structure_new ("Ext_Sub_Language_List", "lang_list",
+ G_TYPE_POINTER, self->state.language_list, NULL));
+
+ gst_element_post_message (GST_ELEMENT_CAST (self), m);
+ self->state.langlist_msg_posted = TRUE;
+ GST_DEBUG_OBJECT (self, "curr lang as : %s ",
+ GST_STR_NULL (self->state.current_language));
+ }
+ #endif
if (subtitle) {
-#ifdef TIZEN_FEATURE_UPSTREAM
guint subtitle_len;
if (self->strip_pango_markup) {
gboolean first_buffer;
/* used by frame based parsers */
- gint fps_n, fps_d;
+ gint fps_n, fps_d;
+ #ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GMutex seek_lock;
+ #endif
};
-struct _GstSubParseClass {
- GstElementClass parent_class;
-};
-
-GType gst_sub_parse_get_type (void);
-
G_END_DECLS
#endif /* __GST_SUBPARSE_H__ */
if (strcmp (category, "subtitles") == 0 || strcmp (category, "SUB") == 0 ||
strcmp (category, "spu-subtitles") == 0 ||
strcmp (category, "K-SPU") == 0) {
- gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM,
- "subtitle/x-kate", NULL);
+ gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_MAXIMUM,
+ "subtitle/x-kate");
} else {
- gst_type_find_suggest_simple (tf, GST_TYPE_FIND_MAXIMUM,
- "application/x-kate", NULL);
+ gst_type_find_suggest_empty_simple (tf, GST_TYPE_FIND_MAXIMUM,
+ "application/x-kate");
}
}
+ #endif
/*** WEBVTTT subtitles ***/
static GstStaticCaps webvtt_caps =
}
}
-/*** generic typefind for streams that have some data at a specific position***/
-typedef struct
-{
- const guint8 *data;
- guint size;
- guint probability;
- GstCaps *caps;
-}
-GstTypeFindData;
-
-static void
-start_with_type_find (GstTypeFind * tf, gpointer private)
-{
- GstTypeFindData *start_with = (GstTypeFindData *) private;
- const guint8 *data;
-
- GST_LOG ("trying to find mime type %s with the first %u bytes of data",
- gst_structure_get_name (gst_caps_get_structure (start_with->caps, 0)),
- start_with->size);
- data = gst_type_find_peek (tf, 0, start_with->size);
- if (data && memcmp (data, start_with->data, start_with->size) == 0) {
- gst_type_find_suggest (tf, start_with->probability, start_with->caps);
- }
-}
-
-static void
-sw_data_destroy (GstTypeFindData * sw_data)
-{
- if (G_LIKELY (sw_data->caps != NULL))
- gst_caps_unref (sw_data->caps);
- g_slice_free (GstTypeFindData, sw_data);
-}
-
-#define TYPE_FIND_REGISTER_START_WITH(plugin,name,rank,ext,_data,_size,_probability)\
-G_BEGIN_DECLS{ \
- GstTypeFindData *sw_data = g_slice_new (GstTypeFindData); \
- sw_data->data = (const guint8 *)_data; \
- sw_data->size = _size; \
- sw_data->probability = _probability; \
- sw_data->caps = gst_caps_new_empty_simple (name); \
- if (!gst_type_find_register (plugin, name, rank, start_with_type_find,\
- ext, sw_data->caps, sw_data, \
- (GDestroyNotify) (sw_data_destroy))) { \
- sw_data_destroy (sw_data); \
- } \
-}G_END_DECLS
-
-/*** same for riff types ***/
-
-static void
-riff_type_find (GstTypeFind * tf, gpointer private)
-{
- GstTypeFindData *riff_data = (GstTypeFindData *) private;
- const guint8 *data = gst_type_find_peek (tf, 0, 12);
-
- if (data && (memcmp (data, "RIFF", 4) == 0 || memcmp (data, "AVF0", 4) == 0)) {
- data += 8;
- if (memcmp (data, riff_data->data, 4) == 0)
- gst_type_find_suggest (tf, riff_data->probability, riff_data->caps);
- }
-}
-
-#define TYPE_FIND_REGISTER_RIFF(plugin,name,rank,ext,_data) \
-G_BEGIN_DECLS{ \
- GstTypeFindData *sw_data = g_slice_new (GstTypeFindData); \
- sw_data->data = (gpointer)_data; \
- sw_data->size = 4; \
- sw_data->probability = GST_TYPE_FIND_MAXIMUM; \
- sw_data->caps = gst_caps_new_empty_simple (name); \
- if (!gst_type_find_register (plugin, name, rank, riff_type_find, \
- ext, sw_data->caps, sw_data, \
- (GDestroyNotify) (sw_data_destroy))) { \
- sw_data_destroy (sw_data); \
- } \
-}G_END_DECLS
-
-
-/*** plugin initialization ***/
-
-#define TYPE_FIND_REGISTER(plugin,name,rank,func,ext,caps,priv,notify) \
-G_BEGIN_DECLS{\
- if (!gst_type_find_register (plugin, name, rank, func, ext, caps, priv, notify))\
- return FALSE; \
-}G_END_DECLS
-
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- /* can't initialize this via a struct as caps can't be statically initialized */
-
- GST_DEBUG_CATEGORY_INIT (type_find_debug, "typefindfunctions",
- GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions");
-
- /* note: asx/wax/wmx are XML files, asf doesn't handle them */
- /* must use strings, macros don't accept initializers */
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-ms-asf", GST_RANK_SECONDARY,
- "asf,wm,wma,wmv",
- "\060\046\262\165\216\146\317\021\246\331\000\252\000\142\316\154", 16,
- GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "audio/x-musepack", GST_RANK_PRIMARY,
- musepack_type_find, "mpc,mpp,mp+", MUSEPACK_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-au", GST_RANK_MARGINAL,
- au_type_find, "au,snd", AU_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_RIFF (plugin, "video/x-msvideo", GST_RANK_PRIMARY,
- "avi", "AVI ");
-#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER_RIFF (plugin, "audio/qcelp", GST_RANK_PRIMARY,
- "qcp", "QLCM");
- TYPE_FIND_REGISTER_RIFF (plugin, "video/x-cdxa", GST_RANK_PRIMARY,
- "dat", "CDXA");
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-vcd", GST_RANK_PRIMARY,
- "dat", "\000\377\377\377\377\377\377\377\377\377\377\000", 12,
- GST_TYPE_FIND_MAXIMUM);
-#endif
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-imelody", GST_RANK_PRIMARY,
- "imy,ime,imelody", "BEGIN:IMELODY", 13, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-scc", GST_RANK_PRIMARY,
- "scc", "Scenarist_SCC V1.0", 18, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "application/x-mcc", GST_RANK_PRIMARY,
- mcc_type_find, "mcc", MCC_CAPS, NULL, NULL);
+/*Type find definition by functions */
+GST_TYPE_FIND_REGISTER_DEFINE (musepack, "audio/x-musepack", GST_RANK_PRIMARY,
+ musepack_type_find, "mpc,mpp,mp+", MUSEPACK_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (au, "audio/x-au", GST_RANK_MARGINAL,
+ au_type_find, "au,snd", AU_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mcc, "application/x-mcc", GST_RANK_PRIMARY,
+ mcc_type_find, "mcc", MCC_CAPS, NULL, NULL);
#if 0
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-smoke", GST_RANK_PRIMARY,
- NULL, "\x80smoke\x00\x01\x00", 6, GST_TYPE_FIND_MAXIMUM);
+GST_TYPE_FIND_REGISTER_START_WITH_DEFINE (smoke, "video/x-smoke",
+ GST_RANK_PRIMARY, NULL, "\x80smoke\x00\x01\x00", 6, GST_TYPE_FIND_MAXIMUM);
#endif
- TYPE_FIND_REGISTER (plugin, "audio/midi", GST_RANK_PRIMARY, mid_type_find,
- "mid,midi", MID_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_RIFF (plugin, "audio/riff-midi", GST_RANK_PRIMARY,
- "mid,midi", "RMID");
- TYPE_FIND_REGISTER (plugin, "audio/mobile-xmf", GST_RANK_PRIMARY,
- mxmf_type_find, "mxmf", MXMF_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mid, "audio/midi", GST_RANK_PRIMARY,
+ mid_type_find, "mid,midi", MID_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mxmf, "audio/mobile-xmf", GST_RANK_PRIMARY,
+ mxmf_type_find, "mxmf", MXMF_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "video/x-fli", GST_RANK_MARGINAL, flx_type_find,
- "flc,fli", FLX_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (flx, "video/x-fli", GST_RANK_MARGINAL,
+ flx_type_find, "flc,fli", FLX_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "application/x-id3v2", GST_RANK_PRIMARY + 103,
- id3v2_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta", ID3_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-id3v1", GST_RANK_PRIMARY + 101,
- id3v1_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta", ID3_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-apetag", GST_RANK_PRIMARY + 102,
- apetag_type_find, "mp3,ape,mpc,wv", APETAG_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (id3v2, "application/x-id3v2",
+ GST_RANK_PRIMARY + 103, id3v2_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta",
+ ID3_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (id3v1, "application/x-id3v1",
+ GST_RANK_PRIMARY + 101, id3v1_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta",
+ ID3_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (apetag, "application/x-apetag",
+ GST_RANK_PRIMARY + 102, apetag_type_find, "mp3,ape,mpc,wv", APETAG_CAPS,
+ NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "audio/x-ttafile", GST_RANK_PRIMARY,
- tta_type_find, "tta", TTA_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-mod", GST_RANK_SECONDARY, mod_type_find,
- "669,amf,ams,dbm,digi,dmf,dsm,gdm,far,imf,it,j2b,mdl,med,mod,mt2,mtm,"
- "okt,psm,ptm,sam,s3m,stm,stx,ult,umx,xm", MOD_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (tta, "audio/x-ttafile", GST_RANK_PRIMARY,
+ tta_type_find, "tta", TTA_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mod, "audio/x-mod", GST_RANK_SECONDARY,
+ mod_type_find,
+ "669,amf,ams,dbm,digi,dmf,dsm,gdm,far,imf,it,j2b,mdl,med,mod,mt2,mtm,"
+ "okt,psm,ptm,sam,s3m,stm,stx,ult,umx,xm", MOD_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "audio/mpeg", GST_RANK_PRIMARY, mp3_type_find,
- "mp3,mp2,mp1,mpga", MP3_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-ac3", GST_RANK_PRIMARY, ac3_type_find,
- "ac3,eac3", AC3_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-dts", GST_RANK_SECONDARY, dts_type_find,
- "dts", DTS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mp3, "audio/mpeg", GST_RANK_PRIMARY,
+ mp3_type_find, "mp3,mp2,mp1,mpga", MP3_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ac3, "audio/x-ac3", GST_RANK_PRIMARY,
+ ac3_type_find, "ac3,eac3", AC3_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (dts, "audio/x-dts", GST_RANK_SECONDARY,
+ dts_type_find, "dts", DTS_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "audio/x-gsm", GST_RANK_PRIMARY, NULL, "gsm",
- GSM_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (gsm, "audio/x-gsm", GST_RANK_PRIMARY, NULL,
+ "gsm", GSM_CAPS, NULL, NULL);
+ #endif
+ #ifdef TIZEN_PROFILE_TV
- TYPE_FIND_REGISTER (plugin, "video/mpeg-sys", GST_RANK_PRIMARY,
- mpeg_sys_type_find, "mpe,mpeg,mpg", MPEG_SYS_CAPS, NULL, NULL);
-#endif
- TYPE_FIND_REGISTER (plugin, "video/mpegts", GST_RANK_PRIMARY,
- mpeg_ts_type_find, "ts,mts", MPEGTS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/ogg", GST_RANK_PRIMARY,
- ogganx_type_find, "ogg,oga,ogv,ogm,ogx,spx,anx,axa,axv", OGG_CAPS,
- NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/mpeg-elementary", GST_RANK_MARGINAL,
- mpeg_video_stream_type_find, "mpv,mpeg,mpg", MPEG_VIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/mpeg4", GST_RANK_PRIMARY,
- mpeg4_video_type_find, "m4v", MPEG_VIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-h263", GST_RANK_SECONDARY,
- h263_video_type_find, "h263,263", H263_VIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-h264", GST_RANK_PRIMARY,
- h264_video_type_find, "h264,x264,264", H264_VIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-h265", GST_RANK_PRIMARY,
- h265_video_type_find, "h265,x265,265", H265_VIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-nuv", GST_RANK_SECONDARY, nuv_type_find,
- "nuv", NUV_CAPS, NULL, NULL);
-
- /* ISO formats */
- TYPE_FIND_REGISTER (plugin, "audio/x-m4a", GST_RANK_PRIMARY, m4a_type_find,
- "m4a", M4A_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-3gp", GST_RANK_PRIMARY,
- q3gp_type_find, "3gp", Q3GP_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/quicktime", GST_RANK_PRIMARY,
- qt_type_find, "mov,mp4", QT_CAPS, NULL, NULL);
-#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "image/x-quicktime", GST_RANK_SECONDARY,
- qtif_type_find, "qif,qtif,qti", QTIF_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "image/jp2", GST_RANK_PRIMARY,
- jp2_type_find, "jp2", JP2_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "image/x-jpc", GST_RANK_PRIMARY,
- jpc_type_find, "jpc,j2k", JPC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/mj2", GST_RANK_PRIMARY,
- jp2_type_find, "mj2", MJ2_CAPS, NULL, NULL);
-
- TYPE_FIND_REGISTER (plugin, "text/html", GST_RANK_SECONDARY, html_type_find,
- "htm,html", HTML_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mpeg_sys, "video/mpeg-sys", GST_RANK_PRIMARY,
+ mpeg_sys_type_find, "mpe,mpeg,mpg", MPEG_SYS_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/vnd.rn-realmedia",
- GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".RMF", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-pn-realaudio",
- GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".ra\375", 4,
- GST_TYPE_FIND_MAXIMUM);
+GST_TYPE_FIND_REGISTER_DEFINE (mpeg_ts, "video/mpegts", GST_RANK_PRIMARY,
+ mpeg_ts_type_find, "ts,mts", MPEGTS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ogganx, "application/ogg", GST_RANK_PRIMARY,
+ ogganx_type_find, "ogg,oga,ogv,ogm,ogx,spx,anx,axa,axv", OGG_CAPS, NULL,
+ NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mpeg_video_stream, "video/mpeg-elementary",
+ GST_RANK_MARGINAL, mpeg_video_stream_type_find, "mpv,mpeg,mpg",
+ MPEG_VIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mpeg4_video, "video/mpeg4", GST_RANK_PRIMARY,
+ mpeg4_video_type_find, "m4v", MPEG_VIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (h263_video, "video/x-h263", GST_RANK_SECONDARY,
+ h263_video_type_find, "h263,263", H263_VIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (h264_video, "video/x-h264", GST_RANK_PRIMARY,
+ h264_video_type_find, "h264,x264,264", H264_VIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (h265_video, "video/x-h265", GST_RANK_PRIMARY,
+ h265_video_type_find, "h265,x265,265", H265_VIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (nuv, "video/x-nuv", GST_RANK_SECONDARY,
+ nuv_type_find, "nuv", NUV_CAPS, NULL, NULL);
+/* ISO formats */
+GST_TYPE_FIND_REGISTER_DEFINE (m4a, "audio/x-m4a", GST_RANK_PRIMARY,
+ m4a_type_find, "m4a", M4A_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (q3gp, "application/x-3gp", GST_RANK_PRIMARY,
+ q3gp_type_find, "3gp", Q3GP_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (qt, "video/quicktime", GST_RANK_PRIMARY,
+ qt_type_find, "mov,mp4", QT_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "application/x-shockwave-flash",
- GST_RANK_SECONDARY, swf_type_find, "swf,swfl", SWF_CAPS, NULL, NULL);
-#endif
- TYPE_FIND_REGISTER (plugin, "application/xges",
- GST_RANK_PRIMARY, xges_type_find, "xges", XGES_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/dash+xml",
- GST_RANK_PRIMARY, dash_mpd_type_find, "mpd,MPD", DASH_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/vnd.ms-sstr+xml",
- GST_RANK_PRIMARY, mss_manifest_type_find, NULL, MSS_MANIFEST_CAPS, NULL,
- NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-flv", GST_RANK_SECONDARY,
- "flv", "FLV", 3, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "text/plain", GST_RANK_MARGINAL, utf8_type_find,
- "txt", UTF8_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "text/utf-16", GST_RANK_MARGINAL, utf16_type_find,
- "txt", UTF16_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "text/utf-32", GST_RANK_MARGINAL, utf32_type_find,
- "txt", UTF32_CAPS, NULL, NULL);
-#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "text/uri-list", GST_RANK_MARGINAL, uri_type_find,
- "ram", URI_CAPS, NULL, NULL);
-#endif
- TYPE_FIND_REGISTER (plugin, "application/itc", GST_RANK_SECONDARY,
- itc_type_find, "itc", ITC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-hls", GST_RANK_MARGINAL,
- hls_type_find, "m3u8", HLS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/sdp", GST_RANK_SECONDARY,
- sdp_type_find, "sdp", SDP_CAPS, NULL, NULL);
-#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "application/smil", GST_RANK_SECONDARY,
- smil_type_find, "smil", SMIL_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/ttml+xml", GST_RANK_SECONDARY,
- ttml_xml_type_find, "ttml+xml", TTML_XML_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/xml", GST_RANK_MARGINAL,
- xml_type_find, "xml", GENERIC_XML_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (qtif, "image/x-quicktime", GST_RANK_SECONDARY,
+ qtif_type_find, "qif,qtif,qti", QTIF_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (jp2, "image/jp2", GST_RANK_PRIMARY,
+ jp2_type_find, "jp2", JP2_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (jpc, "image/x-jpc", GST_RANK_PRIMARY,
+ jpc_type_find, "jpc,j2k", JPC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mj2, "video/mj2", GST_RANK_PRIMARY,
+ jp2_type_find, "mj2", MJ2_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (html, "text/html", GST_RANK_SECONDARY,
+ html_type_find, "htm,html", HTML_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (swf, "application/x-shockwave-flash",
+ GST_RANK_SECONDARY, swf_type_find, "swf,swfl", SWF_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER_RIFF (plugin, "audio/x-wav", GST_RANK_PRIMARY, "wav",
- "WAVE");
- TYPE_FIND_REGISTER (plugin, "audio/x-aiff", GST_RANK_SECONDARY,
- aiff_type_find, "aiff,aif,aifc", AIFF_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (xges, "application/xges",
+ GST_RANK_PRIMARY, xges_type_find, "xges", XGES_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (xmeml, "application/vnd.apple-xmeml+xml",
+ GST_RANK_SECONDARY, xmeml_type_find, "xmeml", XMEML_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (fcpxml, "application/vnd.apple-fcp+xml",
+ GST_RANK_SECONDARY, fcpxml_type_find, "fcpxml", FCPXML_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (otio,
+ "application/vnd.pixar.opentimelineio+json", GST_RANK_SECONDARY,
+ otio_type_find, "otio", OTIO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (dash_mpd, "application/dash+xml",
+ GST_RANK_PRIMARY, dash_mpd_type_find, "mpd,MPD", DASH_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mss_manifest, "application/vnd.ms-sstr+xml",
+ GST_RANK_PRIMARY, mss_manifest_type_find, NULL, MSS_MANIFEST_CAPS, NULL,
+ NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (utf8, "text/plain", GST_RANK_MARGINAL,
+ utf8_type_find, "txt", UTF8_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (utf16, "text/utf-16", GST_RANK_MARGINAL,
+ utf16_type_find, "txt", UTF16_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (utf32, "text/utf-32", GST_RANK_MARGINAL,
+ utf32_type_find, "txt", UTF32_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "audio/x-svx", GST_RANK_SECONDARY, svx_type_find,
- "iff,svx", SVX_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-paris", GST_RANK_SECONDARY,
- paris_type_find, "paf", PARIS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-nist", GST_RANK_SECONDARY,
- "nist", "NIST", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-voc", GST_RANK_SECONDARY,
- "voc", "Creative", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "audio/x-sds", GST_RANK_SECONDARY, sds_type_find,
- "sds", SDS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-ircam", GST_RANK_SECONDARY,
- ircam_type_find, "sf", IRCAM_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-w64", GST_RANK_SECONDARY,
- "w64", "riff", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-rf64", GST_RANK_PRIMARY,
- "rf64", "RF64", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "audio/x-shorten", GST_RANK_SECONDARY,
- shn_type_find, "shn", SHN_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ape", GST_RANK_SECONDARY,
- ape_type_find, "ape", APE_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (uri, "text/uri-list", GST_RANK_MARGINAL,
+ uri_type_find, "ram", URI_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "image/jpeg", GST_RANK_PRIMARY + 15,
- jpeg_type_find, "jpg,jpe,jpeg", JPEG_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/gif", GST_RANK_PRIMARY, "gif",
- "GIF8", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/png", GST_RANK_PRIMARY + 14,
- "png", "\211PNG\015\012\032\012", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "image/bmp", GST_RANK_PRIMARY, bmp_type_find,
- "bmp", BMP_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (itc, "application/itc", GST_RANK_SECONDARY,
+ itc_type_find, "itc", ITC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (hls, "application/x-hls", GST_RANK_MARGINAL,
+ hls_type_find, "m3u8", HLS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (sdp, "application/sdp", GST_RANK_SECONDARY,
+ sdp_type_find, "sdp", SDP_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "image/tiff", GST_RANK_PRIMARY, tiff_type_find,
- "tif,tiff", TIFF_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_RIFF (plugin, "image/webp", GST_RANK_PRIMARY,
- "webp", "WEBP");
+GST_TYPE_FIND_REGISTER_DEFINE (smil, "application/smil", GST_RANK_SECONDARY,
+ smil_type_find, "smil", SMIL_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ttml_xml, "application/ttml+xml",
+ GST_RANK_SECONDARY, ttml_xml_type_find, "ttml+xml", TTML_XML_CAPS, NULL,
+ NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (xml, "application/xml", GST_RANK_MARGINAL,
+ xml_type_find, "xml", GENERIC_XML_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "image/x-exr", GST_RANK_PRIMARY, exr_type_find,
- "exr", EXR_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "image/x-portable-pixmap", GST_RANK_SECONDARY,
- pnm_type_find, "pnm,ppm,pgm,pbm", PNM_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-matroska", GST_RANK_PRIMARY,
- matroska_type_find, "mkv,mka,mk3d,webm", MATROSKA_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (aiff, "audio/x-aiff", GST_RANK_SECONDARY,
+ aiff_type_find, "aiff,aif,aifc", AIFF_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "application/mxf", GST_RANK_PRIMARY,
- mxf_type_find, "mxf", MXF_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-mve", GST_RANK_SECONDARY,
- "mve", "Interplay MVE File\032\000\032\000\000\001\063\021", 26,
- GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "video/x-dv", GST_RANK_SECONDARY, dv_type_find,
- "dv,dif", DV_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (svx, "audio/x-svx", GST_RANK_SECONDARY,
+ svx_type_find, "iff,svx", SVX_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (paris, "audio/x-paris", GST_RANK_SECONDARY,
+ paris_type_find, "paf", PARIS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (sds, "audio/x-sds", GST_RANK_SECONDARY,
+ sds_type_find, "sds", SDS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ircam, "audio/x-ircam", GST_RANK_SECONDARY,
+ ircam_type_find, "sf", IRCAM_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (shn, "audio/x-shorten", GST_RANK_SECONDARY,
+ shn_type_find, "shn", SHN_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ape, "application/x-ape", GST_RANK_SECONDARY,
+ ape_type_find, "ape", APE_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-amr-nb-sh", GST_RANK_PRIMARY,
- "amr", "#!AMR", 5, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-amr-wb-sh", GST_RANK_PRIMARY,
- "amr", "#!AMR-WB", 7, GST_TYPE_FIND_MAXIMUM);
+GST_TYPE_FIND_REGISTER_DEFINE (jpeg, "image/jpeg", GST_RANK_PRIMARY + 15,
+ jpeg_type_find, "jpg,jpe,jpeg", JPEG_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (bmp, "image/bmp", GST_RANK_PRIMARY,
+ bmp_type_find, "bmp", BMP_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "audio/iLBC-sh", GST_RANK_PRIMARY, ilbc_type_find,
- "ilbc", ILBC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-sbc", GST_RANK_MARGINAL, sbc_type_find,
- "sbc", SBC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-sid", GST_RANK_MARGINAL,
- "sid", "PSID", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/x-xcf", GST_RANK_SECONDARY,
- "xcf", "gimp xcf", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-mng", GST_RANK_SECONDARY,
- "mng", "\212MNG\015\012\032\012", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/x-jng", GST_RANK_SECONDARY,
- "jng", "\213JNG\015\012\032\012", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/x-xpixmap", GST_RANK_SECONDARY,
- "xpm", "/* XPM */", 9, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/x-sun-raster",
- GST_RANK_SECONDARY, "ras", "\131\246\152\225", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-bzip",
- GST_RANK_SECONDARY, "bz2", "BZh", 3, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-gzip",
- GST_RANK_SECONDARY, "gz", "\037\213", 2, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/zip", GST_RANK_SECONDARY,
- "zip", "PK\003\004", 4, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-compress",
- GST_RANK_SECONDARY, "Z", "\037\235", 2, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER (plugin, "subtitle/x-kate", GST_RANK_MARGINAL,
- kate_type_find, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (tiff, "image/tiff", GST_RANK_PRIMARY,
+ tiff_type_find, "tif,tiff", TIFF_CAPS, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "application/x-subtitle-vtt", GST_RANK_MARGINAL,
- webvtt_type_find, "vtt", WEBVTT_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-flac", GST_RANK_PRIMARY, flac_type_find,
- "flac", FLAC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-vorbis", GST_RANK_PRIMARY,
- vorbis_type_find, NULL, VORBIS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-theora", GST_RANK_PRIMARY,
- theora_type_find, NULL, THEORA_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (exr, "image/x-exr", GST_RANK_PRIMARY,
+ exr_type_find, "exr", EXR_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (pnm, "image/x-portable-pixmap",
+ GST_RANK_SECONDARY, pnm_type_find, "pnm,ppm,pgm,pbm", PNM_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (matroska, "video/x-matroska", GST_RANK_PRIMARY,
+ matroska_type_find, "mkv,mka,mk3d,webm", MATROSKA_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "application/x-ogm-video", GST_RANK_PRIMARY,
- ogmvideo_type_find, NULL, OGMVIDEO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ogm-audio", GST_RANK_PRIMARY,
- ogmaudio_type_find, NULL, OGMAUDIO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ogm-text", GST_RANK_PRIMARY,
- ogmtext_type_find, NULL, OGMTEXT_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-speex", GST_RANK_PRIMARY,
- speex_type_find, NULL, SPEEX_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-celt", GST_RANK_PRIMARY, celt_type_find,
- NULL, CELT_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ogg-skeleton", GST_RANK_PRIMARY,
- oggskel_type_find, NULL, OGG_SKELETON_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "text/x-cmml", GST_RANK_PRIMARY, cmml_type_find,
- NULL, CMML_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-executable",
- GST_RANK_MARGINAL, NULL, "\177ELF", 4, GST_TYPE_FIND_MAXIMUM);
+GST_TYPE_FIND_REGISTER_DEFINE (mxf, "application/mxf", GST_RANK_PRIMARY,
+ mxf_type_find, "mxf", MXF_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (dv, "video/x-dv", GST_RANK_SECONDARY,
+ dv_type_find, "dv,dif", DV_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ilbc, "audio/iLBC-sh", GST_RANK_PRIMARY,
+ ilbc_type_find, "ilbc", ILBC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (sbc, "audio/x-sbc", GST_RANK_MARGINAL,
+ sbc_type_find, "sbc", SBC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (kate, "subtitle/x-kate", GST_RANK_MARGINAL,
+ kate_type_find, NULL, NULL, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "audio/aac", GST_RANK_SECONDARY, aac_type_find,
- "aac,adts,adif,loas", AAC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (webvtt, "application/x-subtitle-vtt",
+ GST_RANK_MARGINAL, webvtt_type_find, "vtt", WEBVTT_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (flac, "audio/x-flac", GST_RANK_PRIMARY,
+ flac_type_find, "flac", FLAC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (vorbis, "audio/x-vorbis", GST_RANK_PRIMARY,
+ vorbis_type_find, NULL, VORBIS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (theora, "video/x-theora", GST_RANK_PRIMARY,
+ theora_type_find, NULL, THEORA_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-spc", GST_RANK_SECONDARY,
- "spc", "SNES-SPC700 Sound File Data", 27, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "audio/x-wavpack", GST_RANK_SECONDARY,
- wavpack_type_find, "wv,wvp", WAVPACK_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "audio/x-wavpack-correction", GST_RANK_SECONDARY,
- wavpack_type_find, "wvc", WAVPACK_CORRECTION_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-caf", GST_RANK_SECONDARY,
- "caf", "caff\000\001", 6, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER (plugin, "application/postscript", GST_RANK_SECONDARY,
- postscript_type_find, "ps", POSTSCRIPT_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "image/svg+xml", GST_RANK_SECONDARY,
- svg_type_find, "svg", SVG_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-rar",
- GST_RANK_SECONDARY, "rar", "Rar!", 4, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER (plugin, "application/x-tar", GST_RANK_SECONDARY,
- tar_type_find, "tar", TAR_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ar", GST_RANK_SECONDARY,
- ar_type_find, "a", AR_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-ms-dos-executable",
- GST_RANK_SECONDARY, msdos_type_find, "dll,exe,ocx,sys,scr,msstyles,cpl",
- MSDOS_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/x-dirac", GST_RANK_PRIMARY,
- dirac_type_find, NULL, DIRAC_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "multipart/x-mixed-replace", GST_RANK_SECONDARY,
- multipart_type_find, NULL, MULTIPART_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-mmsh", GST_RANK_SECONDARY,
- mmsh_type_find, NULL, MMSH_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "video/vivo", GST_RANK_SECONDARY, vivo_type_find,
- "viv", VIVO_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-nsf", GST_RANK_SECONDARY,
- "nsf", "NESM\x1a", 5, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-gym", GST_RANK_SECONDARY,
- "gym", "GYMX", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-ay", GST_RANK_SECONDARY, "ay",
- "ZXAYEMUL", 8, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-gbs", GST_RANK_SECONDARY,
- "gbs", "GBS\x01", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-vgm", GST_RANK_SECONDARY,
- "vgm", "Vgm\x20", 4, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-sap", GST_RANK_SECONDARY,
- "sap", "SAP\x0d\x0a" "AUTHOR\x20", 12, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-ivf", GST_RANK_SECONDARY,
- "ivf", "DKIF", 4, GST_TYPE_FIND_NEARLY_CERTAIN);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-kss", GST_RANK_SECONDARY,
- "kss", "KSSX\0", 5, GST_TYPE_FIND_MAXIMUM);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/pdf", GST_RANK_SECONDARY,
- "pdf", "%PDF-", 5, GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/msword",
- GST_RANK_SECONDARY, "doc", "\320\317\021\340\241\261\032\341", 8,
- GST_TYPE_FIND_LIKELY);
+GST_TYPE_FIND_REGISTER_DEFINE (ogmvideo, "application/x-ogm-video",
+ GST_RANK_PRIMARY, ogmvideo_type_find, NULL, OGMVIDEO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ogmaudio, "application/x-ogm-audio",
+ GST_RANK_PRIMARY, ogmaudio_type_find, NULL, OGMAUDIO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ogmtext, "application/x-ogm-text",
+ GST_RANK_PRIMARY, ogmtext_type_find, NULL, OGMTEXT_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (speex, "audio/x-speex", GST_RANK_PRIMARY,
+ speex_type_find, NULL, SPEEX_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (celt, "audio/x-celt", GST_RANK_PRIMARY,
+ celt_type_find, NULL, CELT_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (oggskel, "application/x-ogg-skeleton",
+ GST_RANK_PRIMARY, oggskel_type_find, NULL, OGG_SKELETON_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (cmml, "text/x-cmml", GST_RANK_PRIMARY,
+ cmml_type_find, NULL, CMML_CAPS, NULL, NULL);
+ #endif
- /* Mac OS X .DS_Store files tend to be taken for video/mpeg */
- TYPE_FIND_REGISTER_START_WITH (plugin, "application/octet-stream",
- GST_RANK_SECONDARY, "DS_Store", "\000\000\000\001Bud1", 8,
- GST_TYPE_FIND_LIKELY);
+GST_TYPE_FIND_REGISTER_DEFINE (aac, "audio/aac", GST_RANK_SECONDARY,
+ aac_type_find, "aac,adts,adif,loas", AAC_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER_START_WITH (plugin, "image/vnd.adobe.photoshop",
- GST_RANK_SECONDARY, "psd", "8BPS\000\001\000\000\000\000", 10,
- GST_TYPE_FIND_LIKELY);
- TYPE_FIND_REGISTER (plugin, "image/vnd.wap.wbmp", GST_RANK_MARGINAL,
- wbmp_typefind, NULL, NULL, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "application/x-yuv4mpeg", GST_RANK_SECONDARY,
- y4m_typefind, NULL, NULL, NULL, NULL);
- TYPE_FIND_REGISTER (plugin, "image/x-icon", GST_RANK_MARGINAL,
- windows_icon_typefind, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (wavpack_wvp, "audio/x-wavpack",
+ GST_RANK_SECONDARY, wavpack_type_find, "wv,wvp", WAVPACK_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (wavpack_wvc, "audio/x-wavpack-correction",
+ GST_RANK_SECONDARY, wavpack_type_find, "wvc", WAVPACK_CORRECTION_CAPS, NULL,
+ NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (postscript, "application/postscript",
+ GST_RANK_SECONDARY, postscript_type_find, "ps", POSTSCRIPT_CAPS, NULL,
+ NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (svg, "image/svg+xml", GST_RANK_SECONDARY,
+ svg_type_find, "svg", SVG_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (tar, "application/x-tar", GST_RANK_SECONDARY,
+ tar_type_find, "tar", TAR_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ar, "application/x-ar", GST_RANK_SECONDARY,
+ ar_type_find, "a", AR_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (msdos, "application/x-ms-dos-executable",
+ GST_RANK_SECONDARY, msdos_type_find, "dll,exe,ocx,sys,scr,msstyles,cpl",
+ MSDOS_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (dirac, "video/x-dirac", GST_RANK_PRIMARY,
+ dirac_type_find, NULL, DIRAC_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (multipart, "multipart/x-mixed-replace",
+ GST_RANK_SECONDARY, multipart_type_find, NULL, MULTIPART_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (mmsh, "application/x-mmsh", GST_RANK_SECONDARY,
+ mmsh_type_find, NULL, MMSH_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (vivo, "video/vivo", GST_RANK_SECONDARY,
+ vivo_type_find, "viv", VIVO_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (wbmp, "image/vnd.wap.wbmp", GST_RANK_MARGINAL,
+ wbmp_typefind, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (y4m, "application/x-yuv4mpeg",
+ GST_RANK_SECONDARY, y4m_typefind, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (windows_icon, "image/x-icon", GST_RANK_MARGINAL,
+ windows_icon_typefind, NULL, NULL, NULL, NULL);
+ #endif
-
#ifdef USE_GIO
- TYPE_FIND_REGISTER (plugin, "xdgmime-base", GST_RANK_MARGINAL,
- xdgmime_typefind, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (xdgmime, "xdgmime-base", GST_RANK_MARGINAL,
+ xdgmime_typefind, NULL, NULL, NULL, NULL);
#endif
-
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "image/x-degas", GST_RANK_MARGINAL,
- degas_type_find, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (degas, "image/x-degas", GST_RANK_MARGINAL,
+ degas_type_find, NULL, NULL, NULL, NULL);
+ #endif
- TYPE_FIND_REGISTER (plugin, "application/octet-stream", GST_RANK_MARGINAL,
- dvdiso_type_find, NULL, NULL, NULL, NULL);
-
- TYPE_FIND_REGISTER (plugin, "application/x-ssa", GST_RANK_SECONDARY,
- ssa_type_find, "ssa,ass", NULL, NULL, NULL);
-
- TYPE_FIND_REGISTER (plugin, "video/x-pva", GST_RANK_SECONDARY,
- pva_type_find, "pva", PVA_CAPS, NULL, NULL);
-
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-xi", GST_RANK_SECONDARY,
- "xi", "Extended Instrument: ", 21, GST_TYPE_FIND_MAXIMUM);
-
- TYPE_FIND_REGISTER (plugin, "audio/audible", GST_RANK_MARGINAL,
- aa_type_find, "aa,aax", AA_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (dvdiso, "application/octet-stream",
+ GST_RANK_MARGINAL, dvdiso_type_find, NULL, NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (ssa, "application/x-ssa", GST_RANK_SECONDARY,
+ ssa_type_find, "ssa,ass", NULL, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (pva, "video/x-pva", GST_RANK_SECONDARY,
+ pva_type_find, "pva", PVA_CAPS, NULL, NULL);
+GST_TYPE_FIND_REGISTER_DEFINE (aa, "audio/audible", GST_RANK_MARGINAL,
+ aa_type_find, "aa,aax", AA_CAPS, NULL, NULL);
+ #ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
- TYPE_FIND_REGISTER (plugin, "audio/x-tap-tap", GST_RANK_PRIMARY,
- tap_type_find, "tap", TAP_CAPS, NULL, NULL);
- TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-tap-dmp",
- GST_RANK_SECONDARY, "dmp", "DC2N-TAP-RAW", 12, GST_TYPE_FIND_LIKELY);
-#endif
-
- return TRUE;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- typefindfunctions,
- "default typefind functions",
- plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
+GST_TYPE_FIND_REGISTER_DEFINE (tap, "audio/x-tap-tap", GST_RANK_PRIMARY,
+ tap_type_find, "tap", TAP_CAPS, NULL, NULL);
++#endif
--- /dev/null
-
+/* GStreamer
+ * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ * Copyright (C) 2005-2009 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@collabora.com>
+ *
+ * gsttypefindfunctions.c: collection of various typefind functions
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gsttypefindfunctionsplugin.h"
+
+#include <gst/gst.h>
+
+GST_DEBUG_CATEGORY (type_find_functions_debug);
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ /* can't initialize this via a struct as caps can't be statically initialized */
+ GST_DEBUG_CATEGORY_INIT (type_find_functions_debug, "typefindfunctions",
+ GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions");
+ /* note: asx/wax/wmx are XML files, asf doesn't handle them */
+ /* must use strings, macros don't accept initializers */
+
+ /*Riff Type find register */
+ GST_TYPE_FIND_REGISTER (avi, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (qcp, plugin);
+ GST_TYPE_FIND_REGISTER (cdxa, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (riff_mid, plugin);
+ GST_TYPE_FIND_REGISTER (wav, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (webp, plugin);
++#endif
+ /*'Start with' Type find register */
+ GST_TYPE_FIND_REGISTER (asf, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (vcd, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (imelody, plugin);
+ GST_TYPE_FIND_REGISTER (scc, plugin);
+#if 0
+ GST_TYPE_FIND_REGISTER (smoke, plugin);
+#endif
+ GST_TYPE_FIND_REGISTER (rmf, plugin);
+ GST_TYPE_FIND_REGISTER (ram, plugin);
+ GST_TYPE_FIND_REGISTER (flv, plugin);
+ GST_TYPE_FIND_REGISTER (nist, plugin);
+ GST_TYPE_FIND_REGISTER (voc, plugin);
+ GST_TYPE_FIND_REGISTER (w64, plugin);
+ GST_TYPE_FIND_REGISTER (rf64, plugin);
+ GST_TYPE_FIND_REGISTER (gif, plugin);
+ GST_TYPE_FIND_REGISTER (png, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (mve, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (amr, plugin);
+ GST_TYPE_FIND_REGISTER (amr_wb, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (sid, plugin);
+ GST_TYPE_FIND_REGISTER (xcf, plugin);
+ GST_TYPE_FIND_REGISTER (mng, plugin);
+ GST_TYPE_FIND_REGISTER (jng, plugin);
+ GST_TYPE_FIND_REGISTER (xpm, plugin);
+ GST_TYPE_FIND_REGISTER (ras, plugin);
+ GST_TYPE_FIND_REGISTER (bz2, plugin);
+ GST_TYPE_FIND_REGISTER (gz, plugin);
+ GST_TYPE_FIND_REGISTER (zip, plugin);
+ GST_TYPE_FIND_REGISTER (z, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (elf, plugin);
+ GST_TYPE_FIND_REGISTER (spc, plugin);
+ GST_TYPE_FIND_REGISTER (caf, plugin);
+ GST_TYPE_FIND_REGISTER (rar, plugin);
+ GST_TYPE_FIND_REGISTER (nsf, plugin);
+ GST_TYPE_FIND_REGISTER (gym, plugin);
+ GST_TYPE_FIND_REGISTER (ay, plugin);
+ GST_TYPE_FIND_REGISTER (gbs, plugin);
+ GST_TYPE_FIND_REGISTER (vgm, plugin);
+ GST_TYPE_FIND_REGISTER (sap, plugin);
+ GST_TYPE_FIND_REGISTER (ivf, plugin);
+ GST_TYPE_FIND_REGISTER (kss, plugin);
+ GST_TYPE_FIND_REGISTER (pdf, plugin);
+ GST_TYPE_FIND_REGISTER (doc, plugin);
+ /* Mac OS X .DS_Store files tend to be taken for video/mpeg */
+ GST_TYPE_FIND_REGISTER (ds_store, plugin);
+ GST_TYPE_FIND_REGISTER (psd, plugin);
+ GST_TYPE_FIND_REGISTER (xi, plugin);
+ GST_TYPE_FIND_REGISTER (dmp, plugin);
+
+ /* functions Type find register */
+ GST_TYPE_FIND_REGISTER (musepack, plugin);
+ GST_TYPE_FIND_REGISTER (au, plugin);
+ GST_TYPE_FIND_REGISTER (mcc, plugin);
+ GST_TYPE_FIND_REGISTER (mid, plugin);
+ GST_TYPE_FIND_REGISTER (mxmf, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (flx, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (id3v2, plugin);
+ GST_TYPE_FIND_REGISTER (id3v1, plugin);
+ GST_TYPE_FIND_REGISTER (apetag, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (tta, plugin);
+ GST_TYPE_FIND_REGISTER (mod, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (mp3, plugin);
+ GST_TYPE_FIND_REGISTER (ac3, plugin);
+ GST_TYPE_FIND_REGISTER (dts, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (gsm, plugin);
++#endif
++#ifdef TIZEN_PROFILE_TV
+ GST_TYPE_FIND_REGISTER (mpeg_sys, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (mpeg_ts, plugin);
+ GST_TYPE_FIND_REGISTER (ogganx, plugin);
+ GST_TYPE_FIND_REGISTER (mpeg_video_stream, plugin);
+ GST_TYPE_FIND_REGISTER (mpeg4_video, plugin);
+ GST_TYPE_FIND_REGISTER (h263_video, plugin);
+ GST_TYPE_FIND_REGISTER (h264_video, plugin);
+ GST_TYPE_FIND_REGISTER (h265_video, plugin);
+ GST_TYPE_FIND_REGISTER (nuv, plugin);
+ /* ISO formats */
+ GST_TYPE_FIND_REGISTER (m4a, plugin);
+ GST_TYPE_FIND_REGISTER (q3gp, plugin);
+ GST_TYPE_FIND_REGISTER (qt, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (qtif, plugin);
+ GST_TYPE_FIND_REGISTER (jp2, plugin);
+ GST_TYPE_FIND_REGISTER (jpc, plugin);
+ GST_TYPE_FIND_REGISTER (mj2, plugin);
+ GST_TYPE_FIND_REGISTER (html, plugin);
+ GST_TYPE_FIND_REGISTER (swf, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (xges, plugin);
+ GST_TYPE_FIND_REGISTER (xmeml, plugin);
+ GST_TYPE_FIND_REGISTER (fcpxml, plugin);
+ GST_TYPE_FIND_REGISTER (otio, plugin);
+ GST_TYPE_FIND_REGISTER (dash_mpd, plugin);
+ GST_TYPE_FIND_REGISTER (mss_manifest, plugin);
+ GST_TYPE_FIND_REGISTER (utf8, plugin);
+ GST_TYPE_FIND_REGISTER (utf16, plugin);
+ GST_TYPE_FIND_REGISTER (utf32, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (uri, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (itc, plugin);
+ GST_TYPE_FIND_REGISTER (hls, plugin);
+ GST_TYPE_FIND_REGISTER (sdp, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (smil, plugin);
+ GST_TYPE_FIND_REGISTER (ttml_xml, plugin);
+ GST_TYPE_FIND_REGISTER (xml, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (aiff, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (svx, plugin);
+ GST_TYPE_FIND_REGISTER (paris, plugin);
+ GST_TYPE_FIND_REGISTER (sds, plugin);
+ GST_TYPE_FIND_REGISTER (ircam, plugin);
+ GST_TYPE_FIND_REGISTER (shn, plugin);
+ GST_TYPE_FIND_REGISTER (ape, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (jpeg, plugin);
+ GST_TYPE_FIND_REGISTER (bmp, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (tiff, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (exr, plugin);
+ GST_TYPE_FIND_REGISTER (pnm, plugin);
+ GST_TYPE_FIND_REGISTER (matroska, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (mxf, plugin);
+ GST_TYPE_FIND_REGISTER (dv, plugin);
+ GST_TYPE_FIND_REGISTER (ilbc, plugin);
+ GST_TYPE_FIND_REGISTER (sbc, plugin);
+ GST_TYPE_FIND_REGISTER (kate, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (webvtt, plugin);
+ GST_TYPE_FIND_REGISTER (flac, plugin);
+ GST_TYPE_FIND_REGISTER (vorbis, plugin);
+ GST_TYPE_FIND_REGISTER (theora, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (ogmvideo, plugin);
+ GST_TYPE_FIND_REGISTER (ogmaudio, plugin);
+ GST_TYPE_FIND_REGISTER (ogmtext, plugin);
+ GST_TYPE_FIND_REGISTER (speex, plugin);
+ GST_TYPE_FIND_REGISTER (celt, plugin);
+ GST_TYPE_FIND_REGISTER (oggskel, plugin);
+ GST_TYPE_FIND_REGISTER (cmml, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (aac, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (wavpack_wvp, plugin);
+ GST_TYPE_FIND_REGISTER (wavpack_wvc, plugin);
+ GST_TYPE_FIND_REGISTER (postscript, plugin);
+ GST_TYPE_FIND_REGISTER (svg, plugin);
+ GST_TYPE_FIND_REGISTER (tar, plugin);
+ GST_TYPE_FIND_REGISTER (ar, plugin);
+ GST_TYPE_FIND_REGISTER (msdos, plugin);
+ GST_TYPE_FIND_REGISTER (dirac, plugin);
+ GST_TYPE_FIND_REGISTER (multipart, plugin);
+ GST_TYPE_FIND_REGISTER (mmsh, plugin);
+ GST_TYPE_FIND_REGISTER (vivo, plugin);
+ GST_TYPE_FIND_REGISTER (wbmp, plugin);
+ GST_TYPE_FIND_REGISTER (y4m, plugin);
+ GST_TYPE_FIND_REGISTER (windows_icon, plugin);
++#endif
+#ifdef USE_GIO
+ GST_TYPE_FIND_REGISTER (xdgmime, plugin);
+#endif
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (degas, plugin);
++#endif
+ GST_TYPE_FIND_REGISTER (dvdiso, plugin);
+ GST_TYPE_FIND_REGISTER (ssa, plugin);
+ GST_TYPE_FIND_REGISTER (pva, plugin);
+ GST_TYPE_FIND_REGISTER (aa, plugin);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+ GST_TYPE_FIND_REGISTER (tap, plugin);
++#endif
+
+ return TRUE;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ typefindfunctions,
+ "default typefind functions",
+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ * Copyright (C) 2005-2009 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@collabora.com>
+ *
+ * gsttypefindfunctionsriff.c: collection of various typefind functions
+ * based on riff format.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include "gsttypefindfunctionsplugin.h"
+#include "gsttypefindfunctionsdata.h"
+
+/*** same for riff types ***/
+static void
+riff_type_find (GstTypeFind * tf, gpointer private)
+{
+ GstTypeFindData *riff_data = (GstTypeFindData *) private;
+ const guint8 *data = gst_type_find_peek (tf, 0, 12);
+
+ if (data && (memcmp (data, "RIFF", 4) == 0 || memcmp (data, "AVF0", 4) == 0)) {
+ data += 8;
+ if (memcmp (data, riff_data->data, 4) == 0)
+ gst_type_find_suggest (tf, riff_data->probability, riff_data->caps);
+ }
+}
+
+#define TYPE_FIND_REGISTER_RIFF_DEFINE(typefind_name, name, rank, ext, _data) \
+G_BEGIN_DECLS \
+static gboolean \
+G_PASTE(_private_type_find_riff_, typefind_name) (GstPlugin * plugin) \
+{ \
+ GstTypeFindData *sw_data = g_slice_new (GstTypeFindData); \
+ sw_data->data = (gpointer)_data; \
+ sw_data->size = 4; \
+ sw_data->probability = GST_TYPE_FIND_MAXIMUM; \
+ sw_data->caps = gst_caps_new_empty_simple (name); \
+ if (!gst_type_find_register (plugin, name, rank, riff_type_find, \
+ ext, sw_data->caps, sw_data, \
+ (GDestroyNotify) (sw_data_destroy))) { \
+ sw_data_destroy (sw_data); \
+ return FALSE; \
+ } \
+ return TRUE; \
+} \
+GST_TYPE_FIND_REGISTER_DEFINE_CUSTOM (typefind_name, G_PASTE(_private_type_find_riff_, typefind_name)); \
+G_END_DECLS
+
+/*RIFF type find definition */
+TYPE_FIND_REGISTER_RIFF_DEFINE (avi, "video/x-msvideo", GST_RANK_PRIMARY,
+ "avi", "AVI ");
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+TYPE_FIND_REGISTER_RIFF_DEFINE (qcp, "audio/qcelp", GST_RANK_PRIMARY,
+ "qcp", "QLCM");
+TYPE_FIND_REGISTER_RIFF_DEFINE (cdxa, "video/x-cdxa", GST_RANK_PRIMARY,
+ "dat", "CDXA");
++#endif
+TYPE_FIND_REGISTER_RIFF_DEFINE (riff_mid, "audio/riff-midi",
+ GST_RANK_PRIMARY, "mid,midi", "RMID");
+TYPE_FIND_REGISTER_RIFF_DEFINE (wav, "audio/x-wav", GST_RANK_PRIMARY, "wav",
+ "WAVE");
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+TYPE_FIND_REGISTER_RIFF_DEFINE (webp, "image/webp", GST_RANK_PRIMARY,
+ "webp", "WEBP");
++#endif
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ * Copyright (C) 2005-2009 Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) 2009 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@collabora.com>
+ *
+ * gsttypefindfunctionsstartwith.c: collection of various typefind functions
+ * using the start with pattern
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include "gsttypefindfunctionsplugin.h"
+#include "gsttypefindfunctionsdata.h"
+
+static void
+start_with_type_find (GstTypeFind * tf, gpointer private)
+{
+ GstTypeFindData *start_with = (GstTypeFindData *) private;
+ const guint8 *data;
+
+ GST_LOG ("trying to find mime type %s with the first %u bytes of data",
+ gst_structure_get_name (gst_caps_get_structure (start_with->caps, 0)),
+ start_with->size);
+ data = gst_type_find_peek (tf, 0, start_with->size);
+ if (data && memcmp (data, start_with->data, start_with->size) == 0) {
+ gst_type_find_suggest (tf, start_with->probability, start_with->caps);
+ }
+}
+
+#define TYPE_FIND_REGISTER_START_WITH_DEFINE(typefind_name, name, rank, ext, _data, _size, _probability)\
+G_BEGIN_DECLS \
+static gboolean \
+G_PASTE(_private_type_find_start_with_, typefind_name) (GstPlugin * plugin) \
+{ \
+ GstTypeFindData *sw_data = g_slice_new (GstTypeFindData); \
+ sw_data->data = (const guint8 *)_data; \
+ sw_data->size = _size; \
+ sw_data->probability = _probability; \
+ sw_data->caps = gst_caps_new_empty_simple (name); \
+ if (!gst_type_find_register (plugin, name, rank, start_with_type_find,\
+ ext, sw_data->caps, sw_data, \
+ (GDestroyNotify) (sw_data_destroy))) { \
+ sw_data_destroy (sw_data); \
+ return FALSE; \
+ } \
+ return TRUE; \
+}\
+GST_TYPE_FIND_REGISTER_DEFINE_CUSTOM (typefind_name, G_PASTE(_private_type_find_start_with_, typefind_name)); \
+G_END_DECLS
+
+/*'Start with' type find definition */
+TYPE_FIND_REGISTER_START_WITH_DEFINE (asf, "video/x-ms-asf",
+ GST_RANK_SECONDARY, "asf,wm,wma,wmv",
+ "\060\046\262\165\216\146\317\021\246\331\000\252\000\142\316\154", 16,
+ GST_TYPE_FIND_MAXIMUM);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+TYPE_FIND_REGISTER_START_WITH_DEFINE (vcd, "video/x-vcd", GST_RANK_PRIMARY,
+ "dat", "\000\377\377\377\377\377\377\377\377\377\377\000", 12,
+ GST_TYPE_FIND_MAXIMUM);
++#endif
+TYPE_FIND_REGISTER_START_WITH_DEFINE (imelody, "audio/x-imelody",
+ GST_RANK_PRIMARY, "imy,ime,imelody", "BEGIN:IMELODY", 13,
+ GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (scc, "application/x-scc",
+ GST_RANK_PRIMARY, "scc", "Scenarist_SCC V1.0", 18, GST_TYPE_FIND_MAXIMUM);
+#if 0
+TYPE_FIND_REGISTER_START_WITH_DEFINE (smoke, "video/x-smoke",
+ GST_RANK_PRIMARY, NULL, "\x80smoke\x00\x01\x00", 6, GST_TYPE_FIND_MAXIMUM);
+#endif
+TYPE_FIND_REGISTER_START_WITH_DEFINE (rmf, "application/vnd.rn-realmedia",
+ GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".RMF", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (ram, "application/x-pn-realaudio",
+ GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".ra\375", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (flv, "video/x-flv",
+ GST_RANK_SECONDARY, "flv", "FLV", 3, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (nist, "audio/x-nist",
+ GST_RANK_SECONDARY, "nist", "NIST", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (voc, "audio/x-voc",
+ GST_RANK_SECONDARY, "voc", "Creative", 8, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (w64, "audio/x-w64",
+ GST_RANK_SECONDARY, "w64", "riff", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (rf64, "audio/x-rf64",
+ GST_RANK_PRIMARY, "rf64", "RF64", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (gif, "image/gif", GST_RANK_PRIMARY,
+ "gif", "GIF8", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (png, "image/png",
+ GST_RANK_PRIMARY + 14, "png", "\211PNG\015\012\032\012", 8,
+ GST_TYPE_FIND_MAXIMUM);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+TYPE_FIND_REGISTER_START_WITH_DEFINE (mve, "video/x-mve",
+ GST_RANK_SECONDARY, "mve",
+ "Interplay MVE File\032\000\032\000\000\001\063\021", 26,
+ GST_TYPE_FIND_MAXIMUM);
++#endif
+TYPE_FIND_REGISTER_START_WITH_DEFINE (amr, "audio/x-amr-nb-sh",
+ GST_RANK_PRIMARY, "amr", "#!AMR", 5, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (amr_wb, "audio/x-amr-wb-sh",
+ GST_RANK_PRIMARY, "amr", "#!AMR-WB", 7, GST_TYPE_FIND_MAXIMUM);
++#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
+TYPE_FIND_REGISTER_START_WITH_DEFINE (sid, "audio/x-sid", GST_RANK_MARGINAL,
+ "sid", "PSID", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (xcf, "image/x-xcf",
+ GST_RANK_SECONDARY, "xcf", "gimp xcf", 8, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (mng, "video/x-mng",
+ GST_RANK_SECONDARY, "mng", "\212MNG\015\012\032\012", 8,
+ GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (jng, "image/x-jng",
+ GST_RANK_SECONDARY, "jng", "\213JNG\015\012\032\012", 8,
+ GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (xpm, "image/x-xpixmap",
+ GST_RANK_SECONDARY, "xpm", "/* XPM */", 9, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (ras, "image/x-sun-raster",
+ GST_RANK_SECONDARY, "ras", "\131\246\152\225", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (bz2, "application/x-bzip",
+ GST_RANK_SECONDARY, "bz2", "BZh", 3, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (gz, "application/x-gzip",
+ GST_RANK_SECONDARY, "gz", "\037\213", 2, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (zip, "application/zip",
+ GST_RANK_SECONDARY, "zip", "PK\003\004", 4, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (z, "application/x-compress",
+ GST_RANK_SECONDARY, "Z", "\037\235", 2, GST_TYPE_FIND_LIKELY);
++#endif
+TYPE_FIND_REGISTER_START_WITH_DEFINE (elf, "application/x-executable",
+ GST_RANK_MARGINAL, NULL, "\177ELF", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (spc, "audio/x-spc",
+ GST_RANK_SECONDARY, "spc", "SNES-SPC700 Sound File Data", 27,
+ GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (caf, "audio/x-caf",
+ GST_RANK_SECONDARY, "caf", "caff\000\001", 6, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (rar, "application/x-rar",
+ GST_RANK_SECONDARY, "rar", "Rar!", 4, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (nsf, "audio/x-nsf",
+ GST_RANK_SECONDARY, "nsf", "NESM\x1a", 5, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (gym, "audio/x-gym",
+ GST_RANK_SECONDARY, "gym", "GYMX", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (ay, "audio/x-ay", GST_RANK_SECONDARY,
+ "ay", "ZXAYEMUL", 8, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (gbs, "audio/x-gbs",
+ GST_RANK_SECONDARY, "gbs", "GBS\x01", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (vgm, "audio/x-vgm",
+ GST_RANK_SECONDARY, "vgm", "Vgm\x20", 4, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (sap, "audio/x-sap",
+ GST_RANK_SECONDARY, "sap", "SAP\x0d\x0a" "AUTHOR\x20", 12,
+ GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (ivf, "video/x-ivf",
+ GST_RANK_SECONDARY, "ivf", "DKIF", 4, GST_TYPE_FIND_NEARLY_CERTAIN);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (kss, "audio/x-kss",
+ GST_RANK_SECONDARY, "kss", "KSSX\0", 5, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (pdf, "application/pdf",
+ GST_RANK_SECONDARY, "pdf", "%PDF-", 5, GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (doc, "application/msword",
+ GST_RANK_SECONDARY, "doc", "\320\317\021\340\241\261\032\341", 8,
+ GST_TYPE_FIND_LIKELY);
+/* Mac OS X .DS_Store files tend to be taken for video/mpeg */
+TYPE_FIND_REGISTER_START_WITH_DEFINE (ds_store, "application/octet-stream",
+ GST_RANK_SECONDARY, "DS_Store", "\000\000\000\001Bud1", 8,
+ GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (psd, "image/vnd.adobe.photoshop",
+ GST_RANK_SECONDARY, "psd", "8BPS\000\001\000\000\000\000", 10,
+ GST_TYPE_FIND_LIKELY);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (xi, "audio/x-xi", GST_RANK_SECONDARY,
+ "xi", "Extended Instrument: ", 21, GST_TYPE_FIND_MAXIMUM);
+TYPE_FIND_REGISTER_START_WITH_DEFINE (dmp, "audio/x-tap-dmp",
+ GST_RANK_SECONDARY, "dmp", "DC2N-TAP-RAW", 12, GST_TYPE_FIND_LIKELY);
static GstFlowReturn gst_video_convert_transform_frame (GstVideoFilter * filter,
GstVideoFrame * in_frame, GstVideoFrame * out_frame);
+ #ifdef USE_TBM
+ static gboolean gst_video_convert_decide_allocation (GstBaseTransform * bsrc,
+ GstQuery * query);
+ static GstFlowReturn gst_video_convert_prepare_output_buffer (GstBaseTransform * trans,
+ GstBuffer *input, GstBuffer **outbuf);
+ #endif
+static GstCapsFeatures *features_format_interlaced,
+ *features_format_interlaced_sysmem;
/* copies the given caps */
static GstCaps *
GstVideoPrimariesMode primaries_mode;
gdouble alpha_value;
gint n_threads;
+ #ifdef USE_TBM
+ GstBufferPool *pool;
+ #endif
};
-struct _GstVideoConvertClass
-{
- GstVideoFilterClass parent_class;
-};
+GST_ELEMENT_REGISTER_DECLARE (videoconvert);
G_END_DECLS
vconvert_sources,
c_args : gst_plugins_base_args,
include_directories: [configinc, libsinc],
-- dependencies : [video_dep],
++ dependencies : [video_dep, allocators_dep],
install : true,
install_dir : plugins_install_dir,
)
core_conf.set('DISABLE_ORC', 1)
endif
++# TIZEN_BUILD_OPTION
++
++tbm_dep = dependency('libtbm', required : get_option('tbm'))
++if tbm_dep.found()
++ core_conf.set('USE_TBM', 1)
++endif
++
++if get_option('tv-profile')
++ core_conf.set('TIZEN_TV_PROFILE', 1)
++ core_conf.set('TIZEN_FEATURE_TRUSTZONE', 1)
++endif
++
++# TIZEN_BUILD_OPTION end
++
# Used to build SSE* things in audio-resampler
sse_args = '-msse'
sse2_args = '-msse2'
description : 'package name to use in plugins')
option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,
description : 'package origin URL to use in plugins')
+option('doc', type : 'feature', value : 'auto', yield: true,
+ description: 'Enable documentation.')
++
++# Tizen Options
++option('tbm', type : 'boolean', value : true,
++ description : 'tizen buffer manager')
++option('tv-profile', type : 'boolean', value : false,
++ description : 'tv-profile')
--- /dev/null
-Version: 1.16.2
-Release: 23
+ %bcond_with x
+ %define gst_branch 1.0
+ %define _lib_gstreamer_dir %{_libdir}/gstreamer-%{gst_branch}
+ %define _libdebug_dir %{_libdir}/debug/usr/lib
+
+ Name: gst-plugins-base
-Source100: common.tar.gz
++Version: 1.19.2
++Release: 0
+ License: LGPL-2.0+
+ Summary: GStreamer Streaming-Media Framework Plug-Ins
+ Url: http://gstreamer.freedesktop.org/
+ Group: Multimedia/Framework
+ Source: http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-%{version}.tar.xz
-BuildRequires: pkgconfig(gstreamer-1.0)
++Source1001: gst-plugins-base.manifest
+ BuildRequires: gettext-tools
+ BuildRequires: pkgconfig(glib-2.0) >= 2.32
-%setup -q -T -D -a 100
++#BuildRequires: pkgconfig(gstreamer-1.0)
++BuildRequires: gstreamer-devel >= %{version}
+ BuildRequires: orc >= 0.4.16
+ BuildRequires: python
++BuildRequires: meson >= 0.48.0
+ %if "%{tizen_profile_name}" != "tv"
+ BuildRequires: update-desktop-files
+ %endif
+ BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.31.1
+ BuildRequires: pkgconfig(alsa) >= 0.9.1
+ BuildRequires: pkgconfig(freetype2) >= 2.0.9
+ BuildRequires: pkgconfig(libxml-2.0)
+ BuildRequires: pkgconfig(ogg) >= 1.0
+ BuildRequires: pkgconfig(theoradec) >= 1.1
+ BuildRequires: pkgconfig(theoraenc) >= 1.1
+ BuildRequires: pkgconfig(vorbis) >= 1.0
+ BuildRequires: pkgconfig(vorbisenc) >= 1.0
+ BuildRequires: pkgconfig(zlib)
+
+ BuildRequires: pkgconfig(libdrm)
+ BuildRequires: pkgconfig(libtbm)
+ BuildRequires: pkgconfig(opus)
+ %if %{with x}
+ BuildRequires: pkgconfig(ice)
+ BuildRequires: pkgconfig(sm)
+ BuildRequires: pkgconfig(xext)
+ BuildRequires: pkgconfig(xv)
+ BuildRequires: pkgconfig(xfixes)
+ BuildRequires: pkgconfig(dri2proto)
+ BuildRequires: pkgconfig(libdri2)
+ %endif
+
+ Requires: gstreamer >= 1.0.0
+ Requires: opus
+ Supplements: gstreamer
+ Provides: %{name}-profile_tv = %{version}-%{release}
+ Provides: %{name}-profile_common = %{version}-%{release}
+ Provides: %{name}-profile_wearable = %{version}-%{release}
+ Provides: %{name}-profile_ivi = %{version}-%{release}
+
+ %description
+ GStreamer is a streaming media framework based on graphs of filters
+ that operate on media data. Applications using this library can do
+ anything media-related, from real-time sound processing to playing
+ videos. Its plug-in-based architecture means that new data types or
+ processing capabilities can be added simply by installing new plug-ins.
+
+ %package extension-adder
+ Summary: libgstadder.so for gst-plugins-base
+ Requires: %{name} = %{version}-%{release}
+ Provides: %{name}-profile_mobile = %{version}-%{release}
+ %description extension-adder
+ Libgstadder.so for gst-plugin-base. Supplicant for gst-plugin-base.
+ This is for Tizen mobile profile.
+
+ %package devel
+ Summary: Include files and Libraries
+ Requires: %{name} = %{version}
+
+ %description devel
+ This package contains all necessary include files and libraries needed
+ to compile and link applications that use gstreamer-plugins-base.
+
+ %prep
+ %setup -q -n gst-plugins-base-%{version}
-export V=1
-NOCONFIGURE=1 ./autogen.sh
++cp %{SOURCE1001} .
+
+ %build
++mkdir -p build
+ # FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
+ # Silently ignored compilation of uninstalled gtk-doc scanners without RPM_OPT_FLAGS.
-%if "%{tizen_profile_name}" == "tv"
- -DTIZEN_PROFILE_TV\
- -DTIZEN_FEATURE_TRUSTZONE\
-%else
+ export CFLAGS="%{optflags} -fno-strict-aliasing\
+ -DTIZEN_FEATURE_WAYLAND_ENHANCEMENT\
+ -DTIZEN_FEATURE_TYPEFIND_ENHANCEMENT\
+ -DTIZEN_FEATURE_AUDIODECODER_MODIFICATION\
+ -DTIZEN_FEATURE_DISABLE_MIME_TYPES\
+ -DTIZEN_FEATURE_VIDEO_MODIFICATION\
+ -DTIZEN_FEATURE_SUBPARSE_MODIFICATION\
+ -DTIZEN_FEATURE_SUBPARSE_DROP_OUT_OF_SEGMENT\
+ -DTIZEN_FEATURE_HLS_WEBVTT\
+ -DTIZEN_FEATURE_VOLUME_MODIFICATION\
+ -DTIZEN_FEATURE_FORCE_SW_DECODER\
+ -DTIZEN_FEATURE_U3_AVOID_DEADLOCK\
+ -DTIZEN_FEATURE_PLAYBIN3_MODIFICATION\
+ -DTIZEN_FEATURE_DISABLE_EOS_DROP\
-%configure\
- --disable-static\
- --enable-experimental\
- --disable-gtk-doc\
- --enable-introspection\
- --disable-examples\
++%if "%{tizen_profile_name}" != "tv"
+ -DTIZEN_FEATURE_RESOURCE_MANAGER\
+ %endif
+ -DTIZEN_FEATURE_UPSTREAM\
+ -fstack-protector-strong\
+ -Wl,-z,relro\
+ -D_FORTIFY_SOURCE=2\
+ "
- --enable-tv\
++meson --auto-feature=auto --prefix=/usr --libdir=%{_libdir} --datadir=%{_datadir} \
++ -D examples=disabled \
++ -D tests=disabled \
++ -D doc=disabled \
++ -D tools=disabled \
++ -D introspection=enabled \
+ %if "%{tizen_profile_name}" == "tv"
- --enable-tbm
-make %{?_smp_mflags}
++ -D tv-profile=true \
+ %endif
-%make_install
++ -D tbm=true build
++
++ninja -C build all %{?_smp_mflags}
+
+ %install
+ rm -rf %{buildroot}
++export DESTDIR=%{buildroot}
++ninja -C build install
++
+ %find_lang %{name}-%{gst_branch}
+ mv %{name}-%{gst_branch}.lang %{name}.lang
+
+ %post -p /sbin/ldconfig
+
+ %postun -p /sbin/ldconfig
+
+ %lang_package
+
+ %files
+ %manifest %{name}.manifest
+ %defattr(-, root, root)
+ %license COPYING
+
+ %{_lib_gstreamer_dir}/libgstalsa.so
+ %{_lib_gstreamer_dir}/libgstapp.so
+ %{_lib_gstreamer_dir}/libgstaudioconvert.so
+ %{_lib_gstreamer_dir}/libgstaudiorate.so
+ %{_lib_gstreamer_dir}/libgstaudioresample.so
+ %{_lib_gstreamer_dir}/libgstaudiotestsrc.so
+ %{_lib_gstreamer_dir}/libgstgio.so
+ %{_lib_gstreamer_dir}/libgstogg.so
+ %{_lib_gstreamer_dir}/libgstplayback.so
+ %{_lib_gstreamer_dir}/libgstoverlaycomposition.so
+ %{_lib_gstreamer_dir}/libgstsubparse.so
+ %{_lib_gstreamer_dir}/libgsttcp.so
+ %{_lib_gstreamer_dir}/libgsttheora.so
+ %{_lib_gstreamer_dir}/libgsttypefindfunctions.so
+ %{_lib_gstreamer_dir}/libgstvideoconvert.so
+ %{_lib_gstreamer_dir}/libgstvideorate.so
+ %{_lib_gstreamer_dir}/libgstvideoscale.so
+ %{_lib_gstreamer_dir}/libgstvideotestsrc.so
+ %{_lib_gstreamer_dir}/libgstvolume.so
+ %{_lib_gstreamer_dir}/libgstvorbis.so
+ %{_lib_gstreamer_dir}/libgstpbtypes.so
+ %{_lib_gstreamer_dir}/libgstrawparse.so
+ %{_lib_gstreamer_dir}/libgstopus.so
+ %{_lib_gstreamer_dir}/libgstencoding.so
+ %{_lib_gstreamer_dir}/libgstaudiomixer.so
+ %{_lib_gstreamer_dir}/libgstcompositor.so
+
+ %if %{with x}
+ %{_lib_gstreamer_dir}/libgstximagesink.so
+ %{_lib_gstreamer_dir}/libgstxvimagesink.so
+ %endif
+
+ %{_libdir}/libgstapp*.so.*
+ %{_libdir}/libgstaudio*.so.*
+ %{_libdir}/libgstallocators*.so.*
+ %{_libdir}/libgstfft*.so.*
+ %{_libdir}/libgstpbutils*.so.*
+ %{_libdir}/libgstriff*.so.*
+ %{_libdir}/libgstrtp*.so.*
+ %{_libdir}/libgstrtsp*.so.*
+ %{_libdir}/libgstsdp*.so.*
+ %{_libdir}/libgsttag*.so.*
+ %{_libdir}/libgstvideo*.so.*
+ %{_libdir}/girepository-1.0/GstAllocators-1.0.typelib
+ %{_libdir}/girepository-1.0/GstApp-1.0.typelib
+ %{_libdir}/girepository-1.0/GstAudio-1.0.typelib
+ %{_libdir}/girepository-1.0/GstPbutils-1.0.typelib
+ %{_libdir}/girepository-1.0/GstRtp-1.0.typelib
+ %{_libdir}/girepository-1.0/GstRtsp-1.0.typelib
+ %{_libdir}/girepository-1.0/GstSdp-1.0.typelib
+ %{_libdir}/girepository-1.0/GstTag-1.0.typelib
+ %{_libdir}/girepository-1.0/GstVideo-1.0.typelib
+ %dir %{_datadir}/gst-plugins-base/
+ %dir %{_datadir}/gst-plugins-base/%{gst_branch}/
+ %{_datadir}/gst-plugins-base/%{gst_branch}/license-translations.dict
+
+ %files extension-adder
+ %{_lib_gstreamer_dir}/libgstadder.so
+ %license COPYING
+
+ %files devel
+ %manifest %{name}.manifest
+ %defattr(-, root, root)
+ %{_includedir}/gstreamer-%{gst_branch}/*
+ %{_libdir}/*.so
+ %{_libdir}/pkgconfig/*.pc
+ %{_datadir}/gir-1.0/*.gir