| 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_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ | 5 #ifndef MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ |
| 6 #define MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ | 6 #define MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ |
| 7 | 7 |
| 8 // This file contains interfaces modeled after classes in | 8 // This file contains interfaces modeled after classes in |
| 9 // content/renderer/media/android for the purposes of letting clases in | 9 // content/renderer/media/android for the purposes of letting clases in |
| 10 // this directory implement and/or interact with those classes. | 10 // this directory implement and/or interact with those classes. |
| 11 // It's a stop-gap used to support cast on android until a better solution | 11 // It's a stop-gap used to support cast on android until a better solution |
| 12 // is implemented: crbug/575276 | 12 // is implemented: crbug/575276 |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "media/blink/webmediaplayer_delegate.h" | 16 #include "media/blink/webmediaplayer_delegate.h" |
| 17 #include "ui/gfx/geometry/rect_f.h" | 17 #include "ui/gfx/geometry/rect_f.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 namespace blink { |
| 21 enum class WebRemotePlaybackAvailability; |
| 22 } |
| 23 |
| 20 // Dictates which type of media playback is being initialized. | 24 // Dictates which type of media playback is being initialized. |
| 21 enum MediaPlayerHostMsg_Initialize_Type { | 25 enum MediaPlayerHostMsg_Initialize_Type { |
| 22 MEDIA_PLAYER_TYPE_URL, | 26 MEDIA_PLAYER_TYPE_URL, |
| 23 MEDIA_PLAYER_TYPE_REMOTE_ONLY, | 27 MEDIA_PLAYER_TYPE_REMOTE_ONLY, |
| 24 MEDIA_PLAYER_TYPE_LAST = MEDIA_PLAYER_TYPE_REMOTE_ONLY | 28 MEDIA_PLAYER_TYPE_LAST = MEDIA_PLAYER_TYPE_REMOTE_ONLY |
| 25 }; | 29 }; |
| 26 | 30 |
| 27 namespace media { | 31 namespace media { |
| 28 | 32 |
| 29 class RendererMediaPlayerInterface { | 33 class RendererMediaPlayerInterface { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 | 51 |
| 48 // Functions called when media player status changes. | 52 // Functions called when media player status changes. |
| 49 virtual void OnConnectedToRemoteDevice( | 53 virtual void OnConnectedToRemoteDevice( |
| 50 const std::string& remote_playback_message) = 0; | 54 const std::string& remote_playback_message) = 0; |
| 51 virtual void OnDisconnectedFromRemoteDevice() = 0; | 55 virtual void OnDisconnectedFromRemoteDevice() = 0; |
| 52 virtual void OnRemotePlaybackStarted() = 0; | 56 virtual void OnRemotePlaybackStarted() = 0; |
| 53 virtual void OnCancelledRemotePlaybackRequest() = 0; | 57 virtual void OnCancelledRemotePlaybackRequest() = 0; |
| 54 virtual void OnDidExitFullscreen() = 0; | 58 virtual void OnDidExitFullscreen() = 0; |
| 55 virtual void OnMediaPlayerPlay() = 0; | 59 virtual void OnMediaPlayerPlay() = 0; |
| 56 virtual void OnMediaPlayerPause() = 0; | 60 virtual void OnMediaPlayerPause() = 0; |
| 57 virtual void OnRemoteRouteAvailabilityChanged(bool routes_available) = 0; | 61 virtual void OnRemoteRouteAvailabilityChanged( |
| 62 blink::WebRemotePlaybackAvailability availability) = 0; |
| 58 | 63 |
| 59 // Getters of playback state. | 64 // Getters of playback state. |
| 60 virtual bool paused() const = 0; | 65 virtual bool paused() const = 0; |
| 61 | 66 |
| 62 // True if the loaded media has a playable video track. | 67 // True if the loaded media has a playable video track. |
| 63 virtual bool hasVideo() const = 0; | 68 virtual bool hasVideo() const = 0; |
| 64 | 69 |
| 65 // This function is called by the RendererMediaPlayerManager to pause the | 70 // This function is called by the RendererMediaPlayerManager to pause the |
| 66 // video and release the media player and surface texture when we switch tabs. | 71 // video and release the media player and surface texture when we switch tabs. |
| 67 // However, the actual GlTexture is not released to keep the video screenshot. | 72 // However, the actual GlTexture is not released to keep the video screenshot. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual void RequestRemotePlaybackStop(int player_id) = 0; | 119 virtual void RequestRemotePlaybackStop(int player_id) = 0; |
| 115 | 120 |
| 116 // Registers and unregisters a RendererMediaPlayerInterface object. | 121 // Registers and unregisters a RendererMediaPlayerInterface object. |
| 117 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; | 122 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; |
| 118 virtual void UnregisterMediaPlayer(int player_id) = 0; | 123 virtual void UnregisterMediaPlayer(int player_id) = 0; |
| 119 }; | 124 }; |
| 120 | 125 |
| 121 } // namespace media | 126 } // namespace media |
| 122 | 127 |
| 123 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ | 128 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ |
| OLD | NEW |