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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 return !sink_pairs().empty(); | 44 return !sink_pairs().empty(); |
45 } | 45 } |
46 | 46 |
47 VideoSinkWants VideoBroadcaster::wants() const { | 47 VideoSinkWants VideoBroadcaster::wants() const { |
48 rtc::CritScope cs(&sinks_and_wants_lock_); | 48 rtc::CritScope cs(&sinks_and_wants_lock_); |
49 return current_wants_; | 49 return current_wants_; |
50 } | 50 } |
51 | 51 |
52 void VideoBroadcaster::OnFrame(const cricket::VideoFrame& frame) { | 52 void VideoBroadcaster::OnFrame(const cricket::VideoFrame& frame) { |
53 rtc::CritScope cs(&sinks_and_wants_lock_); | 53 rtc::CritScope cs(&sinks_and_wants_lock_); |
54 if (sink_pairs().empty()) | |
55 LOG(LS_INFO) << "Dropping frame because there are no sink pairs in video " | |
perkj_webrtc
2016/09/26 06:46:34
This may soon start spitting out logs in chrome th
sakal
2016/09/26 11:23:59
I changed it to log VideoBroadcaster creation and
magjed_webrtc
2016/09/27 15:06:11
It's probably good to have logs for VideoBroadcast
| |
56 "broadcaster."; | |
54 for (auto& sink_pair : sink_pairs()) { | 57 for (auto& sink_pair : sink_pairs()) { |
55 if (sink_pair.wants.rotation_applied && | 58 if (sink_pair.wants.rotation_applied && |
56 frame.rotation() != webrtc::kVideoRotation_0) { | 59 frame.rotation() != webrtc::kVideoRotation_0) { |
57 // Calls to OnFrame are not synchronized with changes to the sink wants. | 60 // Calls to OnFrame are not synchronized with changes to the sink wants. |
58 // When rotation_applied is set to true, one or a few frames may get here | 61 // When rotation_applied is set to true, one or a few frames may get here |
59 // with rotation still pending. Protect sinks that don't expect any | 62 // with rotation still pending. Protect sinks that don't expect any |
60 // pending rotation. | 63 // pending rotation. |
61 LOG(LS_VERBOSE) << "Discarding frame with unexpected rotation."; | 64 LOG(LS_VERBOSE) << "Discarding frame with unexpected rotation."; |
62 continue; | 65 continue; |
63 } | 66 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 rtc::scoped_refptr<webrtc::I420Buffer> buffer = | 113 rtc::scoped_refptr<webrtc::I420Buffer> buffer = |
111 new RefCountedObject<webrtc::I420Buffer>(width, height); | 114 new RefCountedObject<webrtc::I420Buffer>(width, height); |
112 buffer->SetToBlack(); | 115 buffer->SetToBlack(); |
113 black_frame_buffer_ = buffer; | 116 black_frame_buffer_ = buffer; |
114 } | 117 } |
115 | 118 |
116 return black_frame_buffer_; | 119 return black_frame_buffer_; |
117 } | 120 } |
118 | 121 |
119 } // namespace rtc | 122 } // namespace rtc |
OLD | NEW |