OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ | 5 #ifndef WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ |
6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ | 6 #define WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time.h" | 10 #include "base/time.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
12 #include "media/base/android/demuxer_stream_player_params.h" | 12 #include "media/base/android/demuxer_stream_player_params.h" |
13 #include "media/base/android/media_player_android.h" | 13 #include "media/base/android/media_player_android.h" |
14 | 14 |
15 namespace webkit_media { | 15 namespace webkit_media { |
16 | 16 |
17 // An interface to facilitate the IPC between the browser side | 17 // An interface to facilitate the IPC between the browser side |
18 // android::MediaPlayer and the WebMediaPlayerImplAndroid in the renderer | 18 // android::MediaPlayer and the WebMediaPlayerImplAndroid in the renderer |
19 // process. | 19 // process. |
20 // Implementation is provided by content::WebMediaPlayerProxyImplAndroid. | 20 // Implementation is provided by content::WebMediaPlayerProxyImplAndroid. |
21 class WebMediaPlayerProxyAndroid { | 21 class WebMediaPlayerProxyAndroid { |
22 public: | 22 public: |
23 virtual ~WebMediaPlayerProxyAndroid(); | 23 virtual ~WebMediaPlayerProxyAndroid(); |
24 | 24 |
25 // Initialize a MediaPlayerAndroid object in browser process | 25 // Initializes a MediaPlayerAndroid object in browser process |
26 virtual void Initialize( | 26 virtual void Initialize( |
27 int player_id, | 27 int player_id, |
28 const GURL& url, | 28 const GURL& url, |
29 media::MediaPlayerAndroid::SourceType source_type, | 29 media::MediaPlayerAndroid::SourceType source_type, |
30 const GURL& first_party_for_cookies) = 0; | 30 const GURL& first_party_for_cookies) = 0; |
31 | 31 |
32 // Start the player. | 32 // Starts the player. |
33 virtual void Start(int player_id) = 0; | 33 virtual void Start(int player_id) = 0; |
34 | 34 |
35 // Pause the player. | 35 // Pauses the player. |
36 virtual void Pause(int player_id) = 0; | 36 virtual void Pause(int player_id) = 0; |
37 | 37 |
38 // Perform seek on the player. | 38 // Performs seek on the player. |
39 virtual void Seek(int player_id, base::TimeDelta time) = 0; | 39 virtual void Seek(int player_id, base::TimeDelta time) = 0; |
40 | 40 |
41 // Release resources for the player. | 41 // Releases resources for the player. |
42 virtual void ReleaseResources(int player_id) = 0; | 42 virtual void ReleaseResources(int player_id) = 0; |
43 | 43 |
44 // Destroy the player in the browser process | 44 // Destroys the player in the browser process |
45 virtual void DestroyPlayer(int player_id) = 0; | 45 virtual void DestroyPlayer(int player_id) = 0; |
46 | 46 |
47 // Request the player to enter fullscreen. | 47 // Requests the player to enter fullscreen. |
48 virtual void EnterFullscreen(int player_id) = 0; | 48 virtual void EnterFullscreen(int player_id) = 0; |
49 | 49 |
50 // Request the player to exit fullscreen. | 50 // Requests the player to exit fullscreen. |
51 virtual void ExitFullscreen(int player_id) = 0; | 51 virtual void ExitFullscreen(int player_id) = 0; |
52 | 52 |
53 #if defined(GOOGLE_TV) | 53 #if defined(GOOGLE_TV) |
54 // Request an external surface for out-of-band compositing. | 54 // Requests an external surface for out-of-band compositing. |
55 virtual void RequestExternalSurface(int player_id, | 55 virtual void RequestExternalSurface(int player_id, |
56 const gfx::RectF& geometry) = 0; | 56 const gfx::RectF& geometry) = 0; |
57 #endif | 57 #endif |
58 | 58 |
59 // Inform the media source player that the demuxer is ready. | 59 // Informs the media source player that the demuxer is ready. |
60 virtual void DemuxerReady( | 60 virtual void DemuxerReady( |
61 int player_id, | 61 int player_id, |
62 const media::MediaPlayerHostMsg_DemuxerReady_Params&) = 0; | 62 const media::MediaPlayerHostMsg_DemuxerReady_Params&) = 0; |
63 | 63 |
64 // Return the data to the media source player when data is ready. | 64 // Returns the data to the media source player when data is ready. |
65 virtual void ReadFromDemuxerAck( | 65 virtual void ReadFromDemuxerAck( |
66 int player_id, | 66 int player_id, |
67 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params) = 0; | 67 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params) = 0; |
68 | 68 |
69 virtual void GenerateKeyRequest(int player_id, | 69 // Informs the media source player of changed duration from demuxer. |
| 70 virtual void DurationChanged(int player_id, |
| 71 const base::TimeDelta& duration) = 0; |
| 72 |
| 73 // Initializes a CDM that supports |uuid|. The |media_keys_id| is stored by |
| 74 // the CDM for future reference. |
| 75 virtual void InitializeCDM(int media_keys_id, |
| 76 const std::vector<uint8>& uuid) = 0; |
| 77 |
| 78 // Asks the CDM referenced by |media_keys_id| to generate a key request. |
| 79 virtual void GenerateKeyRequest(int media_keys_id, |
70 const std::string& type, | 80 const std::string& type, |
71 const std::vector<uint8>& init_data) = 0; | 81 const std::vector<uint8>& init_data) = 0; |
72 | 82 |
73 virtual void AddKey(int player_id, | 83 // Adds a key to the CDM referenced by |media_keys_id|. |
| 84 virtual void AddKey(int media_keys_id, |
74 const std::vector<uint8>& key, | 85 const std::vector<uint8>& key, |
75 const std::vector<uint8>& init_data, | 86 const std::vector<uint8>& init_data, |
76 const std::string& session_id) = 0; | 87 const std::string& session_id) = 0; |
77 | 88 |
78 virtual void CancelKeyRequest(int player_id, | 89 // Destroys the session with |session_id| in the CDM referenced by |
| 90 // |media_keys_id|. |
| 91 virtual void CancelKeyRequest(int media_keys_id, |
79 const std::string& session_id) = 0; | 92 const std::string& session_id) = 0; |
80 | |
81 // Inform the media source player of changed duration from demuxer. | |
82 virtual void DurationChanged(int player_id, | |
83 const base::TimeDelta& duration) = 0; | |
84 }; | 93 }; |
85 | 94 |
86 } // namespace webkit_media | 95 } // namespace webkit_media |
87 | 96 |
88 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ | 97 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ |
OLD | NEW |