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

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

Issue 1827023002: Get VideoCapturer stats via VideoTrackSourceInterface in StatsCollector, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments from Peter and Taylor. Created 4 years, 8 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/api/statscollector.h » ('j') | webrtc/api/videocapturertracksource.cc » ('J')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 public NotifierInterface { 80 public NotifierInterface {
81 public: 81 public:
82 enum TrackState { 82 enum TrackState {
83 kLive, 83 kLive,
84 kEnded, 84 kEnded,
85 }; 85 };
86 86
87 static const char kAudioKind[]; 87 static const char kAudioKind[];
88 static const char kVideoKind[]; 88 static const char kVideoKind[];
89 89
90 // The kind() method must return kAudioKind only if the object is a
91 // subclass of AudioTrackInterface, and kVideoKind only if the
92 // object is a subclass of VideoTrackInterface. It is typically used
93 // to protect a static_cast<> to the corresponding subclass.
90 virtual std::string kind() const = 0; 94 virtual std::string kind() const = 0;
91 virtual std::string id() const = 0; 95 virtual std::string id() const = 0;
92 virtual bool enabled() const = 0; 96 virtual bool enabled() const = 0;
93 virtual TrackState state() const = 0; 97 virtual TrackState state() const = 0;
94 virtual bool set_enabled(bool enable) = 0; 98 virtual bool set_enabled(bool enable) = 0;
95 99
96 protected: 100 protected:
97 virtual ~MediaStreamTrackInterface() {} 101 virtual ~MediaStreamTrackInterface() {}
98 }; 102 };
99 103
100 // VideoTrackSourceInterface is a reference counted source used for VideoTracks. 104 // VideoTrackSourceInterface is a reference counted source used for VideoTracks.
101 // The same source can be used in multiple VideoTracks. 105 // The same source can be used in multiple VideoTracks.
102 class VideoTrackSourceInterface 106 class VideoTrackSourceInterface
103 : public MediaSourceInterface, 107 : public MediaSourceInterface,
104 public rtc::VideoSourceInterface<cricket::VideoFrame> { 108 public rtc::VideoSourceInterface<cricket::VideoFrame> {
105 public: 109 public:
110 struct Stats {
111 // Original frame size, before video adaptation.
112 int input_width;
113 int input_height;
114 };
106 // Get access to the source implementation of cricket::VideoCapturer. 115 // Get access to the source implementation of cricket::VideoCapturer.
107 // This can be used for receiving frames and state notifications. 116 // This can be used for receiving frames and state notifications.
108 // But it should not be used for starting or stopping capturing. 117 // But it should not be used for starting or stopping capturing.
109 // TODO(perkj): We are currently trying to replace all internal use of 118 // TODO(perkj): We are currently trying to replace all internal use of
110 // cricket::VideoCapturer with rtc::VideoSourceInterface. Once that 119 // cricket::VideoCapturer with rtc::VideoSourceInterface. Once that
111 // refactoring is done, 120 // refactoring is done,
112 // remove this method. 121 // remove this method.
113 virtual cricket::VideoCapturer* GetVideoCapturer() = 0; 122 virtual cricket::VideoCapturer* GetVideoCapturer() = 0;
114 123
115 virtual void Stop() = 0; 124 virtual void Stop() = 0;
116 virtual void Restart() = 0; 125 virtual void Restart() = 0;
117 126
118 // Indicates that parameters suitable for screencasts should be automatically 127 // Indicates that parameters suitable for screencasts should be automatically
119 // applied to RtpSenders. 128 // applied to RtpSenders.
120 // TODO(perkj): Remove these once all known applications have moved to 129 // TODO(perkj): Remove these once all known applications have moved to
121 // explicitly setting suitable parameters for screencasts and dont' need this 130 // explicitly setting suitable parameters for screencasts and dont' need this
122 // implicit behavior. 131 // implicit behavior.
123 virtual bool is_screencast() const = 0; 132 virtual bool is_screencast() const = 0;
124 133
125 // Indicates that the encoder should denoise the video before encoding it. 134 // Indicates that the encoder should denoise the video before encoding it.
126 // TODO(perkj): Remove this once denoising is done by the source, and not by 135 // TODO(perkj): Remove this once denoising is done by the source, and not by
127 // the encoder. 136 // the encoder.
128 virtual bool needs_denoising() const = 0; 137 virtual bool needs_denoising() const = 0;
129 138
139 virtual bool GetStats(Stats* stats) = 0;
pbos-webrtc 2016/03/31 11:50:46 I assume this is intended to fail if we haven't go
perkj_webrtc 2016/03/31 11:57:30 prefer void.
nisse-webrtc 2016/03/31 12:07:27 What should a VideoTrackSource (used for remote so
nisse-webrtc 2016/03/31 12:07:27 It's intended to fail if the source doesn't have a
perkj_webrtc 2016/03/31 12:13:31 I see. Ok - please then document when this returns
140
130 protected: 141 protected:
131 virtual ~VideoTrackSourceInterface() {} 142 virtual ~VideoTrackSourceInterface() {}
132 }; 143 };
133 144
134 class VideoTrackInterface 145 class VideoTrackInterface
135 : public MediaStreamTrackInterface, 146 : public MediaStreamTrackInterface,
136 public rtc::VideoSourceInterface<cricket::VideoFrame> { 147 public rtc::VideoSourceInterface<cricket::VideoFrame> {
137 public: 148 public:
138 // Register a video sink for this track. 149 // Register a video sink for this track.
139 void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink, 150 void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; 274 virtual bool RemoveTrack(AudioTrackInterface* track) = 0;
264 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; 275 virtual bool RemoveTrack(VideoTrackInterface* track) = 0;
265 276
266 protected: 277 protected:
267 virtual ~MediaStreamInterface() {} 278 virtual ~MediaStreamInterface() {}
268 }; 279 };
269 280
270 } // namespace webrtc 281 } // namespace webrtc
271 282
272 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_ 283 #endif // WEBRTC_API_MEDIASTREAMINTERFACE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/statscollector.h » ('j') | webrtc/api/videocapturertracksource.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698