Skip to content

Commit

Permalink
Decklink simulator integration
Browse files Browse the repository at this point in the history
  • Loading branch information
g-maxime committed Mar 6, 2024
1 parent ffd6b6d commit 65883a8
Show file tree
Hide file tree
Showing 21 changed files with 384 additions and 314 deletions.
11 changes: 9 additions & 2 deletions Project/GNU/CLI/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ if BUILD_AVFCTL
endif

if BUILD_DECKLINK
dvrescue_SOURCES += ../../../Source/Common/DecklinkWrapper.cpp \
../../../Source/Common/Output_Mkv.cpp
dvrescue_SOURCES += ../../../Source/Common/DecklinkWrapper.cpp
endif

if BUILD_DECKLINK
dvrescue_SOURCES += ../../../Source/Common/Output_Mkv.cpp
else
if BUILD_SIMULATOR
dvrescue_SOURCES += ../../../Source/Common/Output_Mkv.cpp
endif
endif

if BUILD_SONY9PIN
Expand Down
8 changes: 6 additions & 2 deletions Project/GNU/CLI/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ dnl Arguments - Enable
dnl

dnl TODO: USE --enable-capture on all platforms (use --enable-avfctl only for building the tool binary)
dnl Also provide an option to enable simulator (will disable capture)

AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable full debug]), , enable_debug=no)
AC_ARG_ENABLE(gprof, AC_HELP_STRING([--enable-gprof], [Enable gprof log]), , enable_gprof=no)
AC_ARG_ENABLE(universal_binary, AC_HELP_STRING([--enable-universal_binary], [Create Mac PPC/i386 Universal binary]), , enable_universal_binary=no)
Expand All @@ -53,6 +51,7 @@ AC_ARG_ENABLE(avfctl, AC_HELP_STRING([--enable-avfctl], [Bui
AC_ARG_ENABLE(capture, AC_HELP_STRING([--enable-capture], [Use libavc1394 and libdc1394 for capture support on linux]), , enable_capture=yes)
AC_ARG_ENABLE(decklink, AC_HELP_STRING([--enable-decklink], [Enable capture from Blackmagic capture devices]), , enable_decklink=no)
AC_ARG_ENABLE(sony9pin, AC_HELP_STRING([--enable-sony9pin], [Enable control through Sony9Pin serial interface]), , enable_sony9pin=no)
AC_ARG_ENABLE(simulator, AC_HELP_STRING([--enable-simulator], [Enable capture simulation for testing purposes]), , enable_simulator=yes)

dnl -------------------------------------------------------------------------
dnl Arguments - With
Expand Down Expand Up @@ -125,6 +124,11 @@ if test "$host_macos" = "yes" -a "$enable_sony9pin" = "yes" ; then
dnl AC_CHECK_HEADERS([Sony9PinRemote.h], , [AC_MSG_ERROR([Sony9pin SDK is not found])])
fi

AM_CONDITIONAL([BUILD_SIMULATOR], [test "$enable_simulator" = "yes"])
if test "$enable_simulator" = "yes" ; then
AC_DEFINE(ENABLE_SIMULATOR)
fi

dnl #########################################################################
dnl ### MediaInfo flags
dnl #########################################################################
Expand Down
10 changes: 6 additions & 4 deletions Project/MSVC2017/CLI/DVRescue.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -101,7 +101,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -118,7 +118,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -137,7 +137,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -160,6 +160,7 @@
<ClCompile Include="..\..\..\Source\Common\Output_Captions_Decode.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Webvtt.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFile.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFileWrapper.cpp" />
<ClCompile Include="..\..\..\Source\Common\SimulatorWrapper.cpp" />
Expand All @@ -182,6 +183,7 @@
<ClInclude Include="..\..\..\Source\Common\Output_Captions_Decode.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Webvtt.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFile.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFileWrapper.h" />
<ClInclude Include="..\..\..\Source\Common\SimulatorWrapper.h" />
Expand Down
6 changes: 6 additions & 0 deletions Project/MSVC2017/CLI/DVRescue.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
Expand Down Expand Up @@ -116,6 +119,9 @@
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
Expand Down
10 changes: 6 additions & 4 deletions Project/MSVC2019/CLI/DVRescue.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -102,7 +102,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -119,7 +119,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -138,7 +138,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -161,6 +161,7 @@
<ClCompile Include="..\..\..\Source\Common\Output_Captions_Decode.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Webvtt.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFile.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFileWrapper.cpp" />
<ClCompile Include="..\..\..\Source\Common\SimulatorWrapper.cpp" />
Expand All @@ -183,6 +184,7 @@
<ClInclude Include="..\..\..\Source\Common\Output_Captions_Decode.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Webvtt.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFile.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFileWrapper.h" />
<ClInclude Include="..\..\..\Source\Common\SimulatorWrapper.h" />
Expand Down
6 changes: 6 additions & 0 deletions Project/MSVC2019/CLI/DVRescue.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
Expand Down Expand Up @@ -116,6 +119,9 @@
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
Expand Down
10 changes: 6 additions & 4 deletions Project/MSVC2022/CLI/DVRescue.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;ENABLE_SIMULATOR%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -102,7 +102,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -119,7 +119,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -138,7 +138,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;ENABLE_SIMULATOR;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\Source;..\..\..\Source\ThirdParty\TimeCode;..\..\..\Source\ThirdParty\ccdecoder;..\..\..\..\MediaInfoLib\Source;..\..\..\..\ZenLib\Source</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand All @@ -161,6 +161,7 @@
<ClCompile Include="..\..\..\Source\Common\Output_Captions_Decode.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Webvtt.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp" />
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFile.cpp" />
<ClCompile Include="..\..\..\Source\Common\ProcessFileWrapper.cpp" />
<ClCompile Include="..\..\..\Source\Common\SimulatorWrapper.cpp" />
Expand All @@ -183,6 +184,7 @@
<ClInclude Include="..\..\..\Source\Common\Output_Captions_Decode.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Webvtt.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h" />
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFile.h" />
<ClInclude Include="..\..\..\Source\Common\ProcessFileWrapper.h" />
<ClInclude Include="..\..\..\Source\Common\SimulatorWrapper.h" />
Expand Down
6 changes: 6 additions & 0 deletions Project/MSVC2022/CLI/DVRescue.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
<ClCompile Include="..\..\..\Source\Common\Output_Xml.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output_Mkv.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\Source\Common\Output.cpp">
<Filter>Source Files\Common</Filter>
</ClCompile>
Expand Down Expand Up @@ -116,6 +119,9 @@
<ClInclude Include="..\..\..\Source\Common\Output_Xml.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output_Mkv.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\Source\Common\Output.h">
<Filter>Header Files\Common</Filter>
</ClInclude>
Expand Down
4 changes: 2 additions & 2 deletions Source/CLI/CommandLine_Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ return_value Parse(Core &C, int argc, const char* argv_ansi[], const MediaInfoNa
Control_Port = argv_ansi[i];
}
#endif
#ifdef ENABLE_DECKLINK
#if defined(ENABLE_DECKLINK) || defined(ENABLE_SIMULATOR)
else if (!strcmp(argv_ansi[i], "--decklink-video-mode"))
{
if (++i >= argc)
Expand Down Expand Up @@ -545,7 +545,7 @@ return_value Parse(Core &C, int argc, const char* argv_ansi[], const MediaInfoNa
else if (!strcmp(argv_ansi[i], "serial"))
DeckLinkTimecodeFormat = 7;
else if (!strcmp(argv_ansi[i], "none"))
DeckLinkTimecodeFormat = 9;
DeckLinkTimecodeFormat = 8;
else
{
if (C.Err)
Expand Down
Loading

0 comments on commit 65883a8

Please sign in to comment.