X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fvideo_format.h;h=593671540f613f0efab44333f116bd1545ad0027;hb=a6f5b702bc78bee88f41480ac558e8a0b0c9f111;hp=672e18f6076763367054bb75938c5d58e87fe5a5;hpb=188e7cc6354e055e1a0c5453c20f47881ace9d98;p=casparcg diff --git a/core/video_format.h b/core/video_format.h index 672e18f60..593671540 100644 --- a/core/video_format.h +++ b/core/video_format.h @@ -1,9 +1,29 @@ +/* +* Copyright (c) 2011 Sveriges Television AB +* +* This file is part of CasparCG (www.casparcg.com). +* +* 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 . +* +* Author: Robert Nagy, ronag89@gmail.com +*/ + #pragma once +#include #include -#include - namespace caspar { namespace core { struct video_format @@ -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,25 +83,33 @@ 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; + std::vector audio_cadence; + static const video_format_desc& get(video_format::type format); static const video_format_desc& get(const std::wstring& name); -}; - -inline bool operator==(const video_format_desc& rhs, const video_format_desc& lhs) -{ - return rhs.format == lhs.format; -} + + bool operator==(const video_format_desc& lhs) + { + return format == lhs.format; + } -inline bool operator!=(const video_format_desc& rhs, const video_format_desc& lhs) -{ - return !(rhs == lhs); -} + bool operator!=(const video_format_desc& lhs) + { + return !(*this == lhs); + } +}; inline std::wostream& operator<<(std::wostream& out, const video_format_desc& format_desc) {