X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fffmpeg%2Fproducer%2Faudio%2Faudio_decoder.h;h=6c06ea941cedf5b03ef910a90fabd447aa75e5fa;hb=009816de6e071c6a35c74b0954d04cf61005b971;hp=4cb89ce5d171de1b618f388ebe3f47ff005da9ab;hpb=8785073d7c9b371c81a8be02d3b8258544bdfa94;p=casparcg diff --git a/modules/ffmpeg/producer/audio/audio_decoder.h b/modules/ffmpeg/producer/audio/audio_decoder.h index 4cb89ce5d..6c06ea941 100644 --- a/modules/ffmpeg/producer/audio/audio_decoder.h +++ b/modules/ffmpeg/producer/audio/audio_decoder.h @@ -1,63 +1,54 @@ -/* -* copyright (c) 2010 Sveriges Television AB -* -* This file is part of CasparCG. -* -* 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 . -* -*/ -#pragma once - -#include "../util.h" - -#include - -#include - -#include - -#include -#include - -struct AVPacket; -struct AVFormatContext; - -namespace caspar { - -namespace core { - -struct video_format_desc; - -} - -namespace ffmpeg { - -class audio_decoder : boost::noncopyable -{ -public: - - typedef Concurrency::ISource& source_t; - typedef Concurrency::ITarget& target_t; - - explicit audio_decoder(source_t& source, target_t& target, AVFormatContext& context, const core::video_format_desc& format_desc); - - int64_t nb_frames() const; - -private: - - struct implementation; - safe_ptr impl_; -}; - -}} \ No newline at end of file +/* +* Copyright 2013 Sveriges Television AB http://casparcg.com/ +* +* 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 +*/ + +#pragma once + +#include + +#include + +#include + +struct AVPacket; +struct AVFrame; +struct AVFormatContext; + +namespace caspar { namespace ffmpeg { + +class audio_decoder : boost::noncopyable +{ +public: + explicit audio_decoder(int stream_index, const spl::shared_ptr& context, int out_samplerate); + + bool ready() const; + void push(const std::shared_ptr& packet); + std::shared_ptr poll(); + + int num_channels() const; + uint64_t ffmpeg_channel_layout() const; + + std::wstring print() const; +private: + struct implementation; + spl::shared_ptr impl_; +}; + +}}