event = gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, twcc_packets);
gst_pad_push_event (send_rtp_sink, event);
gst_object_unref (send_rtp_sink);
+ } else {
+ gst_structure_free (twcc_packets);
}
g_object_notify (G_OBJECT (rtpsession), "twcc-stats");
RTP_SESSION_UNLOCK (sess);
if (sess->callbacks.notify_twcc)
- sess->callbacks.notify_twcc (sess, twcc_packets_s, twcc_stats_s,
- sess->notify_twcc_user_data);
+ sess->callbacks.notify_twcc (sess, g_steal_pointer (&twcc_packets_s),
+ g_steal_pointer (&twcc_stats_s), sess->notify_twcc_user_data);
+ else {
+ gst_structure_free (twcc_packets_s);
+ gst_structure_free (twcc_stats_s);
+ }
RTP_SESSION_LOCK (sess);
}
/**
* RTPSessionNotifyTWCC:
+ * @sess: an #RTPSession
+ * @twcc_packets: (transfer full): TWCC packets #GstStructure
+ * @twcc_stats: (transfer full): TWCC stats #GstStructure
* @user_data: user data specified when registering
*
* Notifies of Transport-wide congestion control packets and stats.