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 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/common_types.h" | 18 #include "webrtc/common_types.h" |
19 #include "webrtc/common_video/include/frame_callback.h" | 19 #include "webrtc/common_video/include/frame_callback.h" |
20 #include "webrtc/config.h" | 20 #include "webrtc/config.h" |
21 #include "webrtc/media/base/videosinkinterface.h" | 21 #include "webrtc/media/base/videosinkinterface.h" |
| 22 #include "webrtc/media/base/videosourceinterface.h" |
22 #include "webrtc/transport.h" | 23 #include "webrtc/transport.h" |
23 | 24 |
24 namespace webrtc { | 25 namespace webrtc { |
25 | 26 |
26 class LoadObserver; | 27 class LoadObserver; |
27 class VideoEncoder; | 28 class VideoEncoder; |
28 | 29 |
29 // Class to deliver captured frame to the video send stream. | |
30 class VideoCaptureInput { | |
31 public: | |
32 // These methods do not lock internally and must be called sequentially. | |
33 // If your application switches input sources synchronization must be done | |
34 // externally to make sure that any old frames are not delivered concurrently. | |
35 virtual void IncomingCapturedFrame(const VideoFrame& video_frame) = 0; | |
36 | |
37 protected: | |
38 virtual ~VideoCaptureInput() {} | |
39 }; | |
40 | |
41 class VideoSendStream { | 30 class VideoSendStream { |
42 public: | 31 public: |
43 struct StreamStats { | 32 struct StreamStats { |
44 std::string ToString() const; | 33 std::string ToString() const; |
45 | 34 |
46 FrameCounts frame_counts; | 35 FrameCounts frame_counts; |
47 bool is_rtx = false; | 36 bool is_rtx = false; |
48 int width = 0; | 37 int width = 0; |
49 int height = 0; | 38 int height = 0; |
50 // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer. | 39 // TODO(holmer): Move bitrate_bps out to the webrtc::Call layer. |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 Config(const Config&) = default; | 175 Config(const Config&) = default; |
187 }; | 176 }; |
188 | 177 |
189 // Starts stream activity. | 178 // Starts stream activity. |
190 // When a stream is active, it can receive, process and deliver packets. | 179 // When a stream is active, it can receive, process and deliver packets. |
191 virtual void Start() = 0; | 180 virtual void Start() = 0; |
192 // Stops stream activity. | 181 // Stops stream activity. |
193 // When a stream is stopped, it can't receive, process or deliver packets. | 182 // When a stream is stopped, it can't receive, process or deliver packets. |
194 virtual void Stop() = 0; | 183 virtual void Stop() = 0; |
195 | 184 |
196 // Gets interface used to insert captured frames. Valid as long as the | 185 virtual void SetSource( |
197 // VideoSendStream is valid. | 186 rtc::VideoSourceInterface<webrtc::VideoFrame>* source) = 0; |
198 virtual VideoCaptureInput* Input() = 0; | |
199 | 187 |
200 // Set which streams to send. Must have at least as many SSRCs as configured | 188 // Set which streams to send. Must have at least as many SSRCs as configured |
201 // in the config. Encoder settings are passed on to the encoder instance along | 189 // in the config. Encoder settings are passed on to the encoder instance along |
202 // with the VideoStream settings. | 190 // with the VideoStream settings. |
203 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; | 191 virtual void ReconfigureVideoEncoder(VideoEncoderConfig config) = 0; |
204 | 192 |
205 virtual Stats GetStats() = 0; | 193 virtual Stats GetStats() = 0; |
206 | 194 |
207 protected: | 195 protected: |
208 virtual ~VideoSendStream() {} | 196 virtual ~VideoSendStream() {} |
209 }; | 197 }; |
210 | 198 |
211 } // namespace webrtc | 199 } // namespace webrtc |
212 | 200 |
213 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 201 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
OLD | NEW |