mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
basevideoencoder: simplify negotiated checking
... by avoiding some extraneous (un)ref'ing.
This commit is contained in:
parent
dd118538e9
commit
72a32afc65
1 changed files with 1 additions and 17 deletions
|
@ -384,22 +384,6 @@ error:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gst_pad_is_negotiated (GstPad * pad)
|
|
||||||
{
|
|
||||||
GstCaps *caps;
|
|
||||||
|
|
||||||
g_return_val_if_fail (pad != NULL, FALSE);
|
|
||||||
|
|
||||||
caps = gst_pad_get_negotiated_caps (pad);
|
|
||||||
if (caps) {
|
|
||||||
gst_caps_unref (caps);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_base_video_encoder_chain (GstPad * pad, GstBuffer * buf)
|
gst_base_video_encoder_chain (GstPad * pad, GstBuffer * buf)
|
||||||
{
|
{
|
||||||
|
@ -412,7 +396,7 @@ gst_base_video_encoder_chain (GstPad * pad, GstBuffer * buf)
|
||||||
|
|
||||||
g_return_val_if_fail (klass->handle_frame != NULL, GST_FLOW_ERROR);
|
g_return_val_if_fail (klass->handle_frame != NULL, GST_FLOW_ERROR);
|
||||||
|
|
||||||
if (!gst_pad_is_negotiated (pad)) {
|
if (!GST_PAD_CAPS (pad)) {
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue