Ignore:
Timestamp:
Jul 13, 2017, 8:01:48 AM (7 years ago)
Author:
roman
Message:
 
Location:
trunk/Utilities/DirectShowReferenceSource/Sample
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/DirectShowReferenceSource/Sample/Generate/Generate.vcxproj

    r636 r769  
    1515    <Keyword>Win32Proj</Keyword>
    1616    <RootNamespace>Generate</RootNamespace>
     17    <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
    1718  </PropertyGroup>
    1819  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  • trunk/Utilities/DirectShowReferenceSource/Sample/Generate/targetver.h

    r523 r769  
    1313// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
    1414
    15 #include <SDKDDKVer.h>
     15#include <winsdkver.h>
     16#include <sdkddkver.h>
  • trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/Application.cpp

    r637 r769  
    11////////////////////////////////////////////////////////////
    2 // Copyright (C) Roman Ryltsov, 2015-2016
     2// Copyright (C) Roman Ryltsov, 2015-2017
    33// Created by Roman Ryltsov roman@alax.info
    44//
     
    4848                //      __D(pMediaSource, E_NOINTERFACE);
    4949                //}
     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
    5081                {
    5182                        using namespace AlaxInfoDirectShowReferenceSource;
    5283                        CComPtr<IVideoMediaSource> pVideoMediaSource;
    5384                        __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))));
    5586                        //__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));
    5889                        pMediaSource = pVideoMediaSource;
    5990                }
     
    74105                pWriterMediaType[MF_MT_MAJOR_TYPE] = MFMediaType_Video;
    75106                pWriterMediaType[MF_MT_SUBTYPE] = MFVideoFormat_H264;
    76                 pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) (12 << 10) * 1000; // 12 MBps
     107                pWriterMediaType[MF_MT_AVG_BITRATE] = (UINT32) g_nBitrate;
    77108                pWriterMediaType[MF_MT_FRAME_RATE] = pMediaType.GetUINT64(MF_MT_FRAME_RATE);
    78109                pWriterMediaType[MF_MT_FRAME_SIZE] = pMediaType.GetUINT64(MF_MT_FRAME_SIZE);
    79110                pWriterMediaType[MF_MT_INTERLACE_MODE] = pMediaType.GetUINT32(MF_MT_INTERLACE_MODE);
    80111                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();
    81116                DWORD nWriterStreamIndex;
    82117                __C(pSinkWriter->AddStream(pWriterMediaType, &nWriterStreamIndex));
     
    88123                        __C(pSinkWriter->SetInputMediaType(nWriterStreamIndex, pMediaType, pAttributes));
    89124                }
     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
    90134                __C(pSinkWriter->BeginWriting());
    91135                for(; ; )
  • trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/MfGenerate.vcxproj

    r636 r769  
    66      <Platform>Win32</Platform>
    77    </ProjectConfiguration>
     8    <ProjectConfiguration Include="Debug|x64">
     9      <Configuration>Debug</Configuration>
     10      <Platform>x64</Platform>
     11    </ProjectConfiguration>
    812    <ProjectConfiguration Include="Release|Win32">
    913      <Configuration>Release</Configuration>
    1014      <Platform>Win32</Platform>
     15    </ProjectConfiguration>
     16    <ProjectConfiguration Include="Release|x64">
     17      <Configuration>Release</Configuration>
     18      <Platform>x64</Platform>
    1119    </ProjectConfiguration>
    1220  </ItemGroup>
     
    1523    <Keyword>Win32Proj</Keyword>
    1624    <RootNamespace>MfGenerate</RootNamespace>
    17     <WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
     25    <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
    1826  </PropertyGroup>
    1927  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
    2028  <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">
    2135    <ConfigurationType>Application</ConfigurationType>
    2236    <UseDebugLibraries>true</UseDebugLibraries>
     
    3145    <CharacterSet>Unicode</CharacterSet>
    3246  </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>
    3354  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
    3455  <ImportGroup Label="ExtensionSettings">
     
    3758    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    3859  </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>
    3963  <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">
    4067    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    4168  </ImportGroup>
    4269  <PropertyGroup Label="UserMacros" />
    4370  <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'">
    4476    <LinkIncremental>true</LinkIncremental>
    4577    <OutDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\</OutDir>
     
    5183    <IntDir>$(SolutionDir)_Bin\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
    5284  </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>
    5390  <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'">
    54106    <ClCompile>
    55107      <PrecompiledHeader>Use</PrecompiledHeader>
     
    84136    </Link>
    85137  </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>
    86156  <ItemGroup>
    87157    <ClInclude Include="stdafx.h" />
     
    92162    <ClCompile Include="stdafx.cpp">
    93163      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
     164      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
    94165      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
     166      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
    95167    </ClCompile>
    96168  </ItemGroup>
  • trunk/Utilities/DirectShowReferenceSource/Sample/MfGenerate/targetver.h

    r636 r769  
    1313// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
    1414
    15 #include <SDKDDKVer.h>
     15#include <winsdkver.h>
     16#include <sdkddkver.h>
  • trunk/Utilities/DirectShowReferenceSource/Sample/RegisterSources/Program.cs

    r636 r769  
    2222            VideoSourceFilterRegistry registry = new VideoSourceFilterRegistry();
    2323            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;
    2626            VideoSourceFilter filter = new VideoSourceFilter();
    2727            filter.Live = true;
Note: See TracChangeset for help on using the changeset viewer.