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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (!decode_time_ms) { | 80 if (!decode_time_ms) { |
81 decode_time_ms = | 81 decode_time_ms = |
82 rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs); | 82 rtc::Optional<int32_t>(now_ms - frameInfo->decodeStartTimeMs); |
83 } | 83 } |
84 _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms, | 84 _timing->StopDecodeTimer(decodedImage.timestamp(), *decode_time_ms, now_ms, |
85 frameInfo->renderTimeMs); | 85 frameInfo->renderTimeMs); |
86 | 86 |
87 decodedImage.set_timestamp_us( | 87 decodedImage.set_timestamp_us( |
88 frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec); | 88 frameInfo->renderTimeMs * rtc::kNumMicrosecsPerMillisec); |
89 decodedImage.set_rotation(frameInfo->rotation); | 89 decodedImage.set_rotation(frameInfo->rotation); |
| 90 decodedImage.set_content_type(frameInfo->content_type); |
90 _receiveCallback->FrameToRender(decodedImage, qp); | 91 _receiveCallback->FrameToRender(decodedImage, qp); |
91 } | 92 } |
92 | 93 |
93 int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame( | 94 int32_t VCMDecodedFrameCallback::ReceivedDecodedReferenceFrame( |
94 const uint64_t pictureId) { | 95 const uint64_t pictureId) { |
95 return _receiveCallback->ReceivedDecodedReferenceFrame(pictureId); | 96 return _receiveCallback->ReceivedDecodedReferenceFrame(pictureId); |
96 } | 97 } |
97 | 98 |
98 int32_t VCMDecodedFrameCallback::ReceivedDecodedFrame( | 99 int32_t VCMDecodedFrameCallback::ReceivedDecodedFrame( |
99 const uint64_t pictureId) { | 100 const uint64_t pictureId) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 143 |
143 return _decoder->InitDecode(settings, numberOfCores); | 144 return _decoder->InitDecode(settings, numberOfCores); |
144 } | 145 } |
145 | 146 |
146 int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, int64_t nowMs) { | 147 int32_t VCMGenericDecoder::Decode(const VCMEncodedFrame& frame, int64_t nowMs) { |
147 TRACE_EVENT1("webrtc", "VCMGenericDecoder::Decode", "timestamp", | 148 TRACE_EVENT1("webrtc", "VCMGenericDecoder::Decode", "timestamp", |
148 frame.EncodedImage()._timeStamp); | 149 frame.EncodedImage()._timeStamp); |
149 _frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs; | 150 _frameInfos[_nextFrameInfoIdx].decodeStartTimeMs = nowMs; |
150 _frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs(); | 151 _frameInfos[_nextFrameInfoIdx].renderTimeMs = frame.RenderTimeMs(); |
151 _frameInfos[_nextFrameInfoIdx].rotation = frame.rotation(); | 152 _frameInfos[_nextFrameInfoIdx].rotation = frame.rotation(); |
| 153 _frameInfos[_nextFrameInfoIdx].content_type = frame.contentType(); |
152 _callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]); | 154 _callback->Map(frame.TimeStamp(), &_frameInfos[_nextFrameInfoIdx]); |
153 | 155 |
154 _nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength; | 156 _nextFrameInfoIdx = (_nextFrameInfoIdx + 1) % kDecoderFrameMemoryLength; |
155 const RTPFragmentationHeader dummy_header; | 157 const RTPFragmentationHeader dummy_header; |
156 int32_t ret = _decoder->Decode(frame.EncodedImage(), frame.MissingFrame(), | 158 int32_t ret = _decoder->Decode(frame.EncodedImage(), frame.MissingFrame(), |
157 &dummy_header, | 159 &dummy_header, |
158 frame.CodecSpecific(), frame.RenderTimeMs()); | 160 frame.CodecSpecific(), frame.RenderTimeMs()); |
159 | 161 |
160 _callback->OnDecoderImplementationName(_decoder->ImplementationName()); | 162 _callback->OnDecoderImplementationName(_decoder->ImplementationName()); |
161 if (ret < WEBRTC_VIDEO_CODEC_OK) { | 163 if (ret < WEBRTC_VIDEO_CODEC_OK) { |
(...skipping 21 matching lines...) Expand all Loading... |
183 | 185 |
184 bool VCMGenericDecoder::External() const { | 186 bool VCMGenericDecoder::External() const { |
185 return _isExternal; | 187 return _isExternal; |
186 } | 188 } |
187 | 189 |
188 bool VCMGenericDecoder::PrefersLateDecoding() const { | 190 bool VCMGenericDecoder::PrefersLateDecoding() const { |
189 return _decoder->PrefersLateDecoding(); | 191 return _decoder->PrefersLateDecoding(); |
190 } | 192 } |
191 | 193 |
192 } // namespace webrtc | 194 } // namespace webrtc |
OLD | NEW |