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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 } | 871 } |
872 PopulateCodecSpecific(&codec_specific, *pkt, stream_idx, | 872 PopulateCodecSpecific(&codec_specific, *pkt, stream_idx, |
873 input_image.timestamp()); | 873 input_image.timestamp()); |
874 break; | 874 break; |
875 } | 875 } |
876 } | 876 } |
877 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); | 877 encoded_images_[encoder_idx]._timeStamp = input_image.timestamp(); |
878 encoded_images_[encoder_idx].capture_time_ms_ = | 878 encoded_images_[encoder_idx].capture_time_ms_ = |
879 input_image.render_time_ms(); | 879 input_image.render_time_ms(); |
880 encoded_images_[encoder_idx].rotation_ = input_image.rotation(); | 880 encoded_images_[encoder_idx].rotation_ = input_image.rotation(); |
| 881 encoded_images_[encoder_idx].content_type_ = input_image.content_type(); |
881 | 882 |
882 int qp = -1; | 883 int qp = -1; |
883 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); | 884 vpx_codec_control(&encoders_[encoder_idx], VP8E_GET_LAST_QUANTIZER_64, &qp); |
884 temporal_layers_[stream_idx]->FrameEncoded( | 885 temporal_layers_[stream_idx]->FrameEncoded( |
885 encoded_images_[encoder_idx]._length, qp); | 886 encoded_images_[encoder_idx]._length, qp); |
886 if (send_stream_[stream_idx]) { | 887 if (send_stream_[stream_idx]) { |
887 if (encoded_images_[encoder_idx]._length > 0) { | 888 if (encoded_images_[encoder_idx]._length > 0) { |
888 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx, | 889 TRACE_COUNTER_ID1("webrtc", "EncodedFrameSize", encoder_idx, |
889 encoded_images_[encoder_idx]._length); | 890 encoded_images_[encoder_idx]._length); |
890 encoded_images_[encoder_idx]._encodedHeight = | 891 encoded_images_[encoder_idx]._encodedHeight = |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1118 } |
1118 | 1119 |
1119 libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y], | 1120 libyuv::I420Copy(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y], |
1120 img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U], | 1121 img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U], |
1121 img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V], | 1122 img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V], |
1122 buffer->MutableDataY(), buffer->StrideY(), | 1123 buffer->MutableDataY(), buffer->StrideY(), |
1123 buffer->MutableDataU(), buffer->StrideU(), | 1124 buffer->MutableDataU(), buffer->StrideU(), |
1124 buffer->MutableDataV(), buffer->StrideV(), | 1125 buffer->MutableDataV(), buffer->StrideV(), |
1125 img->d_w, img->d_h); | 1126 img->d_w, img->d_h); |
1126 | 1127 |
1127 VideoFrame decoded_image(buffer, timestamp, 0, kVideoRotation_0); | 1128 VideoFrame decoded_image(buffer, timestamp, 0, kVideoRotation_0, |
| 1129 VideoContentType::kDefault); |
1128 decoded_image.set_ntp_time_ms(ntp_time_ms); | 1130 decoded_image.set_ntp_time_ms(ntp_time_ms); |
1129 decode_complete_callback_->Decoded(decoded_image, rtc::Optional<int32_t>(), | 1131 decode_complete_callback_->Decoded(decoded_image, rtc::Optional<int32_t>(), |
1130 rtc::Optional<uint8_t>(qp)); | 1132 rtc::Optional<uint8_t>(qp)); |
1131 | 1133 |
1132 return WEBRTC_VIDEO_CODEC_OK; | 1134 return WEBRTC_VIDEO_CODEC_OK; |
1133 } | 1135 } |
1134 | 1136 |
1135 int VP8DecoderImpl::RegisterDecodeCompleteCallback( | 1137 int VP8DecoderImpl::RegisterDecodeCompleteCallback( |
1136 DecodedImageCallback* callback) { | 1138 DecodedImageCallback* callback) { |
1137 decode_complete_callback_ = callback; | 1139 decode_complete_callback_ = callback; |
(...skipping 11 matching lines...) Expand all Loading... |
1149 buffer_pool_.Release(); | 1151 buffer_pool_.Release(); |
1150 inited_ = false; | 1152 inited_ = false; |
1151 return WEBRTC_VIDEO_CODEC_OK; | 1153 return WEBRTC_VIDEO_CODEC_OK; |
1152 } | 1154 } |
1153 | 1155 |
1154 const char* VP8DecoderImpl::ImplementationName() const { | 1156 const char* VP8DecoderImpl::ImplementationName() const { |
1155 return "libvpx"; | 1157 return "libvpx"; |
1156 } | 1158 } |
1157 | 1159 |
1158 } // namespace webrtc | 1160 } // namespace webrtc |
OLD | NEW |