Updated for "Windows 10 Anniversary Update" (Version 1607)

This commit is contained in:
karlf 2016-08-11 13:28:13 -07:00
Родитель 687b274aa3
Коммит 96eb96dfb6
1832 изменённых файлов: 92780 добавлений и 314321 удалений

Просмотреть файл

@ -20,10 +20,10 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\mft0\AvsCameraMft0.vcxproj">
<Project>{11E4CED5-8A3E-4BDF-9FEC-3C63BEF81478}</Project>
<Project>{2C0B129E-88F3-479A-AE5D-65609A88BE66}</Project>
</ProjectReference>
<ProjectReference Include="..\sys\AvsCamera.vcxproj">
<Project>{BB6E820D-6149-4486-AD06-96E8F33DCE8A}</Project>
<Project>{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="PropertySheets">
@ -35,8 +35,8 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{E1203C9D-047C-4357-9747-0476C871A53B}</ProjectGuid>
<SampleGuid>{C7A901F1-4095-4C27-A0AA-87BE488930F7}</SampleGuid>
<ProjectGuid>{9397D285-8C29-4661-A741-F6703E2F5FD6}</ProjectGuid>
<SampleGuid>{B28A4CED-96FB-4426-8E77-15A9C0BCFDD5}</SampleGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

Просмотреть файл

@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
<UniqueIdentifier>{532008E1-2000-458F-880C-BB33071663FA}</UniqueIdentifier>
<UniqueIdentifier>{F1A06F53-B8EA-4605-9176-11EC0176E816}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
<UniqueIdentifier>{6C9436B8-8F80-4015-B139-6A072D19C24C}</UniqueIdentifier>
<UniqueIdentifier>{F24A15E4-0A77-4A7C-9140-398C8C947588}</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>{21B1ED41-2D14-4605-B7CC-F42B6037C5EC}</UniqueIdentifier>
<UniqueIdentifier>{2C36364F-95CF-43D3-AE5B-AFEEE8D123EF}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
<UniqueIdentifier>{A5CFB552-03B4-4E4F-BE46-A88DEEC7B2C2}</UniqueIdentifier>
<UniqueIdentifier>{C72B8B2A-0C65-4C86-A70C-475757BF3912}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

Просмотреть файл

Просмотреть файл

@ -0,0 +1,59 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0
MinimumVisualStudioVersion = 12.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{174AB66C-6250-4DDB-88C5-856B9D499DB7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mft0", "Mft0", "{8031E506-AE20-4995-9F28-2D177A1FB319}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sys", "Sys", "{72571B45-7827-4380-8821-38A33FBFF4E2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "package", "Package\package.VcxProj", "{9397D285-8C29-4661-A741-F6703E2F5FD6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvsCameraMft0", "mft0\AvsCameraMft0.vcxproj", "{2C0B129E-88F3-479A-AE5D-65609A88BE66}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AvsCamera", "sys\AvsCamera.vcxproj", "{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Debug|Win32.ActiveCfg = Debug|Win32
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Debug|Win32.Build.0 = Debug|Win32
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Release|Win32.ActiveCfg = Release|Win32
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Release|Win32.Build.0 = Release|Win32
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Debug|x64.ActiveCfg = Debug|x64
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Debug|x64.Build.0 = Debug|x64
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Release|x64.ActiveCfg = Release|x64
{9397D285-8C29-4661-A741-F6703E2F5FD6}.Release|x64.Build.0 = Release|x64
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Debug|Win32.ActiveCfg = Debug|Win32
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Debug|Win32.Build.0 = Debug|Win32
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Release|Win32.ActiveCfg = Release|Win32
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Release|Win32.Build.0 = Release|Win32
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Debug|x64.ActiveCfg = Debug|x64
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Debug|x64.Build.0 = Debug|x64
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Release|x64.ActiveCfg = Release|x64
{2C0B129E-88F3-479A-AE5D-65609A88BE66}.Release|x64.Build.0 = Release|x64
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Debug|Win32.ActiveCfg = Debug|Win32
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Debug|Win32.Build.0 = Debug|Win32
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Release|Win32.ActiveCfg = Release|Win32
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Release|Win32.Build.0 = Release|Win32
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Debug|x64.ActiveCfg = Debug|x64
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Debug|x64.Build.0 = Debug|x64
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Release|x64.ActiveCfg = Release|x64
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9397D285-8C29-4661-A741-F6703E2F5FD6} = {174AB66C-6250-4DDB-88C5-856B9D499DB7}
{2C0B129E-88F3-479A-AE5D-65609A88BE66} = {8031E506-AE20-4995-9F28-2D177A1FB319}
{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68} = {72571B45-7827-4380-8821-38A33FBFF4E2}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -46,3 +46,14 @@ enum
KSPROPERTY_CUSTOMCONTROL_DUMMY
};
// {570615F9-D924-42AC-B967-BE7B0E489965}
#define STATIC_PROPSETID_SENSOR_CUSTOMCONTROL \
0x570615f9, 0xd924, 0x42ac, 0xb9, 0x67, 0xbe, 0x7b, 0xe, 0x48, 0x99, 0x65
DEFINE_GUIDSTRUCT("570615F9-D924-42AC-B967-BE7B0E489965", PROPSETID_SENSOR_CUSTOMCONTROL);
#define PROPSETID_SENSOR_CUSTOMCONTROL DEFINE_GUIDNAMED(PROPSETID_SENSOR_CUSTOMCONTROL )
enum
{
KSPROPERTY_SENSOR_PIN_CUSTOM_CONTROL_ULONG=0
};

Просмотреть файл

Просмотреть файл

@ -19,13 +19,13 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{11E4CED5-8A3E-4BDF-9FEC-3C63BEF81478}</ProjectGuid>
<ProjectGuid>{2C0B129E-88F3-479A-AE5D-65609A88BE66}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<RequiresPackageProject>true</RequiresPackageProject>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<SampleGuid>{C6FB0F20-5242-4187-95E4-B6BD741DA56C}</SampleGuid>
<SampleGuid>{1921F93C-296D-4875-BD67-D087F1DBF95B}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

Просмотреть файл

@ -3,15 +3,15 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
<UniqueIdentifier>{60DA7BE1-F98A-4082-8012-10277DA284FC}</UniqueIdentifier>
<UniqueIdentifier>{5293FBF9-AB37-479B-86A2-4DE6B858B90A}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
<UniqueIdentifier>{0A04E637-D033-4503-9ED5-F0FE9523FC0F}</UniqueIdentifier>
<UniqueIdentifier>{BB11CFC9-BD19-4353-9E5F-42D5BA1A0CB3}</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>{9131C40A-BF05-41D0-8089-D1207A87E3BA}</UniqueIdentifier>
<UniqueIdentifier>{49D3ED6A-39BD-49AC-96B4-4C1645E71934}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,21 @@
PUBLIC_PASS0_CONSUMES= \
avcore\published\idl|PASS0 \
avcore\published\media|PASS0 \
avcore\published\mf\publish|PASS0 \
base\appmodel\search\search\search\structuredquery\interfaces\publish|PASS0 \
base\published2|PASS0 \
com\published\idlole\publish|PASS0 \
enduser\sql\xml\msxml3\publish|PASS0 \
inetcore\published\sdk\inc|PASS0 \
minkernel\published\base|PASS0 \
onecore\avcore\published\media|PASS0 \
onecore\base\published2|PASS0 \
onecore\com\published\idlole\publish|PASS0 \
onecore\enduser\sql\xml\msxml3\publish|PASS0 \
onecore\inetcore\published\sdk\inc|PASS0 \
onecore\shell\propsys\inc0|PASS0 \
onecore\shell\published\inc\inc0|PASS0 \
onecoreuap\base\appmodel\search\search\search\structuredquery\interfaces\publish|PASS0 \
shell\propsys\inc0|PASS0 \
shell\published\inc\inc0|PASS0 \

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -19,13 +19,13 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BB6E820D-6149-4486-AD06-96E8F33DCE8A}</ProjectGuid>
<ProjectGuid>{24D35D6E-BDB0-4949-8A34-7DD25F0E8F68}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<SupportsPackaging>false</SupportsPackaging>
<RequiresPackageProject>true</RequiresPackageProject>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<SampleGuid>{032DA1CE-AC79-4BEF-ADDE-9A060C7D5E47}</SampleGuid>
<SampleGuid>{7F43971C-9E5A-46A0-B925-AFE3282E014C}</SampleGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -208,6 +208,7 @@
<ClCompile Include="capture.cpp" />
<ClCompile Include="device.cpp" />
<ClCompile Include="filter.cpp" />
<ClCompile Include="formats.cpp" />
<ClCompile Include="hwsim.cpp" />
<ClCompile Include="imagecapture.cpp" />
<ClCompile Include="ImagehwSim.cpp" />

Просмотреть файл

@ -3,19 +3,19 @@
<ItemGroup>
<Filter Include="Source Files">
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
<UniqueIdentifier>{435FFB2D-4374-4BBF-97B6-52E43DA1C157}</UniqueIdentifier>
<UniqueIdentifier>{1E6E0D75-6064-4AA6-9EED-9795A14A9565}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
<UniqueIdentifier>{F0B00B7F-1E80-4427-93E0-FA621775CBBF}</UniqueIdentifier>
<UniqueIdentifier>{673D2600-D125-46B1-886A-679ED918CAE3}</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>{BD39318B-B023-47F9-A201-FAB94C9DBE26}</UniqueIdentifier>
<UniqueIdentifier>{4E7C2C4D-E0C2-4719-8255-3A104085149B}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
<UniqueIdentifier>{59B47F1B-A111-4923-BF9B-C8AF5D2F41CF}</UniqueIdentifier>
<UniqueIdentifier>{39B99289-64B8-4EB7-808C-3AFE1DEF2048}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -76,8 +76,8 @@ Initialize()
static
CSensorContext Context[] =
{
{ L"RFC", &AvsCameraFilterDescriptor, AcpiPldPanelBack },
{ L"FFC", &AvsCameraFilterDescriptorFFC, AcpiPldPanelFront }
{ L"RFC", &AvsCameraFilterDescriptor, AcpiPldPanelBack, AcpiPldRotation0 },
{ L"FFC", &AvsCameraFilterDescriptorFFC, AcpiPldPanelFront, AcpiPldRotation90 }
};
m_FilterDescriptorCount = SIZEOF_ARRAY(Context);

Просмотреть файл

@ -316,7 +316,8 @@ DEFINE_KSPROPERTY_TABLE(PFSPropertyTable)
DEFINE_KSPROPERTY_TABLE(FilterVidcapPropertyTable)
{
DEFINE_PROP_ITEM( CCaptureFilter, KSPROPERTY_VIDEOCONTROL_MODE, KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode )
DEFINE_PROP_ITEM( CCaptureFilter, KSPROPERTY_VIDEOCONTROL_MODE, KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode ),
DEFINE_PROP_ITEM_NO_SET( CCaptureFilter, KSPROPERTY_VIDEOCONTROL_CAPS, KSPROPERTY_VIDEOCONTROL_CAPS_S, VideoControlCaps )
};
DEFINE_KSPROPERTY_TABLE( VideoProcampPropertyTable )

Просмотреть файл

Просмотреть файл

@ -1170,6 +1170,12 @@ Return Value:
//
CCapturePin *CapPin = reinterpret_cast <CCapturePin *> (Pin->Context);
// For debugging...
UNICODE_STRING NewFormat;
UNICODE_STRING RefFormat;
RtlStringFromGUID( Pin->ConnectionFormat->SubFormat, &NewFormat );
RtlStringFromGUID( DataRange->SubFormat, &RefFormat );
if( IsEqualGUID( Pin->ConnectionFormat->Specifier, ImageInfoSpecifier ) &&
Pin->ConnectionFormat->FormatSize >= sizeof (KS_DATAFORMAT_IMAGEINFO) )
{
@ -1199,7 +1205,7 @@ Return Value:
//
else if( (ConnectionFormat->ImageInfoHeader.biWidth != VIRange->ImageInfoHeader.biWidth) ||
(ConnectionFormat->ImageInfoHeader.biHeight != VIRange->ImageInfoHeader.biHeight) ||
(ConnectionFormat->ImageInfoHeader.biCompression != VIRange->ImageInfoHeader.biCompression) )
!IsEqualGUID( Pin->ConnectionFormat->SubFormat, DataRange->SubFormat ) )
{
Status = STATUS_NO_MATCH;
}
@ -1295,12 +1301,9 @@ Return Value:
KS_DATAFORMAT_VIDEOINFOHEADER, VideoInfoHeader
) + VideoHeaderSize;
if(
VideoHeaderSize < ConnectionFormat->
VideoInfoHeader.bmiHeader.biSize ||
if( VideoHeaderSize < ConnectionFormat->VideoInfoHeader.bmiHeader.biSize ||
DataFormatSize < VideoHeaderSize ||
DataFormatSize > ConnectionFormat->DataFormat.FormatSize
)
DataFormatSize > ConnectionFormat->DataFormat.FormatSize )
{
Status = STATUS_INVALID_PARAMETER;
}
@ -1310,19 +1313,27 @@ Return Value:
//
else if(
(ConnectionFormat->VideoInfoHeader.bmiHeader.biWidth !=
VIRange->VideoInfoHeader.bmiHeader.biWidth) ||
VIRange->VideoInfoHeader.bmiHeader.biWidth) ||
(ConnectionFormat->VideoInfoHeader.bmiHeader.biHeight !=
VIRange->VideoInfoHeader.bmiHeader.biHeight) ||
(ConnectionFormat->VideoInfoHeader.bmiHeader.biCompression !=
VIRange->VideoInfoHeader.bmiHeader.biCompression)
)
VIRange->VideoInfoHeader.bmiHeader.biHeight) ||
!IsEqualGUID( Pin->ConnectionFormat->SubFormat, DataRange->SubFormat ) )
{
DBG_TRACE("FAILED: Height=(%d,%d), Width=(%d,%d), SubFormat=(%wZ,%wZ)",
ConnectionFormat->VideoInfoHeader.bmiHeader.biWidth,
VIRange->VideoInfoHeader.bmiHeader.biWidth,
ConnectionFormat->VideoInfoHeader.bmiHeader.biHeight,
VIRange->VideoInfoHeader.bmiHeader.biHeight,
&NewFormat, &RefFormat );
Status = STATUS_NO_MATCH;
}
else
{
DBG_TRACE("MATCH: Height=(%d,%d), Width=(%d,%d), SubFormat=(%wZ,%wZ)",
ConnectionFormat->VideoInfoHeader.bmiHeader.biWidth,
VIRange->VideoInfoHeader.bmiHeader.biWidth,
ConnectionFormat->VideoInfoHeader.bmiHeader.biHeight,
VIRange->VideoInfoHeader.bmiHeader.biHeight,
&NewFormat, &RefFormat );
//
// Compute the minimum size of our buffers to validate against.
@ -1415,6 +1426,9 @@ Return Value:
}
}
RtlFreeUnicodeString(&NewFormat);
RtlFreeUnicodeString(&RefFormat);
DBG_LEAVE( "(Pin->Id=%d)=0x%08X", Pin->Id, Status );
return Status;
}
@ -1627,12 +1641,9 @@ Return Value:
// operations to compute the alleged size. (On unsigned
// math, a+b < a iff an arithmetic overflow occurred).
//
if(
VideoHeaderSize < callerDataRange->
VideoInfoHeader.bmiHeader.biSize ||
if( VideoHeaderSize < callerDataRange->VideoInfoHeader.bmiHeader.biSize ||
DataRangeSize < VideoHeaderSize ||
DataRangeSize > callerDataRange->DataRange.FormatSize
)
DataRangeSize > callerDataRange->DataRange.FormatSize )
{
return STATUS_INVALID_PARAMETER;
}
@ -2056,16 +2067,16 @@ UpdateAllocatorFraming()
);
Framing->FramingItem[0].Frames = m_DesiredFrames;
Framing->FramingItem[0].PhysicalRange.MinFrameSize = m_VideoInfoHeader->bmiHeader.biSize;
Framing->FramingItem[0].PhysicalRange.MaxFrameSize = m_VideoInfoHeader->bmiHeader.biSize;
Framing->FramingItem [0].FramingRange.Range.MinFrameSize = m_VideoInfoHeader->bmiHeader.biSize;
Framing->FramingItem [0].FramingRange.Range.MaxFrameSize = m_VideoInfoHeader->bmiHeader.biSize;
Framing->FramingItem[0].PhysicalRange.MinFrameSize = m_VideoInfoHeader->bmiHeader.biSizeImage;
Framing->FramingItem[0].PhysicalRange.MaxFrameSize = m_VideoInfoHeader->bmiHeader.biSizeImage;
Framing->FramingItem [0].FramingRange.Range.MinFrameSize = m_VideoInfoHeader->bmiHeader.biSizeImage;
Framing->FramingItem [0].FramingRange.Range.MaxFrameSize = m_VideoInfoHeader->bmiHeader.biSizeImage;
Framing->FramingItem [0].PhysicalRange.Stepping = 0;
Framing->FramingItem [0].FramingRange.Range.Stepping = 0;
DBG_TRACE( "Advertising Frame requirement: %d", m_DesiredFrames );
DBG_TRACE("Image size estimate of: %d bytes", m_VideoInfoHeader->bmiHeader.biSize );
DBG_TRACE("Image size estimate of: %d bytes", m_VideoInfoHeader->bmiHeader.biSizeImage );
}
}

Просмотреть файл

@ -189,12 +189,6 @@ protected:
NTSTATUS
Initialize();
void
SetDesiredFrames( ULONG n )
{
m_DesiredFrames = n;
}
public:
//
// CCapturePin():
@ -226,6 +220,12 @@ public:
_In_ PKSSTREAM_POINTER Clone=nullptr
);
void
SetDesiredFrames( ULONG n )
{
m_DesiredFrames = n;
}
// Update the Pin's Allocator Framing
virtual
NTSTATUS

Просмотреть файл

