diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 23:45:46 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 23:45:46 +0000 |
commit | 3953428eedab395e93faf28ee21270d748ca74b9 (patch) | |
tree | 3a1f1be6107785d9189d9187f4400b4ea60bb932 /webkit | |
parent | 0dea3ea8bee2b135b079d8b75c9e9fb7f2fa82a8 (diff) | |
download | chromium_src-3953428eedab395e93faf28ee21270d748ca74b9.zip chromium_src-3953428eedab395e93faf28ee21270d748ca74b9.tar.gz chromium_src-3953428eedab395e93faf28ee21270d748ca74b9.tar.bz2 |
Re-enabling ENABLE_VIDEO since and made appropriate changes due toWebKit merge since r41907 (http://trac.webkit.org/changeset/41907).Changes include change names of state enums and adding method tosupport added state change event in WebCore::MediaPlayer.
Review URL: http://codereview.chromium.org/56038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12917 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rwxr-xr-x | webkit/build/V8Bindings/build-generated-files.sh | 2 | ||||
-rw-r--r-- | webkit/build/webkit_common_defines.vsprops | 2 | ||||
-rw-r--r-- | webkit/glue/media_player_private_impl.cc | 101 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer.h | 27 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer_impl.cc | 15 | ||||
-rw-r--r-- | webkit/glue/webmediaplayer_impl.h | 9 |
6 files changed, 98 insertions, 58 deletions
diff --git a/webkit/build/V8Bindings/build-generated-files.sh b/webkit/build/V8Bindings/build-generated-files.sh index 2453744..c175cc9 100755 --- a/webkit/build/V8Bindings/build-generated-files.sh +++ b/webkit/build/V8Bindings/build-generated-files.sh @@ -43,7 +43,7 @@ export ENCODINGS_PREFIX="" # To see what FEATURE_DEFINES Apple uses, look at: # webkit/third_party/WebCore/Configurations/WebCore.xcconfig -export FEATURE_DEFINES="ENABLE_WORKERS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_XPATH ENABLE_XSLT" +export FEATURE_DEFINES="ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKERS ENABLE_XPATH ENABLE_XSLT" # Adjust the number of jobs spawned according to the CPU count. if [ -z "$NUMBER_OF_PROCESSORS" ]; then diff --git a/webkit/build/webkit_common_defines.vsprops b/webkit/build/webkit_common_defines.vsprops index bcfbe79..0563493 100644 --- a/webkit/build/webkit_common_defines.vsprops +++ b/webkit/build/webkit_common_defines.vsprops @@ -6,6 +6,6 @@ > <Tool Name="VCCLCompilerTool" - PreprocessorDefinitions="ENABLE_DATABASE=1;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;ENABLE_WORKERS=1;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;CRASH=__debugbreak;BUILDING_CHROMIUM__=1" + PreprocessorDefinitions="ENABLE_DATABASE=1;ENABLE_DASHBOARD_SUPPORT=0;ENABLE_JAVASCRIPT_DEBUGGER=0;ENABLE_JSC_MULTIPLE_THREADS=0;ENABLE_ICONDATABASE=0;ENABLE_XSLT=1;ENABLE_XPATH=1;ENABLE_SVG=1;ENABLE_SVG_ANIMATION=1;ENABLE_SVG_AS_IMAGE=1;ENABLE_SVG_USE=1;ENABLE_SVG_FOREIGN_OBJECT=1;ENABLE_SVG_FONTS=1;ENABLE_VIDEO=1;ENABLE_WORKERS=1;WEBCORE_NAVIGATOR_PLATFORM="\"Win32\"";USE_GOOGLE_URL_LIBRARY;CRASH=__debugbreak;BUILDING_CHROMIUM__=1" /> </VisualStudioPropertySheet> diff --git a/webkit/glue/media_player_private_impl.cc b/webkit/glue/media_player_private_impl.cc index 78c723f..963f5b4 100644 --- a/webkit/glue/media_player_private_impl.cc +++ b/webkit/glue/media_player_private_impl.cc @@ -80,31 +80,13 @@ void MediaPlayerPrivate::cancelLoad() { IntSize MediaPlayerPrivate::naturalSize() const { if (m_data) { - return IntSize(AsDelegate(m_data)->GetWidth(), AsDelegate(m_data)->GetHeight()); + return IntSize(AsDelegate(m_data)->GetWidth(), + AsDelegate(m_data)->GetHeight()); } else { return IntSize(0, 0); } } -MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) -{ - return new MediaPlayerPrivate(player); -} - -void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar) -{ - if (isAvailable()) - registrar(create, getSupportedTypes, supportsType); -} - -MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String &type, const String &codecs) -{ - // FIXME: Do the real thing - notImplemented(); - - return MediaPlayer::IsSupported; -} - bool MediaPlayerPrivate::hasVideo() const { if (m_data) { return AsDelegate(m_data)->IsVideo(); @@ -194,41 +176,39 @@ MediaPlayer::NetworkState MediaPlayerPrivate::networkState() const { switch (AsDelegate(m_data)->GetNetworkState()) { case webkit_glue::WebMediaPlayer::EMPTY: return MediaPlayer::Empty; - case webkit_glue::WebMediaPlayer::LOADED: - return MediaPlayer::Loaded; + case webkit_glue::WebMediaPlayer::IDLE: + return MediaPlayer::Idle; case webkit_glue::WebMediaPlayer::LOADING: return MediaPlayer::Loading; - case webkit_glue::WebMediaPlayer::LOAD_FAILED: - return MediaPlayer::LoadFailed; - case webkit_glue::WebMediaPlayer::LOADED_META_DATA: - return MediaPlayer::LoadedMetaData; - case webkit_glue::WebMediaPlayer::LOADED_FIRST_FRAME: - return MediaPlayer::LoadedFirstFrame; - default: - return MediaPlayer::Empty; + case webkit_glue::WebMediaPlayer::LOADED: + return MediaPlayer::Loaded; + case webkit_glue::WebMediaPlayer::FORMAT_ERROR: + return MediaPlayer::FormatError; + case webkit_glue::WebMediaPlayer::NETWORK_ERROR: + return MediaPlayer::NetworkError; + case webkit_glue::WebMediaPlayer::DECODE_ERROR: + return MediaPlayer::DecodeError; } - } else { - return MediaPlayer::Empty; } + return MediaPlayer::Empty; } MediaPlayer::ReadyState MediaPlayerPrivate::readyState() const { if (m_data) { switch (AsDelegate(m_data)->GetReadyState()) { - case webkit_glue::WebMediaPlayer::CAN_PLAY: - return MediaPlayer::CanPlay; - case webkit_glue::WebMediaPlayer::CAN_PLAY_THROUGH: - return MediaPlayer::CanPlayThrough; - case webkit_glue::WebMediaPlayer::CAN_SHOW_CURRENT_FRAME: - return MediaPlayer::CanShowCurrentFrame; - case webkit_glue::WebMediaPlayer::DATA_UNAVAILABLE: - return MediaPlayer::DataUnavailable; - default: - return MediaPlayer::DataUnavailable; + case webkit_glue::WebMediaPlayer::HAVE_NOTHING: + return MediaPlayer::HaveNothing; + case webkit_glue::WebMediaPlayer::HAVE_METADATA: + return MediaPlayer::HaveMetadata; + case webkit_glue::WebMediaPlayer::HAVE_CURRENT_DATA: + return MediaPlayer::HaveCurrentData; + case webkit_glue::WebMediaPlayer::HAVE_FUTURE_DATA: + return MediaPlayer::HaveFutureData; + case webkit_glue::WebMediaPlayer::HAVE_ENOUGH_DATA: + return MediaPlayer::HaveEnoughData; } - } else { - return MediaPlayer::DataUnavailable; } + return MediaPlayer::HaveNothing; } float MediaPlayerPrivate::maxTimeBuffered() const { @@ -315,14 +295,39 @@ void MediaPlayerPrivate::repaint() { m_player->repaint(); } +void MediaPlayerPrivate::sizeChanged() { + m_player->sizeChanged(); +} + +void MediaPlayerPrivate::rateChanged() { + m_player->rateChanged(); +} + +void MediaPlayerPrivate::durationChanged() { + m_player->durationChanged(); +} + // public static methods ------------------------------------------------------ -void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types) { - // Do nothing for now. +MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) { + return new MediaPlayerPrivate(player); +} + +void MediaPlayerPrivate::registerMediaEngine(MediaEngineRegistrar registrar) { + if (webkit_glue::IsMediaPlayerAvailable()) + registrar(create, getSupportedTypes, supportsType); } -bool MediaPlayerPrivate::isAvailable() { - return webkit_glue::IsMediaPlayerAvailable(); +MediaPlayer::SupportsType MediaPlayerPrivate::supportsType( + const String &type, const String &codecs) { + // TODO(hclam): decide what to do here, now we just say we support everything. + return MediaPlayer::IsSupported; +} + +void MediaPlayerPrivate::getSupportedTypes(HashSet<String>& types) { + // TODO(hclam): decide what to do here, we should fill in the HashSet about + // codecs that we support. + notImplemented(); } } // namespace WebCore diff --git a/webkit/glue/webmediaplayer.h b/webkit/glue/webmediaplayer.h index 102eb5e..4d80cfa 100644 --- a/webkit/glue/webmediaplayer.h +++ b/webkit/glue/webmediaplayer.h @@ -17,18 +17,20 @@ class WebMediaPlayer { public: enum NetworkState { EMPTY, - LOAD_FAILED, + IDLE, LOADING, - LOADED_META_DATA, - LOADED_FIRST_FRAME, - LOADED + LOADED, + FORMAT_ERROR, + NETWORK_ERROR, + DECODE_ERROR, }; enum ReadyState { - DATA_UNAVAILABLE, - CAN_SHOW_CURRENT_FRAME, - CAN_PLAY, - CAN_PLAY_THROUGH + HAVE_NOTHING, + HAVE_METADATA, + HAVE_CURRENT_DATA, + HAVE_FUTURE_DATA, + HAVE_ENOUGH_DATA, }; WebMediaPlayer() {} @@ -51,6 +53,15 @@ public: // Notify the media player about volume change. virtual void NotifyVolumeChange() = 0; + // Notify the media player size of video frame changed. + virtual void NotifySizeChanged() = 0; + + // Notify the media player playback rate has changed. + virtual void NotifyRateChanged() = 0; + + // Notify the media player duration of the media file has changed. + virtual void NotifyDurationChanged() = 0; + // Tell the media player to repaint itself. virtual void Repaint() = 0; diff --git a/webkit/glue/webmediaplayer_impl.cc b/webkit/glue/webmediaplayer_impl.cc index e262ec4..1a17346 100644 --- a/webkit/glue/webmediaplayer_impl.cc +++ b/webkit/glue/webmediaplayer_impl.cc @@ -65,6 +65,21 @@ void WebMediaPlayerImpl::NotifyVolumeChange() { media_player_private_->volumeChanged(); } +void WebMediaPlayerImpl::NotifySizeChanged() { + if (media_player_private_) + media_player_private_->sizeChanged(); +} + +void WebMediaPlayerImpl::NotifyRateChanged() { + if (media_player_private_) + media_player_private_->rateChanged(); +} + +void WebMediaPlayerImpl::NotifyDurationChanged() { + if (media_player_private_) + media_player_private_->durationChanged(); +} + void WebMediaPlayerImpl::Repaint() { if (media_player_private_) media_player_private_->repaint(); diff --git a/webkit/glue/webmediaplayer_impl.h b/webkit/glue/webmediaplayer_impl.h index fce28bc..3dc29e5 100644 --- a/webkit/glue/webmediaplayer_impl.h +++ b/webkit/glue/webmediaplayer_impl.h @@ -45,6 +45,15 @@ class WebMediaPlayerImpl : public WebMediaPlayer { // Notify the media player about volume change. virtual void NotifyVolumeChange(); + // Notify the media player size of video frame changed. + virtual void NotifySizeChanged(); + + // Notify the media player playback rate has changed. + virtual void NotifyRateChanged(); + + // Notify the media player duration of the media file has changed. + virtual void NotifyDurationChanged(); + // Tell the media player to repaint itself. virtual void Repaint(); |