diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2020-04-10 10:58:34 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2020-04-10 11:30:29 +0200 |
commit | 5e6090056db4523136a854f627b5722fc37b856f (patch) | |
tree | f04a1eb69b8fd130a35bfb861239a1e866a4a237 /omx | |
parent | 84e99060760ee0d9b1e02d2bd98f333428102fdb (diff) | |
download | gst-omx-5e6090056db4523136a854f627b5722fc37b856f.tar.gz |
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.c | 10 |
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", |