X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fffmpeg%2Fproducer%2Fmuxer%2Fframe_muxer.h;h=8364a282b3709b6855c6b8be59cfdf69b9defcbe;hb=009816de6e071c6a35c74b0954d04cf61005b971;hp=e91777bf4cc20e4f03e8d1ac755771f4c134899f;hpb=82b509232cd7250f4e55ba58a7560404aa92ae30;p=casparcg diff --git a/modules/ffmpeg/producer/muxer/frame_muxer.h b/modules/ffmpeg/producer/muxer/frame_muxer.h index e91777bf4..8364a282b 100644 --- a/modules/ffmpeg/producer/muxer/frame_muxer.h +++ b/modules/ffmpeg/producer/muxer/frame_muxer.h @@ -1,68 +1,71 @@ -/* -* 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 "display_mode.h" - -#include -#include - -#include -#include - -#include - -#include - -struct AVFrame; - -FORWARD2(caspar, core, struct pixel_format_desc); -FORWARD2(caspar, core, class frame); -FORWARD2(caspar, core, class frame_factory); -FORWARD2(caspar, core, class draw_frame); - -namespace caspar { namespace ffmpeg { - -class frame_muxer : boost::noncopyable -{ -public: - frame_muxer(double in_fps, const spl::shared_ptr& frame_factory, const core::video_format_desc& format_desc, const std::wstring& filter = L""); - - void push_video(const std::shared_ptr& frame); - void push_audio(const std::shared_ptr& frame); - - bool video_ready() const; - bool audio_ready() const; - - void clear(); - - bool empty() const; - core::draw_frame front() const; - void pop(); - - uint32_t calc_nb_frames(uint32_t nb_frames) const; -private: - struct impl; - spl::shared_ptr impl_; -}; - -}} \ No newline at end of file +/* +* 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 "display_mode.h" +#include "../filter/audio_filter.h" + +#include +#include + +#include +#include +#include + +#include +#include + +#include + +struct AVFrame; + +namespace caspar { namespace ffmpeg { + +class frame_muxer : boost::noncopyable +{ +public: + frame_muxer( + boost::rational in_framerate, + std::vector audio_input_pads, + const spl::shared_ptr& frame_factory, + const core::video_format_desc& format_desc, + const core::audio_channel_layout& channel_layout, + const std::wstring& filter, + bool multithreaded_filter); + + void push(const std::shared_ptr& video_frame); + void push(const std::vector>& audio_samples_per_stream); + + bool video_ready() const; + bool audio_ready() const; + + core::draw_frame poll(); + + boost::rational out_framerate() const; + + uint32_t calc_nb_frames(uint32_t nb_frames) const; +private: + struct impl; + spl::shared_ptr impl_; +}; + +}}