X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_format.h;h=58634a827ba742f361900a434051e3ab9fde9418;hb=4df32ce9ef78323744ec05ab51a626c8ef7d20a0;hp=ae5e45910d538a1d7cb1086cd586a1f6bf7099ac;hpb=0791def326d8c23599935d600c125f3ec869c700;p=casparcg diff --git a/core/video_format.h b/core/video_format.h index ae5e45910..58634a827 100644 --- a/core/video_format.h +++ b/core/video_format.h @@ -1,3 +1,23 @@ +/* +* copyright (c) 2010 Sveriges Television AB +* +* This file is part of CasparCG. +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. + +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +*/ + #pragma once #include @@ -25,21 +45,36 @@ struct video_format x1080p2500, x1080p2997, x1080p3000, + x1080p5000, invalid, count }; }; -struct video_mode +struct field_mode { enum type { - progressive, - lower, - upper, - count, - invalid + empty = 0, + lower = 1, + upper = 2, + progressive = 3 // NOTE: progressive == lower | upper; }; + + static std::wstring print(field_mode::type value) + { + switch(value) + { + case progressive: + return L"progressive"; + case lower: + return L"lower"; + case upper: + return L"upper"; + default: + return L"invalid"; + } + } }; struct video_format_desc @@ -48,12 +83,20 @@ struct video_format_desc size_t width; // output frame width size_t height; // output frame height - video_mode::type mode; // progressive, interlaced upper field first, interlaced lower field first + size_t square_width; + size_t square_height; + field_mode::type field_mode; // progressive, interlaced upper field first, interlaced lower field first double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps - double interval; // time between frames + size_t time_scale; + size_t duration; + size_t field_count; size_t size; // output frame size in bytes std::wstring name; // name of output format + size_t audio_sample_rate; + size_t audio_channels; + size_t audio_samples_per_frame; + static const video_format_desc& get(video_format::type format); static const video_format_desc& get(const std::wstring& name); }; @@ -74,9 +117,4 @@ inline std::wostream& operator<<(std::wostream& out, const video_format_desc& fo return out; } -inline bool interlaced(double fps, const video_format_desc& format_desc) -{ - return abs(fps/2.0 - format_desc.fps) < 0.1; -} - }} \ No newline at end of file