3 #include <common/memory/safe_ptr.h>
\r
5 #include <core/video_format.h>
\r
6 #include <core/producer/frame/pixel_format.h>
\r
7 #include <core/mixer/audio/audio_mixer.h>
\r
10 #if defined(_MSC_VER)
\r
11 #pragma warning (push)
\r
12 #pragma warning (disable : 4244)
\r
16 #include <libavutil/pixfmt.h>
\r
17 #include <libavcodec/avcodec.h>
\r
19 #if defined(_MSC_VER)
\r
20 #pragma warning (pop)
\r
24 struct AVFormatContext;
\r
31 struct pixel_format_desc;
\r
33 struct frame_factory;
\r
39 std::shared_ptr<core::audio_buffer> flush_audio();
\r
40 std::shared_ptr<core::audio_buffer> empty_audio();
\r
41 std::shared_ptr<AVFrame> flush_video();
\r
42 std::shared_ptr<AVFrame> empty_video();
\r
46 static const PixelFormat CASPAR_PIX_FMT_LUMA = PIX_FMT_MONOBLACK; // Just hijack some unual pixel format.
\r
48 core::field_mode::type get_mode(const AVFrame& frame);
\r
49 int make_alpha_format(int format); // NOTE: Be careful about CASPAR_PIX_FMT_LUMA, change it to PIX_FMT_GRAY8 if you want to use the frame inside some ffmpeg function.
\r
50 safe_ptr<core::write_frame> make_write_frame(const void* tag, const safe_ptr<AVFrame>& decoded_frame, const safe_ptr<core::frame_factory>& frame_factory, int hints);
\r
52 safe_ptr<AVPacket> create_packet();
\r
54 safe_ptr<AVCodecContext> open_codec(AVFormatContext& context, enum AVMediaType type, int& index);
\r
55 safe_ptr<AVFormatContext> open_input(const std::wstring& filename);
\r
57 bool is_sane_fps(AVRational time_base);
\r
58 AVRational fix_time_base(AVRational time_base);
\r
60 double read_fps(AVFormatContext& context, double fail_value);
\r
62 std::wstring print_mode(size_t width, size_t height, double fps, bool interlaced);
\r