@ -220,7 +220,30 @@ inline void __cdecl operator delete[]
#define FOURCC_YUY2 mmioFOURCC('Y', 'U', 'Y', '2')
#define FOURCC_NV12 mmioFOURCC('N', 'V', '1', '2')
//Number of filters: FFC, RFC
// RGB24
#define STATIC_KSDATAFORMAT_SUBTYPE_RGB24\
0xe436eb7d, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70
DEFINE_GUIDSTRUCT("e436eb7d-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_RGB24);
#define KSDATAFORMAT_SUBTYPE_RGB24 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RGB24)
// RGB32
#define STATIC_KSDATAFORMAT_SUBTYPE_RGB32\
0xe436eb7e, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70
DEFINE_GUIDSTRUCT("e436eb7e-524f-11ce-9f53-0020af0ba770", KSDATAFORMAT_SUBTYPE_RGB32);
#define KSDATAFORMAT_SUBTYPE_RGB32 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_RGB32)
// NV12
#define STATIC_KSDATAFORMAT_SUBTYPE_NV12\
0x3231564E, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
DEFINE_GUIDSTRUCT("3231564E-0000-0010-8000-00AA00389B71", KSDATAFORMAT_SUBTYPE_NV12);
#define KSDATAFORMAT_SUBTYPE_NV12 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_NV12)
// YUY2
#define STATIC_KSDATAFORMAT_SUBTYPE_YUY2\
0x32595559, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71
DEFINE_GUIDSTRUCT("32595559-0000-0010-8000-00AA00389B71", KSDATAFORMAT_SUBTYPE_YUY2);
#define KSDATAFORMAT_SUBTYPE_YUY2 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_YUY2)
#define CAPTURE_FILTER_COUNT 2
//filter index
@ -239,20 +262,6 @@ inline void __cdecl operator delete[]
#define VIDEO_CAPTURE_PIN_DATA_RANGE_COUNT 30
#define VIDEO_PREVIEW_PIN_DATA_RANGE_COUNT 15
//
// CAPTURE_FILTER_PIN_COUNT:
//
// The number of pins on the capture filter.
//
#define CAPTURE_FILTER_VIDEO_PIN_COUNT 2
#define CAPTURE_FILTER_IMAGE_PIN_COUNT 1
#define CAPTURE_FILTER_PIN_COUNT (CAPTURE_FILTER_VIDEO_PIN_COUNT+CAPTURE_FILTER_IMAGE_PIN_COUNT)
#define CAPTURE_FILTER_VIDEO_PIN 0
#define CAPTURE_FILTER_PREVIEW_PIN 1
#define CAPTURE_FILTER_STILL_PIN 2
//
// Define the number of frames needed in the queue for each pin.
//
@ -310,6 +319,7 @@ inline void __cdecl operator delete[]
#define POWERLINEFREQ_DISABLED 0
#define POWERLINEFREQ_50HZ 1
#define POWERLINEFREQ_60HZ 2
#define POWERLINEFREQ_AUTO 3
#define POWERLINEFREQ_DEFAULT POWERLINEFREQ_DISABLED
@ -360,16 +370,6 @@ const
KSFILTER_DESCRIPTOR
AvsCameraFilterDescriptorFFC;
extern
const
KSPIN_DESCRIPTOR_EX
AvsCameraFilterPinDescriptors [CAPTURE_FILTER_PIN_COUNT];
extern
const
KSPIN_DESCRIPTOR_EX
AvsCameraFilterPinDescriptorsFFC [CAPTURE_FILTER_PIN_COUNT];
extern
const
GUID
@ -398,21 +398,6 @@ const
KSPIN_DISPATCH
ImageCapturePinDispatch;
extern
const
PKSDATARANGE
VideoCapturePinDataRanges [VIDEO_CAPTURE_PIN_DATA_RANGE_COUNT];
extern
const
PKSDATARANGE
VideoPreviewPinDataRanges[VIDEO_PREVIEW_PIN_DATA_RANGE_COUNT];
extern
const
PKSDATARANGE
ImageCapturePinDataRanges[IMAGE_CAPTURE_PIN_DATA_RANGE_COUNT];
/*************************************************
Enums / Typedefs
@ -436,6 +421,19 @@ typedef enum _PIN_MODE
} PIN_MODE, *PPIN_MODE;
//Panel surface bits 115:118
enum AcpiPldRotation
{
AcpiPldRotation0 = 0,
AcpiPldRotation45 = 1,
AcpiPldRotation90 = 2,
AcpiPldRotation135 = 3,
AcpiPldRotation180 = 4,
AcpiPldRotation225 = 5,
AcpiPldRotation270 = 6,
AcpiPldRotation315 = 7,
};
/*************************************************
@ -700,5 +698,6 @@ private:
#include "capture.h"
#include "videocapture.h"
#include "imagecapture.h"
#include "formats.h"
#include <uuids.h>
#include <devpkey.h>

Просмотреть файл

Просмотреть файл

@ -99,21 +99,21 @@ static KSCAMERA_PROFILE_MEDIAINFO s_Profile2_RecordMediaInfo[] =
static KSCAMERA_PROFILE_PININFO s_Profile0_PinInfo[] =
{
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0, ARRAYSIZE(s_Profile0_PreviewMediaInfo), s_Profile0_PreviewMediaInfo },
{ {STATIC_PINNAME_VIDEO_CAPTURE}, 0, ARRAYSIZE(s_Profile0_RecordMediaInfo), s_Profile0_RecordMediaInfo },
{ {STATIC_PINNAME_IMAGE}, 0, ARRAYSIZE(s_Profile0_PhotoMediaInfo), s_Profile0_PhotoMediaInfo }
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0,0, ARRAYSIZE(s_Profile0_PreviewMediaInfo), s_Profile0_PreviewMediaInfo },
{ {STATIC_PINNAME_VIDEO_CAPTURE}, 0,0, ARRAYSIZE(s_Profile0_RecordMediaInfo), s_Profile0_RecordMediaInfo },
{ {STATIC_PINNAME_IMAGE}, 0,0, ARRAYSIZE(s_Profile0_PhotoMediaInfo), s_Profile0_PhotoMediaInfo }
};
static KSCAMERA_PROFILE_PININFO s_Profile1_PinInfo[] =
{
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0, ARRAYSIZE(s_Profile1_PreviewMediaInfo), s_Profile1_PreviewMediaInfo },
{ {STATIC_PINNAME_IMAGE}, 0, ARRAYSIZE(s_Profile1_PhotoMediaInfo), s_Profile1_PhotoMediaInfo }
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0,0, ARRAYSIZE(s_Profile1_PreviewMediaInfo), s_Profile1_PreviewMediaInfo },
{ {STATIC_PINNAME_IMAGE}, 0,0, ARRAYSIZE(s_Profile1_PhotoMediaInfo), s_Profile1_PhotoMediaInfo }
};
static KSCAMERA_PROFILE_PININFO s_Profile2_PinInfo[] =
{
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0, ARRAYSIZE(s_Profile2_PreviewMediaInfo), s_Profile2_PreviewMediaInfo },
{ {STATIC_PINNAME_VIDEO_CAPTURE}, 0, ARRAYSIZE(s_Profile2_RecordMediaInfo), s_Profile2_RecordMediaInfo }
{ {STATIC_PINNAME_VIDEO_PREVIEW}, 0,0, ARRAYSIZE(s_Profile2_PreviewMediaInfo), s_Profile2_PreviewMediaInfo },
{ {STATIC_PINNAME_VIDEO_CAPTURE}, 0,0, ARRAYSIZE(s_Profile2_RecordMediaInfo), s_Profile2_RecordMediaInfo }
};
static KSCAMERA_PROFILE_INFO s_Profiles[] =
@ -673,9 +673,11 @@ Return Value:
PKSDEVICE_PROFILE_INFO pDeviceProfiles = nullptr;
UINT32 uiProfileCount = 0;
PUNICODE_STRING SymbolicLinkName = KsFilterFactoryGetSymbolicLink(FilterFactory);
ACPI_PLD_BUFFER pld = {0};
BOOL fFrontCamera = FALSE;
ACPI_PLD_V2_BUFFER pld = {0};
pld.Revision = 2;
pld.Panel = m_Context[i].AcpiPosition;
pld.Rotation = m_Context[i].AcpiRotation;
static
const
GUID FFC_Filter = {STATIC_FrontCamera_Filter};
@ -730,6 +732,8 @@ Return Value:
}
IFFAILED_EXIT(m_Sensor[i]->Initialize());
m_Sensor[i]->SetMountingOrientation( m_Context[i].AcpiRotation );
}
}

Просмотреть файл

@ -31,6 +31,7 @@ struct CSensorContext
PWSTR Name; // What to call this class of filter.
const KSFILTER_DESCRIPTOR *Descriptor; // The description of the filter.
AcpiPldPanel AcpiPosition; // Where the device is located.
AcpiPldRotation AcpiRotation; // How the device is oriented with respect to the panel.
};
class CCaptureDevice

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -47,13 +47,14 @@ CSensor::CSensor(
, m_VideoInfoHeader(nullptr)
, m_InterruptTime(nullptr)
, m_LastMappingsCompleted(nullptr)
, m_PreviewIndex(INVALID_PIN_INDEX)
, m_StillIndex(INVALID_PIN_INDEX)
, m_VideoIndex(INVALID_PIN_INDEX)
, m_PreviewMask(INVALID_PIN_MASK)
, m_StillMask(INVALID_PIN_MASK)
, m_VideoMask(INVALID_PIN_MASK)
, m_FilterInstanceCount(0)
, m_pIspSettings(nullptr)
, m_PfsFrameLimit(0)
, m_PfsLoopLimit(0)
, m_MountingOrientation(AcpiPldRotation0)
{
PAGED_CODE();
NT_ASSERT(Device);
@ -215,7 +216,7 @@ Return Value:
{
PAGED_CODE();
if( PinIndex<((LONG)m_PinCount) && PinIndex>=0 )
if( IsValidIndex((ULONG)PinIndex) )
{
DBG_ENTER("(PinIndex=%d): m_LastMappingsCompleted[%d]=%d", PinIndex,
PinIndex, m_LastMappingsCompleted[PinIndex]);
@ -230,7 +231,7 @@ Return Value:
// be done in the ISR.
//
ULONG LastMappingCompleted = m_LastMappingsCompleted[PinIndex];
if( PinIndex != (LONG) m_StillIndex )
if( !IsStillIndex(PinIndex) )
{
while( LastMappingCompleted <
m_HardwareSimulation[PinIndex]->ReadNumberOfMappingsCompleted() )
@ -254,14 +255,20 @@ Return Value:
// Emit a photo confirmation image (we don't send off a copy of this image),
// but only if we need one for this photo and if the timestamp is valid.
if( pImageHw->m_PhotoConfirmationInfo.isRequired() &&
(pClone->StreamHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_TIMEVALID) &&
m_PreviewIndex < m_PinCount )
(pClone->StreamHeader->OptionsFlags & KSSTREAM_HEADER_OPTIONSF_TIMEVALID) )
{
m_HardwareSimulation[m_PreviewIndex]->
GeneratePhotoConfirmation(
pImageHw->m_PhotoConfirmationInfo.getIndex(),
pImageHw->m_PhotoConfirmationInfo.getTime()
);
// Generate a photo confirmation on any running preview pins.
for( ULONG Index=0; IsValidIndex(Index); Index++ )
{
if( IsPreviewIndex(Index) )
{
m_HardwareSimulation[Index]->
GeneratePhotoConfirmation(
pImageHw->m_PhotoConfirmationInfo.getIndex(),
pImageHw->m_PhotoConfirmationInfo.getTime()
);
}
}
}
//
@ -283,6 +290,77 @@ Return Value:
}
}
NTSTATUS
CSensor::
CreateSynthesizer(
_In_ PKSPIN Pin,
_In_ PKS_VIDEOINFOHEADER VideoInfoHeader
)
//
// Create the necessary type of image synthesizer.
//
{
NTSTATUS Status = STATUS_SUCCESS;
LONG Width = VideoInfoHeader->bmiHeader.biWidth;
LONG Height = VideoInfoHeader->bmiHeader.biHeight;
if( VideoInfoHeader->bmiHeader.biBitCount == 24 &&
VideoInfoHeader->bmiHeader.biCompression == KS_BI_RGB )
{
//
// If we're RGB24, create a new RGB24 synth. RGB24 surfaces
// can be in either orientation. The origin is lower left if
// height < 0. Otherwise, it's upper left.
//
m_Synthesizer[ Pin->Id ] = new (NonPagedPoolNx, 'RysI')
CRGB24Synthesizer( Width, Height );
DBG_TRACE( "Creating CRGB24Synthesizer..." );
}
else if( VideoInfoHeader->bmiHeader.biBitCount == 32 &&
VideoInfoHeader->bmiHeader.biCompression == KS_BI_RGB )
{
//
// If we're RGB32, create a new RGB32 synth. RGB32 surfaces
// can be in either orientation. The origin is lower left if
// height < 0. Otherwise, it's upper left.
//
m_Synthesizer[ Pin->Id ] = new (NonPagedPoolNx, '23RI')
CXRGBSynthesizer( Width, Height );
DBG_TRACE( "Creating CXRGBSynthesizer..." );
}
else if( VideoInfoHeader->bmiHeader.biBitCount == 16 &&
(VideoInfoHeader->bmiHeader.biCompression == FOURCC_YUY2) )
{
//
// If we're YUY2, create the YUY2 synth.
//
m_Synthesizer[ Pin->Id ] = new(NonPagedPoolNx, 'YysI') CYUY2Synthesizer( Width, Height );
DBG_TRACE( "Creating CYUY2Synthesizer..." );
}
else if( VideoInfoHeader->bmiHeader.biBitCount == 12 &&
(VideoInfoHeader->bmiHeader.biCompression == FOURCC_NV12) )
{
m_Synthesizer[ Pin->Id ] = new(NonPagedPoolNx, 'Nv12') CNV12Synthesizer( Width, Height );
DBG_TRACE( "Creating CNV12Synthesizer..." );
}
else
{
Status = STATUS_INVALID_PARAMETER;
}
if( NT_SUCCESS( Status ) )
{
DBG_TRACE( "Setting Mounting Orientation to %d°", DbgRotation2Degrees(m_MountingOrientation) )
m_Synthesizer[ Pin->Id ]->SetRotation( m_MountingOrientation );
}
return Status;
}
NTSTATUS
CSensor::
AcquireHardwareResources(
@ -343,9 +421,6 @@ Return Value:
{
m_VideoInfoHeader[lPindex] = VideoInfoHeader;
LONG Width = VideoInfoHeader->bmiHeader.biWidth;
LONG Height= VideoInfoHeader->bmiHeader.biHeight;
//
// If there's an old hardware simulation sitting around for some
// reason, blow it away.
@ -359,55 +434,8 @@ Return Value:
DBG_TRACE( "biCompression='%04s'", (PSTR) &VideoInfoHeader->bmiHeader.biCompression );
DBG_TRACE( "AvgTimePerFrame=%lld", VideoInfoHeader->AvgTimePerFrame );
//
// Create the necessary type of image synthesizer.
//
if (VideoInfoHeader->bmiHeader.biBitCount == 24 &&
VideoInfoHeader->bmiHeader.biCompression == KS_BI_RGB)
{
//
// If we're RGB24, create a new RGB24 synth. RGB24 surfaces
// can be in either orientation. The origin is lower left if
// height < 0. Otherwise, it's upper left.
//
m_Synthesizer[lPindex] = new (NonPagedPoolNx, 'RysI')
CRGB24Synthesizer ( Width, Height );
DBG_TRACE( "Creating CRGB24Synthesizer..." );
}
else if (VideoInfoHeader->bmiHeader.biBitCount == 32 &&
VideoInfoHeader->bmiHeader.biCompression == KS_BI_RGB)
{
//
// If we're RGB32, create a new RGB32 synth. RGB32 surfaces
// can be in either orientation. The origin is lower left if
// height < 0. Otherwise, it's upper left.
//
m_Synthesizer[lPindex] = new (NonPagedPoolNx, '23RI')
CXRGBSynthesizer ( Width, Height );
DBG_TRACE( "Creating CXRGBSynthesizer..." );
}
else if (VideoInfoHeader->bmiHeader.biBitCount == 16 &&
(VideoInfoHeader->bmiHeader.biCompression == FOURCC_YUY2))
{
//
// If we're YUY2, create the YUY2 synth.
//
m_Synthesizer[lPindex] = new(NonPagedPoolNx, 'YysI') CYUY2Synthesizer(Width, Height);
DBG_TRACE( "Creating CYUY2Synthesizer..." );
}
else if (VideoInfoHeader->bmiHeader.biBitCount == 12 &&
(VideoInfoHeader->bmiHeader.biCompression == FOURCC_NV12))
{
m_Synthesizer[lPindex] = new(NonPagedPoolNx, 'Nv12') CNV12Synthesizer(Width, Height);
DBG_TRACE( "Creating CNV12Synthesizer..." );
}
else
{
Status = STATUS_INVALID_PARAMETER;
}
Status = CreateSynthesizer( Pin,
VideoInfoHeader );
if (NT_SUCCESS(Status) && !m_Synthesizer[lPindex])
{
@ -490,7 +518,7 @@ Return Value:
// simulation is constructed first and these values aren't used until
// we call start.
if(lPindex != (LONG) m_StillIndex)
if( !IsStillIndex(lPindex) )
{
return
m_HardwareSimulation[lPindex] -> Start (
@ -533,6 +561,7 @@ Return Value:
DBG_TRACE( "MaxFrameRate = %lld/%lld", PerformanceTime.QuadPart, Frequency );
SetPhotoFrameRate(
lPindex,
KSCONVERT_PERFORMANCE_TIME( Frequency, PerformanceTime )
);
}
@ -645,7 +674,7 @@ Return Value:
NTSTATUS Status = pHwSim->Stop();
if( lPindex == (LONG) m_StillIndex )
if( IsStillIndex(lPindex) )
{
// Clear out any previous Per Frame Settings, if they still exist.
((CImageHardwareSimulation *)pHwSim)->SetPFS(nullptr, 0, 0) ;
@ -662,17 +691,26 @@ Reset(
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
if( !IsValidIndex( Pin->Id ) )
{
return STATUS_INVALID_PARAMETER;
}
if( !IsStillIndex(Pin->Id) )
{
return STATUS_SUCCESS;
}
if( !m_HardwareSimulation[Pin->Id] )
{
return STATUS_INVALID_DEVICE_STATE;
}
if( Pin->Id == m_StillIndex )
{
return Reset();
}
return STATUS_SUCCESS;
CHardwareSimulation *pHwSim = m_HardwareSimulation[Pin->Id];
NTSTATUS Status = pHwSim->Reset();
m_LastMappingsCompleted[Pin->Id] = pHwSim->ReadNumberOfMappingsCompleted();
return Status;
}
//Resets both filter's first PIN
@ -683,22 +721,28 @@ Reset(
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
NTSTATUS Status=STATUS_SUCCESS;
for( ULONG Index=GetNextStillIndex(); IsValidIndex(Index) && NT_SUCCESS( Status ); Index=GetNextStillIndex(Index) )
{
return STATUS_INVALID_DEVICE_STATE;
if( !m_HardwareSimulation[Index] )
{
Status = STATUS_INVALID_DEVICE_STATE;
}
else
{
CHardwareSimulation *pHwSim = m_HardwareSimulation[Index];
Status = pHwSim->Reset();
m_LastMappingsCompleted[Index] = pHwSim->ReadNumberOfMappingsCompleted();
}
}
CHardwareSimulation *pHwSim = m_HardwareSimulation[m_StillIndex];
pHwSim->Reset();
m_LastMappingsCompleted[m_StillIndex] = pHwSim->ReadNumberOfMappingsCompleted();
for( ULONG i=0; i<m_PinCount; i++ )
{
DBG_TRACE("m_LastMappingsCompleted[%d] = %d", i, m_LastMappingsCompleted[i] );
DBG_TRACE("m_LastMappingsCompleted[%d] = %d", i, m_LastMappingsCompleted[i] );
}
return STATUS_SUCCESS;
return Status;
}
@ -731,7 +775,7 @@ Return Value:
PAGED_CODE();
if( PinId > m_PinCount ||
if( !IsStillIndex(PinId) ||
!m_HardwareSimulation[PinId] ||
m_HardwareSimulation[PinId]->GetState() != PinRunning )
{
@ -743,9 +787,51 @@ Return Value:
}
LONG
CSensor::
GetTriggerMode(
_In_ ULONG PinId
)
/*++
Routine Description:
For a photo pin, take a picture or begin or end a photo sequence.
Arguments:
PinId -
This must be a photo pin.
mode -
The trigger mode, ie: normal or start/stop sequence.
Return Value:
Success / Failure
--*/
{
PAGED_CODE();
if( !IsStillIndex(PinId) ||
!m_HardwareSimulation[PinId] ||
m_HardwareSimulation[PinId]->GetState() != PinRunning )
{
return 0;
}
return
((CImageHardwareSimulation *)m_HardwareSimulation[PinId])->GetTriggerMode();
}
NTSTATUS
CSensor::
SetPhotoFrameRate(
_In_ ULONG StillIndex,
_In_ ULONGLONG TimePerFrame
)
/*++
@ -767,15 +853,17 @@ Return Value:
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_VideoInfoHeader[m_StillIndex] ||
!m_HardwareSimulation[m_StillIndex] )
// For now, we only handle 1 photo pin.
if( !IsValidIndex(StillIndex) ||
!m_VideoInfoHeader[StillIndex] ||
!m_HardwareSimulation[StillIndex] )
{
return STATUS_INVALID_DEVICE_STATE;
}
ULONGLONG AvgTimePerFrame =
(ULONGLONG) m_VideoInfoHeader[m_StillIndex]->AvgTimePerFrame;
(ULONGLONG) m_VideoInfoHeader[StillIndex]->AvgTimePerFrame;
DBG_TRACE( "TimePerFrame=%lld, AvgTimePerFrame=%lld", TimePerFrame, AvgTimePerFrame );
@ -794,12 +882,14 @@ Return Value:
DBG_TRACE( "Setting new TimePerFrame=%lld", TimePerFrame );
return
((CImageHardwareSimulation *) m_HardwareSimulation[m_StillIndex])->SetPhotoFrameRate( TimePerFrame );
((CImageHardwareSimulation *) m_HardwareSimulation[StillIndex])->SetPhotoFrameRate( TimePerFrame );
}
ULONGLONG
CSensor::
GetPhotoFrameRate()
GetPhotoFrameRate(
_In_ ULONG StillIndex
)
/*++
Routine Description:
@ -818,34 +908,40 @@ Return Value:
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
if( !IsStillIndex(StillIndex) ||
!m_HardwareSimulation[StillIndex] )
{
NT_ASSERT(FALSE);
return 0;
}
CImageHardwareSimulation *pSim = (CImageHardwareSimulation *) (m_HardwareSimulation[m_StillIndex]);
CImageHardwareSimulation *pSim = (CImageHardwareSimulation *) (m_HardwareSimulation[StillIndex]);
return pSim->GetPhotoFrameRate( );
}
NTSTATUS
CSensor::
SetFlashStatus(
_In_ ULONGLONG ulFlashStatus
_In_ ULONGLONG ulFlashStatus
)
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
NTSTATUS Status = STATUS_SUCCESS;
for( ULONG StillIndex = GetNextStillIndex();
IsValidIndex( StillIndex ) && NT_SUCCESS(Status);
StillIndex = GetNextStillIndex( StillIndex ) )
{
NT_ASSERT(FALSE);
return 0;
if( !m_HardwareSimulation[ StillIndex ] )
{
NT_ASSERT(FALSE);
return STATUS_INVALID_DEVICE_STATE;
}
Status = ((CImageHardwareSimulation *) m_HardwareSimulation[StillIndex])->SetFlashStatus (ulFlashStatus);
}
return
((CImageHardwareSimulation *) m_HardwareSimulation[m_StillIndex])->SetFlashStatus (ulFlashStatus);
return Status;
}
/*************************************************/
@ -854,40 +950,42 @@ SetFlashStatus(
NTSTATUS
CSensor::
SetPinMode(
_In_ ULONGLONG Flags,
_In_ ULONG PastBuffers
_In_ ULONG StillIndex,
_In_ ULONGLONG Flags,
_In_ ULONG PastBuffers
)
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
if( !IsStillIndex(StillIndex) ||
!m_HardwareSimulation[StillIndex] )
{
return STATUS_INVALID_DEVICE_STATE;
}
return
((CImageHardwareSimulation *) m_HardwareSimulation[m_StillIndex])->
SetMode( Flags, PastBuffers );
((CImageHardwareSimulation *) m_HardwareSimulation[StillIndex])->
SetMode( Flags, PastBuffers );
}
NTSTATUS
CSensor::
GetQPC(
_Out_ PULONGLONG TriggerTime
_In_ ULONG StillIndex,
_Out_ PULONGLONG TriggerTime
)
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
if( !IsStillIndex(StillIndex) ||
!m_HardwareSimulation[StillIndex] )
{
return STATUS_INVALID_DEVICE_STATE;
}
*TriggerTime =
((CImageHardwareSimulation *) m_HardwareSimulation[m_StillIndex])->
GetTriggerTime();
((CImageHardwareSimulation *) m_HardwareSimulation[StillIndex])->
GetTriggerTime();
return STATUS_SUCCESS;
}
@ -895,19 +993,20 @@ GetQPC(
NTSTATUS
CSensor::
SetQPC(
_In_ ULONGLONG TriggerTime
_In_ ULONG StillIndex,
_In_ ULONGLONG TriggerTime
)
{
PAGED_CODE();
if( m_StillIndex > m_PinCount ||
!m_HardwareSimulation[m_StillIndex] )
if( !IsStillIndex(StillIndex) ||
!m_HardwareSimulation[StillIndex] )
{
return STATUS_INVALID_DEVICE_STATE;
}
((CImageHardwareSimulation *) m_HardwareSimulation[m_StillIndex])->
SetTriggerTime( TriggerTime );
((CImageHardwareSimulation *) m_HardwareSimulation[StillIndex])->
SetTriggerTime( TriggerTime );
return STATUS_SUCCESS;
}
@ -1126,6 +1225,7 @@ func( \
{ \
PAGED_CODE(); \
UNREFERENCED_PARAMETER(Value); \
DBG_OUT("DEFINE_NULL_PROPERTY_FUNC defined %s - STATUS_NOT_FOUND(0x%x)", #func, STATUS_NOT_FOUND);\
return STATUS_NOT_FOUND; \
}
@ -1134,6 +1234,7 @@ ULONG \
func() \
{ \
PAGED_CODE(); \
DBG_OUT("DEFINE_NULL_SIZEOF_FUNC defined %s - STATUS_SUCCESS(0x%x)", #func, 0);\
return 0; \
}
@ -1160,6 +1261,7 @@ Set##name##Async( \
PAGED_CODE(); \
UNREFERENCED_PARAMETER(pProperty); \
UNREFERENCED_PARAMETER(Notifier); \
DBG_OUT("Set##name##Async defined null property for Set%sAsync - STATUS_NOT_FOUND(0x%x)", #name, STATUS_NOT_FOUND);\
return STATUS_NOT_FOUND; \
} \
\
@ -1168,6 +1270,7 @@ T:: \
Cancel##name() \
{ \
PAGED_CODE(); \
DBG_OUT("Cancel##name defined null property for Cancel%s - STATUS_UNSUCCESSFUL(0x%x)", #name, STATUS_UNSUCCESSFUL);\
return STATUS_UNSUCCESSFUL; \
}
@ -1179,6 +1282,7 @@ T:: \
SizeOf##name() \
{ \
PAGED_CODE(); \
DBG_OUT("SizeOf##name defined null property for SizeOf%s - STATUS_SUCCESS(0x%x)", #name, STATUS_SUCCESS);\
return 0; \
}
@ -1189,6 +1293,7 @@ DEFINE_NULL_PROPERTY_ASYNC(CSensor, KSPROPERTY_CAMERACONTROL_REGION_OF_INTEREST_
DEFINE_NULL_PROPERTY_ASYNC(CSensor, CExtendedPhotoMode, PhotoMode)
DEFINE_NULL_PROPERTY(CSensor, KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode)
DEFINE_NULL_PROPERTY_GET(CSensor, KSPROPERTY_VIDEOCONTROL_CAPS_S, VideoControlCaps)
DEFINE_NULL_PROPERTY(CSensor, KSPROPERTY_CAMERACONTROL_FLASH_S, Flash)
DEFINE_NULL_PROPERTY_GET(CSensor, KSPROPERTY_CAMERACONTROL_IMAGE_PIN_CAPABILITY_S, PinDependence)

Просмотреть файл

@ -179,11 +179,12 @@ protected:
//
ULONG *m_LastMappingsCompleted;
static const ULONG INVALID_PIN_INDEX = 0xffffffff;
static const ULONG INVALID_PIN_INDEX = 0xFFFFFFFF;
static const ULONG INVALID_PIN_MASK = 0;
ULONG m_PreviewIndex;
ULONG m_StillIndex;
ULONG m_VideoIndex;
ULONG m_PreviewMask;
ULONG m_StillMask;
ULONG m_VideoMask;
// Access control mutex.
KMutex m_SensorMutex;
@ -194,6 +195,8 @@ protected:
ISP_FRAME_SETTINGS m_GlobalIspSettings;
AcpiPldRotation m_MountingOrientation;
public:
CSensor(
@ -230,6 +233,13 @@ public:
return m_Device->GetDeviceObject();
}
virtual
NTSTATUS
CreateSynthesizer(
_In_ PKSPIN Pin,
_In_ PKS_VIDEOINFOHEADER VideoInfoHeader
);
//
// AcquireHardwareResources():
//
@ -291,31 +301,37 @@ public:
NTSTATUS
SetQPC(
_In_ ULONGLONG QPC
_In_ ULONG StillIndex,
_In_ ULONGLONG QPC
);
NTSTATUS
GetQPC(
_Out_ PULONGLONG QPC
_In_ ULONG StillIndex,
_Out_ PULONGLONG QPC
);
NTSTATUS
SetPinMode(
_In_ ULONGLONG Flags,
_In_ ULONG PastBuffers
_In_ ULONG StillIndex,
_In_ ULONGLONG Flags,
_In_ ULONG PastBuffers
);
NTSTATUS
SetPhotoFrameRate(
_In_ ULONG StillIndex,
_In_ ULONGLONG TimePerFrame
);
ULONGLONG
GetPhotoFrameRate();
GetPhotoFrameRate(
_In_ ULONG StillIndex
);
NTSTATUS
SetFlashStatus(
_In_ ULONGLONG ulFlashStatus
_In_ ULONGLONG ulFlashStatus
);
bool
@ -323,7 +339,7 @@ public:
_In_ ULONG Index
)
{
return m_PreviewIndex == Index ;
return !!(m_PreviewMask & (1<<Index)) ;
}
bool
@ -331,7 +347,7 @@ public:
_In_ ULONG Index
)
{
return m_StillIndex == Index ;
return !!(m_StillMask & (1<<Index)) ;
}
bool
@ -339,7 +355,7 @@ public:
_In_ ULONG Index
)
{
return m_VideoIndex == Index ;
return !!(m_VideoMask & (1<<Index)) ;
}
bool
@ -350,21 +366,47 @@ public:
return Index < GetPinCount() ;
}
inline ULONG GetPreviewIndex()
inline ULONG GetNextPreviewIndex(ULONG Index=INVALID_PIN_INDEX)
{
return m_PreviewIndex;
while( IsValidIndex(++Index) )
{
if( IsPreviewIndex(Index) )
{
return Index;
}
}
return INVALID_PIN_INDEX;
}
inline ULONG GetStillIndex()
inline ULONG GetNextStillIndex(ULONG Index=INVALID_PIN_INDEX)
{
return m_StillIndex;
while( IsValidIndex(++Index) )
{
if( IsStillIndex(Index) )
{
return Index;
}
}
return INVALID_PIN_INDEX;
}
inline ULONG GetVideoIndex()
inline ULONG GetNextVideoIndex(ULONG Index=INVALID_PIN_INDEX)
{
return m_VideoIndex;
while( IsValidIndex(++Index) )
{
if( IsVideoIndex(Index) )
{
return Index;
}
}
return INVALID_PIN_INDEX;
}
LONG
GetTriggerMode(
_In_ ULONG PinId
);
//Not thread safe, for User mode notification only.
LONG
GetFilterCount()
@ -466,6 +508,14 @@ public:
void
UpdateZoom(void);
void
SetMountingOrientation(
_In_ AcpiPldRotation Orientation
)
{
m_MountingOrientation = Orientation;
}
protected:
LONG
IncrementFilterCount()
@ -482,6 +532,7 @@ protected:
public:
DECLARE_PROPERTY( KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode );
DECLARE_PROPERTY_GET( KSPROPERTY_VIDEOCONTROL_CAPS_S, VideoControlCaps );
DECLARE_PROPERTY_GET( KSCAMERA_EXTENDEDPROP_FOCUSSTATE, FocusState );
DECLARE_PROPERTY_ASYNC( KSPROPERTY_CAMERACONTROL_REGION_OF_INTEREST_S, FocusRect );

Просмотреть файл

@ -100,7 +100,7 @@ DEFINE_LEGACY_CTRL_CAPS( BacklightCompensation, 0, 1, 1, 0 )
DEFINE_LEGACY_CTRL_CAPS( Brightness, -10000, 10000, 1, 750 )
DEFINE_LEGACY_CTRL_CAPS( Contrast, -10000, 10000, 1, 100 )
DEFINE_LEGACY_CTRL_CAPS( Hue, -18000, 18000, 1, 0 )
DEFINE_LEGACY_CTRL_CAPS( PLF, POWERLINEFREQ_DISABLED, POWERLINEFREQ_60HZ, 1, POWERLINEFREQ_DEFAULT )
DEFINE_LEGACY_CTRL_CAPS( PLF, POWERLINEFREQ_DISABLED, POWERLINEFREQ_AUTO, 1, POWERLINEFREQ_DEFAULT )
DEFINE_LEGACY_CTRL_CAPS( WhiteBalance, WHITEBALANCE_MIN, WHITEBALANCE_MAX, WHITEBALANCE_STEP, WHITEBALANCE_DEF )
DEFINE_LEGACY_CTRL_CAPS( Exposure, EXPOSURE_BILOG_MIN, EXPOSURE_BILOG_MAX, EXPOSURE_BILOG_STEP, EXPOSURE_BILOG_DEF)
DEFINE_LEGACY_CTRL_CAPS( Focus, 1, 1200, 1, 100 );
@ -299,7 +299,14 @@ Return Value:
m_VideoStabilization = KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_OFF;
m_Histogram = KSCAMERA_EXTENDEDPROP_HISTOGRAM_OFF;
m_OpticalImageStabilization = KSCAMERA_EXTENDEDPROP_OIS_AUTO;
m_AdvancedPhoto = KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_OFF;
m_AdvancedPhoto.PinId = GetNextStillIndex();
m_AdvancedPhoto.Flags = KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_OFF;
m_AdvancedPhoto.Capability = KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_OFF |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_HDR |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_FNF |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_ULTRALOWLIGHT;
m_FocusRect.left = 0;
m_FocusRect.top = 0;
@ -310,13 +317,17 @@ Return Value:
m_PhotoMode = CExtendedPhotoMode();
m_PhotoMode.Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL | KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE;
m_PhotoMode.PinId = GetStillIndex();
m_PhotoMode.PinId = GetNextStillIndex();
m_PhotoMode.MaxHistoryFrames() = IMAGE_CAPTURE_PIN_MAXIMUM_HISTORY_FRAMES;
m_PhotoMode.RequestedHistoryFrames() = 0;
m_PhotoMode.SubMode() = KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE_SUB_NONE;
m_MaxFrameRate = CExtendedProperty(); // assume nothing.
SetQPC( 0 );
for( ULONG Index = GetNextStillIndex(); IsValidIndex( Index ); Index = GetNextStillIndex( Index ) )
{
SetQPC( Index, 0 );
}
m_TorchMode.Flags = KSCAMERA_EXTENDEDPROP_VIDEOTORCH_OFF;
m_TorchMode = 50UL;
@ -454,7 +465,8 @@ Return Value:
m_Hue.Flags = KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
// Set up our Power Line Frequency defaults.
m_PowerLineFreq.Capabilities = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
m_PowerLineFreq.Capabilities =
KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL | KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
m_PowerLineFreq.Value = POWERLINEFREQ_DEFAULT;
m_PowerLineFreq.Flags = KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL;
@ -512,59 +524,57 @@ Return Value:
IFNULL_EXIT( m_MetadataInfo = new (PagedPool, 'ateM') CExtendedMetadata[GetPinCount()] );
IFNULL_EXIT( m_WarmStartEnabled = new (PagedPool, 'mraW' ) CExtendedProperty[GetPinCount()] );
if( NT_SUCCESS( Status ) )
for( ULONG PinIndex=0;
NT_SUCCESS(Status) && PinIndex<m_Descriptors->PinDescriptorsCount;
PinIndex++ )
{
for( ULONG PinIndex=0;
NT_SUCCESS(Status) && PinIndex<m_Descriptors->PinDescriptorsCount;
PinIndex++ )
const KSPIN_DESCRIPTOR_EX *PinDescriptors = m_Descriptors->PinDescriptors;
CHardwareSimulation *pSim=nullptr;
NT_ASSERT( m_Descriptors->PinDescriptorSize == sizeof( *PinDescriptors ) );
// Video pin type
if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PIN_CATEGORY_CAPTURE ) )
{
const KSPIN_DESCRIPTOR_EX *PinDescriptors = m_Descriptors->PinDescriptors;
CHardwareSimulation *pSim=nullptr;
pSim = new (NonPagedPoolNx, 'ediV') CVideoHardwareSimulation( this, PinIndex );
m_VideoMask |= 1<<PinIndex;
}
else if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PIN_CATEGORY_PREVIEW ) )
{
pSim = new (NonPagedPoolNx, 'verP') CPreviewHardwareSimulation( this, PinIndex );
m_PreviewMask |= 1<<PinIndex; // must set to enable photo confirmation...
}
else if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PINNAME_IMAGE ) )
{
pSim = new (NonPagedPoolNx, 'litS') CImageHardwareSimulation( this, PinIndex );
m_StillMask |= 1<<PinIndex;
}
else
{
// We don't know this pin type, so skip it.
m_HardwareSimulation[PinIndex] = nullptr;
continue;
}
NT_ASSERT( m_Descriptors->PinDescriptorSize == sizeof( *PinDescriptors ) );
// Video pin type
if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PIN_CATEGORY_CAPTURE ) )
if( pSim )
{
if( pSim->Initialize() )
{
pSim = new (NonPagedPoolNx, 'ediV') CVideoHardwareSimulation( this, PinIndex );
m_VideoIndex = PinIndex;
}
else if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PIN_CATEGORY_PREVIEW ) )
{
pSim = new (NonPagedPoolNx, 'verP') CPreviewHardwareSimulation( this, PinIndex );
m_PreviewIndex = PinIndex; // must set to enable photo confirmation...
}
else if( IsEqualGUID( *PinDescriptors[PinIndex].PinDescriptor.Category, PINNAME_IMAGE ) )
{
pSim = new (NonPagedPoolNx, 'litS') CImageHardwareSimulation( this, PinIndex );
m_StillIndex = PinIndex;
}
else
{
Status = STATUS_INTERNAL_ERROR;
NT_ASSERT(FALSE);
}
if( pSim )
{
if( pSim->Initialize() )
{
m_HardwareSimulation[PinIndex] = pSim;
}
else
{
//
// If we couldn't create the hardware simulation, fail.
//
delete pSim;
Status = STATUS_INSUFFICIENT_RESOURCES;
}
m_HardwareSimulation[PinIndex] = pSim;
}
else
{
//
// If we couldn't create the hardware simulation, fail.
//
delete pSim;
Status = STATUS_INSUFFICIENT_RESOURCES;
}
}
else
{
Status = STATUS_INSUFFICIENT_RESOURCES;
}
}
done:
@ -1553,7 +1563,6 @@ GetVideoHDR(
pProperty->Capability = KSCAMERA_EXTENDEDPROP_VIDEOHDR_OFF |
KSCAMERA_EXTENDEDPROP_VIDEOHDR_ON |
KSCAMERA_EXTENDEDPROP_VIDEOHDR_AUTO;
pProperty->PinId = m_VideoIndex;
return STATUS_SUCCESS;
}
@ -1581,8 +1590,8 @@ GetVFR(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
*pProperty = CExtendedProperty( m_VFR );
pProperty->PinId = m_VideoIndex;
pProperty->Flags = m_VFR;
pProperty->Capability = 0;
return STATUS_SUCCESS;
}
@ -1710,11 +1719,10 @@ GetVideoStabilization(
PAGED_CODE();
KScopedMutex lock(m_SensorMutex);
*pProperty = CExtendedProperty(m_VideoStabilization);
pProperty->Flags = m_VideoStabilization;
pProperty->Capability = KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_OFF |
KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_ON |
KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_AUTO;
pProperty->PinId = m_VideoIndex;
return STATUS_SUCCESS;
}
@ -1775,13 +1783,8 @@ GetAdvancedPhoto(
PAGED_CODE();
KScopedMutex lock(m_SensorMutex);
*pProperty = CExtendedProperty(m_AdvancedPhoto);
pProperty->PinId = GetStillIndex();
pProperty->Capability = KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_OFF |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_HDR |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_FNF |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_ULTRALOWLIGHT;
pProperty->Flags = m_AdvancedPhoto.Flags;
pProperty->Capability = m_AdvancedPhoto.Capability;
return STATUS_SUCCESS;
}
@ -1795,7 +1798,7 @@ SetAdvancedPhoto(
PAGED_CODE();
KScopedMutex lock(m_SensorMutex);
m_AdvancedPhoto = pProperty->Flags;
m_AdvancedPhoto = *pProperty;
return STATUS_SUCCESS;
}
@ -1813,7 +1816,9 @@ GetFocus(
KSPROPERTY_CAMERACONTROL_FLAGS_AUTO |
KSPROPERTY_CAMERACONTROL_FLAGS_ABSOLUTE;
pKsCameraControl->Flags = KSPROPERTY_CAMERACONTROL_FLAGS_ABSOLUTE;
if (m_GlobalIspSettings.FocusMode & KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_AUTO)
// If we're currently set to AUTO or CONTINUOUS, report AUTO.
if (m_GlobalIspSettings.FocusMode &
( KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_AUTO | KSCAMERA_EXTENDEDPROP_FOCUS_CONTINUOUS ))
{
pKsCameraControl->Flags |= KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
}
@ -1909,8 +1914,8 @@ GetExposure(
pKsCameraControl->Value = Exposure100nsToBinaryLog(m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll);
DBG_TRACE("ExposureMode=0x%016llX, ExposureTime=%lld00ns",
m_GlobalIspSettings.ExposureMode, m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll);
DBG_TRACE("ExposureValue=%d, ExposureMode=0x%016llX, ExposureTime=%lld00ns",
pKsCameraControl->Value, m_GlobalIspSettings.ExposureMode, m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll);
return STATUS_SUCCESS;
}
@ -1924,36 +1929,38 @@ SetExposure(
{
PAGED_CODE();
KScopedMutex lock(m_SensorMutex);
NTSTATUS ntStatus = STATUS_SUCCESS;
NTSTATUS ntStatus = BoundsCheckSigned( pKsCameraControl->Value, ExposureRangeAndStep[0] );
if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL)
if( NT_SUCCESS(ntStatus) )
{
// Convert relative values to absolute.
if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE || !ExposureBinaryLogIsValid(pKsCameraControl->Value))
if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_MANUAL)
{
// Convert relative values to absolute.
if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_RELATIVE || !ExposureBinaryLogIsValid(pKsCameraControl->Value))
{
ntStatus = STATUS_INVALID_PARAMETER;
}
if (NT_SUCCESS(ntStatus))
{
// We report these changes in the next metadata payload
m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll = ExposureBinaryLogTo100ns(pKsCameraControl->Value);
m_GlobalIspSettings.ExposureMode =
KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_MANUAL;
}
}
else if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_AUTO)
{
m_GlobalIspSettings.ExposureMode = KSPROPERTY_CAMERACONTROL_FLAGS_AUTO | KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_LOCK;
}
else
{
ntStatus = STATUS_INVALID_PARAMETER;
}
if (NT_SUCCESS(ntStatus))
{
// We report these changes in the next metadata payload
m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll = ExposureBinaryLogTo100ns(pKsCameraControl->Value);
m_GlobalIspSettings.ExposureMode =
KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_MANUAL;
}
}
else if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_AUTO)
{
m_GlobalIspSettings.ExposureMode = KSPROPERTY_CAMERACONTROL_FLAGS_AUTO | KSCAMERA_EXTENDEDPROP_VIDEOPROCFLAG_LOCK;
}
else
{
ntStatus = STATUS_INVALID_PARAMETER;
}
DBG_TRACE("ExposureMode=0x%016llX, ExposureTime=%lld00ns",
m_GlobalIspSettings.ExposureMode, m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll);
DBG_TRACE("ExposureValue=%d, ExposureMode=0x%016llX, ExposureTime=%lld00ns",
pKsCameraControl->Value, m_GlobalIspSettings.ExposureMode, m_GlobalIspSettings.ExposureSetting.VideoProc.Value.ll);
return ntStatus;
}
@ -1987,11 +1994,13 @@ SmoothZoom()
bool bZoomIn = (targetZoom > currentZoom);
LONG OpModeZoomSpeed = ZOOM_SPEED;
// User lower zoom speed for video.
if( INVALID_PIN_INDEX != m_VideoIndex &&
PinRunning == m_HardwareSimulation[m_VideoIndex]->GetState() )
// Use lower zoom speed for video, if any record pin is running.
for( ULONG VideoIndex=GetNextVideoIndex(); IsValidIndex(VideoIndex); VideoIndex=GetNextVideoIndex(VideoIndex) )
{
OpModeZoomSpeed = ZOOM_SPEED_VIDEO_RECORDING;
if( PinRunning == m_HardwareSimulation[VideoIndex]->GetState() )
{
OpModeZoomSpeed = ZOOM_SPEED_VIDEO_RECORDING;
}
}
// Calculate zoom step that is relative to current zoom factor.
@ -2639,7 +2648,7 @@ SetPowerlineFreq(
else if (pKsCameraControl->Flags & KSPROPERTY_CAMERACONTROL_FLAGS_AUTO)
{
m_PowerLineFreq.Flags = KSPROPERTY_CAMERACONTROL_FLAGS_AUTO;
m_PowerLineFreq.Value = 0;
m_PowerLineFreq.Value = POWERLINEFREQ_AUTO; // Auto is auto.
}
else
{
@ -2721,8 +2730,8 @@ GetHistogram(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
*pProperty = CExtendedProperty( m_Histogram );
pProperty->PinId = m_PreviewIndex;
pProperty->Flags = m_Histogram;
pProperty->m_Value.Value.ull = 0;
pProperty->Capability = 0;
return STATUS_SUCCESS;
}
@ -2740,7 +2749,7 @@ SetHistogram(
m_Histogram = pProperty->Flags;
// Adjust the reported metadata buffer size for preview.
m_MetadataInfo[m_PreviewIndex] =
m_MetadataInfo[pProperty->PinId] =
CExtendedMetadata::METADATA_MAX +
(( m_Histogram == KSCAMERA_EXTENDEDPROP_HISTOGRAM_ON ) ? sizeof(CAMERA_METADATA_HISTOGRAM) : 0 ) ;
@ -2906,13 +2915,15 @@ GetTriggerTime(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
*pQPC = CExtendedProperty(0);
pQPC->PinId = GetStillIndex();
NTSTATUS Status = GetQPC( &pQPC->m_Value.Value.ull );
pQPC->Flags = 0;
NTSTATUS Status = GetQPC( pQPC->PinId, &pQPC->m_Value.Value.ull );
pQPC->Flags = ( pQPC->m_Value.Value.ull != 0 ) ?
KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_SET :
KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_CLEAR;
if( NT_SUCCESS(Status) )
{
pQPC->Flags = ( pQPC->m_Value.Value.ull != 0 ) ?
KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_SET :
KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_CLEAR;
}
return Status;
}
@ -2927,7 +2938,7 @@ SetTriggerTime(
KScopedMutex lock( m_SensorMutex );
ULONGLONG Time = ( pQPC->Flags & KSPROPERTY_CAMERA_PHOTOTRIGGERTIME_SET ) ? *pQPC : 0;
return SetQPC( Time );
return SetQPC( pQPC->PinId, Time );
}
// Get KSPROPERTY_CAMERACONTROL_EXTENDED_TORCHMODE
@ -2973,7 +2984,12 @@ GetPhotoMode(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
*pPhotoMode = m_PhotoMode;
pPhotoMode->Flags = m_PhotoMode.Flags;
pPhotoMode->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL | KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE;
pPhotoMode->MaxHistoryFrames() = IMAGE_CAPTURE_PIN_MAXIMUM_HISTORY_FRAMES;
pPhotoMode->RequestedHistoryFrames() = m_PhotoMode.RequestedHistoryFrames();
pPhotoMode->SubMode() = m_PhotoMode.SubMode();
return STATUS_SUCCESS;
}
@ -2993,7 +3009,7 @@ SetPhotoModeAsync(
m_PhotoMode = *pPhotoMode;
NTSTATUS Status =
SetPinMode( pPhotoMode->Flags, pPhotoMode->RequestedHistoryFrames() );
SetPinMode( pPhotoMode->PinId, pPhotoMode->Flags, pPhotoMode->RequestedHistoryFrames() );
// Tell the caller that we're done.
Notifier->Set();
@ -3014,9 +3030,15 @@ GetPhotoMaxFrameRate(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
*pPhotoMaxFrameRate = m_MaxFrameRate;
pPhotoMaxFrameRate->Flags = m_MaxFrameRate.Flags;
pPhotoMaxFrameRate->m_Value = m_MaxFrameRate.m_Value;
// If max frame rate is 0,0, we want to indicate 30fps to the caller.
if ((*pPhotoMaxFrameRate).m_Value.Value.ull == 0)
{
(*pPhotoMaxFrameRate).m_Value.Value.ratio.HighPart = 30000;
(*pPhotoMaxFrameRate).m_Value.Value.ratio.LowPart = 1000;
}
pPhotoMaxFrameRate->Capability = KSCAMERA_EXTENDEDPROP_CAPS_ASYNCCONTROL;
pPhotoMaxFrameRate->PinId = GetStillIndex();
return STATUS_SUCCESS;
}
@ -3052,7 +3074,7 @@ SetPhotoMaxFrameRateAsync(
DBG_TRACE( "SetPhotoFrameRate(%lld)", TimePerFrame );
// Consume any error; we'll set the rate again when the pin starts.
SetPhotoFrameRate( TimePerFrame );
SetPhotoFrameRate( pPhotoMaxFrameRate->PinId, TimePerFrame );
// Tell the caller that we're done.
Notifier->Set();
@ -3472,11 +3494,7 @@ GetVideoControlMode(
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
pMode->Mode =
KS_VideoControlFlag_IndependentImagePin |
KS_VideoControlFlag_Trigger |
KS_VideoControlFlag_StartPhotoSequenceCapture |
KS_VideoControlFlag_StopPhotoSequenceCapture;
pMode->Mode = GetTriggerMode(pMode->StreamIndex);
return STATUS_SUCCESS;
}
@ -3494,3 +3512,26 @@ SetVideoControlMode(
return Trigger( pMode->StreamIndex, pMode->Mode );
}
// Get KSPROPERTY_VIDEOCONTROL_CAPS.
NTSTATUS
CSensorSimulation::
GetVideoControlCaps(
_Inout_ KSPROPERTY_VIDEOCONTROL_CAPS_S *pCaps
)
{
PAGED_CODE();
KScopedMutex lock( m_SensorMutex );
pCaps->VideoControlCaps = 0;
if( IsStillIndex( pCaps->StreamIndex ) )
{
pCaps->VideoControlCaps =
KS_VideoControlFlag_IndependentImagePin |
KS_VideoControlFlag_Trigger |
KS_VideoControlFlag_StartPhotoSequenceCapture |
KS_VideoControlFlag_StopPhotoSequenceCapture;
}
return STATUS_SUCCESS;
}

Просмотреть файл

@ -60,7 +60,7 @@ protected:
ULONGLONG m_VideoStabilization;
ULONGLONG m_Histogram;
ULONGLONG m_OpticalImageStabilization;
ULONGLONG m_AdvancedPhoto;
CExtendedProperty m_AdvancedPhoto;
CWhiteBalanceRoiIspControl m_RoiWhiteBalance;
CExposureRoiIspControl m_RoiExposureMode;
@ -190,6 +190,7 @@ public:
// Declare the property controls handled by this sensor.
DECLARE_PROPERTY( KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode );
DECLARE_PROPERTY_GET( KSPROPERTY_VIDEOCONTROL_CAPS_S, VideoControlCaps );
DECLARE_PROPERTY_ASYNC( KSPROPERTY_CAMERACONTROL_REGION_OF_INTEREST_S, FocusRect );

Просмотреть файл

@ -0,0 +1 @@

Просмотреть файл

@ -80,8 +80,9 @@ ULONG CSynthesizer::m_Frame=0;
//
const UCHAR
CSynthesizer::
m_FontData [256][8] =
m_FontData [2][256][8] =
{
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e},
{0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e},
@ -338,6 +339,265 @@ m_FontData [256][8] =
{0x70, 0x18, 0x30, 0x60, 0x78, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
},
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x7e, 0x81, 0xa9, 0x8d, 0x8d, 0xa9, 0x81, 0x7e},
{0x7e, 0xff, 0xd7, 0xf3, 0xf3, 0xd7, 0xff, 0x7e},
{0x00, 0x70, 0xf8, 0xfc, 0x7e, 0xfc, 0xf8, 0x70},
{0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10},
{0x00, 0x18, 0x5d, 0xff, 0xff, 0xff, 0x5d, 0x18},
{0x00, 0x08, 0x1d, 0x3f, 0xff, 0x3f, 0x1d, 0x08},
{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00},
{0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff},
{0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00},
{0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff},
{0xf0, 0xe0, 0xfe, 0xbf, 0x11, 0x11, 0x1f, 0x0e},
{0x00, 0x72, 0xfa, 0x8f, 0x8f, 0xfa, 0x72, 0x00},
{0xe0, 0xe0, 0xa0, 0xa0, 0xfe, 0xff, 0x07, 0x03},
{0xfc, 0xfe, 0xa6, 0xa0, 0xa0, 0xfe, 0xff, 0x03},
{0x99, 0x5a, 0x3c, 0xe7, 0xe7, 0x3c, 0x5a, 0x99},
{0x00, 0x10, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe},
{0x00, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x10},
{0x00, 0x24, 0x66, 0xff, 0xff, 0x66, 0x24, 0x00},
{0x00, 0xfa, 0xfa, 0x00, 0x00, 0xfa, 0xfa, 0x00},
{0xfe, 0xfe, 0x80, 0xfe, 0xfe, 0x90, 0xf0, 0x60},
{0x40, 0xc0, 0x9a, 0xbf, 0xa5, 0xfd, 0x5b, 0x02},
{0x00, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x0e, 0x00},
{0x01, 0x29, 0x6d, 0xff, 0xff, 0x6d, 0x29, 0x01},
{0x00, 0x20, 0x60, 0xfe, 0xfe, 0x60, 0x20, 0x00},
{0x00, 0x08, 0x0c, 0xfe, 0xfe, 0x0c, 0x08, 0x00},
{0x00, 0x10, 0x38, 0x7c, 0x54, 0x10, 0x10, 0x10},
{0x00, 0x10, 0x10, 0x10, 0x54, 0x7c, 0x38, 0x10},
{0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x3c, 0x3c},
{0x10, 0x38, 0x7c, 0x10, 0x10, 0x7c, 0x38, 0x10},
{0x0c, 0x1c, 0x3c, 0x7c, 0x7c, 0x3c, 0x1c, 0x0c},
{0x60, 0x70, 0x78, 0x7c, 0x7c, 0x78, 0x70, 0x60},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x60, 0xfa, 0xfa, 0x60, 0x00},
{0x00, 0x00, 0xe0, 0xe0, 0x00, 0xe0, 0xe0, 0x00},
{0x00, 0x28, 0xfe, 0xfe, 0x28, 0xfe, 0xfe, 0x28},
{0x00, 0x00, 0x48, 0x5c, 0xd6, 0xd6, 0x74, 0x24},
{0x00, 0x46, 0x66, 0x30, 0x18, 0x0c, 0x66, 0x62},
{0x00, 0x12, 0x5e, 0xec, 0xba, 0xf2, 0x5e, 0x0c},
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x20},
{0x00, 0x00, 0x00, 0x82, 0xc6, 0x7c, 0x38, 0x00},
{0x00, 0x00, 0x00, 0x38, 0x7c, 0xc6, 0x82, 0x00},
{0x10, 0x54, 0x7c, 0x38, 0x38, 0x7c, 0x54, 0x10},
{0x00, 0x00, 0x10, 0x10, 0x7c, 0x7c, 0x10, 0x10},
{0x00, 0x00, 0x00, 0x00, 0x06, 0x07, 0x01, 0x00},
{0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10},
{0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00},
{0x00, 0x80, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06},
{0x00, 0x7c, 0xfe, 0xb2, 0x9a, 0x8e, 0xfe, 0x7c},
{0x00, 0x00, 0x02, 0x02, 0xfe, 0xfe, 0x42, 0x02},
{0x00, 0x00, 0x66, 0xf6, 0x92, 0x9a, 0xce, 0x46},
{0x00, 0x00, 0x6c, 0xfe, 0x92, 0x92, 0xc6, 0x44},
{0x00, 0x0a, 0xfe, 0xfe, 0xca, 0x68, 0x38, 0x18},
{0x00, 0x00, 0x9c, 0xbe, 0xa2, 0xa2, 0xe6, 0xe4},
{0x00, 0x00, 0x0c, 0x9e, 0x92, 0xd2, 0x7e, 0x3c},
{0x00, 0x00, 0xe0, 0xf0, 0x9e, 0x8e, 0xc0, 0xc0},
{0x00, 0x00, 0x6c, 0xfe, 0x92, 0x92, 0xfe, 0x6c},
{0x00, 0x00, 0x78, 0xfc, 0x96, 0x92, 0xf2, 0x60},
{0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x66, 0x67, 0x01, 0x00},
{0x00, 0x00, 0x00, 0x82, 0xc6, 0x6c, 0x38, 0x10},
{0x00, 0x00, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24},
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x82, 0x00},
{0x00, 0x00, 0x60, 0xf0, 0x9a, 0x8a, 0xc0, 0x40},
{0x00, 0x78, 0xf8, 0xba, 0xba, 0x82, 0xfe, 0x7c},
{0x00, 0x00, 0x3e, 0x7e, 0xc8, 0xc8, 0x7e, 0x3e},
{0x00, 0x6c, 0xfe, 0x92, 0x92, 0xfe, 0xfe, 0x82},
{0x00, 0x44, 0xc6, 0x82, 0x82, 0xc6, 0x7c, 0x38},
{0x00, 0x38, 0x7c, 0xc6, 0x82, 0xfe, 0xfe, 0x82},
{0x00, 0xc6, 0x82, 0xba, 0x92, 0xfe, 0xfe, 0x82},
{0x00, 0xc0, 0x80, 0xb8, 0x92, 0xfe, 0xfe, 0x82},
{0x00, 0x4e, 0xce, 0x8a, 0x82, 0xc6, 0x7c, 0x38},
{0x00, 0x00, 0xfe, 0xfe, 0x10, 0x10, 0xfe, 0xfe},
{0x00, 0x00, 0x00, 0x82, 0xfe, 0xfe, 0x82, 0x00},
{0x00, 0x80, 0xfc, 0xfe, 0x82, 0x02, 0x0e, 0x0c},
{0x00, 0xc6, 0xee, 0x38, 0x10, 0xfe, 0xfe, 0x82},
{0x00, 0x0e, 0x06, 0x02, 0x82, 0xfe, 0xfe, 0x82},
{0x00, 0xfe, 0xfe, 0x70, 0x38, 0x70, 0xfe, 0xfe},
{0x00, 0xfe, 0xfe, 0x18, 0x30, 0x60, 0xfe, 0xfe},
{0x00, 0x38, 0x7c, 0xc6, 0x82, 0xc6, 0x7c, 0x38},
{0x00, 0x60, 0xf0, 0x90, 0x92, 0xfe, 0xfe, 0x82},
{0x00, 0x00, 0x7a, 0xfe, 0x8e, 0x84, 0xfc, 0x78},
{0x00, 0x66, 0xfe, 0x98, 0x90, 0xfe, 0xfe, 0x82},
{0x00, 0x00, 0x4c, 0xce, 0x9a, 0xb2, 0xf6, 0x64},
{0x00, 0x00, 0xc0, 0x82, 0xfe, 0xfe, 0x82, 0xc0},
{0x00, 0x00, 0xfe, 0xfe, 0x02, 0x02, 0xfe, 0xfe},
{0x00, 0x00, 0xf8, 0xfc, 0x06, 0x06, 0xfc, 0xf8},
{0x00, 0xfe, 0xfe, 0x0c, 0x18, 0x0c, 0xfe, 0xfe},
{0x00, 0xc2, 0xe6, 0x3c, 0x18, 0x3c, 0xe6, 0xc2},
{0x00, 0x00, 0xe0, 0xf2, 0x1e, 0x1e, 0xf2, 0xe0},
{0x00, 0xce, 0xe6, 0xb2, 0x9a, 0x8e, 0xc6, 0xe2},
{0x00, 0x00, 0x00, 0x82, 0x82, 0xfe, 0xfe, 0x00},
{0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80},
{0x00, 0x00, 0x00, 0xfe, 0xfe, 0x82, 0x82, 0x00},
{0x00, 0x10, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x10},
{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01},
{0x00, 0x00, 0x00, 0x20, 0xe0, 0xc0, 0x00, 0x00},
{0x00, 0x02, 0x1e, 0x3c, 0x2a, 0x2a, 0x2e, 0x04},
{0x00, 0x0c, 0x1e, 0x12, 0x12, 0xfc, 0xfe, 0x82},
{0x00, 0x00, 0x14, 0x36, 0x22, 0x22, 0x3e, 0x1c},
{0x00, 0x02, 0xfe, 0xfc, 0x92, 0x12, 0x1e, 0x0c},
{0x00, 0x00, 0x18, 0x3a, 0x2a, 0x2a, 0x3e, 0x1c},
{0x00, 0x00, 0x40, 0xc0, 0x92, 0xfe, 0x7e, 0x12},
{0x00, 0x20, 0x3e, 0x1f, 0x25, 0x25, 0x3d, 0x19},
{0x00, 0x1e, 0x3e, 0x20, 0x10, 0xfe, 0xfe, 0x82},
{0x00, 0x00, 0x00, 0x02, 0xbe, 0xbe, 0x22, 0x00},
{0x00, 0x00, 0xbe, 0xbf, 0x01, 0x01, 0x07, 0x06},
{0x00, 0x22, 0x36, 0x1c, 0x08, 0xfe, 0xfe, 0x82},
{0x00, 0x00, 0x00, 0x02, 0xfe, 0xfe, 0x82, 0x00},
{0x00, 0x1e, 0x3e, 0x38, 0x1c, 0x18, 0x3e, 0x3e},
{0x00, 0x00, 0x1e, 0x3e, 0x20, 0x20, 0x3e, 0x3e},
{0x00, 0x00, 0x1c, 0x3e, 0x22, 0x22, 0x3e, 0x1c},
{0x00, 0x18, 0x3c, 0x24, 0x25, 0x1f, 0x3f, 0x21},
{0x00, 0x21, 0x3f, 0x1f, 0x25, 0x24, 0x3c, 0x18},
{0x00, 0x18, 0x38, 0x20, 0x32, 0x1e, 0x3e, 0x22},
{0x00, 0x00, 0x24, 0x2e, 0x2a, 0x2a, 0x3a, 0x12},
{0x00, 0x00, 0x24, 0x22, 0xfe, 0x7c, 0x20, 0x00},
{0x00, 0x02, 0x3e, 0x3c, 0x02, 0x02, 0x3e, 0x3c},
{0x00, 0x00, 0x38, 0x3c, 0x06, 0x06, 0x3c, 0x38},
{0x00, 0x3c, 0x3e, 0x0e, 0x1c, 0x0e, 0x3e, 0x3c},
{0x00, 0x22, 0x36, 0x1c, 0x08, 0x1c, 0x36, 0x22},
{0x00, 0x00, 0x3e, 0x3f, 0x05, 0x05, 0x3d, 0x39},
{0x00, 0x00, 0x26, 0x32, 0x3a, 0x2e, 0x26, 0x32},
{0x00, 0x00, 0x82, 0x82, 0xee, 0x7c, 0x10, 0x10},
{0x00, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x10, 0x10, 0x7c, 0xee, 0x82, 0x82},
{0x00, 0x80, 0xc0, 0x40, 0xc0, 0x80, 0xc0, 0x40},
{0x00, 0x0e, 0x1e, 0x32, 0x62, 0x32, 0x1e, 0x0e},
{0x00, 0x00, 0x52, 0xdf, 0x8d, 0x89, 0xf9, 0x70},
{0x00, 0x02, 0x5e, 0x5e, 0x02, 0x02, 0x5e, 0x5c},
{0x00, 0x00, 0x98, 0xba, 0xaa, 0x2a, 0x3e, 0x1c},
{0x42, 0xde, 0xbe, 0xaa, 0xaa, 0xae, 0xc4, 0x40},
{0x00, 0x02, 0x9e, 0xbe, 0x2a, 0x2a, 0xae, 0x84},
{0x00, 0x02, 0x1e, 0x3e, 0x2a, 0xaa, 0xae, 0x84},
{0x00, 0x02, 0x1e, 0x3e, 0xea, 0xea, 0x2e, 0x04},
{0x00, 0x00, 0x02, 0x27, 0x25, 0x25, 0x3c, 0x18},
{0x40, 0xd8, 0xba, 0xaa, 0xaa, 0xbe, 0xdc, 0x40},
{0x00, 0x00, 0x98, 0xba, 0x2a, 0x2a, 0xbe, 0x9c},
{0x00, 0x00, 0x18, 0x3a, 0x2a, 0xaa, 0xbe, 0x9c},
{0x00, 0x00, 0x80, 0x82, 0x3e, 0x3e, 0xa2, 0x80},
{0x00, 0x40, 0xc2, 0xbe, 0xbe, 0xa2, 0xc0, 0x40},
{0x00, 0x00, 0x00, 0x02, 0x3e, 0xbe, 0xa2, 0x80},
{0x00, 0x9e, 0xbe, 0x68, 0x48, 0x68, 0xbe, 0x9e},
{0x00, 0x00, 0x0e, 0x1e, 0xd4, 0xd4, 0x1e, 0x0e},
{0x00, 0x00, 0xa2, 0xaa, 0xaa, 0x3e, 0x3e, 0x22},
{0x2a, 0x2a, 0x3e, 0x3e, 0x2a, 0x2a, 0x2e, 0x04},
{0x00, 0x92, 0xfe, 0xfe, 0x90, 0xd0, 0x7e, 0x3e},
{0x00, 0x00, 0x4c, 0xde, 0x92, 0x92, 0xde, 0x4c},
{0x00, 0x00, 0x4c, 0x5e, 0x12, 0x12, 0x5e, 0x4c},
{0x00, 0x00, 0x0c, 0x1e, 0x12, 0x52, 0x5e, 0x4c},
{0x00, 0x02, 0x5e, 0xde, 0x82, 0x82, 0xde, 0x5c},
{0x00, 0x02, 0x1e, 0x1e, 0x02, 0x42, 0x5e, 0x5c},
{0x00, 0x00, 0x5e, 0x5f, 0x05, 0x05, 0x5d, 0x59},
{0x80, 0x98, 0x3c, 0x66, 0x66, 0x3c, 0x98, 0x80},
{0x00, 0x00, 0xbc, 0xbe, 0x02, 0x02, 0xbe, 0xbc},
{0x00, 0x24, 0x24, 0xe7, 0xe7, 0x24, 0x3c, 0x18},
{0x00, 0x04, 0x66, 0xc2, 0x92, 0xfe, 0x7e, 0x16},
{0x00, 0x00, 0xd4, 0xf4, 0x3f, 0x3f, 0xf4, 0xd4},
{0x05, 0x1f, 0x6f, 0xf4, 0x90, 0x90, 0xff, 0xff},
{0x40, 0xc0, 0x90, 0xfe, 0x7f, 0x11, 0x03, 0x02},
{0x00, 0x02, 0x9e, 0xbe, 0xaa, 0x2a, 0x2e, 0x04},
{0x00, 0x00, 0x00, 0x82, 0xbe, 0xbe, 0x22, 0x00},
{0x00, 0x00, 0x4c, 0x5e, 0x52, 0x12, 0x1e, 0x0c},
{0x00, 0x02, 0x5e, 0x5e, 0x42, 0x02, 0x1e, 0x1c},
{0x00, 0x00, 0x0e, 0x5e, 0x50, 0x50, 0x5e, 0x5e},
{0x00, 0x00, 0xbe, 0xbe, 0x8c, 0x98, 0xbe, 0xbe},
{0x00, 0x14, 0xf4, 0xf4, 0x94, 0xf4, 0x64, 0x00},
{0x00, 0x00, 0x64, 0xf4, 0x94, 0xf4, 0x64, 0x00},
{0x00, 0x00, 0x04, 0x06, 0xa2, 0xb2, 0x1e, 0x0c},
{0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1c, 0x1c},
{0x00, 0x00, 0x1c, 0x1c, 0x10, 0x10, 0x10, 0x10},
{0x89, 0xdd, 0x77, 0x33, 0x18, 0x0c, 0xf6, 0xf2},
{0x9f, 0xdf, 0x6e, 0x36, 0x18, 0x0c, 0xf6, 0xf2},
{0x00, 0x00, 0x00, 0xde, 0xde, 0x00, 0x00, 0x00},
{0x44, 0x6c, 0x38, 0x10, 0x44, 0x6c, 0x38, 0x10},
{0x10, 0x38, 0x6c, 0x44, 0x10, 0x38, 0x6c, 0x44},
{0x00, 0xaa, 0x00, 0x55, 0x00, 0xaa, 0x00, 0x55},
{0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55},
{0xee, 0xff, 0x55, 0xbb, 0xee, 0x55, 0xff, 0xbb},
{0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x08, 0x08},
{0x00, 0x00, 0x00, 0xff, 0xff, 0x28, 0x28, 0x28},
{0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x08, 0x08},
{0x00, 0x0f, 0x0f, 0x08, 0x0f, 0x0f, 0x08, 0x08},
{0x00, 0x00, 0x00, 0x3f, 0x3f, 0x28, 0x28, 0x28},
{0x00, 0xff, 0xff, 0x00, 0xef, 0xef, 0x28, 0x28},
{0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00},
{0x00, 0x3f, 0x3f, 0x20, 0x2f, 0x2f, 0x28, 0x28},
{0x00, 0xf8, 0xf8, 0x08, 0xe8, 0xe8, 0x28, 0x28},
{0x00, 0xf8, 0xf8, 0x08, 0xf8, 0xf8, 0x08, 0x08},
{0x00, 0x00, 0x00, 0xf8, 0xf8, 0x28, 0x28, 0x28},
{0x00, 0x00, 0x00, 0x0f, 0x0f, 0x08, 0x08, 0x08},
{0x08, 0x08, 0x08, 0xf8, 0xf8, 0x00, 0x00, 0x00},
{0x08, 0x08, 0x08, 0xf8, 0xf8, 0x08, 0x08, 0x08},
{0x08, 0x08, 0x08, 0x0f, 0x0f, 0x08, 0x08, 0x08},
{0x08, 0x08, 0x08, 0xff, 0xff, 0x00, 0x00, 0x00},
{0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08},
{0x08, 0x08, 0x08, 0xff, 0xff, 0x08, 0x08, 0x08},
{0x28, 0x28, 0x28, 0xff, 0xff, 0x00, 0x00, 0x00},
{0x08, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00},
{0x28, 0xe8, 0xe8, 0x08, 0xf8, 0xf8, 0x00, 0x00},
{0x28, 0x2f, 0x2f, 0x20, 0x3f, 0x3f, 0x00, 0x00},
{0x28, 0xe8, 0xe8, 0x08, 0xe8, 0xe8, 0x28, 0x28},
{0x28, 0x2f, 0x2f, 0x20, 0x2f, 0x2f, 0x28, 0x28},
{0x28, 0xef, 0xef, 0x00, 0xff, 0xff, 0x00, 0x00},
{0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28},
{0x28, 0xef, 0xef, 0x00, 0xef, 0xef, 0x28, 0x28},
{0x28, 0x28, 0x28, 0xe8, 0xe8, 0x28, 0x28, 0x28},
{0x08, 0xf8, 0xf8, 0x08, 0xf8, 0xf8, 0x08, 0x08},
{0x28, 0x28, 0x28, 0x2f, 0x2f, 0x28, 0x28, 0x28},
{0x08, 0x0f, 0x0f, 0x08, 0x0f, 0x0f, 0x08, 0x08},
{0x08, 0xf8, 0xf8, 0x08, 0xf8, 0xf8, 0x00, 0x00},
{0x28, 0x28, 0x28, 0xf8, 0xf8, 0x00, 0x00, 0x00},
{0x28, 0x28, 0x28, 0x3f, 0x3f, 0x00, 0x00, 0x00},
{0x08, 0x0f, 0x0f, 0x08, 0x0f, 0x0f, 0x00, 0x00},
{0x08, 0xff, 0xff, 0x08, 0xff, 0xff, 0x08, 0x08},
{0x28, 0x28, 0x28, 0xff, 0xff, 0x28, 0x28, 0x28},
{0x00, 0x00, 0x00, 0xf8, 0xf8, 0x08, 0x08, 0x08},
{0x08, 0x08, 0x08, 0x0f, 0x0f, 0x00, 0x00, 0x00},
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
{0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f},
{0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff},
{0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00},
{0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0},
{0x00, 0x22, 0x36, 0x1c, 0x36, 0x22, 0x3e, 0x1c},
{0x00, 0x00, 0x28, 0x7c, 0x54, 0x54, 0x7f, 0x3f},
{0x00, 0x00, 0x60, 0x60, 0x40, 0x40, 0x7e, 0x7e},
{0x00, 0x40, 0x7e, 0x7e, 0x40, 0x7e, 0x7e, 0x40},
{0x00, 0x00, 0xc6, 0xc6, 0x92, 0xba, 0xee, 0xc6},
{0x00, 0x20, 0x20, 0x3c, 0x3e, 0x22, 0x3e, 0x1c},
{0x00, 0x78, 0x7c, 0x04, 0x04, 0x7e, 0x7f, 0x01},
{0x00, 0x40, 0x60, 0x3e, 0x7e, 0x40, 0x60, 0x20},
{0x00, 0x00, 0x99, 0xbd, 0xe7, 0xe7, 0xbd, 0x99},
{0x00, 0x38, 0x7c, 0xd6, 0x92, 0xd6, 0x7c, 0x38},
{0x00, 0x32, 0x7e, 0xce, 0x80, 0xce, 0x7e, 0x32},
{0x00, 0x00, 0x9c, 0xbe, 0xf2, 0x52, 0x1e, 0x0c},
{0x18, 0x3c, 0x24, 0x3c, 0x3c, 0x24, 0x3c, 0x18},
{0x18, 0xbc, 0xe4, 0x7c, 0x3c, 0x26, 0x3f, 0x19},
{0x00, 0x00, 0x00, 0x92, 0x92, 0xd6, 0x7c, 0x38},
{0x00, 0x00, 0x7e, 0xfe, 0x80, 0x80, 0xfe, 0x7e},
{0x00, 0x00, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54},
{0x00, 0x00, 0x22, 0x22, 0xfa, 0xfa, 0x22, 0x22},
{0x00, 0x00, 0x02, 0x22, 0x72, 0xda, 0x8a, 0x02},
{0x00, 0x00, 0x02, 0x8a, 0xda, 0x72, 0x22, 0x02},
{0x60, 0xe0, 0x80, 0xff, 0x7f, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0xfe, 0xff, 0x01, 0x07, 0x06},
{0x00, 0x00, 0x10, 0x10, 0xd6, 0xd6, 0x10, 0x10},
{0x00, 0x48, 0x6c, 0x24, 0x6c, 0x48, 0x6c, 0x24},
{0x00, 0x00, 0x60, 0xf0, 0x90, 0xf0, 0x60, 0x00},
{0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00},
{0x80, 0x80, 0xff, 0xff, 0x03, 0x0e, 0x0c, 0x08},
{0x00, 0x00, 0x78, 0xf8, 0x80, 0xf8, 0xf8, 0x00},
{0x00, 0x00, 0x00, 0x48, 0xe8, 0xb8, 0x98, 0x00},
{0x00, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
}
};
BOOLEAN
@ -739,7 +999,7 @@ Return Value:
}
size_t StrLen = 0;
PCHAR CurChar;
PUCHAR CurChar;
//
// Determine the character length of the string.
@ -846,10 +1106,10 @@ Return Value:
//
// Generate the row'th row of the overlay.
//
CurChar = Text;
CurChar = (PUCHAR) Text;
while( *CurChar )
{
UCHAR CharBase = m_FontData [*CurChar++][row];
UCHAR CharBase = m_FontData [m_Rotation==AcpiPldRotation90][*CurChar++][row];
for (ULONG mask = 0x80; mask && CurSpaceX; mask >>= 1)
{
for (ULONG scale = 0; scale < Scaling && CurSpaceX; scale++)
@ -1029,7 +1289,7 @@ Return Value:
1,
Text,
BLACK,
WHITE
TEXT_COLOR
);
//
@ -1041,9 +1301,25 @@ Return Value:
(m_Height - 28),
1,
Text,
BLACK,
WHITE
TRANSPARENT,
TEXT_COLOR
);
//
// Add a description of the mounting.
//
RtlStringCbPrintfA(Text, sizeof(Text), "%d\370 Mounting", DbgRotation2Degrees(m_Rotation));
size_t len = 0;
RtlStringCchLengthA(Text, sizeof(Text), &len);
OverlayText (
(m_Width - (((ULONG)len*8))), // right-adjust text.
(m_Height - 28),
1,
Text,
TRANSPARENT,
TEXT_COLOR
);
return STATUS_SUCCESS;
}

