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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 PopulateCodecSpecific(&codec_specific, *pkt, stream_idx, | 965 PopulateCodecSpecific(&codec_specific, *pkt, stream_idx, |
966 input_image.timestamp(), | 966 input_image.timestamp(), |
967 only_predicting_from_key_frame); | 967 only_predicting_from_key_frame); |
968 break; | 968 break; |
969 } | 969 } |
970 } | 970 } |
971 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); | 971 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); |
972 encoded_images_[encoder_idx].capture_time_ms_ = | 972 encoded_images_[encoder_idx].capture_time_ms_ = |
973 input_image.render_time_ms(); | 973 input_image.render_time_ms(); |
974 encoded_images_[encoder_idx].rotation_ = input_image.rotation(); | 974 encoded_images_[encoder_idx].rotation_ = input_image.rotation(); |
| 975 encoded_images_[encoder_idx].content_type_ = input_image.content_type(); |
975 | 976 |
976 int qp = -1; | 977 int qp = -1; |
977 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); | 978 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); |
978 temporal_layers_[stream_idx]->FrameEncoded( | 979 temporal_layers_[stream_idx]->FrameEncoded( |
979 encoded_images_[encoder_idx]._length, | 980 encoded_images_[encoder_idx]._length, |
980 encoded_images_[encoder_idx]._timeStamp, qp); | 981 encoded_images_[encoder_idx]._timeStamp, qp); |
981 if (send_stream_[stream_idx]) { | 982 if (send_stream_[stream_idx]) { |
982 if (encoded_images_[encoder_idx]._length > 0) { | 983 if (encoded_images_[encoder_idx]._length > 0) { |
983 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx, | 984 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx, |
984 encoded_images_[encoder_idx]._length); | 985 encoded_images_[encoder_idx]._length); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 } | 1273 } |
1273 | 1274 |
1274 libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y], | 1275 libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y], |
1275 img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U], | 1276 img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U], |
1276 img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V], | 1277 img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V], |
1277 buffer->MutableDataY(), buffer->StrideY(), | 1278 buffer->MutableDataY(), buffer->StrideY(), |
1278 buffer->MutableDataU(), buffer->StrideU(), | 1279 buffer->MutableDataU(), buffer->StrideU(), |
1279 buffer->MutableDataV(), buffer->StrideV(), | 1280 buffer->MutableDataV(), buffer->StrideV(), |
1280 img->d_w, img->d_h); | 1281 img->d_w, img->d_h); |
1281 | 1282 |
1282 VideoFrame decoded_image(buffer, timestamp, 0, kVideoRotation_0); | 1283 VideoFrame decoded_image(buffer, timestamp, 0, kVideoRotation_0, |
| 1284 kVideoContent_Default); |
1283 decoded_image.set_ntp_time_ms(ntp_time_ms); | 1285 decoded_image.set_ntp_time_ms(ntp_time_ms); |
1284 decode_complete_callback_->Decoded(decoded_image, rtc::Optional<int32_t>(), | 1286 decode_complete_callback_->Decoded(decoded_image, rtc::Optional<int32_t>(), |
1285 rtc::Optional<uint8_t>(qp)); | 1287 rtc::Optional<uint8_t>(qp)); |
1286 | 1288 |
1287 // Remember image format for later | 1289 // Remember image format for later |
1288 image_format_ = img->fmt; | 1290 image_format_ = img->fmt; |
1289 return WEBRTC_VIDEO_CODEC_OK; | 1291 return WEBRTC_VIDEO_CODEC_OK; |
1290 } | 1292 } |
1291 | 1293 |
1292 int VP8DecoderImpl::RegisterDecodeCompleteCallback( | 1294 int VP8DecoderImpl::RegisterDecodeCompleteCallback( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 return -1; | 1327 return -1; |
1326 } | 1328 } |
1327 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != | 1329 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) != |
1328 VPX_CODEC_OK) { | 1330 VPX_CODEC_OK) { |
1329 return -1; | 1331 return -1; |
1330 } | 1332 } |
1331 return 0; | 1333 return 0; |
1332 } | 1334 } |
1333 | 1335 |
1334 } // namespace webrtc | 1336 } // namespace webrtc |
OLD | NEW |