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

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

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Implement Holmer@ comments Created 3 years, 6 months 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/sdk/android/src/jni/androidmediaencoder_jni.cc ('k') | webrtc/test/constants.h » ('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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
715 } 715 }
716 webrtc::EncodedImage frame(buffer->data(), buffer->size(), buffer->size()); 716 webrtc::EncodedImage frame(buffer->data(), buffer->size(), buffer->size());
717 frame._encodedWidth = width; 717 frame._encodedWidth = width;
718 frame._encodedHeight = height; 718 frame._encodedHeight = height;
719 frame._completeFrame = true; 719 frame._completeFrame = true;
720 frame._frameType = 720 frame._frameType =
721 is_keyframe ? webrtc::kVideoFrameKey : webrtc::kVideoFrameDelta; 721 is_keyframe ? webrtc::kVideoFrameKey : webrtc::kVideoFrameDelta;
722 frame.capture_time_ms_ = render_time_ms; 722 frame.capture_time_ms_ = render_time_ms;
723 frame._timeStamp = timestamp; 723 frame._timeStamp = timestamp;
724 frame.rotation_ = rotation; 724 frame.rotation_ = rotation;
725
726 frame.content_type_ = 725 frame.content_type_ =
727 (mode_ == kScreensharing) ? VideoContentType::SCREENSHARE : VideoContentTy pe::UNSPECIFIED; 726 (mode_ == kScreensharing) ? VideoContentType::SCREENSHARE : VideoContentTy pe::UNSPECIFIED;
727 frame.timing_.is_timing_frame = false;
728 728
729 h264_bitstream_parser_.ParseBitstream(buffer->data(), buffer->size()); 729 h264_bitstream_parser_.ParseBitstream(buffer->data(), buffer->size());
730 h264_bitstream_parser_.GetLastSliceQp(&frame.qp_); 730 h264_bitstream_parser_.GetLastSliceQp(&frame.qp_);
731 731
732 EncodedImageCallback::Result res = 732 EncodedImageCallback::Result res =
733 callback_->OnEncodedImage(frame, &codec_specific_info, header.get()); 733 callback_->OnEncodedImage(frame, &codec_specific_info, header.get());
734 if (res.error != EncodedImageCallback::Result::OK) { 734 if (res.error != EncodedImageCallback::Result::OK) {
735 LOG(LS_ERROR) << "Encode callback failed: " << res.error; 735 LOG(LS_ERROR) << "Encode callback failed: " << res.error;
736 return; 736 return;
737 } 737 }
738 bitrate_adjuster_.Update(frame._length); 738 bitrate_adjuster_.Update(frame._length);
739 } 739 }
740 740
741 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() 741 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings()
742 const { 742 const {
743 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, 743 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold,
744 internal::kHighH264QpThreshold); 744 internal::kHighH264QpThreshold);
745 } 745 }
746 } // namespace webrtc 746 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc ('k') | webrtc/test/constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698