Просмотреть файл

@ -52,6 +52,8 @@ typedef enum
BLUE,
GREY,
TEXT_COLOR, // Used to offset text
MAX_COLOR,
TRANSPARENT,
@ -113,7 +115,7 @@ class CSynthesizer :
protected:
static
const UCHAR m_FontData [256][8];
const UCHAR m_FontData [2][256][8];
static
const COLOR m_ColorBars[8];
@ -130,6 +132,11 @@ protected:
static
ULONG m_Frame;
// This value is used to fudge a rotated image.
enum
AcpiPldRotation
m_Rotation;
//
// The width and height the synthesizer is set to.
//
@ -224,6 +231,7 @@ public:
, m_SynthesisTime(0)
, m_CommitCount(0)
, m_CommitTime(0)
, m_Rotation(AcpiPldRotation0)
{
m_Length = Height * m_SynthesisStride;
KeQueryPerformanceCounter(&m_Frequency);
@ -459,6 +467,12 @@ public:
m_Frame = Frame;
}
void
SetRotation( AcpiPldRotation Rotation )
{
m_Rotation = Rotation;
}
//
// GetChannelMask
//

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -205,7 +205,7 @@ const ExposurePresetStruct ExposurePresets[] =
{ 6, 640000000 },// 64s -> 64 * 10000000 (100 ns)
{ 7, 1280000000 },// 128s -> 128 * 10000000 (100 ns)
{ 8, 2560000000 },// 256s -> 256 * 10000000 (100 ns)
{ 9, 3600000000 },// 512s -> 512 * 10000000 (100 ns) (Max is 360 s)
{ 9, 3600000000 } // 512s -> 512 * 10000000 (100 ns) (Max is 360 s)
};
const ExposurePresetStruct ExposureMidpoints[] =
@ -229,7 +229,7 @@ const ExposurePresetStruct ExposureMidpoints[] =
{ 6, 905096680 },// 2^(6.5) -> 90.50966799
{ 7, 1810193360 },// 2^(7.5) -> 181.0193360
{ 8, 3080000000 },// Halfway between 8 and Max: 30800
{ 9, 3600000000 },// Above
{ 9, 3600000000 } // Above
};
BOOL
@ -239,13 +239,9 @@ ExposureBinaryLogIsValid(
{
PAGED_CODE();
if( ExposurePresets[0].exposureBinaryLog > ExposureBL ||
ExposurePresets[_countof(ExposurePresets) - 1].exposureBinaryLog < ExposureBL )
{
return FALSE;
}
return TRUE;
return
ExposurePresets[0].exposureBinaryLog <= ExposureBL &&
ExposurePresets[_countof(ExposurePresets) - 1].exposureBinaryLog >= ExposureBL;
}
// Changes a Legacy Preset value into 100 ns units for Exposure. If the
@ -257,7 +253,7 @@ ExposureBinaryLogTo100ns(
{
PAGED_CODE( );
for (LONG i = 0; i < _countof(ExposurePresets) - 1; i++)
for( LONG i = 0; i < _countof(ExposurePresets); i++ )
{
if (ExposureBL == ExposurePresets[i].exposureBinaryLog)
{
@ -275,7 +271,7 @@ Exposure100nsToBinaryLog(
{
PAGED_CODE( );
for(LONG i = 0; i < _countof(ExposureMidpoints) - 1; i++)
for( LONG i = 0; i < _countof(ExposureMidpoints) - 1; i++ )
{
if(Exposure100ns <= ExposureMidpoints[i].exposure100ns)
{
@ -474,3 +470,22 @@ Return Value:
return FALSE;
}
int
DbgRotation2Degrees(
AcpiPldRotation r
)
{
switch( r )
{
case AcpiPldRotation0 : return 0;
case AcpiPldRotation45 : return 45;
case AcpiPldRotation90 : return 90;
case AcpiPldRotation135: return 135;
case AcpiPldRotation180: return 180;
case AcpiPldRotation225: return 225;
case AcpiPldRotation270: return 270;
case AcpiPldRotation315: return 315;
}
return -1;
}

Просмотреть файл

@ -259,6 +259,15 @@ FocusStateDbgTxt(
_In_ KSCAMERA_EXTENDEDPROP_FOCUSSTATE State
);
//
// Debugging Helper - translate ACPI rotation enum to degrees.
//
int
DbgRotation2Degrees(
AcpiPldRotation r
);
#define SAFE_FREE(_x_) \
if( _x_ ) \
{ \

Просмотреть файл

@ -0,0 +1,130 @@
/**************************************************************************
A/V Stream Camera Sample
Copyright (c) 2001, Microsoft Corporation.
File:
videocapture.cpp
Abstract:
Video Capture Pin implementation.
Handles construction and defines pin data ranges.
History:
created 3/8/2001
**************************************************************************/
#include "Common.h"
#include "ntintsafe.h"
#ifdef ALLOC_PRAGMA
#pragma code_seg("PAGE")
#endif // ALLOC_PRAGMA
CVideoCapturePin::CVideoCapturePin(IN PKSPIN Pin) :
CCapturePin (Pin)
{
PAGED_CODE();
}
/*************************************************
Routine Description:
Create a new capture pin. This is the creation dispatch for
the video capture pin.
Arguments:
Pin -
The pin being created
Irp -
The creation Irp
Return Value:
Success / Failure
**************************************************/
NTSTATUS
CVideoCapturePin::
DispatchCreate(
IN PKSPIN Pin,
IN PIRP Irp
)
{
PAGED_CODE();
DBG_ENTER("(Pin=%d)", Pin->Id);
NTSTATUS Status = STATUS_SUCCESS;
CCaptureFilter* pFilter = reinterpret_cast <CCaptureFilter*>(KsPinGetParentFilter(Pin)->Context);
CVideoCapturePin *CapPin = new (NonPagedPoolNx) CVideoCapturePin (Pin);
if( !CapPin )
{
// Fail if we couldn't create the pin.
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else
{
Status =
CapPin->Initialize();
}
if( NT_SUCCESS (Status) )
{
//
// Adjust the stream header size. The video packets have extended
// header info (KS_FRAME_INFO).
//
pFilter->setPin(CapPin, Pin->Id);
}
else
{
// Clean up.
delete CapPin;
}
DBG_LEAVE("(Pin=%d)=0x%08X", Pin->Id, Status);
return Status;
}
//
// CapturePinDispatch:
//
// This is the dispatch table for the capture pin. It provides notifications
// about creation, closure, processing, data formats, etc...
//
DEFINE_CAMERA_KSPIN_DISPATCH( VideoCapturePinDispatch, CVideoCapturePin );
//
// CapturePinAllocatorFraming:
//
// This is the simple framing structure for the capture pin. Note that this
// will be modified via KsEdit when the actual capture format is determined.
//
DECLARE_SIMPLE_FRAMING_EX(
VideoCapturePinAllocatorFraming,
STATICGUIDOF( KSMEMORY_TYPE_KERNEL_NONPAGED ),
KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY |
KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY,
2,
0,
2 * PAGE_SIZE,
2 * PAGE_SIZE
);

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -167,7 +167,8 @@ Return Value:
{255, 0, 255}, // MAGENTA
{0, 0, 255}, // RED
{255, 0, 0}, // BLUE
{128, 128, 128} // GREY
{128, 128, 128}, // GREY
{255, 255, 255}, // TEXT_COLOR
};
return Colors;

Просмотреть файл

@ -68,6 +68,7 @@ Return Value:
{90, 81, 240}, // RED
{240, 41, 109}, // BLUE
{128, 125, 128}, // GREY
{128, 235, 128} // TEXT_COLOR
};
return Colors;

Просмотреть файл

Двоичный файл не отображается.

Просмотреть файл

@ -645,6 +645,10 @@ SetPhotoMode(
{
CExtendedPhotoMode Caps(*pMode);
Status = m_Sensor->GetPhotoMode( &Caps );
CCapturePin *pPin = getPin(pMode->PinId);
// Should always be valid.
NT_ASSERT(pPin);
if( NT_SUCCESS(Status) )
{
@ -682,35 +686,47 @@ SetPhotoMode(
// Assume the normal photo sequence case.
// For normal photo sequence, we provide history frames +1 or at least a minimum of 3 frames.
ULONG TotalFrames = max( (Caps.RequestedHistoryFrames() + 1), IMAGE_CAPTURE_PIN_MINIMUM_FRAMES );
ULONG TotalFrames = pMode->RequestedHistoryFrames() + 1;
// Modify TotalFrames for the VPS case.
// For VPS, we need LoopCount * FrameCount; but limit by the minimum(3) and maximum (20) frames.
if( KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE_SUB_VARIABLE==pMode->SubMode() )
{
// Assume at least one loop, if the loop is infinite.
ULONG LoopCount = max( pPFS->LoopCount, 1 );
ULONG FrameCount= pPFS->FrameCount;
TotalFrames = max( IMAGE_CAPTURE_PIN_MINIMUM_FRAMES, Caps.RequestedHistoryFrames() + (LoopCount * FrameCount) );
ASSERT( TotalFrames <= IMAGE_CAPTURE_PIN_MAXIMUM_FRAMES );
// Add in the number of future frames expected.
TotalFrames+= (LoopCount * FrameCount) -1;
DBG_TRACE( "TotalFrames=%d, LoopCount=%d, FrameCount=%d", TotalFrames, LoopCount, FrameCount );
}
TotalFrames = min( TotalFrames, IMAGE_CAPTURE_PIN_MAXIMUM_FRAMES );
// Bound the frame count to minimum and maximums.
TotalFrames =
min( max( TotalFrames, IMAGE_CAPTURE_PIN_MINIMUM_FRAMES ), IMAGE_CAPTURE_PIN_MAXIMUM_FRAMES );
DBG_TRACE( "Advertising Framing requirement: %d", TotalFrames );
Status = UpdateAllocatorFraming( pMode->PinId );
pPin->SetDesiredFrames(TotalFrames);
Status = STATUS_SUCCESS;
break;
}
case KSCAMERA_EXTENDEDPROP_PHOTOMODE_NORMAL:
{
// Set it back to 4 frames.
Status = UpdateAllocatorFraming( pMode->PinId );
// Set it back to the minimum number of frames.
pPin->SetDesiredFrames(IMAGE_CAPTURE_PIN_MINIMUM_FRAMES);
Status = STATUS_SUCCESS;
break;
}
}
// Update allocator framing.
if( NT_SUCCESS( Status ) )
{
Status = UpdateAllocatorFraming( pMode->PinId );
}
// Update the sensor object...
if( NT_SUCCESS(Status) )
{
@ -745,7 +761,7 @@ CCaptureFilter::GetPhotoFrameRate(
if( pFrameRate->isValid() &&
m_Sensor->IsStillIndex(pFrameRate->PinId) )
{
ULONGLONG TimePerFrame = m_Sensor->GetPhotoFrameRate( );
ULONGLONG TimePerFrame = m_Sensor->GetPhotoFrameRate(pFrameRate->PinId);
if( TimePerFrame > ULONG_MAX )
{
// Handle very large (slow) frame rates in seconds.
@ -2296,6 +2312,7 @@ Return Value:
BufferLimit == 0 ||
pPFS->Size > BufferLimit ||
pPFS->Size < sizeof(KSCAMERA_PERFRAMESETTING_HEADER) ||
pPFS->LoopCount!=1 || // Hard-coded to 1, per spec.
pPFS->FrameCount > MAX_FRAME_COUNT ||
pPFS->FrameCount == 0 )
{
@ -2993,7 +3010,7 @@ GetVFR(
Status = m_Sensor->GetVFR( pVFR );
}
DBG_LEAVE("PinId=%u, VideoIndex=%u, Flags=0x%016llX, Version=%u, Status=0x%08X",
pVFR->PinId, m_Sensor->GetVideoIndex(), pVFR->Flags, pVFR->Version, Status);
pVFR->PinId, m_Sensor->GetNextVideoIndex(), pVFR->Flags, pVFR->Version, Status);
return Status;
}
@ -3019,7 +3036,7 @@ SetVFR(
Status = m_Sensor->SetVFR( pVFR );
}
DBG_LEAVE("PinId=%u, VideoIndex=%u, Flags=0x%016llX, Version=%u, Status=0x%08X",
pVFR->PinId, m_Sensor->GetVideoIndex(), pVFR->Flags, pVFR->Version, Status);
pVFR->PinId, m_Sensor->GetNextVideoIndex(), pVFR->Flags, pVFR->Version, Status);
return Status;
}
@ -3041,7 +3058,7 @@ GetVideoHDR(
Status = m_Sensor->GetVideoHDR(pVideoHDR);
}
DBG_LEAVE("PinId=%u, VideoIndex=%u, Flags=0x%016llX, Version=%u, Status=0x%08X",
pVideoHDR->PinId, m_Sensor->GetVideoIndex(), pVideoHDR->Flags, pVideoHDR->Version, Status);
pVideoHDR->PinId, m_Sensor->GetNextVideoIndex(), pVideoHDR->Flags, pVideoHDR->Version, Status);
return Status;
}
@ -3064,7 +3081,8 @@ SetVideoHDR(
KSCAMERA_EXTENDEDPROP_VIDEOHDR_ON == pVideoHDR->Flags ||
KSCAMERA_EXTENDEDPROP_VIDEOHDR_AUTO== pVideoHDR->Flags) )
{
if( m_pinArray[pVideoHDR->PinId]->GetState() == PinStopped )
if( !m_pinArray[pVideoHDR->PinId] ||
m_pinArray[pVideoHDR->PinId]->GetState() == PinStopped )
{
CExtendedProperty Caps(*pVideoHDR);
Status = m_Sensor->GetVideoHDR( &Caps );
@ -3088,7 +3106,7 @@ SetVideoHDR(
}
DBG_LEAVE("PinId=%u, VideoIndex=%u, Flags=0x%016llX, Version=%u, Status=0x%08X",
pVideoHDR->PinId, m_Sensor->GetVideoIndex(), pVideoHDR->Flags, pVideoHDR->Version, Status);
pVideoHDR->PinId, m_Sensor->GetNextVideoIndex(), pVideoHDR->Flags, pVideoHDR->Version, Status);
return Status;
}
@ -3111,7 +3129,7 @@ GetHistogram(
Status = m_Sensor->GetHistogram( pHistogram );
}
DBG_TRACE("pHistogram->PinId = %u, m_sensor->PreviewIndex = %u, pHistogram->Flags = %016llx, pHistogram->Version = %u",
pHistogram->PinId, m_Sensor->GetPreviewIndex(), pHistogram->Flags, pHistogram->Version);
pHistogram->PinId, m_Sensor->GetNextPreviewIndex(), pHistogram->Flags, pHistogram->Version);
return Status;
}
@ -3144,7 +3162,7 @@ SetHistogram(
}
DBG_TRACE("pHistogram->PinId = %u, m_sensor->PreviewIndex = %u, pHistogram->Flags = %016llx, pHistogram->Version = %u",
pHistogram->PinId, m_Sensor->GetPreviewIndex(), pHistogram->Flags, pHistogram->Version);
pHistogram->PinId, m_Sensor->GetNextPreviewIndex(), pHistogram->Flags, pHistogram->Version);
return Status;
}
@ -3347,7 +3365,7 @@ SetVideoStabilization(
}
}
DBG_TRACE("pVideoStab = %p, PinId = %u, m_sensor->VideoIndex = %u, Flags = %llu, Version = %u",
pVideoStab, pVideoStab->PinId, m_Sensor->GetVideoIndex(), pVideoStab->Flags, pVideoStab->Version);
pVideoStab, pVideoStab->PinId, m_Sensor->GetNextVideoIndex(), pVideoStab->Flags, pVideoStab->Version);
return Status;
}
@ -3554,7 +3572,7 @@ SetExposure(
)
{
PAGED_CODE();
DBG_ENTER("()");
DBG_ENTER("(Property->Value=%d)", pProperty->Value);
NTSTATUS Status = m_Sensor->SetExposure(pProperty);
@ -4016,14 +4034,15 @@ SetVideoControlMode(
if( m_Sensor->IsStillIndex(pMode->StreamIndex) )
{
KSPROPERTY_VIDEOCONTROL_MODE_S Caps;
KSPROPERTY_VIDEOCONTROL_CAPS_S Caps;
RtlZeroMemory( &Caps, sizeof(Caps) );
Caps.StreamIndex = pMode->StreamIndex;
Status = m_Sensor->GetVideoControlMode( &Caps );
if( NT_SUCCESS(Status) )//&&
// pMode->Mode == (pMode->Mode & Caps.Mode) )
Status = m_Sensor->GetVideoControlCaps( &Caps );
if( NT_SUCCESS(Status) &&
pMode->Mode == (pMode->Mode & (LONG)Caps.VideoControlCaps ) )
{
DBG_TRACE("Mode=0x%08X, Caps.Mode=0x%08X", pMode->Mode, Caps.Mode);
DBG_TRACE("Mode=0x%08X, Caps.Mode=0x%08X", pMode->Mode, Caps.VideoControlCaps);
Status = m_Sensor->SetVideoControlMode( pMode );
}
else
@ -4037,3 +4056,25 @@ SetVideoControlMode(
return Status;
}
// Get KSPROPERTY_VIDEOCONTROL_CAPS.
NTSTATUS
CCaptureFilter::
GetVideoControlCaps(
_Inout_ KSPROPERTY_VIDEOCONTROL_CAPS_S *pCaps
)
{
PAGED_CODE();
DBG_ENTER("()");
NTSTATUS Status = STATUS_INVALID_PARAMETER;
if( m_Sensor->IsValidIndex(pCaps->StreamIndex) )
{
Status = m_Sensor->GetVideoControlCaps( pCaps );
}
DBG_LEAVE("( Pin=%d, Caps=0x%08X )=0x%08X",
pCaps->StreamIndex, pCaps->VideoControlCaps, Status );
return Status;
}

Просмотреть файл

@ -343,6 +343,7 @@ DECLARE_PROPERTY_SET_HANDLER( type, name )
DECLARE_PROPERTY_GET_HANDLER( CRoiConfig, RoiConfigCaps );
DECLARE_PROPERTY_HANDLERS(KSPROPERTY_VIDEOCONTROL_MODE_S, VideoControlMode);
DECLARE_PROPERTY_GET_HANDLER(KSPROPERTY_VIDEOCONTROL_CAPS_S, VideoControlCaps);
//
// The following are property handlers that use an atypical variable

Просмотреть файл

@ -0,0 +1,390 @@
/**************************************************************************
A/V Stream Camera Sample
Copyright (c) 2001, Microsoft Corporation.
File:
Formats.cpp
Abstract:
A list of available Image and Video formats.
History:
created 2/12/2016
**************************************************************************/
#include "Common.h"
#include "ntintsafe.h"
#ifdef ALLOC_PRAGMA
#pragma code_seg("PAGE")
#endif // ALLOC_PRAGMA
/**************************************************************************
DISPATCH AND DESCRIPTOR LAYOUT
**************************************************************************/
DEFINE_DATARANGE_VIDEO(
FormatNV12_CaptureVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_NV12),
DMAX_X, DMAX_Y,
30,
1,
12,
FOURCC_NV12)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureQVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
D_X, D_Y,
30,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureQVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
D_X_OS, D_Y_OS,
30,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X, DMAX_Y,
30,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X_OS, DMAX_Y_OS,
30,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureQVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
D_X, D_Y,
30,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureQVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
D_X_OS, D_Y_OS,
30,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X, DMAX_Y,
30,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X_OS, DMAX_Y_OS,
30,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_60fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X, DMAX_Y,
60,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_60fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X_OS, DMAX_Y_OS,
60,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_60fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X, DMAX_Y,
60,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_60fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X_OS, DMAX_Y_OS,
60,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_90fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X, DMAX_Y,
90,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_90fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X_OS, DMAX_Y_OS,
90,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_90fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X, DMAX_Y,
90,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_90fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X_OS, DMAX_Y_OS,
90,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_120fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X, DMAX_Y,
120,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatYUY2_CaptureVGA_120fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_YUY2),
DMAX_X_OS, DMAX_Y_OS,
120,
1,
16,
FOURCC_YUY2)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_120fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X, DMAX_Y,
120,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB24Bpp_CaptureVGA_120fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB24),
DMAX_X_OS, DMAX_Y_OS,
120,
1,
24,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X, DMAX_Y,
30,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X_OS, DMAX_Y_OS,
30,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_60fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X, DMAX_Y,
60,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_60fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X_OS, DMAX_Y_OS,
60,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_90fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X, DMAX_Y,
90,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_90fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X_OS, DMAX_Y_OS,
90,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_120fps,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X, DMAX_Y,
120,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureVGA_120fpsOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
DMAX_X_OS, DMAX_Y_OS,
120,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureQVGA,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
D_X, D_Y,
30,
1,
32,
KS_BI_RGB)
DEFINE_DATARANGE_VIDEO(
FormatRGB32Bpp_CaptureQVGAOverscan,
STATICGUIDOF(KSDATAFORMAT_SUBTYPE_RGB32),
D_X_OS, D_Y_OS,
30,
1,
32,
KS_BI_RGB)
//
// CapturePinDataRanges:
//
// This is the list of data ranges supported on the capture pin. We support
// two: one RGB24, and one YUY2.
//
const
PKSDATARANGE
ImageCapturePinDataRanges[ IMAGE_CAPTURE_PIN_DATA_RANGE_COUNT ] =
{
(PKSDATARANGE) &FormatYUY2_CaptureVGA,
(PKSDATARANGE) &FormatNV12_CaptureVGA
};
//
// CapturePinDataRanges:
//
// This is the list of data ranges supported on the capture pin. We support
// RGB24, YUY2, and RGB32
//
const
PKSDATARANGE
VideoCapturePinDataRanges [VIDEO_CAPTURE_PIN_DATA_RANGE_COUNT] =
{
(PKSDATARANGE) &FormatYUY2_CaptureQVGA,
(PKSDATARANGE) &FormatYUY2_CaptureQVGAOverscan,
(PKSDATARANGE) &FormatYUY2_CaptureVGA,
(PKSDATARANGE) &FormatYUY2_CaptureVGAOverscan,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureQVGA,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureQVGAOverscan,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGAOverscan,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_60fps,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_60fpsOverscan,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_60fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_60fpsOverscan,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_90fps,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_90fpsOverscan,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_90fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_90fpsOverscan,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_120fps,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_120fpsOverscan,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_120fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_120fpsOverscan,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGAOverscan,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_60fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_60fpsOverscan,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_90fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_90fpsOverscan,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_120fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_120fpsOverscan,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureQVGA,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureQVGAOverscan,
};
const
PKSDATARANGE
VideoPreviewPinDataRanges[VIDEO_PREVIEW_PIN_DATA_RANGE_COUNT] =
{
(PKSDATARANGE) &FormatYUY2_CaptureQVGA,
(PKSDATARANGE) &FormatYUY2_CaptureVGA,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureQVGA,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_60fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_60fps,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_90fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_90fps,
(PKSDATARANGE) &FormatYUY2_CaptureVGA_120fps,
(PKSDATARANGE) &FormatRGB24Bpp_CaptureVGA_120fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_60fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_90fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureVGA_120fps,
(PKSDATARANGE) &FormatRGB32Bpp_CaptureQVGA,
};

