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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 uint8_t* buffer = _encodedImage._buffer; | 109 uint8_t* buffer = _encodedImage._buffer; |
110 | 110 |
111 buffer = InsertHeader(buffer, width, height); | 111 buffer = InsertHeader(buffer, width, height); |
112 | 112 |
113 int ret_length = | 113 int ret_length = |
114 ExtractBuffer(inputImage, req_length - kI420HeaderSize, buffer); | 114 ExtractBuffer(inputImage, req_length - kI420HeaderSize, buffer); |
115 if (ret_length < 0) | 115 if (ret_length < 0) |
116 return WEBRTC_VIDEO_CODEC_MEMORY; | 116 return WEBRTC_VIDEO_CODEC_MEMORY; |
117 _encodedImage._length = ret_length + kI420HeaderSize; | 117 _encodedImage._length = ret_length + kI420HeaderSize; |
118 | 118 |
119 _encodedCompleteCallback->OnEncodedImage(_encodedImage, nullptr, nullptr); | 119 _encodedCompleteCallback->Encoded(_encodedImage, NULL, NULL); |
120 | |
121 return WEBRTC_VIDEO_CODEC_OK; | 120 return WEBRTC_VIDEO_CODEC_OK; |
122 } | 121 } |
123 | 122 |
124 uint8_t* I420Encoder::InsertHeader(uint8_t* buffer, | 123 uint8_t* I420Encoder::InsertHeader(uint8_t* buffer, |
125 uint16_t width, | 124 uint16_t width, |
126 uint16_t height) { | 125 uint16_t height) { |
127 *buffer++ = static_cast<uint8_t>(width >> 8); | 126 *buffer++ = static_cast<uint8_t>(width >> 8); |
128 *buffer++ = static_cast<uint8_t>(width & 0xFF); | 127 *buffer++ = static_cast<uint8_t>(width & 0xFF); |
129 *buffer++ = static_cast<uint8_t>(height >> 8); | 128 *buffer++ = static_cast<uint8_t>(height >> 8); |
130 *buffer++ = static_cast<uint8_t>(height & 0xFF); | 129 *buffer++ = static_cast<uint8_t>(height & 0xFF); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 DecodedImageCallback* callback) { | 229 DecodedImageCallback* callback) { |
231 _decodeCompleteCallback = callback; | 230 _decodeCompleteCallback = callback; |
232 return WEBRTC_VIDEO_CODEC_OK; | 231 return WEBRTC_VIDEO_CODEC_OK; |
233 } | 232 } |
234 | 233 |
235 int I420Decoder::Release() { | 234 int I420Decoder::Release() { |
236 _inited = false; | 235 _inited = false; |
237 return WEBRTC_VIDEO_CODEC_OK; | 236 return WEBRTC_VIDEO_CODEC_OK; |
238 } | 237 } |
239 } // namespace webrtc | 238 } // namespace webrtc |
OLD | NEW |