WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-162899-20161021212226.patch (text/plain), 18.19 KB, created by
Enrique Ocaña
on 2016-10-21 14:26:07 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Enrique Ocaña
Created:
2016-10-21 14:26:07 PDT
Size:
18.19 KB
patch
obsolete
>Subversion Revision: 207639 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b3f4ff345bed8a40df0038294f8f3e9a942b603a..75fe0a0ab3ed095ead8006413803a18ce04f583e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,31 @@ > 2016-10-04 Enrique Ocaña González <eocanha@igalia.com> > >+ [GStreamer][MSE] MediaSourceGStreamer refactoring >+ https://bugs.webkit.org/show_bug.cgi?id=162899 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move MediaSourceGStreamer to the mse directory, manage SourceBufferPrivates and delegate WebKitMediaSrc operations to the MSE private player. >+ >+ * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp. >+ (WebCore::MediaSourceGStreamer::open): >+ (WebCore::MediaSourceGStreamer::MediaSourceGStreamer): >+ (WebCore::MediaSourceGStreamer::~MediaSourceGStreamer): >+ (WebCore::MediaSourceGStreamer::addSourceBuffer): >+ (WebCore::MediaSourceGStreamer::removeSourceBuffer): >+ (WebCore::MediaSourceGStreamer::durationChanged): >+ (WebCore::MediaSourceGStreamer::markEndOfStream): >+ (WebCore::MediaSourceGStreamer::unmarkEndOfStream): >+ (WebCore::MediaSourceGStreamer::readyState): >+ (WebCore::MediaSourceGStreamer::setReadyState): >+ (WebCore::MediaSourceGStreamer::waitForSeekCompleted): >+ (WebCore::MediaSourceGStreamer::seekCompleted): >+ (WebCore::MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState): >+ (WebCore::MediaSourceGStreamer::buffered): >+ * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h: Renamed from Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h. >+ >+2016-10-04 Enrique Ocaña González <eocanha@igalia.com> >+ > [GStreamer][MSE] SourceBufferPrivateGStreamer refactoring > https://bugs.webkit.org/show_bug.cgi?id=162898 > >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp >deleted file mode 100644 >index 4913fe8ecbbe3b6eead666b4b4bfb3f13f0525a1..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.cpp >+++ /dev/null >@@ -1,107 +0,0 @@ >-/* >- * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013 Orange >- * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com> >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions are >- * met: >- * >- * * Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * * Redistributions in binary form must reproduce the above >- * copyright notice, this list of conditions and the following disclaimer >- * in the documentation and/or other materials provided with the >- * distribution. >- * * Neither the name of Google Inc. nor the names of its >- * contributors may be used to endorse or promote products derived from >- * this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "MediaSourceGStreamer.h" >- >-#if ENABLE(MEDIA_SOURCE) && USE(GSTREAMER) >- >-#include "NotImplemented.h" >-#include "SourceBufferPrivateGStreamer.h" >-#include "WebKitMediaSourceGStreamer.h" >- >-#include <wtf/glib/GRefPtr.h> >- >-namespace WebCore { >- >-void MediaSourceGStreamer::open(MediaSourcePrivateClient* mediaSource, WebKitMediaSrc* src) >-{ >- ASSERT(mediaSource); >- mediaSource->setPrivateAndOpen(adoptRef(*new MediaSourceGStreamer(mediaSource, src))); >-} >- >-MediaSourceGStreamer::MediaSourceGStreamer(MediaSourcePrivateClient* mediaSource, WebKitMediaSrc* src) >- : m_client(adoptRef(new MediaSourceClientGStreamer(src))) >- , m_mediaSource(mediaSource) >- , m_readyState(MediaPlayer::HaveNothing) >-{ >- ASSERT(m_client); >-} >- >-MediaSourceGStreamer::~MediaSourceGStreamer() >-{ >-} >- >-MediaSourceGStreamer::AddStatus MediaSourceGStreamer::addSourceBuffer(const ContentType& contentType, RefPtr<SourceBufferPrivate>& sourceBufferPrivate) >-{ >- RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivateGStreamer = SourceBufferPrivateGStreamer::create(*m_client, contentType); >- sourceBufferPrivate = sourceBufferPrivateGStreamer; >- return m_client->addSourceBuffer(sourceBufferPrivateGStreamer, contentType); >-} >- >-void MediaSourceGStreamer::durationChanged() >-{ >- m_client->durationChanged(m_mediaSource->duration()); >-} >- >-void MediaSourceGStreamer::markEndOfStream(EndOfStreamStatus status) >-{ >- m_client->markEndOfStream(status); >-} >- >-void MediaSourceGStreamer::unmarkEndOfStream() >-{ >- notImplemented(); >-} >- >-MediaPlayer::ReadyState MediaSourceGStreamer::readyState() const >-{ >- return m_readyState; >-} >- >-void MediaSourceGStreamer::setReadyState(MediaPlayer::ReadyState state) >-{ >- m_readyState = state; >-} >- >-void MediaSourceGStreamer::waitForSeekCompleted() >-{ >- notImplemented(); >-} >- >-void MediaSourceGStreamer::seekCompleted() >-{ >- notImplemented(); >-} >- >-} >-#endif >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h >deleted file mode 100644 >index f30b29fc996887e5d45ae6487dee2468f1226be2..0000000000000000000000000000000000000000 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaSourceGStreamer.h >+++ /dev/null >@@ -1,70 +0,0 @@ >-/* >- * Copyright (C) 2013 Google Inc. All rights reserved. >- * Copyright (C) 2013 Orange >- * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com> >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions are >- * met: >- * >- * * Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * * Redistributions in binary form must reproduce the above >- * copyright notice, this list of conditions and the following disclaimer >- * in the documentation and/or other materials provided with the >- * distribution. >- * * Neither the name of Google Inc. nor the names of its >- * contributors may be used to endorse or promote products derived from >- * this software without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#ifndef MediaSourceGStreamer_h >-#define MediaSourceGStreamer_h >- >-#if ENABLE(MEDIA_SOURCE) && USE(GSTREAMER) >-#include "MediaSource.h" >-#include "WebKitMediaSourceGStreamer.h" >- >-namespace WebCore { >- >-// FIXME: Should this be called MediaSourcePrivateGStreamer? >-class MediaSourceGStreamer final : public MediaSourcePrivate { >-public: >- static void open(MediaSourcePrivateClient*, WebKitMediaSrc*); >- virtual ~MediaSourceGStreamer(); >- >- virtual AddStatus addSourceBuffer(const ContentType&, RefPtr<SourceBufferPrivate>&); >- virtual void durationChanged(); >- virtual void markEndOfStream(EndOfStreamStatus); >- virtual void unmarkEndOfStream(); >- >- virtual MediaPlayer::ReadyState readyState() const; >- virtual void setReadyState(MediaPlayer::ReadyState); >- >- virtual void waitForSeekCompleted(); >- virtual void seekCompleted(); >- >-private: >- MediaSourceGStreamer(MediaSourcePrivateClient*, WebKitMediaSrc*); >- >- RefPtr<MediaSourceClientGStreamer> m_client; >- MediaSourcePrivateClient* m_mediaSource; >- MediaPlayer::ReadyState m_readyState; >-}; >- >-} >- >-#endif >-#endif >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..92095b6106716420086beb272d441144ae8d97d7 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp >@@ -0,0 +1,139 @@ >+/* >+ * Copyright (C) 2013 Google Inc. All rights reserved. >+ * Copyright (C) 2013 Orange >+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com> >+ * Copyright (C) 2015, 2016 Metrological Group B.V. >+ * Copyright (C) 2015, 2016 Igalia, S.L >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following disclaimer >+ * in the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "MediaSourceGStreamer.h" >+ >+#if ENABLE(MEDIA_SOURCE) && USE(GSTREAMER) >+ >+#include "ContentType.h" >+#include "MediaPlayerPrivateGStreamer.h" >+#include "MediaPlayerPrivateGStreamerMSE.h" >+#include "MediaSourceClientGStreamerMSE.h" >+#include "NotImplemented.h" >+#include "SourceBufferPrivateGStreamer.h" >+#include "TimeRanges.h" >+#include "WebKitMediaSourceGStreamer.h" >+#include <wtf/PassRefPtr.h> >+#include <wtf/glib/GRefPtr.h> >+ >+namespace WebCore { >+ >+void MediaSourceGStreamer::open(MediaSourcePrivateClient& mediaSource, MediaPlayerPrivateGStreamerMSE& playerPrivate) >+{ >+ mediaSource.setPrivateAndOpen(adoptRef(*new MediaSourceGStreamer(mediaSource, playerPrivate))); >+} >+ >+MediaSourceGStreamer::MediaSourceGStreamer(MediaSourcePrivateClient& mediaSource, MediaPlayerPrivateGStreamerMSE& playerPrivate) >+ : MediaSourcePrivate() >+ , m_client(MediaSourceClientGStreamerMSE::create(playerPrivate)) >+ , m_mediaSource(mediaSource) >+ , m_playerPrivate(playerPrivate) >+{ >+} >+ >+MediaSourceGStreamer::~MediaSourceGStreamer() >+{ >+ for (auto& sourceBufferPrivate : m_sourceBuffers) >+ sourceBufferPrivate->clearMediaSource(); >+} >+ >+MediaSourceGStreamer::AddStatus MediaSourceGStreamer::addSourceBuffer(const ContentType& contentType, RefPtr<SourceBufferPrivate>& sourceBufferPrivate) >+{ >+ sourceBufferPrivate = SourceBufferPrivateGStreamer::create(this, m_client.get(), contentType); >+ RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivateGStreamer = static_cast<SourceBufferPrivateGStreamer*>(sourceBufferPrivate.get()); >+ m_sourceBuffers.add(sourceBufferPrivateGStreamer); >+ return m_client->addSourceBuffer(sourceBufferPrivateGStreamer, contentType); >+} >+ >+void MediaSourceGStreamer::removeSourceBuffer(SourceBufferPrivate* sourceBufferPrivate) >+{ >+ RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivateGStreamer = static_cast<SourceBufferPrivateGStreamer*>(sourceBufferPrivate); >+ ASSERT(m_sourceBuffers.contains(sourceBufferPrivateGStreamer)); >+ >+ sourceBufferPrivateGStreamer->clearMediaSource(); >+ m_sourceBuffers.remove(sourceBufferPrivateGStreamer); >+ m_activeSourceBuffers.remove(sourceBufferPrivateGStreamer.get()); >+} >+ >+void MediaSourceGStreamer::durationChanged() >+{ >+ m_client->durationChanged(m_mediaSource->duration()); >+} >+ >+void MediaSourceGStreamer::markEndOfStream(EndOfStreamStatus status) >+{ >+ m_client->markEndOfStream(status); >+} >+ >+void MediaSourceGStreamer::unmarkEndOfStream() >+{ >+ notImplemented(); >+} >+ >+MediaPlayer::ReadyState MediaSourceGStreamer::readyState() const >+{ >+ return m_playerPrivate.readyState(); >+} >+ >+void MediaSourceGStreamer::setReadyState(MediaPlayer::ReadyState state) >+{ >+ m_playerPrivate.setReadyState(state); >+} >+ >+void MediaSourceGStreamer::waitForSeekCompleted() >+{ >+ m_playerPrivate.waitForSeekCompleted(); >+} >+ >+void MediaSourceGStreamer::seekCompleted() >+{ >+ m_playerPrivate.seekCompleted(); >+} >+ >+void MediaSourceGStreamer::sourceBufferPrivateDidChangeActiveState(SourceBufferPrivateGStreamer* sourceBufferPrivate, bool isActive) >+{ >+ if (!isActive) >+ m_activeSourceBuffers.remove(sourceBufferPrivate); >+ else if (!m_activeSourceBuffers.contains(sourceBufferPrivate)) >+ m_activeSourceBuffers.add(sourceBufferPrivate); >+} >+ >+std::unique_ptr<PlatformTimeRanges> MediaSourceGStreamer::buffered() >+{ >+ return m_mediaSource->buffered(); >+} >+ >+} >+#endif >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h >new file mode 100644 >index 0000000000000000000000000000000000000000..c9a09fa0439fef8eb8db7505fcbc97e052378ea6 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceGStreamer.h >@@ -0,0 +1,88 @@ >+/* >+ * Copyright (C) 2013 Google Inc. All rights reserved. >+ * Copyright (C) 2013 Orange >+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com> >+ * Copyright (C) 2015, 2016 Metrological Group B.V. >+ * Copyright (C) 2015, 2016 Igalia, S.L >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions are >+ * met: >+ * >+ * * Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * * Redistributions in binary form must reproduce the above >+ * copyright notice, this list of conditions and the following disclaimer >+ * in the documentation and/or other materials provided with the >+ * distribution. >+ * * Neither the name of Google Inc. nor the names of its >+ * contributors may be used to endorse or promote products derived from >+ * this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(MEDIA_SOURCE) && USE(GSTREAMER) >+#include "MediaSourcePrivate.h" >+ >+#include <wtf/Forward.h> >+#include <wtf/HashSet.h> >+ >+typedef struct _WebKitMediaSrc WebKitMediaSrc; >+ >+namespace WebCore { >+ >+class SourceBufferPrivateGStreamer; >+class MediaSourceClientGStreamerMSE; >+class MediaPlayerPrivateGStreamerMSE; >+class PlatformTimeRanges; >+ >+// FIXME: Should this be called MediaSourcePrivateGStreamer? >+class MediaSourceGStreamer final : public MediaSourcePrivate { >+public: >+ static void open(MediaSourcePrivateClient&, MediaPlayerPrivateGStreamerMSE&); >+ virtual ~MediaSourceGStreamer(); >+ >+ MediaSourceClientGStreamerMSE& client() { return m_client.get(); } >+ AddStatus addSourceBuffer(const ContentType&, RefPtr<SourceBufferPrivate>&) override; >+ void removeSourceBuffer(SourceBufferPrivate*); >+ >+ void durationChanged() override; >+ void markEndOfStream(EndOfStreamStatus) override; >+ void unmarkEndOfStream() override; >+ >+ MediaPlayer::ReadyState readyState() const override; >+ void setReadyState(MediaPlayer::ReadyState) override; >+ >+ void waitForSeekCompleted() override; >+ void seekCompleted() override; >+ >+ void sourceBufferPrivateDidChangeActiveState(SourceBufferPrivateGStreamer*, bool); >+ >+ std::unique_ptr<PlatformTimeRanges> buffered(); >+ >+private: >+ MediaSourceGStreamer(MediaSourcePrivateClient&, MediaPlayerPrivateGStreamerMSE&); >+ >+ HashSet<RefPtr<SourceBufferPrivateGStreamer>> m_sourceBuffers; >+ HashSet<SourceBufferPrivateGStreamer*> m_activeSourceBuffers; >+ Ref<MediaSourceClientGStreamerMSE> m_client; >+ Ref<MediaSourcePrivateClient> m_mediaSource; >+ MediaPlayerPrivateGStreamerMSE& m_playerPrivate; >+}; >+ >+} >+ >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 162899
:
290591
|
291762
|
292254
|
292408
|
292893