From d581e9bc28de6160090eb3c4afc46d06cba71178 Mon Sep 17 00:00:00 2001 From: "imcheng@chromium.org" Date: Sat, 5 Apr 2014 00:10:51 +0000 Subject: Cast: Better redundancy for receiver RTCP events Previously we always take the latest RTCP events from ReceiverRtcpEventSubscriber (without clearing explicitly) and stuff the packet with at most 200 bytes of data. This patch reintroduces the resetting of ReceiverRtcpEventSubscriber map when data is read from it, and it will be used as follows: - Get data from ReceiverRtcpEventSubscriber and reset its map - (Same as before) Impose 200 byte limit on rtcp receiver logs - Fill packet with data - Push a copy of data to redundancy buffer in RtcpSender - If there is enough space left, fill packet with data that was used X_1 receiver logs ago - If there is enough space left, fill packet with data that was used X_2 receiver logs ago -- Where 0 < X_1 < X_2 <= B where B is the buffer size. - Truncate buffer to discard old receiver logs if necessary. This gives a more consistent redudancy factor of 3 for each event. In here, X_1 = 10, X_2 = B = 20. So an event will be sent at reports N, N+10, and N+20. Additional items: - fix ssrc mismatch in receiver app. - removed unused function in cast_sender.{h,cc}. BUG=349265 Review URL: https://codereview.chromium.org/203293009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261921 0039d316-1c4b-4281-b951-d872f2087c98 --- media/cast/audio_receiver/audio_receiver.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'media/cast/audio_receiver/audio_receiver.cc') diff --git a/media/cast/audio_receiver/audio_receiver.cc b/media/cast/audio_receiver/audio_receiver.cc index b214c52..b01a54f 100644 --- a/media/cast/audio_receiver/audio_receiver.cc +++ b/media/cast/audio_receiver/audio_receiver.cc @@ -271,7 +271,9 @@ void AudioReceiver::CastFeedback(const RtcpCastMessage& cast_message) { cast_environment_->Logging()->InsertFrameEvent( now, kAudioAckSent, rtp_timestamp, cast_message.ack_frame_id_); - rtcp_.SendRtcpFromRtpReceiver(&cast_message, &event_subscriber_); + ReceiverRtcpEventSubscriber::RtcpEventMultiMap rtcp_events; + event_subscriber_.GetRtcpEventsAndReset(&rtcp_events); + rtcp_.SendRtcpFromRtpReceiver(&cast_message, &rtcp_events); } base::TimeTicks AudioReceiver::GetPlayoutTime(base::TimeTicks now, -- cgit v1.1