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

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

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Addressed comments. Moved VideoCodec creation to factory class. 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
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 20 matching lines...) Expand all
31 int32_t InitEncode(const VideoCodec* config, 31 int32_t InitEncode(const VideoCodec* config,
32 int32_t number_of_cores, 32 int32_t number_of_cores,
33 size_t max_payload_size) override; 33 size_t max_payload_size) override;
34 int32_t Encode(const VideoFrame& input_image, 34 int32_t Encode(const VideoFrame& input_image,
35 const CodecSpecificInfo* codec_specific_info, 35 const CodecSpecificInfo* codec_specific_info,
36 const std::vector<FrameType>* frame_types) override; 36 const std::vector<FrameType>* frame_types) override;
37 int32_t RegisterEncodeCompleteCallback( 37 int32_t RegisterEncodeCompleteCallback(
38 EncodedImageCallback* callback) override; 38 EncodedImageCallback* callback) override;
39 int32_t Release() override; 39 int32_t Release() override;
40 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; 40 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override;
41 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override; 41 int32_t SetRateAllocation(const BitrateAllocation& rate_allocation,
42 uint32_t framerate) override;
42 const char* ImplementationName() const override; 43 const char* ImplementationName() const override;
43 44
44 static const char* kImplementationName; 45 static const char* kImplementationName;
45 46
46 protected: 47 protected:
47 Clock* const clock_; 48 Clock* const clock_;
48 VideoCodec config_; 49 VideoCodec config_;
49 EncodedImageCallback* callback_; 50 EncodedImageCallback* callback_;
50 int target_bitrate_kbps_; 51 BitrateAllocation target_bitrate_;
51 int max_target_bitrate_kbps_; 52 int max_target_bitrate_kbps_;
52 int64_t last_encode_time_ms_; 53 int64_t last_encode_time_ms_;
53 uint8_t encoded_buffer_[100000]; 54 uint8_t encoded_buffer_[100000];
54 }; 55 };
55 56
56 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback { 57 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback {
57 public: 58 public:
58 explicit FakeH264Encoder(Clock* clock); 59 explicit FakeH264Encoder(Clock* clock);
59 virtual ~FakeH264Encoder() {} 60 virtual ~FakeH264Encoder() {}
60 61
(...skipping 18 matching lines...) Expand all
79 const CodecSpecificInfo* codec_specific_info, 80 const CodecSpecificInfo* codec_specific_info,
80 const std::vector<FrameType>* frame_types) override; 81 const std::vector<FrameType>* frame_types) override;
81 82
82 private: 83 private:
83 const int delay_ms_; 84 const int delay_ms_;
84 }; 85 };
85 } // namespace test 86 } // namespace test
86 } // namespace webrtc 87 } // namespace webrtc
87 88
88 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ 89 #endif // WEBRTC_TEST_FAKE_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698