OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 68 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
69 public: | 69 public: |
70 explicit FakeAudioReceiveStream( | 70 explicit FakeAudioReceiveStream( |
71 const webrtc::AudioReceiveStream::Config& config); | 71 const webrtc::AudioReceiveStream::Config& config); |
72 | 72 |
73 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 73 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
74 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 74 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
75 int received_packets() const { return received_packets_; } | 75 int received_packets() const { return received_packets_; } |
76 bool VerifyLastPacket(const uint8_t* data, size_t length) const; | 76 bool VerifyLastPacket(const uint8_t* data, size_t length) const; |
77 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } | 77 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } |
| 78 float gain() const { return gain_; } |
78 bool DeliverRtp(const uint8_t* packet, | 79 bool DeliverRtp(const uint8_t* packet, |
79 size_t length, | 80 size_t length, |
80 const webrtc::PacketTime& packet_time); | 81 const webrtc::PacketTime& packet_time); |
81 | 82 |
82 private: | 83 private: |
83 // webrtc::AudioReceiveStream implementation. | 84 // webrtc::AudioReceiveStream implementation. |
84 void Start() override {} | 85 void Start() override {} |
85 void Stop() override {} | 86 void Stop() override {} |
86 | 87 |
87 webrtc::AudioReceiveStream::Stats GetStats() const override; | 88 webrtc::AudioReceiveStream::Stats GetStats() const override; |
88 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; | 89 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
| 90 void SetGain(float gain) override; |
89 | 91 |
90 webrtc::AudioReceiveStream::Config config_; | 92 webrtc::AudioReceiveStream::Config config_; |
91 webrtc::AudioReceiveStream::Stats stats_; | 93 webrtc::AudioReceiveStream::Stats stats_; |
92 int received_packets_; | 94 int received_packets_ = 0; |
93 std::unique_ptr<webrtc::AudioSinkInterface> sink_; | 95 std::unique_ptr<webrtc::AudioSinkInterface> sink_; |
| 96 float gain_ = 1.0f; |
94 rtc::Buffer last_packet_; | 97 rtc::Buffer last_packet_; |
95 }; | 98 }; |
96 | 99 |
97 class FakeVideoSendStream final : public webrtc::VideoSendStream, | 100 class FakeVideoSendStream final : public webrtc::VideoSendStream, |
98 public webrtc::VideoCaptureInput { | 101 public webrtc::VideoCaptureInput { |
99 public: | 102 public: |
100 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 103 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
101 const webrtc::VideoEncoderConfig& encoder_config); | 104 const webrtc::VideoEncoderConfig& encoder_config); |
102 webrtc::VideoSendStream::Config GetConfig() const; | 105 webrtc::VideoSendStream::Config GetConfig() const; |
103 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 106 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 std::vector<FakeAudioSendStream*> audio_send_streams_; | 241 std::vector<FakeAudioSendStream*> audio_send_streams_; |
239 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 242 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
240 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 243 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
241 | 244 |
242 int num_created_send_streams_; | 245 int num_created_send_streams_; |
243 int num_created_receive_streams_; | 246 int num_created_receive_streams_; |
244 }; | 247 }; |
245 | 248 |
246 } // namespace cricket | 249 } // namespace cricket |
247 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 250 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
OLD | NEW |