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

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

Issue 1563403002: Adding AddTrack/RemoveTrack to native PeerConnection API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Adding default implementation for new methods. Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/rtpsender.h ('k') | no next file » | 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 provider_(provider), 68 provider_(provider),
69 stats_(stats), 69 stats_(stats),
70 track_(track), 70 track_(track),
71 cached_track_enabled_(track->enabled()), 71 cached_track_enabled_(track->enabled()),
72 sink_adapter_(new LocalAudioSinkAdapter()) { 72 sink_adapter_(new LocalAudioSinkAdapter()) {
73 RTC_DCHECK(provider != nullptr); 73 RTC_DCHECK(provider != nullptr);
74 track_->RegisterObserver(this); 74 track_->RegisterObserver(this);
75 track_->AddSink(sink_adapter_.get()); 75 track_->AddSink(sink_adapter_.get());
76 } 76 }
77 77
78 AudioRtpSender::AudioRtpSender(AudioTrackInterface* track,
79 AudioProviderInterface* provider,
80 StatsCollector* stats)
81 : id_(track->id()),
82 stream_id_(rtc::CreateRandomUuid()),
83 provider_(provider),
84 stats_(stats),
85 track_(track),
86 cached_track_enabled_(track->enabled()),
87 sink_adapter_(new LocalAudioSinkAdapter()) {
88 RTC_DCHECK(provider != nullptr);
89 track_->RegisterObserver(this);
90 track_->AddSink(sink_adapter_.get());
91 }
92
78 AudioRtpSender::AudioRtpSender(AudioProviderInterface* provider, 93 AudioRtpSender::AudioRtpSender(AudioProviderInterface* provider,
79 StatsCollector* stats) 94 StatsCollector* stats)
80 : id_(rtc::CreateRandomUuid()), 95 : id_(rtc::CreateRandomUuid()),
81 stream_id_(rtc::CreateRandomUuid()), 96 stream_id_(rtc::CreateRandomUuid()),
82 provider_(provider), 97 provider_(provider),
83 stats_(stats), 98 stats_(stats),
84 sink_adapter_(new LocalAudioSinkAdapter()) {} 99 sink_adapter_(new LocalAudioSinkAdapter()) {}
85 100
86 AudioRtpSender::~AudioRtpSender() { 101 AudioRtpSender::~AudioRtpSender() {
87 Stop(); 102 Stop();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 VideoProviderInterface* provider) 219 VideoProviderInterface* provider)
205 : id_(track->id()), 220 : id_(track->id()),
206 stream_id_(stream_id), 221 stream_id_(stream_id),
207 provider_(provider), 222 provider_(provider),
208 track_(track), 223 track_(track),
209 cached_track_enabled_(track->enabled()) { 224 cached_track_enabled_(track->enabled()) {
210 RTC_DCHECK(provider != nullptr); 225 RTC_DCHECK(provider != nullptr);
211 track_->RegisterObserver(this); 226 track_->RegisterObserver(this);
212 } 227 }
213 228
229 VideoRtpSender::VideoRtpSender(VideoTrackInterface* track,
230 VideoProviderInterface* provider)
231 : id_(track->id()),
232 stream_id_(rtc::CreateRandomUuid()),
233 provider_(provider),
234 track_(track),
235 cached_track_enabled_(track->enabled()) {
236 RTC_DCHECK(provider != nullptr);
237 track_->RegisterObserver(this);
238 }
239
214 VideoRtpSender::VideoRtpSender(VideoProviderInterface* provider) 240 VideoRtpSender::VideoRtpSender(VideoProviderInterface* provider)
215 : id_(rtc::CreateRandomUuid()), 241 : id_(rtc::CreateRandomUuid()),
216 stream_id_(rtc::CreateRandomUuid()), 242 stream_id_(rtc::CreateRandomUuid()),
217 provider_(provider) {} 243 provider_(provider) {}
218 244
219 VideoRtpSender::~VideoRtpSender() { 245 VideoRtpSender::~VideoRtpSender() {
220 Stop(); 246 Stop();
221 } 247 }
222 248
223 void VideoRtpSender::OnChanged() { 249 void VideoRtpSender::OnChanged() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 RTC_DCHECK(!stopped_ && can_send_track()); 337 RTC_DCHECK(!stopped_ && can_send_track());
312 const cricket::VideoOptions* options = nullptr; 338 const cricket::VideoOptions* options = nullptr;
313 VideoSourceInterface* source = track_->GetSource(); 339 VideoSourceInterface* source = track_->GetSource();
314 if (track_->enabled() && source) { 340 if (track_->enabled() && source) {
315 options = source->options(); 341 options = source->options();
316 } 342 }
317 provider_->SetVideoSend(ssrc_, track_->enabled(), options); 343 provider_->SetVideoSend(ssrc_, track_->enabled(), options);
318 } 344 }
319 345
320 } // namespace webrtc 346 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/rtpsender.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698