summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webmediaplayer_delegate.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 21:40:36 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-18 21:40:36 +0000
commitec9212f3e7399920c6c50b8943549b995192c5cf (patch)
tree2f0ebe96ba5c4ec29457ea4f68aa702dc7a99afa /webkit/glue/webmediaplayer_delegate.h
parentf08f95e9d8e6f36be7162c77acefc834764209e1 (diff)
downloadchromium_src-ec9212f3e7399920c6c50b8943549b995192c5cf.zip
chromium_src-ec9212f3e7399920c6c50b8943549b995192c5cf.tar.gz
chromium_src-ec9212f3e7399920c6c50b8943549b995192c5cf.tar.bz2
Bridge out media player from MediaPlayerPrivate.
- Remove MediaPlayerPrivateChromium.cpp and move it to webkit/glue/media_player_private_impl.cc - Added the following classes: WebMediaPlayer WebMediaPlayerImpl WebMediaPlayerDelegate WebMediaPlayerDelegateImpl TestWebMediaPlayerDelegate VideoStackMediaPlayer (Just a forward declaration) - One include fix for webkit/glue/webframe.h - Overview of what each class is doing: WebMediaPlayer and WebMediaPlayerImpl Wrapper over the MediaPlayerPrivate, it provides methods like Repaint(), NotifyNetworkStateChange(), etc to VideoStackMediaPlayer. It also creates the ResourceHandle for VideoStackMediaPlayer for resource loading, or maybe VideoStackMediaPlayer can simply use webkit_glue::ResourceDispatcher? WebMediaPlayerDelegate, WebMediaPlayerDelegateImpl Delegate calls from webkit to the internal media player. MediaPlayerPrivate Forward calls to WebMidiaPlayerDelegate, creates WebMediaPlayerDelegate and WebMediaPlayer in the constructor. Expose some public methods to WebMediaPlayer so we can actually do repaint and notification of changes. Review URL: http://codereview.chromium.org/13762 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webmediaplayer_delegate.h')
-rw-r--r--webkit/glue/webmediaplayer_delegate.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/webkit/glue/webmediaplayer_delegate.h b/webkit/glue/webmediaplayer_delegate.h
new file mode 100644
index 0000000..ee2d553
--- /dev/null
+++ b/webkit/glue/webmediaplayer_delegate.h
@@ -0,0 +1,80 @@
+// Copyright (c) 2008 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_GLUE_WEBMEDIAPLAYER_DELEGATE_H_
+#define WEBKIT_GLUE_WEBMEDIAPLAYER_DELEGATE_H_
+
+#include "base/gfx/platform_canvas.h"
+#include "webkit/glue/webmediaplayer.h"
+
+class GURL;
+
+namespace gfx {
+class Rect;
+}
+
+namespace webkit_glue {
+
+class WebMediaPlayerDelegate {
+ public:
+ WebMediaPlayerDelegate() {}
+ virtual ~WebMediaPlayerDelegate() {}
+
+ virtual void Initialize(WebMediaPlayer *web_media_player) = 0;
+
+ virtual void Load(const GURL& url) = 0;
+ virtual void CancelLoad() = 0;
+
+ // Playback controls.
+ virtual void Play() = 0;
+ virtual void Pause() = 0;
+ virtual void Stop() = 0;
+ virtual void Seek(float time) = 0;
+ virtual void SetEndTime(float time) = 0;
+ virtual void SetPlaybackRate(float rate) = 0;
+ virtual void SetVolume(float volume) = 0;
+ virtual void SetVisible(bool visible) = 0;
+ virtual bool IsTotalBytesKnown() = 0;
+ virtual float GetMaxTimeBuffered() const = 0;
+ virtual float GetMaxTimeSeekable() const = 0;
+
+ // Methods for painting.
+ virtual void SetRect(const gfx::Rect& rect) = 0;
+
+ // TODO(hclam): Using paint at the moment, maybe we just need to return a
+ // SkiaBitmap?
+ virtual void Paint(skia::PlatformCanvas *canvas, const gfx::Rect& rect) = 0;
+
+ // True if a video is loaded.
+ virtual bool IsVideo() const = 0;
+
+ // Dimension of the video.
+ virtual size_t GetWidth() const = 0;
+ virtual size_t GetHeight() const = 0;
+
+ // Getters fo playback state.
+ virtual bool IsPaused() const = 0;
+ virtual bool IsSeeking() const = 0;
+ virtual float GetDuration() const = 0;
+ virtual float GetCurrentTime() const = 0;
+ virtual float GetPlayBackRate() const = 0;
+ virtual float GetVolume() const = 0;
+
+ // Get rate of loading the resource.
+ virtual int32 GetDataRate() const = 0;
+
+ // Internal states of loading and network.
+ virtual WebMediaPlayer::NetworkState GetNetworkState() const = 0;
+ virtual WebMediaPlayer::ReadyState GetReadyState() const = 0;
+
+ virtual int64 GetBytesLoaded() const = 0;
+ virtual int64 GetTotalBytes() const = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerDelegate);
+};
+
+} // namespace webkit_glue
+
+#endif // ifndef WEBKIT_GLUE_WEBMEDIAPLAYER_DELEGATE_H_