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

Side by Side Diff: webkit/media/android/webmediaplayer_impl_android.h

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing comments Created 8 years, 3 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
(Empty)
1 // Copyright (c) 2012 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_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
6 #define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
7
8 #include <string>
9
10 #include <jni.h>
11
12 #include "base/basictypes.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
18 #include "webkit/media/android/webmediaplayer_android.h"
19
20 namespace WebKit {
21 class WebFrame;
22 }
23
24 namespace webkit_media {
25
26 class StreamTextureFactory;
27 class WebMediaPlayerManagerAndroid;
28 class WebMediaPlayerProxyAndroid;
29
30 // This class implements WebKit::WebMediaPlayer by keeping the android
31 // media player in the browser process. It listens to all the status changes
32 // sent from the browser process and sends playback controls to the media
33 // player.
34 class WebMediaPlayerImplAndroid : public WebMediaPlayerAndroid {
35 public:
36 WebMediaPlayerImplAndroid(WebKit::WebFrame* frame,
37 WebKit::WebMediaPlayerClient* client,
38 WebMediaPlayerManagerAndroid* manager,
39 WebMediaPlayerProxyAndroid* proxy,
40 StreamTextureFactory* factory);
41 virtual ~WebMediaPlayerImplAndroid();
42
43 // Called to update the current time.
44 virtual void OnTimeUpdate(base::TimeDelta current_time) OVERRIDE;
45
46 private:
47 // Methods inherited from WebMediaPlayerAndroid.
48 virtual void InitializeMediaPlayer(GURL url) OVERRIDE;
49 virtual void PlayInternal() OVERRIDE;
50 virtual void PauseInternal() OVERRIDE;
51 virtual void SeekInternal(base::TimeDelta time) OVERRIDE;
52 virtual float GetCurrentTimeInternal() const OVERRIDE;
53 virtual void ReleaseResourcesInternal() OVERRIDE;
54 virtual void Destroy() OVERRIDE;
55
56 WebKit::WebFrame* const frame_;
57
58 // Proxy object that delegates method calls on Render Thread.
59 // This object is created on the Render Thread and is only called in the
60 // destructor.
61 WebMediaPlayerProxyAndroid* proxy_;
62
63 // The current playing time. Because the mediaplayer is in the browser
64 // process, it will regularly update the |current_time_| by calling
65 // OnTimeUpdate().
66 float current_time_;
67
68 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImplAndroid);
69 };
70
71 } // namespace webkit_media
72
73 #endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698