Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: webrtc/api/mediastreaminterface.h

Issue 2964863002: Change VideoTrack implementation to invoke VideoTrackSourceInterface::AddOrUpdateSink on wt (Closed)
Patch Set: Changed VideoTrack to invoke changing the sink wants on the worker thread. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/ortc/ortcfactory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // Live or ended. A track will never be live again after becoming ended. 99 // Live or ended. A track will never be live again after becoming ended.
100 virtual TrackState state() const = 0; 100 virtual TrackState state() const = 0;
101 101
102 protected: 102 protected:
103 virtual ~MediaStreamTrackInterface() {} 103 virtual ~MediaStreamTrackInterface() {}
104 }; 104 };
105 105
106 // VideoTrackSourceInterface is a reference counted source used for 106 // VideoTrackSourceInterface is a reference counted source used for
107 // VideoTracks. The same source can be used by multiple VideoTracks. 107 // VideoTracks. The same source can be used by multiple VideoTracks.
108 // VideoTrackSourceInterface is designed to be invoked on the signaling thread
109 // except for rtc::VideoSourceInterface<VideoFrame> methods that will be invoked
110 // on the worker thread via a VideoTrack. A custom implementation of a source
111 // can inherit AdaptedVideoTrackSource instead of directly implementing this
112 // interface.
108 class VideoTrackSourceInterface 113 class VideoTrackSourceInterface
109 : public MediaSourceInterface, 114 : public MediaSourceInterface,
110 public rtc::VideoSourceInterface<VideoFrame> { 115 public rtc::VideoSourceInterface<VideoFrame> {
111 public: 116 public:
112 struct Stats { 117 struct Stats {
113 // Original size of captured frame, before video adaptation. 118 // Original size of captured frame, before video adaptation.
114 int input_width; 119 int input_width;
115 int input_height; 120 int input_height;
116 }; 121 };
117 122
(...skipping 14 matching lines...) Expand all
132 // Returns false if no stats are available, e.g, for a remote source, or a 137 // Returns false if no stats are available, e.g, for a remote source, or a
133 // source which has not seen its first frame yet. 138 // source which has not seen its first frame yet.
134 // 139 //
135 // Implementation should avoid blocking. 140 // Implementation should avoid blocking.
136 virtual bool GetStats(Stats* stats) = 0; 141 virtual bool GetStats(Stats* stats) = 0;
137 142
138 protected: 143 protected:
139 virtual ~VideoTrackSourceInterface() {} 144 virtual ~VideoTrackSourceInterface() {}
140 }; 145 };
141 146
147 // VideoTrackInterface is designed to be invoked on the signaling thread except
148 // for rtc::VideoSourceInterface<VideoFrame> methods that must be invoked
149 // on the worker thread.
150 // PeerConnectionFactory::CreateVideoTrack can be used for creating a VideoTrack
151 // that ensures thread safety and that all methods are called on the right
152 // thread.
142 class VideoTrackInterface 153 class VideoTrackInterface
143 : public MediaStreamTrackInterface, 154 : public MediaStreamTrackInterface,
144 public rtc::VideoSourceInterface<VideoFrame> { 155 public rtc::VideoSourceInterface<VideoFrame> {
145 public: 156 public:
146 // Video track content hint, used to override the source is_screencast 157 // Video track content hint, used to override the source is_screencast
147 // property. 158 // property.
148 // See https://crbug.com/653531 and https://github.com/WICG/mst-content-hint. 159 // See https://crbug.com/653531 and https://github.com/WICG/mst-content-hint.
149 enum class ContentHint { kNone, kFluid, kDetailed }; 160 enum class ContentHint { kNone, kFluid, kDetailed };
150 161
151 // Register a video sink for this track. Used to connect the track to the
152 // underlying video engine.
153 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
154 const rtc::VideoSinkWants& wants) override {}
155 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
156
157 virtual VideoTrackSourceInterface* GetSource() const = 0; 162 virtual VideoTrackSourceInterface* GetSource() const = 0;
158 163
159 virtual ContentHint content_hint() const { return ContentHint::kNone; } 164 virtual ContentHint content_hint() const { return ContentHint::kNone; }
160 virtual void set_content_hint(ContentHint hint) {} 165 virtual void set_content_hint(ContentHint hint) {}
161 166
162 protected: 167 protected:
163 virtual ~VideoTrackInterface() {} 168 virtual ~VideoTrackInterface() {}
164 }; 169 };
165 170
166 // Interface for receiving audio data from a AudioTrack. 171 // Interface for receiving audio data from a AudioTrack.
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; 302 virtual bool RemoveTrack(AudioTrackInterface* track) = 0;
298 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; 303 virtual bool RemoveTrack(VideoTrackInterface* track) = 0;
299 304
300 protected: 305 protected:
301 virtual ~MediaStreamInterface() {} 306 virtual ~MediaStreamInterface() {}
302 }; 307 };
303 308
304 } // namespace webrtc 309 } // namespace webrtc
305 310
306 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_ 311 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/ortc/ortcfactory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698