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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 bool IsSending() const; | 113 bool IsSending() const; |
114 bool GetVp8Settings(webrtc::VideoCodecVP8* settings) const; | 114 bool GetVp8Settings(webrtc::VideoCodecVP8* settings) const; |
115 bool GetVp9Settings(webrtc::VideoCodecVP9* settings) const; | 115 bool GetVp9Settings(webrtc::VideoCodecVP9* settings) const; |
116 | 116 |
117 int GetNumberOfSwappedFrames() const; | 117 int GetNumberOfSwappedFrames() const; |
118 int GetLastWidth() const; | 118 int GetLastWidth() const; |
119 int GetLastHeight() const; | 119 int GetLastHeight() const; |
120 int64_t GetLastTimestamp() const; | 120 int64_t GetLastTimestamp() const; |
121 void SetStats(const webrtc::VideoSendStream::Stats& stats); | 121 void SetStats(const webrtc::VideoSendStream::Stats& stats); |
| 122 int num_encoder_reconfigurations() const { |
| 123 return num_encoder_reconfigurations_; |
| 124 } |
122 | 125 |
123 private: | 126 private: |
124 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override; | 127 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override; |
125 | 128 |
126 // webrtc::SendStream implementation. | 129 // webrtc::SendStream implementation. |
127 void Start() override; | 130 void Start() override; |
128 void Stop() override; | 131 void Stop() override; |
129 void SignalNetworkState(webrtc::NetworkState state) override {} | 132 void SignalNetworkState(webrtc::NetworkState state) override {} |
130 bool DeliverRtcp(const uint8_t* packet, size_t length) override { | 133 bool DeliverRtcp(const uint8_t* packet, size_t length) override { |
131 return true; | 134 return true; |
132 } | 135 } |
133 | 136 |
134 // webrtc::VideoSendStream implementation. | 137 // webrtc::VideoSendStream implementation. |
135 webrtc::VideoSendStream::Stats GetStats() override; | 138 webrtc::VideoSendStream::Stats GetStats() override; |
136 void ReconfigureVideoEncoder( | 139 void ReconfigureVideoEncoder( |
137 const webrtc::VideoEncoderConfig& config) override; | 140 const webrtc::VideoEncoderConfig& config) override; |
138 webrtc::VideoCaptureInput* Input() override; | 141 webrtc::VideoCaptureInput* Input() override; |
139 | 142 |
140 bool sending_; | 143 bool sending_; |
141 webrtc::VideoSendStream::Config config_; | 144 webrtc::VideoSendStream::Config config_; |
142 webrtc::VideoEncoderConfig encoder_config_; | 145 webrtc::VideoEncoderConfig encoder_config_; |
143 bool codec_settings_set_; | 146 bool codec_settings_set_; |
144 union VpxSettings { | 147 union VpxSettings { |
145 webrtc::VideoCodecVP8 vp8; | 148 webrtc::VideoCodecVP8 vp8; |
146 webrtc::VideoCodecVP9 vp9; | 149 webrtc::VideoCodecVP9 vp9; |
147 } vpx_settings_; | 150 } vpx_settings_; |
148 int num_swapped_frames_; | 151 int num_swapped_frames_; |
149 webrtc::VideoFrame last_frame_; | 152 webrtc::VideoFrame last_frame_; |
150 webrtc::VideoSendStream::Stats stats_; | 153 webrtc::VideoSendStream::Stats stats_; |
| 154 int num_encoder_reconfigurations_ = 0; |
151 }; | 155 }; |
152 | 156 |
153 class FakeVideoReceiveStream final : public webrtc::VideoReceiveStream { | 157 class FakeVideoReceiveStream final : public webrtc::VideoReceiveStream { |
154 public: | 158 public: |
155 explicit FakeVideoReceiveStream( | 159 explicit FakeVideoReceiveStream( |
156 const webrtc::VideoReceiveStream::Config& config); | 160 const webrtc::VideoReceiveStream::Config& config); |
157 | 161 |
158 webrtc::VideoReceiveStream::Config GetConfig(); | 162 webrtc::VideoReceiveStream::Config GetConfig(); |
159 | 163 |
160 bool IsReceiving() const; | 164 bool IsReceiving() const; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 std::vector<FakeAudioSendStream*> audio_send_streams_; | 252 std::vector<FakeAudioSendStream*> audio_send_streams_; |
249 std::vector<FakeVideoReceiveStream*> video_receive_streams_; | 253 std::vector<FakeVideoReceiveStream*> video_receive_streams_; |
250 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; | 254 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; |
251 | 255 |
252 int num_created_send_streams_; | 256 int num_created_send_streams_; |
253 int num_created_receive_streams_; | 257 int num_created_receive_streams_; |
254 }; | 258 }; |
255 | 259 |
256 } // namespace cricket | 260 } // namespace cricket |
257 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ | 261 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ |
OLD | NEW |