#include <glib.h>
#include <string.h>
#include <math.h>
+#ifdef USE_TBM
+#include <gst/allocators/gsttizenmemory.h>
+#endif
#include "video-orc.h"
convert_fill_border (convert, dest);
}
+#ifdef USE_TBM
+static void
+convert_I420_SN12 (GstVideoConverter * convert, const GstVideoFrame * src,
+ GstVideoFrame * dest )
+{
+ guint8 *mY, *mUV, *Y, *U, *V;
+ gint l1, l2;
+ int i, j;
+ gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
+
+ gint width = convert->in_width;
+ gint height = convert->in_height;
+
+ mY = mUV = Y = U = V = NULL;
+ mY = GST_VIDEO_FRAME_PLANE_DATA (dest, 0);
+ mUV = GST_VIDEO_FRAME_PLANE_DATA (dest, 1);
+
+ for (i = 0; i < GST_ROUND_DOWN_2 (height); i += 2) {
+ GET_LINE_OFFSETS (interlaced, i, l1, l2);
+
+ Y = FRAME_GET_Y_LINE (src, l1);
+ memcpy(mY, Y, width);
+ mY += width;
+ Y = FRAME_GET_Y_LINE (src, l2);
+ memcpy(mY, Y, width);
+ mY += width;
+
+ U = FRAME_GET_U_LINE (src, i >> 1);
+ V = FRAME_GET_V_LINE (src, i >> 1);
+ for (j = 0; j < (width + 1) / 2; j++) {
+ *mUV++ = *U++;
+ *mUV++ = *V++;
+ }
+ }
+}
+#endif
+
static GstVideoFormat
get_scale_format (GstVideoFormat format, gint plane)
{
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
res = format;
g_assert_not_reached ();
break;
+#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ default:
+ break;
+#endif
+
}
return res;
}
in_format = GST_VIDEO_INFO_FORMAT (in_info);
out_format = GST_VIDEO_INFO_FORMAT (out_info);
+#ifdef USE_TBM
+ if(out_format == GST_VIDEO_FORMAT_SN12) {
+ /* do nothing for SN12 output format */
+ return TRUE;
+ }
+#endif
switch (in_format) {
case GST_VIDEO_FORMAT_RGB15:
case GST_VIDEO_FORMAT_RGB16:
return FALSE;
}
break;
+#ifdef USE_TBM
+ case GST_VIDEO_FORMAT_SN12:
+ return TRUE; /* do nothing for SN12 format */
+#endif
default:
break;
}
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_Y444, FALSE, FALSE, FALSE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
+#ifdef USE_TBM
+ {GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_SN12, FALSE, FALSE, FALSE, TRUE,
+ TRUE, FALSE, FALSE, FALSE, 0, 0, convert_I420_SN12},
+#endif
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_GRAY8, FALSE, FALSE, FALSE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_A420, FALSE, FALSE, FALSE, TRUE,