From 7ebef2941ba29a2198ede5bc56a82aa451d1384f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 2 Nov 2011 10:39:10 +0100 Subject: [PATCH] omxvideoenc: If no stride was set for the OMX input port assume GStreamer stride This is not really correct but there's nothing else we could do. --- omx/gstomxvideoenc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index bd250a3..e8a1dbd 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1106,10 +1106,17 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, dest_stride = port_def->format.video.nStride; src_stride = gst_video_format_get_row_stride (state->format, 0, state->width); + + /* XXX: Try this if no stride was set */ + if (dest_stride == 0) + dest_stride = src_stride; } else { dest_stride = port_def->format.video.nStride / 2; src_stride = gst_video_format_get_row_stride (state->format, 1, state->width); + /* XXX: Try this if no stride was set */ + if (dest_stride == 0) + dest_stride = src_stride; } dest = outbuf->omx_buf->pBuffer + outbuf->omx_buf->nOffset; @@ -1166,10 +1173,16 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf, dest_stride = port_def->format.video.nStride; src_stride = gst_video_format_get_row_stride (state->format, 0, state->width); + /* XXX: Try this if no stride was set */ + if (dest_stride == 0) + dest_stride = src_stride; } else { dest_stride = port_def->format.video.nStride; src_stride = gst_video_format_get_row_stride (state->format, 1, state->width); + /* XXX: Try this if no stride was set */ + if (dest_stride == 0) + dest_stride = src_stride; } dest = outbuf->omx_buf->pBuffer + outbuf->omx_buf->nOffset; -- 2.7.4