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 // These options are enforced on a best-effort basis. For instance, all of | |
218 // these options may suffer some frame drops in order to avoid queuing. | |
219 // TODO(sprang): Look into possibility of more strictly enforcing the | |
220 // maintain-framerate option. | |
221 enum class DegradationPreference { | 217 enum class DegradationPreference { |
222 // Don't take any actions based on over-utilization signals. | |
223 kDegradationDisabled, | |
224 // On over-use, request lost resolution, possibly causing down-scaling. | |
225 kMaintainResolution, | 218 kMaintainResolution, |
226 // On over-use, request lower frame rate, possible causing frame drops. | 219 // TODO(perkj): Implement kMaintainFrameRate. kBalanced will drop frames |
227 kMaintainFramerate, | 220 // if the encoder overshoots or the encoder can not encode fast enough. |
228 // Try to strike a "pleasing" balance between frame rate or resolution. | |
229 kBalanced, | 221 kBalanced, |
230 }; | 222 }; |
231 | |
232 virtual void SetSource( | 223 virtual void SetSource( |
233 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, | 224 rtc::VideoSourceInterface<webrtc::VideoFrame>* source, |
234 const DegradationPreference& degradation_preference) = 0; | 225 const DegradationPreference& degradation_preference) = 0; |
235 | 226 |
236 // Set which streams to send. Must have at least as many SSRCs as configured | 227 // Set which streams to send. Must have at least as many SSRCs as configured |
237 // in the config. Encoder settings are passed on to the encoder instance along | 228 // in the config. Encoder settings are passed on to the encoder instance along |
238 // with the VideoStream settings. | 229 // with the VideoStream settings. |
239 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; | 230 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; |
240 | 231 |
241 virtual Stats GetStats() = 0; | 232 virtual Stats GetStats() = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
256 EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0); | 247 EnableEncodedFrameRecording(std::vector<rtc::PlatformFile>(), 0); |
257 } | 248 } |
258 | 249 |
259 protected: | 250 protected: |
260 virtual ~VideoSendStream() {} | 251 virtual ~VideoSendStream() {} |
261 }; | 252 }; |
262 | 253 |
263 } // namespace webrtc | 254 } // namespace webrtc |
264 | 255 |
265 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 256 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
OLD | NEW |