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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 // TODO(tkchin): Try setting payload size via | 249 // TODO(tkchin): Try setting payload size via |
250 // kVTCompressionPropertyKey_MaxH264SliceBytes. | 250 // kVTCompressionPropertyKey_MaxH264SliceBytes. |
251 | 251 |
252 return ResetCompressionSession(); | 252 return ResetCompressionSession(); |
253 } | 253 } |
254 | 254 |
255 int H264VideoToolboxEncoder::Encode( | 255 int H264VideoToolboxEncoder::Encode( |
256 const VideoFrame& frame, | 256 const VideoFrame& frame, |
257 const CodecSpecificInfo* codec_specific_info, | 257 const CodecSpecificInfo* codec_specific_info, |
258 const std::vector<FrameType>* frame_types) { | 258 const std::vector<FrameType>* frame_types) { |
259 RTC_DCHECK(!frame.IsZeroSize()); | |
stefan-webrtc
2016/09/05 14:45:25
Could you comment on why this isn't necessary?
| |
260 if (!callback_ || !compression_session_) { | 259 if (!callback_ || !compression_session_) { |
261 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 260 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
262 } | 261 } |
263 #if defined(WEBRTC_IOS) | 262 #if defined(WEBRTC_IOS) |
264 if (!RTCIsUIApplicationActive()) { | 263 if (!RTCIsUIApplicationActive()) { |
265 // Ignore all encode requests when app isn't active. In this state, the | 264 // Ignore all encode requests when app isn't active. In this state, the |
266 // hardware encoder has been invalidated by the OS. | 265 // hardware encoder has been invalidated by the OS. |
267 return WEBRTC_VIDEO_CODEC_OK; | 266 return WEBRTC_VIDEO_CODEC_OK; |
268 } | 267 } |
269 #endif | 268 #endif |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
627 if (result != 0) { | 626 if (result != 0) { |
628 LOG(LS_ERROR) << "Encode callback failed: " << result; | 627 LOG(LS_ERROR) << "Encode callback failed: " << result; |
629 return; | 628 return; |
630 } | 629 } |
631 bitrate_adjuster_.Update(frame._size); | 630 bitrate_adjuster_.Update(frame._size); |
632 } | 631 } |
633 | 632 |
634 } // namespace webrtc | 633 } // namespace webrtc |
635 | 634 |
636 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) | 635 #endif // defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) |
OLD | NEW |