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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { | 65 class FakeAudioReceiveStream final : public webrtc::AudioReceiveStream { |
66 public: | 66 public: |
67 explicit FakeAudioReceiveStream( | 67 explicit FakeAudioReceiveStream( |
68 const webrtc::AudioReceiveStream::Config& config); | 68 const webrtc::AudioReceiveStream::Config& config); |
69 | 69 |
70 const webrtc::AudioReceiveStream::Config& GetConfig() const; | 70 const webrtc::AudioReceiveStream::Config& GetConfig() const; |
71 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); | 71 void SetStats(const webrtc::AudioReceiveStream::Stats& stats); |
72 int received_packets() const { return received_packets_; } | 72 int received_packets() const { return received_packets_; } |
73 bool VerifyLastPacket(const uint8_t* data, size_t length) const; | 73 bool VerifyLastPacket(const uint8_t* data, size_t length) const; |
74 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } | 74 const webrtc::AudioSinkInterface* sink() const { return sink_.get(); } |
| 75 float gain() const { return gain_; } |
75 bool DeliverRtp(const uint8_t* packet, | 76 bool DeliverRtp(const uint8_t* packet, |
76 size_t length, | 77 size_t length, |
77 const webrtc::PacketTime& packet_time); | 78 const webrtc::PacketTime& packet_time); |
78 | 79 |
79 private: | 80 private: |
80 // webrtc::AudioReceiveStream implementation. | 81 // webrtc::AudioReceiveStream implementation. |
81 void Start() override {} | 82 void Start() override {} |
82 void Stop() override {} | 83 void Stop() override {} |
83 | 84 |
84 webrtc::AudioReceiveStream::Stats GetStats() const override; | 85 webrtc::AudioReceiveStream::Stats GetStats() const override; |
85 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; | 86 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; |
| 87 void SetGain(float gain) override; |
86 | 88 |
87 webrtc::AudioReceiveStream::Config config_; | 89 webrtc::AudioReceiveStream::Config config_; |
88 webrtc::AudioReceiveStream::Stats stats_; | 90 webrtc::AudioReceiveStream::Stats stats_; |
89 int received_packets_; | 91 int received_packets_ = 0; |
90 std::unique_ptr<webrtc::AudioSinkInterface> sink_; | 92 std::unique_ptr<webrtc::AudioSinkInterface> sink_; |
| 93 float gain_ = 0.0f; |
91 rtc::Buffer last_packet_; | 94 rtc::Buffer last_packet_; |
92 }; | 95 }; |
93 | 96 |
94 class FakeVideoSendStream final : public webrtc::VideoSendStream, | 97 class FakeVideoSendStream final : public webrtc::VideoSendStream, |
95 public webrtc::VideoCaptureInput { | 98 public webrtc::VideoCaptureInput { |
96 public: | 99 public: |
97 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, | 100 FakeVideoSendStream(const webrtc::VideoSendStream::Config& config, |
98 const webrtc::VideoEncoderConfig& encoder_config); | 101 const webrtc::VideoEncoderConfig& encoder_config); |
99 webrtc::VideoSendStream::Config GetConfig() const; | 102 webrtc::VideoSendStream::Config GetConfig() const; |
100 webrtc::VideoEncoderConfig GetEncoderConfig() const; | 103 webrtc::VideoEncoderConfig GetEncoderConfig() const; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 std::vector<FakeAudioSendStream*> audio_send_streams_; | 230 std::vector<FakeAudioSendStream*> audio_send_streams_; |
228 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 231 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
229 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 232 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
230 | 233 |
231 int num_created_send_streams_; | 234 int num_created_send_streams_; |
232 int num_created_receive_streams_; | 235 int num_created_receive_streams_; |
233 }; | 236 }; |
234 | 237 |
235 } // namespace cricket | 238 } // namespace cricket |
236 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 239 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
OLD | NEW |