| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 "return code: %d\n", bit_rate, set_rates_result); | 155 "return code: %d\n", bit_rate, set_rates_result); |
| 156 } | 156 } |
| 157 num_dropped_frames_ = 0; | 157 num_dropped_frames_ = 0; |
| 158 num_spatial_resizes_ = 0; | 158 num_spatial_resizes_ = 0; |
| 159 } | 159 } |
| 160 | 160 |
| 161 size_t VideoProcessorImpl::EncodedFrameSize() { | 161 size_t VideoProcessorImpl::EncodedFrameSize() { |
| 162 return encoded_frame_size_; | 162 return encoded_frame_size_; |
| 163 } | 163 } |
| 164 | 164 |
| 165 VideoFrameType VideoProcessorImpl::EncodedFrameType() { | 165 FrameType VideoProcessorImpl::EncodedFrameType() { |
| 166 return encoded_frame_type_; | 166 return encoded_frame_type_; |
| 167 } | 167 } |
| 168 | 168 |
| 169 int VideoProcessorImpl::NumberDroppedFrames() { | 169 int VideoProcessorImpl::NumberDroppedFrames() { |
| 170 return num_dropped_frames_; | 170 return num_dropped_frames_; |
| 171 } | 171 } |
| 172 | 172 |
| 173 int VideoProcessorImpl::NumberSpatialResizes() { | 173 int VideoProcessorImpl::NumberSpatialResizes() { |
| 174 return num_spatial_resizes_; | 174 return num_spatial_resizes_; |
| 175 } | 175 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 192 kVideoRotation_0); | 192 kVideoRotation_0); |
| 193 | 193 |
| 194 // Ensure we have a new statistics data object we can fill: | 194 // Ensure we have a new statistics data object we can fill: |
| 195 FrameStatistic& stat = stats_->NewFrame(frame_number); | 195 FrameStatistic& stat = stats_->NewFrame(frame_number); |
| 196 | 196 |
| 197 encode_start_ = TickTime::Now(); | 197 encode_start_ = TickTime::Now(); |
| 198 // Use the frame number as "timestamp" to identify frames | 198 // Use the frame number as "timestamp" to identify frames |
| 199 source_frame_.set_timestamp(frame_number); | 199 source_frame_.set_timestamp(frame_number); |
| 200 | 200 |
| 201 // Decide if we're going to force a keyframe: | 201 // Decide if we're going to force a keyframe: |
| 202 std::vector<VideoFrameType> frame_types(1, kDeltaFrame); | 202 std::vector<FrameType> frame_types(1, kDeltaFrame); |
| 203 if (config_.keyframe_interval > 0 && | 203 if (config_.keyframe_interval > 0 && |
| 204 frame_number % config_.keyframe_interval == 0) { | 204 frame_number % config_.keyframe_interval == 0) { |
| 205 frame_types[0] = kKeyFrame; | 205 frame_types[0] = kKeyFrame; |
| 206 } | 206 } |
| 207 | 207 |
| 208 // For dropped frames, we regard them as zero size encoded frames. | 208 // For dropped frames, we regard them as zero size encoded frames. |
| 209 encoded_frame_size_ = 0; | 209 encoded_frame_size_ = 0; |
| 210 encoded_frame_type_ = kDeltaFrame; | 210 encoded_frame_type_ = kDeltaFrame; |
| 211 | 211 |
| 212 int32_t encode_result = encoder_->Encode(source_frame_, NULL, &frame_types); | 212 int32_t encode_result = encoder_->Encode(source_frame_, NULL, &frame_types); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 return 0; | 413 return 0; |
| 414 } | 414 } |
| 415 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( | 415 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( |
| 416 VideoFrame& image) { | 416 VideoFrame& image) { |
| 417 video_processor_->FrameDecoded(image); // forward to parent class | 417 video_processor_->FrameDecoded(image); // forward to parent class |
| 418 return 0; | 418 return 0; |
| 419 } | 419 } |
| 420 | 420 |
| 421 } // namespace test | 421 } // namespace test |
| 422 } // namespace webrtc | 422 } // namespace webrtc |
| OLD | NEW |