X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_format.h;h=58634a827ba742f361900a434051e3ab9fde9418;hb=34420e565fdeb9b862d59835c212f44ebdda8d5b;hp=672e18f6076763367054bb75938c5d58e87fe5a5;hpb=a33eb71489ededc77101c2136b50690fd55e89e2;p=casparcg diff --git a/core/video_format.h b/core/video_format.h index 672e18f60..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); };