X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fffmpeg%2Fconsumer%2Fffmpeg_consumer.cpp;h=b3006ab0a2ebcd6a1bb9450178c6800d90a49efa;hb=b8c8660af595b9897af41183fe8b12786d45af98;hp=733659fb8e5a9f8983613122cbd2ce53c1abc702;hpb=3cccad0a2d401c4452274939f9729a3c4aa923cc;p=casparcg diff --git a/modules/ffmpeg/consumer/ffmpeg_consumer.cpp b/modules/ffmpeg/consumer/ffmpeg_consumer.cpp index 733659fb8..b3006ab0a 100644 --- a/modules/ffmpeg/consumer/ffmpeg_consumer.cpp +++ b/modules/ffmpeg/consumer/ffmpeg_consumer.cpp @@ -1,577 +1,940 @@ -/* -* 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 -*/ - -#include "../StdAfx.h" - -#include "../ffmpeg_error.h" - -#include "ffmpeg_consumer.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#if defined(_MSC_VER) -#pragma warning (push) -#pragma warning (disable : 4244) -#endif -extern "C" -{ - #define __STDC_CONSTANT_MACROS - #define __STDC_LIMIT_MACROS - #include - #include - #include -} -#if defined(_MSC_VER) -#pragma warning (pop) -#endif - -namespace caspar { namespace ffmpeg { - -struct option -{ - std::string name; - std::string value; - - option(std::string name, std::string value) - : name(std::move(name)) - , value(std::move(value)) - { - } -}; - -void set_format(AVOutputFormat*& format, const std::string& value) -{ - format = av_guess_format(value.c_str(), nullptr, nullptr); - - if(format == nullptr) - BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("f")); -} - -bool parse_format(AVOutputFormat*& format, std::vector