From 17027c16cdb3f90c63796c778e6fdb469868c022 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Fri, 23 Mar 2018 15:51:11 +0000 Subject: [PATCH] gsdx-legacy: Copy GSdx baseclasses changes So it compiles. Bit of a pain though. --- plugins/GSdx_legacy/GSCapture.cpp | 44 ++++++++++++++++-------- plugins/GSdx_legacy/GSCaptureDlg.cpp | 12 +++++++ plugins/GSdx_legacy/GSCaptureDlg.h | 2 +- plugins/GSdx_legacy/GSdx.vcxproj | 2 +- plugins/GSdx_legacy/vsprops/common.props | 2 +- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/plugins/GSdx_legacy/GSCapture.cpp b/plugins/GSdx_legacy/GSCapture.cpp index d31a0873d5..cebbb67680 100644 --- a/plugins/GSdx_legacy/GSCapture.cpp +++ b/plugins/GSdx_legacy/GSCapture.cpp @@ -26,6 +26,36 @@ #ifdef _WIN32 +class CPinInfo : public PIN_INFO { +public: + CPinInfo() { pFilter = NULL; } + ~CPinInfo() { if (pFilter) pFilter->Release(); } +}; + +class CFilterInfo : public FILTER_INFO { +public: + CFilterInfo() { pGraph = NULL; } + ~CFilterInfo() { if (pGraph) pGraph->Release(); } +}; + +#define BeginEnumFilters(pFilterGraph, pEnumFilters, pBaseFilter) \ + {CComPtr pEnumFilters; \ + if(pFilterGraph && SUCCEEDED(pFilterGraph->EnumFilters(&pEnumFilters))) \ + { \ + for(CComPtr pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) \ + { \ + +#define EndEnumFilters }}} + +#define BeginEnumPins(pBaseFilter, pEnumPins, pPin) \ + {CComPtr pEnumPins; \ + if(pBaseFilter && SUCCEEDED(pBaseFilter->EnumPins(&pEnumPins))) \ + { \ + for(CComPtr pPin; S_OK == pEnumPins->Next(1, &pPin, 0); pPin = NULL) \ + { \ + +#define EndEnumPins }}} + // // GSSource // @@ -341,15 +371,6 @@ public: } }; -#define BeginEnumPins(pBaseFilter, pEnumPins, pPin) \ - {CComPtr pEnumPins; \ - if(pBaseFilter && SUCCEEDED(pBaseFilter->EnumPins(&pEnumPins))) \ - { \ - for(CComPtr pPin; S_OK == pEnumPins->Next(1, &pPin, 0); pPin = NULL) \ - { \ - -#define EndEnumPins }}} - static IPin* GetFirstPin(IBaseFilter* pBF, PIN_DIRECTION dir) { if(!pBF) return(NULL); @@ -467,11 +488,6 @@ bool GSCapture::BeginCapture(float fps, GSVector2i recomendedResolution, float a pPin->QueryPinInfo(&pi); wstring s(pi.achName); printf("- Pin [%p - %p]: %s (%s)\n", pPin.p, pPinTo.p, string(s.begin(), s.end()).c_str(), pi.dir ? "out" : "in"); - - BeginEnumMediaTypes(pPin, pEMT, pmt) - { - } - EndEnumMediaTypes(pmt) } EndEnumPins } diff --git a/plugins/GSdx_legacy/GSCaptureDlg.cpp b/plugins/GSdx_legacy/GSCaptureDlg.cpp index 7c34743f6f..0e3d187f28 100644 --- a/plugins/GSdx_legacy/GSCaptureDlg.cpp +++ b/plugins/GSdx_legacy/GSCaptureDlg.cpp @@ -23,6 +23,18 @@ #include "GSdx.h" #include "GSCaptureDlg.h" +#define BeginEnumSysDev(clsid, pMoniker) \ + {CComPtr pDevEnum4$##clsid; \ + pDevEnum4$##clsid.CoCreateInstance(CLSID_SystemDeviceEnum); \ + CComPtr pClassEnum4$##clsid; \ + if(SUCCEEDED(pDevEnum4$##clsid->CreateClassEnumerator(clsid, &pClassEnum4$##clsid, 0)) \ + && pClassEnum4$##clsid) \ + { \ + for(CComPtr pMoniker; pClassEnum4$##clsid->Next(1, &pMoniker, 0) == S_OK; pMoniker = NULL) \ + { \ + +#define EndEnumSysDev }}} + GSCaptureDlg::GSCaptureDlg() : GSDialog(IDD_CAPTURE) { diff --git a/plugins/GSdx_legacy/GSCaptureDlg.h b/plugins/GSdx_legacy/GSCaptureDlg.h index 58773750d8..3efb3d5964 100644 --- a/plugins/GSdx_legacy/GSCaptureDlg.h +++ b/plugins/GSdx_legacy/GSCaptureDlg.h @@ -23,7 +23,7 @@ #include "GSDialog.h" #include "resource.h" -#include "baseclasses/streams.h" +#include class GSCaptureDlg : public GSDialog { diff --git a/plugins/GSdx_legacy/GSdx.vcxproj b/plugins/GSdx_legacy/GSdx.vcxproj index 9f7f994ccf..24c13826cf 100644 --- a/plugins/GSdx_legacy/GSdx.vcxproj +++ b/plugins/GSdx_legacy/GSdx.vcxproj @@ -937,7 +937,7 @@ {d80d4a75-c385-41bd-ae62-83d2e2b595a7} false - + {27f17499-a372-4408-8afa-4f9f4584fbd3} diff --git a/plugins/GSdx_legacy/vsprops/common.props b/plugins/GSdx_legacy/vsprops/common.props index 535b76dd92..441217cc07 100644 --- a/plugins/GSdx_legacy/vsprops/common.props +++ b/plugins/GSdx_legacy/vsprops/common.props @@ -13,7 +13,7 @@ Level4 ProgramDatabase 4456;4458;4996;4995;4324;4100;4101;4201;4556;4127;4512;%(DisableSpecificWarnings) - $(VTUNE_AMPLIFIER_XE_2015_DIR)include;$(SolutionDir)unfree;$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\libpng;$(SolutionDir)3rdparty\opencl;$(SolutionDir)3rdparty\zlib;%(AdditionalIncludeDirectories) + $(VTUNE_AMPLIFIER_XE_2015_DIR)include;$(SolutionDir)3rdparty\baseclasses;$(SolutionDir)3rdparty;$(SolutionDir)3rdparty\libpng;$(SolutionDir)3rdparty\opencl;$(SolutionDir)3rdparty\zlib;%(AdditionalIncludeDirectories) true