]> git.sesse.net Git - casparcg/blobdiff - shell/main.cpp
2.0. video_format: Renamed video_mode to field_mode. image_mixer: Refactored field...
[casparcg] / shell / main.cpp
index 2b016d0da6a8bd2f7ba85485e85775a07a13eb76..56118a51e5eb52de901d325f86e59c2410a54efe 100644 (file)
 #endif\r
 \r
 #define NOMINMAX\r
+#define WIN32_LEAN_AND_MEAN\r
 \r
 #include <windows.h>\r
+#include <winnt.h>\r
+#include <mmsystem.h>\r
 #include <atlbase.h>\r
 \r
 #include <protocol/amcp/AMCPProtocolStrategy.h>\r
@@ -141,11 +144,29 @@ void print_info()
        CASPAR_LOG(info) << L"FFMPEG-swscale "  << caspar::get_swscale_version();\r
        CASPAR_LOG(info) << L"OpenGL " << caspar::core::ogl_device::get_version() << "\n\n";\r
 }\r
\r
+\r
+LONG WINAPI UserUnhandledExceptionFilter(EXCEPTION_POINTERS* info)\r
+{\r
+       try\r
+       {\r
+               CASPAR_LOG(fatal) << L"#######################\n UNHANDLED EXCEPTION: \n" \r
+                       << L"Adress:" << info->ExceptionRecord->ExceptionAddress << L"\n"\r
+                       << L"Code:" << info->ExceptionRecord->ExceptionCode << L"\n"\r
+                       << L"Flag:" << info->ExceptionRecord->ExceptionFlags << L"\n"\r
+                       << L"Info:" << info->ExceptionRecord->ExceptionInformation << L"\n"\r
+                       << L"Continuing execution. \n#######################";\r
+       }\r
+       catch(...){}\r
+\r
+    return EXCEPTION_CONTINUE_EXECUTION;\r
+}\r
+\r
 int main(int argc, wchar_t* argv[])\r
 {      \r
        static_assert(sizeof(void*) == 4, "64-bit code generation is not supported.");\r
        \r
+       SetUnhandledExceptionFilter(UserUnhandledExceptionFilter);\r
+\r
        CASPAR_LOG(info) << L"Type \"q\" to close application";\r
 \r
        CASPAR_LOG(info) << L"THIS IS AN ALPHA BUILD";\r
@@ -177,7 +198,7 @@ int main(int argc, wchar_t* argv[])
                tbb_thread_installer(){observe(true);}\r
                void on_scheduler_entry(bool is_worker)\r
                {\r
-                       caspar::detail::SetThreadName(GetCurrentThreadId(), "tbb-worker-thread");\r
+                       //caspar::detail::SetThreadName(GetCurrentThreadId(), "tbb-worker-thread");\r
                        caspar::win32_exception::install_handler();\r
                }\r
        } tbb_thread_installer;\r
@@ -225,6 +246,16 @@ int main(int argc, wchar_t* argv[])
                                wcmd = L"CG 1-2 ADD 1 BBTELEFONARE 1";\r
                        else if(wcmd.substr(0, 1) == L"4")\r
                                wcmd = L"PLAY 1-1 DV FILTER yadif=1:-1 LOOP";\r
+                       else if(wcmd.substr(0, 1) == L"5")\r
+                       {\r
+                               auto file = wcmd.substr(2, wcmd.length()-1);\r
+                               wcmd = L"PLAY 1-1 " + file + L" LOOP\r\n" \r
+                                          L"PLAY 1-2 " + file + L" LOOP\r\n" \r
+                                          L"PLAY 1-3 " + file + L" LOOP\r\n"\r
+                                          L"PLAY 2-1 " + file + L" LOOP\r\n" \r
+                                          L"PLAY 2-2 " + file + L" LOOP\r\n" \r
+                                          L"PLAY 2-3 " + file + L" LOOP\r\n";\r
+                       }\r
                        else if(wcmd.substr(0, 1) == L"X")\r
                        {\r
                                int num = 0;\r