From: Helge Norberg Date: Tue, 27 Sep 2016 15:46:47 +0000 (+0200) Subject: Added boost::rational framerate in video_format_desc for convenience. X-Git-Tag: 2.1.0_Beta1~52 X-Git-Url: https://git.sesse.net/?p=casparcg;a=commitdiff_plain;h=e05a326e32e82cd89ecdcf58a481d835f9c1fca8 Added boost::rational framerate in video_format_desc for convenience. --- diff --git a/core/video_format.cpp b/core/video_format.cpp index b58e1f199..30db1e3fc 100644 --- a/core/video_format.cpp +++ b/core/video_format.cpp @@ -85,6 +85,7 @@ video_format_desc::video_format_desc( , square_height(square_height) , field_mode(field_mode) , fps(static_cast(time_scale) / static_cast(duration)) + , framerate(time_scale, duration) , time_scale(time_scale) , duration(duration) , field_count(field_mode == core::field_mode::progressive ? 1 : 2) diff --git a/core/video_format.h b/core/video_format.h index 90ff1f806..0016f2d24 100644 --- a/core/video_format.h +++ b/core/video_format.h @@ -27,6 +27,8 @@ #include +#include + namespace caspar { namespace core { enum class video_format @@ -83,22 +85,23 @@ ENUM_ENABLE_BITWISE(field_mode); struct video_format_desc final { - video_format format; + video_format format; - int width; - int height; - int square_width; - int square_height; - core::field_mode field_mode; // progressive, interlaced upper field first, interlaced lower field first - double fps; // actual framerate = duration/time_scale, e.g. i50 = 25 fps, p50 = 50 fps - int time_scale; - int duration; - int field_count; - std::size_t size; // frame size in bytes - std::wstring name; // name of output format + int width; + int height; + int square_width; + int square_height; + core::field_mode field_mode; // progressive, interlaced upper field first, interlaced lower field first + double fps; // actual framerate = duration/time_scale, e.g. i50 = 25 fps, p50 = 50 fps + boost::rational framerate; + int time_scale; + int duration; + int field_count; + std::size_t size; // frame size in bytes + std::wstring name; // name of output format - int audio_sample_rate; - std::vector audio_cadence; // rotating optimal number of samples per frame + int audio_sample_rate; + std::vector audio_cadence; // rotating optimal number of samples per frame video_format_desc(video_format format, int width,