Factor MediaSource methods out of MediaPlayer & MediaPlayerPrivate and into a new...
authoracolwell <acolwell@chromium.org>
Sat, 23 Feb 2013 02:48:57 +0000 (02:48 +0000)
committeracolwell <acolwell@chromium.org>
Sat, 23 Feb 2013 02:48:57 +0000 (02:48 +0000)
commit6d507c291186cffb004a69a26216357cbe480fd8
tree3b14ce2da685a828d78a870c2613029995addb3c
parent8acb9dd31d745b5afc1d90b137007e8e225b0820
Factor MediaSource methods out of MediaPlayer & MediaPlayerPrivate and into a new MediaSourcePrivate interface.
https://bugs.webkit.org/show_bug.cgi?id=109857

Reviewed by Adam Barth.

Source/WebCore:

This is a simple refactor that moves MediaSource related methods out of MediaPlayer & MediaPlayerPrivate
so that the MediaSource implementation can be updated without further polluting these interfaces.
MediaSourcePrivate is the new WebCore interface that ports must implement to support the MediaSource API.

No new tests. No user visible behavior has changed.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::duration):
(WebCore::MediaSource::setDuration):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::setReadyState):
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::buffered):
(WebCore::MediaSource::append):
(WebCore::MediaSource::abort):
(WebCore::MediaSource::setTimestampOffset):
(WebCore::MediaSource::setPrivateAndOpen):
(WebCore):
(WebCore::MediaSource::hasPendingActivity):
(WebCore::MediaSource::stop):
* Modules/mediasource/MediaSource.h:
(MediaSource):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::reportMemoryUsage):
* html/HTMLMediaElement.h:
(HTMLMediaElement):
* platform/graphics/MediaPlayer.cpp:
(NullMediaPlayerPrivate):
(WebCore::NullMediaPlayerPrivate::load):
(WebCore::MediaPlayer::load):
(WebCore):
(WebCore::MediaPlayer::loadWithNextMediaEngine):
* platform/graphics/MediaPlayer.h:
(WebCore):
(MediaPlayerClient):
(MediaPlayer):
* platform/graphics/MediaPlayerPrivate.h:
(MediaPlayerPrivateInterface):
* platform/graphics/MediaSourcePrivate.h: Added.
(WebCore):
(MediaSourcePrivate): Contains the MediaSource methods extracted from MediaPlayer.
(WebCore::MediaSourcePrivate::MediaSourcePrivate):
(WebCore::MediaSourcePrivate::~MediaSourcePrivate):

Source/WebKit/chromium:

WebMediaSource and WebMediaSource client were created to replace the MediaSource methods in WebMediaPlayer and
WebMediaPlayerClient. This allows the MediaSource implementation to be updated without further polluting the
media player interfaces.

* WebKit.gyp:
* public/WebMediaPlayer.h:
(WebMediaPlayer):
(WebKit::WebMediaPlayer::load):
* public/WebMediaPlayerClient.h:
(WebKit):
* public/WebMediaSource.h: Added.
(WebKit):
(WebMediaSource):
(WebKit::WebMediaSource::~WebMediaSource):
* public/WebMediaSourceClient.h: Added.
(WebKit):
(WebMediaSourceClient):
(WebKit::WebMediaSourceClient::~WebMediaSourceClient):
* src/AssertMatchingEnums.cpp:
* src/WebMediaPlayerClientImpl.cpp:
(WebKit):
(WebMediaSourceClientImpl): Temporary WebMediaSourceClient implementation to keep things working until Chromium
                            changes land.
(WebKit::WebMediaSourceClientImpl::WebMediaSourceClientImpl):
(WebKit::WebMediaSourceClientImpl::~WebMediaSourceClientImpl):
(WebKit::WebMediaSourceClientImpl::addId):
(WebKit::WebMediaSourceClientImpl::removeId):
(WebKit::WebMediaSourceClientImpl::buffered):
(WebKit::WebMediaSourceClientImpl::append):
(WebKit::WebMediaSourceClientImpl::abort):
(WebKit::WebMediaSourceClientImpl::duration):
(WebKit::WebMediaSourceClientImpl::setDuration):
(WebKit::WebMediaSourceClientImpl::endOfStream):
(WebKit::WebMediaSourceClientImpl::setTimestampOffset):
(WebKit::WebMediaPlayerClientImpl::sourceOpened):
(WebKit::WebMediaPlayerClientImpl::sourceURL):
(WebKit::WebMediaPlayerClientImpl::load):
(WebKit::WebMediaPlayerClientImpl::loadRequested):
(WebKit::WebMediaPlayerClientImpl::loadInternal):
* src/WebMediaPlayerClientImpl.h:
(WebMediaPlayerClientImpl):
* src/WebMediaSourceImpl.cpp: Added.
(WebKit):
(MediaSourcePrivateImpl):
(WebKit::MediaSourcePrivateImpl::~MediaSourcePrivateImpl):
(WebKit::MediaSourcePrivateImpl::MediaSourcePrivateImpl):
(WebKit::MediaSourcePrivateImpl::addId):
(WebKit::MediaSourcePrivateImpl::removeId):
(WebKit::MediaSourcePrivateImpl::buffered):
(WebKit::MediaSourcePrivateImpl::append):
(WebKit::MediaSourcePrivateImpl::abort):
(WebKit::MediaSourcePrivateImpl::duration):
(WebKit::MediaSourcePrivateImpl::setDuration):
(WebKit::MediaSourcePrivateImpl::endOfStream):
(WebKit::MediaSourcePrivateImpl::setTimestampOffset):
(WebKit::WebMediaSourceImpl::WebMediaSourceImpl):
(WebKit::WebMediaSourceImpl::~WebMediaSourceImpl):
(WebKit::WebMediaSourceImpl::open):
* src/WebMediaSourceImpl.h: Added.
(WebKit):
(WebMediaSourceImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/MediaSourcePrivate.h [new file with mode: 0644]
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/public/WebMediaPlayer.h
Source/WebKit/chromium/public/WebMediaPlayerClient.h
Source/WebKit/chromium/public/WebMediaSource.h [new file with mode: 0644]
Source/WebKit/chromium/public/WebMediaSourceClient.h [new file with mode: 0644]
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
Source/WebKit/chromium/src/WebMediaSourceImpl.cpp [new file with mode: 0644]
Source/WebKit/chromium/src/WebMediaSourceImpl.h [new file with mode: 0644]