diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2019-05-16 10:38:49 +0200 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2019-12-22 05:43:40 +0000 |
commit | bb0d9add242a2840e781c8e1581deea2e88d2cdc (patch) | |
tree | ebe4f277160b3c433dbd1a89e8e4b35b4cd82bf6 /omx | |
parent | d6d2a5b19463c2f700e5e12f48b2178018c46b67 (diff) | |
download | gst-omx-bb0d9add242a2840e781c8e1581deea2e88d2cdc.tar.gz |
omxh264enc: no need to check if codeconfig has startcode
We currently only support stream-format=byte-stream so there is no point
re-checking for it when handling CODECCONFIG buffer.
Diffstat (limited to 'omx')
-rw-r--r-- | omx/gstomxh264enc.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/omx/gstomxh264enc.c b/omx/gstomxh264enc.c index 2711e86..f050e80 100644 --- a/omx/gstomxh264enc.c +++ b/omx/gstomxh264enc.c @@ -857,32 +857,28 @@ gst_omx_h264_enc_handle_output_frame (GstOMXVideoEnc * enc, GstOMXPort * port, GstOMXH264Enc *self = GST_OMX_H264_ENC (enc); if (buf->omx_buf->nFlags & OMX_BUFFERFLAG_CODECCONFIG) { - /* The codec data is SPS/PPS with a startcode => bytestream stream format + /* The codec data is SPS/PPS but our output is stream-format=byte-stream. * For bytestream stream format the SPS/PPS is only in-stream and not * in the caps! */ - if (buf->omx_buf->nFilledLen >= 4 && - GST_READ_UINT32_BE (buf->omx_buf->pBuffer + - buf->omx_buf->nOffset) == 0x00000001) { - GstBuffer *hdrs; - GstMapInfo map = GST_MAP_INFO_INIT; + GstBuffer *hdrs; + GstMapInfo map = GST_MAP_INFO_INIT; - GST_DEBUG_OBJECT (self, "got codecconfig in byte-stream format"); + GST_DEBUG_OBJECT (self, "got codecconfig in byte-stream format"); - hdrs = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen); + hdrs = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen); - 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); + 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); - if (frame) - gst_video_codec_frame_unref (frame); + if (frame) + gst_video_codec_frame_unref (frame); - return GST_FLOW_OK; - } + return GST_FLOW_OK; } else if (self->headers) { gst_video_encoder_set_headers (GST_VIDEO_ENCODER (self), self->headers); self->headers = NULL; |