| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 return ResetCompressionSession(); | 373 return ResetCompressionSession(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 int H264VideoToolboxEncoder::Encode( | 376 int H264VideoToolboxEncoder::Encode( |
| 377 const VideoFrame& frame, | 377 const VideoFrame& frame, |
| 378 const CodecSpecificInfo* codec_specific_info, | 378 const CodecSpecificInfo* codec_specific_info, |
| 379 const std::vector<FrameType>* frame_types) { | 379 const std::vector<FrameType>* frame_types) { |
| 380 // |input_frame| size should always match codec settings. | 380 // |input_frame| size should always match codec settings. |
| 381 RTC_DCHECK_EQ(frame.width(), width_); | 381 RTC_DCHECK_EQ(frame.width(), width_); |
| 382 RTC_DCHECK_EQ(frame.height(), height_); | 382 RTC_DCHECK_EQ(frame.height(), height_); |
| 383 RTC_DCHECK(!frame.IsZeroSize()); | |
| 384 if (!callback_ || !compression_session_) { | 383 if (!callback_ || !compression_session_) { |
| 385 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 384 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
| 386 } | 385 } |
| 387 #if defined(WEBRTC_IOS) | 386 #if defined(WEBRTC_IOS) |
| 388 if (!RTCIsUIApplicationActive()) { | 387 if (!RTCIsUIApplicationActive()) { |
| 389 // Ignore all encode requests when app isn't active. In this state, the | 388 // Ignore all encode requests when app isn't active. In this state, the |
| 390 // hardware encoder has been invalidated by the OS. | 389 // hardware encoder has been invalidated by the OS. |
| 391 return WEBRTC_VIDEO_CODEC_OK; | 390 return WEBRTC_VIDEO_CODEC_OK; |
| 392 } | 391 } |
| 393 #endif | 392 #endif |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 729 } |
| 731 bitrate_adjuster_.Update(frame._size); | 730 bitrate_adjuster_.Update(frame._size); |
| 732 } | 731 } |
| 733 | 732 |
| 734 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() | 733 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() |
| 735 const { | 734 const { |
| 736 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, | 735 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, |
| 737 internal::kHighH264QpThreshold); | 736 internal::kHighH264QpThreshold); |
| 738 } | 737 } |
| 739 } // namespace webrtc | 738 } // namespace webrtc |
| OLD | NEW |