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

Unified Diff: webrtc/api/webrtcsession.cc

Issue 1838413002: Combining SetVideoSend and SetSource into one method. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressing pbos@'s comments. Created 4 years, 7 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
Index: webrtc/api/webrtcsession.cc
diff --git a/webrtc/api/webrtcsession.cc b/webrtc/api/webrtcsession.cc
index 2b146c6b155bade2893c7ec6c0a60cf6ea732896..a4c56adab9743103037ede8d75e4c00473379d60 100644
--- a/webrtc/api/webrtcsession.cc
+++ b/webrtc/api/webrtcsession.cc
@@ -1236,21 +1236,6 @@ bool WebRtcSession::SetAudioRtpParameters(uint32_t ssrc,
return voice_channel_->SetRtpParameters(ssrc, parameters);
}
-bool WebRtcSession::SetSource(
- uint32_t ssrc,
- rtc::VideoSourceInterface<cricket::VideoFrame>* source) {
- ASSERT(signaling_thread()->IsCurrent());
-
- if (!video_channel_) {
- // |video_channel_| doesnt't exist. Probably because the remote end doesnt't
- // support video.
- LOG(LS_WARNING) << "Video not used in this call.";
- return false;
- }
- video_channel_->SetSource(ssrc, source);
- return true;
-}
-
void WebRtcSession::SetVideoPlayout(
uint32_t ssrc,
bool enable,
@@ -1268,19 +1253,21 @@ void WebRtcSession::SetVideoPlayout(
}
}
-void WebRtcSession::SetVideoSend(uint32_t ssrc,
- bool enable,
- const cricket::VideoOptions* options) {
+void WebRtcSession::SetVideoSend(
+ uint32_t ssrc,
+ bool enable,
+ const cricket::VideoOptions* options,
+ rtc::VideoSourceInterface<cricket::VideoFrame>* source) {
ASSERT(signaling_thread()->IsCurrent());
if (!video_channel_) {
LOG(LS_WARNING) << "SetVideoSend: No video channel exists.";
return;
}
- if (!video_channel_->SetVideoSend(ssrc, enable, options)) {
- // Allow that MuteStream fail if |enable| is false but assert otherwise.
- // This in the normal case when the underlying media channel has already
- // been deleted.
- ASSERT(enable == false);
+ if (!video_channel_->SetVideoSend(ssrc, enable, options, source)) {
+ // Allow that MuteStream fail if |enable| is false and |source| is NULL but
+ // assert otherwise. This in the normal case when the underlying media
+ // channel has already been deleted.
+ ASSERT(enable == false && source == nullptr);
}
}

Powered by Google App Engine
This is Rietveld 408576698