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

Unified 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 and resolving merge conflicts 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/media/android/webmediaplayer_android.cc ('k') | webkit/media/android/webmediaplayer_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_impl_android.h
diff --git a/webkit/media/android/webmediaplayer_impl_android.h b/webkit/media/android/webmediaplayer_impl_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..20a87e10e3d6983f4fc6e310bb3004f29a7f65a3
--- /dev/null
+++ b/webkit/media/android/webmediaplayer_impl_android.h
@@ -0,0 +1,79 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
+#define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
+
+#include <string>
+
+#include <jni.h>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h"
+#include "webkit/media/android/webmediaplayer_android.h"
+
+namespace WebKit {
+class WebFrame;
+}
+
+namespace webkit_media {
+
+class StreamTextureFactory;
+class WebMediaPlayerManagerAndroid;
+class WebMediaPlayerProxyAndroid;
+
+// This class implements WebKit::WebMediaPlayer by keeping the android
+// media player in the browser process. It listens to all the status changes
+// sent from the browser process and sends playback controls to the media
+// player.
+class WebMediaPlayerImplAndroid : public WebMediaPlayerAndroid {
+ public:
+ // Construct a WebMediaPlayerImplAndroid object. This class communicates
+ // with the MediaPlayerBridge object in the browser process through
+ // |proxy|.
+ // TODO(qinmin): |frame| argument is used to determine whether the current
+ // player can enter fullscreen.
+ WebMediaPlayerImplAndroid(WebKit::WebFrame* frame,
+ WebKit::WebMediaPlayerClient* client,
+ WebMediaPlayerManagerAndroid* manager,
+ WebMediaPlayerProxyAndroid* proxy,
+ StreamTextureFactory* factory);
+ virtual ~WebMediaPlayerImplAndroid();
+
+ // WebMediaPlayerAndroid implementation.
+ virtual void OnTimeUpdate(base::TimeDelta current_time) OVERRIDE;
+ virtual void SetVideoSurface(jobject j_surface) OVERRIDE;
+
+ private:
+ // Methods inherited from WebMediaPlayerAndroid.
+ virtual void InitializeMediaPlayer(GURL url) OVERRIDE;
+ virtual void PlayInternal() OVERRIDE;
+ virtual void PauseInternal() OVERRIDE;
+ virtual void SeekInternal(base::TimeDelta time) OVERRIDE;
+ virtual float GetCurrentTimeInternal() const OVERRIDE;
+ virtual void ReleaseResourcesInternal() OVERRIDE;
+ virtual void Destroy() OVERRIDE;
+
+ WebKit::WebFrame* const frame_;
+
+ // Proxy object that delegates method calls on Render Thread.
+ // This object is created on the Render Thread and is only called in the
+ // destructor.
+ WebMediaPlayerProxyAndroid* proxy_;
+
+ // The current playing time. Because the mediaplayer is in the browser
+ // process, it will regularly update the |current_time_| by calling
+ // OnTimeUpdate().
+ float current_time_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImplAndroid);
+};
+
+} // namespace webkit_media
+
+#endif // WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_IMPL_ANDROID_H_
« no previous file with comments | « webkit/media/android/webmediaplayer_android.cc ('k') | webkit/media/android/webmediaplayer_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698