OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1413 } | 1413 } |
1414 default: | 1414 default: |
1415 RTC_DCHECK(false && "Not implemented"); | 1415 RTC_DCHECK(false && "Not implemented"); |
1416 break; | 1416 break; |
1417 } | 1417 } |
1418 } | 1418 } |
1419 | 1419 |
1420 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, | 1420 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, |
1421 const std::string& track_id, | 1421 const std::string& track_id, |
1422 uint32_t ssrc) { | 1422 uint32_t ssrc) { |
1423 receivers_.push_back( | 1423 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
1424 RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1424 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
1425 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, | 1425 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, |
1426 session_->voice_channel()))); | 1426 session_->voice_channel())); |
1427 | |
1428 receivers_.push_back(receiver); | |
1429 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | |
1430 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | |
honghaiz3
2016/11/17 01:19:02
Is there any reason to use a vector of streams her
Zhi Huang
2016/11/17 01:42:06
According to the spec: https://www.w3.org/TR/webrt
Taylor Brandstetter
2016/11/17 02:07:25
I agree about this. Even if we take a long time to
| |
1431 observer_->OnAddTrack(receiver, streams); | |
honghaiz3
2016/11/17 01:52:31
Should we just get the track from the receiver and
| |
1427 } | 1432 } |
1428 | 1433 |
1429 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, | 1434 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, |
1430 const std::string& track_id, | 1435 const std::string& track_id, |
1431 uint32_t ssrc) { | 1436 uint32_t ssrc) { |
1432 receivers_.push_back( | 1437 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
1433 RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1438 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
1434 signaling_thread(), | 1439 signaling_thread(), |
1435 new VideoRtpReceiver(stream, track_id, factory_->worker_thread(), | 1440 new VideoRtpReceiver(stream, track_id, factory_->worker_thread(), |
1436 ssrc, session_->video_channel()))); | 1441 ssrc, session_->video_channel())); |
1442 receivers_.push_back(receiver); | |
1443 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | |
1444 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | |
1445 observer_->OnAddTrack(receiver, streams); | |
1437 } | 1446 } |
1438 | 1447 |
1439 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote | 1448 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote |
1440 // description. | 1449 // description. |
1441 void PeerConnection::DestroyReceiver(const std::string& track_id) { | 1450 void PeerConnection::DestroyReceiver(const std::string& track_id) { |
1442 auto it = FindReceiverForTrack(track_id); | 1451 auto it = FindReceiverForTrack(track_id); |
1443 if (it == receivers_.end()) { | 1452 if (it == receivers_.end()) { |
1444 LOG(LS_WARNING) << "RtpReceiver for track with id " << track_id | 1453 LOG(LS_WARNING) << "RtpReceiver for track with id " << track_id |
1445 << " doesn't exist."; | 1454 << " doesn't exist."; |
1446 } else { | 1455 } else { |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2350 | 2359 |
2351 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2360 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
2352 int64_t max_size_bytes) { | 2361 int64_t max_size_bytes) { |
2353 return event_log_->StartLogging(file, max_size_bytes); | 2362 return event_log_->StartLogging(file, max_size_bytes); |
2354 } | 2363 } |
2355 | 2364 |
2356 void PeerConnection::StopRtcEventLog_w() { | 2365 void PeerConnection::StopRtcEventLog_w() { |
2357 event_log_->StopLogging(); | 2366 event_log_->StopLogging(); |
2358 } | 2367 } |
2359 } // namespace webrtc | 2368 } // namespace webrtc |
OLD | NEW |