2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>
\r
4 * This file is part of CasparCG.
\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
25 #include <common/compiler/vs/disable_silly_warnings.h>
\r
27 namespace caspar { namespace core {
\r
29 struct video_format
\r
60 progressive = 3 // NOTE: progressive == lower | upper;
\r
63 static std::wstring print(video_mode::type value)
\r
68 return L"progressive";
\r
79 struct video_format_desc
\r
81 video_format::type format; // video output format
\r
83 size_t width; // output frame width
\r
84 size_t height; // output frame height
\r
85 video_mode::type mode; // progressive, interlaced upper field first, interlaced lower field first
\r
86 double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps
\r
90 size_t size; // output frame size in bytes
\r
91 std::wstring name; // name of output format
\r
93 size_t audio_bytes_per_sample;
\r
94 size_t audio_sample_rate;
\r
95 size_t audio_channels;
\r
96 size_t audio_samples_per_frame;
\r
98 static const video_format_desc& get(video_format::type format);
\r
99 static const video_format_desc& get(const std::wstring& name);
\r
102 inline bool operator==(const video_format_desc& rhs, const video_format_desc& lhs)
\r
104 return rhs.format == lhs.format;
\r
107 inline bool operator!=(const video_format_desc& rhs, const video_format_desc& lhs)
\r
109 return !(rhs == lhs);
\r
112 inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc)
\r
114 out << format_desc.name.c_str();
\r