Commit cee79b1e authored by Ghislain MARY's avatar Ghislain MARY

Changes to get display on mobiles + Resize displayed video to the size of the SwapChainPanel.

parent a48a6eba
/*
RemoteHandle.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 "RemoteHandle.h"
libmswinrtvid::RemoteHandle::RemoteHandle()
: mLocalHandle(INVALID_HANDLE_VALUE), mRemoteHandle(INVALID_HANDLE_VALUE), mProcessId(0), mProcessHandle(INVALID_HANDLE_VALUE)
{
}
libmswinrtvid::RemoteHandle::~RemoteHandle()
{
Close();
if (mProcessHandle != INVALID_HANDLE_VALUE) {
CloseHandle(mProcessHandle);
mProcessHandle = INVALID_HANDLE_VALUE;
}
}
libmswinrtvid::RemoteHandle& libmswinrtvid::RemoteHandle::AssignHandle(HANDLE localHandle, DWORD processId)
{
if (localHandle != mLocalHandle) {
HANDLE remoteHandle;
HANDLE processHandle = mProcessHandle;
if (processId != mProcessId) {
processHandle = OpenProcess(PROCESS_DUP_HANDLE, TRUE, processId);
if ((processHandle == nullptr) || (processHandle == INVALID_HANDLE_VALUE)) {
throw std::exception();
}
}
if (!DuplicateHandle(GetCurrentProcess(), localHandle, processHandle, &remoteHandle, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
throw std::exception();
}
Close();
if (processId != mProcessId) {
if (mProcessHandle != INVALID_HANDLE_VALUE) {
CloseHandle(mProcessHandle);
}
mProcessHandle = processHandle;
mProcessId = processId;
}
mLocalHandle = localHandle;
mRemoteHandle = remoteHandle;
}
return *this;
}
libmswinrtvid::RemoteHandle& libmswinrtvid::RemoteHandle::Close()
{
if (mLocalHandle != INVALID_HANDLE_VALUE) {
CloseHandle(mLocalHandle);
mLocalHandle = INVALID_HANDLE_VALUE;
}
if (mRemoteHandle != INVALID_HANDLE_VALUE) {
DuplicateHandle(mProcessHandle, mRemoteHandle, nullptr, nullptr, 0, TRUE, DUPLICATE_CLOSE_SOURCE);
mRemoteHandle = INVALID_HANDLE_VALUE;
}
return *this;
}
HANDLE libmswinrtvid::RemoteHandle::GetLocalHandle() const
{
return mLocalHandle;
}
HANDLE libmswinrtvid::RemoteHandle::GetRemoteHandle() const
{
return mRemoteHandle;
}
/*
RemoteHandle.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 RemoteHandle
{
public:
RemoteHandle();
~RemoteHandle();
RemoteHandle& AssignHandle(HANDLE localHandle, DWORD processId);
RemoteHandle& Close();
HANDLE GetLocalHandle() const;
HANDLE GetRemoteHandle() const;
private:
RemoteHandle(const RemoteHandle&);
const RemoteHandle& operator = (const RemoteHandle&) { return *this; };
HANDLE mLocalHandle;
HANDLE mRemoteHandle;
DWORD mProcessId;
HANDLE mProcessHandle;
};
}
......@@ -82,7 +82,7 @@ Platform::Boolean MSWinRTExtensionManager::UnregisterUrl(Platform::String^ url)
MSWinRTRenderer::MSWinRTRenderer() :
mWidth(0), mHeight(0), mMediaStreamSource(nullptr), mMediaEngine(nullptr), mUrl(nullptr),
mMediaStreamSource(nullptr), mMediaEngine(nullptr), mUrl(nullptr),
mForegroundProcess(nullptr), mMemoryMapping(nullptr), mSharedData(nullptr), mLock(nullptr), mShutdownEvent(nullptr), mEventAvailableEvent(nullptr)
{
}
......@@ -126,12 +126,24 @@ void MSWinRTRenderer::SetSwapChainPanel(Platform::String ^swapChainPanelName)
Close();
throw ref new Platform::COMException(HRESULT_FROM_WIN32(error));
}
if (!DuplicateHandle(mForegroundProcess, mSharedData->foregroundShutdownCompleteEvent, GetCurrentProcess(), &mShutdownCompleteEvent, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
DWORD error = GetLastError();
mLock = nullptr;
Close();
throw ref new Platform::COMException(HRESULT_FROM_WIN32(error));
}
if (!DuplicateHandle(mForegroundProcess, mSharedData->foregroundEventAvailableEvent, GetCurrentProcess(), &mEventAvailableEvent, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
DWORD error = GetLastError();
mLock = nullptr;
Close();
throw ref new Platform::COMException(HRESULT_FROM_WIN32(error));
}
if (!DuplicateHandle(mForegroundProcess, mSharedData->foregroundCommandAvailableEvent, GetCurrentProcess(), &mCommandAvailableEvent, 0, TRUE, DUPLICATE_SAME_ACCESS)) {
DWORD error = GetLastError();
mLock = nullptr;
Close();
throw ref new Platform::COMException(HRESULT_FROM_WIN32(error));
}
}
void MSWinRTRenderer::Close()
......@@ -139,6 +151,11 @@ void MSWinRTRenderer::Close()
if (mMediaEngine != nullptr)
{
mMediaEngine->Shutdown();
mMediaEngine = nullptr;
}
if (mMediaEngineEx != nullptr)
{
mMediaEngineEx = nullptr;
}
if (mUrl != nullptr)
{
......@@ -176,6 +193,17 @@ void MSWinRTRenderer::Close()
CloseHandle(mForegroundProcess);
mForegroundProcess = nullptr;
}
if (mShutdownCompleteEvent != nullptr)
{
SetEvent(mShutdownCompleteEvent);
mShutdownCompleteEvent = nullptr;
}
if (mCommandAvailableEvent != nullptr)
{
CloseHandle(mCommandAvailableEvent);
mCommandAvailableEvent = nullptr;
}
mSwapChainHandle.Close();
}
bool MSWinRTRenderer::Start()
......@@ -226,6 +254,23 @@ bool MSWinRTRenderer::Start()
void MSWinRTRenderer::Feed(Windows::Storage::Streams::IBuffer^ pBuffer, int width, int height)
{
if (mMediaStreamSource != nullptr) {
bool sizeChanged = false;
if ((width != mFrameWidth) || (height != mFrameHeight)) {
mFrameWidth = width;
mFrameHeight = height;
sizeChanged = true;
}
if ((mSharedData->width != mSwapChainPanelWidth) || (mSharedData->height != mSwapChainPanelHeight)) {
mSwapChainPanelWidth = mSharedData->width;
mSwapChainPanelHeight = mSharedData->height;
sizeChanged = true;
}
if (sizeChanged) {
MFVideoNormalizedRect srcSize = { 0.f, 0.f, (float)width, (float)height };
RECT dstSize = { 0, 0, mSwapChainPanelWidth, mSwapChainPanelHeight };
MFARGB backgroundColor = { 0, 0, 0, 0 };
mMediaEngineEx->UpdateVideoStream(&srcSize, &dstSize, &backgroundColor);
}
mMediaStreamSource->Feed(pBuffer, width, height);
}
}
......@@ -254,7 +299,7 @@ HRESULT MSWinRTRenderer::SetupDirectX()
return hr;
}
ComPtr<IMFMediaEngineClassFactory> factory;
hr = CoCreateInstance(CLSID_MFMediaEngineClassFactory, nullptr, CLSCTX_ALL, IID_PPV_ARGS(&factory));
hr = CoCreateInstance(CLSID_MFMediaEngineClassFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&factory));
if (FAILED(hr)) {
ms_error("MSWinRTRenderer::SetupDirectX: CoCreateInstance failed %x", hr);
return hr;
......@@ -283,7 +328,7 @@ HRESULT MSWinRTRenderer::SetupDirectX()
ms_error("MSWinRTRenderer::SetupDirectX: Set MF_MEDIA_ENGINE_CALLBACK attribute failed %x", hr);
return hr;
}
hr = factory->CreateInstance(MF_MEDIA_ENGINE_REAL_TIME_MODE | MF_MEDIA_ENGINE_WAITFORSTABLE_STATE, attributes.Get(), &mMediaEngine);
hr = factory->CreateInstance(MF_MEDIA_ENGINE_REAL_TIME_MODE, attributes.Get(), &mMediaEngine);
if (FAILED(hr)) {
ms_error("MSWinRTRenderer::SetupDirectX: CreateInstance failed %x", hr);
return hr;
......@@ -298,7 +343,6 @@ HRESULT MSWinRTRenderer::SetupDirectX()
ms_error("MSWinRTRenderer::SetupDirectX: EnableWindowlessSwapchainMode failed %x", hr);
return hr;
}
mMediaEngineEx->SetRealTimeMode(TRUE);
return S_OK;
}
......@@ -308,7 +352,10 @@ HRESULT MSWinRTRenderer::CreateDX11Device()
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_1
};
D3D_FEATURE_LEVEL FeatureLevel;
HRESULT hr = S_OK;
......@@ -342,27 +389,15 @@ HRESULT MSWinRTRenderer::CreateDX11Device()
return hr;
}
void MSWinRTRenderer::SendSwapChainHandle(HANDLE swapChain, bool forceNewHandle)
void MSWinRTRenderer::SendSwapChainHandle(HANDLE swapChain)
{
if ((swapChain == nullptr) || (swapChain == INVALID_HANDLE_VALUE)) return;
bool notify = false;
ScopeLock lock(mLock);
if (forceNewHandle) {
if (mSharedData->backgroundSwapChainHandle) {
CloseHandle(mSharedData->backgroundSwapChainHandle);
}
mSharedData->backgroundSwapChainHandle = swapChain;
notify = true;
}
else if (mSharedData->backgroundSwapChainHandle == nullptr) {
mSharedData->backgroundSwapChainHandle = swapChain;
notify = true;
}
if (notify) {
HANDLE foregroundProcess = OpenProcess(PROCESS_DUP_HANDLE, TRUE, mSharedData->foregroundProcessId);
DuplicateHandle(GetCurrentProcess(), swapChain, foregroundProcess, &mSharedData->foregroundSwapChainHandle, 0, TRUE, DUPLICATE_SAME_ACCESS);
CloseHandle(foregroundProcess);
mSwapChainHandle.AssignHandle(swapChain, mSharedData->foregroundProcessId);
HANDLE remoteHandle = mSwapChainHandle.GetRemoteHandle();
if (remoteHandle != mSharedData->foregroundSwapChainHandle) {
mSharedData->foregroundSwapChainHandle = remoteHandle;
SetEvent(mEventAvailableEvent);
}
}
......@@ -371,7 +406,7 @@ void MSWinRTRenderer::SendErrorEvent(HRESULT hr)
{
ScopeLock lock(mLock);
mSharedData->error = hr;
SetEvent(mSharedData->foregroundEventAvailableEvent);
SetEvent(mEventAvailableEvent);
}
void MSWinRTRenderer::OnMediaEngineEvent(uint32 meEvent, uintptr_t param1, uint32 param2)
......@@ -385,11 +420,11 @@ void MSWinRTRenderer::OnMediaEngineEvent(uint32 meEvent, uintptr_t param1, uint3
case MF_MEDIA_ENGINE_EVENT_PLAYING:
case MF_MEDIA_ENGINE_EVENT_FIRSTFRAMEREADY:
mMediaEngineEx->GetVideoSwapchainHandle(&swapChainHandle);
SendSwapChainHandle(swapChainHandle, false);
SendSwapChainHandle(swapChainHandle);
break;
case MF_MEDIA_ENGINE_EVENT_FORMATCHANGE:
mMediaEngineEx->GetVideoSwapchainHandle(&swapChainHandle);
SendSwapChainHandle(swapChainHandle, true);
SendSwapChainHandle(swapChainHandle);
break;
case MF_MEDIA_ENGINE_EVENT_CANPLAY:
hr = mMediaEngine->Play();
......
......@@ -48,6 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "MediaEngineNotify.h"
#include "MediaStreamSource.h"
#include "RemoteHandle.h"
#include "SharedData.h"
......@@ -86,34 +87,37 @@ namespace libmswinrtvid
void Feed(Windows::Storage::Streams::IBuffer^ pBuffer, int width, int height);
virtual void OnMediaEngineEvent(uint32 meEvent, uintptr_t param1, uint32 param2);
property int Width
property int FrameWidth
{
int get() { return mWidth; }
void set(int value) { mWidth = value; }
int get() { return mFrameWidth; }
}
property int Height
property int FrameHeight
{
int get() { return mHeight; }
void set(int value) { mHeight = value; }
int get() { return mFrameHeight; }
}
private:
void Close();
HRESULT SetupDirectX();
HRESULT CreateDX11Device();
void SendSwapChainHandle(HANDLE swapChain, bool forceNewHandle);
void SendSwapChainHandle(HANDLE swapChain);
void SendErrorEvent(HRESULT hr);
int mWidth;
int mHeight;
int mFrameWidth;
int mFrameHeight;
int mSwapChainPanelWidth;
int mSwapChainPanelHeight;
MediaStreamSource^ mMediaStreamSource;
HANDLE mMemoryMapping;
HANDLE mForegroundProcess;
HANDLE mLock;
HANDLE mShutdownEvent;
HANDLE mShutdownCompleteEvent;
HANDLE mEventAvailableEvent;
HANDLE mCommandAvailableEvent;
RemoteHandle mSwapChainHandle;
SharedData* mSharedData;
bool mUseHardware;
Platform::String^ mUrl;
......
......@@ -35,9 +35,9 @@ namespace libmswinrtvid
DWORD backgroundProcessId;
HANDLE foregroundLockMutex;
HANDLE foregroundShutdownEvent;
HANDLE foregroundShutdownCompleteEvent;
HANDLE foregroundCommandAvailableEvent;
HANDLE foregroundEventAvailableEvent;
HANDLE backgroundSwapChainHandle;
HANDLE foregroundSwapChainHandle;
bool shutdown;
HRESULT error;
......
......@@ -47,7 +47,6 @@ void libmswinrtvid::SwapChainPanelSource::Start(Windows::UI::Xaml::Controls::Swa
Stop();
mSwapChainPanel = swapChainPanel;
mSwapChainPanel->Unloaded += ref new Windows::UI::Xaml::RoutedEventHandler(this, &libmswinrtvid::SwapChainPanelSource::OnUnloaded);
HRESULT hr;
if ((FAILED(hr = reinterpret_cast<IUnknown*>(swapChainPanel)->QueryInterface(IID_PPV_ARGS(&mNativeSwapChainPanel)))) || (!mNativeSwapChainPanel))
......@@ -66,28 +65,53 @@ void libmswinrtvid::SwapChainPanelSource::Start(Windows::UI::Xaml::Controls::Swa
mSharedData->foregroundProcessId = GetCurrentProcessId();
mSharedData->foregroundLockMutex = CreateMutex(nullptr, FALSE, nullptr);
mSharedData->foregroundShutdownEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
mSharedData->foregroundShutdownCompleteEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
mSharedData->foregroundEventAvailableEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
mSharedData->foregroundCommandAvailableEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
GetEvents();
if ((swapChainPanel->ActualWidth > 0.0f) && (swapChainPanel->ActualHeight > 0.0f))
{
mSharedData->width = (int)swapChainPanel->ActualWidth;
mSharedData->height = (int)swapChainPanel->ActualHeight;
SetEvent(mSharedData->foregroundCommandAvailableEvent);
}
mSwapChainPanel->SizeChanged += ref new Windows::UI::Xaml::SizeChangedEventHandler(this, &libmswinrtvid::SwapChainPanelSource::OnSizeChanged);
}
void libmswinrtvid::SwapChainPanelSource::Stop()
{
if (mSharedData != nullptr)
{
if (mSharedData->foregroundShutdownEvent != nullptr)
{
SetEvent(mSharedData->foregroundShutdownEvent);
}
if (mSharedData->foregroundShutdownCompleteEvent != nullptr)
{
SetEvent(mSharedData->foregroundShutdownCompleteEvent);
}
if (mSharedData->foregroundLockMutex != nullptr)
{
CloseHandle(mSharedData->foregroundLockMutex);
}
if (mSharedData->foregroundShutdownEvent != nullptr)
{
SetEvent(mSharedData->foregroundShutdownEvent);
CloseHandle(mSharedData->foregroundShutdownEvent);
}
if (mSharedData->foregroundShutdownCompleteEvent != nullptr)
{
CloseHandle(mSharedData->foregroundShutdownCompleteEvent);
}
if (mSharedData->foregroundEventAvailableEvent != nullptr)
{
CloseHandle(mSharedData->foregroundEventAvailableEvent);
}
if (mSharedData->foregroundCommandAvailableEvent != nullptr)
{
CloseHandle(mSharedData->foregroundCommandAvailableEvent);
}
UnmapViewOfFile(mSharedData);
mSharedData = nullptr;
}
......@@ -102,18 +126,23 @@ void libmswinrtvid::SwapChainPanelSource::Stop()
mNativeSwapChainPanel->SetSwapChainHandle(nullptr);
}
mNativeSwapChainPanel.Reset();
if (mCurrentSwapChainHandle != nullptr)
{
CloseHandle(mCurrentSwapChainHandle);
mCurrentSwapChainHandle = nullptr;
}
}
IAsyncAction^ libmswinrtvid::SwapChainPanelSource::GetEvents()
{
return concurrency::create_async([this]()
{
HANDLE evt[2];
HANDLE evt[3];
evt[0] = mSharedData->foregroundShutdownEvent;
evt[1] = mSharedData->foregroundEventAvailableEvent;
bool running = true;
HRESULT hr = S_OK;
HANDLE lastBackgroundSwapChainHandleUsed = nullptr;
HANDLE lastSwapChainHandleUsed = nullptr;
HANDLE backgroundProcess = nullptr;
HANDLE foregroundSwapChainHandle;
while (running)
......@@ -131,21 +160,10 @@ IAsyncAction^ libmswinrtvid::SwapChainPanelSource::GetEvents()
hr = mSharedData->error;
running = false;
}
else if (mSharedData->backgroundSwapChainHandle != lastBackgroundSwapChainHandleUsed)
else if (mSharedData->foregroundSwapChainHandle != lastSwapChainHandleUsed)
{
lastBackgroundSwapChainHandleUsed = mSharedData->backgroundSwapChainHandle;
if (backgroundProcess == nullptr)
{
backgroundProcess = OpenProcess(PROCESS_DUP_HANDLE, TRUE, mSharedData->backgroundProcessId);
if ((backgroundProcess == nullptr) || (backgroundProcess == INVALID_HANDLE_VALUE))
{
hr = HRESULT_FROM_WIN32(GetLastError());
running = false;
ReleaseMutex(mSharedData->foregroundLockMutex);
break;
}
}
if (!DuplicateHandle(GetCurrentProcess(), mSharedData->foregroundSwapChainHandle, GetCurrentProcess(), &foregroundSwapChainHandle, 0, TRUE, DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE))
lastSwapChainHandleUsed = mSharedData->foregroundSwapChainHandle;
if (!DuplicateHandle(GetCurrentProcess(), mSharedData->foregroundSwapChainHandle, GetCurrentProcess(), &foregroundSwapChainHandle, 0, TRUE, DUPLICATE_SAME_ACCESS))
{
hr = HRESULT_FROM_WIN32(GetLastError());
running = false;
......@@ -154,6 +172,7 @@ IAsyncAction^ libmswinrtvid::SwapChainPanelSource::GetEvents()
}
mSwapChainPanel->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, foregroundSwapChainHandle]()
{
if (mNativeSwapChainPanel == nullptr) return;
HRESULT hr = mNativeSwapChainPanel->SetSwapChainHandle(foregroundSwapChainHandle);
if (FAILED(hr))
{
......@@ -180,7 +199,12 @@ IAsyncAction^ libmswinrtvid::SwapChainPanelSource::GetEvents()
});
}
void libmswinrtvid::SwapChainPanelSource::OnUnloaded(Platform::Object ^sender, Windows::UI::Xaml::RoutedEventArgs ^e)
void libmswinrtvid::SwapChainPanelSource::OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
{
Stop();
if (mSharedData == nullptr) return;
WaitForSingleObject(mSharedData->foregroundLockMutex, INFINITE);
mSharedData->width = (int)e->NewSize.Width;
mSharedData->height = (int)e->NewSize.Height;
SetEvent(mSharedData->foregroundCommandAvailableEvent);
ReleaseMutex(mSharedData->foregroundLockMutex);
}
......@@ -38,7 +38,7 @@ namespace libmswinrtvid
private:
Windows::Foundation::IAsyncAction^ GetEvents();
void OnUnloaded(Platform::Object ^sender, Windows::UI::Xaml::RoutedEventArgs ^e);
void OnSizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
Windows::UI::Xaml::Controls::SwapChainPanel^ mSwapChainPanel;
Microsoft::WRL::ComPtr<ISwapChainPanelNative2> mNativeSwapChainPanel;
......
......@@ -76,9 +76,7 @@ int MSWinRTDis::feed(MSFilter *f)
int size = 0;
MSPicture buf;
if (ms_yuv_buf_init_from_mblk(&buf, im) == 0) {
if ((buf.w != mRenderer->Width) || (buf.h != mRenderer->Height)) {
mRenderer->Width = buf.w;
mRenderer->Height = buf.h;
if ((buf.w != mRenderer->FrameWidth) || (buf.h != mRenderer->FrameHeight)) {
if (mBuffer) {
ms_free(mBuffer);
mBuffer = NULL;
......@@ -107,17 +105,11 @@ int MSWinRTDis::feed(MSFilter *f)
MSVideoSize MSWinRTDis::getVideoSize()
{
MSVideoSize vs;
vs.width = mRenderer->Width;
vs.height = mRenderer->Height;
vs.width = mRenderer->FrameWidth;
vs.height = mRenderer->FrameHeight;
return vs;
}
void MSWinRTDis::setVideoSize(MSVideoSize vs)
{
mRenderer->Width = vs.width;
mRenderer->Height = vs.height;
}
void MSWinRTDis::setSwapChainPanel(Platform::String ^swapChainPanelName)
{
mRenderer->SetSwapChainPanel(swapChainPanelName);
......
......@@ -43,7 +43,6 @@ namespace libmswinrtvid
void stop();
int feed(MSFilter *f);
MSVideoSize getVideoSize();
void setVideoSize(MSVideoSize vs);
void setSwapChainPanel(Platform::String ^swapChainPanelName);
private:
......
......@@ -241,13 +241,6 @@ static int ms_winrtdis_get_vsize(MSFilter *f, void *arg) {
return 0;
}
static int ms_winrtdis_set_vsize(MSFilter *f, void *arg) {
MSWinRTDis *w = static_cast<MSWinRTDis *>(f->data);
MSVideoSize *vs = static_cast<MSVideoSize *>(arg);
w->setVideoSize(*vs);
return 0;
}
static int ms_winrtdis_set_native_window_id(MSFilter *f, void *arg) {
MSWinRTDis *w = static_cast<MSWinRTDis *>(f->data);
RefToPtrProxy<Platform::String^> *proxy = static_cast<RefToPtrProxy<Platform::String^>*>((void *)(*((PULONG_PTR)arg)));
......@@ -258,7 +251,6 @@ static int ms_winrtdis_set_native_window_id(MSFilter *f, void *arg) {
static MSFilterMethod ms_winrtdis_methods[] = {
{ MS_FILTER_GET_VIDEO_SIZE, ms_winrtdis_get_vsize },
{ MS_FILTER_SET_VIDEO_SIZE, ms_winrtdis_set_vsize },
{ MS_VIDEO_DISPLAY_SET_NATIVE_WINDOW_ID, ms_winrtdis_set_native_window_id },
{ 0, NULL }
};
......
......@@ -41,6 +41,7 @@
<ClCompile Include="..\..\mswinrtdis.cpp" />
<ClCompile Include="..\..\mswinrtmediasink.cpp" />
<ClCompile Include="..\..\mswinrtvid.cpp" />
<ClCompile Include="..\..\RemoteHandle.cpp" />
<ClCompile Include="..\..\Renderer.cpp" />
<ClCompile Include="..\..\SchemeHandler.cpp" />
<ClCompile Include="..\..\ScopeLock.cpp" />
......@@ -54,6 +55,7 @@
<ClInclude Include="..\..\mswinrtdis.h" />
<ClInclude Include="..\..\mswinrtmediasink.h" />
<ClInclude Include="..\..\mswinrtvid.h" />
<ClInclude Include="..\..\RemoteHandle.h" />
<ClInclude Include="..\..\Renderer.h" />
<ClInclude Include="..\..\SchemeHandler.h" />
<ClInclude Include="..\..\ScopeLock.h" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment