summaryrefslogtreecommitdiff
path: root/omx/gstomxvideoenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'omx/gstomxvideoenc.c')
-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);