Diff
Modified: trunk/Source/WebCore/ChangeLog (181152 => 181153)
--- trunk/Source/WebCore/ChangeLog 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/ChangeLog 2015-03-06 14:10:11 UTC (rev 181153)
@@ -1,5 +1,40 @@
2015-03-05 Philippe Normand <pnorm...@igalia.com>
+ [MediaStream] new load method for MediaStreamPrivate objects
+ https://bugs.webkit.org/show_bug.cgi?id=142346
+
+ Reviewed by Eric Carlson.
+
+ No new tests, existing mediastream tests cover this use-case.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::loadResource): Use new load method for MediaStreams.
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::NullMediaPlayerPrivate::load): New stub.
+ (WebCore::MediaPlayer::load): New load method for
+ MediaStreamPrivate.
+ (WebCore::MediaPlayer::nextBestMediaEngine): Set a new boolean on
+ the MediaEngineSupportParameters to differenciate with MSE and
+ normal video resources.
+ (WebCore::MediaPlayer::loadWithNextMediaEngine): Defer loading of
+ the MediaStream to the MediaPlayerPrivate backend.
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::MediaEngineSupportParameters::MediaEngineSupportParameters):
+ * platform/graphics/MediaPlayerPrivate.h:
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+ (WebCore::MediaPlayerPrivateAVFoundation::load): New empty load
+ method for MediaStreamPrivate objects.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto.
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+ (WebCore::MediaPlayerPrivateQTKit::load): Ditto.
+ * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
+
+2015-03-05 Philippe Normand <pnorm...@igalia.com>
+
Rename MediaStreamSource to RealtimeMediaSource
https://bugs.webkit.org/show_bug.cgi?id=142330
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (181152 => 181153)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2015-03-06 14:10:11 UTC (rev 181153)
@@ -1221,6 +1221,11 @@
}
} else
#endif
+#if ENABLE(MEDIA_STREAM)
+ if (m_mediaStreamSrcObject)
+ m_player->load(m_mediaStreamSrcObject->privateStream());
+ else
+#endif
if (!m_player->load(url, contentType, keySystem))
mediaLoadingFailed(MediaPlayer::FormatError);
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp 2015-03-06 14:10:11 UTC (rev 181153)
@@ -47,6 +47,10 @@
#include "MediaSourcePrivateClient.h"
#endif
+#if ENABLE(MEDIA_STREAM)
+#include "MediaStreamPrivate.h"
+#endif
+
#if USE(GSTREAMER)
#include "MediaPlayerPrivateGStreamer.h"
#define PlatformMediaEngineClassName MediaPlayerPrivateGStreamer
@@ -85,6 +89,9 @@
#if ENABLE(MEDIA_SOURCE)
virtual void load(const String&, MediaSourcePrivateClient*) { }
#endif
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) { }
+#endif
virtual void cancelLoad() { }
virtual void prepareToPlay() { }
@@ -309,6 +316,9 @@
#if ENABLE(MEDIA_SOURCE)
m_mediaSource = 0;
#endif
+#if ENABLE(MEDIA_STREAM)
+ m_mediaStream = 0;
+#endif
// If the MIME type is missing or is not meaningful, try to figure it out from the URL.
if (m_contentMIMEType.isEmpty() || m_contentMIMEType == applicationOctetStream() || m_contentMIMEType == textPlain()) {
@@ -347,6 +357,18 @@
}
#endif
+#if ENABLE(MEDIA_STREAM)
+bool MediaPlayer::load(MediaStreamPrivate* mediaStream)
+{
+ ASSERT(mediaStream);
+ m_mediaStream = mediaStream;
+ m_keySystem = "";
+ m_contentMIMETypeWasInferredFromExtension = false;
+ loadWithNextMediaEngine(0);
+ return m_currentMediaEngine;
+}
+#endif
+
const MediaPlayerFactory* MediaPlayer::nextBestMediaEngine(const MediaPlayerFactory* current) const
{
MediaEngineSupportParameters parameters;
@@ -359,6 +381,9 @@
#if ENABLE(MEDIA_SOURCE)
parameters.isMediaSource = !!m_mediaSource;
#endif
+#if ENABLE(MEDIA_STREAM)
+ parameters.isMediaStream = !!m_mediaStream;
+#endif
return bestMediaEngineForSupportParameters(parameters, current);
}
@@ -396,6 +421,11 @@
m_private->load(m_url.string(), m_mediaSource.get());
else
#endif
+#if ENABLE(MEDIA_STREAM)
+ if (m_mediaStream)
+ m_private->load(m_mediaStream.get());
+ else
+#endif
m_private->load(m_url.string());
} else {
m_private = std::make_unique<NullMediaPlayerPrivate>(this);
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -74,6 +74,9 @@
#if ENABLE(MEDIA_SOURCE)
class MediaSourcePrivateClient;
#endif
+#if ENABLE(MEDIA_STREAM)
+class MediaStreamPrivate;
+#endif
class MediaPlayerPrivateInterface;
class TextTrackRepresentation;
struct Cookie;
@@ -113,12 +116,18 @@
#if ENABLE(MEDIA_SOURCE)
bool isMediaSource;
#endif
+#if ENABLE(MEDIA_STREAM)
+ bool isMediaStream;
+#endif
MediaEngineSupportParameters()
#if ENABLE(MEDIA_SOURCE)
: isMediaSource(false)
#endif
{
+#if ENABLE(MEDIA_STREAM)
+ isMediaStream = false;
+#endif
}
};
@@ -324,6 +333,9 @@
#if ENABLE(MEDIA_SOURCE)
bool load(const URL&, const ContentType&, MediaSourcePrivateClient*);
#endif
+#if ENABLE(MEDIA_STREAM)
+ bool load(MediaStreamPrivate*);
+#endif
void cancelLoad();
bool visible() const;
@@ -604,6 +616,9 @@
#if ENABLE(MEDIA_SOURCE)
RefPtr<MediaSourcePrivateClient> m_mediaSource;
#endif
+#if ENABLE(MEDIA_STREAM)
+ RefPtr<MediaStreamPrivate> m_mediaStream;
+#endif
};
typedef std::function<std::unique_ptr<MediaPlayerPrivateInterface> (MediaPlayer*)> CreateMediaEnginePlayer;
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -48,6 +48,9 @@
#if ENABLE(MEDIA_SOURCE)
virtual void load(const String& url, MediaSourcePrivateClient*) = 0;
#endif
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) = 0;
+#endif
virtual void cancelLoad() = 0;
virtual void prepareToPlay() { }
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -153,6 +153,9 @@
#if ENABLE(MEDIA_SOURCE)
virtual void load(const String&, MediaSourcePrivateClient*);
#endif
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) { }
+#endif
virtual void cancelLoad() = 0;
virtual void prepareToPlay() override;
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -95,6 +95,9 @@
// MediaPlayerPrivateInterface
virtual void load(const String& url) override;
virtual void load(const String& url, MediaSourcePrivateClient*) override;
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) { }
+#endif
virtual void cancelLoad() override;
virtual void prepareToPlay() override;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2015-03-06 14:10:11 UTC (rev 181153)
@@ -320,6 +320,13 @@
}
#endif
+#if ENABLE(MEDIA_STREAM)
+void MediaPlayerPrivateGStreamer::load(MediaStreamPrivate* mediaStream)
+{
+ notImplemented();
+}
+#endif
+
void MediaPlayerPrivateGStreamer::commitLoad()
{
ASSERT(!m_delayingLoad);
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -76,6 +76,9 @@
#if ENABLE(MEDIA_SOURCE)
void load(const String& url, MediaSourcePrivateClient*);
#endif
+#if ENABLE(MEDIA_STREAM)
+ void load(MediaStreamPrivate*);
+#endif
void commitLoad();
void cancelLoad();
Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (181152 => 181153)
--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -86,6 +86,9 @@
#if ENABLE(MEDIA_SOURCE)
virtual void load(const String&, MediaSourcePrivateClient*);
#endif
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) { }
+#endif
void cancelLoad();
void loadInternal(const String& url);
void resumeLoad();
Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h (181152 => 181153)
--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h 2015-03-06 14:07:13 UTC (rev 181152)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h 2015-03-06 14:10:11 UTC (rev 181153)
@@ -60,6 +60,9 @@
// MediaPlayerPrivate Overrides
virtual void load(const String& url) override;
virtual void load(const String& url, MediaSourcePrivateClient*) override;
+#if ENABLE(MEDIA_STREAM)
+ virtual void load(MediaStreamPrivate*) override { };
+#endif
virtual void cancelLoad() override;
virtual void play() override;
virtual void pause() override;