| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 scoped_refptr<RemotingSourceImpl> remoting_source); | 28 scoped_refptr<RemotingSourceImpl> remoting_source); |
| 29 ~RemotingRendererController() override; | 29 ~RemotingRendererController() override; |
| 30 | 30 |
| 31 // RemotingSourceImpl::Client implemenations. | 31 // RemotingSourceImpl::Client implemenations. |
| 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 OnStablyFilledViewportChanged(bool is_mostly_filling_viewport) override; |
| 38 void OnSetCdm(CdmContext* cdm_context) override; | 39 void OnSetCdm(CdmContext* cdm_context) override; |
| 39 void OnMetadataChanged(const PipelineMetadata& metadata) override; | 40 void OnMetadataChanged(const PipelineMetadata& metadata) override; |
| 40 | 41 |
| 41 void SetSwitchRendererCallback(const base::Closure& cb); | 42 void SetSwitchRendererCallback(const base::Closure& cb); |
| 42 | 43 |
| 43 base::WeakPtr<RemotingRendererController> GetWeakPtr() { | 44 base::WeakPtr<RemotingRendererController> GetWeakPtr() { |
| 44 return weak_factory_.GetWeakPtr(); | 45 return weak_factory_.GetWeakPtr(); |
| 45 } | 46 } |
| 46 | 47 |
| 47 // Used by RemotingRendererFactory to query whether to create Media Remoting | 48 // Used by RemotingRendererFactory to query whether to create Media Remoting |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Indicates whether remoting is started. | 97 // Indicates whether remoting is started. |
| 97 bool remote_rendering_started_ = false; | 98 bool remote_rendering_started_ = false; |
| 98 | 99 |
| 99 // Indicates whether audio or video is encrypted. | 100 // Indicates whether audio or video is encrypted. |
| 100 bool is_encrypted_ = false; | 101 bool is_encrypted_ = false; |
| 101 | 102 |
| 102 // Current audio/video config. | 103 // Current audio/video config. |
| 103 VideoDecoderConfig video_decoder_config_; | 104 VideoDecoderConfig video_decoder_config_; |
| 104 AudioDecoderConfig audio_decoder_config_; | 105 AudioDecoderConfig audio_decoder_config_; |
| 105 | 106 |
| 107 // Indicates whether video fills most of the viewport. |
| 108 bool is_mostly_filling_viewport_ = false; |
| 109 |
| 106 // The callback to switch the media renderer. | 110 // The callback to switch the media renderer. |
| 107 base::Closure switch_renderer_cb_; | 111 base::Closure switch_renderer_cb_; |
| 108 | 112 |
| 109 // This is initially the RemotingSourceImpl passed to the ctor, and might be | 113 // This is initially the RemotingSourceImpl passed to the ctor, and might be |
| 110 // replaced with a different instance later if OnSetCdm() is called. | 114 // replaced with a different instance later if OnSetCdm() is called. |
| 111 scoped_refptr<RemotingSourceImpl> remoting_source_; | 115 scoped_refptr<RemotingSourceImpl> remoting_source_; |
| 112 | 116 |
| 113 // This is used to check all the methods are called on the current thread in | 117 // This is used to check all the methods are called on the current thread in |
| 114 // debug builds. | 118 // debug builds. |
| 115 base::ThreadChecker thread_checker_; | 119 base::ThreadChecker thread_checker_; |
| 116 | 120 |
| 117 PipelineMetadata pipeline_metadata_; | 121 PipelineMetadata pipeline_metadata_; |
| 118 | 122 |
| 119 base::WeakPtrFactory<RemotingRendererController> weak_factory_; | 123 base::WeakPtrFactory<RemotingRendererController> weak_factory_; |
| 120 | 124 |
| 121 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); | 125 DISALLOW_COPY_AND_ASSIGN(RemotingRendererController); |
| 122 }; | 126 }; |
| 123 | 127 |
| 124 } // namespace media | 128 } // namespace media |
| 125 | 129 |
| 126 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ | 130 #endif // MEDIA_REMOTING_REMOTING_RENDERER_CONTROLLER_H_ |
| OLD | NEW |