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/stream.h" |
| 21 #include "webrtc/transport.h" |
21 #include "webrtc/video_renderer.h" | 22 #include "webrtc/video_renderer.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 class VideoEncoder; | 26 class VideoEncoder; |
26 | 27 |
27 // Class to deliver captured frame to the video send stream. | 28 // Class to deliver captured frame to the video send stream. |
28 class VideoCaptureInput { | 29 class VideoCaptureInput { |
29 public: | 30 public: |
30 // These methods do not lock internally and must be called sequentially. | 31 // These methods do not lock internally and must be called sequentially. |
(...skipping 26 matching lines...) Expand all Loading... |
57 int encode_frame_rate = 0; | 58 int encode_frame_rate = 0; |
58 int avg_encode_time_ms = 0; | 59 int avg_encode_time_ms = 0; |
59 int encode_usage_percent = 0; | 60 int encode_usage_percent = 0; |
60 int target_media_bitrate_bps = 0; | 61 int target_media_bitrate_bps = 0; |
61 int media_bitrate_bps = 0; | 62 int media_bitrate_bps = 0; |
62 bool suspended = false; | 63 bool suspended = false; |
63 std::map<uint32_t, StreamStats> substreams; | 64 std::map<uint32_t, StreamStats> substreams; |
64 }; | 65 }; |
65 | 66 |
66 struct Config { | 67 struct Config { |
| 68 Config() = delete; |
| 69 explicit Config(newapi::Transport* send_transport) |
| 70 : send_transport(send_transport) {} |
| 71 |
67 std::string ToString() const; | 72 std::string ToString() const; |
68 | 73 |
69 struct EncoderSettings { | 74 struct EncoderSettings { |
70 std::string ToString() const; | 75 std::string ToString() const; |
71 | 76 |
72 std::string payload_name; | 77 std::string payload_name; |
73 int payload_type = -1; | 78 int payload_type = -1; |
74 | 79 |
75 // Uninitialized VideoEncoder instance to be used for encoding. Will be | 80 // Uninitialized VideoEncoder instance to be used for encoding. Will be |
76 // initialized from inside the VideoSendStream. | 81 // initialized from inside the VideoSendStream. |
(...skipping 26 matching lines...) Expand all Loading... |
103 std::vector<uint32_t> ssrcs; | 108 std::vector<uint32_t> ssrcs; |
104 | 109 |
105 // Payload type to use for the RTX stream. | 110 // Payload type to use for the RTX stream. |
106 int payload_type = -1; | 111 int payload_type = -1; |
107 } rtx; | 112 } rtx; |
108 | 113 |
109 // RTCP CNAME, see RFC 3550. | 114 // RTCP CNAME, see RFC 3550. |
110 std::string c_name; | 115 std::string c_name; |
111 } rtp; | 116 } rtp; |
112 | 117 |
| 118 // Transport for outgoing packets. |
| 119 newapi::Transport* send_transport = nullptr; |
| 120 |
113 // Called for each I420 frame before encoding the frame. Can be used for | 121 // Called for each I420 frame before encoding the frame. Can be used for |
114 // effects, snapshots etc. 'nullptr' disables the callback. | 122 // effects, snapshots etc. 'nullptr' disables the callback. |
115 I420FrameCallback* pre_encode_callback = nullptr; | 123 I420FrameCallback* pre_encode_callback = nullptr; |
116 | 124 |
117 // Called for each encoded frame, e.g. used for file storage. 'nullptr' | 125 // Called for each encoded frame, e.g. used for file storage. 'nullptr' |
118 // disables the callback. | 126 // disables the callback. |
119 EncodedFrameObserver* post_encode_callback = nullptr; | 127 EncodedFrameObserver* post_encode_callback = nullptr; |
120 | 128 |
121 // Renderer for local preview. The local renderer will be called even if | 129 // Renderer for local preview. The local renderer will be called even if |
122 // sending hasn't started. 'nullptr' disables local rendering. | 130 // sending hasn't started. 'nullptr' disables local rendering. |
(...skipping 22 matching lines...) Expand all Loading... |
145 // in the config. Encoder settings are passed on to the encoder instance along | 153 // in the config. Encoder settings are passed on to the encoder instance along |
146 // with the VideoStream settings. | 154 // with the VideoStream settings. |
147 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; | 155 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; |
148 | 156 |
149 virtual Stats GetStats() = 0; | 157 virtual Stats GetStats() = 0; |
150 }; | 158 }; |
151 | 159 |
152 } // namespace webrtc | 160 } // namespace webrtc |
153 | 161 |
154 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 162 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
OLD | NEW |