OLD | NEW |
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 Loading... |
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 SetRateAllocation(const BitrateAllocation& rate_allocation, | 42 int32_t SetRates(uint32_t new_target_bitrate, uint32_t framerate) override; |
43 uint32_t framerate) override; | |
44 const char* ImplementationName() const override; | 43 const char* ImplementationName() const override; |
45 | 44 |
46 static const char* kImplementationName; | 45 static const char* kImplementationName; |
47 | 46 |
48 protected: | 47 protected: |
49 Clock* const clock_; | 48 Clock* const clock_; |
50 VideoCodec config_; | 49 VideoCodec config_; |
51 EncodedImageCallback* callback_; | 50 EncodedImageCallback* callback_; |
52 BitrateAllocation target_bitrate_; | 51 int target_bitrate_kbps_; |
53 int max_target_bitrate_kbps_; | 52 int max_target_bitrate_kbps_; |
54 int64_t last_encode_time_ms_; | 53 int64_t last_encode_time_ms_; |
55 uint8_t encoded_buffer_[100000]; | 54 uint8_t encoded_buffer_[100000]; |
56 }; | 55 }; |
57 | 56 |
58 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback { | 57 class FakeH264Encoder : public FakeEncoder, public EncodedImageCallback { |
59 public: | 58 public: |
60 explicit FakeH264Encoder(Clock* clock); | 59 explicit FakeH264Encoder(Clock* clock); |
61 virtual ~FakeH264Encoder() {} | 60 virtual ~FakeH264Encoder() {} |
62 | 61 |
(...skipping 20 matching lines...) Expand all Loading... |
83 const std::vector<FrameType>* frame_types) override; | 82 const std::vector<FrameType>* frame_types) override; |
84 | 83 |
85 private: | 84 private: |
86 rtc::CriticalSection lock_; | 85 rtc::CriticalSection lock_; |
87 int delay_ms_ GUARDED_BY(&lock_); | 86 int delay_ms_ GUARDED_BY(&lock_); |
88 }; | 87 }; |
89 } // namespace test | 88 } // namespace test |
90 } // namespace webrtc | 89 } // namespace webrtc |
91 | 90 |
92 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ | 91 #endif // WEBRTC_TEST_FAKE_ENCODER_H_ |
OLD | NEW |