| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1393   if (ref_frame_ != NULL) { |  1397   if (ref_frame_ != NULL) { | 
|  1394     vpx_img_free(&ref_frame_->img); |  1398     vpx_img_free(&ref_frame_->img); | 
|  1395     delete ref_frame_; |  1399     delete ref_frame_; | 
|  1396     ref_frame_ = NULL; |  1400     ref_frame_ = NULL; | 
|  1397   } |  1401   } | 
|  1398   buffer_pool_.Release(); |  1402   buffer_pool_.Release(); | 
|  1399   inited_ = false; |  1403   inited_ = false; | 
|  1400   return WEBRTC_VIDEO_CODEC_OK; |  1404   return WEBRTC_VIDEO_CODEC_OK; | 
|  1401 } |  1405 } | 
|  1402  |  1406  | 
 |  1407 const char* VP8DecoderImpl::ImplementationName() const { | 
 |  1408   return "libvpx"; | 
 |  1409 } | 
 |  1410  | 
|  1403 int VP8DecoderImpl::CopyReference(VP8DecoderImpl* copy) { |  1411 int VP8DecoderImpl::CopyReference(VP8DecoderImpl* copy) { | 
|  1404   // The type of frame to copy should be set in ref_frame_->frame_type |  1412   // The type of frame to copy should be set in ref_frame_->frame_type | 
|  1405   // before the call to this function. |  1413   // before the call to this function. | 
|  1406   if (vpx_codec_control(decoder_, VP8_COPY_REFERENCE, ref_frame_) |  1414   if (vpx_codec_control(decoder_, VP8_COPY_REFERENCE, ref_frame_) | 
|  1407       != VPX_CODEC_OK) { |  1415       != VPX_CODEC_OK) { | 
|  1408     return -1; |  1416     return -1; | 
|  1409   } |  1417   } | 
|  1410   if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) |  1418   if (vpx_codec_control(copy->decoder_, VP8_SET_REFERENCE, ref_frame_) | 
|  1411       != VPX_CODEC_OK) { |  1419       != VPX_CODEC_OK) { | 
|  1412     return -1; |  1420     return -1; | 
|  1413   } |  1421   } | 
|  1414   return 0; |  1422   return 0; | 
|  1415 } |  1423 } | 
|  1416  |  1424  | 
|  1417 }  // namespace webrtc |  1425 }  // namespace webrtc | 
| OLD | NEW |