| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/rtc_encoding_video_capturer.h" | 5 #include "content/renderer/media/rtc_encoding_video_capturer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/base/encoded_bitstream_buffer.h" | 8 #include "media/base/encoded_bitstream_buffer.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 const media::VideoEncodingParameters& params) { | 90 const media::VideoEncodingParameters& params) { |
| 91 params_ = params; | 91 params_ = params; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnClosed() { | 94 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnClosed() { |
| 95 finished_ = true; | 95 finished_ = true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnBufferReady( | 98 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnBufferReady( |
| 99 scoped_refptr<const media::EncodedBitstreamBuffer> buffer) { | 99 scoped_refptr<const media::EncodedBitstreamBuffer> buffer) { |
| 100 DCHECK(!finished_ && buffer); | 100 DCHECK(!finished_ && buffer.get()); |
| 101 | 101 |
| 102 // First buffer constitutes the origin of the time for this bitstream context. | 102 // First buffer constitutes the origin of the time for this bitstream context. |
| 103 if (time_base_.is_null()) | 103 if (time_base_.is_null()) |
| 104 time_base_ = buffer->metadata().timestamp; | 104 time_base_ = buffer->metadata().timestamp; |
| 105 | 105 |
| 106 ReportEncodedFrame(buffer); | 106 ReportEncodedFrame(buffer); |
| 107 encoded_video_source_->ReturnBitstreamBuffer(buffer); | 107 encoded_video_source_->ReturnBitstreamBuffer(buffer); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnConfigChanged( | 110 void RtcEncodingVideoCapturer::EncodedVideoSourceClient::OnConfigChanged( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 int32_t RtcEncodingVideoCapturer::SetRates(uint32_t newBitRate, | 220 int32_t RtcEncodingVideoCapturer::SetRates(uint32_t newBitRate, |
| 221 uint32_t frameRate) { | 221 uint32_t frameRate) { |
| 222 if (!encoded_video_source_client_) | 222 if (!encoded_video_source_client_) |
| 223 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; | 223 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; |
| 224 // TODO(hshi): wire up runtime rate control. | 224 // TODO(hshi): wire up runtime rate control. |
| 225 return WEBRTC_VIDEO_CODEC_OK; | 225 return WEBRTC_VIDEO_CODEC_OK; |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace content | 228 } // namespace content |
| OLD | NEW |