Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 18590002: Migrate MediaStream test code from content/shell/renderer/ to content/test/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 25 matching lines...) Expand all
36 } 36 }
37 37
38 namespace WebKit { 38 namespace WebKit {
39 class WebFrame; 39 class WebFrame;
40 } 40 }
41 41
42 namespace webkit { 42 namespace webkit {
43 class WebLayerImpl; 43 class WebLayerImpl;
44 } 44 }
45 45
46 namespace webkit_media { 46 namespace content {
47 class WebMediaPlayerDelegate; 47 class WebMediaPlayerDelegate;
48 class WebMediaPlayerManagerAndroid;
49 class WebMediaPlayerProxyAndroid;
48 50
49 #if defined(GOOGLE_TV) 51 #if defined(GOOGLE_TV)
50 class MediaStreamAudioRenderer; 52 class MediaStreamAudioRenderer;
51 class MediaStreamClient; 53 class MediaStreamClient;
52 #endif 54 #endif
53 }
54
55 namespace content {
56
57 class WebMediaPlayerManagerAndroid;
58 class WebMediaPlayerProxyAndroid;
59 55
60 // This class implements WebKit::WebMediaPlayer by keeping the android 56 // This class implements WebKit::WebMediaPlayer by keeping the android
61 // media player in the browser process. It listens to all the status changes 57 // media player in the browser process. It listens to all the status changes
62 // sent from the browser process and sends playback controls to the media 58 // sent from the browser process and sends playback controls to the media
63 // player. 59 // player.
64 class WebMediaPlayerAndroid 60 class WebMediaPlayerAndroid
65 : public WebKit::WebMediaPlayer, 61 : public WebKit::WebMediaPlayer,
66 public cc::VideoFrameProvider, 62 public cc::VideoFrameProvider,
67 public base::MessageLoop::DestructionObserver, 63 public base::MessageLoop::DestructionObserver,
68 public base::SupportsWeakPtr<WebMediaPlayerAndroid> { 64 public base::SupportsWeakPtr<WebMediaPlayerAndroid> {
69 public: 65 public:
70 // Construct a WebMediaPlayerAndroid object. This class communicates 66 // Construct a WebMediaPlayerAndroid object. This class communicates
71 // with the MediaPlayerAndroid object in the browser process through 67 // with the MediaPlayerAndroid object in the browser process through
72 // |proxy|. 68 // |proxy|.
73 // TODO(qinmin): |frame| argument is used to determine whether the current 69 // TODO(qinmin): |frame| argument is used to determine whether the current
74 // player can enter fullscreen. This logic should probably be moved into 70 // player can enter fullscreen. This logic should probably be moved into
75 // blink, so that enterFullscreen() will not be called if another video is 71 // blink, so that enterFullscreen() will not be called if another video is
76 // already in fullscreen. 72 // already in fullscreen.
77 WebMediaPlayerAndroid( 73 WebMediaPlayerAndroid(
78 WebKit::WebFrame* frame, 74 WebKit::WebFrame* frame,
79 WebKit::WebMediaPlayerClient* client, 75 WebKit::WebMediaPlayerClient* client,
80 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, 76 base::WeakPtr<WebMediaPlayerDelegate> delegate,
81 WebMediaPlayerManagerAndroid* manager, 77 WebMediaPlayerManagerAndroid* manager,
82 WebMediaPlayerProxyAndroid* proxy, 78 WebMediaPlayerProxyAndroid* proxy,
83 StreamTextureFactory* factory, 79 StreamTextureFactory* factory,
84 media::MediaLog* media_log); 80 media::MediaLog* media_log);
85 virtual ~WebMediaPlayerAndroid(); 81 virtual ~WebMediaPlayerAndroid();
86 82
87 // WebKit::WebMediaPlayer implementation. 83 // WebKit::WebMediaPlayer implementation.
88 virtual void enterFullscreen(); 84 virtual void enterFullscreen();
89 virtual void exitFullscreen(); 85 virtual void exitFullscreen();
90 virtual bool canEnterFullscreen() const; 86 virtual bool canEnterFullscreen() const;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 278
283 WebKit::WebFrame* const frame_; 279 WebKit::WebFrame* const frame_;
284 280
285 WebKit::WebMediaPlayerClient* const client_; 281 WebKit::WebMediaPlayerClient* const client_;
286 282
287 // |delegate_| is used to notify the browser process of the player status, so 283 // |delegate_| is used to notify the browser process of the player status, so
288 // that the browser process can control screen locks. 284 // that the browser process can control screen locks.
289 // TODO(qinmin): Currently android mediaplayer takes care of the screen 285 // TODO(qinmin): Currently android mediaplayer takes care of the screen
290 // lock. So this is only used for media source. Will apply this to regular 286 // lock. So this is only used for media source. Will apply this to regular
291 // media tag once http://crbug.com/247892 is fixed. 287 // media tag once http://crbug.com/247892 is fixed.
292 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate_; 288 base::WeakPtr<WebMediaPlayerDelegate> delegate_;
293 289
294 // Save the list of buffered time ranges. 290 // Save the list of buffered time ranges.
295 WebKit::WebTimeRanges buffered_; 291 WebKit::WebTimeRanges buffered_;
296 292
297 // Size of the video. 293 // Size of the video.
298 WebKit::WebSize natural_size_; 294 WebKit::WebSize natural_size_;
299 295
300 // Size that has been sent to StreamTexture. 296 // Size that has been sent to StreamTexture.
301 WebKit::WebSize cached_stream_texture_size_; 297 WebKit::WebSize cached_stream_texture_size_;
302 298
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 420
425 // The decryptor that manages decryption keys and decrypts encrypted frames. 421 // The decryptor that manages decryption keys and decrypts encrypted frames.
426 scoped_ptr<webkit_media::ProxyDecryptor> decryptor_; 422 scoped_ptr<webkit_media::ProxyDecryptor> decryptor_;
427 423
428 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid); 424 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerAndroid);
429 }; 425 };
430 426
431 } // namespace content 427 } // namespace content
432 428
433 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_ 429 #endif // CONTENT_RENDERER_MEDIA_ANDROID_WEBMEDIAPLAYER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698