OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 277 |
278 num_spatial_layers_ = inst->VP9().numberOfSpatialLayers; | 278 num_spatial_layers_ = inst->VP9().numberOfSpatialLayers; |
279 num_temporal_layers_ = inst->VP9().numberOfTemporalLayers; | 279 num_temporal_layers_ = inst->VP9().numberOfTemporalLayers; |
280 if (num_temporal_layers_ == 0) | 280 if (num_temporal_layers_ == 0) |
281 num_temporal_layers_ = 1; | 281 num_temporal_layers_ = 1; |
282 | 282 |
283 // Allocate memory for encoded image | 283 // Allocate memory for encoded image |
284 if (encoded_image_._buffer != NULL) { | 284 if (encoded_image_._buffer != NULL) { |
285 delete[] encoded_image_._buffer; | 285 delete[] encoded_image_._buffer; |
286 } | 286 } |
287 encoded_image_._size = CalcBufferSize(kI420, codec_.width, codec_.height); | 287 encoded_image_._size = |
| 288 CalcBufferSize(VideoType::kI420, codec_.width, codec_.height); |
288 encoded_image_._buffer = new uint8_t[encoded_image_._size]; | 289 encoded_image_._buffer = new uint8_t[encoded_image_._size]; |
289 encoded_image_._completeFrame = true; | 290 encoded_image_._completeFrame = true; |
290 // Creating a wrapper to the image - setting image data to NULL. Actual | 291 // Creating a wrapper to the image - setting image data to NULL. Actual |
291 // pointer will be set in encode. Setting align to 1, as it is meaningless | 292 // pointer will be set in encode. Setting align to 1, as it is meaningless |
292 // (actual memory is not allocated). | 293 // (actual memory is not allocated). |
293 raw_ = vpx_img_wrap(NULL, VPX_IMG_FMT_I420, codec_.width, codec_.height, 1, | 294 raw_ = vpx_img_wrap(NULL, VPX_IMG_FMT_I420, codec_.width, codec_.height, 1, |
294 NULL); | 295 NULL); |
295 // Populate encoder configuration with default values. | 296 // Populate encoder configuration with default values. |
296 if (vpx_codec_enc_config_default(vpx_codec_vp9_cx(), config_, 0)) { | 297 if (vpx_codec_enc_config_default(vpx_codec_vp9_cx(), config_, 0)) { |
297 return WEBRTC_VIDEO_CODEC_ERROR; | 298 return WEBRTC_VIDEO_CODEC_ERROR; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 frame_buffer_pool_.ClearPool(); | 1009 frame_buffer_pool_.ClearPool(); |
1009 inited_ = false; | 1010 inited_ = false; |
1010 return WEBRTC_VIDEO_CODEC_OK; | 1011 return WEBRTC_VIDEO_CODEC_OK; |
1011 } | 1012 } |
1012 | 1013 |
1013 const char* VP9DecoderImpl::ImplementationName() const { | 1014 const char* VP9DecoderImpl::ImplementationName() const { |
1014 return "libvpx"; | 1015 return "libvpx"; |
1015 } | 1016 } |
1016 | 1017 |
1017 } // namespace webrtc | 1018 } // namespace webrtc |
OLD | NEW |