2 * Copyright 2013 Sveriges Television AB http://casparcg.com/
\r
4 * This file is part of CasparCG (www.casparcg.com).
\r
6 * CasparCG is free software: you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation, either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * CasparCG is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
\r
19 * Author: Robert Nagy, ronag89@gmail.com
\r
27 namespace caspar { namespace core {
\r
29 struct video_format
\r
75 progressive = 3 // NOTE: progressive == lower | upper;
\r
78 static std::wstring print(field_mode::type value)
\r
83 return L"progressive";
\r
94 struct video_format_desc
\r
96 video_format::type format; // video output format
\r
98 size_t width; // output frame width
\r
99 size_t height; // output frame height
\r
100 size_t square_width;
\r
101 size_t square_height;
\r
102 field_mode::type field_mode; // progressive, interlaced upper field first, interlaced lower field first
\r
103 double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps
\r
106 size_t field_count;
\r
107 size_t size; // output frame size in bytes
\r
108 std::wstring name; // name of output format
\r
110 size_t audio_sample_rate;
\r
111 std::vector<size_t> audio_cadence; // rotating optimal number of samples per frame
\r
113 static const video_format_desc& get(video_format::type format);
\r
114 static const video_format_desc& get(const std::wstring& name);
\r
116 bool operator==(const video_format_desc& lhs)
\r
118 return format == lhs.format;
\r
121 bool operator!=(const video_format_desc& lhs)
\r
123 return !(*this == lhs);
\r
127 inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc)
\r
129 out << format_desc.name.c_str();
\r