Просмотреть файл

@ -0,0 +1,137 @@
/**************************************************************************
A/V Stream Camera Sample
Copyright (c) 2001, Microsoft Corporation.
File:
Formats.h
Abstract:
A list of available Image and Video formats.
History:
created 2/12/2016
**************************************************************************/
#pragma once
#include "capture.h"
#define DEFINE_DATARANGE_VIDEO(_RANGE_NAME_, _Subtype_, _X_, _Y_, _Rate_, _Planes_, _BitCount_, _Compression_) \
const \
KS_DATARANGE_VIDEO \
_RANGE_NAME_ = \
{ \
\
/* \
// KSDATARANGE \
*/ \
{ \
sizeof( KS_DATARANGE_VIDEO ), /* FormatSize */ \
0, /* Flags */ \
ULONG((ULONGLONG(_X_) *_Y_ * _BitCount_)/8),/* SampleSize */ \
0, /* Reserved */ \
\
STATICGUIDOF( KSDATAFORMAT_TYPE_VIDEO ), /* aka. MEDIATYPE_Video */ \
_Subtype_, /* aka. MEDIASUBTYPE_RGB24, */ \
STATICGUIDOF( KSDATAFORMAT_SPECIFIER_VIDEOINFO ) /* aka. FORMAT_VideoInfo */ \
}, \
\
TRUE, /* BOOL, bFixedSizeSamples (all samples same size?) */ \
FALSE, /* BOOL, bTemporalCompression (all I frames?) */ \
0, /* Reserved (was StreamDescriptionFlags) */ \
0, /* Reserved (was MemoryAllocationFlags */ \
/* (KS_VIDEO_ALLOC_*)) */ \
/* */ \
/* _KS_VIDEO_STREAM_CONFIG_CAPS */ \
/* */ \
{ \
STATICGUIDOF( KSDATAFORMAT_SPECIFIER_VIDEOINFO ), /* GUID */ \
KS_AnalogVideo_None, /* AnalogVideoStandard */ \
_X_,_Y_, /* InputSize, (the inherent size of the incoming signal */ \
/* with every digitized pixel unique) */ \
_X_,_Y_, /* MinCroppingSize, smallest rcSrc cropping rect allowed */ \
_X_,_Y_, /* MaxCroppingSize, largest rcSrc cropping rect allowed */ \
8, /* CropGranularityX, granularity of cropping size */ \
1, /* CropGranularityY */ \
8, /* CropAlignX, alignment of cropping rect */ \
1, /* CropAlignY; */ \
_X_, _Y_, /* MinOutputSize, smallest bitmap stream can produce */ \
_X_, _Y_, /* MaxOutputSize, largest bitmap stream can produce */ \
8, /* OutputGranularityX, granularity of output bitmap size */ \
1, /* OutputGranularityY; */ \
0, /* StretchTapsX (0 no stretch, 1 pix dup, 2 interp...) */ \
0, /* StretchTapsY */ \
0, /* ShrinkTapsX */ \
0, /* ShrinkTapsY */ \
(ONESECOND / _Rate_), /* MinFrameInterval, 100 nS units */ \
640000000, /* MaxFrameInterval, 100 nS units */ \
ULONG(min(ULONG_MAX,(ULONGLONG(_X_) *_Y_ * _BitCount_)*_Rate_)),/* MinBitsPerSecond;*/ \
ULONG(min(ULONG_MAX,(ULONGLONG(_X_) *_Y_ * _BitCount_)*_Rate_)) /* MaxBitsPerSecond;*/ \
}, \
\
/* \
// KS_VIDEOINFOHEADER (default format) \
*/ \
{ \
0,0,0,0, /* RECT rcSource; */ \
0,0,0,0, /* RECT rcTarget; */ \
ULONG(min(ULONG_MAX,(ULONGLONG(_X_) *_Y_ * _BitCount_)*_Rate_)),/* DWORD dwBitRate;*/ \
0L, /* DWORD dwBitErrorRate; */ \
(ONESECOND / _Rate_), /* REFERENCE_TIME AvgTimePerFrame; */ \
sizeof( KS_BITMAPINFOHEADER ), /* DWORD biSize; */ \
_X_, /* LONG biWidth; */ \
_Y_, /* LONG biHeight; */ \
_Planes_, /* WORD biPlanes; */ \
_BitCount_, /* WORD biBitCount; */ \
_Compression_, /* DWORD biCompression; */ \
ULONG((ULONGLONG(_X_) *_Y_ * _BitCount_)/8),/* DWORD biSizeImage; */ \
0, /* LONG biXPelsPerMeter; */ \
0, /* LONG biYPelsPerMeter; */ \
0, /* DWORD biClrUsed; */ \
0 /* DWORD biClrImportant; */ \
} \
}; \
extern const KS_DATARANGE_VIDEO FormatYUY2Image_Capture;
extern const KS_DATARANGE_VIDEO FormatNV12Image_Capture;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureQVGA;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureQVGAOverscan;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGAOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureQVGA;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureQVGAOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGAOverscan;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_60fps;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_60fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_60fps;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_60fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_90fps;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_90fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_90fps;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_90fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_120fps;
extern const KS_DATARANGE_VIDEO FormatYUY2_CaptureVGA_120fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_120fps;
extern const KS_DATARANGE_VIDEO FormatRGB24Bpp_CaptureVGA_120fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGAOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_60fps;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_60fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_90fps;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_90fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_120fps;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureVGA_120fpsOverscan;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureQVGA;
extern const KS_DATARANGE_VIDEO FormatRGB32Bpp_CaptureQVGAOverscan;
extern const PKSDATARANGE VideoCapturePinDataRanges[VIDEO_CAPTURE_PIN_DATA_RANGE_COUNT];
extern const PKSDATARANGE VideoPreviewPinDataRanges[VIDEO_PREVIEW_PIN_DATA_RANGE_COUNT];
extern const PKSDATARANGE ImageCapturePinDataRanges[IMAGE_CAPTURE_PIN_DATA_RANGE_COUNT];

