summaryrefslogtreecommitdiff
path: root/omx
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2020-04-10 10:58:34 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2020-04-10 11:30:29 +0200
commit5e6090056db4523136a854f627b5722fc37b856f (patch)
treef04a1eb69b8fd130a35bfb861239a1e866a4a237 /omx
parent84e99060760ee0d9b1e02d2bd98f333428102fdb (diff)
omxvideoenc: use gst_video_meta_get_plane_height() to compute slice height
This new API saves us from doing manual computation and actually work with single planar formats, such as GRAY8.
Diffstat (limited to 'omx')
-rw-r--r--omx/gstomxvideoenc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 5da6085..a37b127 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1984,10 +1984,18 @@ gst_omx_video_enc_configure_input_buffer (GstOMXVideoEnc * self,
meta = gst_buffer_get_video_meta (input);
if (meta) {
+ guint plane_height[GST_VIDEO_MAX_PLANES];
+
/* Use the stride and slice height of the first plane */
+ if (!gst_video_meta_get_plane_height (meta, plane_height)) {
+ GST_WARNING_OBJECT (self, "Failed to retrieve plane height from meta");
+ slice_height = GST_VIDEO_INFO_FIELD_HEIGHT (info);
+ } else {
+ slice_height = plane_height[0];
+ }
+
stride = meta->stride[0];
g_assert (stride != 0);
- slice_height = (meta->offset[1] - meta->offset[0]) / stride;
GST_DEBUG_OBJECT (self,
"adjusting stride (%d) and slice-height (%d) using input buffer meta",