Chromium Code Reviews| 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/transport.h" |
| 22 #include "webrtc/video_renderer.h" | 22 #include "webrtc/video_renderer.h" |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 | 25 |
| 26 class FrameEncodeTimeCallback; | |
| 26 class LoadObserver; | 27 class LoadObserver; |
| 27 class VideoEncoder; | 28 class VideoEncoder; |
| 28 | 29 |
| 30 class EncodingTimeObserver { | |
| 31 public: | |
| 32 virtual ~EncodingTimeObserver() {} | |
| 33 | |
| 34 virtual void OnEncodedFrame(const VideoFrame& frame, int encode_time_ms) = 0; | |
| 35 }; | |
| 36 | |
| 29 // Class to deliver captured frame to the video send stream. | 37 // Class to deliver captured frame to the video send stream. |
| 30 class VideoCaptureInput { | 38 class VideoCaptureInput { |
| 31 public: | 39 public: |
| 32 // These methods do not lock internally and must be called sequentially. | 40 // These methods do not lock internally and must be called sequentially. |
| 33 // If your application switches input sources synchronization must be done | 41 // If your application switches input sources synchronization must be done |
| 34 // externally to make sure that any old frames are not delivered concurrently. | 42 // externally to make sure that any old frames are not delivered concurrently. |
| 35 virtual void IncomingCapturedFrame(const VideoFrame& video_frame) = 0; | 43 virtual void IncomingCapturedFrame(const VideoFrame& video_frame) = 0; |
| 36 | 44 |
| 37 protected: | 45 protected: |
| 38 virtual ~VideoCaptureInput() {} | 46 virtual ~VideoCaptureInput() {} |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 int render_delay_ms = 0; | 153 int render_delay_ms = 0; |
| 146 | 154 |
| 147 // Target delay in milliseconds. A positive value indicates this stream is | 155 // Target delay in milliseconds. A positive value indicates this stream is |
| 148 // used for streaming instead of a real-time call. | 156 // used for streaming instead of a real-time call. |
| 149 int target_delay_ms = 0; | 157 int target_delay_ms = 0; |
| 150 | 158 |
| 151 // True if the stream should be suspended when the available bitrate fall | 159 // True if the stream should be suspended when the available bitrate fall |
| 152 // below the minimum configured bitrate. If this variable is false, the | 160 // below the minimum configured bitrate. If this variable is false, the |
| 153 // stream may send at a rate higher than the estimated available bitrate. | 161 // stream may send at a rate higher than the estimated available bitrate. |
| 154 bool suspend_below_min_bitrate = false; | 162 bool suspend_below_min_bitrate = false; |
| 163 | |
| 164 // Called for each encoded frame. Passes the total time spent on encoding. | |
|
pbos-webrtc
2015/09/30 12:48:31
// TODO(ivica): Consolidate with post_encode_callb
ivica
2015/09/30 13:18:04
Done.
| |
| 165 EncodingTimeObserver* encoding_time_observer = nullptr; | |
| 155 }; | 166 }; |
| 156 | 167 |
| 157 // Gets interface used to insert captured frames. Valid as long as the | 168 // Gets interface used to insert captured frames. Valid as long as the |
| 158 // VideoSendStream is valid. | 169 // VideoSendStream is valid. |
| 159 virtual VideoCaptureInput* Input() = 0; | 170 virtual VideoCaptureInput* Input() = 0; |
| 160 | 171 |
| 161 // Set which streams to send. Must have at least as many SSRCs as configured | 172 // Set which streams to send. Must have at least as many SSRCs as configured |
| 162 // in the config. Encoder settings are passed on to the encoder instance along | 173 // in the config. Encoder settings are passed on to the encoder instance along |
| 163 // with the VideoStream settings. | 174 // with the VideoStream settings. |
| 164 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; | 175 virtual bool ReconfigureVideoEncoder(const VideoEncoderConfig& config) = 0; |
| 165 | 176 |
| 166 virtual Stats GetStats() = 0; | 177 virtual Stats GetStats() = 0; |
| 167 }; | 178 }; |
| 168 | 179 |
| 169 } // namespace webrtc | 180 } // namespace webrtc |
| 170 | 181 |
| 171 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ | 182 #endif // WEBRTC_VIDEO_SEND_STREAM_H_ |
| OLD | NEW |