mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-01 13:49:58 +00:00
androidmedia: Hacks for HuaweiMediaPad which reports wrong color format
COLOR_FormatYCbYCr is reported but it is actually COLOR_TI_FormatYUV420PackedSemiPlanar.
This commit is contained in:
parent
0a496f4167
commit
a36c9c1cc9
2 changed files with 12 additions and 0 deletions
|
@ -1841,6 +1841,13 @@ scan_codecs (GstPlugin * plugin)
|
|||
}
|
||||
|
||||
for (k = 0; k < n_elems; k++) {
|
||||
if (strcmp (name_str, "OMX.k3.video.decoder.avc") == 0)
|
||||
if (n_elems == 1 && color_formats_elems[k] == COLOR_FormatYCbYCr) {
|
||||
GST_INFO ("On HuaweiMediaPad it reports a wrong COLOR_FormatYCbYCr,"
|
||||
"should be COLOR_TI_FormatYUV420PackedSemiPlanar, fix it.");
|
||||
color_formats_elems[k] = COLOR_TI_FormatYUV420PackedSemiPlanar;
|
||||
}
|
||||
|
||||
GST_INFO ("Color format %d: %d", k, color_formats_elems[k]);
|
||||
gst_codec_type->color_formats[k] = color_formats_elems[k];
|
||||
}
|
||||
|
|
|
@ -698,6 +698,7 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
|||
gint crop_left, crop_right;
|
||||
gint crop_top, crop_bottom;
|
||||
GstVideoFormat gst_format;
|
||||
GstAmcVideoDecClass *klass = GST_AMC_VIDEO_DEC_GET_CLASS (self);
|
||||
|
||||
if (!gst_amc_format_get_int (format, "color-format", &color_format) ||
|
||||
!gst_amc_format_get_int (format, "width", &width) ||
|
||||
|
@ -706,6 +707,10 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (strcmp (klass->codec_info->name, "OMX.k3.video.decoder.avc") &&
|
||||
color_format == COLOR_FormatYCbYCr)
|
||||
color_format = COLOR_TI_FormatYUV420PackedSemiPlanar;
|
||||
|
||||
if (!gst_amc_format_get_int (format, "stride", &stride) ||
|
||||
!gst_amc_format_get_int (format, "slice-height", &slice_height)) {
|
||||
GST_ERROR_OBJECT (self, "Failed to get stride and slice-height");
|
||||
|
|
Loading…
Reference in a new issue