Chromium Code Reviews| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 frame.buffer = [NSData dataWithBytesNoCopy:buffer->data() length:buffer->size( ) freeWhenDone:NO]; | 650 frame.buffer = [NSData dataWithBytesNoCopy:buffer->data() length:buffer->size( ) freeWhenDone:NO]; |
| 651 frame.encodedWidth = width; | 651 frame.encodedWidth = width; |
| 652 frame.encodedHeight = height; | 652 frame.encodedHeight = height; |
| 653 frame.completeFrame = YES; | 653 frame.completeFrame = YES; |
| 654 frame.frameType = isKeyframe ? RTCFrameTypeVideoFrameKey : RTCFrameTypeVideoFr ameDelta; | 654 frame.frameType = isKeyframe ? RTCFrameTypeVideoFrameKey : RTCFrameTypeVideoFr ameDelta; |
| 655 frame.captureTimeMs = renderTimeMs; | 655 frame.captureTimeMs = renderTimeMs; |
| 656 frame.timeStamp = timestamp; | 656 frame.timeStamp = timestamp; |
| 657 frame.rotation = rotation; | 657 frame.rotation = rotation; |
| 658 frame.contentType = (_mode == RTCVideoCodecModeScreensharing) ? RTCVideoConten tTypeScreenshare : | 658 frame.contentType = (_mode == RTCVideoCodecModeScreensharing) ? RTCVideoConten tTypeScreenshare : |
| 659 RTCVideoConten tTypeUnspecified; | 659 RTCVideoConten tTypeUnspecified; |
| 660 frame.isTimingFrame = NO; | 660 frame.flags = 0; |
|
kthelgason
2017/08/14 11:32:36
why is this not webrtc::TimingFrameFlags::kInvalid
sprang_webrtc
2017/08/14 11:56:44
You're right, it should be kInvalid.
| |
| 661 | 661 |
| 662 int qp; | 662 int qp; |
| 663 _h264BitstreamParser.ParseBitstream(buffer->data(), buffer->size()); | 663 _h264BitstreamParser.ParseBitstream(buffer->data(), buffer->size()); |
| 664 _h264BitstreamParser.GetLastSliceQp(&qp); | 664 _h264BitstreamParser.GetLastSliceQp(&qp); |
| 665 frame.qp = @(qp); | 665 frame.qp = @(qp); |
| 666 | 666 |
| 667 BOOL res = _callback(frame, codecSpecificInfo, header); | 667 BOOL res = _callback(frame, codecSpecificInfo, header); |
| 668 if (!res) { | 668 if (!res) { |
| 669 LOG(LS_ERROR) << "Encode callback failed"; | 669 LOG(LS_ERROR) << "Encode callback failed"; |
| 670 return; | 670 return; |
| 671 } | 671 } |
| 672 _bitrateAdjuster->Update(frame.buffer.length); | 672 _bitrateAdjuster->Update(frame.buffer.length); |
| 673 } | 673 } |
| 674 | 674 |
| 675 - (RTCVideoEncoderQpThresholds *)scalingSettings { | 675 - (RTCVideoEncoderQpThresholds *)scalingSettings { |
| 676 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold | 676 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold |
| 677 high:kHighH264QpT hreshold]; | 677 high:kHighH264QpT hreshold]; |
| 678 } | 678 } |
| 679 | 679 |
| 680 @end | 680 @end |
| OLD | NEW |