amc/videodec: only retrieve the stride/slice-height for raw output

When outputting to a surface, these values may not exist.

As found on a Google Pixel 3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1284>
This commit is contained in:
Matthew Waters 2020-05-19 14:58:35 +10:00 committed by GStreamer Merge Bot
parent 3f16353d64
commit 8403d97587

View file

@ -758,14 +758,6 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
return FALSE;
}
if (!gst_amc_format_get_int (format, "stride", &stride, &err) ||
!gst_amc_format_get_int (format, "slice-height", &slice_height, &err)) {
GST_ERROR_OBJECT (self, "Failed to get stride and slice-height: %s",
err->message);
g_clear_error (&err);
return FALSE;
}
if (gst_amc_format_get_int (format, "crop-left", &crop_left, NULL) &&
gst_amc_format_get_int (format, "crop-right", &crop_right, NULL)) {
width = crop_right + 1 - crop_left;
@ -835,6 +827,14 @@ gst_amc_video_dec_set_src_caps (GstAmcVideoDec * self, GstAmcFormat * format)
goto out;
}
if (!gst_amc_format_get_int (format, "stride", &stride, &err) ||
!gst_amc_format_get_int (format, "slice-height", &slice_height, &err)) {
GST_ERROR_OBJECT (self, "Failed to get stride and slice-height: %s",
err->message);
g_clear_error (&err);
return FALSE;
}
self->format = gst_format;
self->width = width;
self->height = height;