Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: webrtc/test/fake_encoder.h

Issue 2510583002: Reland #2 of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/test/configurable_frame_size_encoder.cc ('k') | webrtc/test/fake_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 21 matching lines...) Expand all
32 int32_t InitEncode(const VideoCodec* config, 32 int32_t InitEncode(const VideoCodec* config,
33 int32_t number_of_cores, 33 int32_t number_of_cores,
34 size_t max_payload_size) override; 34 size_t max_payload_size) override;
35 int32_t Encode(const VideoFrame& input_image, 35 int32_t Encode(const VideoFrame& input_image,
36 const CodecSpecificInfo* codec_specific_info, 36 const CodecSpecificInfo* codec_specific_info,
37 const std::vector<FrameType>* frame_types) override; 37 const std::vector<FrameType>* frame_types) override;
38 int32_t RegisterEncodeCompleteCallback( 38 int32_t RegisterEncodeCompleteCallback(
39 EncodedImageCallback* callback) override; 39 EncodedImageCallback* callback) override;
40 int32_t Release() override; 40 int32_t Release() override;
41 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; 41 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
42 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override; 42 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation,
43 uint32_t framerate) override;
43 const char* ImplementationName() const override; 44 const char* ImplementationName() const override;
44 45
45 static const char* kImplementationName; 46 static const char* kImplementationName;
46 47
47 protected: 48 protected:
48 Clock* const clock_; 49 Clock* const clock_;
49 VideoCodec config_; 50 VideoCodec config_;
50 EncodedImageCallback* callback_; 51 EncodedImageCallback* callback_;
51 int target_bitrate_kbps_; 52 BitrateAllocation target_bitrate_;
52 int max_target_bitrate_kbps_; 53 int max_target_bitrate_kbps_;
53 int64_t last_encode_time_ms_; 54 int64_t last_encode_time_ms_;
54 uint8_t encoded_buffer_[100000]; 55 uint8_t encoded_buffer_[100000];
55 }; 56 };
56 57
57 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback { 58 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback {
58 public: 59 public:
59 explicit FakeH264Encoder(Clock* clock); 60 explicit FakeH264Encoder(Clock* clock);
60 virtual ~FakeH264Encoder() {} 61 virtual ~FakeH264Encoder() {}
61 62
(...skipping 20 matching lines...) Expand all
82 const std::vector<FrameType>* frame_types) override; 83 const std::vector<FrameType>* frame_types) override;
83 84
84 private: 85 private:
85 rtc::CriticalSection lock_; 86 rtc::CriticalSection lock_;
86 int delay_ms_ GUARDED_BY(&lock_); 87 int delay_ms_ GUARDED_BY(&lock_);
87 }; 88 };
88 } // namespace test 89 } // namespace test
89 } // namespace webrtc 90 } // namespace webrtc
90 91
91 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ 92 #endif // WEBRTC_TEST_FAKE_ENCODER_H_
OLDNEW
« no previous file with comments | « webrtc/test/configurable_frame_size_encoder.cc ('k') | webrtc/test/fake_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698