| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Live or ended. A track will never be live again after becoming ended. | 105 // Live or ended. A track will never be live again after becoming ended. |
| 106 virtual TrackState state() const = 0; | 106 virtual TrackState state() const = 0; |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 virtual ~MediaStreamTrackInterface() {} | 109 virtual ~MediaStreamTrackInterface() {} |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 // VideoTrackSourceInterface is a reference counted source used for | 112 // VideoTrackSourceInterface is a reference counted source used for |
| 113 // VideoTracks. The same source can be used by multiple VideoTracks. | 113 // VideoTracks. The same source can be used by multiple VideoTracks. |
| 114 // VideoTrackSourceInterface is designed to be invoked on the signaling thread |
| 115 // except for rtc::VideoSourceInterface<VideoFrame> methods that will be invoked |
| 116 // on the worker thread via a VideoTrack. A custom implementation of a source |
| 117 // can inherit AdaptedVideoTrackSource instead of directly implementing this |
| 118 // interface. |
| 114 class VideoTrackSourceInterface | 119 class VideoTrackSourceInterface |
| 115 : public MediaSourceInterface, | 120 : public MediaSourceInterface, |
| 116 public rtc::VideoSourceInterface<VideoFrame> { | 121 public rtc::VideoSourceInterface<VideoFrame> { |
| 117 public: | 122 public: |
| 118 struct Stats { | 123 struct Stats { |
| 119 // Original size of captured frame, before video adaptation. | 124 // Original size of captured frame, before video adaptation. |
| 120 int input_width; | 125 int input_width; |
| 121 int input_height; | 126 int input_height; |
| 122 }; | 127 }; |
| 123 | 128 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 138 // Returns false if no stats are available, e.g, for a remote source, or a | 143 // Returns false if no stats are available, e.g, for a remote source, or a |
| 139 // source which has not seen its first frame yet. | 144 // source which has not seen its first frame yet. |
| 140 // | 145 // |
| 141 // Implementation should avoid blocking. | 146 // Implementation should avoid blocking. |
| 142 virtual bool GetStats(Stats* stats) = 0; | 147 virtual bool GetStats(Stats* stats) = 0; |
| 143 | 148 |
| 144 protected: | 149 protected: |
| 145 virtual ~VideoTrackSourceInterface() {} | 150 virtual ~VideoTrackSourceInterface() {} |
| 146 }; | 151 }; |
| 147 | 152 |
| 153 // VideoTrackInterface is designed to be invoked on the signaling thread except |
| 154 // for rtc::VideoSourceInterface<VideoFrame> methods that must be invoked |
| 155 // on the worker thread. |
| 156 // PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack |
| 157 // that ensures thread safety and that all methods are called on the right |
| 158 // thread. |
| 148 class VideoTrackInterface | 159 class VideoTrackInterface |
| 149 : public MediaStreamTrackInterface, | 160 : public MediaStreamTrackInterface, |
| 150 public rtc::VideoSourceInterface<VideoFrame> { | 161 public rtc::VideoSourceInterface<VideoFrame> { |
| 151 public: | 162 public: |
| 152 // Video track content hint, used to override the source is_screencast | 163 // Video track content hint, used to override the source is_screencast |
| 153 // property. | 164 // property. |
| 154 // See https://crbug.com/653531 and https://github.com/WICG/mst-content-hint. | 165 // See https://crbug.com/653531 and https://github.com/WICG/mst-content-hint. |
| 155 enum class ContentHint { kNone, kFluid, kDetailed }; | 166 enum class ContentHint { kNone, kFluid, kDetailed }; |
| 156 | 167 |
| 157 // Register a video sink for this track. Used to connect the track to the | 168 // Register a video sink for this track. Used to connect the track to the |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; | 314 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; |
| 304 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; | 315 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; |
| 305 | 316 |
| 306 protected: | 317 protected: |
| 307 virtual ~MediaStreamInterface() {} | 318 virtual ~MediaStreamInterface() {} |
| 308 }; | 319 }; |
| 309 | 320 |
| 310 } // namespace webrtc | 321 } // namespace webrtc |
| 311 | 322 |
| 312 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_ | 323 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_ |
| OLD | NEW |