src/3rdparty/phonon/ds9/backend.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    39 
    39 
    40 namespace Phonon
    40 namespace Phonon
    41 {
    41 {
    42     namespace DS9
    42     namespace DS9
    43     {
    43     {
       
    44         QMutex *Backend::directShowMutex = 0;
       
    45 
    44         bool Backend::AudioMoniker::operator==(const AudioMoniker &other)
    46         bool Backend::AudioMoniker::operator==(const AudioMoniker &other)
    45         {
    47         {
    46             return other->IsEqual(*this) == S_OK;
    48             return other->IsEqual(*this) == S_OK;
    47         }
    49         }
    48 
    50 
    49 
    51 
    50         Backend::Backend(QObject *parent, const QVariantList &)
    52         Backend::Backend(QObject *parent, const QVariantList &)
    51             : QObject(parent)
    53             : QObject(parent)
    52         {
    54         {
       
    55             directShowMutex = &m_directShowMutex;
       
    56 
    53             ::CoInitialize(0);
    57             ::CoInitialize(0);
    54 
    58 
    55             //registering meta types
    59             //registering meta types
    56             qRegisterMetaType<HRESULT>("HRESULT");
    60             qRegisterMetaType<HRESULT>("HRESULT");
    57             qRegisterMetaType<Graph>("Graph");
    61             qRegisterMetaType<Graph>("Graph");
    60         Backend::~Backend()
    64         Backend::~Backend()
    61         {
    65         {
    62             m_audioOutputs.clear();
    66             m_audioOutputs.clear();
    63             m_audioEffects.clear();
    67             m_audioEffects.clear();
    64             ::CoUninitialize();
    68             ::CoUninitialize();
    65         }
    69 
    66 
    70             directShowMutex = 0;
    67         QMutex *Backend::directShowMutex()
       
    68         {
       
    69             return &qobject_cast<Backend*>(qt_plugin_instance())->m_directShowMutex;
       
    70         }
    71         }
    71 
    72 
    72         QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)
    73         QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args)
    73         {
    74         {
    74             switch (c)
    75             switch (c)