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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(MediaPlayerHostMsg_Initialize_Type type, |
83 int player_id, | 84 int player_id, |
84 const GURL& url, | 85 const GURL& url, |
85 const GURL& first_party_for_cookies, | 86 const GURL& first_party_for_cookies, |
86 int demuxer_client_id, | 87 int demuxer_client_id, |
87 const GURL& frame_url, | 88 const GURL& frame_url, |
88 bool allow_credentials) = 0; | 89 bool allow_credentials, |
| 90 int delegate_id) = 0; |
89 | 91 |
90 // Starts the player. | 92 // Starts the player. |
91 virtual void Start(int player_id) = 0; | 93 virtual void Start(int player_id) = 0; |
92 | 94 |
93 // Pauses the player. | 95 // Pauses the player. |
94 // is_media_related_action should be true if this pause is coming from an | 96 // 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.) | 97 // 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 | 98 // Otherwise it should be false if Pause is being called due to other reasons |
97 // (cleanup, freeing resources, etc.) | 99 // (cleanup, freeing resources, etc.) |
98 virtual void Pause(int player_id, bool is_media_related_action) = 0; | 100 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; | 121 virtual void RequestRemotePlaybackControl(int player_id) = 0; |
120 | 122 |
121 // Registers and unregisters a RendererMediaPlayerInterface object. | 123 // Registers and unregisters a RendererMediaPlayerInterface object. |
122 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; | 124 virtual int RegisterMediaPlayer(RendererMediaPlayerInterface* player) = 0; |
123 virtual void UnregisterMediaPlayer(int player_id) = 0; | 125 virtual void UnregisterMediaPlayer(int player_id) = 0; |
124 }; | 126 }; |
125 | 127 |
126 } // namespace media | 128 } // namespace media |
127 | 129 |
128 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ | 130 #endif // MEDIA_BLINK_RENDERER_MEDIA_PLAYER_INTERFACE_H_ |
OLD | NEW |