diff options
Diffstat (limited to 'src/plugins/directshow/common/directshowpin.cpp')
-rw-r--r-- | src/plugins/directshow/common/directshowpin.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/plugins/directshow/common/directshowpin.cpp b/src/plugins/directshow/common/directshowpin.cpp index 390d410a4..d8129748c 100644 --- a/src/plugins/directshow/common/directshowpin.cpp +++ b/src/plugins/directshow/common/directshowpin.cpp @@ -45,11 +45,12 @@ #include <qdebug.h> +#include <mutex> + QT_BEGIN_NAMESPACE DirectShowPin::DirectShowPin(DirectShowBaseFilter *filter, const QString &name, PIN_DIRECTION direction) - : m_mutex(QMutex::Recursive) - , m_filter(filter) + : m_filter(filter) , m_name(name) , m_direction(direction) { @@ -63,7 +64,7 @@ HRESULT DirectShowPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) return E_POINTER; HRESULT hr = E_FAIL; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (m_peerPin) return VFW_E_ALREADY_CONNECTED; @@ -169,7 +170,7 @@ HRESULT DirectShowPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE * if (!pConnector || !pmt) return E_POINTER; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (m_peerPin) return VFW_E_ALREADY_CONNECTED; @@ -206,7 +207,7 @@ HRESULT DirectShowPin::ReceiveConnection(IPin *pConnector, const AM_MEDIA_TYPE * HRESULT DirectShowPin::Disconnect() { - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (m_filter->state() != State_Stopped) return VFW_E_NOT_STOPPED; @@ -232,7 +233,7 @@ HRESULT DirectShowPin::ConnectedTo(IPin **ppPin) if (!ppPin) return E_POINTER; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (!m_peerPin) { *ppPin = nullptr; return VFW_E_NOT_CONNECTED; @@ -247,7 +248,7 @@ HRESULT DirectShowPin::ConnectionMediaType(AM_MEDIA_TYPE *pmt) if (!pmt) return E_POINTER; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (!m_peerPin) { DirectShowMediaType::init(pmt); return VFW_E_NOT_CONNECTED; @@ -531,14 +532,14 @@ HRESULT DirectShowInputPin::EndOfStream() HRESULT DirectShowInputPin::BeginFlush() { - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); m_flushing = true; return S_OK; } HRESULT DirectShowInputPin::EndFlush() { - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); m_flushing = false; m_inErrorState = false; return S_OK; @@ -549,7 +550,7 @@ HRESULT DirectShowInputPin::GetAllocator(IMemAllocator **ppAllocator) if (!ppAllocator) return E_POINTER; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (!m_allocator) { m_allocator = com_new<IMemAllocator>(CLSID_MemoryAllocator);; @@ -570,7 +571,7 @@ HRESULT DirectShowInputPin::NotifyAllocator(IMemAllocator *pAllocator, BOOL bRea if (!pAllocator) return E_POINTER; - QMutexLocker locker(&m_mutex); + const std::lock_guard<QRecursiveMutex> locker(m_mutex); if (m_allocator) m_allocator->Release(); |