diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 21:40:36 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 21:40:36 +0000 |
commit | ec9212f3e7399920c6c50b8943549b995192c5cf (patch) | |
tree | 2f0ebe96ba5c4ec29457ea4f68aa702dc7a99afa /webkit/glue/webmediaplayer.h | |
parent | f08f95e9d8e6f36be7162c77acefc834764209e1 (diff) | |
download | chromium_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.h')
-rw-r--r-- | webkit/glue/webmediaplayer.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/webkit/glue/webmediaplayer.h b/webkit/glue/webmediaplayer.h new file mode 100644 index 0000000..3dfbd31 --- /dev/null +++ b/webkit/glue/webmediaplayer.h @@ -0,0 +1,63 @@ +// 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_H_ +#define WEBKIT_GLUE_WEBMEDIAPLAYER_H_ + +#include "base/basictypes.h" + +class WebFrame; + +namespace webkit_glue { + +class WebMediaPlayerDelegate; + +class WebMediaPlayer { +public: + enum NetworkState { + EMPTY, + LOAD_FAILED, + LOADING, + LOADED_META_DATA, + LOADED_FIRST_FRAME, + LOADED + }; + + enum ReadyState { + DATA_UNAVAILABLE, + CAN_SHOW_CURRENT_FRAME, + CAN_PLAY, + CAN_PLAY_THROUGH + }; + + WebMediaPlayer() {} + virtual ~WebMediaPlayer() {} + + virtual void Initialize(WebMediaPlayerDelegate* delegate) = 0; + + // Get the web frame associated with the media player + virtual WebFrame* GetWebFrame() = 0; + + // Notify the media player about network state change. + virtual void NotifynetworkStateChange() = 0; + + // Notify the media player about ready state change. + virtual void NotifyReadyStateChange() = 0; + + // Notify the media player about time change. + virtual void NotifyTimeChange() = 0; + + // Notify the media player about volume change. + virtual void NotifyVolumeChange() = 0; + + // Tell the media player to repaint itself. + virtual void Repaint() = 0; + +private: + DISALLOW_COPY_AND_ASSIGN(WebMediaPlayer); +}; + +} // namespace webkit_glue + +#endif // ifndef WEBKIT_GLUE_WEBMEDIAPLAYER_H_ |