| 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 "ui/gfx/geometry/rect_f.h" | 17 #include "ui/gfx/geometry/rect_f.h" |
| 17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 18 | 19 |
| 19 // Dictates which type of media playback is being initialized. | 20 // Dictates which type of media playback is being initialized. |
| 20 enum MediaPlayerHostMsg_Initialize_Type { | 21 enum MediaPlayerHostMsg_Initialize_Type { |
| 21 MEDIA_PLAYER_TYPE_URL, | 22 MEDIA_PLAYER_TYPE_URL, |
| 22 MEDIA_PLAYER_TYPE_MEDIA_SOURCE, | 23 MEDIA_PLAYER_TYPE_MEDIA_SOURCE, |
| 23 MEDIA_PLAYER_TYPE_REMOTE_ONLY, | 24 MEDIA_PLAYER_TYPE_REMOTE_ONLY, |
| 24 MEDIA_PLAYER_TYPE_LAST = MEDIA_PLAYER_TYPE_REMOTE_ONLY | 25 MEDIA_PLAYER_TYPE_LAST = MEDIA_PLAYER_TYPE_REMOTE_ONLY |
| 25 }; | 26 }; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Returns true if the geometry has been changed since the last call. | 73 // Returns true if the geometry has been changed since the last call. |
| 73 virtual bool UpdateBoundaryRectangle() = 0; | 74 virtual bool UpdateBoundaryRectangle() = 0; |
| 74 | 75 |
| 75 virtual const gfx::RectF GetBoundaryRectangle() = 0; | 76 virtual const gfx::RectF GetBoundaryRectangle() = 0; |
| 76 #endif | 77 #endif |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 class RendererMediaPlayerManagerInterface { | 80 class RendererMediaPlayerManagerInterface { |
| 80 public: | 81 public: |
| 81 // Initializes a MediaPlayerAndroid object in browser process. | 82 // Initializes a MediaPlayerAndroid object in browser process. |
| 82 virtual void Initialize(MediaPlayerHostMsg_Initialize_Type type, | 83 virtual void Initialize( |
| 83 int player_id, | 84 MediaPlayerHostMsg_Initialize_Type type, |
| 84 const GURL& url, | 85 int player_id, |
| 85 const GURL& first_party_for_cookies, | 86 const GURL& url, |
| 86 int demuxer_client_id, | 87 const GURL& first_party_for_cookies, |
| 87 const GURL& frame_url, | 88 int demuxer_client_id, |
| 88 bool allow_credentials) = 0; | 89 const GURL& frame_url, |
| 90 bool allow_credentials, |
| 91 media::WebMediaPlayerDelegate::Observer* observer) = 0; |
| 89 | 92 |
| 90 // Starts the player. | 93 // Starts the player. |
| 91 virtual void Start(int player_id) = 0; | 94 virtual void Start(int player_id) = 0; |
| 92 | 95 |
| 93 // Pauses the player. | 96 // Pauses the player. |
| 94 // is_media_related_action should be true if this pause is coming from an | 97 // is_media_related_action should be true if this pause is coming from an |
| 95 // an action that explicitly pauses the video (user pressing pause, JS, etc.) | 98 // an action that explicitly pauses the video (user pressing pause, JS, etc.) |
| 96 // Otherwise it should be false if Pause is being called due to other reasons | 99 // Otherwise it should be false if Pause is being called due to other reasons |
| 97 // (cleanup, freeing resources, etc.) | 100 // (cleanup, freeing resources, etc.) |
| 98 virtual void Pause(int player_id, bool is_media_related_action) = 0; | 101 virtual void Pause(int player_id, bool is_media_related_action) = 0; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 119 virtual void RequestRemotePlaybackControl(int player_id) = 0; | 122 virtual void RequestRemotePlaybackControl(int player_id) = 0; |
| 120 | 123 |
| 121 // Registers and unregisters a RendererMediaPlayerInterface object. | 124 // Registers and unregisters a RendererMediaPlayerInterface object. |
| 122 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; | 125 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; |
| 123 virtual void UnregisterMediaPlayer(int player_id) = 0; | 126 virtual void UnregisterMediaPlayer(int player_id) = 0; |
| 124 }; | 127 }; |
| 125 | 128 |
| 126 } // namespace media | 129 } // namespace media |
| 127 | 130 |
| 128 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ | 131 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ |
| OLD | NEW |