p_sys->crop_top = 0;
p_sys->crop_left = 0;
}
- /* Workaround for some Samsung decoders, the ones named e.g.
- * OMX.SEC.avc.dec don't have any padding between planes (while
- * the slice height signals that they would have). The ones
- * named OMX.SEC.AVC.Decoder have proper slice height as the
- * parameter indicates. */
- if (!strncmp(p_sys->name, "OMX.SEC.", strlen("OMX.SEC.")) &&
- !strstr(p_sys->name, ".Decoder")) {
+ if (IgnoreOmxDecoderPadding(p_sys->name)) {
p_sys->slice_height = 0;
p_sys->stride = p_dec->fmt_out.video.i_width;
}
strlen("OMX.qcom.video.decoder")))
def->format.video.eColorFormat = OMX_QCOM_COLOR_FormatYVU420SemiPlanar;
- /* Hack: Some Samsung devices (e.g. Galaxy S III) have multiple
- * H264 decoders with different quirks (OMX.SEC.avc.dec, OMX.SEC.avcdec
- * and OMX.SEC.AVC.Decoder) - the latter is well-behaved while the
- * former ones signal padding but in practice doesn't have any padding.
- * We can't simply ignore the buggy ones, because some devices only
- * have that one (Galaxy S II has only got one named OMX.SEC.avcdec,
- * at least in the pre-4.0 firmwares). Thus, we enable this quirk on
- * any OMX.SEC. decoder that doesn't contain the string ".Decoder". */
- if(!strncmp(p_sys->psz_component, "OMX.SEC.", strlen("OMX.SEC.")) &&
- !strstr(p_sys->psz_component, ".Decoder")) {
+ if (IgnoreOmxDecoderPadding(p_sys->psz_component)) {
def->format.video.nSliceHeight = 0;
def->format.video.nStride = p_fmt->video.i_width;
}
void CopyVlcPicture( decoder_t *, OMX_BUFFERHEADERTYPE *, picture_t * );
+int IgnoreOmxDecoderPadding(const char *psz_name);
+
/*****************************************************************************
* Logging utility functions
*****************************************************************************/
}
}
+int IgnoreOmxDecoderPadding(const char *name)
+{
+ // The list of decoders that signal padding properly is not necessary,
+ // since that is the default, but keep it here for reference. (This is
+ // only relevant for manufacturers that are known to have decoders with
+ // this kind of bug.)
+ // Unknown: OMX.SEC.vc1.dec (wmv9/vc1 - lack of samples that have cropping)
+/*
+ static const char *padding_decoders[] = {
+ "OMX.SEC.AVC.Decoder",
+ "OMX.SEC.wmv7.dec",
+ "OMX.SEC.wmv8.dec",
+ NULL
+ };
+*/
+ static const char *nopadding_decoders[] = {
+ "OMX.SEC.avc.dec",
+ "OMX.SEC.avcdec",
+ "OMX.SEC.MPEG4.Decoder",
+ "OMX.SEC.mpeg4.dec",
+ NULL
+ };
+ for (const char **ptr = nopadding_decoders; *ptr; ptr++) {
+ if (!strcmp(*ptr, name))
+ return 1;
+ }
+ return 0;
+}
+
/*****************************************************************************
* Logging utility functions
*****************************************************************************/