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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 framerate, | 294 framerate, |
295 &configurations_[i]); | 295 &configurations_[i]); |
296 if (vpx_codec_enc_config_set(&encoders_[i], &configurations_[i])) { | 296 if (vpx_codec_enc_config_set(&encoders_[i], &configurations_[i])) { |
297 return WEBRTC_VIDEO_CODEC_ERROR; | 297 return WEBRTC_VIDEO_CODEC_ERROR; |
298 } | 298 } |
299 } | 299 } |
300 quality_scaler_.ReportFramerate(new_framerate); | 300 quality_scaler_.ReportFramerate(new_framerate); |
301 return WEBRTC_VIDEO_CODEC_OK; | 301 return WEBRTC_VIDEO_CODEC_OK; |
302 } | 302 } |
303 | 303 |
| 304 const char* VP8EncoderImpl::ImplementationName() const { |
| 305 return "libvpx"; |
| 306 } |
| 307 |
304 void VP8EncoderImpl::SetStreamState(bool send_stream, | 308 void VP8EncoderImpl::SetStreamState(bool send_stream, |
305 int stream_idx) { | 309 int stream_idx) { |
306 if (send_stream && !send_stream_[stream_idx]) { | 310 if (send_stream && !send_stream_[stream_idx]) { |
307 // Need a key frame if we have not sent this stream before. | 311 // Need a key frame if we have not sent this stream before. |
308 key_frame_request_[stream_idx] = true; | 312 key_frame_request_[stream_idx] = true; |
309 } | 313 } |
310 send_stream_[stream_idx] = send_stream; | 314 send_stream_[stream_idx] = send_stream; |
311 } | 315 } |
312 | 316 |
313 void VP8EncoderImpl::SetupTemporalLayers(int num_streams, | 317 void VP8EncoderImpl::SetupTemporalLayers(int num_streams, |
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 if (ref_frame_ != NULL) { | 1396 if (ref_frame_ != NULL) { |
1393 vpx_img_free(&ref_frame_->img); | 1397 vpx_img_free(&ref_frame_->img); |
1394 delete ref_frame_; | 1398 delete ref_frame_; |
1395 ref_frame_ = NULL; | 1399 ref_frame_ = NULL; |
1396 } | 1400 } |
1397 buffer_pool_.Release(); | 1401 buffer_pool_.Release(); |
1398 inited_ = false; | 1402 inited_ = false; |
1399 return WEBRTC_VIDEO_CODEC_OK; | 1403 return WEBRTC_VIDEO_CODEC_OK; |
1400 } | 1404 } |
1401 | 1405 |
| 1406 const char* VP8DecoderImpl::ImplementationName() const { |
| 1407 return "libvpx"; |
| 1408 } |
| 1409 |
1402 int VP8DecoderImpl::CopyReference(VP8DecoderImpl* copy) { | 1410 int VP8DecoderImpl::CopyReference(VP8DecoderImpl* copy) { |
1403 // The type of frame to copy should be set in ref_frame_->frame_type | 1411 // The type of frame to copy should be set in ref_frame_->frame_type |
1404 // before the call to this function. | 1412 // before the call to this function. |
1405 if (vpx_codec_control(decoder_, VP8_COPY_REFERENCE, ref_frame_) | 1413 if (vpx_codec_control(decoder_, VP8_COPY_REFERENCE, ref_frame_) |
1406 != VPX_CODEC_OK) { | 1414 != VPX_CODEC_OK) { |
1407 return -1; | 1415 return -1; |
1408 } | 1416 } |
1409 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) | 1417 if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) |
1410 != VPX_CODEC_OK) { | 1418 != VPX_CODEC_OK) { |
1411 return -1; | 1419 return -1; |
1412 } | 1420 } |
1413 return 0; | 1421 return 0; |
1414 } | 1422 } |
1415 | 1423 |
1416 } // namespace webrtc | 1424 } // namespace webrtc |
OLD | NEW |