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

Unified Diff: content/renderer/media/media_stream_video_source.h

Issue 2365223002: Video Capture: Allow suspension of individual devices. (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_video_source.h
diff --git a/content/renderer/media/media_stream_video_source.h b/content/renderer/media/media_stream_video_source.h
index 3d79aeafb776d0fe9c84c08615d4f688df848e34..ebed2e358c1b88fb95fc870545544573c66172dc 100644
--- a/content/renderer/media/media_stream_video_source.h
+++ b/content/renderer/media/media_stream_video_source.h
@@ -71,11 +71,21 @@ class CONTENT_EXPORT MediaStreamVideoSource
const ConstraintsCallback& callback);
void RemoveTrack(MediaStreamVideoTrack* track);
+ // Called by |track| to notify the source whether it has any paths to a
+ // consuming endpoint.
+ void UpdateHasConsumers(MediaStreamVideoTrack* track, bool has_consumers);
chfremer 2016/09/27 00:54:59 As a reader unfamiliar with this class, I am confu
miu 2016/09/27 23:42:23 Done. Made the SetXXX() methods protected, renamed
+
void UpdateCapturingLinkSecure(MediaStreamVideoTrack* track, bool is_secure);
// Request underlying source to capture a new frame.
virtual void RequestRefreshFrame() {}
+ // Notify the underlying source whether there are one or more consumers
+ // present. When none are present, the source can stop delivering frames,
+ // giving it the option of running in an "idle" state to minimize resource
+ // usage.
+ virtual void SetHasConsumers(bool has_consumers) {}
+
// Notify underlying source if the capturing link is secure.
virtual void SetCapturingLinkSecured(bool is_secure) {}
@@ -183,6 +193,10 @@ class CONTENT_EXPORT MediaStreamVideoSource
// Tracks that currently are connected to this source.
std::vector<MediaStreamVideoTrack*> tracks_;
+ // Tracks that have no paths to a consuming endpoint, and so do not need
+ // frames delivered from the source.
+ std::vector<MediaStreamVideoTrack*> suspended_tracks_;
+
// This is used for tracking if all connected video sinks are secure.
SecureDisplayLinkTracker<MediaStreamVideoTrack> secure_tracker_;

Powered by Google App Engine
This is Rietveld 408576698