mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 23:06:49 +00:00
videoenc: don't set stride padding to 0 when copying frames
Padding can be left undefined there is no point filling it with 0. https://bugzilla.gnome.org/show_bug.cgi?id=793694
This commit is contained in:
parent
ea2df994f3
commit
f861ad2bc5
1 changed files with 2 additions and 20 deletions
|
@ -2273,7 +2273,7 @@ gst_omx_video_enc_nv12_manual_copy (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
GstVideoInfo *info = &self->input_state->info;
|
GstVideoInfo *info = &self->input_state->info;
|
||||||
OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def;
|
OMX_PARAM_PORTDEFINITIONTYPE *port_def = &self->enc_in_port->port_def;
|
||||||
GstVideoFrame frame;
|
GstVideoFrame frame;
|
||||||
gint i, j, height, width, dest_height;
|
gint i, j, height, width;
|
||||||
guint8 *src, *dest;
|
guint8 *src, *dest;
|
||||||
gint src_stride, dest_stride;
|
gint src_stride, dest_stride;
|
||||||
|
|
||||||
|
@ -2296,10 +2296,6 @@ gst_omx_video_enc_nv12_manual_copy (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
dest +=
|
dest +=
|
||||||
port_def->format.video.nSliceHeight * port_def->format.video.nStride;
|
port_def->format.video.nSliceHeight * port_def->format.video.nStride;
|
||||||
|
|
||||||
if (i == 0)
|
|
||||||
dest_height = port_def->format.video.nSliceHeight;
|
|
||||||
else
|
|
||||||
dest_height = port_def->format.video.nSliceHeight / 2;
|
|
||||||
src = GST_VIDEO_FRAME_COMP_DATA (&frame, i);
|
src = GST_VIDEO_FRAME_COMP_DATA (&frame, i);
|
||||||
height = GST_VIDEO_FRAME_COMP_HEIGHT (&frame, i);
|
height = GST_VIDEO_FRAME_COMP_HEIGHT (&frame, i);
|
||||||
width = GST_VIDEO_FRAME_COMP_WIDTH (&frame, i) * (i == 0 ? 1 : 2);
|
width = GST_VIDEO_FRAME_COMP_WIDTH (&frame, i) * (i == 0 ? 1 : 2);
|
||||||
|
@ -2322,12 +2318,6 @@ gst_omx_video_enc_nv12_manual_copy (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
src += src_stride;
|
src += src_stride;
|
||||||
dest += dest_stride;
|
dest += dest_stride;
|
||||||
}
|
}
|
||||||
for (; j < dest_height; j++) {
|
|
||||||
memset (dest, 0, dest_stride);
|
|
||||||
outbuf->omx_buf->nFilledLen += dest_stride;
|
|
||||||
src += src_stride;
|
|
||||||
dest += dest_stride;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_video_frame_unmap (&frame);
|
gst_video_frame_unmap (&frame);
|
||||||
|
@ -2411,7 +2401,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
|
|
||||||
switch (info->finfo->format) {
|
switch (info->finfo->format) {
|
||||||
case GST_VIDEO_FORMAT_I420:{
|
case GST_VIDEO_FORMAT_I420:{
|
||||||
gint i, j, height, width, dest_height;
|
gint i, j, height, width;
|
||||||
guint8 *src, *dest;
|
guint8 *src, *dest;
|
||||||
gint src_stride, dest_stride;
|
gint src_stride, dest_stride;
|
||||||
|
|
||||||
|
@ -2426,10 +2416,8 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
dest_stride = port_def->format.video.nStride;
|
dest_stride = port_def->format.video.nStride;
|
||||||
dest_height = port_def->format.video.nSliceHeight;
|
|
||||||
} else {
|
} else {
|
||||||
dest_stride = port_def->format.video.nStride / 2;
|
dest_stride = port_def->format.video.nStride / 2;
|
||||||
dest_height = port_def->format.video.nSliceHeight / 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
src_stride = GST_VIDEO_FRAME_COMP_STRIDE (&frame, i);
|
src_stride = GST_VIDEO_FRAME_COMP_STRIDE (&frame, i);
|
||||||
|
@ -2465,12 +2453,6 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
|
||||||
src += src_stride;
|
src += src_stride;
|
||||||
dest += dest_stride;
|
dest += dest_stride;
|
||||||
}
|
}
|
||||||
for (; j < dest_height; j++) {
|
|
||||||
memset (dest, 0, dest_stride);
|
|
||||||
outbuf->omx_buf->nFilledLen += dest_stride;
|
|
||||||
src += src_stride;
|
|
||||||
dest += dest_stride;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gst_video_frame_unmap (&frame);
|
gst_video_frame_unmap (&frame);
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue