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 CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 class RendererMediaPlayerManager; | 63 class RendererMediaPlayerManager; |
64 class WebContentDecryptionModuleImpl; | 64 class WebContentDecryptionModuleImpl; |
65 class WebMediaPlayerDelegate; | 65 class WebMediaPlayerDelegate; |
66 | 66 |
67 // This class implements blink::WebMediaPlayer by keeping the android | 67 // This class implements blink::WebMediaPlayer by keeping the android |
68 // media player in the browser process. It listens to all the status changes | 68 // media player in the browser process. It listens to all the status changes |
69 // sent from the browser process and sends playback controls to the media | 69 // sent from the browser process and sends playback controls to the media |
70 // player. | 70 // player. |
71 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, | 71 class WebMediaPlayerAndroid : public blink::WebMediaPlayer, |
72 public cc::VideoFrameProvider, | 72 public cc::VideoFrameProvider, |
73 public RenderFrameObserver { | 73 public RenderFrameObserver, |
| 74 public StreamTextureFactoryContextObserver { |
74 public: | 75 public: |
75 // Construct a WebMediaPlayerAndroid object. This class communicates with the | 76 // Construct a WebMediaPlayerAndroid object. This class communicates with the |
76 // MediaPlayerAndroid object in the browser process through |proxy|. | 77 // MediaPlayerAndroid object in the browser process through |proxy|. |
77 // TODO(qinmin): |frame| argument is used to determine whether the current | 78 // TODO(qinmin): |frame| argument is used to determine whether the current |
78 // player can enter fullscreen. This logic should probably be moved into | 79 // player can enter fullscreen. This logic should probably be moved into |
79 // blink, so that enterFullscreen() will not be called if another video is | 80 // blink, so that enterFullscreen() will not be called if another video is |
80 // already in fullscreen. | 81 // already in fullscreen. |
81 WebMediaPlayerAndroid( | 82 WebMediaPlayerAndroid( |
82 blink::WebFrame* frame, | 83 blink::WebFrame* frame, |
83 blink::WebMediaPlayerClient* client, | 84 blink::WebMediaPlayerClient* client, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 190 |
190 // Functions called when media player status changes. | 191 // Functions called when media player status changes. |
191 void OnConnectedToRemoteDevice(const std::string& remote_playback_message); | 192 void OnConnectedToRemoteDevice(const std::string& remote_playback_message); |
192 void OnDisconnectedFromRemoteDevice(); | 193 void OnDisconnectedFromRemoteDevice(); |
193 void OnDidEnterFullscreen(); | 194 void OnDidEnterFullscreen(); |
194 void OnDidExitFullscreen(); | 195 void OnDidExitFullscreen(); |
195 void OnMediaPlayerPlay(); | 196 void OnMediaPlayerPlay(); |
196 void OnMediaPlayerPause(); | 197 void OnMediaPlayerPause(); |
197 void OnRequestFullscreen(); | 198 void OnRequestFullscreen(); |
198 | 199 |
| 200 // StreamTextureFactoryContextObserver implementation. |
| 201 virtual void ResetStreamTextureProxy() OVERRIDE; |
| 202 |
199 // Called when the player is released. | 203 // Called when the player is released. |
200 virtual void OnPlayerReleased(); | 204 virtual void OnPlayerReleased(); |
201 | 205 |
202 // This function is called by the RendererMediaPlayerManager to pause the | 206 // This function is called by the RendererMediaPlayerManager to pause the |
203 // video and release the media player and surface texture when we switch tabs. | 207 // video and release the media player and surface texture when we switch tabs. |
204 // However, the actual GlTexture is not released to keep the video screenshot. | 208 // However, the actual GlTexture is not released to keep the video screenshot. |
205 virtual void ReleaseMediaResources(); | 209 virtual void ReleaseMediaResources(); |
206 | 210 |
207 // RenderFrameObserver implementation. | 211 // RenderFrameObserver implementation. |
208 virtual void OnDestruct() OVERRIDE; | 212 virtual void OnDestruct() OVERRIDE; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 499 |
496 // NOTE: Weak pointers must be invalidated before all other member variables. | 500 // NOTE: Weak pointers must be invalidated before all other member variables. |
497 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; | 501 base::WeakPtrFactory<WebMediaPlayerAndroid> weak_factory_; |
498 | 502 |
499 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); | 503 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); |
500 }; | 504 }; |
501 | 505 |
502 } // namespace content | 506 } // namespace content |
503 | 507 |
504 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ | 508 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ |
OLD | NEW |