switch(fmt)\r
{\r
case video_format::pal: return VID_FMT_PAL;\r
- case video_format::ntsc: return VID_FMT_NTSC;\r
+ //case video_format::ntsc: return VID_FMT_NTSC;\r
case video_format::x576p2500: return VID_FMT_INVALID; //not supported\r
case video_format::x720p2500: return VID_FMT_720P_2500;\r
case video_format::x720p5000: return VID_FMT_720P_5000;\r
- case video_format::x720p5994: return VID_FMT_720P_5994;\r
- case video_format::x720p6000: return VID_FMT_720P_6000;\r
- case video_format::x1080p2397: return VID_FMT_1080P_2397;\r
- case video_format::x1080p2400: return VID_FMT_1080P_2400;\r
+ //case video_format::x720p5994: return VID_FMT_720P_5994;\r
+ //case video_format::x720p6000: return VID_FMT_720P_6000;\r
+ //case video_format::x1080p2397: return VID_FMT_1080P_2397;\r
+ //case video_format::x1080p2400: return VID_FMT_1080P_2400;\r
case video_format::x1080i5000: return VID_FMT_1080I_5000;\r
- case video_format::x1080i5994: return VID_FMT_1080I_5994;\r
- case video_format::x1080i6000: return VID_FMT_1080I_6000;\r
+ //case video_format::x1080i5994: return VID_FMT_1080I_5994;\r
+ //case video_format::x1080i6000: return VID_FMT_1080I_6000;\r
case video_format::x1080p2500: return VID_FMT_1080P_2500;\r
- case video_format::x1080p2997: return VID_FMT_1080P_2997;\r
- case video_format::x1080p3000: return VID_FMT_1080P_3000;\r
+ //case video_format::x1080p2997: return VID_FMT_1080P_2997;\r
+ //case video_format::x1080p3000: return VID_FMT_1080P_3000;\r
default: return VID_FMT_INVALID;\r
}\r
}\r
switch(fmt)\r
{\r
case video_format::pal: return bmdModePAL;\r
- case video_format::ntsc: return bmdModeNTSC;\r
+ //case video_format::ntsc: return bmdModeNTSC;\r
case video_format::x576p2500: return ULONG_MAX; //not supported\r
case video_format::x720p5000: return bmdModeHD720p50;\r
- case video_format::x720p5994: return bmdModeHD720p5994;\r
- case video_format::x720p6000: return bmdModeHD720p60;\r
- case video_format::x1080p2397: return bmdModeHD1080p2398;\r
- case video_format::x1080p2400: return bmdModeHD1080p24;\r
+ //case video_format::x720p5994: return bmdModeHD720p5994;\r
+ //case video_format::x720p6000: return bmdModeHD720p60;\r
+ //case video_format::x1080p2397: return bmdModeHD1080p2398;\r
+ //case video_format::x1080p2400: return bmdModeHD1080p24;\r
case video_format::x1080i5000: return bmdModeHD1080i50;\r
- case video_format::x1080i5994: return bmdModeHD1080i5994;\r
- case video_format::x1080i6000: return bmdModeHD1080i6000;\r
+ //case video_format::x1080i5994: return bmdModeHD1080i5994;\r
+ //case video_format::x1080i6000: return bmdModeHD1080i6000;\r
case video_format::x1080p2500: return bmdModeHD1080p25;\r
- case video_format::x1080p2997: return bmdModeHD1080p2997;\r
- case video_format::x1080p3000: return bmdModeHD1080p30;\r
+ //case video_format::x1080p2997: return bmdModeHD1080p2997;\r
+ //case video_format::x1080p3000: return bmdModeHD1080p30;\r
default: return ULONG_MAX;\r
}\r
}\r
\r
#include <array>\r
\r
-#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (f), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s) }\r
+#define DEFINE_VIDEOFORMATDESC(w, h, m, f, s, fmt) { (fmt), (w), (h), (m), (f), (m == video_mode::progressive ? f : f/2.0), (1.0/(m == video_mode::progressive ? f : f/2.0)), ((w)*(h)*4), (s) }\r
\r
namespace caspar { namespace core {\r
\r
const video_format_desc format_descs[video_format::invalid] = \r
{ \r
DEFINE_VIDEOFORMATDESC(720, 576, video_mode::upper, 50, TEXT("PAL"), video_format::pal ), \r
- DEFINE_VIDEOFORMATDESC(720, 486, video_mode::lower, 60/1.001, TEXT("NTSC"), video_format::ntsc ), \r
+ //DEFINE_VIDEOFORMATDESC(720, 486, video_mode::lower, 60/1.001, TEXT("NTSC"), video_format::ntsc ), \r
DEFINE_VIDEOFORMATDESC(720, 576, video_mode::progressive, 25, TEXT("576p2500"), video_format::x576p2500 ),\r
DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 25, TEXT("720p2500"), video_format::x720p2500 ), \r
DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 50, TEXT("720p5000"), video_format::x720p5000 ), \r
- DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60/1.001, TEXT("720p5994"), video_format::x720p5994 ),\r
- DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60, TEXT("720p6000"), video_format::x720p6000 ),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24/1.001, TEXT("1080p2397"), video_format::x1080p2397),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24, TEXT("1080p2400"), video_format::x1080p2400),\r
+ //DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60/1.001, TEXT("720p5994"), video_format::x720p5994 ),\r
+ //DEFINE_VIDEOFORMATDESC(1280, 720, video_mode::progressive, 60, TEXT("720p6000"), video_format::x720p6000 ),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24/1.001, TEXT("1080p2397"), video_format::x1080p2397),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 24, TEXT("1080p2400"), video_format::x1080p2400),\r
DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 50, TEXT("1080i5000"), video_format::x1080i5000),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60/1.001, TEXT("1080i5994"), video_format::x1080i5994),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60, TEXT("1080i6000"), video_format::x1080i6000),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60/1.001, TEXT("1080i5994"), video_format::x1080i5994),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::upper, 60, TEXT("1080i6000"), video_format::x1080i6000),\r
DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 25, TEXT("1080p2500"), video_format::x1080p2500),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30/1.001, TEXT("1080p2997"), video_format::x1080p2997),\r
- DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30, TEXT("1080p3000"), video_format::x1080p3000),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30/1.001, TEXT("1080p2997"), video_format::x1080p2997),\r
+ //DEFINE_VIDEOFORMATDESC(1920, 1080, video_mode::progressive, 30, TEXT("1080p3000"), video_format::x1080p3000),\r
DEFINE_VIDEOFORMATDESC(0, 0, video_mode::invalid, -1, TEXT("invalid"), video_format::invalid)\r
};\r
\r
#include "../../processor/frame_processor_device.h"\r
\r
#include <common/concurrency/executor.h>\r
+#include <common/utility/timer.h>\r
\r
#include <boost/filesystem.hpp>\r
\r
\r
auto frame = render_simple_frame();\r
\r
- auto running_fps = ax_->GetFPS();\r
- auto target_fps = static_cast<int>(format_desc_.mode == video_mode::progressive ? format_desc_.fps : format_desc_.fps/2.0);\r
+ auto running_fps = static_cast<int>(ax_->GetFPS());\r
+ auto target_fps = static_cast<int>(format_desc_.actual_fps);\r
if(target_fps < running_fps)\r
frame = draw_frame::interlace(frame, render_simple_frame(), format_desc_.mode);\r
return frame;\r
}\r
- \r
+ \r
+ timer timer_;\r
std::wstring print() const{ return L"flash[" + boost::filesystem::wpath(filename_).filename() + L"] Render thread"; }\r
std::string bprint() const{ return narrow(print()); }\r
\r
\r
safe_ptr<draw_frame> render_simple_frame()\r
{\r
+ timer_.wait(ax_->GetFPS()); // Tick doesnt work on nested timelines, force an actual sync\r
+\r
ax_->Tick();\r
\r
if(ax_->InvalidRect())\r
{\r
executor_.begin_invoke([=]\r
{\r
- auto frame = draw_frame::empty();\r
+ if(!renderer_)\r
+ return;\r
+\r
try\r
{\r
- if(renderer_)\r
- frame = renderer_->render_frame();\r
+ auto frame = draw_frame::empty();\r
+ do{frame = renderer_->render_frame();}\r
+ while(frame_buffer_.try_push(frame) && frame == draw_frame::empty());\r
}\r
catch(...)\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
renderer_ = nullptr;\r
}\r
- frame_buffer_.try_push(frame);\r
}); \r
} \r
return tail_;\r