Changeset 769 for trunk/Utilities/DirectShowReferenceSource/Sample
- Timestamp:
- Jul 13, 2017, 8:01:48 AM (6 years ago)
- Location:
- trunk/Utilities/DirectShowReferenceSource/Sample
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Utilities/DirectShowReferenceSource/Sample/Generate/Generate.vcxproj
r636 r769 15 15 <Keyword>Win32Proj</Keyword> 16 16 <RootNamespace>Generate</RootNamespace> 17 <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> 17 18 </PropertyGroup> 18 19 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> -
trunk/Utilities/DirectShowReferenceSource/Sample/Generate/targetver.h
r523 r769 13 13 // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 14 14 15 #include <SDKDDKVer.h> 15 #include <winsdkver.h> 16 #include <sdkddkver.h> -
trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/Application.cpp
r637 r769 1 1 //////////////////////////////////////////////////////////// 2 // Copyright (C) Roman Ryltsov, 2015-201 62 // Copyright (C) Roman Ryltsov, 2015-2017 3 3 // Created by Roman Ryltsov roman@alax.info 4 4 // … … 48 48 // __D(pMediaSource, E_NOINTERFACE); 49 49 //} 50 51 //const SIZE g_Extent = { 640, 360 }; 52 //const LONG g_nFrameRateNumerator = 30000; 53 //const LONG g_nFrameRateDenominator = 1001; 54 //const LONG g_nDuration = 1 * 60; // 1 minutes 55 //const LONG g_nBitrate = (2 << 10) * 1000; // 2 MBps 56 57 //const SIZE g_Extent = { 720, 480 }; 58 //const LONG g_nFrameRateNumerator = 90; //30 * 1000; 59 //const LONG g_nFrameRateDenominator = 1; //1001; 60 //const LONG g_nDuration = 60; //5 * 60; // 5 minutes 61 //const LONG g_nBitrate = (2 << 10) * 1000; // 2 MBps 62 63 //const SIZE g_Extent = { 1280, 720 }; 64 //const LONG g_nFrameRateNumerator = 60 * 1000; 65 //const LONG g_nFrameRateDenominator = 1000; 66 //const LONG g_nDuration = 5 * 60; // 5 minutes 67 //const LONG g_nBitrate = (5 << 10) * 1000; // 5 MBps 68 69 const SIZE g_Extent = { 1920, 1080 }; 70 const LONG g_nFrameRateNumerator = 25 * 1000; // frames/second 71 const LONG g_nFrameRateDenominator = 1000; 72 const LONG g_nDuration = 1 * 60; // minutes 73 const LONG g_nBitrate = (2 << 10) * 1000; // 2 MBps 74 75 //const SIZE g_Extent = { 4096, 2304 }; 76 //const LONG g_nFrameRateNumerator = 50; 77 //const LONG g_nFrameRateDenominator = 1; 78 //const LONG g_nDuration = 5 * 60; // 5 minutes 79 //const LONG g_nBitrate = (2 << 10) * 1000; // 2 MBps 80 50 81 { 51 82 using namespace AlaxInfoDirectShowReferenceSource; 52 83 CComPtr<IVideoMediaSource> pVideoMediaSource; 53 84 __C(pVideoMediaSource.CoCreateInstance(__uuidof(VideoMediaSource))); 54 __C(pVideoMediaSource->SetMediaType( 4096, 2304, CComVariant(_PersistHelper::StringFromIdentifier(MEDIASUBTYPE_RGB32))));85 __C(pVideoMediaSource->SetMediaType(g_Extent.cx, g_Extent.cy, CComVariant(_PersistHelper::StringFromIdentifier(MEDIASUBTYPE_RGB32)))); 55 86 //__C(pVideoMediaSource->SetMediaTypeAspectRatio(...)); 56 __C(pVideoMediaSource->SetMediaTypeRate( 50, 1));57 __C(pVideoMediaSource->put_Duration( 5.0));87 __C(pVideoMediaSource->SetMediaTypeRate(g_nFrameRateNumerator, g_nFrameRateDenominator)); 88 __C(pVideoMediaSource->put_Duration((DOUBLE) g_nDuration)); 58 89 pMediaSource = pVideoMediaSource; 59 90 } … … 74 105 pWriterMediaType[MF_MT_MAJOR_TYPE] = MFMediaType_Video; 75 106 pWriterMediaType[MF_MT_SUBTYPE] = MFVideoFormat_H264; 76 pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) (12 << 10) * 1000; // 12 MBps107 pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) g_nBitrate; 77 108 pWriterMediaType[MF_MT_FRAME_RATE] = pMediaType.GetUINT64(MF_MT_FRAME_RATE); 78 109 pWriterMediaType[MF_MT_FRAME_SIZE] = pMediaType.GetUINT64(MF_MT_FRAME_SIZE); 79 110 pWriterMediaType[MF_MT_INTERLACE_MODE] = pMediaType.GetUINT32(MF_MT_INTERLACE_MODE); 80 111 pWriterMediaType[MF_MT_PIXEL_ASPECT_RATIO] = pMediaType.GetUINT64(MF_MT_PIXEL_ASPECT_RATIO); 112 113 //pWriterMediaType[MF_MT_MPEG2_PROFILE] = (UINT32) eAVEncH264VProfile_High; 114 115 pWriterMediaType.Trace(); 81 116 DWORD nWriterStreamIndex; 82 117 __C(pSinkWriter->AddStream(pWriterMediaType, &nWriterStreamIndex)); … … 88 123 __C(pSinkWriter->SetInputMediaType(nWriterStreamIndex, pMediaType, pAttributes)); 89 124 } 125 126 //CRoArrayT<CComPtr<IMFTransform>> TransformArray; 127 //MF::CSinkWriterHelper::GetTransforms(pSinkWriter, nWriterStreamIndex, TransformArray); 128 //_A(!TransformArray.IsEmpty()); 129 //MF::CCodecApi pCodecApi(TransformArray[TransformArray.GetCount() - 1]); 130 //// NOTE: H.264 Video Encoder https://msdn.microsoft.com/en-us/library/windows/desktop/dd797816 131 //pCodecApi[CODECAPI_AVEncMPVGOPSize] = (UINT32) 16; 132 //pCodecApi[CODECAPI_AVEncMPVDefaultBPictureCount] = (UINT32) 3; 133 90 134 __C(pSinkWriter->BeginWriting()); 91 135 for(; ; ) -
trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/MfGenerate.vcxproj
r636 r769 6 6 <Platform>Win32</Platform> 7 7 </ProjectConfiguration> 8 <ProjectConfiguration Include="Debug|x64"> 9 <Configuration>Debug</Configuration> 10 <Platform>x64</Platform> 11 </ProjectConfiguration> 8 12 <ProjectConfiguration Include="Release|Win32"> 9 13 <Configuration>Release</Configuration> 10 14 <Platform>Win32</Platform> 15 </ProjectConfiguration> 16 <ProjectConfiguration Include="Release|x64"> 17 <Configuration>Release</Configuration> 18 <Platform>x64</Platform> 11 19 </ProjectConfiguration> 12 20 </ItemGroup> … … 15 23 <Keyword>Win32Proj</Keyword> 16 24 <RootNamespace>MfGenerate</RootNamespace> 17 <WindowsTargetPlatformVersion>10.0.1 0586.0</WindowsTargetPlatformVersion>25 <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> 18 26 </PropertyGroup> 19 27 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> 20 28 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> 29 <ConfigurationType>Application</ConfigurationType> 30 <UseDebugLibraries>true</UseDebugLibraries> 31 <PlatformToolset>v140</PlatformToolset> 32 <CharacterSet>Unicode</CharacterSet> 33 </PropertyGroup> 34 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> 21 35 <ConfigurationType>Application</ConfigurationType> 22 36 <UseDebugLibraries>true</UseDebugLibraries> … … 31 45 <CharacterSet>Unicode</CharacterSet> 32 46 </PropertyGroup> 47 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> 48 <ConfigurationType>Application</ConfigurationType> 49 <UseDebugLibraries>false</UseDebugLibraries> 50 <PlatformToolset>v140</PlatformToolset> 51 <WholeProgramOptimization>true</WholeProgramOptimization> 52 <CharacterSet>Unicode</CharacterSet> 53 </PropertyGroup> 33 54 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> 34 55 <ImportGroup Label="ExtensionSettings"> … … 37 58 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 38 59 </ImportGroup> 60 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> 61 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 62 </ImportGroup> 39 63 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> 64 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 65 </ImportGroup> 66 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> 40 67 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> 41 68 </ImportGroup> 42 69 <PropertyGroup Label="UserMacros" /> 43 70 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 71 <LinkIncremental>true</LinkIncremental> 72 <OutDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\</OutDir> 73 <IntDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> 74 </PropertyGroup> 75 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 44 76 <LinkIncremental>true</LinkIncremental> 45 77 <OutDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\</OutDir> … … 51 83 <IntDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> 52 84 </PropertyGroup> 85 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 86 <LinkIncremental>false</LinkIncremental> 87 <OutDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\</OutDir> 88 <IntDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> 89 </PropertyGroup> 53 90 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> 91 <ClCompile> 92 <PrecompiledHeader>Use</PrecompiledHeader> 93 <WarningLevel>Level3</WarningLevel> 94 <Optimization>Disabled</Optimization> 95 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> 96 <SDLCheck>true</SDLCheck> 97 </ClCompile> 98 <Link> 99 <SubSystem>Console</SubSystem> 100 <MfGenerateDebugInformation>true</MfGenerateDebugInformation> 101 <GenerateDebugInformation>true</GenerateDebugInformation> 102 <LargeAddressAware>true</LargeAddressAware> 103 </Link> 104 </ItemDefinitionGroup> 105 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> 54 106 <ClCompile> 55 107 <PrecompiledHeader>Use</PrecompiledHeader> … … 84 136 </Link> 85 137 </ItemDefinitionGroup> 138 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> 139 <ClCompile> 140 <WarningLevel>Level3</WarningLevel> 141 <PrecompiledHeader>Use</PrecompiledHeader> 142 <Optimization>MaxSpeed</Optimization> 143 <FunctionLevelLinking>true</FunctionLevelLinking> 144 <IntrinsicFunctions>true</IntrinsicFunctions> 145 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> 146 <SDLCheck>true</SDLCheck> 147 </ClCompile> 148 <Link> 149 <SubSystem>Console</SubSystem> 150 <MfGenerateDebugInformation>true</MfGenerateDebugInformation> 151 <EnableCOMDATFolding>true</EnableCOMDATFolding> 152 <OptimizeReferences>true</OptimizeReferences> 153 <LargeAddressAware>true</LargeAddressAware> 154 </Link> 155 </ItemDefinitionGroup> 86 156 <ItemGroup> 87 157 <ClInclude Include="stdafx.h" /> … … 92 162 <ClCompile Include="stdafx.cpp"> 93 163 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> 164 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> 94 165 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> 166 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> 95 167 </ClCompile> 96 168 </ItemGroup> -
trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/targetver.h
r636 r769 13 13 // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 14 14 15 #include <SDKDDKVer.h> 15 #include <winsdkver.h> 16 #include <sdkddkver.h> -
trunk/Utilities/DirectShowReferenceSource/Sample/RegisterSources/Program.cs
r636 r769 22 22 VideoSourceFilterRegistry registry = new VideoSourceFilterRegistry(); 23 23 UnregisterAll(registry); 24 //int width = 1920, height = 1080;25 int width = 640, height = 480;24 int width = 1920, height = 1080; 25 //int width = 640, height = 480; 26 26 VideoSourceFilter filter = new VideoSourceFilter(); 27 27 filter.Live = true;
Note: See TracChangeset
for help on using the changeset viewer.