Skip to content

Commit

Permalink
media: set stream media source id for video streams
Browse files Browse the repository at this point in the history
  • Loading branch information
xhaakon committed Dec 4, 2018
1 parent 895390a commit 2ea7325
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/sipe-backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down
6 changes: 6 additions & 0 deletions src/core/sipe-media.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion src/purple/purple-media.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2ea7325

Please sign in to comment.