OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 22 matching lines...) Expand all Loading... |
33 void VideoBroadcaster::RemoveSink( | 33 void VideoBroadcaster::RemoveSink( |
34 VideoSinkInterface<cricket::VideoFrame>* sink) { | 34 VideoSinkInterface<cricket::VideoFrame>* sink) { |
35 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 35 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
36 RTC_DCHECK(sink != nullptr); | 36 RTC_DCHECK(sink != nullptr); |
37 rtc::CritScope cs(&sinks_and_wants_lock_); | 37 rtc::CritScope cs(&sinks_and_wants_lock_); |
38 VideoSourceBase::RemoveSink(sink); | 38 VideoSourceBase::RemoveSink(sink); |
39 UpdateWants(); | 39 UpdateWants(); |
40 } | 40 } |
41 | 41 |
42 bool VideoBroadcaster::frame_wanted() const { | 42 bool VideoBroadcaster::frame_wanted() const { |
43 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | |
44 rtc::CritScope cs(&sinks_and_wants_lock_); | 43 rtc::CritScope cs(&sinks_and_wants_lock_); |
45 return !sink_pairs().empty(); | 44 return !sink_pairs().empty(); |
46 } | 45 } |
47 | 46 |
48 VideoSinkWants VideoBroadcaster::wants() const { | 47 VideoSinkWants VideoBroadcaster::wants() const { |
49 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 48 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
50 rtc::CritScope cs(&sinks_and_wants_lock_); | 49 rtc::CritScope cs(&sinks_and_wants_lock_); |
51 return current_wants_; | 50 return current_wants_; |
52 } | 51 } |
53 | 52 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 103 } |
105 black_frame_.reset(new cricket::WebRtcVideoFrame( | 104 black_frame_.reset(new cricket::WebRtcVideoFrame( |
106 new rtc::RefCountedObject<webrtc::I420Buffer>(frame.width(), | 105 new rtc::RefCountedObject<webrtc::I420Buffer>(frame.width(), |
107 frame.height()), | 106 frame.height()), |
108 frame.rotation(), frame.timestamp_us())); | 107 frame.rotation(), frame.timestamp_us())); |
109 black_frame_->SetToBlack(); | 108 black_frame_->SetToBlack(); |
110 return *black_frame_; | 109 return *black_frame_; |
111 } | 110 } |
112 | 111 |
113 } // namespace rtc | 112 } // namespace rtc |
OLD | NEW |