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