summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-05-16 10:38:49 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2019-12-22 05:43:40 +0000
commit4c9b8052c7fd15fd0fd676b78d4ba8debd3ebb2d (patch)
tree076670caa91641435bed2a4eba622f1887c0b799
parentbb0d9add242a2840e781c8e1581deea2e88d2cdc (diff)
downloadgst-omx-4c9b8052c7fd15fd0fd676b78d4ba8debd3ebb2d.tar.gz
omxh264enc: send codec data downstream
We are operating in stream-format=byte-stream so the codec data buffer is meant to be part of the buffer flow. The base class will push it when a key frame is requested (as we stored it with gst_video_encoder_set_headers()) but we still have to push it right away as part of the normal buffer flow. Also set the HEADER flag on this buffer.
-rw-r--r--omx/gstomxh264enc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/omx/gstomxh264enc.c b/omx/gstomxh264enc.c
index f050e80..94963e1 100644
--- a/omx/gstomxh264enc.c
+++ b/omx/gstomxh264enc.c
@@ -863,22 +863,27 @@ gst_omx_h264_enc_handle_output_frame (GstOMXVideoEnc * enc, GstOMXPort * port,
*/
GstBuffer *hdrs;
GstMapInfo map = GST_MAP_INFO_INIT;
+ GstFlowReturn flow_ret;
GST_DEBUG_OBJECT (self, "got codecconfig in byte-stream format");
hdrs = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen);
+ GST_BUFFER_FLAG_SET (hdrs, GST_BUFFER_FLAG_HEADER);
gst_buffer_map (hdrs, &map, GST_MAP_WRITE);
memcpy (map.data,
buf->omx_buf->pBuffer + buf->omx_buf->nOffset,
buf->omx_buf->nFilledLen);
gst_buffer_unmap (hdrs, &map);
- self->headers = g_list_append (self->headers, hdrs);
+ self->headers = g_list_append (self->headers, gst_buffer_ref (hdrs));
+ frame->output_buffer = hdrs;
+ flow_ret =
+ gst_video_encoder_finish_subframe (GST_VIDEO_ENCODER (self), frame);
if (frame)
gst_video_codec_frame_unref (frame);
- return GST_FLOW_OK;
+ return flow_ret;
} else if (self->headers) {
gst_video_encoder_set_headers (GST_VIDEO_ENCODER (self), self->headers);
self->headers = NULL;