X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fffmpeg%2Fproducer%2Faudio%2Faudio_decoder.h;h=0deb8292045c7bbb7162f407fc17ef9e0cb2a096;hb=726897adbf881d3b75f171fff24f2b917ba5f05a;hp=7d6bc9c7cba3a1911a9355dfe88bdacf16a939cf;hpb=e8b0425cb9d7eebb5140c34ae1d73071fe712900;p=casparcg diff --git a/modules/ffmpeg/producer/audio/audio_decoder.h b/modules/ffmpeg/producer/audio/audio_decoder.h index 7d6bc9c7c..0deb82920 100644 --- a/modules/ffmpeg/producer/audio/audio_decoder.h +++ b/modules/ffmpeg/producer/audio/audio_decoder.h @@ -1,70 +1,54 @@ -/* -* Copyright (c) 2011 Sveriges Television AB -* -* 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 - -#include - -struct AVPacket; -struct AVFormatContext; - -namespace caspar { - -namespace core { - -struct video_format_desc; - -} - -namespace ffmpeg { - -class audio_decoder : public monitor::observable - , boost::noncopyable -{ -public: - explicit audio_decoder(); - explicit audio_decoder(class input& input, const core::video_format_desc& format_desc); - - audio_decoder(audio_decoder&& other); - audio_decoder& operator=(audio_decoder&& other); - - std::shared_ptr operator()(); - - uint32_t nb_frames() const; - - std::wstring print() const; - - // monitor::observable - - void subscribe(const monitor::observable::observer_ptr& o) override; - void unsubscribe(const monitor::observable::observer_ptr& o) override; - -private: - struct impl; - spl::shared_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(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_; +}; + +}}