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

Side by Side Diff: webrtc/media/engine/fakewebrtccall.h

Issue 1870283002: Don't reconfigure the encoder if the video options aren't changing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@50
Patch Set: Created 4 years, 8 months 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
« no previous file with comments | « no previous file | webrtc/media/engine/fakewebrtccall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 bool IsSending() const; 111 bool IsSending() const;
112 bool GetVp8Settings(webrtc::VideoCodecVP8* settings) const; 112 bool GetVp8Settings(webrtc::VideoCodecVP8* settings) const;
113 bool GetVp9Settings(webrtc::VideoCodecVP9* settings) const; 113 bool GetVp9Settings(webrtc::VideoCodecVP9* settings) const;
114 114
115 int GetNumberOfSwappedFrames() const; 115 int GetNumberOfSwappedFrames() const;
116 int GetLastWidth() const; 116 int GetLastWidth() const;
117 int GetLastHeight() const; 117 int GetLastHeight() const;
118 int64_t GetLastTimestamp() const; 118 int64_t GetLastTimestamp() const;
119 void SetStats(const webrtc::VideoSendStream::Stats& stats); 119 void SetStats(const webrtc::VideoSendStream::Stats& stats);
120 int num_encoder_reconfigurations() const {
121 return num_encoder_reconfigurations_;
122 }
120 123
121 private: 124 private:
122 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override; 125 void IncomingCapturedFrame(const webrtc::VideoFrame& frame) override;
123 126
124 // webrtc::SendStream implementation. 127 // webrtc::SendStream implementation.
125 void Start() override; 128 void Start() override;
126 void Stop() override; 129 void Stop() override;
127 void SignalNetworkState(webrtc::NetworkState state) override {} 130 void SignalNetworkState(webrtc::NetworkState state) override {}
128 bool DeliverRtcp(const uint8_t* packet, size_t length) override { 131 bool DeliverRtcp(const uint8_t* packet, size_t length) override {
129 return true; 132 return true;
130 } 133 }
131 134
132 // webrtc::VideoSendStream implementation. 135 // webrtc::VideoSendStream implementation.
133 webrtc::VideoSendStream::Stats GetStats() override; 136 webrtc::VideoSendStream::Stats GetStats() override;
134 bool ReconfigureVideoEncoder( 137 bool ReconfigureVideoEncoder(
135 const webrtc::VideoEncoderConfig& config) override; 138 const webrtc::VideoEncoderConfig& config) override;
136 webrtc::VideoCaptureInput* Input() override; 139 webrtc::VideoCaptureInput* Input() override;
137 140
138 bool sending_; 141 bool sending_;
139 webrtc::VideoSendStream::Config config_; 142 webrtc::VideoSendStream::Config config_;
140 webrtc::VideoEncoderConfig encoder_config_; 143 webrtc::VideoEncoderConfig encoder_config_;
141 bool codec_settings_set_; 144 bool codec_settings_set_;
142 union VpxSettings { 145 union VpxSettings {
143 webrtc::VideoCodecVP8 vp8; 146 webrtc::VideoCodecVP8 vp8;
144 webrtc::VideoCodecVP9 vp9; 147 webrtc::VideoCodecVP9 vp9;
145 } vpx_settings_; 148 } vpx_settings_;
146 int num_swapped_frames_; 149 int num_swapped_frames_;
147 webrtc::VideoFrame last_frame_; 150 webrtc::VideoFrame last_frame_;
148 webrtc::VideoSendStream::Stats stats_; 151 webrtc::VideoSendStream::Stats stats_;
152 int num_encoder_reconfigurations_ = 0;
149 }; 153 };
150 154
151 class FakeVideoReceiveStream final : public webrtc::VideoReceiveStream { 155 class FakeVideoReceiveStream final : public webrtc::VideoReceiveStream {
152 public: 156 public:
153 explicit FakeVideoReceiveStream( 157 explicit FakeVideoReceiveStream(
154 const webrtc::VideoReceiveStream::Config& config); 158 const webrtc::VideoReceiveStream::Config& config);
155 159
156 webrtc::VideoReceiveStream::Config GetConfig(); 160 webrtc::VideoReceiveStream::Config GetConfig();
157 161
158 bool IsReceiving() const; 162 bool IsReceiving() const;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 std::vector<FakeAudioSendStream*> audio_send_streams_; 248 std::vector<FakeAudioSendStream*> audio_send_streams_;
245 std::vector<FakeVideoReceiveStream*> video_receive_streams_; 249 std::vector<FakeVideoReceiveStream*> video_receive_streams_;
246 std::vector<FakeAudioReceiveStream*> audio_receive_streams_; 250 std::vector<FakeAudioReceiveStream*> audio_receive_streams_;
247 251
248 int num_created_send_streams_; 252 int num_created_send_streams_;
249 int num_created_receive_streams_; 253 int num_created_receive_streams_;
250 }; 254 };
251 255
252 } // namespace cricket 256 } // namespace cricket
253 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_ 257 #endif // TALK_MEDIA_WEBRTC_WEBRTCVIDEOENGINE2_UNITTEST_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/media/engine/fakewebrtccall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698