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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 I420Buffer::Create(_width, _height, _width, half_width, half_width); | 204 I420Buffer::Create(_width, _height, _width, half_width, half_width); |
205 | 205 |
206 // Converting from raw buffer I420Buffer. | 206 // Converting from raw buffer I420Buffer. |
207 int ret = ConvertToI420(kI420, buffer, 0, 0, _width, _height, 0, | 207 int ret = ConvertToI420(kI420, buffer, 0, 0, _width, _height, 0, |
208 kVideoRotation_0, frame_buffer.get()); | 208 kVideoRotation_0, frame_buffer.get()); |
209 if (ret < 0) { | 209 if (ret < 0) { |
210 return WEBRTC_VIDEO_CODEC_MEMORY; | 210 return WEBRTC_VIDEO_CODEC_MEMORY; |
211 } | 211 } |
212 | 212 |
213 VideoFrame decoded_image(frame_buffer, inputImage._timeStamp, 0, | 213 VideoFrame decoded_image(frame_buffer, inputImage._timeStamp, 0, |
214 webrtc::kVideoRotation_0); | 214 webrtc::kVideoRotation_0, |
| 215 webrtc::VideoContentType::kDefault); |
215 _decodeCompleteCallback->Decoded(decoded_image); | 216 _decodeCompleteCallback->Decoded(decoded_image); |
216 return WEBRTC_VIDEO_CODEC_OK; | 217 return WEBRTC_VIDEO_CODEC_OK; |
217 } | 218 } |
218 | 219 |
219 const uint8_t* I420Decoder::ExtractHeader(const uint8_t* buffer, | 220 const uint8_t* I420Decoder::ExtractHeader(const uint8_t* buffer, |
220 uint16_t* width, | 221 uint16_t* width, |
221 uint16_t* height) { | 222 uint16_t* height) { |
222 *width = static_cast<uint16_t>(*buffer++) << 8; | 223 *width = static_cast<uint16_t>(*buffer++) << 8; |
223 *width |= *buffer++; | 224 *width |= *buffer++; |
224 *height = static_cast<uint16_t>(*buffer++) << 8; | 225 *height = static_cast<uint16_t>(*buffer++) << 8; |
225 *height |= *buffer++; | 226 *height |= *buffer++; |
226 | 227 |
227 return buffer; | 228 return buffer; |
228 } | 229 } |
229 | 230 |
230 int I420Decoder::RegisterDecodeCompleteCallback( | 231 int I420Decoder::RegisterDecodeCompleteCallback( |
231 DecodedImageCallback* callback) { | 232 DecodedImageCallback* callback) { |
232 _decodeCompleteCallback = callback; | 233 _decodeCompleteCallback = callback; |
233 return WEBRTC_VIDEO_CODEC_OK; | 234 return WEBRTC_VIDEO_CODEC_OK; |
234 } | 235 } |
235 | 236 |
236 int I420Decoder::Release() { | 237 int I420Decoder::Release() { |
237 _inited = false; | 238 _inited = false; |
238 return WEBRTC_VIDEO_CODEC_OK; | 239 return WEBRTC_VIDEO_CODEC_OK; |
239 } | 240 } |
240 } // namespace webrtc | 241 } // namespace webrtc |
OLD | NEW |