OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // Sources producing native frames must handle apply_rotation | 208 // Sources producing native frames must handle apply_rotation |
209 // themselves. But even if they do, we may occasionally end up | 209 // themselves. But even if they do, we may occasionally end up |
210 // in this case, for frames in flight at the time | 210 // in this case, for frames in flight at the time |
211 // applied_rotation is set to true. In that case, we just drop | 211 // applied_rotation is set to true. In that case, we just drop |
212 // the frame. | 212 // the frame. |
213 LOG(LS_WARNING) << "Native frame requiring rotation. Discarding."; | 213 LOG(LS_WARNING) << "Native frame requiring rotation. Discarding."; |
214 return; | 214 return; |
215 } | 215 } |
216 broadcaster_.OnFrame(webrtc::VideoFrame( | 216 broadcaster_.OnFrame(webrtc::VideoFrame( |
217 webrtc::I420Buffer::Rotate(*buffer, frame.rotation()), | 217 webrtc::I420Buffer::Rotate(*buffer, frame.rotation()), |
218 webrtc::kVideoRotation_0, frame.timestamp_us())); | 218 webrtc::kVideoRotation_0, frame.content_type(), frame.timestamp_us())); |
219 } else { | 219 } else { |
220 broadcaster_.OnFrame(frame); | 220 broadcaster_.OnFrame(frame); |
221 } | 221 } |
222 UpdateInputSize(orig_width, orig_height); | 222 UpdateInputSize(orig_width, orig_height); |
223 } | 223 } |
224 | 224 |
225 void VideoCapturer::SetCaptureState(CaptureState state) { | 225 void VideoCapturer::SetCaptureState(CaptureState state) { |
226 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 226 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
227 if (state == capture_state_) { | 227 if (state == capture_state_) { |
228 // Don't trigger a state changed callback if the state hasn't changed. | 228 // Don't trigger a state changed callback if the state hasn't changed. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 void VideoCapturer::UpdateInputSize(int width, int height) { | 363 void VideoCapturer::UpdateInputSize(int width, int height) { |
364 // Update stats protected from fetches from different thread. | 364 // Update stats protected from fetches from different thread. |
365 rtc::CritScope cs(&frame_stats_crit_); | 365 rtc::CritScope cs(&frame_stats_crit_); |
366 | 366 |
367 input_size_valid_ = true; | 367 input_size_valid_ = true; |
368 input_width_ = width; | 368 input_width_ = width; |
369 input_height_ = height; | 369 input_height_ = height; |
370 } | 370 } |
371 | 371 |
372 } // namespace cricket | 372 } // namespace cricket |
OLD | NEW |