From 3c77fbda8774de0e9ac9a3839f8b6bcd656f3887 Mon Sep 17 00:00:00 2001 From: Matthieu Bouron Date: Sun, 3 May 2015 14:56:05 +0200 Subject: [PATCH] androidmedia: Add suport for COLOR_FormatYV12 Reference: http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12 https://bugzilla.gnome.org/show_bug.cgi?id=747126 --- sys/androidmedia/gstamc-constants.h | 4 +++- sys/androidmedia/gstamc.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/androidmedia/gstamc-constants.h b/sys/androidmedia/gstamc-constants.h index af2a877edc..ae524642d0 100644 --- a/sys/androidmedia/gstamc-constants.h +++ b/sys/androidmedia/gstamc-constants.h @@ -111,7 +111,9 @@ enum * we shouldn't find incompatible usage and crash horribly... right? * FIXME: Not actually implemented in the video decoder, it will just error out * The format seems to be equiv to V4L2_PIX_FMT_NV12MT_16X16 */ - COLOR_OMX_SEC_FormatNV12Tiled = 0x7fc00002 + COLOR_OMX_SEC_FormatNV12Tiled = 0x7fc00002, + /* YV12: http://developer.android.com/reference/android/graphics/ImageFormat.html#YV12 */ + COLOR_FormatYV12 = 0x32315659, }; enum diff --git a/sys/androidmedia/gstamc.c b/sys/androidmedia/gstamc.c index f9dbdba520..8080de401b 100644 --- a/sys/androidmedia/gstamc.c +++ b/sys/androidmedia/gstamc.c @@ -1785,7 +1785,8 @@ static const struct COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka, GST_VIDEO_FORMAT_NV12}, { COLOR_QCOM_FormatYVU420SemiPlanar32m, GST_VIDEO_FORMAT_NV12}, { COLOR_OMX_SEC_FormatNV12Tiled, GST_VIDEO_FORMAT_NV12}, { - COLOR_FormatYCbYCr, GST_VIDEO_FORMAT_YUY2} + COLOR_FormatYCbYCr, GST_VIDEO_FORMAT_YUY2}, { + COLOR_FormatYV12, GST_VIDEO_FORMAT_YV12} }; static gboolean @@ -1971,6 +1972,7 @@ gst_amc_color_format_info_set (GstAmcColorFormatInfo * color_format_info, switch (color_format) { case COLOR_FormatYUV420Planar: case COLOR_FormatYUV420Flexible:{ + case COLOR_FormatYV12: if (stride == 0 || slice_height == 0) { GST_ERROR ("Stride or slice height is 0"); return FALSE;