| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 } | 361 } |
| 362 for (int i = 0; i < number_of_streams; ++i) { | 362 for (int i = 0; i < number_of_streams; ++i) { |
| 363 // Random start, 16 bits is enough. | 363 // Random start, 16 bits is enough. |
| 364 picture_id_[i] = static_cast<uint16_t>(rand()) & 0x7FFF; // NOLINT | 364 picture_id_[i] = static_cast<uint16_t>(rand()) & 0x7FFF; // NOLINT |
| 365 last_key_frame_picture_id_[i] = -1; | 365 last_key_frame_picture_id_[i] = -1; |
| 366 // allocate memory for encoded image | 366 // allocate memory for encoded image |
| 367 if (encoded_images_[i]._buffer != NULL) { | 367 if (encoded_images_[i]._buffer != NULL) { |
| 368 delete[] encoded_images_[i]._buffer; | 368 delete[] encoded_images_[i]._buffer; |
| 369 } | 369 } |
| 370 encoded_images_[i]._size = | 370 encoded_images_[i]._size = |
| 371 CalcBufferSize(kI420, codec_.width, codec_.height); | 371 CalcBufferSize(VideoType::kI420, codec_.width, codec_.height); |
| 372 encoded_images_[i]._buffer = new uint8_t[encoded_images_[i]._size]; | 372 encoded_images_[i]._buffer = new uint8_t[encoded_images_[i]._size]; |
| 373 encoded_images_[i]._completeFrame = true; | 373 encoded_images_[i]._completeFrame = true; |
| 374 } | 374 } |
| 375 // populate encoder configuration with default values | 375 // populate encoder configuration with default values |
| 376 if (vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &configurations_[0], | 376 if (vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &configurations_[0], |
| 377 0)) { | 377 0)) { |
| 378 return WEBRTC_VIDEO_CODEC_ERROR; | 378 return WEBRTC_VIDEO_CODEC_ERROR; |
| 379 } | 379 } |
| 380 // setting the time base of the codec | 380 // setting the time base of the codec |
| 381 configurations_[0].g_timebase.num = 1; | 381 configurations_[0].g_timebase.num = 1; |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 buffer_pool_.Release(); | 1152 buffer_pool_.Release(); |
| 1153 inited_ = false; | 1153 inited_ = false; |
| 1154 return WEBRTC_VIDEO_CODEC_OK; | 1154 return WEBRTC_VIDEO_CODEC_OK; |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 const char* VP8DecoderImpl::ImplementationName() const { | 1157 const char* VP8DecoderImpl::ImplementationName() const { |
| 1158 return "libvpx"; | 1158 return "libvpx"; |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 } // namespace webrtc | 1161 } // namespace webrtc |
| OLD | NEW |