X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fffmpeg%2Fproducer%2Futil%2Futil.h;h=be76ca5dc81e393b130c421ab6d7b270bb9e9d55;hb=726897adbf881d3b75f171fff24f2b917ba5f05a;hp=abd167a0180f3708a2105ec736db7a33b49c001c;hpb=cd1a44a41dd64c05de067ba728c285f001b66bf3;p=casparcg diff --git a/modules/ffmpeg/producer/util/util.h b/modules/ffmpeg/producer/util/util.h index abd167a01..be76ca5dc 100644 --- a/modules/ffmpeg/producer/util/util.h +++ b/modules/ffmpeg/producer/util/util.h @@ -26,12 +26,15 @@ #include #include -#include +#include +#include #include #include #include +#include +#include #if defined(_MSC_VER) #pragma warning (push) @@ -52,7 +55,15 @@ struct AVRational; struct AVCodecContext; namespace caspar { namespace ffmpeg { - + +enum class FFMPEG_Resource { + FFMPEG_FILE, + FFMPEG_DEVICE, + FFMPEG_STREAM +}; + +typedef std::vector> ffmpeg_options; + // Utils core::field_mode get_mode(const AVFrame& frame); @@ -71,7 +82,10 @@ spl::shared_ptr open_input(const std::wstring& filename); bool is_sane_fps(AVRational time_base); AVRational fix_time_base(AVRational time_base); -std::shared_ptr flush(); +std::shared_ptr flush_audio(); +std::shared_ptr empty_audio(); +std::shared_ptr flush_video(); +std::shared_ptr empty_video(); double read_fps(AVFormatContext& context, double fail_value); boost::rational read_framerate(AVFormatContext& context, const boost::rational& fail_value); @@ -87,4 +101,6 @@ core::audio_channel_layout get_audio_channel_layout(int num_channels, std::uint6 // av_get_default_channel_layout does not work for layouts not predefined in ffmpeg. This is needed to support > 8 channels. std::int64_t create_channel_layout_bitmask(int num_channels); +std::vector find_audio_cadence(const boost::rational& framerate); + }}