OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_FILTERS_REMOTING_CONTROLLER_H_ |
| 6 #define MEDIA_FILTERS_REMOTING_CONTROLLER_H_ |
| 7 |
| 8 // This class does the following: |
| 9 // 1) Receive notification from Remoter; |
| 10 // 3) Make decision and notify the WebMediaPlayerImpl when to switch the |
| 11 // media renderer. |
| 12 // |
| 13 // It is own by media::PipelineController, and may be created in two places: |
| 14 // 1) In CdmSessionAdapter::CreateCdm(). Its ownership is passed to |
| 15 // media::PopelineController later. |
| 16 // TODO(xjz): The implementation for encrypted content case will be added in a |
| 17 // soon-upcoming change. |
| 18 // 2) In media::PipelineController if is not created before. |
| 19 // |
| 20 // TODO(xjz): Mojo service bindings will be added in a soon-upcoming change. |
| 21 namespace media { |
| 22 |
| 23 class PipelineController; |
| 24 |
| 25 class RemotingController { |
| 26 public: |
| 27 RemotingController(); |
| 28 // |pipeline_controller| outlives this class. |
| 29 explicit RemotingController(PipelineController* pipeline_controller); |
| 30 ~RemotingController(); |
| 31 |
| 32 // Notification of the remoting sink availability from Remoter. |
| 33 void OnSinkAvailable(); |
| 34 void OnSinkGone(); |
| 35 |
| 36 // Setters. |
| 37 void SetFullscreenMode(bool is_fullscreen); |
| 38 void SetIsEncryptedContent(); |
| 39 void SetPipelineController(PipelineController* pipeline_controller); |
| 40 |
| 41 // Starts/Stops remoting according to |use_remoting_renderer_|, and returns |
| 42 // whether to use remoting renderer. This is used to tell PipelineController |
| 43 // which renderer should be used. |
| 44 bool ShouldUseRemotingRenderer(); |
| 45 |
| 46 private: |
| 47 bool isVideoDecoderSupported(); |
| 48 bool isAudioDecoderSupported(); |
| 49 |
| 50 // Makes decision on which renderer should be used. |
| 51 void Update(); |
| 52 |
| 53 // Indicates whether this media element or its ancestor enters full screen. |
| 54 bool is_fullscreen_; |
| 55 |
| 56 // Indicates whether WebMediaPlayerImpl encounters encrypted content. |
| 57 bool is_encrypted_content_; |
| 58 |
| 59 // Indicates the remoting sink availablity. |
| 60 bool is_sink_available_; |
| 61 |
| 62 // Indicates whether we should use remoting renderer. |
| 63 bool use_remoting_renderer_; |
| 64 |
| 65 PipelineController* pipeline_controller_; |
| 66 }; |
| 67 |
| 68 } // namespace media |
| 69 |
| 70 #endif // MEDIA_FILTERS_REMOTING_CONTROLLER_H_ |
OLD | NEW |