mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
omxvideoenc: factor out get_output_caps()
No semantic change so far. https://bugzilla.gnome.org/show_bug.cgi?id=792040
This commit is contained in:
parent
2ca3cf5cfa
commit
1990580d79
1 changed files with 13 additions and 2 deletions
|
@ -549,6 +549,17 @@ gst_omx_video_enc_change_state (GstElement * element, GstStateChange transition)
|
||||||
return ret;
|
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
|
static GstFlowReturn
|
||||||
gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
|
gst_omx_video_enc_handle_output_frame (GstOMXVideoEnc * self, GstOMXPort * port,
|
||||||
GstOMXBuffer * buf, GstVideoCodecFrame * frame)
|
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");
|
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);
|
codec_data = gst_buffer_new_and_alloc (buf->omx_buf->nFilledLen);
|
||||||
|
|
||||||
gst_buffer_map (codec_data, &map, GST_MAP_WRITE);
|
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);
|
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 (!caps) {
|
||||||
if (buf)
|
if (buf)
|
||||||
gst_omx_port_release_buffer (self->enc_out_port, buf);
|
gst_omx_port_release_buffer (self->enc_out_port, buf);
|
||||||
|
|
Loading…
Reference in a new issue