mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 15:08:53 +00:00
rtpsession: send twcc struct in both directions
As there are signals around rtpsession in both directions, send twcc data both upstream and downstream. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7940>
This commit is contained in:
parent
a2119fb12e
commit
90d99c7b52
1 changed files with 15 additions and 1 deletions
|
@ -2993,24 +2993,38 @@ gst_rtp_session_notify_twcc (RTPSession * sess,
|
||||||
{
|
{
|
||||||
GstRtpSession *rtpsession = GST_RTP_SESSION (user_data);
|
GstRtpSession *rtpsession = GST_RTP_SESSION (user_data);
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
|
GstPad *send_rtp_src;
|
||||||
GstPad *send_rtp_sink;
|
GstPad *send_rtp_sink;
|
||||||
|
|
||||||
GST_RTP_SESSION_LOCK (rtpsession);
|
GST_RTP_SESSION_LOCK (rtpsession);
|
||||||
if ((send_rtp_sink = rtpsession->send_rtp_sink))
|
if ((send_rtp_sink = rtpsession->send_rtp_sink))
|
||||||
gst_object_ref (send_rtp_sink);
|
gst_object_ref (send_rtp_sink);
|
||||||
|
if ((send_rtp_src = rtpsession->send_rtp_src))
|
||||||
|
gst_object_ref (send_rtp_src);
|
||||||
if (rtpsession->priv->last_twcc_stats)
|
if (rtpsession->priv->last_twcc_stats)
|
||||||
gst_structure_free (rtpsession->priv->last_twcc_stats);
|
gst_structure_free (rtpsession->priv->last_twcc_stats);
|
||||||
rtpsession->priv->last_twcc_stats = twcc_stats;
|
rtpsession->priv->last_twcc_stats = twcc_stats;
|
||||||
GST_RTP_SESSION_UNLOCK (rtpsession);
|
GST_RTP_SESSION_UNLOCK (rtpsession);
|
||||||
|
|
||||||
if (send_rtp_sink) {
|
if (send_rtp_sink) {
|
||||||
event = gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, twcc_packets);
|
event =
|
||||||
|
gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM,
|
||||||
|
gst_structure_copy (twcc_packets));
|
||||||
gst_pad_push_event (send_rtp_sink, event);
|
gst_pad_push_event (send_rtp_sink, event);
|
||||||
gst_object_unref (send_rtp_sink);
|
gst_object_unref (send_rtp_sink);
|
||||||
} else {
|
} else {
|
||||||
gst_structure_free (twcc_packets);
|
gst_structure_free (twcc_packets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (send_rtp_src) {
|
||||||
|
event =
|
||||||
|
gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM,
|
||||||
|
gst_structure_copy (twcc_packets));
|
||||||
|
gst_pad_push_event (send_rtp_src, event);
|
||||||
|
gst_object_unref (send_rtp_src);
|
||||||
|
}
|
||||||
|
|
||||||
|
gst_structure_free (twcc_packets);
|
||||||
g_object_notify (G_OBJECT (rtpsession), "twcc-stats");
|
g_object_notify (G_OBJECT (rtpsession), "twcc-stats");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue