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 if (converted_frame.video_frame_buffer()->native_handle() && |
| 304 !_encoder->SupportsNativeHandle()) { |
304 // This module only supports software encoding. | 305 // This module only supports software encoding. |
305 // TODO(pbos): Offload conversion from the encoder thread. | 306 // TODO(pbos): Offload conversion from the encoder thread. |
306 converted_frame = converted_frame.ConvertNativeToI420Frame(); | 307 converted_frame = converted_frame.ConvertNativeToI420Frame(); |
307 RTC_CHECK(!converted_frame.IsZeroSize()) | 308 RTC_CHECK(!converted_frame.IsZeroSize()) |
308 << "Frame conversion failed, won't be able to encode frame."; | 309 << "Frame conversion failed, won't be able to encode frame."; |
309 } | 310 } |
310 int32_t ret = | 311 int32_t ret = |
311 _encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types); | 312 _encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types); |
312 if (ret < 0) { | 313 if (ret < 0) { |
313 LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret; | 314 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. | 379 // 10 kbps. |
379 int window_bps = std::max(threshold_bps / 10, 10000); | 380 int window_bps = std::max(threshold_bps / 10, 10000); |
380 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); | 381 _mediaOpt.SuspendBelowMinBitrate(threshold_bps, window_bps); |
381 } | 382 } |
382 | 383 |
383 bool VideoSender::VideoSuspended() const { | 384 bool VideoSender::VideoSuspended() const { |
384 return _mediaOpt.IsVideoSuspended(); | 385 return _mediaOpt.IsVideoSuspended(); |
385 } | 386 } |
386 } // namespace vcm | 387 } // namespace vcm |
387 } // namespace webrtc | 388 } // namespace webrtc |
OLD | NEW |