Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.mm

Issue 2574123002: Revert of Delete VideoFrame default constructor, and IsZeroSize method. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/video_coding/generic_encoder.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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());
383 if (!callback_ || !compression_session_) { 384 if (!callback_ || !compression_session_) {
384 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; 385 return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
385 } 386 }
386 #if defined(WEBRTC_IOS) 387 #if defined(WEBRTC_IOS)
387 if (!RTCIsUIApplicationActive()) { 388 if (!RTCIsUIApplicationActive()) {
388 // Ignore all encode requests when app isn't active. In this state, the 389 // Ignore all encode requests when app isn't active. In this state, the
389 // hardware encoder has been invalidated by the OS. 390 // hardware encoder has been invalidated by the OS.
390 return WEBRTC_VIDEO_CODEC_OK; 391 return WEBRTC_VIDEO_CODEC_OK;
391 } 392 }
392 #endif 393 #endif
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 } 730 }
730 bitrate_adjuster_.Update(frame._size); 731 bitrate_adjuster_.Update(frame._size);
731 } 732 }
732 733
733 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() 734 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings()
734 const { 735 const {
735 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, 736 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold,
736 internal::kHighH264QpThreshold); 737 internal::kHighH264QpThreshold);
737 } 738 }
738 } // namespace webrtc 739 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/generic_encoder.cc ('k') | webrtc/test/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698