]> git.sesse.net Git - casparcg/blobdiff - modules/ffmpeg/producer/audio/audio_decoder.h
[ffmpeg] Reimplemented support for playing all audio streams in a clip and treating...
[casparcg] / modules / ffmpeg / producer / audio / audio_decoder.h
index 3a1de55eeb4bf26ba1cf481c3c78f98191a18572..6c06ea941cedf5b03ef910a90fabd447aa75e5fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+* Copyright 2013 Sveriges Television AB http://casparcg.com/
 *
 * This file is part of CasparCG (www.casparcg.com).
 *
 
 #pragma once
 
-#include <core/mixer/audio/audio_mixer.h>
-#include <core/monitor/monitor.h>
-
 #include <common/memory.h>
 
+#include <core/frame/frame.h>
+
 #include <boost/noncopyable.hpp>
 
 struct AVPacket;
+struct AVFrame;
 struct AVFormatContext;
 
 namespace caspar { namespace ffmpeg {
-       
-class audio_decoder : public boost::noncopyable
+
+class audio_decoder : boost::noncopyable
 {
 public:
-       explicit audio_decoder(class input& input, const core::video_format_desc& format_desc);
-       
-       audio_decoder(audio_decoder&& other);
-       audio_decoder& operator=(audio_decoder&& other);
+       explicit audio_decoder(int stream_index, const spl::shared_ptr<AVFormatContext>& context, int out_samplerate);
 
-       std::shared_ptr<AVFrame> operator()();
+       bool ready() const;
+       void push(const std::shared_ptr<AVPacket>& packet);
+       std::shared_ptr<core::mutable_audio_buffer> poll();
 
-       uint32_t nb_frames() const;
-       
-       std::wstring print() const;
-       
-       core::monitor::subject& monitor_output();
+       int     num_channels() const;
+       uint64_t ffmpeg_channel_layout() const;
 
+       std::wstring print() const;
 private:
-       struct impl;
-       spl::shared_ptr<impl> impl_;
+       struct implementation;
+       spl::shared_ptr<implementation> impl_;
 };
 
-}}
\ No newline at end of file
+}}