summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-08-31 12:24:34 +0200
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2019-12-22 05:43:40 +0000
commitde83fbd3a365e5f78f92ef7cab4a424abc31141a (patch)
treec6f70a59f22c2e2c74d8d69a90b4f5cdb9fcb7c9
parentbba92f64ca2fece3a50938d408014772fc41bbcc (diff)
downloadgst-omx-de83fbd3a365e5f78f92ef7cab4a424abc31141a.tar.gz
omxvideoenc: use subframe base class API
Use subframe base class support.
-rw-r--r--omx/gstomxvideoenc.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 7c7bd95..c98d239 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1429,9 +1429,19 @@ gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
}
if (frame) {
- frame->output_buffer = outbuf;
- flow_ret =
- gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (self), frame);
+ if ((buf->omx_buf->nFlags & OMX_BUFFERFLAG_ENDOFFRAME)
+ || !gst_omx_port_get_subframe (self->enc_out_port)) {
+ frame->output_buffer = outbuf;
+ flow_ret =
+ gst_video_encoder_finish_frame (GST_VIDEO_ENCODER (self), frame);
+ if (buf->omx_buf->nFlags | ~OMX_BUFFERFLAG_ENDOFFRAME)
+ GST_WARNING_OBJECT (self,
+ "OMX_BUFFERFLAG_ENDOFFRAME is missing flags");
+ } else {
+ flow_ret =
+ gst_video_encoder_finish_subframe (GST_VIDEO_ENCODER (self), frame);
+ gst_video_codec_frame_unref (frame);
+ }
} else {
GST_ERROR_OBJECT (self, "No corresponding frame found");
flow_ret = gst_pad_push (GST_VIDEO_ENCODER_SRC_PAD (self), outbuf);