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 // Initialize 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 // Start the player. | |
33 virtual void Start(int player_id) = 0; | |
34 | |
35 // Pause the player. | |
36 virtual void Pause(int player_id) = 0; | |
37 | |
38 // Perform seek on the player. | |
39 virtual void Seek(int player_id, base::TimeDelta time) = 0; | |
40 | |
41 // Release resources for the player. | |
42 virtual void ReleaseResources(int player_id) = 0; | |
43 | |
44 // Destroy the player in the browser process | |
45 virtual void DestroyPlayer(int player_id) = 0; | |
46 | |
47 // Request the player to enter fullscreen. | |
48 virtual void EnterFullscreen(int player_id) = 0; | |
49 | |
50 // Request the player to exit fullscreen. | |
51 virtual void ExitFullscreen(int player_id) = 0; | |
52 | |
53 #if defined(GOOGLE_TV) | |
54 // Request 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 // Inform 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 // Return 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 virtual void GenerateKeyRequest(int player_id, | |
70 const std::string& type, | |
71 const std::vector<uint8>& init_data) = 0; | |
72 | |
73 virtual void AddKey(int player_id, | |
74 const std::vector<uint8>& key, | |
75 const std::vector<uint8>& init_data, | |
76 const std::string& session_id) = 0; | |
77 | |
78 virtual void CancelKeyRequest(int player_id, | |
79 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 }; | |
85 | |
86 } // namespace webkit_media | |
87 | |
88 #endif // WEBKIT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_ | |
OLD | NEW |