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

Side by Side Diff: talk/app/webrtc/rtpsender.cc

Issue 1522903002: Add a 'remote' property to MediaSourceInterface. Also adding an implementation to the relevant sour… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years 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 unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/rtpreceiver.cc ('k') | talk/app/webrtc/rtpsenderreceiver_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 if (stats_) { 177 if (stats_) {
178 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_); 178 stats_->RemoveLocalAudioTrack(track_.get(), ssrc_);
179 } 179 }
180 } 180 }
181 stopped_ = true; 181 stopped_ = true;
182 } 182 }
183 183
184 void AudioRtpSender::SetAudioSend() { 184 void AudioRtpSender::SetAudioSend() {
185 RTC_DCHECK(!stopped_ && can_send_track()); 185 RTC_DCHECK(!stopped_ && can_send_track());
186 cricket::AudioOptions options; 186 cricket::AudioOptions options;
187 if (track_->enabled() && track_->GetSource()) { 187 if (track_->enabled() && track_->GetSource() &&
188 !track_->GetSource()->remote()) {
188 // TODO(xians): Remove this static_cast since we should be able to connect 189 // TODO(xians): Remove this static_cast since we should be able to connect
189 // a remote audio track to a peer connection. 190 // a remote audio track to a peer connection.
190 options = static_cast<LocalAudioSource*>(track_->GetSource())->options(); 191 options = static_cast<LocalAudioSource*>(track_->GetSource())->options();
191 } 192 }
192 193
193 // Use the renderer if the audio track has one, otherwise use the sink 194 // Use the renderer if the audio track has one, otherwise use the sink
194 // adapter owned by this class. 195 // adapter owned by this class.
195 cricket::AudioRenderer* renderer = 196 cricket::AudioRenderer* renderer =
196 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get(); 197 track_->GetRenderer() ? track_->GetRenderer() : sink_adapter_.get();
197 ASSERT(renderer != nullptr); 198 ASSERT(renderer != nullptr);
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 RTC_DCHECK(!stopped_ && can_send_track()); 311 RTC_DCHECK(!stopped_ && can_send_track());
311 const cricket::VideoOptions* options = nullptr; 312 const cricket::VideoOptions* options = nullptr;
312 VideoSourceInterface* source = track_->GetSource(); 313 VideoSourceInterface* source = track_->GetSource();
313 if (track_->enabled() && source) { 314 if (track_->enabled() && source) {
314 options = source->options(); 315 options = source->options();
315 } 316 }
316 provider_->SetVideoSend(ssrc_, track_->enabled(), options); 317 provider_->SetVideoSend(ssrc_, track_->enabled(), options);
317 } 318 }
318 319
319 } // namespace webrtc 320 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/rtpreceiver.cc ('k') | talk/app/webrtc/rtpsenderreceiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698