/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
*\r
-* This file is part of CasparCG.\r
+* This file is part of CasparCG (www.casparcg.com).\r
*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
*/\r
\r
#pragma once\r
\r
+#include <vector>\r
#include <string>\r
\r
-#include <common/compiler/vs/disable_silly_warnings.h>\r
-\r
namespace caspar { namespace core {\r
\r
struct video_format \r
};\r
};\r
\r
-struct video_mode \r
+struct field_mode \r
{ \r
enum type\r
{\r
- progressive,\r
- lower,\r
- upper,\r
- count,\r
- invalid\r
+ empty = 0,\r
+ lower = 1,\r
+ upper = 2,\r
+ progressive = 3 // NOTE: progressive == lower | upper;\r
};\r
+\r
+ static std::wstring print(field_mode::type value)\r
+ {\r
+ switch(value)\r
+ {\r
+ case progressive:\r
+ return L"progressive"; \r
+ case lower:\r
+ return L"lower";\r
+ case upper:\r
+ return L"upper";\r
+ default:\r
+ return L"invalid";\r
+ }\r
+ }\r
};\r
\r
struct video_format_desc\r
\r
size_t width; // output frame width\r
size_t height; // output frame height\r
- video_mode::type mode; // progressive, interlaced upper field first, interlaced lower field first\r
+ size_t square_width;\r
+ size_t square_height;\r
+ field_mode::type field_mode; // progressive, interlaced upper field first, interlaced lower field first\r
double fps; // actual framerate, e.g. i50 = 25 fps, p50 = 50 fps\r
- double interval; // time between frames\r
+ size_t time_scale;\r
+ size_t duration;\r
+ size_t field_count;\r
size_t size; // output frame size in bytes \r
std::wstring name; // name of output format\r
\r
+ size_t audio_sample_rate;\r
+ size_t audio_channels;\r
+ std::vector<size_t> audio_cadence;\r
+\r
static const video_format_desc& get(video_format::type format);\r
static const video_format_desc& get(const std::wstring& name);\r
-};\r
-\r
-inline bool operator==(const video_format_desc& rhs, const video_format_desc& lhs)\r
-{\r
- return rhs.format == lhs.format;\r
-}\r
+ \r
+ bool operator==(const video_format_desc& lhs)\r
+ {\r
+ return format == lhs.format;\r
+ }\r
\r
-inline bool operator!=(const video_format_desc& rhs, const video_format_desc& lhs)\r
-{\r
- return !(rhs == lhs);\r
-}\r
+ bool operator!=(const video_format_desc& lhs)\r
+ {\r
+ return !(*this == lhs);\r
+ }\r
+};\r
\r
inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc)\r
{\r