| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void VideoProcessorImpl::SetRates(int bit_rate, int frame_rate) { | 211 void VideoProcessorImpl::SetRates(int bit_rate, int frame_rate) { |
| 212 int set_rates_result = encoder_->SetRateAllocation( | 212 int set_rates_result = encoder_->SetRateAllocation( |
| 213 bitrate_allocator_->GetAllocation(bit_rate * 1000, frame_rate), | 213 bitrate_allocator_->GetAllocation(bit_rate * 1000, frame_rate), |
| 214 frame_rate); | 214 frame_rate); |
| 215 RTC_DCHECK_GE(set_rates_result, 0) | 215 RTC_DCHECK_GE(set_rates_result, 0) |
| 216 << "Failed to update encoder with new rate " << bit_rate; | 216 << "Failed to update encoder with new rate " << bit_rate; |
| 217 num_dropped_frames_ = 0; | 217 num_dropped_frames_ = 0; |
| 218 num_spatial_resizes_ = 0; | 218 num_spatial_resizes_ = 0; |
| 219 } | 219 } |
| 220 | 220 |
| 221 // TODO(brandtr): Update implementation of EncodedFrameSize and EncodedFrameType | 221 size_t VideoProcessorImpl::EncodedFrameSize(int frame_number) { |
| 222 // to support batch processing in the caller. | 222 RTC_DCHECK_LT(frame_number, frame_infos_.size()); |
| 223 size_t VideoProcessorImpl::EncodedFrameSize() { | 223 return frame_infos_[frame_number].encoded_frame_size; |
| 224 RTC_DCHECK(!frame_infos_.empty()); | |
| 225 return frame_infos_.back().encoded_frame_size; | |
| 226 } | 224 } |
| 227 | 225 |
| 228 FrameType VideoProcessorImpl::EncodedFrameType() { | 226 FrameType VideoProcessorImpl::EncodedFrameType(int frame_number) { |
| 229 RTC_DCHECK(!frame_infos_.empty()); | 227 RTC_DCHECK_LT(frame_number, frame_infos_.size()); |
| 230 return frame_infos_.back().encoded_frame_type; | 228 return frame_infos_[frame_number].encoded_frame_type; |
| 231 } | 229 } |
| 232 | 230 |
| 233 int VideoProcessorImpl::NumberDroppedFrames() { | 231 int VideoProcessorImpl::NumberDroppedFrames() { |
| 234 return num_dropped_frames_; | 232 return num_dropped_frames_; |
| 235 } | 233 } |
| 236 | 234 |
| 237 int VideoProcessorImpl::NumberSpatialResizes() { | 235 int VideoProcessorImpl::NumberSpatialResizes() { |
| 238 return num_spatial_resizes_; | 236 return num_spatial_resizes_; |
| 239 } | 237 } |
| 240 | 238 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 if (decoded_frame_writer_) { | 491 if (decoded_frame_writer_) { |
| 494 RTC_DCHECK_EQ(extracted_length, decoded_frame_writer_->FrameLength()); | 492 RTC_DCHECK_EQ(extracted_length, decoded_frame_writer_->FrameLength()); |
| 495 RTC_CHECK(decoded_frame_writer_->WriteFrame(extracted_buffer.data())); | 493 RTC_CHECK(decoded_frame_writer_->WriteFrame(extracted_buffer.data())); |
| 496 } | 494 } |
| 497 | 495 |
| 498 last_decoded_frame_buffer_ = std::move(extracted_buffer); | 496 last_decoded_frame_buffer_ = std::move(extracted_buffer); |
| 499 } | 497 } |
| 500 | 498 |
| 501 } // namespace test | 499 } // namespace test |
| 502 } // namespace webrtc | 500 } // namespace webrtc |
| OLD | NEW |