Просмотреть файл

@ -1117,7 +1117,14 @@ DVS_Text( ULONGLONG Flags )
case KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_OFF: return "Off";
case KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_ON: return "On";
case KSCAMERA_EXTENDEDPROP_VIDEOSTABILIZATION_AUTO: return "Auto";
default: return "Unknown";
default:
{
static
CHAR buffer[32];
RtlStringCbPrintfA(buffer, sizeof(buffer), "Unknown [0x%016llX]", Flags);
return (PCCHAR) buffer;
}
}
}
@ -1131,7 +1138,14 @@ OIS_Text( ULONGLONG Flags )
case KSCAMERA_EXTENDEDPROP_OIS_OFF: return "Off";
case KSCAMERA_EXTENDEDPROP_OIS_ON: return "On";
case KSCAMERA_EXTENDEDPROP_OIS_AUTO: return "Auto";
default: return "Unknown";
default:
{
static
CHAR buffer[32];
RtlStringCbPrintfA(buffer, sizeof(buffer), "Unknown [0x%016llX]", Flags);
return (PCCHAR) buffer;
}
}
}
@ -1191,11 +1205,11 @@ Return Value:
CExtendedProperty Control;
m_Sensor->GetVideoStabilization( &Control );
RtlStringCbPrintfA(Text, sizeof(Text), "DVS: %s", DVS_Text(Control.Flags));
m_Synthesizer->OverlayText( 0, m_Height-38, 1, Text, BLACK, WHITE );
m_Synthesizer->OverlayText( 0, m_Height-38, 1, Text, TRANSPARENT, TEXT_COLOR );
m_Sensor->GetOpticalImageStabilization( &Control );
RtlStringCbPrintfA(Text, sizeof(Text), "OIS: %s", OIS_Text(Control.Flags));
m_Synthesizer->OverlayText( 0, m_Height-48, 1, Text, BLACK, WHITE );
m_Synthesizer->OverlayText( 0, m_Height-48, 1, Text, TRANSPARENT, TEXT_COLOR );
//
// Fill scatter gather buffers

