X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_format.h;h=fdbe1bd3ee49fff95159360fd029fa9a0d5eaaaa;hb=f054618ec557df435df17047f6d72b5d36e4b496;hp=bdcf3f8ac47d1167baf294e062e77968f7013337;hpb=6853b5cf1073f6d3696e5842d994ba89d88dc126;p=casparcg diff --git a/core/video_format.h b/core/video_format.h index bdcf3f8ac..fdbe1bd3e 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 @@ -11,35 +31,50 @@ struct video_format enum type { pal = 0, - //ntsc, - //x576p2500, + ntsc, + x576p2500, x720p2500, x720p5000, - //x720p5994, - //x720p6000, - //x1080p2397, - //x1080p2400, + x720p5994, + x720p6000, + x1080p2397, + x1080p2400, x1080i5000, - //x1080i5994, - //x1080i6000, + x1080i5994, + x1080i6000, x1080p2500, - //x1080p2997, - //x1080p3000, - count, - invalid + 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,21 @@ 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_bytes_per_sample; + 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); };