Commit 5bd327e5 authored by Ghislain MARY's avatar Ghislain MARY

Handle display with a SwapChainPanel widget.

parent b067bca9
/*
MediaEngineNotify.cpp
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "MediaEngineNotify.h"
using namespace libmswinrtvid;
MediaEngineNotify::~MediaEngineNotify()
{
}
void MediaEngineNotify::SetCallback(MediaEngineNotifyCallback^ callback)
{
_callback = callback;
}
IFACEMETHODIMP MediaEngineNotify::EventNotify(DWORD evt, DWORD_PTR param1, DWORD param2)
{
if (evt == MF_MEDIA_ENGINE_EVENT_NOTIFYSTABLESTATE) {
SetEvent(reinterpret_cast<HANDLE>(param1));
} else {
_callback->OnMediaEngineEvent((unsigned int)evt, param1, param2);
}
return S_OK;
}
/*
MediaEngineNotify.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include <wrl.h>
#include <mfmediaengine.h>
namespace libmswinrtvid
{
public interface struct MediaEngineNotifyCallback
{
void OnMediaEngineEvent(uint32 meEvent, uintptr_t param1, uint32 param2) = 0;
};
class MediaEngineNotify :
public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::ClassicCom>, IMFMediaEngineNotify>
{
public:
// MediaEngineNotify
void SetCallback(MediaEngineNotifyCallback^ callback);
// IMFMediaEngineNotify
IFACEMETHOD(EventNotify)(DWORD evt, DWORD_PTR param1, DWORD param2);
private:
virtual ~MediaEngineNotify();
MediaEngineNotifyCallback^ _callback;
};
}
/*
MediaStreamSource.cpp
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "MediaStreamSource.h"
#include <mfapi.h>
#include <wrl.h>
#include <robuffer.h>
using namespace Windows::Media::Core;
using namespace Windows::Media::MediaProperties;
using Microsoft::WRL::ComPtr;
libmswinrtvid::MediaStreamSource::MediaStreamSource()
: mMediaStreamSource(nullptr), mTimeStamp(0LL), mInitialTimeStamp(0LL)
{
mDeferralQueue = ref new Platform::Collections::Vector<SampleRequestDeferral^>();
}
libmswinrtvid::MediaStreamSource::~MediaStreamSource()
{
}
libmswinrtvid::MediaStreamSource^ libmswinrtvid::MediaStreamSource::CreateMediaSource()
{
libmswinrtvid::MediaStreamSource^ streamState = ref new libmswinrtvid::MediaStreamSource();
VideoEncodingProperties^ videoProperties = VideoEncodingProperties::CreateUncompressed(MediaEncodingSubtypes::Nv12, 40, 40);
streamState->mVideoDesc = ref new VideoStreamDescriptor(videoProperties);
streamState->mVideoDesc->EncodingProperties->Width = 40;
streamState->mVideoDesc->EncodingProperties->Height = 40;
streamState->mMediaStreamSource = ref new Windows::Media::Core::MediaStreamSource(streamState->mVideoDesc);
streamState->mMediaStreamSource->SampleRequested += ref new Windows::Foundation::TypedEventHandler<Windows::Media::Core::MediaStreamSource ^, MediaStreamSourceSampleRequestedEventArgs ^>(
[streamState](Windows::Media::Core::MediaStreamSource^ sender, MediaStreamSourceSampleRequestedEventArgs^ args) {
streamState->OnSampleRequested(sender, args);
});
return streamState;
}
void libmswinrtvid::MediaStreamSource::OnSampleRequested(Windows::Media::Core::MediaStreamSource ^sender, MediaStreamSourceSampleRequestedEventArgs ^args)
{
MediaStreamSourceSampleRequest^ request = args->Request;
if (request == nullptr) {
return;
}
mMutex.lock();
if (mSample == nullptr) {
mDeferralQueue->Append(ref new SampleRequestDeferral(request, request->GetDeferral()));
}
else {
AnswerSampleRequest(request);
}
mMutex.unlock();
}
void libmswinrtvid::MediaStreamSource::Feed(Windows::Storage::Streams::IBuffer^ pBuffer, int width, int height)
{
mMutex.lock();
mSample = ref new Sample(pBuffer, width, height);
if (mDeferralQueue->Size > 0) {
SampleRequestDeferral^ deferral = mDeferralQueue->GetAt(0);
mDeferralQueue->RemoveAt(0);
AnswerSampleRequest(deferral->Request);
deferral->Deferral->Complete();
}
mMutex.unlock();
}
void libmswinrtvid::MediaStreamSource::AnswerSampleRequest(Windows::Media::Core::MediaStreamSourceSampleRequest^ sampleRequest)
{
ComPtr<IMFMediaStreamSourceSampleRequest> spRequest;
HRESULT hr = reinterpret_cast<IInspectable*>(sampleRequest)->QueryInterface(spRequest.ReleaseAndGetAddressOf());
if (FAILED(hr)) return;
ComPtr<IMFSample> spSample;
hr = MFCreateSample(spSample.GetAddressOf());
if (FAILED(hr)) return;
LONGLONG timeStamp = GetTickCount64();
if (mInitialTimeStamp == 0) {
mInitialTimeStamp = timeStamp;
}
mTimeStamp = timeStamp;
// Set frame 40ms into the future
LONGLONG sampleTime = (mTimeStamp - mInitialTimeStamp + 40LL) * 10000LL;
spSample->SetSampleTime(sampleTime);
ComPtr<IMFMediaBuffer> mediaBuffer;
if ((mVideoDesc->EncodingProperties->Width != mSample->Width) || (mVideoDesc->EncodingProperties->Height != mSample->Height)) {
mVideoDesc->EncodingProperties->Width = mSample->Width;
mVideoDesc->EncodingProperties->Height = mSample->Height;
}
hr = MFCreate2DMediaBuffer(mVideoDesc->EncodingProperties->Width, mVideoDesc->EncodingProperties->Height, 0x3231564E /* NV12 */, FALSE, mediaBuffer.GetAddressOf());
if (FAILED(hr)) return;
spSample->AddBuffer(mediaBuffer.Get());
RenderFrame(mediaBuffer.Get());
spRequest->SetSample(spSample.Get());
}
void libmswinrtvid::MediaStreamSource::RenderFrame(IMFMediaBuffer* mediaBuffer)
{
ComPtr<IMF2DBuffer2> imageBuffer;
if (FAILED(mediaBuffer->QueryInterface(imageBuffer.GetAddressOf()))) return;
ComPtr<Windows::Storage::Streams::IBufferByteAccess> sampleByteAccess;
if (FAILED(reinterpret_cast<IInspectable*>(mSample->Buffer)->QueryInterface(IID_PPV_ARGS(&sampleByteAccess)))) return;
BYTE* destRawData;
BYTE* buffer;
LONG pitch;
DWORD destMediaBufferSize;
if (FAILED(imageBuffer->Lock2DSize(MF2DBuffer_LockFlags_Write, &destRawData, &pitch, &buffer, &destMediaBufferSize))) return;
BYTE* srcRawData = nullptr;
sampleByteAccess->Buffer(&srcRawData);
memcpy(destRawData, srcRawData, destMediaBufferSize);
imageBuffer->Unlock2D();
}
/*
MediaStreamSource.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include <Mfidl.h>
#include <mutex>
#include <collection.h>
namespace libmswinrtvid
{
private ref class SampleRequestDeferral sealed
{
public:
SampleRequestDeferral(Windows::Media::Core::MediaStreamSourceSampleRequest^ request, Windows::Media::Core::MediaStreamSourceSampleRequestDeferral^ deferral)
{
this->Request = request;
this->Deferral = deferral;
}
property Windows::Media::Core::MediaStreamSourceSampleRequest^ Request
{
Windows::Media::Core::MediaStreamSourceSampleRequest^ get() { return mRequest; }
void set(Windows::Media::Core::MediaStreamSourceSampleRequest^ value) { mRequest = value; }
}
property Windows::Media::Core::MediaStreamSourceSampleRequestDeferral^ Deferral
{
Windows::Media::Core::MediaStreamSourceSampleRequestDeferral^ get() { return mDeferral; }
void set(Windows::Media::Core::MediaStreamSourceSampleRequestDeferral^ value) { mDeferral = value; }
}
private:
~SampleRequestDeferral() {};
Windows::Media::Core::MediaStreamSourceSampleRequest^ mRequest;
Windows::Media::Core::MediaStreamSourceSampleRequestDeferral^ mDeferral;
};
private ref class Sample sealed
{
public:
Sample(Windows::Storage::Streams::IBuffer^ buffer, int width, int height)
{
mBuffer = buffer;
mWidth = width;
mHeight = height;
}
property Windows::Storage::Streams::IBuffer^ Buffer
{
Windows::Storage::Streams::IBuffer^ get() { return mBuffer; }
}
property int Width
{
int get() { return mWidth; }
}
property int Height
{
int get() { return mHeight; }
}
private:
~Sample() {};
Windows::Storage::Streams::IBuffer^ mBuffer;
int mWidth;
int mHeight;
};
ref class MediaStreamSource sealed
{
public:
static MediaStreamSource^ CreateMediaSource();
void Feed(Windows::Storage::Streams::IBuffer^ pBuffer, int width, int height);
property Windows::Media::Core::MediaStreamSource^ Source
{
Windows::Media::Core::MediaStreamSource^ get() { return mMediaStreamSource; }
}
private:
MediaStreamSource();
~MediaStreamSource();
void OnSampleRequested(Windows::Media::Core::MediaStreamSource ^sender, Windows::Media::Core::MediaStreamSourceSampleRequestedEventArgs ^args);
void AnswerSampleRequest(Windows::Media::Core::MediaStreamSourceSampleRequest^ sampleRequest);
void RenderFrame(IMFMediaBuffer* mediaBuffer);
Windows::Media::Core::MediaStreamSource^ mMediaStreamSource;
Windows::Media::Core::VideoStreamDescriptor^ mVideoDesc;
Platform::Collections::Vector<SampleRequestDeferral^>^ mDeferralQueue;
Sample^ mSample;
uint64 mTimeStamp;
uint64 mInitialTimeStamp;
BYTE *mFrame;
std::mutex mMutex;
};
}
This diff is collapsed.
/*
Renderer.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include <collection.h>
#include <ppltasks.h>
#include <d3d11_2.h>
#include <d2d1_2.h>
#include <mfidl.h>
#include <mfapi.h>
#include <mferror.h>
#include <Mfmediaengine.h>
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
#include <windows.media.h>
#include <windows.media.capture.h>
#include <windows.media.mediaproperties.h>
#include <wrl.h>
#include <wrl\client.h>
#include <wrl\implements.h>
#include <wrl\ftm.h>
#include <wrl\event.h>
#include <wrl\wrappers\corewrappers.h>
#include <wrl\module.h>
#include "MediaEngineNotify.h"
#include "MediaStreamSource.h"
#include "SharedData.h"
namespace libmswinrtvid
{
public ref class MSWinRTRenderer sealed
: public MediaEngineNotifyCallback
{
public:
MSWinRTRenderer();
virtual ~MSWinRTRenderer();
void SetSwapChainPanel(Platform::String ^swapChainPanelName);
bool Start();
void Feed(Windows::Storage::Streams::IBuffer^ pBuffer, int width, int height);
virtual void OnMediaEngineEvent(uint32 meEvent, uintptr_t param1, uint32 param2);
property int Width
{
int get() { return mWidth; }
void set(int value) { mWidth = value; }
}
property int Height
{
int get() { return mHeight; }
void set(int value) { mHeight = value; }
}
private:
void Close();
HRESULT SetupSchemeHandler();
HRESULT SetupDirectX();
HRESULT CreateDX11Device();
void SendSwapChainHandle(HANDLE swapChain, bool forceNewHandle);
void SendErrorEvent(HRESULT hr);
int mWidth;
int mHeight;
MediaStreamSource^ mMediaStreamSource;
HANDLE mMemoryMapping;
HANDLE mForegroundProcess;
HANDLE mLock;
HANDLE mShutdownEvent;
HANDLE mEventAvailableEvent;
SharedData* mSharedData;
bool mUseHardware;
Microsoft::WRL::ComPtr<ID3D11Device> mDevice;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> mDx11DeviceContext;
Microsoft::WRL::ComPtr<IMFDXGIDeviceManager> mDxGIManager;
Microsoft::WRL::ComPtr<IMFMediaEngine> mMediaEngine;
Microsoft::WRL::ComPtr<IMFMediaEngineEx> mMediaEngineEx;
Microsoft::WRL::ComPtr<ABI::Windows::Media::IMediaExtensionManager> mMediaExtensionManager;
Microsoft::WRL::ComPtr<ABI::Windows::Foundation::Collections::IMap<HSTRING, IInspectable*>> mExtensionManagerProperties;
};
}
/*
SchemeHandler.cpp
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "SchemeHandler.h"
#include <mfapi.h>
using namespace Microsoft::WRL::Wrappers;
using namespace Microsoft::WRL;
libmswinrtvid::SchemeHandler::SchemeHandler()
{
}
libmswinrtvid::SchemeHandler::~SchemeHandler()
{
}
// IMediaExtension methods
IFACEMETHODIMP libmswinrtvid::SchemeHandler::SetProperties(ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration)
{
mExtensionManagerProperties = pConfiguration;
return S_OK;
}
// IMFSchemeHandler methods
IFACEMETHODIMP libmswinrtvid::SchemeHandler::BeginCreateObject(
_In_ LPCWSTR pwszURL,
_In_ DWORD dwFlags,
_In_ IPropertyStore *pProps,
_COM_Outptr_opt_ IUnknown **ppIUnknownCancelCookie,
_In_ IMFAsyncCallback *pCallback,
_In_ IUnknown *punkState)
{
if (ppIUnknownCancelCookie != nullptr) {
*ppIUnknownCancelCookie = nullptr;
}
if ((pwszURL == nullptr) || (pCallback == nullptr)) {
return E_INVALIDARG;
}
if ((dwFlags & MF_RESOLUTION_MEDIASOURCE) == 0) {
return E_INVALIDARG;
}
ComPtr<ABI::Windows::Foundation::Collections::IMap<HSTRING, IInspectable*>> propMap;
HRESULT hr = mExtensionManagerProperties.As(&propMap);
if (FAILED(hr)) {
return hr;
}
ComPtr<IInspectable> frameSourceInspectable;
hr = propMap->Lookup(HStringReference(pwszURL).Get(), frameSourceInspectable.GetAddressOf());
if (FAILED(hr)) {
unsigned int size;
hr = propMap->get_Size(&size);
if (size == 0) {
return E_FAIL;
}
return hr;
}
ComPtr<IMFAsyncResult> result;
hr = MFCreateAsyncResult(frameSourceInspectable.Get(), pCallback, punkState, &result);
if (FAILED(hr)) {
return hr;
}
hr = pCallback->Invoke(result.Get());
if (FAILED(hr)) {
return hr;
}
return result->GetStatus();
}
IFACEMETHODIMP libmswinrtvid::SchemeHandler::EndCreateObject(_In_ IMFAsyncResult *pResult, _Out_ MF_OBJECT_TYPE *pObjectType, _Out_ IUnknown **ppObject)
{
if ((pResult == nullptr) || (pObjectType == nullptr) || (ppObject == nullptr)) {
return E_INVALIDARG;
}
*pObjectType = MF_OBJECT_INVALID;
*ppObject = nullptr;
HRESULT hr = pResult->GetStatus();
if (FAILED(hr)) {
return hr;
}
ComPtr<IUnknown> source;
hr = pResult->GetObject(&source);
if (FAILED(hr)) {
return hr;
}
*ppObject = source.Get();
(*ppObject)->AddRef();
*pObjectType = MF_OBJECT_MEDIASOURCE;
return S_OK;
}
IFACEMETHODIMP libmswinrtvid::SchemeHandler::CancelObjectCreation(_In_ IUnknown *pIUnknownCancelCookie)
{
return E_NOTIMPL;
}
/*
SchemeHandler.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include <windows.foundation.h>
#include <windows.foundation.collections.h>
#include <windows.media.h>
#include <wrl.h>
#include <mfmediaengine.h>
namespace libmswinrtvid
{
class DECLSPEC_UUID("0D41D269-A26E-4726-972B-5DFE45E2DA2E") SchemeHandler
: public Microsoft::WRL::RuntimeClass<Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::RuntimeClassType::WinRtClassicComMix>, ABI::Windows::Media::IMediaExtension, IMFSchemeHandler>
{
InspectableClass(L"libmswinrtvid.SchemeHandler", BaseTrust)
public:
SchemeHandler();
~SchemeHandler();
// IMediaExtension
IFACEMETHOD(SetProperties)(ABI::Windows::Foundation::Collections::IPropertySet *pConfiguration);
// IMFSchemeHandler
IFACEMETHOD(BeginCreateObject)(
_In_ LPCWSTR pwszURL,
_In_ DWORD dwFlags,
_In_ IPropertyStore *pProps,
_COM_Outptr_opt_ IUnknown **ppIUnknownCancelCookie,
_In_ IMFAsyncCallback *pCallback,
_In_ IUnknown *punkState);
IFACEMETHOD(EndCreateObject)(
_In_ IMFAsyncResult *pResult,
_Out_ MF_OBJECT_TYPE *pObjectType,
_Out_ IUnknown **ppObject);
IFACEMETHOD(CancelObjectCreation)(_In_ IUnknown *pIUnknownCancelCookie);
};
CoCreatableClass(SchemeHandler);
ActivatableClass(SchemeHandler)
Microsoft::WRL::ComPtr<ABI::Windows::Foundation::Collections::IPropertySet> mExtensionManagerProperties;
}
/*
ScopeLock.cpp
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "ScopeLock.h"
libmswinrtvid::ScopeLock::ScopeLock(HANDLE mutex) : mMutex(mutex)
{
WaitForSingleObject(mutex, INFINITE);
}
libmswinrtvid::ScopeLock::~ScopeLock()
{
ReleaseMutex(mMutex);
}
/*
ScopeLock.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#pragma once
#include <ppltasks.h>
namespace libmswinrtvid
{
class ScopeLock
{
public:
ScopeLock(HANDLE mutex);
~ScopeLock();
private:
ScopeLock(const ScopeLock&);
const ScopeLock& operator = (const ScopeLock&) {};
HANDLE mMutex;
};
}
/*
SharedData.h
mediastreamer2 library - modular sound and video processing and streaming
Windows Audio Session API sound card plugin for mediastreamer2
Copyright (C) 2010-2015 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of