Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(526)

Unified Diff: webrtc/media/engine/webrtcvideoengine.cc

Issue 2974453002: Protected streams report RTP messages directly to the FlexFec streams (Closed)
Patch Set: Appease lint. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine.h ('k') | webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine.cc
diff --git a/webrtc/media/engine/webrtcvideoengine.cc b/webrtc/media/engine/webrtcvideoengine.cc
index b6447329e265519da1f19d29f1227006feeff8c0..2651a9a3bb6e7521ea7f9dd6d0c59d6d8d10242b 100644
--- a/webrtc/media/engine/webrtcvideoengine.cc
+++ b/webrtc/media/engine/webrtcvideoengine.cc
@@ -2154,6 +2154,7 @@ WebRtcVideoChannel::WebRtcVideoReceiveStream::AllocatedDecoder::
WebRtcVideoChannel::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() {
if (flexfec_stream_) {
+ MaybeDissociateFlexfecFromVideo();
call_->DestroyFlexfecReceiveStream(flexfec_stream_);
}
call_->DestroyVideoReceiveStream(stream_);
@@ -2334,24 +2335,42 @@ void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetRecvParameters(
void WebRtcVideoChannel::WebRtcVideoReceiveStream::
RecreateWebRtcVideoStream() {
if (stream_) {
+ MaybeDissociateFlexfecFromVideo();
call_->DestroyVideoReceiveStream(stream_);
stream_ = nullptr;
}
webrtc::VideoReceiveStream::Config config = config_.Copy();
config.rtp.protected_by_flexfec = (flexfec_stream_ != nullptr);
stream_ = call_->CreateVideoReceiveStream(std::move(config));
+ MaybeAssociateFlexfecWithVideo();
stream_->Start();
}
void WebRtcVideoChannel::WebRtcVideoReceiveStream::
MaybeRecreateWebRtcFlexfecStream() {
if (flexfec_stream_) {
+ MaybeDissociateFlexfecFromVideo();
call_->DestroyFlexfecReceiveStream(flexfec_stream_);
flexfec_stream_ = nullptr;
}
if (flexfec_config_.IsCompleteAndEnabled()) {
flexfec_stream_ = call_->CreateFlexfecReceiveStream(flexfec_config_);
flexfec_stream_->Start();
+ MaybeAssociateFlexfecWithVideo();
+ }
+}
+
+void WebRtcVideoChannel::WebRtcVideoReceiveStream::
+ MaybeAssociateFlexfecWithVideo() {
+ if (stream_ && flexfec_stream_) {
+ stream_->AddSecondarySink(flexfec_stream_);
+ }
+}
+
+void WebRtcVideoChannel::WebRtcVideoReceiveStream::
+ MaybeDissociateFlexfecFromVideo() {
+ if (stream_ && flexfec_stream_) {
+ stream_->RemoveSecondarySink(flexfec_stream_);
}
}
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine.h ('k') | webrtc/modules/rtp_rtcp/source/flexfec_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698