Просмотреть файл

Просмотреть файл

@ -0,0 +1,155 @@
/**************************************************************************
A/V Stream Camera Sample
Copyright (c) 2001, Microsoft Corporation.
File:
imagecapture.cpp
Abstract:
An implementation of CImageCapturePin
History:
created 3/8/2001
**************************************************************************/
#include "Common.h"
#ifdef ALLOC_PRAGMA
#pragma code_seg("PAGE")
#endif // ALLOC_PRAGMA
CImageCapturePin::
CImageCapturePin(
_In_ PKSPIN Pin
) : CCapturePin (Pin)
{
PAGED_CODE();
}
NTSTATUS
CImageCapturePin::
DispatchCreate(
_In_ PKSPIN Pin,
_In_ PIRP Irp
)
/*++
Routine Description:
Static member function called when a pin is created. Instantiate a
CImageCapturePin and attach it to our filter object.
Arguments:
Pin -
The KSPIN to wrap.
Irp -
The IRP assocated with this request.
Return Value:
Success / Failure
--*/
{
PAGED_CODE();
DBG_ENTER("(Pin=%d)", Pin->Id);
NTSTATUS Status = STATUS_SUCCESS;
CCaptureFilter* pFilter = reinterpret_cast <CCaptureFilter*>(KsPinGetParentFilter(Pin)->Context);
CImageCapturePin *CapPin = new (NonPagedPoolNx) CImageCapturePin (Pin);
if( !CapPin )
{
// Fail if we couldn't create the pin.
Status = STATUS_INSUFFICIENT_RESOURCES;
}
else
{
// Query the filter for the PhotoMode so we can figure out how many frames should be allocated.
CExtendedPhotoMode Mode;
Mode.PinId = Pin->Id; // Use Pin ID from KS.
Status = pFilter->GetPhotoMode( &Mode );
// CSensor::GetPhotoMode could fail if the framework gives us a Pin ID that doesn't match our descriptors...
if( NT_SUCCESS(Status) )
{
// Override the number of frames.
CapPin->SetDesiredFrames(
( (Mode.Flags & KSCAMERA_EXTENDEDPROP_PHOTOMODE_SEQUENCE) ?
Mode.RequestedHistoryFrames() : 1)
+ IMAGE_CAPTURE_PIN_MINIMUM_FRAMES );
Status =
CapPin->Initialize();
}
}
if (NT_SUCCESS (Status))
{
//
// Adjust the stream header size. The video packets have extended
// header info (KS_FRAME_INFO).
//
pFilter->setPin(CapPin, Pin->Id);
}
else
{
// Clean up.
delete CapPin;
}
DBG_LEAVE("(Pin=%d)=0x%08X", Pin->Id, Status);
return Status;
}
NTSTATUS
CImageCapturePin::
Close(
_In_ PIRP Irp
)
{
PAGED_CODE();
Reset();
return STATUS_SUCCESS;
}
// ImageCapturePinDispatch:
//
// This is the dispatch table for the capture pin. It provides notifications
// about creation, closure, processing, data formats, etc...
// just a copy of CapturePinDispatch for now.
//
DEFINE_CAMERA_KSPIN_DISPATCH( ImageCapturePinDispatch, CImageCapturePin );
//
// ImagePinAllocatorFraming:
//
// This is the simple framing structure for the capture pin. Note that this
// will be modified via KsEdit when the actual capture format is determined.
// just a copy of CapturePinAllocatorFraming for now.
//
DECLARE_SIMPLE_FRAMING_EX (
ImageCapturePinAllocatorFraming,
STATICGUIDOF (KSMEMORY_TYPE_KERNEL_NONPAGED),
KSALLOCATOR_REQUIREMENTF_SYSTEM_MEMORY |
KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY,
4,
0,
2 * PAGE_SIZE,
2 * PAGE_SIZE
);

