OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 } | 293 } |
294 _mediaOpt.UpdateContentData(contentMetrics); | 294 _mediaOpt.UpdateContentData(contentMetrics); |
295 // TODO(pbos): Make sure setting send codec is synchronized with video | 295 // TODO(pbos): Make sure setting send codec is synchronized with video |
296 // processing so frame size always matches. | 296 // processing so frame size always matches. |
297 if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(), | 297 if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(), |
298 videoFrame.height())) { | 298 videoFrame.height())) { |
299 LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping."; | 299 LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping."; |
300 return VCM_PARAMETER_ERROR; | 300 return VCM_PARAMETER_ERROR; |
301 } | 301 } |
302 VideoFrame converted_frame = videoFrame; | 302 VideoFrame converted_frame = videoFrame; |
303 if (converted_frame.native_handle() && !_encoder->SupportsNativeHandle()) { | 303 // TODO(nisse): Is it allowed to have video_frame_buffer() return a |
perkj_webrtc
2016/04/13 05:44:08
I don't think video_frame_buffer() ever should be
nisse-webrtc
2016/04/13 07:28:50
Good. Should I add some RTC_CHECKS to that effect
| |
304 // nullptr here? | |
305 if (converted_frame.video_frame_buffer()->native_handle() && | |
306 !_encoder->SupportsNativeHandle()) { | |
304 // This module only supports software encoding. | 307 // This module only supports software encoding. |
305 // TODO(pbos): Offload conversion from the encoder thread. | 308 // TODO(pbos): Offload conversion from the encoder thread. |
306 converted_frame = converted_frame.ConvertNativeToI420Frame(); | 309 converted_frame = converted_frame.ConvertNativeToI420Frame(); |
307 RTC_CHECK(!converted_frame.IsZeroSize()) | 310 RTC_CHECK(!converted_frame.IsZeroSize()) |
308 << "Frame conversion failed, won't be able to encode frame."; | 311 << "Frame conversion failed, won't be able to encode frame."; |
309 } | 312 } |
310 int32_t ret = | 313 int32_t ret = |
311 _encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types); | 314 _encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types); |
312 if (ret < 0) { | 315 if (ret < 0) { |
313 LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret; | 316 LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 // 10 kbps. | 381 // 10 kbps. |
379 int window_bps = std::max(threshold_bps / 10, 10000); | 382 int window_bps = std::max(threshold_bps / 10, 10000); |
380 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 383 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
381 } | 384 } |
382 | 385 |
383 bool VideoSender::VideoSuspended() const { | 386 bool VideoSender::VideoSuspended() const { |
384 return _mediaOpt.IsVideoSuspended(); | 387 return _mediaOpt.IsVideoSuspended(); |
385 } | 388 } |
386 } // namespace vcm | 389 } // namespace vcm |
387 } // namespace webrtc | 390 } // namespace webrtc |
OLD | NEW |