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 |
11 #ifndef WEBRTC_VIDEO_SEND_STREAM_H_ | 11 #ifndef WEBRTC_VIDEO_SEND_STREAM_H_ |
12 #define WEBRTC_VIDEO_SEND_STREAM_H_ | 12 #define WEBRTC_VIDEO_SEND_STREAM_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
18 #include "webrtc/config.h" | 18 #include "webrtc/config.h" |
19 #include "webrtc/frame_callback.h" | 19 #include "webrtc/frame_callback.h" |
| 20 #include "webrtc/stream.h" |
20 #include "webrtc/video_renderer.h" | 21 #include "webrtc/video_renderer.h" |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 | 24 |
24 class VideoEncoder; | 25 class VideoEncoder; |
25 | 26 |
26 // Class to deliver captured frame to the video send stream. | 27 // Class to deliver captured frame to the video send stream. |
27 class VideoCaptureInput { | 28 class VideoCaptureInput { |
28 public: | 29 public: |
29 // These methods do not lock internally and must be called sequentially. | 30 // These methods do not lock internally and must be called sequentially. |
30 // If your application switches input sources synchronization must be done | 31 // If your application switches input sources synchronization must be done |
31 // externally to make sure that any old frames are not delivered concurrently. | 32 // externally to make sure that any old frames are not delivered concurrently. |
32 virtual void IncomingCapturedFrame(const VideoFrame& video_frame) = 0; | 33 virtual void IncomingCapturedFrame(const VideoFrame& video_frame) = 0; |
33 | 34 |
34 protected: | 35 protected: |
35 virtual ~VideoCaptureInput() {} | 36 virtual ~VideoCaptureInput() {} |
36 }; | 37 }; |
37 | 38 |
38 class VideoSendStream { | 39 class VideoSendStream : public SendStream { |
39 public: | 40 public: |
40 struct StreamStats { | 41 struct StreamStats { |
41 FrameCounts frame_counts; | 42 FrameCounts frame_counts; |
42 int width = 0; | 43 int width = 0; |
43 int height = 0; | 44 int height = 0; |
44 // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer. | 45 // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer. |
45 int total_bitrate_bps = 0; | 46 int total_bitrate_bps = 0; |
46 int retransmit_bitrate_bps = 0; | 47 int retransmit_bitrate_bps = 0; |
47 int avg_delay_ms = 0; | 48 int avg_delay_ms = 0; |
48 int max_delay_ms = 0; | 49 int max_delay_ms = 0; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // True if the stream should be suspended when the available bitrate fall | 134 // True if the stream should be suspended when the available bitrate fall |
134 // below the minimum configured bitrate. If this variable is false, the | 135 // below the minimum configured bitrate. If this variable is false, the |
135 // stream may send at a rate higher than the estimated available bitrate. | 136 // stream may send at a rate higher than the estimated available bitrate. |
136 bool suspend_below_min_bitrate = false; | 137 bool suspend_below_min_bitrate = false; |
137 }; | 138 }; |
138 | 139 |
139 // Gets interface used to insert captured frames. Valid as long as the | 140 // Gets interface used to insert captured frames. Valid as long as the |
140 // VideoSendStream is valid. | 141 // VideoSendStream is valid. |
141 virtual VideoCaptureInput* Input() = 0; | 142 virtual VideoCaptureInput* Input() = 0; |
142 | 143 |
143 virtual void Start() = 0; | |
144 virtual void Stop() = 0; | |
145 | |
146 // Set which streams to send. Must have at least as many SSRCs as configured | 144 // Set which streams to send. Must have at least as many SSRCs as configured |
147 // in the config. Encoder settings are passed on to the encoder instance along | 145 // in the config. Encoder settings are passed on to the encoder instance along |
148 // with the VideoStream settings. | 146 // with the VideoStream settings. |
149 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; | 147 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; |
150 | 148 |
151 virtual Stats GetStats() = 0; | 149 virtual Stats GetStats() = 0; |
152 | |
153 protected: | |
154 virtual ~VideoSendStream() {} | |
155 }; | 150 }; |
156 | 151 |
157 } // namespace webrtc | 152 } // namespace webrtc |
158 | 153 |
159 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 154 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
OLD | NEW |