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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 // Starts stream activity. | 208 // Starts stream activity. |
209 // When a stream is active, it can receive, process and deliver packets. | 209 // When a stream is active, it can receive, process and deliver packets. |
210 virtual void Start() = 0; | 210 virtual void Start() = 0; |
211 // Stops stream activity. | 211 // Stops stream activity. |
212 // When a stream is stopped, it can't receive, process or deliver packets. | 212 // When a stream is stopped, it can't receive, process or deliver packets. |
213 virtual void Stop() = 0; | 213 virtual void Stop() = 0; |
214 | 214 |
215 // Based on the spec in | 215 // Based on the spec in |
216 // https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference. | 216 // https://w3c.github.io/webrtc-pc/#idl-def-rtcdegradationpreference. |
217 enum class DegradationPreference { | 217 enum class DegradationPreference : size_t { |
218 kMaintainResolution, | 218 kMaintainResolution = 0, |
219 // TODO(perkj): Implement kMaintainFrameRate. kBalanced will drop frames | 219 // TODO(perkj): Implement kMaintainFrameRate. kBalanced will drop frames |
220 // if the encoder overshoots or the encoder can not encode fast enough. | 220 // if the encoder overshoots or the encoder can not encode fast enough. |
221 kBalanced, | 221 kBalanced = 1, |
222 }; | 222 }; |
| 223 static const size_t kNumDegradationPreferences = |
| 224 static_cast<size_t>(DegradationPreference::kBalanced) + 1; |
| 225 |
223 virtual void SetSource( | 226 virtual void SetSource( |
224 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, | 227 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, |
225 const DegradationPreference& degradation_preference) = 0; | 228 const DegradationPreference& degradation_preference) = 0; |
226 | 229 |
227 // Set which streams to send. Must have at least as many SSRCs as configured | 230 // Set which streams to send. Must have at least as many SSRCs as configured |
228 // in the config. Encoder settings are passed on to the encoder instance along | 231 // in the config. Encoder settings are passed on to the encoder instance along |
229 // with the VideoStream settings. | 232 // with the VideoStream settings. |
230 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; | 233 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; |
231 | 234 |
232 virtual Stats GetStats() = 0; | 235 virtual Stats GetStats() = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
247 EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0); | 250 EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0); |
248 } | 251 } |
249 | 252 |
250 protected: | 253 protected: |
251 virtual ~VideoSendStream() {} | 254 virtual ~VideoSendStream() {} |
252 }; | 255 }; |
253 | 256 |
254 } // namespace webrtc | 257 } // namespace webrtc |
255 | 258 |
256 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 259 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
OLD | NEW |