OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 encoded_images_[encoder_idx]._length); | 1011 encoded_images_[encoder_idx]._length); |
1012 encoded_images_[encoder_idx]._encodedHeight = | 1012 encoded_images_[encoder_idx]._encodedHeight = |
1013 codec_.simulcastStream[stream_idx].height; | 1013 codec_.simulcastStream[stream_idx].height; |
1014 encoded_images_[encoder_idx]._encodedWidth = | 1014 encoded_images_[encoder_idx]._encodedWidth = |
1015 codec_.simulcastStream[stream_idx].width; | 1015 codec_.simulcastStream[stream_idx].width; |
1016 encoded_complete_callback_->Encoded(encoded_images_[encoder_idx], | 1016 encoded_complete_callback_->Encoded(encoded_images_[encoder_idx], |
1017 &codec_specific, &frag_info); | 1017 &codec_specific, &frag_info); |
1018 } else if (codec_.mode == kScreensharing) { | 1018 } else if (codec_.mode == kScreensharing) { |
1019 result = WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT; | 1019 result = WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT; |
1020 } | 1020 } |
1021 } else { | |
1022 // Required in case padding is applied to dropped frames. | |
1023 encoded_images_[encoder_idx]._length = 0; | |
1024 encoded_images_[encoder_idx]._frameType = kSkipFrame; | |
1025 codec_specific.codecType = kVideoCodecVP8; | |
1026 CodecSpecificInfoVP8* vp8Info = &(codec_specific.codecSpecific.VP8); | |
1027 vp8Info->pictureId = picture_id_[stream_idx]; | |
1028 vp8Info->simulcastIdx = stream_idx; | |
1029 vp8Info->keyIdx = kNoKeyIdx; | |
1030 encoded_complete_callback_->Encoded(encoded_images_[encoder_idx], | |
1031 &codec_specific, NULL); | |
1032 } | 1021 } |
1033 } | 1022 } |
1034 if (encoders_.size() == 1 && send_stream_[0]) { | 1023 if (encoders_.size() == 1 && send_stream_[0]) { |
1035 if (encoded_images_[0]._length > 0) { | 1024 if (encoded_images_[0]._length > 0) { |
1036 int qp; | 1025 int qp; |
1037 vpx_codec_control(&encoders_[0], VP8E_GET_LAST_QUANTIZER_64, &qp); | 1026 vpx_codec_control(&encoders_[0], VP8E_GET_LAST_QUANTIZER_64, &qp); |
1038 quality_scaler_.ReportQP(qp); | 1027 quality_scaler_.ReportQP(qp); |
1039 } else { | 1028 } else { |
1040 quality_scaler_.ReportDroppedFrame(); | 1029 quality_scaler_.ReportDroppedFrame(); |
1041 } | 1030 } |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 return -1; | 1387 return -1; |
1399 } | 1388 } |
1400 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) | 1389 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) |
1401 != VPX_CODEC_OK) { | 1390 != VPX_CODEC_OK) { |
1402 return -1; | 1391 return -1; |
1403 } | 1392 } |
1404 return 0; | 1393 return 0; |
1405 } | 1394 } |
1406 | 1395 |
1407 } // namespace webrtc | 1396 } // namespace webrtc |
OLD | NEW |