| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 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 17 matching lines...) Expand all Loading... |
| 28 video_source_->UnregisterObserver(this); | 28 video_source_->UnregisterObserver(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 std::string VideoTrack::kind() const { | 31 std::string VideoTrack::kind() const { |
| 32 return kVideoKind; | 32 return kVideoKind; |
| 33 } | 33 } |
| 34 | 34 |
| 35 // AddOrUpdateSink and RemoveSink should be called on the worker | 35 // AddOrUpdateSink and RemoveSink should be called on the worker |
| 36 // thread. | 36 // thread. |
| 37 void VideoTrack::AddOrUpdateSink( | 37 void VideoTrack::AddOrUpdateSink( |
| 38 rtc::VideoSinkInterface<cricket::VideoFrame>* sink, | 38 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink, |
| 39 const rtc::VideoSinkWants& wants) { | 39 const rtc::VideoSinkWants& wants) { |
| 40 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 40 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 41 VideoSourceBase::AddOrUpdateSink(sink, wants); | 41 VideoSourceBase::AddOrUpdateSink(sink, wants); |
| 42 rtc::VideoSinkWants modified_wants = wants; | 42 rtc::VideoSinkWants modified_wants = wants; |
| 43 modified_wants.black_frames = !enabled(); | 43 modified_wants.black_frames = !enabled(); |
| 44 video_source_->AddOrUpdateSink(sink, modified_wants); | 44 video_source_->AddOrUpdateSink(sink, modified_wants); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void VideoTrack::RemoveSink( | 47 void VideoTrack::RemoveSink( |
| 48 rtc::VideoSinkInterface<cricket::VideoFrame>* sink) { | 48 rtc::VideoSinkInterface<webrtc::VideoFrame>* sink) { |
| 49 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 49 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 50 VideoSourceBase::RemoveSink(sink); | 50 VideoSourceBase::RemoveSink(sink); |
| 51 video_source_->RemoveSink(sink); | 51 video_source_->RemoveSink(sink); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool VideoTrack::set_enabled(bool enable) { | 54 bool VideoTrack::set_enabled(bool enable) { |
| 55 RTC_DCHECK(signaling_thread_checker_.CalledOnValidThread()); | 55 RTC_DCHECK(signaling_thread_checker_.CalledOnValidThread()); |
| 56 for (auto& sink_pair : sink_pairs()) { | 56 for (auto& sink_pair : sink_pairs()) { |
| 57 rtc::VideoSinkWants modified_wants = sink_pair.wants; | 57 rtc::VideoSinkWants modified_wants = sink_pair.wants; |
| 58 modified_wants.black_frames = !enable; | 58 modified_wants.black_frames = !enable; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 74 | 74 |
| 75 rtc::scoped_refptr<VideoTrack> VideoTrack::Create( | 75 rtc::scoped_refptr<VideoTrack> VideoTrack::Create( |
| 76 const std::string& id, | 76 const std::string& id, |
| 77 VideoTrackSourceInterface* source) { | 77 VideoTrackSourceInterface* source) { |
| 78 rtc::RefCountedObject<VideoTrack>* track = | 78 rtc::RefCountedObject<VideoTrack>* track = |
| 79 new rtc::RefCountedObject<VideoTrack>(id, source); | 79 new rtc::RefCountedObject<VideoTrack>(id, source); |
| 80 return track; | 80 return track; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace webrtc | 83 } // namespace webrtc |
| OLD | NEW |