Просмотреть файл

Просмотреть файл

@ -296,6 +296,43 @@ Return Value:
}
LONG
CImageHardwareSimulation::
GetTriggerMode()
/*++
Returns the pin's current trigger mode and state:
Return Value:
mode -
Normal trigger, start or stop photo sequence.
--*/
{
PAGED_CODE();
NTSTATUS status = STATUS_SUCCESS;
LONG mode = 0;
DBG_ENTER( "(), m_PinMode=%d", m_PinMode );
KScopedMutex Lock( m_ListLock );
if( m_bTriggered )
{
mode = (m_PinMode == PinBurstMode) ?
KS_VideoControlFlag_StartPhotoSequenceCapture :
KS_VideoControlFlag_Trigger;
}
DBG_LEAVE("()=0x%08X", mode);
return mode;
}
NTSTATUS
CImageHardwareSimulation::
SetMode(
@ -841,6 +878,41 @@ Return Value:
}
}
/**************************************************************************
Debug helpers
**************************************************************************/
PCCHAR
AdvancedPhoto_Text( ULONGLONG Flags )
{
PAGED_CODE();
switch( Flags )
{
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_OFF: return "Off";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO: return "Auto";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_HDR: return "HDR";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_FNF: return "FNF";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_ULTRALOWLIGHT: return "UltraLL";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_HDR: return "Auto|HDR";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_FNF: return "Auto|FNF";
case KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_AUTO |
KSCAMERA_EXTENDEDPROP_ADVANCEDPHOTO_ULTRALOWLIGHT: return "Auto|UltraLL";
default:
{
static
CHAR buffer[32];
RtlStringCbPrintfA(buffer, sizeof(buffer), "Unknown [0x%016llX]", Flags);
return (PCCHAR) buffer;
}
}
}
/*************************************************/
void
@ -886,6 +958,13 @@ Return Value:
m_Synthesizer->DoSynthesize();
CHAR Text[64];
CExtendedProperty Control;
m_Sensor->GetAdvancedPhoto(&Control);
RtlStringCbPrintfA(Text, sizeof(Text), "Adv: %s", AdvancedPhoto_Text(Control.Flags));
m_Synthesizer->OverlayText( 0, m_Height-38, 1, Text, TRANSPARENT, WHITE );
//
// Fill scatter gather buffers
//

Просмотреть файл

