summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2017-11-07 14:30:45 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-01-30 09:23:59 +0000
commit1990580d798ad7c8d0ad1605b04d5f7d6c41fb55 (patch)
tree118eb594c3fa494f9179d31a75c1ee5ae93efb4a
parent2ca3cf5cfa47ca367bd58005a2303fb6b3a1609a (diff)
downloadgst-omx-1990580d798ad7c8d0ad1605b04d5f7d6c41fb55.tar.gz
omxvideoenc: factor out get_output_caps()
No semantic change so far. https://bugzilla.gnome.org/show_bug.cgi?id=792040
-rw-r--r--omx/gstomxvideoenc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 5f8046d..80f9562 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -549,6 +549,17 @@ gst_omx_video_enc_change_state (GstElement * element, GstStateChange transition)
return ret;
}
+static GstCaps *
+get_output_caps (GstOMXVideoEnc * self)
+{
+ GstOMXVideoEncClass *klass = GST_OMX_VIDEO_ENC_GET_CLASS (self);
+ GstCaps *caps;
+
+ caps = klass->get_caps (self, self->enc_out_port, self->input_state);
+
+ return caps;
+}
+
static GstFlowReturn
gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
GstOMXBuffer * buf, GstVideoCodecFrame * frame)
@@ -565,7 +576,7 @@ gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
GST_DEBUG_OBJECT (self, "Handling codec data");
- caps = klass->get_caps (self, self->enc_out_port, self->input_state);
+ caps = get_output_caps (self);
codec_data = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen);
gst_buffer_map (codec_data, &map, GST_MAP_WRITE);
@@ -690,7 +701,7 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
GST_VIDEO_ENCODER_STREAM_LOCK (self);
- caps = klass->get_caps (self, self->enc_out_port, self->input_state);
+ caps = get_output_caps (self);
if (!caps) {
if (buf)
gst_omx_port_release_buffer (self->enc_out_port, buf);