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

Side by Side Diff: media/remoting/remoting_renderer_controller.h

Issue 2587613002: Media Remoting: Switch to remoting only when media is playing. (Closed)
Patch Set: Addressed comments. Created 4 years 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 | « media/blink/webmediaplayer_impl.cc ('k') | media/remoting/remoting_renderer_controller.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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ 5 #ifndef MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_
6 #define MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ 6 #define MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "media/base/media_observer.h" 10 #include "media/base/media_observer.h"
(...skipping 21 matching lines...) Expand all
32 void OnStarted(bool success) override; 32 void OnStarted(bool success) override;
33 void OnSessionStateChanged() override; 33 void OnSessionStateChanged() override;
34 34
35 // MediaObserver implementations. 35 // MediaObserver implementations.
36 void OnEnteredFullscreen() override; 36 void OnEnteredFullscreen() override;
37 void OnExitedFullscreen() override; 37 void OnExitedFullscreen() override;
38 void OnBecameDominantVisibleContent(bool is_dominant) override; 38 void OnBecameDominantVisibleContent(bool is_dominant) override;
39 void OnSetCdm(CdmContext* cdm_context) override; 39 void OnSetCdm(CdmContext* cdm_context) override;
40 void OnMetadataChanged(const PipelineMetadata& metadata) override; 40 void OnMetadataChanged(const PipelineMetadata& metadata) override;
41 void OnRemotePlaybackDisabled(bool disabled) override; 41 void OnRemotePlaybackDisabled(bool disabled) override;
42 void OnPlaying() override;
43 void OnPaused() override;
42 44
43 void SetSwitchRendererCallback(const base::Closure& cb); 45 void SetSwitchRendererCallback(const base::Closure& cb);
44 void SetRemoteSinkAvailableChangedCallback( 46 void SetRemoteSinkAvailableChangedCallback(
45 const base::Callback<void(bool)>& cb); 47 const base::Callback<void(bool)>& cb);
46 48
47 base::WeakPtr<RemotingRendererController> GetWeakPtr() { 49 base::WeakPtr<RemotingRendererController> GetWeakPtr() {
48 return weak_factory_.GetWeakPtr(); 50 return weak_factory_.GetWeakPtr();
49 } 51 }
50 52
51 // Used by RemotingRendererFactory to query whether to create Media Remoting 53 // Used by RemotingRendererFactory to query whether to create Media Remoting
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // OnRemotePlaybackDisabled() at some point in the future. A web page 115 // OnRemotePlaybackDisabled() at some point in the future. A web page
114 // typically sets/removes the disableRemotePlayback attribute on a 116 // typically sets/removes the disableRemotePlayback attribute on a
115 // HTMLMediaElement to disable/enable remoting of its content. Please see the 117 // HTMLMediaElement to disable/enable remoting of its content. Please see the
116 // Remote Playback API spec for more details: 118 // Remote Playback API spec for more details:
117 // https://w3c.github.io/remote-playback 119 // https://w3c.github.io/remote-playback
118 bool is_remote_playback_disabled_ = true; 120 bool is_remote_playback_disabled_ = true;
119 121
120 // Indicates whether video is the dominant visible content in the tab. 122 // Indicates whether video is the dominant visible content in the tab.
121 bool is_dominant_content_ = false; 123 bool is_dominant_content_ = false;
122 124
125 // Indicates whether video is paused.
126 bool is_paused_ = true;
127
123 // The callback to switch the media renderer. 128 // The callback to switch the media renderer.
124 base::Closure switch_renderer_cb_; 129 base::Closure switch_renderer_cb_;
125 130
126 // Called when remoting sink availability is changed. 131 // Called when remoting sink availability is changed.
127 base::Callback<void(bool)> sink_available_changed_cb_; 132 base::Callback<void(bool)> sink_available_changed_cb_;
128 133
129 // This is initially the RemotingSourceImpl passed to the ctor, and might be 134 // This is initially the RemotingSourceImpl passed to the ctor, and might be
130 // replaced with a different instance later if OnSetCdm() is called. 135 // replaced with a different instance later if OnSetCdm() is called.
131 scoped_refptr<RemotingSourceImpl> remoting_source_; 136 scoped_refptr<RemotingSourceImpl> remoting_source_;
132 137
133 // This is used to check all the methods are called on the current thread in 138 // This is used to check all the methods are called on the current thread in
134 // debug builds. 139 // debug builds.
135 base::ThreadChecker thread_checker_; 140 base::ThreadChecker thread_checker_;
136 141
137 PipelineMetadata pipeline_metadata_; 142 PipelineMetadata pipeline_metadata_;
138 143
139 base::WeakPtrFactory<RemotingRendererController> weak_factory_; 144 base::WeakPtrFactory<RemotingRendererController> weak_factory_;
140 145
141 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); 146 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController);
142 }; 147 };
143 148
144 } // namespace media 149 } // namespace media
145 150
146 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ 151 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/remoting/remoting_renderer_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698