summaryrefslogtreecommitdiff
path: root/avstream
diff options
context:
space:
mode:
authorkarlf <[email protected]>2016-08-11 13:28:13 -0700
committerkarlf <[email protected]>2016-08-11 13:28:13 -0700
commit96eb96dfb613e4c745db6bd1f53a92fe7e2290fc (patch)
treead5f3ede5cbcd6b598677ce41bcf8318471bdd92 /avstream
parent687b274aa38fd05c8c26e3068932121876d7f745 (diff)
Updated for "Windows 10 Anniversary Update" (Version 1607)
Diffstat (limited to 'avstream')
-rw-r--r--avstream/avshws/avshws.sln18
-rw-r--r--avstream/avshws/avshws.vcxproj4
-rw-r--r--avstream/avshws/avshws.vcxproj.Filters8
-rw-r--r--avstream/avssamp/avssamp.sln18
-rw-r--r--avstream/avssamp/avssamp.vcxproj4
-rw-r--r--avstream/avssamp/avssamp.vcxproj.Filters8
-rw-r--r--avstream/sampledevicemft/README.md29
-rw-r--r--avstream/sampledevicemft/SampleDeviceMft.sln18
-rw-r--r--avstream/sampledevicemft/basepin.cpp92
-rw-r--r--avstream/sampledevicemft/basepin.h72
-rw-r--r--avstream/sampledevicemft/common.h28
-rw-r--r--avstream/sampledevicemft/custompin.cpp2
-rw-r--r--avstream/sampledevicemft/dllmain.cpp21
-rw-r--r--avstream/sampledevicemft/mftpeventgenerator.cpp2
-rw-r--r--avstream/sampledevicemft/multipinmft.cpp177
-rw-r--r--avstream/sampledevicemft/multipinmft.h25
-rw-r--r--avstream/sampledevicemft/multipinmft.vcxproj4
-rw-r--r--avstream/sampledevicemft/multipinmft.vcxproj.Filters6
-rw-r--r--avstream/sampledevicemft/multipinmfthelpers.cpp331
-rw-r--r--avstream/sampledevicemft/multipinmfthelpers.h85
-rw-r--r--avstream/sampledevicemft/multipinmftutils.cpp7
-rw-r--r--avstream/sampledevicemft/stdafx.h1
-rw-r--r--avstream/samplemft0/SampleMft0.sln39
-rw-r--r--avstream/samplemft0/SampleMft0.vcxproj140
-rw-r--r--avstream/samplemft0/SampleMft0.vcxproj.Filters78
25 files changed, 853 insertions, 364 deletions
diff --git a/avstream/avshws/avshws.sln b/avstream/avshws/avshws.sln
index 17026592..b8aebb75 100644
--- a/avstream/avshws/avshws.sln
+++ b/avstream/avshws/avshws.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avshws", "avshws.vcxproj", "{40F5B84D-59BB-4A25-A352-166715D6D7C4}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avshws", "avshws.vcxproj", "{77FA53EC-3637-411C-B708-C8EED64543A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Debug|Win32.ActiveCfg = Debug|Win32
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Debug|Win32.Build.0 = Debug|Win32
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Release|Win32.ActiveCfg = Release|Win32
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Release|Win32.Build.0 = Release|Win32
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Debug|x64.ActiveCfg = Debug|x64
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Debug|x64.Build.0 = Debug|x64
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Release|x64.ActiveCfg = Release|x64
- {40F5B84D-59BB-4A25-A352-166715D6D7C4}.Release|x64.Build.0 = Release|x64
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Debug|Win32.ActiveCfg = Debug|Win32
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Debug|Win32.Build.0 = Debug|Win32
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Release|Win32.ActiveCfg = Release|Win32
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Release|Win32.Build.0 = Release|Win32
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Debug|x64.ActiveCfg = Debug|x64
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Debug|x64.Build.0 = Debug|x64
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Release|x64.ActiveCfg = Release|x64
+ {77FA53EC-3637-411C-B708-C8EED64543A4}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/avstream/avshws/avshws.vcxproj b/avstream/avshws/avshws.vcxproj
index f08dc075..b3909878 100644
--- a/avstream/avshws/avshws.vcxproj
+++ b/avstream/avshws/avshws.vcxproj
@@ -19,11 +19,11 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{40F5B84D-59BB-4A25-A352-166715D6D7C4}</ProjectGuid>
+ <ProjectGuid>{77FA53EC-3637-411C-B708-C8EED64543A4}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{D6F9E8D8-B257-4DE2-B79A-F9B31E238C88}</SampleGuid>
+ <SampleGuid>{555099C6-5354-4C50-A241-A09CDD72299D}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/avstream/avshws/avshws.vcxproj.Filters b/avstream/avshws/avshws.vcxproj.Filters
index 64ea1e42..4e32a73f 100644
--- a/avstream/avshws/avshws.vcxproj.Filters
+++ b/avstream/avshws/avshws.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{ABE488E5-3DF7-4962-BBAC-F378FDFB32D5}</UniqueIdentifier>
+ <UniqueIdentifier>{124F9628-D980-4A5F-BCB3-C73BBF85F98E}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{B7A823E9-BED1-4D5B-BE9A-B8E81CA6BC20}</UniqueIdentifier>
+ <UniqueIdentifier>{53840AE7-57A9-46F8-8D16-B52859B4C272}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
- <UniqueIdentifier>{19E87A7B-173D-4D83-B9E7-D53BA8F93A4D}</UniqueIdentifier>
+ <UniqueIdentifier>{1156F063-8F29-4654-8347-0519BE2E0418}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{314F8E71-FFC5-460E-B7EB-AA16C51B169F}</UniqueIdentifier>
+ <UniqueIdentifier>{77087805-4D7E-4591-B71F-4ABA9576DD2A}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/avstream/avssamp/avssamp.sln b/avstream/avssamp/avssamp.sln
index 46663180..6b6d6b07 100644
--- a/avstream/avssamp/avssamp.sln
+++ b/avstream/avssamp/avssamp.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avssamp", "avssamp.vcxproj", "{5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avssamp", "avssamp.vcxproj", "{2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Debug|Win32.ActiveCfg = Debug|Win32
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Debug|Win32.Build.0 = Debug|Win32
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Release|Win32.ActiveCfg = Release|Win32
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Release|Win32.Build.0 = Release|Win32
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Debug|x64.ActiveCfg = Debug|x64
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Debug|x64.Build.0 = Debug|x64
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Release|x64.ActiveCfg = Release|x64
- {5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}.Release|x64.Build.0 = Release|x64
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Debug|Win32.Build.0 = Debug|Win32
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Release|Win32.ActiveCfg = Release|Win32
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Release|Win32.Build.0 = Release|Win32
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Debug|x64.ActiveCfg = Debug|x64
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Debug|x64.Build.0 = Debug|x64
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Release|x64.ActiveCfg = Release|x64
+ {2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/avstream/avssamp/avssamp.vcxproj b/avstream/avssamp/avssamp.vcxproj
index ceb26506..21c292d2 100644
--- a/avstream/avssamp/avssamp.vcxproj
+++ b/avstream/avssamp/avssamp.vcxproj
@@ -19,11 +19,11 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{5F47C95F-F225-46CA-9EB6-1B1DF6A2A10E}</ProjectGuid>
+ <ProjectGuid>{2CCFF21D-0B89-4F39-A4FC-2D0CCC25A071}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{EAF20BE9-2DCE-40E6-A9BF-4CA1CED83133}</SampleGuid>
+ <SampleGuid>{B0781D0B-B397-4C3A-9D2D-6993E9C47C60}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/avstream/avssamp/avssamp.vcxproj.Filters b/avstream/avssamp/avssamp.vcxproj.Filters
index 74ea459c..9b056e4d 100644
--- a/avstream/avssamp/avssamp.vcxproj.Filters
+++ b/avstream/avssamp/avssamp.vcxproj.Filters
@@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{7793ECBE-4482-4C88-A024-E8D2F1F80F38}</UniqueIdentifier>
+ <UniqueIdentifier>{CA27E3B0-4B55-4FE3-9F26-29F35E3AF608}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{50335876-3174-49EA-AFD7-6F6E510BDB0C}</UniqueIdentifier>
+ <UniqueIdentifier>{3F416EF8-A9B0-42DF-9371-BAA2CC072CD3}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
- <UniqueIdentifier>{344836DC-1F8B-4D73-AC33-5DD9C8E9A465}</UniqueIdentifier>
+ <UniqueIdentifier>{C2BB2712-8840-4220-B911-1CD96B679F83}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
- <UniqueIdentifier>{9AA3E219-66BC-4AE9-8DC5-75267CA4DEE7}</UniqueIdentifier>
+ <UniqueIdentifier>{F67003C9-C833-4C37-97BC-2593BB03BE03}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/avstream/sampledevicemft/README.md b/avstream/sampledevicemft/README.md
deleted file mode 100644
index dbf3c2db..00000000
--- a/avstream/sampledevicemft/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-Driver Device Transform Sample
-==============================
-Illustrative example for a *Driver Device Transform* which loads in a process streaming an Avstream-based camera device using Media Foundation.
-
-A *Driver Device Transform* is a new kind of a transform that is used with a specific camera when capturing video. The *Driver Device Transform* is also known as DeviceMFT because it is the first Device Transform applied to the video source. This *Driver Device Transform* is an alternative to the Driver MFT, for example MFT0, in that it caters to the source rather than the streams. An N stream source supporting DeviceMFT will have a single instance of the *Device Driver Transform* loaded, while MFT0 will have *N* instances for each pipeline process. The DeviceMFT can advertise multiple streams at the output, which can differ from the number of streams advertised by the source. This is analogous to having a user mode driver in the MF pipeline which intercepts and processes commands before they enter/leave the Kernel mode driver loaded for the streaming source.
-
-In this sample, the Device Transform, when enabled, will replicate a photo sequence in the user mode from a one pin device. It acts as a passthrough for sources exposing more than one pin.
-
-This sample is designed to be used with a specific camera. To run the sample, you need your camera's device ID and device metadata package.
-
-
-Related topics
---------------
-
-**Concepts**
-
-[Windows Store device apps for cameras](http://go.microsoft.com/fwlink/p/?LinkId=306683)
-
-[Media Foundation Transforms](http://msdn.microsoft.com/en-us/library/windows/hardware/ms703138)
-
-[Roadmap for Developing Streaming Media Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff568130)
-
-[Universal camera driver design guide for Windows 10](https://msdn.microsoft.com/en-us/Library/Windows/Hardware/dn937080)
-
-**Samples**
-
-[Windows Store device app for camera sample](http://go.microsoft.com/fwlink/p/?linkid=249442)
-
-[Camera Capture UI sample](http://go.microsoft.com/fwlink/p/?linkid=249441%20) \ No newline at end of file
diff --git a/avstream/sampledevicemft/SampleDeviceMft.sln b/avstream/sampledevicemft/SampleDeviceMft.sln
index 874e9b3c..a6a00c4d 100644
--- a/avstream/sampledevicemft/SampleDeviceMft.sln
+++ b/avstream/sampledevicemft/SampleDeviceMft.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multipinmft", "multipinmft.vcxproj", "{FBAACBDA-D207-4158-8497-37F54DD12701}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multipinmft", "multipinmft.vcxproj", "{E77657CD-A270-49E1-823A-8A14FF8596C8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,14 +13,14 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Debug|Win32.ActiveCfg = Debug|Win32
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Debug|Win32.Build.0 = Debug|Win32
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Release|Win32.ActiveCfg = Release|Win32
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Release|Win32.Build.0 = Release|Win32
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Debug|x64.ActiveCfg = Debug|x64
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Debug|x64.Build.0 = Debug|x64
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Release|x64.ActiveCfg = Release|x64
- {FBAACBDA-D207-4158-8497-37F54DD12701}.Release|x64.Build.0 = Release|x64
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Debug|Win32.Build.0 = Debug|Win32
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Release|Win32.ActiveCfg = Release|Win32
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Release|Win32.Build.0 = Release|Win32
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Debug|x64.ActiveCfg = Debug|x64
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Debug|x64.Build.0 = Debug|x64
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Release|x64.ActiveCfg = Release|x64
+ {E77657CD-A270-49E1-823A-8A14FF8596C8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/avstream/sampledevicemft/basepin.cpp b/avstream/sampledevicemft/basepin.cpp
index 30bfcc20..a1f71860 100644
--- a/avstream/sampledevicemft/basepin.cpp
+++ b/avstream/sampledevicemft/basepin.cpp
@@ -5,7 +5,7 @@
#include "basepin.h"
#ifdef MF_WPP
-#include "basepin.tmh"
+#include "basepin.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
/* -------> New STATE
|
@@ -17,7 +17,7 @@ DeviceStreamState_Disabled
*/
DeviceStreamState pinStateTransition[4][4] = {
- { DeviceStreamState_Stop, DeviceStreamState_Stop, DeviceStreamState_Run, DeviceStreamState_Disabled },
+ { DeviceStreamState_Stop, DeviceStreamState_Pause, DeviceStreamState_Run, DeviceStreamState_Disabled },
{ DeviceStreamState_Stop, DeviceStreamState_Pause, DeviceStreamState_Run, DeviceStreamState_Disabled },
{ DeviceStreamState_Stop, DeviceStreamState_Pause, DeviceStreamState_Run, DeviceStreamState_Disabled },
{ DeviceStreamState_Disabled, DeviceStreamState_Disabled, DeviceStreamState_Disabled, DeviceStreamState_Disabled }
@@ -27,8 +27,6 @@ CBasePin::CBasePin( _In_ ULONG id, _In_ CMultipinMft *parent) :
m_StreamId(id)
, m_Parent(parent)
, m_setMediaType(nullptr)
- , m_Attributes(nullptr)
- , m_Ikscontrol(nullptr)
{
}
@@ -42,16 +40,21 @@ CBasePin::~CBasePin()
SAFE_RELEASE(pMediaType);
}
m_listOfMediaTypes.clear();
- m_Attributes = nullptr;
+ m_spAttributes = nullptr;
}
HRESULT CBasePin::AddMediaType( _Inout_ DWORD *pos, _In_ IMFMediaType *pMediaType)
{
HRESULT hr = S_OK;
-
+ CAutoLock Lock(lock());
DMFTCHECKNULL_GOTO(pMediaType, done, E_INVALIDARG);
- m_listOfMediaTypes.push_back( pMediaType );
+ hr = ExceptionBoundary([&]()
+ {
+ m_listOfMediaTypes.push_back(pMediaType);
+ });
+
+ DMFTCHECKHR_GOTO(hr, done);
pMediaType->AddRef();
if (pos)
@@ -66,7 +69,7 @@ done:
HRESULT CBasePin::GetMediaTypeAt( _In_ DWORD pos, _Outptr_result_maybenull_ IMFMediaType **ppMediaType )
{
HRESULT hr = S_OK;
-
+ CAutoLock Lock(lock());
DMFTCHECKNULL_GOTO(ppMediaType,done,E_INVALIDARG);
if (pos >= m_listOfMediaTypes.size())
@@ -91,7 +94,7 @@ STDMETHODIMP_(BOOL) CBasePin::IsMediaTypeSupported
{
HRESULT hr = S_OK;
BOOL bFound = FALSE;
-
+ CAutoLock Lock(lock());
DMFTCHECKNULL_GOTO(pMediaType,done,E_INVALIDARG);
if (ppIMFMediaTypeFull)
{
@@ -185,7 +188,6 @@ CInPin::CInPin(
_In_ CMultipinMft *pParent)
:
CBasePin(ulPinId, pParent),
- m_pSourceTransform(nullptr),
m_stStreamType(GUID_NULL),
m_activeStreamCount(0),
m_state(DeviceStreamState_Stop),
@@ -201,7 +203,7 @@ CInPin::CInPin(
CInPin::~CInPin()
{
setAttributes( nullptr );
- m_pSourceTransform = nullptr;
+ m_spSourceTransform = nullptr;
for (ULONG ulIndex = 0, ulSize = (ULONG)m_outpins.size();
ulIndex < ulSize;
@@ -228,14 +230,14 @@ STDMETHODIMP CInPin::Init(
DMFTCHECKNULL_GOTO( pTransform, done, E_INVALIDARG );
- m_pSourceTransform = pTransform;
+ m_spSourceTransform = pTransform;
DMFTCHECKHR_GOTO( GetGUID( MF_DEVICESTREAM_STREAM_CATEGORY, &m_stStreamType ), done );
//
//Get the DevProxy IKSControl.. used to send the KSControls or the device control IOCTLS over to devproxy and finally on to the driver!!!!
//
- DMFTCHECKHR_GOTO( m_pSourceTransform.As( &m_Ikscontrol ), done );
+ DMFTCHECKHR_GOTO( m_spAttributes.As( &m_spIkscontrol ), done );
m_waitInputMediaTypeWaiter = CreateEvent( NULL,
FALSE,
@@ -249,7 +251,7 @@ STDMETHODIMP CInPin::Init(
done:
if ( FAILED(hr) )
{
- m_pSourceTransform = nullptr;
+ m_spSourceTransform = nullptr;
if ( m_waitInputMediaTypeWaiter )
{
@@ -271,35 +273,17 @@ STDMETHODIMP CInPin::GenerateMFMediaTypeListFromDevice(
HRESULT hr = S_OK;
GUID stSubType = { 0 };
//This is only called in the begining when the input pin is constructed
- DMFTCHECKNULL_GOTO( m_pSourceTransform, done, MF_E_TRANSFORM_TYPE_NOT_SET );
+ DMFTCHECKNULL_GOTO( m_spSourceTransform, done, MF_E_TRANSFORM_TYPE_NOT_SET );
for (UINT iMediaType = 0; SUCCEEDED(hr) ; iMediaType++)
{
- ComPtr<IMFMediaType> pMediaType = nullptr;
- hr = m_pSourceTransform->MFTGetOutputAvailableType( uiStreamId, iMediaType, pMediaType.GetAddressOf() );
+ ComPtr<IMFMediaType> spMediaType;
+ DWORD pos = 0;
+
+ hr = m_spSourceTransform->MFTGetOutputAvailableType(uiStreamId, iMediaType, spMediaType.GetAddressOf());
if (hr != S_OK)
break;
- DMFTCHECKHR_GOTO(pMediaType->GetGUID(MF_MT_SUBTYPE, &stSubType),done);
-
- if (((stSubType == MFVideoFormat_RGB8) || (stSubType == MFVideoFormat_RGB555) ||
- (stSubType == MFVideoFormat_RGB565) || (stSubType == MFVideoFormat_RGB24) ||
- (stSubType == MFVideoFormat_RGB32) || (stSubType == MFVideoFormat_ARGB32) ||
- (stSubType == MFVideoFormat_AI44) || (stSubType == MFVideoFormat_AYUV) ||
- (stSubType == MFVideoFormat_I420) || (stSubType == MFVideoFormat_IYUV) ||
- (stSubType == MFVideoFormat_NV11) || (stSubType == MFVideoFormat_NV12) ||
- (stSubType == MFVideoFormat_UYVY) || (stSubType == MFVideoFormat_Y41P) ||
- (stSubType == MFVideoFormat_Y41T) || (stSubType == MFVideoFormat_Y42T) ||
- (stSubType == MFVideoFormat_YUY2) || (stSubType == MFVideoFormat_YV12) ||
- (stSubType == MFVideoFormat_P010) || (stSubType == MFVideoFormat_P016) ||
- (stSubType == MFVideoFormat_P210) || (stSubType == MFVideoFormat_P216) ||
- (stSubType == MFVideoFormat_v210) || (stSubType == MFVideoFormat_v216) ||
- (stSubType == MFVideoFormat_v410) || (stSubType == MFVideoFormat_Y210) ||
- (stSubType == MFVideoFormat_Y216) || (stSubType == MFVideoFormat_Y410) ||
- (stSubType == MFVideoFormat_Y416)) )
- {
- DWORD pos = 0;
- AddMediaType(&pos, pMediaType.Get());
- }
- pMediaType = nullptr;
+
+ DMFTCHECKHR_GOTO(AddMediaType(&pos, spMediaType.Get()), done);
}
done:
if (hr == MF_E_NO_MORE_TYPES) {
@@ -334,6 +318,7 @@ done:
STDMETHODIMP_(VOID) CInPin::ConnectPin( _In_ CBasePin * poPin )
{
+ CAutoLock Lock(lock());
if (poPin!=nullptr)
{
m_outpins.push_back(poPin);
@@ -433,9 +418,9 @@ COutPin::COutPin(
: CBasePin( ulPinId, pparent ),
m_firstSample( false )
{
- HRESULT hr = S_OK;
- CPinState* pState = NULL;
- IMFAttributes *pAttributes = nullptr;
+ HRESULT hr = S_OK;
+ CPinState* pState = NULL;
+ ComPtr<IMFAttributes> spAttributes;
for ( ULONG ulIndex = 0; ulIndex <= DeviceStreamState_Disabled; ulIndex++ )
{
@@ -462,25 +447,22 @@ COutPin::COutPin(
//
//Get the input pin IKS control.. the pin IKS control talks to sourcetransform's IKS control
//
- m_Ikscontrol = pIksControl;
+ m_spIkscontrol = pIksControl;
- MFCreateAttributes( &pAttributes, 3 ); //Create the space for the attribute store!!
- setAttributes( pAttributes );
+ MFCreateAttributes( &spAttributes, 3 ); //Create the space for the attribute store!!
+ setAttributes( spAttributes.Get());
DMFTCHECKHR_GOTO( SetUINT32( MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE, TRUE ), done );
DMFTCHECKHR_GOTO( SetString( MFT_ENUM_HARDWARE_URL_Attribute, L"Sample_CameraExtensionMft" ),done );
DMFTCHECKHR_GOTO( SetUINT32( MF_TRANSFORM_ASYNC, TRUE ),done );
- //Set the pin attribute
-
- SAFE_RELEASE( pAttributes );
+
done:
- ;
DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! exiting %x = %!HRESULT!", hr, hr);
}
COutPin::~COutPin()
{
CPinQueue *que = NULL;
- m_Attributes = nullptr;
+ m_spAttributes = nullptr;
for ( ULONG ulIndex = 0, ulSize = (ULONG)m_queues.size(); ulIndex < ulSize; ulIndex++ )
{
@@ -513,11 +495,15 @@ STDMETHODIMP COutPin::AddPin(
//Add a new queue corresponding to the input pin
//
HRESULT hr = S_OK;
+ CAutoLock Lock(lock());
CPinQueue *que = new (std::nothrow) CPinQueue(inputPinId);
DMFTCHECKNULL_GOTO( que, done, E_OUTOFMEMORY );
-
- (void)m_queues.push_back( que );
+ hr = ExceptionBoundary([&]()
+ {
+ (void)m_queues.push_back(que);
+ });
+ DMFTCHECKHR_GOTO(hr, done);
//
//Just ramdonmize media types for odd numbered pins
//
@@ -850,7 +836,7 @@ STDMETHODIMP COutPin::KsProperty(
//
//Route it to input pin
//
- return m_Ikscontrol->KsProperty(pProperty,
+ return m_spIkscontrol->KsProperty(pProperty,
ulPropertyLength,
pPropertyData,
ulDataLength,
diff --git a/avstream/sampledevicemft/basepin.h b/avstream/sampledevicemft/basepin.h
index 63b94c2b..9b254e2a 100644
--- a/avstream/sampledevicemft/basepin.h
+++ b/avstream/sampledevicemft/basepin.h
@@ -67,9 +67,9 @@ public:
_Out_opt_ ULONG* pBytesReturned
)
{
- if ( m_Ikscontrol!=nullptr )
+ if ( m_spIkscontrol!=nullptr )
{
- return m_Ikscontrol->KsProperty(pProperty,
+ return m_spIkscontrol->KsProperty(pProperty,
ulPropertyLength,
pPropertyData,
ulDataLength,
@@ -123,7 +123,7 @@ public:
_Inout_opt_ PROPVARIANT* pValue
)
{
- return m_Attributes->GetItem(guidKey, pValue);
+ return m_spAttributes->GetItem(guidKey, pValue);
}
STDMETHOD(GetItemType)(
@@ -131,7 +131,7 @@ public:
_Out_ MF_ATTRIBUTE_TYPE* pType
)
{
- return m_Attributes->GetItemType(guidKey, pType);
+ return m_spAttributes->GetItemType(guidKey, pType);
}
STDMETHOD(CompareItem)(
@@ -140,7 +140,7 @@ public:
_Out_ BOOL* pbResult
)
{
- return m_Attributes->CompareItem(guidKey, Value, pbResult);
+ return m_spAttributes->CompareItem(guidKey, Value, pbResult);
}
STDMETHOD(Compare)(
@@ -149,7 +149,7 @@ public:
_Out_ BOOL* pbResult
)
{
- return m_Attributes->Compare(pTheirs, MatchType, pbResult);
+ return m_spAttributes->Compare(pTheirs, MatchType, pbResult);
}
STDMETHOD(GetUINT32)(
@@ -157,7 +157,7 @@ public:
_Out_ UINT32* punValue
)
{
- return m_Attributes->GetUINT32(guidKey, punValue);
+ return m_spAttributes->GetUINT32(guidKey, punValue);
}
STDMETHOD(GetUINT64)(
@@ -165,7 +165,7 @@ public:
_Out_ UINT64* punValue
)
{
- return m_Attributes->GetUINT64(guidKey, punValue);
+ return m_spAttributes->GetUINT64(guidKey, punValue);
}
STDMETHOD(GetDouble)(
@@ -173,7 +173,7 @@ public:
_Out_ double* pfValue
)
{
- return m_Attributes->GetDouble(guidKey, pfValue);
+ return m_spAttributes->GetDouble(guidKey, pfValue);
}
STDMETHOD(GetGUID)(
@@ -181,7 +181,7 @@ public:
_Out_ GUID* pguidValue
)
{
- return m_Attributes->GetGUID(guidKey, pguidValue);
+ return m_spAttributes->GetGUID(guidKey, pguidValue);
}
STDMETHOD(GetStringLength)(
@@ -189,7 +189,7 @@ public:
_Out_ UINT32* pcchLength
)
{
- return m_Attributes->GetStringLength(guidKey, pcchLength);
+ return m_spAttributes->GetStringLength(guidKey, pcchLength);
}
STDMETHOD(GetString)(
@@ -199,7 +199,7 @@ public:
_Inout_opt_ UINT32* pcchLength
)
{
- return m_Attributes->GetString(guidKey, pwszValue, cchBufSize, pcchLength);
+ return m_spAttributes->GetString(guidKey, pwszValue, cchBufSize, pcchLength);
}
STDMETHOD(GetAllocatedString)(
@@ -208,7 +208,7 @@ public:
_Inout_ UINT32* pcchLength
)
{
- return m_Attributes->GetAllocatedString(guidKey, ppwszValue, pcchLength);
+ return m_spAttributes->GetAllocatedString(guidKey, ppwszValue, pcchLength);
}
STDMETHOD(GetBlobSize)(
@@ -216,7 +216,7 @@ public:
_Out_ UINT32* pcbBlobSize
)
{
- return m_Attributes->GetBlobSize(guidKey, pcbBlobSize);
+ return m_spAttributes->GetBlobSize(guidKey, pcbBlobSize);
}
STDMETHOD(GetBlob)(
@@ -226,7 +226,7 @@ public:
_Inout_ UINT32* pcbBlobSize
)
{
- return m_Attributes->GetBlob(guidKey, pBuf, cbBufSize, pcbBlobSize);
+ return m_spAttributes->GetBlob(guidKey, pBuf, cbBufSize, pcbBlobSize);
}
STDMETHOD(GetAllocatedBlob)(
@@ -235,7 +235,7 @@ public:
__RPC__out UINT32* pcbSize
)
{
- return m_Attributes->GetAllocatedBlob(guidKey, ppBuf, pcbSize);
+ return m_spAttributes->GetAllocatedBlob(guidKey, ppBuf, pcbSize);
}
STDMETHOD(GetUnknown)(
@@ -244,7 +244,7 @@ public:
__RPC__deref_out_opt LPVOID *ppv
)
{
- return m_Attributes->GetUnknown(guidKey, riid, ppv);
+ return m_spAttributes->GetUnknown(guidKey, riid, ppv);
}
STDMETHOD(SetItem)(
@@ -252,19 +252,19 @@ public:
_In_ REFPROPVARIANT Value
)
{
- return m_Attributes->SetItem(guidKey, Value);
+ return m_spAttributes->SetItem(guidKey, Value);
}
STDMETHOD(DeleteItem)(
_In_ REFGUID guidKey
)
{
- return m_Attributes->DeleteItem(guidKey);
+ return m_spAttributes->DeleteItem(guidKey);
}
STDMETHOD(DeleteAllItems)()
{
- return m_Attributes->DeleteAllItems();
+ return m_spAttributes->DeleteAllItems();
}
STDMETHOD(SetUINT32)(
@@ -272,7 +272,7 @@ public:
_In_ UINT32 unValue
)
{
- return m_Attributes->SetUINT32(guidKey, unValue);
+ return m_spAttributes->SetUINT32(guidKey, unValue);
}
STDMETHOD(SetUINT64)(
@@ -280,7 +280,7 @@ public:
_In_ UINT64 unValue
)
{
- return m_Attributes->SetUINT64(guidKey, unValue);
+ return m_spAttributes->SetUINT64(guidKey, unValue);
}
STDMETHOD(SetDouble)(
@@ -288,7 +288,7 @@ public:
_In_ double fValue
)
{
- return m_Attributes->SetDouble(guidKey, fValue);
+ return m_spAttributes->SetDouble(guidKey, fValue);
}
STDMETHOD(SetGUID)(
@@ -296,7 +296,7 @@ public:
_In_ REFGUID guidValue
)
{
- return m_Attributes->SetGUID(guidKey, guidValue);
+ return m_spAttributes->SetGUID(guidKey, guidValue);
}
STDMETHOD(SetString)(
@@ -304,7 +304,7 @@ public:
_In_ LPCWSTR wszValue
)
{
- return m_Attributes->SetString(guidKey, wszValue);
+ return m_spAttributes->SetString(guidKey, wszValue);
}
STDMETHOD(SetBlob)(
@@ -313,7 +313,7 @@ public:
UINT32 cbBufSize
)
{
- return m_Attributes->SetBlob(guidKey, pBuf, cbBufSize);
+ return m_spAttributes->SetBlob(guidKey, pBuf, cbBufSize);
}
STDMETHOD(SetUnknown)(
@@ -321,24 +321,24 @@ public:
_In_ IUnknown* pUnknown
)
{
- return m_Attributes->SetUnknown(guidKey, pUnknown);
+ return m_spAttributes->SetUnknown(guidKey, pUnknown);
}
STDMETHOD(LockStore)()
{
- return m_Attributes->LockStore();
+ return m_spAttributes->LockStore();
}
STDMETHOD(UnlockStore)()
{
- return m_Attributes->UnlockStore();
+ return m_spAttributes->UnlockStore();
}
STDMETHOD(GetCount)(
_Out_ UINT32* pcItems
)
{
- return m_Attributes->GetCount(pcItems);
+ return m_spAttributes->GetCount(pcItems);
}
STDMETHOD(GetItemByIndex)(
@@ -347,14 +347,14 @@ public:
_Inout_ PROPVARIANT* pValue
)
{
- return m_Attributes->GetItemByIndex(unIndex, pguidKey, pValue);
+ return m_spAttributes->GetItemByIndex(unIndex, pguidKey, pValue);
}
STDMETHOD(CopyAllItems)(
_In_ IMFAttributes* pDest
)
{
- return m_Attributes->CopyAllItems(pDest);
+ return m_spAttributes->CopyAllItems(pDest);
}
//
@@ -420,7 +420,7 @@ protected:
}
__inline HRESULT setAttributes(_In_ IMFAttributes* _pAttributes)
{
- m_Attributes = _pAttributes;
+ m_spAttributes = _pAttributes;
return S_OK;
}
__inline CCritSec& lock()
@@ -428,8 +428,8 @@ protected:
return m_lock;
}
IMFMediaTypeArray m_listOfMediaTypes;
- ComPtr<IMFAttributes> m_Attributes;
- ComPtr<IKsControl> m_Ikscontrol;
+ ComPtr<IMFAttributes> m_spAttributes;
+ ComPtr<IKsControl> m_spIkscontrol;
private:
ULONG m_StreamId; /*Device Stream Id*/
@@ -500,7 +500,7 @@ public:
}
protected:
- ComPtr<IMFTransform> m_pSourceTransform; /*Source Transform*/
+ ComPtr<IMFTransform> m_spSourceTransform; /*Source Transform*/
private:
GUID m_stStreamType; /*GUID representing the GUID*/
ULONG m_activeStreamCount; /*Set when this stream is active*/
diff --git a/avstream/sampledevicemft/common.h b/avstream/sampledevicemft/common.h
index 3959f96b..238decfb 100644
--- a/avstream/sampledevicemft/common.h
+++ b/avstream/sampledevicemft/common.h
@@ -387,9 +387,8 @@ public:
//
//The below guid is used to register the GUID as the Device Transform. This should be adeed to the
//HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\ and under the
-//GLOBAL#\Device Parameters key, add a CameraPostProcessingPluginCLSID value, and set its value to
-// {0E313280-3169-4F41-A329-9E854169634F} for the Pipeline to pick up the Transform. MFT0 and Device
-// Transforms are exclusive and the presence of this key will lead the MFT0 to not load.
+//GLOBAL#\Device Parameters key, add a CameraDeviceMFTCLSID value, and set its value to
+// {0E313280-3169-4F41-A329-9E854169634F} for the Pipeline to pick up the Transform.
//
DEFINE_GUID(CLSID_MultiPinMFT,
0xe313280, 0x3169, 0x4f41, 0xa3, 0x29, 0x9e, 0x85, 0x41, 0x69, 0x63, 0x4f);
@@ -694,4 +693,25 @@ DEFINE_GUID(AVSTREAM_CUSTOM_PIN_IMAGE,
return E_NOTIMPL; \
}
-
+//
+// Object LifeTime manager. The Class has a global variable which
+// maintains a reference count of the number of objects in the
+// system managed by the DLL.
+//
+class CDMFTModuleLifeTimeManager{
+public:
+ CDMFTModuleLifeTimeManager()
+ {
+ InterlockedIncrement(&s_lObjectCount);
+ }
+ ~CDMFTModuleLifeTimeManager()
+ {
+ InterlockedDecrement(&s_lObjectCount);
+ }
+ static long GetDMFTObjCount()
+ {
+ return s_lObjectCount;
+ }
+private:
+ static volatile long s_lObjectCount;
+};
diff --git a/avstream/sampledevicemft/custompin.cpp b/avstream/sampledevicemft/custompin.cpp
index 5c983b54..00edb329 100644
--- a/avstream/sampledevicemft/custompin.cpp
+++ b/avstream/sampledevicemft/custompin.cpp
@@ -3,7 +3,7 @@
#include "basepin.h"
#include "custompin.h"
#ifdef MF_WPP
-#include "custompin.tmh"
+#include "custompin.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
diff --git a/avstream/sampledevicemft/dllmain.cpp b/avstream/sampledevicemft/dllmain.cpp
index 7445bfbd..6978a9d5 100644
--- a/avstream/sampledevicemft/dllmain.cpp
+++ b/avstream/sampledevicemft/dllmain.cpp
@@ -24,9 +24,16 @@
#include <initguid.h>
#ifdef MF_WPP
-#include "dllmain.tmh"
+#include "dllmain.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
+//
+// The static variable needed to check the object count of the deviceMFts loaded.
+//
+
+volatile long CDMFTModuleLifeTimeManager::s_lObjectCount = 0;
+
+
HRESULT RegisterObject(HMODULE hModule, REFGUID guid, PCWSTR pszDescription, PCWSTR pszThreadingModel);
@@ -203,7 +210,17 @@ STDMETHODIMP_(BOOL) WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, void *)
STDMETHODIMP DllCanUnloadNow()
{
- return (g_cRefModule == 0) ? S_OK : S_FALSE;
+ HRESULT hr = ((g_cRefModule == 0) && (CDMFTModuleLifeTimeManager::GetDMFTObjCount() == 0)) ? S_OK : S_FALSE;
+ //
+ // Debug object lifetimes
+ //
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! returning %d %d %!HRESULT!",
+ g_cRefModule,
+ CDMFTModuleLifeTimeManager::GetDMFTObjCount(),
+ hr);
+
+ return hr;
+
}
_Check_return_
diff --git a/avstream/sampledevicemft/mftpeventgenerator.cpp b/avstream/sampledevicemft/mftpeventgenerator.cpp
index b3814260..72b395ff 100644
--- a/avstream/sampledevicemft/mftpeventgenerator.cpp
+++ b/avstream/sampledevicemft/mftpeventgenerator.cpp
@@ -15,7 +15,7 @@
#define DH_THIS_FILE DH_DEVPROXY
#ifdef MF_WPP
-#include "mftpeventgenerator.tmh"
+#include "mftpeventgenerator.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
CMediaEventGenerator::CMediaEventGenerator () :
diff --git a/avstream/sampledevicemft/multipinmft.cpp b/avstream/sampledevicemft/multipinmft.cpp
index 31001858..ea7fd892 100644
--- a/avstream/sampledevicemft/multipinmft.cpp
+++ b/avstream/sampledevicemft/multipinmft.cpp
@@ -9,7 +9,7 @@
#include "stdafx.h"
#include "multipinmft.h"
#ifdef MF_WPP
-#include "multipinmft.tmh"
+#include "multipinmft.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
//
//Note since MFT_UNIQUE_METHOD_NAMES is defined all the functions of IMFTransform have the Mft suffix..
@@ -36,12 +36,11 @@ CMultipinMft::CMultipinMft()
m_OutputPinCount( 0 ),
m_dwWorkQueueId ( MFASYNC_CALLBACK_QUEUE_MULTITHREADED ),
m_lWorkQueuePriority ( 0 ),
- m_attributes( nullptr ),
- m_pSourceTransform( nullptr ),
+ m_spAttributes( nullptr ),
+ m_spSourceTransform( nullptr ),
m_PhotoTriggerSent(false),
m_filterHasIndependentPin( false ),
m_FilterInPhotoSequence( false ),
- m_AsyncPropEvent( nullptr ),
m_filterInWarmStart(false)
#if defined (MF_DEVICEMFT_PHTOTOCONFIRMATION)
, m_spPhotoConfirmationCallback(nullptr)
@@ -53,7 +52,10 @@ CMultipinMft::CMultipinMft()
pAttributes->SetUINT32( MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE, TRUE );
pAttributes->SetUINT32( MF_SA_D3D_AWARE, TRUE );
pAttributes->SetString( MFT_ENUM_HARDWARE_URL_Attribute, L"SampleMultiPinMft" );
- m_attributes = pAttributes;
+ m_spAttributes = pAttributes;
+#if defined (MF_DEVICEMFT_PHTOTOCONFIRMATION)
+ m_guidPhotoConfirmationSubtype = MFVideoFormat_NV12;
+#endif
}
CMultipinMft::~CMultipinMft( )
@@ -73,7 +75,7 @@ CMultipinMft::~CMultipinMft( )
SAFERELEASE( pioPin );
}
m_OutPins.clear();
- m_pSourceTransform = nullptr;
+ m_spSourceTransform = nullptr;
}
@@ -150,6 +152,12 @@ STDMETHODIMP CMultipinMft::QueryInterface(
*ppv = static_cast< IMFCapturePhotoConfirmation* >(this);
AddRef();
}
+ else
+ if (iid == __uuidof(IMFGetService))
+ {
+ *ppv = static_cast< IMFGetService* >(this);
+ AddRef();
+ }
#endif
else
{
@@ -194,12 +202,12 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
//
DMFTCHECKHR_GOTO( pAttributes->GetUnknown( MF_DEVICEMFT_CONNECTED_FILTER_KSCONTROL,IID_PPV_ARGS( &spFilterUnk ) ),done );
- DMFTCHECKHR_GOTO( spFilterUnk.As( &m_pSourceTransform ), done );
-
- DMFTCHECKHR_GOTO( m_pSourceTransform.As( &m_ikscontrol ), done );
+ DMFTCHECKHR_GOTO( spFilterUnk.As( &m_spSourceTransform ), done );
- DMFTCHECKHR_GOTO( m_pSourceTransform->MFTGetStreamCount( &inputStreams, &outputStreams ), done );
+ DMFTCHECKHR_GOTO( m_spSourceTransform.As( &m_spIkscontrol ), done );
+ DMFTCHECKHR_GOTO( m_spSourceTransform->MFTGetStreamCount( &inputStreams, &outputStreams ), done );
+
spFilterUnk = nullptr;
//
@@ -215,7 +223,7 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
pcOutputStreams = new DWORD[ outputStreams ];
DMFTCHECKNULL_GOTO( pcOutputStreams, done, E_OUTOFMEMORY );
- DMFTCHECKHR_GOTO( m_pSourceTransform->MFTGetStreamIDs( inputStreams, pcInputStreams,
+ DMFTCHECKHR_GOTO( m_spSourceTransform->MFTGetStreamIDs( inputStreams, pcInputStreams,
outputStreams,
pcOutputStreams ),done );
@@ -227,7 +235,7 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
{
ComPtr<IMFAttributes> pInAttributes = nullptr;
- DMFTCHECKHR_GOTO( m_pSourceTransform->GetOutputStreamAttributes(pcOutputStreams[ulIndex], pInAttributes.GetAddressOf()), done);
+ DMFTCHECKHR_GOTO( m_spSourceTransform->GetOutputStreamAttributes(pcOutputStreams[ulIndex], pInAttributes.GetAddressOf()), done);
DMFTCHECKHR_GOTO( pInAttributes->GetGUID(MF_DEVICESTREAM_STREAM_CATEGORY, &streamCategory), done);
@@ -252,9 +260,14 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
pInPin = new CInPin( pInAttributes.Get(), pcOutputStreams[ulIndex], this);
DMFTCHECKNULL_GOTO(pInPin, done, E_OUTOFMEMORY);
}
- m_InPins.push_back( pInPin );
-
- DMFTCHECKHR_GOTO( pInPin->Init(m_pSourceTransform.Get() ), done);
+
+ hr = ExceptionBoundary([this,pInPin]()
+ {
+ m_InPins.push_back(pInPin);
+ });
+
+ DMFTCHECKHR_GOTO(hr, done);
+ DMFTCHECKHR_GOTO( pInPin->Init(m_spSourceTransform.Get() ), done);
pInPin->AddRef();
@@ -280,10 +293,17 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
for ( ULONG ulIndex = 0; ulIndex < outputStreams; ulIndex++ )
{
ComPtr<IKsControl> pKsControl = NULL;
+ COutPin *poPin = nullptr;
DMFTCHECKHR_GOTO( piPin->QueryInterface(IID_PPV_ARGS( &pKsControl ) ), done);
+
+ hr = ExceptionBoundary([&]()
+ {
+ poPin = new COutPin(ulIndex, this, pKsControl.Get());
+ });
+
+ DMFTCHECKHR_GOTO(hr, done);
- COutPin *poPin = new COutPin( ulIndex, this, pKsControl.Get() );
DMFTCHECKNULL_GOTO( poPin,done, E_OUTOFMEMORY );
DMFTCHECKHR_GOTO( BridgeInputPinOutputPin( piPin, poPin ),done );
@@ -373,8 +393,11 @@ STDMETHODIMP CMultipinMft::InitializeTransform (
}
#endif
DMFTCHECKHR_GOTO(BridgeInputPinOutputPin(piPin, poPin), done);
-
- m_OutPins.push_back(poPin);
+ hr = ExceptionBoundary([&]()
+ {
+ m_OutPins.push_back(poPin);
+ });
+ DMFTCHECKHR_GOTO(hr, done);
}
}
}
@@ -419,7 +442,7 @@ done:
//
// Simply clear the custom pins since the input pins must have deleted the pin
//
- m_pSourceTransform = nullptr;
+ m_spSourceTransform = nullptr;
}
return hr;
}
@@ -1146,6 +1169,19 @@ STDMETHODIMP CMultipinMft::KsProperty(
UNREFERENCED_PARAMETER(pulBytesReturned);
DMFTCHECKNULL_GOTO(pProperty, done, E_INVALIDARG);
DMFTCHECKNULL_GOTO(pulBytesReturned, done, E_INVALIDARG);
+
+ //
+ // Enable Warm Start on All filters for the sample. Please comment out this
+ // section if this is not needed
+ //
+ if (IsEqualCLSID(pProperty->Set, KSPROPERTYSETID_ExtendedCameraControl)
+ && (pProperty->Id == KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART))
+ {
+ DMFTCHECKHR_GOTO(WarmStartHandler(pProperty,
+ ulPropertyLength, pvPropertyData, ulDataLength, pulBytesReturned),done);
+ goto done;
+ }
+
if (IsEqualCLSID(pProperty->Set, KSPROPERTYSETID_ExtendedCameraControl)
&& (pProperty->Id == KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTHUMBNAIL))
{
@@ -1182,11 +1218,7 @@ STDMETHODIMP CMultipinMft::KsProperty(
ulPropertyLength, pvPropertyData, ulDataLength, pulBytesReturned);
goto done;
break;
- case KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART:
- hr = WarmStartHandler(pProperty,
- ulPropertyLength, pvPropertyData, ulDataLength, pulBytesReturned);
- goto done;
- break;
+
}
}
else
@@ -1235,7 +1267,7 @@ STDMETHODIMP CMultipinMft::KsProperty(
goto done;
}
}
- hr = m_ikscontrol->KsProperty(pProperty,
+ hr = m_spIkscontrol->KsProperty(pProperty,
ulPropertyLength,
pvPropertyData,
ulDataLength,
@@ -1262,7 +1294,7 @@ STDMETHODIMP CMultipinMft::KsMethod(
Implements IKSProperty::KsMethod function.
--*/
{
- return m_ikscontrol->KsMethod(
+ return m_spIkscontrol->KsMethod(
pMethod,
ulPropertyLength,
pvPropertyData,
@@ -1284,11 +1316,35 @@ STDMETHODIMP CMultipinMft::KsEvent(
Implements IKSProperty::KsEvent function.
--*/
{
+
+ HRESULT hr = S_OK;
+ if (pEvent && (pEvent->Set == KSEVENTSETID_ExtendedCameraControl) &&
+ (pEvent->Id == KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART))
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Acquiring Event for Async Extended Control");
+ //
+ // For the Sample the warmstate handlers are supported by Device MFT and not passed to driver
+ //
+ hr = m_eventHandler.KSEvent(pEvent,
+ ulEventLength,
+ pEventData,
+ ulDataLength,
+ pBytesReturned
+ );
+ goto done;
+ }
+
if ((pEvent && (pEvent->Set == KSEVENTSETID_ExtendedCameraControl))
&& (!filterHasIndependentPin()))
{
//
- //Store only for emualted controls..To do!!!
+ // Important: Extended controls will send events which are strictly
+ // One shot. The event comes first where it should be duped and stored,
+ // the control comes next. The event should be set after control completes
+ // and it should be then closed.
+ // The below code handles only certain events needed for
+ // implementing photo sequence. For a complete exhaustive
+ // list refer documentation.
//
switch (pEvent->Id)
{
@@ -1297,20 +1353,32 @@ STDMETHODIMP CMultipinMft::KsEvent(
case KSPROPERTY_CAMERACONTROL_EXTENDED_MAXVIDFPS_PHOTORES:
case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTRIGGERTIME:
case KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOFRAMERATE:
- case KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART:
- {
- DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Acquiring Event for Async Extended Control");
- KSEVENTDATA* ksEventData = (KSEVENTDATA*)pEventData;
- m_AsyncPropEvent = ksEventData->EventHandle.Event;
- }
- return S_OK;
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Acquiring Event for Async Extended Control");
+ //
+ // Let the event handler handle the event
+ //
+ DMFTCHECKHR_GOTO(m_eventHandler.KSEvent(pEvent,
+ ulEventLength,
+ pEventData,
+ ulDataLength,
+ pBytesReturned
+ ),done);
+ goto done;
+ }
}
}
- return m_ikscontrol->KsEvent(pEvent,
+ //
+ // All the Events we don't handle should be sent to the driver!
+ //
+ hr = m_spIkscontrol->KsEvent(pEvent,
ulEventLength,
pEventData,
ulDataLength,
pBytesReturned);
+done:
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! exiting %x = %!HRESULT!", hr, hr);
+ return hr;
}
@@ -1401,9 +1469,9 @@ STDMETHODIMP CMultipinMft::GetAttributes(
*ppAttributes = nullptr;
- if (m_attributes != nullptr)
+ if (m_spAttributes != nullptr)
{
- m_attributes.CopyTo(ppAttributes);
+ m_spAttributes.CopyTo(ppAttributes);
}
else
{
@@ -1763,8 +1831,10 @@ STDMETHODIMP CMultipinMft::BridgeInputPinOutputPin(
DMFTCHECKNULL_GOTO( piPin, done, E_INVALIDARG );
DMFTCHECKNULL_GOTO( poPin, done, E_INVALIDARG );
//
- //Copy over the media types from input pin to output pin. Since there is no
- //decoder support, only the uncompressed media types are inserted
+ // Copy over the media types from input pin to output pin. Since there is no
+ // decoder support, only the uncompressed media types are inserted. Please make
+ // sure any pin advertised supports at least one media type. The pipeline doesn't
+ // like pins with no media types
//
while ( SUCCEEDED( hr = piPin->GetMediaTypeAt( ulIndex++, &pMediaType )))
{
@@ -1781,12 +1851,14 @@ STDMETHODIMP CMultipinMft::BridgeInputPinOutputPin(
//
//Add the Input Pin to the output Pin
//
- DMFTCHECKHR_GOTO( poPin->AddPin(piPin->streamId()), done );
- //
- //Add the output pin to the input pin.
- //
- piPin->ConnectPin( poPin );
-
+ DMFTCHECKHR_GOTO(poPin->AddPin(piPin->streamId()), done);
+ hr = ExceptionBoundary([&](){
+ //
+ //Add the output pin to the input pin.
+ //
+ piPin->ConnectPin(poPin);
+ });
+ DMFTCHECKHR_GOTO(hr, done);
//
//Create the map. This will be useful when we have to decide the state transitions of the pins
//
@@ -1796,6 +1868,10 @@ done:
//
//Failed adding media types
//
+ if (FAILED(hr))
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_ERROR, "%!FUNC! exiting %x = %!HRESULT!", hr, hr);
+ }
return hr;
}
@@ -1841,7 +1917,7 @@ _Inout_ PULONG pulBytesReturned
//PKSCAMERA_EXTENDEDPROP_PHOTOMODE pExtendedValue = (PKSCAMERA_EXTENDEDPROP_PHOTOMODE)(pPayload + sizeof(KSCAMERA_EXTENDEDPROP_HEADER));
//
m_FilterInPhotoSequence = pExtendedHeader->Flags & KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE;
- SetEvent( m_AsyncPropEvent );
+ DMFTCHECKHR_GOTO(m_eventHandler.SetOneShot(KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMODE), done);
}
else
{
@@ -1919,7 +1995,7 @@ STDMETHODIMP CMultipinMft::ExtendedPhotoMaxFrameRate(
//PKSCAMERA_EXTENDEDPROP_HEADER pExtendedHeader = (PKSCAMERA_EXTENDEDPROP_HEADER)(pPayload);
//PKSCAMERA_EXTENDEDPROP_VALUE pExtendedValue = (PKSCAMERA_EXTENDEDPROP_VALUE)(pPayload + sizeof(KSCAMERA_EXTENDEDPROP_HEADER));
//
- SetEvent(m_AsyncPropEvent);
+ DMFTCHECKHR_GOTO(m_eventHandler.SetOneShot(KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMAXFRAMERATE), done);
}
else
{
@@ -2204,8 +2280,7 @@ STDMETHODIMP CMultipinMft::WarmStartHandler(
}
*pulBytesReturned = sizeof( PKSCAMERA_EXTENDEDPROP_HEADER )+sizeof( KSCAMERA_EXTENDEDPROP_VALUE );
-
- SetEvent( m_AsyncPropEvent );
+ m_eventHandler.SetOneShot(KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART);
}
else
{
@@ -2268,6 +2343,8 @@ STDMETHODIMP CMultipinMft::Shutdown(
void
)
{
+ CAutoLock Lock(m_critSec);
+ (VOID) m_eventHandler.Clear();
return ShutdownEventGenerator();
}
@@ -2323,7 +2400,7 @@ STDMETHODIMP CMultipinMft::ProcessCapturePhotoConfirmationCallBack(
DMFTCHECKHR_GOTO(MFCreateMediaType(&spMediaType), done);
DMFTCHECKHR_GOTO(pMediaType->CopyAllItems(spMediaType.Get()), done);
- DMFTCHECKHR_GOTO(pSample->SetUnknown(MFSourceReader_SampleAttribute_MediaType, spMediaType.Get()), done);
+ DMFTCHECKHR_GOTO(pSample->SetUnknown(MFSourceReader_SampleAttribute_MediaType_priv, spMediaType.Get()), done);
DMFTCHECKHR_GOTO(pSample->GetSampleTime(&timeStamp), done);
DMFTCHECKHR_GOTO(pSample->SetUINT64(MFSampleExtension_DeviceReferenceSystemTime, timeStamp), done);
diff --git a/avstream/sampledevicemft/multipinmft.h b/avstream/sampledevicemft/multipinmft.h
index b67c4179..244a47be 100644
--- a/avstream/sampledevicemft/multipinmft.h
+++ b/avstream/sampledevicemft/multipinmft.h
@@ -12,7 +12,16 @@
#include "mftpeventgenerator.h"
#include "basepin.h"
#include "custompin.h"
+#include "multipinmfthelpers.h"
+//
+// The Below GUID is needed to transfer photoconfirmation sample successfully in the pipeline
+// It is used to propagate the mediatype of the sample to the pipeline which will consume the sample
+// This attribute is known to the OS, but not publicly defined.
+//
+
+DEFINE_GUID(MFSourceReader_SampleAttribute_MediaType_priv,
+ 0x0ea5c1e8, 0x9845, 0x41e0, 0xa2, 0x43, 0x72, 0x32, 0x07, 0xfc, 0x78, 0x1f);
interface IDirect3DDeviceManager9;
@@ -408,7 +417,7 @@ protected:
__inline IMFTransform* Parent()
{
- return m_pSourceTransform.Get();
+ return m_spSourceTransform.Get();
}
__inline VOID SetStreamingState(DeviceStreamState state)
@@ -439,17 +448,17 @@ private:
long m_nRefCount; // Reference count
CCritSec m_critSec; // Control lock.. taken only durign state change operations
ComPtr <IUnknown> m_spDeviceManagerUnk; // D3D Manager set, when MFT_MESSAGE_SET_D3D_MANAGER is called through ProcessMessage
- ComPtr<IMFTransform> m_pSourceTransform; // The sources transform
+ ComPtr<IMFTransform> m_spSourceTransform; // The sources transform
MFSHUTDOWN_STATUS m_eShutdownStatus;
DWORD m_dwWorkQueueId;
LONG m_lWorkQueuePriority;
UINT32 m_punValue;
- ComPtr<IKsControl> m_ikscontrol;
- ComPtr<IMFAttributes> m_attributes;
-
- multimap<int, int> m_inputPinMap; //How input pins are connected to output pins o-><0..inpins>
- multimap<int, int> m_outputPinMap; //How output pins are connected to input pins i-><0..outpins>
- HANDLE m_AsyncPropEvent;
+ ComPtr<IKsControl> m_spIkscontrol;
+ ComPtr<IMFAttributes> m_spAttributes;
+
+ multimap<int, int> m_inputPinMap; // How input pins are connected to output pins o-><0..inpins>
+ multimap<int, int> m_outputPinMap; // How output pins are connected to input pins i-><0..outpins>
+ CDMFTEventHandler m_eventHandler;
#if defined (MF_DEVICEMFT_PHTOTOCONFIRMATION)
ComPtr<IMFAsyncCallback> m_spPhotoConfirmationCallback; //Photo Confirmation related definitions
diff --git a/avstream/sampledevicemft/multipinmft.vcxproj b/avstream/sampledevicemft/multipinmft.vcxproj
index 2493f021..31107772 100644
--- a/avstream/sampledevicemft/multipinmft.vcxproj
+++ b/avstream/sampledevicemft/multipinmft.vcxproj
@@ -19,12 +19,12 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{CD76DACF-18E8-4625-9A09-19B020579A56}</ProjectGuid>
+ <ProjectGuid>{E77657CD-A270-49E1-823A-8A14FF8596C8}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{6DBDE413-6AD0-40FA-ABE2-273BA6176E9E}</SampleGuid>
+ <SampleGuid>{D6CB33D6-DEF2-497E-A72D-6E6E29C67F48}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
diff --git a/avstream/sampledevicemft/multipinmft.vcxproj.Filters b/avstream/sampledevicemft/multipinmft.vcxproj.Filters
index 4cf74a60..e06f675d 100644
--- a/avstream/sampledevicemft/multipinmft.vcxproj.Filters
+++ b/avstream/sampledevicemft/multipinmft.vcxproj.Filters
@@ -3,15 +3,15 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{94BAD99E-E9EC-451B-A064-3C99833E8EE5}</UniqueIdentifier>
+ <UniqueIdentifier>{39379DB7-5CE0-407A-A6D4-F2F23BB3BF3C}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{1308E3EE-C5B2-4417-BD87-A7116D7DD60D}</UniqueIdentifier>
+ <UniqueIdentifier>{05E63691-6953-4F79-BEC2-1CF881B618BA}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
- <UniqueIdentifier>{2DCD9326-19A0-46C1-B32D-00012EB223F3}</UniqueIdentifier>
+ <UniqueIdentifier>{B10F4398-9892-4AA8-8653-E5A7F4726726}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
diff --git a/avstream/sampledevicemft/multipinmfthelpers.cpp b/avstream/sampledevicemft/multipinmfthelpers.cpp
index f2f8fc8a..078ca337 100644
--- a/avstream/sampledevicemft/multipinmfthelpers.cpp
+++ b/avstream/sampledevicemft/multipinmfthelpers.cpp
@@ -6,7 +6,7 @@
#include <wincodec.h>
#ifdef MF_WPP
-#include "multipinmfthelpers.tmh"
+#include "multipinmfthelpers.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
class CMediaTypePrinter;
//
@@ -35,7 +35,16 @@ Description:
STDMETHODIMP_(VOID) CPinQueue::InsertInternal( _In_ IMFSample *pSample )
{
pSample->AddRef();
- m_sampleList.push_back( pSample );
+ HRESULT hr = ExceptionBoundary([&]()
+ {
+ m_sampleList.push_back(pSample);
+ });
+
+ if (FAILED(hr))
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! exiting %x = %!HRESULT!", hr, hr);
+ SAFE_RELEASE(pSample);
+ }
}
STDMETHODIMP_(BOOL) CPinQueue::Insert( _In_ IMFSample *pSample )
@@ -656,6 +665,324 @@ STDMETHODIMP CDecoderTee::ConfigureDecoder( _In_ IMFTransform *pTransform)
return S_OK;
}
+/*++
+Descrtiption:
+ Handles events sent by the pipeline
+ --*/
+STDMETHODIMP CDMFTEventHandler::KSEvent(
+ _In_reads_bytes_(ulEventLength) PKSEVENT pEvent,
+ _In_ ULONG ulEventLength,
+ _Inout_updates_bytes_opt_(ulDataLength) LPVOID pEventData,
+ _In_ ULONG ulDataLength,
+ _Inout_ ULONG* pBytesReturned)
+{
+ HRESULT hr = S_OK;
+ UNREFERENCED_PARAMETER(ulDataLength);
+ UNREFERENCED_PARAMETER(pBytesReturned);
+
+ if (pEvent == nullptr)
+ {
+ //
+ // We can have an Event Reset here
+ //
+ if (pEventData == nullptr)
+ {
+ //
+ // Invalid input. KSEVENT and KSEVENTDATA cannot both be null
+ //
+ DMFTCHECKHR_GOTO(E_INVALIDARG, done);
+ }
+ //
+ // The way KSevents work are, KSEVENT and KSEVENTDATA both have to be non null for events to be Set
+ // on the driver. If the pipeline wishes to reset the event we pass the KSEVENT structure as NULL and
+ // the KSEVENTDATA to be nonnull.
+ // ********** EVENT RESET here since KSEVENT is null and KSEVENTDATA is not**********
+ // We will never get Event Reset for One shot events
+ // Search the list of regular events to find the KSEVENTDATA pointer and then free the entry
+ //
+ for ( vector<PDMFTEventEntry>::iterator it = m_RegularEventList.begin(); it != m_RegularEventList.end(); ++it )
+ {
+ PDMFTEventEntry pEntry = nullptr;
+ pEntry = *it;
+ DMFTCHECKNULL_GOTO(pEntry, done, E_UNEXPECTED); // We should never see a null data structure entry
+ if (pEntry->m_pEventData == pEventData)
+ {
+ it = m_RegularEventList.erase(it);
+ delete(pEntry); // Delete the entry!
+ goto done;
+ }
+ }
+
+ DMFTCHECKHR_GOTO(E_NOT_SET, done);
+ }
+ else
+ {
+ //
+ // If we are here the pipeline wants to do the following things
+ // 1) Store a regular event
+ // 2) Store a oneshot event
+ //
+ HANDLE evtHandle = nullptr;
+ PKSEVENT pEvt = pEvent;
+ PKSEVENTDATA pEvtdata = reinterpret_cast<PKSEVENTDATA>(pEventData);
+
+ if (ulEventLength < sizeof(KSEVENT))
+ {
+ DMFTCHECKNULL_GOTO(pBytesReturned, done, E_INVALIDARG);
+ *pBytesReturned = sizeof(KSEVENT);
+ DMFTCHECKHR_GOTO(HRESULT_FROM_WIN32(ERROR_MORE_DATA), done);
+ }
+
+ if (!pEvtdata)
+ {
+ //
+ // Need the event data to be present to service the call properly!
+ //
+ DMFTCHECKHR_GOTO(E_INVALIDARG, done);
+ }
+
+ if (pEvt->Flags & KSEVENT_TYPE_ENABLE) // Regular/ Manual Reset Event
+ {
+ vector<PDMFTEventEntry>::iterator it = m_RegularEventList.begin();
+ for (; it != m_RegularEventList.end(); it++)
+ {
+ PDMFTEventEntry pEntry = *it;
+ DMFTCHECKNULL_GOTO(pEntry, done, E_FAIL);
+ if (pEntry->m_pEventData == pEventData)
+ {
+ break;
+ }
+ }
+ if (it != m_RegularEventList.end())
+ {
+ //
+ // Duplicate entry found.
+ //
+ DMFTCHECKHR_GOTO(E_NOT_VALID_STATE, done);
+ }
+ }
+ else if (pEvt->Flags & KSEVENT_TYPE_ONESHOT)
+ {
+ ULONG ulEventCommand = pEvt->Id;
+ hr = ExceptionBoundary([&]()
+ {
+ map<ULONG, HANDLE>::iterator it = m_OneShotEventMap.find(ulEventCommand);
+ if (it != m_OneShotEventMap.end())
+ {
+ //
+ // Duplicate entry found.
+ //
+ hr = E_NOT_VALID_STATE;
+ }
+ });
+ DMFTCHECKHR_GOTO(hr, done);
+ }
+ else
+ {
+ DMFTCHECKHR_GOTO(E_NOTIMPL, done);
+ }
+
+ //
+ // Duplicate the handle
+ //
+ DMFTCHECKHR_GOTO(Dupe(pEvtdata->EventHandle.Event, &evtHandle),done);
+ ULONG ulEventCommand = pEvt->Id;
+
+ if (pEvt->Flags & KSEVENT_TYPE_ENABLE)
+ {
+ // ************** REGULAR EVENT ****************************
+ // Regualar event. When this needs to be cleqared we will geta call with KSEVENT = null
+ // and KSEVENTDATA with the same address as this call(pEvtdata). Hence store it
+ // To set the event all we need is the EVENT id.
+ //
+ PDMFTEventEntry pEntry = new DMFTEventEntry(ulEventCommand, pEvtdata, evtHandle);
+ DMFTCHECKNULL_GOTO(pEntry, done, E_OUTOFMEMORY);
+ hr = ExceptionBoundary([&]()
+ {
+ (VOID)m_RegularEventList.push_back(pEntry);
+ });
+ }
+ else if(pEvt->Flags & KSEVENT_TYPE_ONESHOT)
+ {
+ // *************** SINGLE SHOT EVENT ************************
+ // Single Shot event store. Store the event Id and the Handle.
+ //
+ hr = ExceptionBoundary([&]()
+ {
+ (VOID)m_OneShotEventMap.insert(std::pair<ULONG, HANDLE>(ulEventCommand, evtHandle));
+ });
+ DMFTCHECKHR_GOTO(hr, done);
+ }
+ }
+
+done:
+ return hr;
+}
+
+/*++
+Descrtiption:
+ Used to set the One shot events sent by the pipeline.
+ One shot events should be closed by the component after firing. The Pipeline
+ will not send a reset or a clear for one shot events
+--*/
+
+STDMETHODIMP CDMFTEventHandler::SetOneShot( ULONG ulEventId )
+{
+ HRESULT hr = S_OK;
+ hr = ExceptionBoundary([&]()
+ {
+ map<ULONG, HANDLE>::iterator it = m_OneShotEventMap.find(ulEventId);
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! trying to Set OneShot %d ", ulEventId);
+
+ if (it != m_OneShotEventMap.end())
+ {
+ // Found the event
+ HANDLE hOneShot = it->second;
+ if (SetEvent(hOneShot))
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Setting OneShot %d Succeeded",
+ ulEventId);
+ CloseHandle(hOneShot);
+ m_OneShotEventMap.erase(it);
+ }
+ else
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Setting OneShot %d failed %x",
+ ulEventId,
+ HRESULT_FROM_WIN32(GetLastError()));
+ }
+ }
+ else
+ {
+ hr = E_NOT_SET;
+ }
+ });
+ DMFTCHECKHR_GOTO(hr, done);
+done:
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Setting OneShot %d failed %x",
+ ulEventId,
+ HRESULT_FROM_WIN32(GetLastError()));
+ return hr;
+}
+
+/*++
+Descrtiption:
+ Used to set the Regular events sent by the pipeline.
+ Regular events unlike the one shot events must be persisted
+ until the pipeline explicitly needs the event to be unset.
+--*/
+STDMETHODIMP CDMFTEventHandler::SetRegularEvent(ULONG ulEventId)
+{
+ BOOL bEvtFound = FALSE;
+ HRESULT hr = ExceptionBoundary([&]()
+ {
+
+ for (vector<PDMFTEventEntry>::iterator it = m_RegularEventList.begin(); it != m_RegularEventList.end(); ++it)
+ {
+ PDMFTEventEntry pEntry = *it;
+ if (ulEventId == pEntry->m_ulEventId)
+ {
+ // Found the event
+ bEvtFound = TRUE;
+ if (!::SetEvent(pEntry->m_hHandle))
+ {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Setting Event %d Failed 0x%x",
+ ulEventId, hr);
+ }
+ else
+ {
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Setting Event %d s",
+ ulEventId);
+ }
+ }
+ }
+ });
+ if (!bEvtFound)
+ {
+ DMFTCHECKHR_GOTO(E_NOT_SET, done);
+ }
+done:
+ return hr;
+}
+/*++
+Descrtiption:
+ Duplicates the handle passed.
+--*/
+
+STDMETHODIMP CDMFTEventHandler::Dupe(_In_ HANDLE hEventHandle, _Outptr_ LPHANDLE lpTargetHandle)
+{
+ HRESULT hr = S_OK;
+ DMFTCHECKNULL_GOTO(hEventHandle, done, E_INVALIDARG);
+ DMFTCHECKNULL_GOTO(lpTargetHandle, done, E_INVALIDARG);
+ //
+ // Duplicate handle and store it for when it needs to be fired
+ //
+ if (!DuplicateHandle(GetCurrentProcess(), hEventHandle,
+ GetCurrentProcess(), lpTargetHandle,
+ 0,
+ false,
+ DUPLICATE_SAME_ACCESS
+ ))
+ {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ DMFTRACE(DMFT_GENERAL, TRACE_LEVEL_INFORMATION, "%!FUNC! Duplicating Event Handle failed %x",
+ hr);
+ DMFTCHECKHR_GOTO(hr, done);
+ }
+done:
+ return hr;
+}
+/*++
+
+Descrtiption:
+ Cleans the event lists, both the Single shot and the Regular ones
+
+--*/
+STDMETHODIMP CDMFTEventHandler::Clear()
+{
+ HRESULT hr = S_OK;
+ hr = ExceptionBoundary([&]()
+ {
+ map<ULONG, HANDLE>::iterator it = m_OneShotEventMap.begin();
+ for (; it != m_OneShotEventMap.end(); ++it)
+ {
+ //
+ // Delete the one shot entries. We should not see this path usually
+ // as the pipeline will send a one shot event and set it soon. We
+ // should remore the entry then.
+ //
+ CloseHandle(it->second);
+ it = m_OneShotEventMap.erase(it);
+ if (it == m_OneShotEventMap.end())
+ {
+ // We've reached the end break
+ break;
+ }
+ }
+ });
+ DMFTCHECKHR_GOTO(hr, done);
+ hr = ExceptionBoundary([=]()
+ {
+ vector<PDMFTEventEntry>::iterator it2 = m_RegularEventList.begin();
+ for (; it2 != m_RegularEventList.end(); ++it2)
+ {
+ //
+ // Delete the entries. This will be traversed
+ //
+ PDMFTEventEntry pEntry = *it2;
+ it2 = m_RegularEventList.erase(it2);
+ SAFE_DELETE(pEntry);
+ if (it2 == m_RegularEventList.end())
+ {
+ break;
+ }
+ }
+ });
+ DMFTCHECKHR_GOTO(hr, done);
+done:
+ return hr;
+}
diff --git a/avstream/sampledevicemft/multipinmfthelpers.h b/avstream/sampledevicemft/multipinmfthelpers.h
index a998f483..25d87eb8 100644
--- a/avstream/sampledevicemft/multipinmfthelpers.h
+++ b/avstream/sampledevicemft/multipinmfthelpers.h
@@ -204,3 +204,88 @@ private:
};
+/*
+################## EVENT HANDLING #############################################
+Events are usually divided into two categories by the Capture Pipeline
+1) Regular Event / Manual Reset Event
+2) One Shot Event
+
+Regular events are set and cleared by the pipeline
+One shot Events will only be set by the pipeline and it should be cleared
+by the Component managing the Event Store i.e. KS or DMFT. For Redstone
+The pipeline should not send any Non One shot events.This sample however
+does show the handling of Regular/ Manual Reset events
+
+This clearing of One shot events is done when the event is fired..
+E.g before sending the warm start command The pipeline will send a one shot event
+KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART and when the operation completes the
+event should be fired.
+The Device MFT should usually keep a watch for one shot events sent by the Pipeline
+for Async Extended controls..The list of Asynchronous controls are as follows..
+
+KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMODE
+KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOMAXFRAMERATE
+KSPROPERTY_CAMERACONTROL_EXTENDED_FOCUSMODE
+KSPROPERTY_CAMERACONTROL_REGION_OF_INTEREST_PROPERTY_ID
+KSPROPERTY_CAMERACONTROL_EXTENDED_ISO
+KSPROPERTY_CAMERACONTROL_EXTENDED_ISO_ADVANCED
+KSPROPERTY_CAMERACONTROL_EXTENDED_EVCOMPENSATION
+KSPROPERTY_CAMERACONTROL_EXTENDED_WHITEBALANCEMODE
+KSPROPERTY_CAMERACONTROL_EXTENDED_EXPOSUREMODE
+KSPROPERTY_CAMERACONTROL_EXTENDED_SCENEMODE
+KSPROPERTY_CAMERACONTROL_EXTENDED_PHOTOTHUMBNAIL
+KSPROPERTY_CAMERACONTROL_EXTENDED_WARMSTART
+KSPROPERTY_CAMERACONTROL_EXTENDED_ROI_ISPCONTROL
+KSPROPERTY_CAMERACONTROL_EXTENDED_PROFILE
+The complete list can be found from the Camera DDI spec
+###############################################################################
+*/
+
+typedef struct _DMFTEventEntry{
+ ULONG m_ulEventId; // KSEVENT->Id
+ PVOID m_pEventData; // Lookup for events in the data structure
+ HANDLE m_hHandle; // The duplicate handle stored from the event
+ //
+ // Constructor. We simply cache the handles, the property id and the KSEVENTDATA buffer sent from the user mode
+ //
+ _DMFTEventEntry( _In_ ULONG ulEventId, _In_ PVOID pEventData, _In_ HANDLE pHandle):m_pEventData(pEventData)
+ , m_ulEventId(ulEventId)
+ , m_hHandle(pHandle)
+ {
+ }
+ ~_DMFTEventEntry()
+ {
+ if ( m_hHandle != nullptr )
+ {
+ CloseHandle(m_hHandle);
+ m_hHandle = nullptr;
+ }
+ }
+
+}DMFTEventEntry, *PDMFTEventEntry;
+
+//
+// Handler for one shot events and Normal events
+//
+class CDMFTEventHandler{
+public:
+ //
+ // Handle the events here
+ //
+ STDMETHOD(KSEvent)(_In_reads_bytes_(ulEventLength) PKSEVENT pEvent,
+ _In_ ULONG ulEventLength,
+ _Inout_updates_bytes_opt_(ulDataLength) LPVOID pEventData,
+ _In_ ULONG ulDataLength,
+ _Inout_ ULONG* pBytesReturned);
+ STDMETHOD(SetOneShot)(ULONG);
+ STDMETHOD(SetRegularEvent)(ULONG);
+ STDMETHOD(Clear)();
+protected:
+ STDMETHOD(Dupe)(_In_ HANDLE hEventHandle, _Outptr_ LPHANDLE lpTargetHandle);
+private:
+ map< ULONG, HANDLE > m_OneShotEventMap;
+ vector< PDMFTEventEntry > m_RegularEventList;
+};
+
+
+
diff --git a/avstream/sampledevicemft/multipinmftutils.cpp b/avstream/sampledevicemft/multipinmftutils.cpp
index d36baa13..6f5735b5 100644
--- a/avstream/sampledevicemft/multipinmftutils.cpp
+++ b/avstream/sampledevicemft/multipinmftutils.cpp
@@ -13,7 +13,7 @@
#pragma comment(lib, "d2d1")
#ifdef MF_WPP
-#include "multipinmftutils.tmh"
+#include "multipinmftutils.tmh" //--REF_ANALYZER_DONT_REMOVE--
#endif
// Critical sections
@@ -328,7 +328,10 @@ STDMETHODIMP_(BOOL) IsKnownUncompressedVideoType(_In_ GUID guidSubType)
guidSubType == MFVideoFormat_P016 ||
guidSubType == MFVideoFormat_v210 ||
guidSubType == MFVideoFormat_v216 ||
- guidSubType == MFVideoFormat_v410 )
+ guidSubType == MFVideoFormat_v410 ||
+ guidSubType == MFVideoFormat_L8 ||
+ guidSubType == MFVideoFormat_L16 ||
+ guidSubType == MFVideoFormat_D16)
{
return( TRUE );
}
diff --git a/avstream/sampledevicemft/stdafx.h b/avstream/sampledevicemft/stdafx.h
index 58cd95dc..9f4bab9f 100644
--- a/avstream/sampledevicemft/stdafx.h
+++ b/avstream/sampledevicemft/stdafx.h
@@ -8,6 +8,7 @@
#include <windows.h>
#include <winnt.h>
#include <tchar.h>
+#include <comdef.h>
#include <initguid.h>
#include <ks.h>
#include <ksmedia.h>
diff --git a/avstream/samplemft0/SampleMft0.sln b/avstream/samplemft0/SampleMft0.sln
index c8951b32..8084fbc7 100644
--- a/avstream/samplemft0/SampleMft0.sln
+++ b/avstream/samplemft0/SampleMft0.sln
@@ -1,28 +1,41 @@

Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0
-MinimumVisualStudioVersion = 12.0
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleMft0", "SampleMft0.vcxproj", "{6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}"
+# Visual Studio 11
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{D5FD28DE-8407-4B27-8785-9839775E254A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "Package\package.VcxProj", "{07664D04-E5E5-4249-8382-4D97E3E5557D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleMft0", "SampleMft0.vcxproj", "{DCF923F6-7164-4A0E-9486-B8A140234CCA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Debug|Win32.ActiveCfg = Debug|Win32
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Debug|Win32.Build.0 = Debug|Win32
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Release|Win32.ActiveCfg = Release|Win32
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Release|Win32.Build.0 = Release|Win32
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Debug|x64.ActiveCfg = Debug|x64
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Debug|x64.Build.0 = Debug|x64
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Release|x64.ActiveCfg = Release|x64
- {6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}.Release|x64.Build.0 = Release|x64
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Debug|Win32.Build.0 = Debug|Win32
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Debug|x64.ActiveCfg = Debug|x64
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Debug|x64.Build.0 = Debug|x64
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Release|Win32.ActiveCfg = Release|Win32
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Release|Win32.Build.0 = Release|Win32
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Release|x64.ActiveCfg = Release|x64
+ {07664D04-E5E5-4249-8382-4D97E3E5557D}.Release|x64.Build.0 = Release|x64
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Debug|Win32.ActiveCfg = Debug|Win32
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Debug|Win32.Build.0 = Debug|Win32
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Debug|x64.ActiveCfg = Debug|x64
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Debug|x64.Build.0 = Debug|x64
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Release|Win32.ActiveCfg = Release|Win32
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Release|Win32.Build.0 = Release|Win32
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Release|x64.ActiveCfg = Release|x64
+ {DCF923F6-7164-4A0E-9486-B8A140234CCA}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {07664D04-E5E5-4249-8382-4D97E3E5557D} = {D5FD28DE-8407-4B27-8785-9839775E254A}
+ EndGlobalSection
EndGlobal
diff --git a/avstream/samplemft0/SampleMft0.vcxproj b/avstream/samplemft0/SampleMft0.vcxproj
index 7d9d2267..90c623ba 100644
--- a/avstream/samplemft0/SampleMft0.vcxproj
+++ b/avstream/samplemft0/SampleMft0.vcxproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -18,45 +18,38 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
+ <PropertyGroup Label="PropertySheets">
+ <DriverType />
+ <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ </PropertyGroup>
<PropertyGroup Label="Globals">
- <ProjectGuid>{6AE575B1-1F8F-4CCD-B889-A18D1BC8A60D}</ProjectGuid>
- <RootNamespace>$(MSBuildProjectName)</RootNamespace>
- <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
+ <Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
- <SampleGuid>{92586FC2-7791-4E03-B6A4-4CD4324F57F2}</SampleGuid>
+ <DebuggerFlavor Condition="'$(PlatformToolset)' == 'WindowsKernelModeDriver8.0'">DbgengKernelDebugger</DebuggerFlavor>
+ <DebuggerFlavor Condition="'$(PlatformToolset)' == 'WindowsUserModeDriver8.0'">DbgengRemoteDebugger</DebuggerFlavor>
+ <SampleGuid>{0D23004B-9844-4510-ABA0-E60F720528B8}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetVersion>Windows10</TargetVersion>
- <UseDebugLibraries>False</UseDebugLibraries>
- <DriverTargetPlatform>Desktop</DriverTargetPlatform>
- <DriverType />
- <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
- <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{DCF923F6-7164-4A0E-9486-B8A140234CCA}</ProjectGuid>
+ <RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetVersion>Windows10</TargetVersion>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
- <DriverTargetPlatform>Desktop</DriverTargetPlatform>
- <DriverType />
- <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
- <ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetVersion>Windows10</TargetVersion>
+ <TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>False</UseDebugLibraries>
- <DriverTargetPlatform>Desktop</DriverTargetPlatform>
- <DriverType />
- <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
- <ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
- <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <TargetVersion>Windows10</TargetVersion>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetVersion>Win8</TargetVersion>
<UseDebugLibraries>True</UseDebugLibraries>
- <DriverTargetPlatform>Desktop</DriverTargetPlatform>
- <DriverType />
- <PlatformToolset>WindowsApplicationForDrivers10.0</PlatformToolset>
- <ConfigurationType>DynamicLibrary</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetVersion>Win8</TargetVersion>
+ <UseDebugLibraries>False</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
@@ -75,56 +68,19 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ItemGroup Label="WrappedTaskItems" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <TargetName>SampleMft0</TargetName>
- <UseOfAtl>Static</UseOfAtl>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <TargetName>SampleMft0</TargetName>
- <UseOfAtl>Static</UseOfAtl>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <TargetName>SampleMft0</TargetName>
- <UseOfAtl>Static</UseOfAtl>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PropertyGroup>
<TargetName>SampleMft0</TargetName>
- <UseOfAtl>Static</UseOfAtl>
</PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </ResourceCompile>
+ <ItemDefinitionGroup>
<ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
+ <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='false'">MultiThreaded</RuntimeLibrary>
+ <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </Midl>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ResourceCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </ResourceCompile>
- <ClCompile>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </ClCompile>
- <Midl>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
- </Midl>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PropertyGroup>
+ <UseOfAtl>Static</UseOfAtl>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
</ResourceCompile>
@@ -135,39 +91,9 @@
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SDK_INC_PATH);$(IntDir)</AdditionalIncludeDirectories>
</Midl>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;mf.lib;mfplat.lib;mfuuid.lib;ntdll.lib;ole32.lib;Oleaut32.lib;runtimeobject.lib;Shlwapi.lib;user32.lib;uuid.lib;version.lib;winmm.lib</AdditionalDependencies>
- <ModuleDefinitionFile>SampleMft0.def</ModuleDefinitionFile>
- </Link>
- <ClCompile>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;mf.lib;mfplat.lib;mfuuid.lib;ntdll.lib;ole32.lib;Oleaut32.lib;runtimeobject.lib;Shlwapi.lib;user32.lib;uuid.lib;version.lib;winmm.lib</AdditionalDependencies>
- <ModuleDefinitionFile>SampleMft0.def</ModuleDefinitionFile>
- </Link>
- <ClCompile>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Link>
- <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;mf.lib;mfplat.lib;mfuuid.lib;ntdll.lib;ole32.lib;Oleaut32.lib;runtimeobject.lib;Shlwapi.lib;user32.lib;uuid.lib;version.lib;winmm.lib</AdditionalDependencies>
- <ModuleDefinitionFile>SampleMft0.def</ModuleDefinitionFile>
- </Link>
- <ClCompile>
- <ExceptionHandling>
- </ExceptionHandling>
- </ClCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ItemDefinitionGroup>
<Link>
- <AdditionalDependencies>%(AdditionalDependencies);advapi32.lib;comctl32.lib;comdlg32.lib;gdi32.lib;kernel32.lib;mf.lib;mfplat.lib;mfuuid.lib;ntdll.lib;ole32.lib;Oleaut32.lib;runtimeobject.lib;Shlwapi.lib;user32.lib;uuid.lib;version.lib;winmm.lib</AdditionalDependencies>
+ <AdditionalDependencies>%(AdditionalDependencies);kernel32.lib;gdi32.lib;ntdll.lib;user32.lib;advapi32.lib;ole32.lib;uuid.lib;version.lib;winmm.lib;comdlg32.lib;Oleaut32.lib;Shlwapi.lib;comctl32.lib;mfuuid.lib;mf.lib;mfplat.lib;runtimeobject.lib</AdditionalDependencies>
<ModuleDefinitionFile>SampleMft0.def</ModuleDefinitionFile>
</Link>
<ClCompile>
@@ -206,7 +132,7 @@
</ItemGroup>
<ItemGroup>
<Inf Exclude="@(Inf)" Include="*.inf" />
- <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
+ <FilesToPackage Include="$(TargetPath)" />
</ItemGroup>
<ItemGroup>
<None Exclude="@(None)" Include="*.txt;*.htm;*.html" />
diff --git a/avstream/samplemft0/SampleMft0.vcxproj.Filters b/avstream/samplemft0/SampleMft0.vcxproj.Filters
index 8b59ec03..945f6fa5 100644
--- a/avstream/samplemft0/SampleMft0.vcxproj.Filters
+++ b/avstream/samplemft0/SampleMft0.vcxproj.Filters
@@ -2,20 +2,20 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
- <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
- <UniqueIdentifier>{C4EF77A5-A475-4447-8C75-D63EAD531425}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ <UniqueIdentifier>{0EBBD007-C6C8-40FA-9163-D9AE2629FA55}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- <UniqueIdentifier>{7668EFE9-B330-4217-95EC-4AAC7F64B20C}</UniqueIdentifier>
+ <UniqueIdentifier>{63FE7C31-9F1C-4BA9-9D75-64A0A33E2CE7}</UniqueIdentifier>
</Filter>
<Filter Include="Resource Files">
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
- <UniqueIdentifier>{42BF196B-979A-4457-99D6-E05389FF4B6C}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ <UniqueIdentifier>{18AC824E-5296-4263-BF1C-82692203056E}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="Debug\\SampleMft0_i.c">
+ <ClCompile Include="$(IntDir)\SampleMft0_i.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="dllmain.cpp">
@@ -30,16 +30,70 @@
<ClCompile Include="stdafxsrc.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <Midl Include="SampleMft0.idl">
- <Filter>Source Files</Filter>
- </Midl>
- <None Include="SampleMft0.def">
- <Filter>Source Files</Filter>
- </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ <ClInclude Include="dllmain.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Mft0.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="SampleHelpers.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="SampleMft0.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
+ <ItemGroup>
+ <Midl Include="SampleMft0.idl">
+ <Filter>Source Files</Filter>
+ </Midl>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="*.def;*.bat;*.hpj;*.asmx">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
</Project> \ No newline at end of file