From 2ea7325e39c0698ce585918d005642318ba8aefa Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Sun, 7 Oct 2018 20:05:15 +0200 Subject: [PATCH] media: set stream media source id for video streams --- src/api/sipe-backend.h | 1 + src/core/sipe-media.c | 6 ++++++ src/purple/purple-media.c | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/api/sipe-backend.h b/src/api/sipe-backend.h index 2e69a56a0..d4577ec18 100644 --- a/src/api/sipe-backend.h +++ b/src/api/sipe-backend.h @@ -395,6 +395,7 @@ struct sipe_media_stream { struct sipe_media_call *call; gchar *id; struct ssrc_range *ssrc_range; + guint32 media_source_id; void (*candidate_pairs_established_cb)(struct sipe_media_stream *); void (*read_cb)(struct sipe_media_stream *); diff --git a/src/core/sipe-media.c b/src/core/sipe-media.c index b9c7e3f45..61cf89674 100644 --- a/src/core/sipe-media.c +++ b/src/core/sipe-media.c @@ -847,6 +847,10 @@ update_call_from_remote_sdp(struct sipe_media_call_private* call_private, backend_candidates); sipe_media_candidate_list_free(backend_candidates); + if (sipe_strequal(stream->id, "video") && call_private->conference_session) { + stream->media_source_id = call_private->conference_session->video_media_source_id; + } + SIPE_MEDIA_STREAM_PRIVATE->remote_candidates_and_codecs_set = TRUE; return TRUE; @@ -1424,6 +1428,8 @@ sipe_media_stream_add(struct sipe_media_call *call, const gchar *id, ssrc_count); } + SIPE_MEDIA_STREAM->media_source_id = SIPE_MSRTP_VSR_SOURCE_ANY; + SIPE_MEDIA_STREAM->backend_private = sipe_backend_media_add_stream(SIPE_MEDIA_STREAM, type, ice_version, diff --git a/src/purple/purple-media.c b/src/purple/purple-media.c index 4e4d53607..8f62fac97 100644 --- a/src/purple/purple-media.c +++ b/src/purple/purple-media.c @@ -591,12 +591,14 @@ on_sending_rtcp_cb(SIPE_UNUSED_PARAMETER GObject *rtpsession, if (sipe_strequal(send_codec->encoding_name, "H264")) { GstRTCPBuffer rtcp_buffer = GST_RTCP_BUFFER_INIT; guint32 ssrc; + struct sipe_media_stream *stream; g_object_get(fssession, "ssrc", &ssrc, NULL); + stream = g_object_get_data(G_OBJECT(fssession), "sipe-media-stream"); gst_rtcp_buffer_map(buffer, GST_MAP_READWRITE, &rtcp_buffer); was_changed = write_ms_h264_video_source_request(&rtcp_buffer, - ssrc, send_codec->id, SIPE_MSRTP_VSR_SOURCE_ANY); + ssrc, send_codec->id, stream->media_source_id); gst_rtcp_buffer_unmap(&rtcp_buffer); } @@ -777,6 +779,10 @@ gst_bus_cb(GstBus *bus, GstMessage *msg, struct sipe_media_stream *stream) stream->ssrc_range->begin, NULL); } + g_object_set_data(G_OBJECT(fssession), + "sipe-media-stream", + stream); + g_object_get(fssession, "media-type", &media_type, NULL); if (media_type == FS_MEDIA_TYPE_VIDEO) {