]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/filter/audio_filter.h
[streaming_consumer] Implemented support for separating audio channels into separate...
[casparcg] / modules / ffmpeg / producer / filter / audio_filter.h
index 370bed04530a868571cfccfc3671a7104f30e91e..86da3a43caca61c0fb4e4b232981a7ab04c929ec 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <boost/rational.hpp>
 #include <boost/noncopyable.hpp>
+#include <boost/range/iterator_range.hpp>
 
 #include <string>
 #include <vector>
@@ -42,6 +43,7 @@ extern "C"
 #endif
 
 struct AVFrame;
+struct AVFilterLink;
 
 namespace caspar { namespace ffmpeg {
 
@@ -50,13 +52,13 @@ struct audio_input_pad
        boost::rational<int>    time_base;
        int                                             sample_rate;
        AVSampleFormat                  sample_fmt;
-       std::int64_t                    audio_channel_layout;
+       std::uint64_t                   audio_channel_layout;
 
        audio_input_pad(
                        boost::rational<int> time_base,
                        int sample_rate,
                        AVSampleFormat sample_fmt,
-                       std::int64_t audio_channel_layout)
+                       std::uint64_t audio_channel_layout)
                : time_base(std::move(time_base))
                , sample_rate(sample_rate)
                , sample_fmt(sample_fmt)
@@ -69,12 +71,12 @@ struct audio_output_pad
 {
        std::vector<int>                        sample_rates;
        std::vector<AVSampleFormat>     sample_fmts;
-       std::vector<std::int64_t>       audio_channel_layouts;
+       std::vector<std::uint64_t>      audio_channel_layouts;
 
        audio_output_pad(
                        std::vector<int> sample_rates,
                        std::vector<AVSampleFormat> sample_fmts,
-                       std::vector<std::int64_t> audio_channel_layouts)
+                       std::vector<std::uint64_t> audio_channel_layouts)
                : sample_rates(std::move(sample_rates))
                , sample_fmts(std::move(sample_fmts))
                , audio_channel_layouts(std::move(audio_channel_layouts))
@@ -92,11 +94,15 @@ public:
        audio_filter(audio_filter&& other);
        audio_filter& operator=(audio_filter&& other);
 
+       void set_guaranteed_output_num_samples_per_frame(int output_pad_id, int num_samples);
        void push(int input_pad_id, const std::shared_ptr<AVFrame>& frame);
+       void push(int input_pad_id, const boost::iterator_range<const int32_t*>& frame_samples);
        std::shared_ptr<AVFrame> poll(int output_pad_id);
        std::vector<spl::shared_ptr<AVFrame>> poll_all(int output_pad_id);
 
        std::wstring filter_str() const;
+       int get_num_output_pads() const;
+       const AVFilterLink& get_output_pad_info(int output_pad_id) const;
 private:
        struct implementation;
        spl::shared_ptr<implementation> impl_;