[GTK][GStreamer][MSE] Crash on youtube when MSE is enabled but gstreamer cant find...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 May 2017 14:05:15 +0000 (14:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 May 2017 14:05:15 +0000 (14:05 +0000)
commit61488e5cccf2291a8d6f81f50ec6e2b6a34af253
tree8967b33f2dac00a8af5c146c20cc4154b6f1006a
parent0391fce3e653a31f45bc754e373e74b2a744450d
[GTK][GStreamer][MSE] Crash on youtube when MSE is enabled but gstreamer cant find the decoder element.
https://bugs.webkit.org/show_bug.cgi?id=167120

Patch by Vanessa Chipirrás Navalón <vchipirras@igalia.com> on 2017-05-18
Reviewed by Žan Doberšek.

This is because supportCodecs() doesn't check in runtime which plugins the player has.
So, a static function which returns a map with the plugins has been created. That map is later
used in the supportsCodecs() method to check if the requested codec matches any of the map.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
The declaration is moved into this class.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::isAvailable): This function calls the implementation of
initializeGstreamerAndRegisterWebKitElements function.
(WebCore::MediaPlayerPrivateGStreamer::load): Ditto
(WebCore::mimeTypeSet): Ditto
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: It is static type to expose
initializeGStreamerAndRegisterWebKitElements() function to be called from internal function
"which runs before MediaPlayerPrivateGStreamerBase initialization but needs to have GStreamer initialized".
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::codecSet): It returns a map with the plugins has been created.
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs): To check if the requested codec
matches any of the map from codecSet().

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp