mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 22:16:22 +00:00
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.
This commit is contained in:
parent
84e9906076
commit
5e6090056d
1 changed files with 9 additions and 1 deletions
|
@ -1984,10 +1984,18 @@ gst_omx_video_enc_configure_input_buffer (GstOMXVideoEnc * self,
|
||||||
|
|
||||||
meta = gst_buffer_get_video_meta (input);
|
meta = gst_buffer_get_video_meta (input);
|
||||||
if (meta) {
|
if (meta) {
|
||||||
|
guint plane_height[GST_VIDEO_MAX_PLANES];
|
||||||
|
|
||||||
/* Use the stride and slice height of the first plane */
|
/* 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];
|
stride = meta->stride[0];
|
||||||
g_assert (stride != 0);
|
g_assert (stride != 0);
|
||||||
slice_height = (meta->offset[1] - meta->offset[0]) / stride;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self,
|
GST_DEBUG_OBJECT (self,
|
||||||
"adjusting stride (%d) and slice-height (%d) using input buffer meta",
|
"adjusting stride (%d) and slice-height (%d) using input buffer meta",
|
||||||
|
|
Loading…
Reference in a new issue