@ -126,7 +126,10 @@ public:
_In_ LONG mode
);
// Limit the rate of frames produced.
LONG
GetTriggerMode();
// Limit the rate of frames produced.
virtual
NTSTATUS
SetPhotoFrameRate (

Просмотреть файл

@ -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,27 +18,6 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KeywordDetectorAdapter\KeywordDetectorContosoAdapter.vcxproj">
<Project>{92E28772-ADE3-4367-B679-6DCF6FFA75F1}</Project>
</ProjectReference>
<ProjectReference Include="..\PhoneAudioSample\PhoneAudioSample.vcxproj">
<Project>{43FF11E5-B4C4-409A-AE4B-13342918B6F8}</Project>
</ProjectReference>
<ProjectReference Include="..\SwapAPO\APO\SwapAPO.vcxproj">
<Project>{2A1B7375-D9CB-4067-AEDE-180D75B5934D}</Project>
</ProjectReference>
<ProjectReference Include="..\SwapAPO\PropPageExtensions\PropPageExt.vcxproj">
<Project>{76DBA957-38F6-47ED-A5C0-AD587D08FF12}</Project>
</ProjectReference>
<ProjectReference Include="..\TabletAudioSample\TabletAudioSample.vcxproj">
<Project>{29A5DD25-AB56-4DEE-96AB-21EC2926A300}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\phoneaudiosample.inf" />
<None Include="..\tabletaudiosample.inf" />
</ItemGroup>
<PropertyGroup Label="PropertySheets">
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
@ -46,26 +25,27 @@
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
<Configuration>Debug</Configuration>
</PropertyGroup>
<PropertyGroup Label="Globals" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{5F7004D7-03BD-44AA-9FDD-6677B2C93469}</ProjectGuid>
<SampleGuid>{24733FBE-11F1-4558-97A6-983B6BB36797}</SampleGuid>
<ProjectGuid>{07664D04-E5E5-4249-8382-4D97E3E5557D}</ProjectGuid>
<SampleGuid>{A92ABE31-4404-4415-B763-7186FA03850E}</SampleGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<TargetVersion>Windows10</TargetVersion>
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@ -78,6 +58,7 @@
<PropertyGroup />
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
<EnableDeployment>False</EnableDeployment>
<ImportToStore>False</ImportToStore>
<InstallMode>None</InstallMode>
<HardwareIdString />
@ -91,9 +72,19 @@
<VerifyProjectOutput>True</VerifyProjectOutput>
<VerifyDrivers />
<VerifyFlags>133563</VerifyFlags>
<PackageDir>$(OutDir)Package</PackageDir>
</PropertyGroup>
<ItemDefinitionGroup>
</ItemDefinitionGroup>
<ItemGroup>
<!--Inf Include="DriverInf.inv" /-->
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SampleMft0.vcxproj">
<Project>{DCF923F6-7164-4A0E-9486-B8A140234CCA}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<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>{D7556E25-EFF2-4B16-A8D7-3E0BEEEC9FEB}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
<UniqueIdentifier>{C45D5482-9F0A-49E8-9BB8-05C43E65E305}</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</Extensions>
<UniqueIdentifier>{D323AE8C-19AA-4F7B-8142-0599701C44A8}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
<UniqueIdentifier>{83B1A36B-57FD-4945-A280-98586DD2E63A}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../buildx/script2/preview.xslt"?>
<gallery_sample xmlns="http://microsoft.com/wdcml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://microsoft.com/wdcml ../../buildx/schema/xsd/wdcml.xsd">
<metadata id="gallery_samples.107a_gallery" type="gallery_sample" msdnID="7cba6311-f0db-4c3d-8f1f-25de8648b353">
<title>ADXL345Accelerometer</title>
<!-- Add a devlang for each programming language in all versions of the sample. -->
<devlang value="cpp" />
<!-- Do not change tech value -->
<tech value="gallery_samples" />
<index />
<sample_langs>
<!-- Describes the languages to which the sample code itself has been localized. -->
<sample_lang xml:lang="en-us" />
</sample_langs>
</metadata>
<content>
<desc>
<p><abstract>The ADXL345Accelerometer sample shows how to write a UMDF v2 driver to control an ADXL345 accelerometer chip.</abstract></p>
</desc>
<outline />
<license_info>
<default_license />
</license_info>
<programming_models>
<programming_model value="win32" />
</programming_models>
<application_frameworks>
</application_frameworks>
<!-- For Driver Samples Only -->
<driver_models>
<!-- possible values: kmdf, umdf, wdm, ndis, wddm -->
<driver_model value="UMDF" />
</driver_models>
<driver_techs>
<driver_tech value="Windows Driver" />
</driver_techs>
<related_techs>
</related_techs>
<os_requirements>
<min_os>
<client name="winblue"/>
<server name="wbluesrv"/>
</min_os>
</os_requirements>
<required_sdks>
<min_sdk>
<tla rid="windows_driver_kit_8" />
</min_sdk>
</required_sdks>
<supported_ides>
<supported_ide>
<tla rid="tla_visualstu2013" />
</supported_ide>
</supported_ides>
<build_info>
<authored_instructions>
<section>
<!-- Include any special instructions for compiling your sample -->
<sectioncontents>
</sectioncontents>
</section>
</authored_instructions>
</build_info>
<run_info>
<authored_instructions>
<section>
<sectioncontents>
<p>To install the sample driver, follow these steps:</p>
<proch>
<item>Ensure that the driver builds without errors.</item>
<item>Ensure the appropriate hardware resources have been assigned in the ACPI table using ASL. A device node with HWID ACPI\ADXL345Acc should be created.</item>
<item>Copy the DLL and INF files to a separate folder.</item>
<item>Enter the command "<inline_code devlang="cmd">devcon.exe update ADXL345Acc.inf ACPI\ADXL345Acc</inline_code>" to install the driver on an existing device node. You can find the devcon.exe program in the tools\devcon folder where you installed the WDK.</item>
</proch>
</sectioncontents>
</section>
<section>
<title>File manifest</title>
<sectioncontents>
<p>The following source files are in the src\Sensors\ADXL345Acc folder and are used to build the ADXL345Acc.dll and ADXL345Acc.inf files.</p>
<table>
<tr>
<th>File</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>device.h, device.cpp</p>
</td>
<td>
<p>Implements the driver's WDF PnP event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>client.cpp</p>
</td>
<td>
<p>Implements the driver's callback functions from the class extension to the ADXL345 accelerometer.</p>
</td>
</tr>
<tr>
<td>
<p>driver.h, driver.cpp</p>
</td>
<td>
<p>WDF driver entry event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>ADXL345.h</p>
</td>
<td>
<p>Device specific definitions.</p>
</td>
</tr>
<tr>
<td>
<p>makefile.inc</p>
</td>
<td>
<p>Defines custom build actions. Includes the conversion of the .INX file into a .INF file.</p>
</td>
</tr>
<tr>
<td>
<p>SensorsTrace.h</p>
</td>
<td>
<p>Implementation the sensor traces files.</p>
</td>
</tr>
<tr>
<td>
<p>ADXL345Acc.ctl</p>
</td>
<td>
<p>Declaration of driver's tracing GUID</p>
</td>
</tr>
<tr>
<td>
<p>ADXL345Acc.inx</p>
</td>
<td>
<p>Describes the installation of the driver. The build process converts this into a .INF.</p>
</td>
</tr>
</table>
</sectioncontents>
</section>
</authored_instructions>
</run_info>
</content>
<!-- List the component compcentral path -->
<feature_teams>
<feature_team_info comp_central_path="CORE-OS Core\SiGMa-Silicon, Graphics and Media\SiPlat - Silicon Platform\Sensors" dev_owner="osamasal" writer_owner="ericdoku" />
</feature_teams>
<workflow_control_host />
</gallery_sample>

Просмотреть файл

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../buildx/script2/preview.xslt"?>
<gallery_sample xmlns="http://microsoft.com/wdcml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://microsoft.com/wdcml ../../buildx/schema/xsd/wdcml.xsd">
<metadata id="gallery_samples.107a_gallery" type="gallery_sample" msdnID="7cba6311-f0db-4c3d-8f1f-25de8648b353">
<title>Activity</title>
<!-- Add a devlang for each programming language in all versions of the sample. -->
<devlang value="cpp" />
<!-- Do not change tech value -->
<tech value="gallery_samples" />
<index />
<sample_langs>
<!-- Describes the languages to which the sample code itself has been localized. -->
<sample_lang xml:lang="en-us" />
</sample_langs>
</metadata>
<content>
<desc>
<p><abstract>The activity sensor sample shows how to write a UMDF v2 driver to control a virtual activity sensor.</abstract></p>
</desc>
<outline />
<license_info>
<default_license />
</license_info>
<programming_models>
<programming_model value="win32" />
</programming_models>
<application_frameworks>
</application_frameworks>
<!-- For Driver Samples Only -->
<driver_models>
<!-- possible values: kmdf, umdf, wdm, ndis, wddm -->
<driver_model value="UMDF" />
</driver_models>
<driver_techs>
<driver_tech value="Windows Driver" />
</driver_techs>
<related_techs>
</related_techs>
<os_requirements>
<min_os>
<client name="winblue"/>
<server name="wbluesrv"/>
</min_os>
</os_requirements>
<required_sdks>
<min_sdk>
<tla rid="windows_driver_kit_8" />
</min_sdk>
</required_sdks>
<supported_ides>
<supported_ide>
<tla rid="tla_visualstu2012" />
</supported_ide>
</supported_ides>
<build_info>
<authored_instructions>
<section>
<!-- Include any special instructions for compiling your sample -->
<sectioncontents>
</sectioncontents>
</section>
</authored_instructions>
</build_info>
<run_info>
<authored_instructions>
<section>
<sectioncontents>
<p>To install the sample driver, follow these steps:</p>
<proch>
<item>Ensure that the driver builds without errors.</item>
<item>Copy the DLL and INF files to a separate folder.</item>
<item>Enter the command "<inline_code devlang="cmd">devcon.exe update Activity.inf ACPI\&lt;HWID&gt;</inline_code>" to install the driver on an existing device node. You can find the devcon.exe program in the tools\devcon folder where you installed the WDK.</item>
</proch>
</sectioncontents>
</section>
<section>
<title>File manifest</title>
<sectioncontents>
<p>The following source files are in the src\Sensors\Activity folder and are used to build the Activity.dll and Activity.inf files.</p>
<table>
<tr>
<th>File</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>device.h, device.cpp</p>
</td>
<td>
<p>Implements the driver's WDF PnP event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>client.cpp</p>
</td>
<td>
<p>Implements the driver's callback functions from the class extension to activity sensors.</p>
</td>
</tr>
<tr>
<td>
<p>driver.h, driver.cpp</p>
</td>
<td>
<p>WDF driver entry event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>hardwaresimulator.h, hardwaresimulator.cpp</p>
</td>
<td>
<p>Hardware simulator implementation</p>
</td>
</tr>
<tr>
<td>
<p>makefile.inc</p>
</td>
<td>
<p>Defines custom build actions. Includes the conversion of the .INX file into a .INF file.</p>
</td>
</tr>
<tr>
<td>
<p>SensorsTrace.h</p>
</td>
<td>
<p>Implementation the sensor traces files.</p>
</td>
</tr>
<tr>
<td>
<p>Activity.ctl</p>
</td>
<td>
<p>Declaration of driver's tracing GUID</p>
</td>
</tr>
<tr>
<td>
<p>Activity.inx</p>
</td>
<td>
<p>Describes the installation of the driver. The build process converts this into a .INF.</p>
</td>
</tr>
</table>
</sectioncontents>
</section>
</authored_instructions>
</run_info>
</content>
<!-- List the component compcentral path -->
<feature_teams>
<feature_team_info comp_central_path="CORE-OS Core\SiGMa-Silicon, Graphics and Media\SiPlat - Silicon Platform\Sensors" dev_owner="osamasal" writer_owner="ericdoku" />
</feature_teams>
<workflow_control_host />
</gallery_sample>

Просмотреть файл

@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../buildx/script2/preview.xslt"?>
<gallery_sample xmlns="http://microsoft.com/wdcml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://microsoft.com/wdcml ../../buildx/schema/xsd/wdcml.xsd">
<metadata id="gallery_samples.107a_gallery" type="gallery_sample" msdnID="7cba6311-f0db-4c3d-8f1f-25de8648b353">
<title>CustomSensors</title>
<!-- Add a devlang for each programming language in all versions of the sample. -->
<devlang value="cpp" />
<!-- Do not change tech value -->
<tech value="gallery_samples" />
<index />
<sample_langs>
<!-- Describes the languages to which the sample code itself has been localized. -->
<sample_lang xml:lang="en-us" />
</sample_langs>
</metadata>
<content>
<desc>
<p><abstract>The CustomSensors sample shows how to write a UMDF v2 driver to control a virtual CO2 sensor.</abstract></p>
</desc>
<outline />
<license_info>
<default_license />
</license_info>
<programming_models>
<programming_model value="win32" />
</programming_models>
<application_frameworks>
</application_frameworks>
<!-- For Driver Samples Only -->
<driver_models>
<!-- possible values: kmdf, umdf, wdm, ndis, wddm -->
<driver_model value="UMDF" />
</driver_models>
<driver_techs>
<driver_tech value="Windows Driver" />
</driver_techs>
<related_techs>
</related_techs>
<os_requirements>
<min_os>
<client name="winblue"/>
<server name="wbluesrv"/>
</min_os>
</os_requirements>
<required_sdks>
<min_sdk>
<tla rid="windows_driver_kit_8" />
</min_sdk>
</required_sdks>
<supported_ides>
<supported_ide>
<tla rid="tla_visualstu2012" />
</supported_ide>
</supported_ides>
<build_info>
<authored_instructions>
<section>
<!-- Include any special instructions for compiling your sample -->
<sectioncontents>
</sectioncontents>
</section>
</authored_instructions>
</build_info>
<run_info>
<authored_instructions>
<section>
<sectioncontents>
<p>To install the sample driver, follow these steps:</p>
<proch>
<item>Ensure that the driver builds without errors.</item>
<item>Copy the DLL and INF files to a separate folder.</item>
<item>Enter the command "<inline_code devlang="cmd">devcon.exe update CustomSensors.inf ACPI\&lt;HWID&gt;</inline_code>" to install the driver on an existing device node. You can find the devcon.exe program in the tools\devcon folder where you installed the WDK.</item>
</proch>
</sectioncontents>
</section>
<section>
<title>File manifest</title>
<sectioncontents>
<p>The following source files are in the src\Sensors\CustomSensors folder and are used to build the CustomSensors.dll and CustomSensors.inf files.</p>
<table>
<tr>
<th>File</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>device.h, device.cpp</p>
</td>
<td>
<p>Implements the driver's WDF PnP event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>client.cpp</p>
</td>
<td>
<p>Implements the driver's callback functions from the class extension to custom sensors.</p>
</td>
</tr>
<tr>
<td>
<p>driver.h, driver.cpp</p>
</td>
<td>
<p>WDF driver entry event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>hardwaresimulator.h, hardwaresimulator.cpp</p>
</td>
<td>
<p>Hardware simulator implementation</p>
</td>
</tr>
<tr>
<td>
<p>makefile.inc</p>
</td>
<td>
<p>Defines custom build actions. Includes the conversion of the .INX file into a .INF file.</p>
</td>
</tr>
<tr>
<td>
<p>SensorsTrace.h</p>
</td>
<td>
<p>Implementation the sensor traces files.</p>
</td>
</tr>
<tr>
<td>
<p>CustomSensors.ctl</p>
</td>
<td>
<p>Declaration of driver's tracing GUID</p>
</td>
</tr>
<tr>
<td>
<p>CustomSensor.inx</p>
</td>
<td>
<p>Describes the installation of the driver. The build process converts this into a .INF.</p>
</td>
</tr>
<tr>
<td>
<p>Trace.h</p>
</td>
<td>
<p>Sets up WPP tracing.</p>
</td>
</tr>
</table>
</sectioncontents>
</section>
</authored_instructions>
</run_info>
</content>
<!-- List the component compcentral path -->
<feature_teams>
<feature_team_info comp_central_path="CORE-OS Core\SiGMa-Silicon, Graphics and Media\SiPlat - Silicon Platform\Sensors" dev_owner="osamasal" writer_owner="ericdoku" />
</feature_teams>
<workflow_control_host />
</gallery_sample>

Просмотреть файл

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../buildx/script2/preview.xslt"?>
<gallery_sample xmlns="http://microsoft.com/wdcml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://microsoft.com/wdcml ../../buildx/schema/xsd/wdcml.xsd">
<metadata id="gallery_samples.107a_gallery" type="gallery_sample" msdnID="7cba6311-f0db-4c3d-8f1f-25de8648b353">
<title>Pedometer</title>
<!-- Add a devlang for each programming language in all versions of the sample. -->
<devlang value="cpp" />
<!-- Do not change tech value -->
<tech value="gallery_samples" />
<index />
<sample_langs>
<!-- Describes the languages to which the sample code itself has been localized. -->
<sample_lang xml:lang="en-us" />
</sample_langs>
</metadata>
<content>
<desc>
<p><abstract>The Pedometer sample shows how to write a UMDF v2 driver to control a virtual Pedometer sensor.</abstract></p>
</desc>
<outline />
<license_info>
<default_license />
</license_info>
<programming_models>
<programming_model value="win32" />
</programming_models>
<application_frameworks>
</application_frameworks>
<!-- For Driver Samples Only -->
<driver_models>
<!-- possible values: kmdf, umdf, wdm, ndis, wddm -->
<driver_model value="UMDF" />
</driver_models>
<driver_techs>
<driver_tech value="Windows Driver" />
</driver_techs>
<related_techs>
</related_techs>
<os_requirements>
<min_os>
<client name="winblue"/>
<server name="wbluesrv"/>
</min_os>
</os_requirements>
<required_sdks>
<min_sdk>
<tla rid="windows_driver_kit_8" />
</min_sdk>
</required_sdks>
<supported_ides>
<supported_ide>
<tla rid="tla_visualstu2012" />
</supported_ide>
</supported_ides>
<build_info>
<authored_instructions>
<section>
<!-- Include any special instructions for compiling your sample -->
<sectioncontents>
</sectioncontents>
</section>
</authored_instructions>
</build_info>
<run_info>
<authored_instructions>
<section>
<sectioncontents>
<p>To install the sample driver, follow these steps:</p>
<proch>
<item>Ensure that the driver builds without errors.</item>
<item>Copy the DLL and INF files to a separate folder.</item>
<item>Enter the command "<inline_code devlang="cmd">devcon.exe update Pedometer.inf ACPI\&lt;HWID&gt;</inline_code>" to install the driver on an existing device node. You can find the devcon.exe program in the tools\devcon folder where you installed the WDK.</item>
</proch>
</sectioncontents>
</section>
<section>
<title>File manifest</title>
<sectioncontents>
<p>The following source files are in the src\Sensors\Pedometer folder and are used to build the Pedometer.dll and Pedometer.inf files.</p>
<table>
<tr>
<th>File</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>device.h, device.cpp</p>
</td>
<td>
<p>Implements the driver's WDF PnP event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>client.cpp</p>
</td>
<td>
<p>Implements the driver's callback functions from the class extension to pedometer sensors.</p>
</td>
</tr>
<tr>
<td>
<p>driver.h, driver.cpp</p>
</td>
<td>
<p>WDF driver entry event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>hardwaresimulator.h, hardwaresimulator.cpp</p>
</td>
<td>
<p>Hardware simulator implementation</p>
</td>
</tr>
<tr>
<td>
<p>makefile.inc</p>
</td>
<td>
<p>Defines custom build actions. Includes the conversion of the .INX file into a .INF file.</p>
</td>
</tr>
<tr>
<td>
<p>SensorsTrace.h</p>
</td>
<td>
<p>Implementation the sensor traces files.</p>
</td>
</tr>
<tr>
<td>
<p>Pedometer.ctl</p>
</td>
<td>
<p>Declaration of driver's tracing GUID</p>
</td>
</tr>
<tr>
<td>
<p>Pedometer.inx</p>
</td>
<td>
<p>Describes the installation of the driver. The build process converts this into a .INF.</p>
</td>
</tr>
</table>
</sectioncontents>
</section>
</authored_instructions>
</run_info>
</content>
<!-- List the component compcentral path -->
<feature_teams>
<feature_team_info comp_central_path="CORE-OS Core\SiGMa-Silicon, Graphics and Media\SiPlat - Silicon Platform\Sensors" dev_owner="osamasal" writer_owner="ericdoku" />
</feature_teams>
<workflow_control_host />
</gallery_sample>

Просмотреть файл

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../buildx/script2/preview.xslt"?>
<gallery_sample xmlns="http://microsoft.com/wdcml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://microsoft.com/wdcml ../../buildx/schema/xsd/wdcml.xsd">
<metadata id="gallery_samples.107a_gallery" type="gallery_sample" msdnID="7cba6311-f0db-4c3d-8f1f-25de8648b353">
<title>SimpleDeviceOrientationSensor</title>
<!-- Add a devlang for each programming language in all versions of the sample. -->
<devlang value="cpp" />
<!-- Do not change tech value -->
<tech value="gallery_samples" />
<index />
<sample_langs>
<!-- Describes the languages to which the sample code itself has been localized. -->
<sample_lang xml:lang="en-us" />
</sample_langs>
</metadata>
<content>
<desc>
<p><abstract>The SimpleDeviceOrientationSensor sample shows how to write a UMDF v2 sensor driver to output Simple Device Orientation values.</abstract></p>
</desc>
<outline />
<license_info>
<default_license />
</license_info>
<programming_models>
<programming_model value="win32" />
</programming_models>
<application_frameworks>
</application_frameworks>
<!-- For Driver Samples Only -->
<driver_models>
<!-- possible values: kmdf, umdf, wdm, ndis, wddm -->
<driver_model value="UMDF" />
</driver_models>
<driver_techs>
<driver_tech value="Windows Driver" />
</driver_techs>
<related_techs>
</related_techs>
<os_requirements>
<min_os>
<client name="winblue"/>
<server name="wbluesrv"/>
</min_os>
</os_requirements>
<required_sdks>
<min_sdk>
<tla rid="windows_driver_kit_8" />
</min_sdk>
</required_sdks>
<supported_ides>
<supported_ide>
<tla rid="tla_visualstu2012" />
</supported_ide>
</supported_ides>
<build_info>
<authored_instructions>
<section>
<!-- Include any special instructions for compiling your sample -->
<sectioncontents>
</sectioncontents>
</section>
</authored_instructions>
</build_info>
<run_info>
<authored_instructions>
<section>
<sectioncontents>
<p>To install the sample driver, follow these steps:</p>
<proch>
<item>Ensure that the driver builds without errors.</item>
<item>Copy the DLL and INF files to a separate folder.</item>
<item>Enter the command "<inline_code devlang="cmd">devcon.exe update SimpleDeviceOrientationSensor.inf ACPI\&lt;HWID&gt;</inline_code>" to install the driver on an existing device node. You can find the devcon.exe program in the tools\devcon folder where you installed the WDK.</item>
</proch>
</sectioncontents>
</section>
<section>
<title>File manifest</title>
<sectioncontents>
<p>The following source files are in the src\Sensors\SimpleDeviceOrientationSensor folder and are used to build the SimpleDeviceOrientationSensor.dll and SimpleDeviceOrientationSensor.inf files.</p>
<table>
<tr>
<th>File</th>
<th>Description</th>
</tr>
<tr>
<td>
<p>device.h, device.cpp</p>
</td>
<td>
<p>Implements the driver's WDF PnP event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>client.cpp</p>
</td>
<td>
<p>Implements the driver's callback functions from the class extension to simple device orientation sensors.</p>
</td>
</tr>
<tr>
<td>
<p>driver.h, driver.cpp</p>
</td>
<td>
<p>WDF driver entry event callbacks and helper methods</p>
</td>
</tr>
<tr>
<td>
<p>hardwaresimulator.h, hardwaresimulator.cpp</p>
</td>
<td>
<p>Hardware simulator implementation</p>
</td>
</tr>
<tr>
<td>
<p>makefile.inc</p>
</td>
<td>
<p>Defines custom build actions. Includes the conversion of the .INX file into a .INF file.</p>
</td>
</tr>
<tr>
<td>
<p>SensorsTrace.h</p>
</td>
<td>
<p>Implementation the sensor traces files.</p>
</td>
</tr>
<tr>
<td>
<p>SimpleDeviceOrientationSensor.ctl</p>
</td>
<td>
<p>Declaration of driver's tracing GUID</p>
</td>
</tr>
<tr>
<td>
<p>SimpleDeviceOrientationSensor.inx</p>
</td>
<td>
<p>Describes the installation of the driver. The build process converts this into a .INF.</p>
</td>
</tr>
</table>
</sectioncontents>
</section>
</authored_instructions>
</run_info>
</content>
<!-- List the component compcentral path -->
<feature_teams>
<feature_team_info comp_central_path="CORE-OS Core\SiGMa-Silicon, Graphics and Media\SiPlat - Silicon Platform\Sensors" dev_owner="osamasal" writer_owner="ericdoku" />
</feature_teams>
<workflow_control_host />
</gallery_sample>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше