androidmedia: Add new color format, and enhance debug output

Add a new color format seen on my Galaxy S3
(OMX_SEC_COLOR_FormatNV12Tiled = 0x7fc00002) to the table,
but don't actually implement it - the decoder doesn't choose it.

Remove an assert that makes the plugin fail noisily and take the app down
if it sees a color format it doesn't recognise (just skip the codec instead)

Modify the debug output when plugin scanning to print color format info to
make this sort of thing easier in the future.
This commit is contained in:
Jan Schmidt 2013-12-31 23:18:54 +11:00
parent 14a56b6964
commit 1df82fc14f
2 changed files with 16 additions and 7 deletions

View file

@ -97,7 +97,13 @@ enum
COLOR_QCOM_FormatYUV420SemiPlanar = 0x7fa30c00, COLOR_QCOM_FormatYUV420SemiPlanar = 0x7fa30c00,
COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7fa30c03, COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7fa30c03,
/* From hardware/ti/omap4xxx/domx/omx_core/inc/OMX_TI_IVCommon.h */ /* From hardware/ti/omap4xxx/domx/omx_core/inc/OMX_TI_IVCommon.h */
COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced = 0x7f000001 COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced = 0x7f000001,
/* This format is Exynos specific from the OMX vendor-specific
* numeric range, but is defined in the Android OMX headers, so
* 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
}; };
enum enum

View file

@ -1848,7 +1848,7 @@ scan_codecs (GstPlugin * plugin)
color_formats_elems[k] = COLOR_TI_FormatYUV420PackedSemiPlanar; color_formats_elems[k] = COLOR_TI_FormatYUV420PackedSemiPlanar;
} }
GST_INFO ("Color format %d: %d", k, color_formats_elems[k]); GST_INFO ("Color format %d: 0x%x", k, color_formats_elems[k]);
gst_codec_type->color_formats[k] = color_formats_elems[k]; gst_codec_type->color_formats[k] = color_formats_elems[k];
} }
@ -1861,9 +1861,9 @@ scan_codecs (GstPlugin * plugin)
if (!ignore_unknown_color_formats if (!ignore_unknown_color_formats
&& !accepted_color_formats (gst_codec_type, is_encoder)) { && !accepted_color_formats (gst_codec_type, is_encoder)) {
GST_ERROR ("Codec has unknown color formats, ignoring"); GST_ERROR ("%s codec has unknown color formats, ignoring",
is_encoder ? "Encoder" : "Decoder");
valid_codec = FALSE; valid_codec = FALSE;
g_assert_not_reached ();
goto next_supported_type; goto next_supported_type;
} }
} }
@ -2126,7 +2126,8 @@ static const struct
COLOR_TI_FormatYUV420PackedSemiPlanar, GST_VIDEO_FORMAT_NV12}, { COLOR_TI_FormatYUV420PackedSemiPlanar, GST_VIDEO_FORMAT_NV12}, {
COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced, GST_VIDEO_FORMAT_NV12}, { COLOR_TI_FormatYUV420PackedSemiPlanarInterlaced, GST_VIDEO_FORMAT_NV12}, {
COLOR_QCOM_FormatYUV420SemiPlanar, GST_VIDEO_FORMAT_NV12}, { COLOR_QCOM_FormatYUV420SemiPlanar, GST_VIDEO_FORMAT_NV12}, {
COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka, GST_VIDEO_FORMAT_NV12} COLOR_QCOM_FormatYUV420PackedSemiPlanar64x32Tile2m8ka, GST_VIDEO_FORMAT_NV12}, {
COLOR_OMX_SEC_FormatNV12Tiled, GST_VIDEO_FORMAT_NV12}
}; };
static gboolean static gboolean
@ -2144,12 +2145,14 @@ accepted_color_formats (GstAmcCodecType * type, gboolean is_encoder)
for (j = 0; j < G_N_ELEMENTS (color_format_mapping_table); j++) { for (j = 0; j < G_N_ELEMENTS (color_format_mapping_table); j++) {
if (color_format_mapping_table[j].color_format == type->color_formats[i]) { if (color_format_mapping_table[j].color_format == type->color_formats[i]) {
found = TRUE; found = TRUE;
accepted++;
break; break;
} }
} }
if (found) if (!found) {
accepted++; GST_DEBUG ("Unknown color format 0x%x, ignoring", type->color_formats[i]);
}
} }
if (is_encoder) if (is_encoder)