OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 image->qp_ = qp; | 1133 image->qp_ = qp; |
1134 } | 1134 } |
1135 } | 1135 } |
1136 } else if (codecType_ == kVideoCodecH264) { | 1136 } else if (codecType_ == kVideoCodecH264) { |
1137 if (scale_) { | 1137 if (scale_) { |
1138 h264_bitstream_parser_.ParseBitstream(payload, payload_size); | 1138 h264_bitstream_parser_.ParseBitstream(payload, payload_size); |
1139 int qp; | 1139 int qp; |
1140 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) { | 1140 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) { |
1141 current_acc_qp_ += qp; | 1141 current_acc_qp_ += qp; |
1142 quality_scaler_.ReportQP(qp); | 1142 quality_scaler_.ReportQP(qp); |
| 1143 image->qp_ = qp; |
1143 } | 1144 } |
1144 } | 1145 } |
1145 // For H.264 search for start codes. | 1146 // For H.264 search for start codes. |
1146 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; | 1147 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; |
1147 int32_t scPositionsLength = 0; | 1148 int32_t scPositionsLength = 0; |
1148 int32_t scPosition = 0; | 1149 int32_t scPosition = 0; |
1149 while (scPositionsLength < MAX_NALUS_PERFRAME) { | 1150 while (scPositionsLength < MAX_NALUS_PERFRAME) { |
1150 int32_t naluPosition = NextNaluPosition( | 1151 int32_t naluPosition = NextNaluPosition( |
1151 payload + scPosition, payload_size - scPosition); | 1152 payload + scPosition, payload_size - scPosition); |
1152 if (naluPosition < 0) { | 1153 if (naluPosition < 0) { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 return supported_codecs_; | 1371 return supported_codecs_; |
1371 } | 1372 } |
1372 | 1373 |
1373 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1374 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1374 webrtc::VideoEncoder* encoder) { | 1375 webrtc::VideoEncoder* encoder) { |
1375 ALOGD << "Destroy video encoder."; | 1376 ALOGD << "Destroy video encoder."; |
1376 delete encoder; | 1377 delete encoder; |
1377 } | 1378 } |
1378 | 1379 |
1379 } // namespace webrtc_jni | 1380 } // namespace webrtc_jni |
OLD | NEW |