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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Processes a single frame. Returns true as long as there's more frames | 141 // Processes a single frame. Returns true as long as there's more frames |
142 // available in the source clip. | 142 // available in the source clip. |
143 // Frame number must be an integer >= 0. | 143 // Frame number must be an integer >= 0. |
144 virtual bool ProcessFrame(int frame_number) = 0; | 144 virtual bool ProcessFrame(int frame_number) = 0; |
145 | 145 |
146 // Updates the encoder with the target bit rate and the frame rate. | 146 // Updates the encoder with the target bit rate and the frame rate. |
147 virtual void SetRates(int bit_rate, int frame_rate) = 0; | 147 virtual void SetRates(int bit_rate, int frame_rate) = 0; |
148 | 148 |
149 // Return the size of the encoded frame in bytes. Dropped frames by the | 149 // Return the size of the encoded frame in bytes. Dropped frames by the |
150 // encoder are regarded as zero size. | 150 // encoder are regarded as zero size. |
151 virtual size_t EncodedFrameSize() = 0; | 151 virtual size_t EncodedFrameSize(int frame_number) = 0; |
152 | 152 |
153 // Return the encoded frame type (key or delta). | 153 // Return the encoded frame type (key or delta). |
154 virtual FrameType EncodedFrameType() = 0; | 154 virtual FrameType EncodedFrameType(int frame_number) = 0; |
155 | 155 |
156 // Return the number of dropped frames. | 156 // Return the number of dropped frames. |
157 virtual int NumberDroppedFrames() = 0; | 157 virtual int NumberDroppedFrames() = 0; |
158 | 158 |
159 // Return the number of spatial resizes. | 159 // Return the number of spatial resizes. |
160 virtual int NumberSpatialResizes() = 0; | 160 virtual int NumberSpatialResizes() = 0; |
161 }; | 161 }; |
162 | 162 |
163 class VideoProcessorImpl : public VideoProcessor { | 163 class VideoProcessorImpl : public VideoProcessor { |
164 public: | 164 public: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 const webrtc::EncodedImage& encodedImage, | 253 const webrtc::EncodedImage& encodedImage, |
254 const webrtc::RTPFragmentationHeader* fragmentation); | 254 const webrtc::RTPFragmentationHeader* fragmentation); |
255 | 255 |
256 // Invoked by the callback when a frame has completed decoding. | 256 // Invoked by the callback when a frame has completed decoding. |
257 void FrameDecoded(const webrtc::VideoFrame& image); | 257 void FrameDecoded(const webrtc::VideoFrame& image); |
258 | 258 |
259 // Updates the encoder with the target bit rate and the frame rate. | 259 // Updates the encoder with the target bit rate and the frame rate. |
260 void SetRates(int bit_rate, int frame_rate) override; | 260 void SetRates(int bit_rate, int frame_rate) override; |
261 | 261 |
262 // Return the size of the encoded frame in bytes. | 262 // Return the size of the encoded frame in bytes. |
263 size_t EncodedFrameSize() override; | 263 size_t EncodedFrameSize(int frame_number) override; |
264 | 264 |
265 // Return the encoded frame type (key or delta). | 265 // Return the encoded frame type (key or delta). |
266 FrameType EncodedFrameType() override; | 266 FrameType EncodedFrameType(int frame_number) override; |
267 | 267 |
268 // Return the number of dropped frames. | 268 // Return the number of dropped frames. |
269 int NumberDroppedFrames() override; | 269 int NumberDroppedFrames() override; |
270 | 270 |
271 // Return the number of spatial resizes. | 271 // Return the number of spatial resizes. |
272 int NumberSpatialResizes() override; | 272 int NumberSpatialResizes() override; |
273 | 273 |
274 webrtc::VideoEncoder* const encoder_; | 274 webrtc::VideoEncoder* const encoder_; |
275 webrtc::VideoDecoder* const decoder_; | 275 webrtc::VideoDecoder* const decoder_; |
276 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; | 276 const std::unique_ptr<VideoBitrateAllocator> bitrate_allocator_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 Stats* stats_; | 318 Stats* stats_; |
319 int num_dropped_frames_; | 319 int num_dropped_frames_; |
320 int num_spatial_resizes_; | 320 int num_spatial_resizes_; |
321 double bit_rate_factor_; // Multiply frame length with this to get bit rate. | 321 double bit_rate_factor_; // Multiply frame length with this to get bit rate. |
322 }; | 322 }; |
323 | 323 |
324 } // namespace test | 324 } // namespace test |
325 } // namespace webrtc | 325 } // namespace webrtc |
326 | 326 |
327 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ | 327 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_TEST_VIDEOPROCESSOR_H_ |
OLD | NEW |