mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +00:00
videocoder: Don't push out identical caps
This avoids triggering plenty of extra code/methods/overhead downstream when we can just quickly check whenever we want to set caps whether they are identical or not https://bugzilla.gnome.org/show_bug.cgi?id=706600
This commit is contained in:
parent
cd3fe60c68
commit
d1cf4b2b9a
1 changed files with 9 additions and 1 deletions
|
@ -3010,6 +3010,7 @@ gst_video_decoder_negotiate_default (GstVideoDecoder * decoder)
|
||||||
GstAllocationParams params;
|
GstAllocationParams params;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
GstVideoCodecFrame *frame;
|
GstVideoCodecFrame *frame;
|
||||||
|
GstCaps *prevcaps;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_VIDEO_INFO_WIDTH (&state->info) != 0, FALSE);
|
g_return_val_if_fail (GST_VIDEO_INFO_WIDTH (&state->info) != 0, FALSE);
|
||||||
g_return_val_if_fail (GST_VIDEO_INFO_HEIGHT (&state->info) != 0, FALSE);
|
g_return_val_if_fail (GST_VIDEO_INFO_HEIGHT (&state->info) != 0, FALSE);
|
||||||
|
@ -3052,7 +3053,14 @@ gst_video_decoder_negotiate_default (GstVideoDecoder * decoder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevcaps = gst_pad_get_current_caps (decoder->srcpad);
|
||||||
|
if (!prevcaps || !gst_caps_is_equal (prevcaps, state->caps))
|
||||||
ret = gst_pad_set_caps (decoder->srcpad, state->caps);
|
ret = gst_pad_set_caps (decoder->srcpad, state->caps);
|
||||||
|
else
|
||||||
|
ret = TRUE;
|
||||||
|
if (prevcaps)
|
||||||
|
gst_caps_unref (prevcaps);
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
Loading…
Reference in a new issue