Title: [180641] trunk
Revision
180641
Author
commit-qu...@webkit.org
Date
2015-02-25 14:37:09 -0800 (Wed, 25 Feb 2015)

Log Message

[WinCairo] WinLauncher is not starting on Vista.
https://bugs.webkit.org/show_bug.cgi?id=141905

Patch by pe...@outlook.com <pe...@outlook.com> on 2015-02-25
Reviewed by Alex Christensen.

We have to soft link with Media Foundation functions to be able
to start on Vista and WinXP.

Source/WebCore:

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::createSession):
(WebCore::MediaPlayerPrivateMediaFoundation::endSession):
(WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
(WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
(WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
(WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):

WebKitLibraries:

* win/tools/vsprops/WinCairo.props: Remove Media Foundation input libraries.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (180640 => 180641)


--- trunk/Source/WebCore/ChangeLog	2015-02-25 22:35:47 UTC (rev 180640)
+++ trunk/Source/WebCore/ChangeLog	2015-02-25 22:37:09 UTC (rev 180641)
@@ -1,3 +1,23 @@
+2015-02-25  pe...@outlook.com  <pe...@outlook.com>
+
+        [WinCairo] WinLauncher is not starting on Vista.
+        https://bugs.webkit.org/show_bug.cgi?id=141905
+
+        Reviewed by Alex Christensen.
+
+        We have to soft link with Media Foundation functions to be able
+        to start on Vista and WinXP.
+
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
+        (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
+        (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
+        (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
+        (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
+        (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
+        (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
+        (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
+
 2015-02-25  Beth Dakin  <bda...@apple.com>
 
         REGRESSION (r180018 ): Holding a rubber-band in place can get stuck

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp (180640 => 180641)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2015-02-25 22:35:47 UTC (rev 180640)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2015-02-25 22:37:09 UTC (rev 180641)
@@ -32,11 +32,25 @@
 #include "GraphicsContext.h"
 #include "HostWindow.h"
 #include "NotImplemented.h"
+#include "SoftLinking.h"
 
 #if USE(MEDIA_FOUNDATION)
 
 #include <wtf/MainThread.h>
 
+SOFT_LINK_LIBRARY(Mf);
+SOFT_LINK_OPTIONAL(Mf, MFCreateSourceResolver, HRESULT, STDAPICALLTYPE, (IMFSourceResolver**));
+SOFT_LINK_OPTIONAL(Mf, MFCreateMediaSession, HRESULT, STDAPICALLTYPE, (IMFAttributes*, IMFMediaSession**));
+SOFT_LINK_OPTIONAL(Mf, MFCreateTopology, HRESULT, STDAPICALLTYPE, (IMFTopology**));
+SOFT_LINK_OPTIONAL(Mf, MFCreateTopologyNode, HRESULT, STDAPICALLTYPE, (MF_TOPOLOGY_TYPE, IMFTopologyNode**));
+SOFT_LINK_OPTIONAL(Mf, MFGetService, HRESULT, STDAPICALLTYPE, (IUnknown*, REFGUID, REFIID, LPVOID*));
+SOFT_LINK_OPTIONAL(Mf, MFCreateAudioRendererActivate, HRESULT, STDAPICALLTYPE, (IMFActivate**));
+SOFT_LINK_OPTIONAL(Mf, MFCreateVideoRendererActivate, HRESULT, STDAPICALLTYPE, (HWND, IMFActivate**));
+
+SOFT_LINK_LIBRARY(Mfplat);
+SOFT_LINK_OPTIONAL(Mfplat, MFStartup, HRESULT, STDAPICALLTYPE, (ULONG, DWORD));
+SOFT_LINK_OPTIONAL(Mfplat, MFShutdown, HRESULT, STDAPICALLTYPE, ());
+
 namespace WebCore {
 
 MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer* player) 
@@ -223,12 +237,15 @@
 
 bool MediaPlayerPrivateMediaFoundation::createSession()
 {
-    if (FAILED(MFStartup(MF_VERSION, MFSTARTUP_FULL)))
+    if (!MFStartupPtr() || !MFCreateMediaSessionPtr())
         return false;
 
-    if (FAILED(MFCreateMediaSession(nullptr, &m_mediaSession)))
+    if (FAILED(MFStartupPtr()(MF_VERSION, MFSTARTUP_FULL)))
         return false;
 
+    if (FAILED(MFCreateMediaSessionPtr()(nullptr, &m_mediaSession)))
+        return false;
+
     // Get next event.
     AsyncCallback* callback = new AsyncCallback(this, true);
     HRESULT hr = m_mediaSession->BeginGetEvent(callback, nullptr);
@@ -244,7 +261,10 @@
         m_mediaSession = nullptr;
     }
 
-    HRESULT hr = MFShutdown();
+    if (!MFShutdownPtr())
+        return false;
+
+    HRESULT hr = MFShutdownPtr()();
     ASSERT(SUCCEEDED(hr));
 
     return true;
@@ -252,9 +272,12 @@
 
 bool MediaPlayerPrivateMediaFoundation::startCreateMediaSource(const String& url)
 {
-    if (FAILED(MFCreateSourceResolver(&m_sourceResolver)))
+    if (!MFCreateSourceResolverPtr())
         return false;
 
+    if (FAILED(MFCreateSourceResolverPtr()(&m_sourceResolver)))
+        return false;
+
     COMPtr<IUnknown> cancelCookie;
     Vector<UChar> urlSource = url.charactersWithNullTermination();
 
@@ -293,6 +316,9 @@
 {
     COMPtr<IMFMediaEvent> event;
 
+    if (!m_mediaSession)
+        return false;
+
     // Get the event from the event queue.
     HRESULT hr = m_mediaSession->EndGetEvent(asyncResult, &event);
     if (FAILED(hr))
@@ -330,8 +356,11 @@
 
 bool MediaPlayerPrivateMediaFoundation::createTopologyFromSource()
 {
+    if (!MFCreateTopologyPtr())
+        return false;
+
     // Create a new topology.
-    if (FAILED(MFCreateTopology(&m_topology)))
+    if (FAILED(MFCreateTopologyPtr()(&m_topology)))
         return false;
 
     // Create the presentation descriptor for the media source.
@@ -450,6 +479,9 @@
 
 bool MediaPlayerPrivateMediaFoundation::createOutputNode(COMPtr<IMFStreamDescriptor> sourceSD, COMPtr<IMFTopologyNode>& node)
 {
+    if (!MFCreateTopologyNodePtr() || !MFCreateAudioRendererActivatePtr() || !MFCreateVideoRendererActivatePtr())
+        return false;
+
     if (!sourceSD)
         return false;
 
@@ -468,19 +500,19 @@
         return false;
 
     // Create a downstream node.
-    if (FAILED(MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &node)))
+    if (FAILED(MFCreateTopologyNodePtr()(MF_TOPOLOGY_OUTPUT_NODE, &node)))
         return false;
 
     // Create an IMFActivate object for the renderer, based on the media type.
     COMPtr<IMFActivate> rendererActivate;
     if (MFMediaType_Audio == guidMajorType) {
         // Create the audio renderer.
-        if (FAILED(MFCreateAudioRendererActivate(&rendererActivate)))
+        if (FAILED(MFCreateAudioRendererActivatePtr()(&rendererActivate)))
             return false;
         m_hasAudio = true;
     } else if (MFMediaType_Video == guidMajorType) {
         // Create the video renderer.
-        if (FAILED(MFCreateVideoRendererActivate(m_hwndVideo, &rendererActivate)))
+        if (FAILED(MFCreateVideoRendererActivatePtr()(m_hwndVideo, &rendererActivate)))
             return false;
         m_hasVideo = true;
     } else
@@ -495,11 +527,14 @@
 
 bool MediaPlayerPrivateMediaFoundation::createSourceStreamNode(COMPtr<IMFStreamDescriptor> sourceSD, COMPtr<IMFTopologyNode>& node)
 {
+    if (!MFCreateTopologyNodePtr())
+        return false;
+
     if (!m_mediaSource || !m_sourcePD || !sourceSD)
         return false;
 
     // Create the source-stream node.
-    HRESULT hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &node);
+    HRESULT hr = MFCreateTopologyNodePtr()(MF_TOPOLOGY_SOURCESTREAM_NODE, &node);
     if (FAILED(hr))
         return false;
 
@@ -533,9 +568,12 @@
 
 void MediaPlayerPrivateMediaFoundation::onTopologySet()
 {
-    if (FAILED(MFGetService(m_mediaSession.get(), MR_VIDEO_RENDER_SERVICE, IID_PPV_ARGS(&m_videoDisplay))))
+    if (!MFGetServicePtr())
         return;
 
+    if (FAILED(MFGetServicePtr()(m_mediaSession.get(), MR_VIDEO_RENDER_SERVICE, IID_PPV_ARGS(&m_videoDisplay))))
+        return;
+
     ASSERT(m_videoDisplay);
 
     RECT rc = { 0, 0, m_size.width(), m_size.height() };

Modified: trunk/WebKitLibraries/ChangeLog (180640 => 180641)


--- trunk/WebKitLibraries/ChangeLog	2015-02-25 22:35:47 UTC (rev 180640)
+++ trunk/WebKitLibraries/ChangeLog	2015-02-25 22:37:09 UTC (rev 180641)
@@ -1,3 +1,15 @@
+2015-02-25  pe...@outlook.com  <pe...@outlook.com>
+
+        [WinCairo] WinLauncher is not starting on Vista.
+        https://bugs.webkit.org/show_bug.cgi?id=141905
+
+        Reviewed by Alex Christensen.
+
+        We have to soft link with Media Foundation functions to be able
+        to start on Vista and WinXP.
+
+        * win/tools/vsprops/WinCairo.props: Remove Media Foundation input libraries.
+
 2015-02-03  Brent Fulgham  <bfulg...@apple.com>
 
         [Win] Unreviewed build fix. Turn on feature flags for items

Modified: trunk/WebKitLibraries/win/tools/vsprops/WinCairo.props (180640 => 180641)


--- trunk/WebKitLibraries/win/tools/vsprops/WinCairo.props	2015-02-25 22:35:47 UTC (rev 180640)
+++ trunk/WebKitLibraries/win/tools/vsprops/WinCairo.props	2015-02-25 22:37:09 UTC (rev 180641)
@@ -9,7 +9,7 @@
       <PreprocessorDefinitions>WIN_CAIRO=1;WTF_PLATFORM_WIN_CAIRO=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>cairo.lib;libjpeg.lib;zdll.lib;libpng.lib;Mf.lib;Mfplat.lib;Mfuuid.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>cairo.lib;libjpeg.lib;zdll.lib;libpng.lib;Mfuuid.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>$(WebKit_Libraries)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to