Changeset 180641 in webkit


Ignore:
Timestamp:
Feb 25, 2015 2:37:09 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by peavo@outlook.com <peavo@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.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r180634 r180641  
     12015-02-25  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [WinCairo] WinLauncher is not starting on Vista.
     4        https://bugs.webkit.org/show_bug.cgi?id=141905
     5
     6        Reviewed by Alex Christensen.
     7
     8        We have to soft link with Media Foundation functions to be able
     9        to start on Vista and WinXP.
     10
     11        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
     12        (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
     13        (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
     14        (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
     15        (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
     16        (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
     17        (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
     18        (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
     19        (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
     20
    1212015-02-25  Beth Dakin  <bdakin@apple.com>
    222
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp

    r180541 r180641  
    3333#include "HostWindow.h"
    3434#include "NotImplemented.h"
     35#include "SoftLinking.h"
    3536
    3637#if USE(MEDIA_FOUNDATION)
    3738
    3839#include <wtf/MainThread.h>
     40
     41SOFT_LINK_LIBRARY(Mf);
     42SOFT_LINK_OPTIONAL(Mf, MFCreateSourceResolver, HRESULT, STDAPICALLTYPE, (IMFSourceResolver**));
     43SOFT_LINK_OPTIONAL(Mf, MFCreateMediaSession, HRESULT, STDAPICALLTYPE, (IMFAttributes*, IMFMediaSession**));
     44SOFT_LINK_OPTIONAL(Mf, MFCreateTopology, HRESULT, STDAPICALLTYPE, (IMFTopology**));
     45SOFT_LINK_OPTIONAL(Mf, MFCreateTopologyNode, HRESULT, STDAPICALLTYPE, (MF_TOPOLOGY_TYPE, IMFTopologyNode**));
     46SOFT_LINK_OPTIONAL(Mf, MFGetService, HRESULT, STDAPICALLTYPE, (IUnknown*, REFGUID, REFIID, LPVOID*));
     47SOFT_LINK_OPTIONAL(Mf, MFCreateAudioRendererActivate, HRESULT, STDAPICALLTYPE, (IMFActivate**));
     48SOFT_LINK_OPTIONAL(Mf, MFCreateVideoRendererActivate, HRESULT, STDAPICALLTYPE, (HWND, IMFActivate**));
     49
     50SOFT_LINK_LIBRARY(Mfplat);
     51SOFT_LINK_OPTIONAL(Mfplat, MFStartup, HRESULT, STDAPICALLTYPE, (ULONG, DWORD));
     52SOFT_LINK_OPTIONAL(Mfplat, MFShutdown, HRESULT, STDAPICALLTYPE, ());
    3953
    4054namespace WebCore {
     
    224238bool MediaPlayerPrivateMediaFoundation::createSession()
    225239{
    226     if (FAILED(MFStartup(MF_VERSION, MFSTARTUP_FULL)))
    227         return false;
    228 
    229     if (FAILED(MFCreateMediaSession(nullptr, &m_mediaSession)))
     240    if (!MFStartupPtr() || !MFCreateMediaSessionPtr())
     241        return false;
     242
     243    if (FAILED(MFStartupPtr()(MF_VERSION, MFSTARTUP_FULL)))
     244        return false;
     245
     246    if (FAILED(MFCreateMediaSessionPtr()(nullptr, &m_mediaSession)))
    230247        return false;
    231248
     
    245262    }
    246263
    247     HRESULT hr = MFShutdown();
     264    if (!MFShutdownPtr())
     265        return false;
     266
     267    HRESULT hr = MFShutdownPtr()();
    248268    ASSERT(SUCCEEDED(hr));
    249269
     
    253273bool MediaPlayerPrivateMediaFoundation::startCreateMediaSource(const String& url)
    254274{
    255     if (FAILED(MFCreateSourceResolver(&m_sourceResolver)))
     275    if (!MFCreateSourceResolverPtr())
     276        return false;
     277
     278    if (FAILED(MFCreateSourceResolverPtr()(&m_sourceResolver)))
    256279        return false;
    257280
     
    293316{
    294317    COMPtr<IMFMediaEvent> event;
     318
     319    if (!m_mediaSession)
     320        return false;
    295321
    296322    // Get the event from the event queue.
     
    331357bool MediaPlayerPrivateMediaFoundation::createTopologyFromSource()
    332358{
     359    if (!MFCreateTopologyPtr())
     360        return false;
     361
    333362    // Create a new topology.
    334     if (FAILED(MFCreateTopology(&m_topology)))
     363    if (FAILED(MFCreateTopologyPtr()(&m_topology)))
    335364        return false;
    336365
     
    451480bool MediaPlayerPrivateMediaFoundation::createOutputNode(COMPtr<IMFStreamDescriptor> sourceSD, COMPtr<IMFTopologyNode>& node)
    452481{
     482    if (!MFCreateTopologyNodePtr() || !MFCreateAudioRendererActivatePtr() || !MFCreateVideoRendererActivatePtr())
     483        return false;
     484
    453485    if (!sourceSD)
    454486        return false;
     
    469501
    470502    // Create a downstream node.
    471     if (FAILED(MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &node)))
     503    if (FAILED(MFCreateTopologyNodePtr()(MF_TOPOLOGY_OUTPUT_NODE, &node)))
    472504        return false;
    473505
     
    476508    if (MFMediaType_Audio == guidMajorType) {
    477509        // Create the audio renderer.
    478         if (FAILED(MFCreateAudioRendererActivate(&rendererActivate)))
     510        if (FAILED(MFCreateAudioRendererActivatePtr()(&rendererActivate)))
    479511            return false;
    480512        m_hasAudio = true;
    481513    } else if (MFMediaType_Video == guidMajorType) {
    482514        // Create the video renderer.
    483         if (FAILED(MFCreateVideoRendererActivate(m_hwndVideo, &rendererActivate)))
     515        if (FAILED(MFCreateVideoRendererActivatePtr()(m_hwndVideo, &rendererActivate)))
    484516            return false;
    485517        m_hasVideo = true;
     
    496528bool MediaPlayerPrivateMediaFoundation::createSourceStreamNode(COMPtr<IMFStreamDescriptor> sourceSD, COMPtr<IMFTopologyNode>& node)
    497529{
     530    if (!MFCreateTopologyNodePtr())
     531        return false;
     532
    498533    if (!m_mediaSource || !m_sourcePD || !sourceSD)
    499534        return false;
    500535
    501536    // Create the source-stream node.
    502     HRESULT hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &node);
     537    HRESULT hr = MFCreateTopologyNodePtr()(MF_TOPOLOGY_SOURCESTREAM_NODE, &node);
    503538    if (FAILED(hr))
    504539        return false;
     
    534569void MediaPlayerPrivateMediaFoundation::onTopologySet()
    535570{
    536     if (FAILED(MFGetService(m_mediaSession.get(), MR_VIDEO_RENDER_SERVICE, IID_PPV_ARGS(&m_videoDisplay))))
     571    if (!MFGetServicePtr())
     572        return;
     573
     574    if (FAILED(MFGetServicePtr()(m_mediaSession.get(), MR_VIDEO_RENDER_SERVICE, IID_PPV_ARGS(&m_videoDisplay))))
    537575        return;
    538576
  • trunk/WebKitLibraries/ChangeLog

    r179594 r180641  
     12015-02-25  peavo@outlook.com  <peavo@outlook.com>
     2
     3        [WinCairo] WinLauncher is not starting on Vista.
     4        https://bugs.webkit.org/show_bug.cgi?id=141905
     5
     6        Reviewed by Alex Christensen.
     7
     8        We have to soft link with Media Foundation functions to be able
     9        to start on Vista and WinXP.
     10
     11        * win/tools/vsprops/WinCairo.props: Remove Media Foundation input libraries.
     12
    1132015-02-03  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/WebKitLibraries/win/tools/vsprops/WinCairo.props

    r178671 r180641  
    1010    </ClCompile>
    1111    <Link>
    12       <AdditionalDependencies>cairo.lib;libjpeg.lib;zdll.lib;libpng.lib;Mf.lib;Mfplat.lib;Mfuuid.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
     12      <AdditionalDependencies>cairo.lib;libjpeg.lib;zdll.lib;libpng.lib;Mfuuid.lib;strmiids.lib;%(AdditionalDependencies)</AdditionalDependencies>
    1313      <AdditionalLibraryDirectories>$(WebKit_Libraries)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    1414    </Link>
Note: See TracChangeset for help on using the changeset viewer.