mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 15:48:23 +00:00
rtph265depay: minor clean-up
Declutter caps update code a bit.
This commit is contained in:
parent
bca8ac2cf0
commit
0580efc6a6
1 changed files with 14 additions and 19 deletions
|
@ -296,9 +296,10 @@ parse_pps (GstMapInfo * map, guint32 * sps_id, guint32 * pps_id)
|
|||
static gboolean
|
||||
gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay)
|
||||
{
|
||||
gboolean res;
|
||||
gboolean res, update_caps;
|
||||
GstCaps *old_caps;
|
||||
GstCaps *srccaps;
|
||||
GstPad *srcpad;
|
||||
|
||||
if (!rtph265depay->byte_stream &&
|
||||
(!rtph265depay->new_codec_data ||
|
||||
|
@ -506,8 +507,9 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay)
|
|||
gst_buffer_unref (codec_data);
|
||||
}
|
||||
|
||||
old_caps =
|
||||
gst_pad_get_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay));
|
||||
srcpad = GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay);
|
||||
|
||||
old_caps = gst_pad_get_current_caps (srcpad);
|
||||
if (old_caps != NULL) {
|
||||
|
||||
/* Only update the caps if they are not equal. For
|
||||
|
@ -516,12 +518,7 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay)
|
|||
* and gstrtph264depay
|
||||
*/
|
||||
if (rtph265depay->byte_stream) {
|
||||
if (!gst_caps_is_equal (srccaps, old_caps))
|
||||
res =
|
||||
gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay),
|
||||
srccaps);
|
||||
else
|
||||
res = TRUE;
|
||||
update_caps = !gst_caps_is_equal (srccaps, old_caps);
|
||||
} else {
|
||||
GstCaps *tmp_caps = gst_caps_copy (srccaps);
|
||||
GstStructure *old_s, *tmp_s;
|
||||
|
@ -532,20 +529,18 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay)
|
|||
gst_structure_set_value (tmp_s, "codec_data",
|
||||
gst_structure_get_value (old_s, "codec_data"));
|
||||
|
||||
if (!gst_caps_is_equal (old_caps, tmp_caps))
|
||||
res =
|
||||
gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay),
|
||||
srccaps);
|
||||
else
|
||||
res = TRUE;
|
||||
|
||||
update_caps = !gst_caps_is_equal (old_caps, tmp_caps);
|
||||
gst_caps_unref (tmp_caps);
|
||||
}
|
||||
gst_caps_unref (old_caps);
|
||||
} else {
|
||||
res =
|
||||
gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay),
|
||||
srccaps);
|
||||
update_caps = TRUE;
|
||||
}
|
||||
|
||||
if (update_caps) {
|
||||
res = gst_pad_set_caps (srcpad, srccaps);
|
||||
} else {
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
gst_caps_unref (srccaps);
|
||||
|
|
Loading…
Reference in a new issue