X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fffmpeg%2Fproducer%2Fframe_muxer.cpp;h=4dfbcebf234e71ad09442994fe0902e9e52d1dca;hb=ffcb75eabba1d77eab8d83447136261462e3e088;hp=14a20ddf6318eefffac7c44e96900b89e2037e53;hpb=6217d51c8c995dd3f3f3b25be6aa14179c18239f;p=casparcg diff --git a/modules/ffmpeg/producer/frame_muxer.cpp b/modules/ffmpeg/producer/frame_muxer.cpp index 14a20ddf6..4dfbcebf2 100644 --- a/modules/ffmpeg/producer/frame_muxer.cpp +++ b/modules/ffmpeg/producer/frame_muxer.cpp @@ -136,7 +136,7 @@ display_mode::type get_display_mode(const core::field_mode::type in_mode, double struct frame_muxer::implementation : boost::noncopyable { std::deque>> video_streams_; - std::deque> audio_streams_; + std::deque audio_streams_; std::deque> frame_buffer_; display_mode::type display_mode_; const double in_fps_; @@ -226,9 +226,9 @@ struct frame_muxer::implementation : boost::noncopyable // Fix field-order if needed if(frame->get_type() == core::field_mode::lower && format_desc_.field_mode == core::field_mode::upper) - frame->get_frame_transform().fill_translation[1] += 1.0/static_cast(frame->get_pixel_format_desc().planes[0].height); + frame->get_frame_transform().fill_translation[1] += 1.0/static_cast(format_desc_.height); else if(frame->get_type() == core::field_mode::upper && format_desc_.field_mode == core::field_mode::lower) - frame->get_frame_transform().fill_translation[1] -= 1.0/static_cast(frame->get_pixel_format_desc().planes[0].height); + frame->get_frame_transform().fill_translation[1] -= 1.0/static_cast(format_desc_.height); video_streams_.back().push(frame); ++video_frame_count_; @@ -238,12 +238,12 @@ struct frame_muxer::implementation : boost::noncopyable BOOST_THROW_EXCEPTION(invalid_operation() << source_info("frame_muxer") << msg_info("video-stream overflow. This can be caused by incorrect frame-rate. Check clip meta-data.")); } - void push(const std::shared_ptr>& audio_samples) + void push(const std::shared_ptr& audio_samples) { if(!audio_samples) { CASPAR_LOG(debug) << L"audio-chunk-count: " << audio_sample_count_/format_desc_.audio_samples_per_frame; - audio_streams_.push_back(std::vector()); + audio_streams_.push_back(core::audio_buffer()); audio_sample_count_ = 0; return; } @@ -276,14 +276,14 @@ struct frame_muxer::implementation : boost::noncopyable return frame; } - std::vector pop_audio() + core::audio_buffer pop_audio() { CASPAR_VERIFY(audio_streams_.front().size() >= format_desc_.audio_samples_per_frame); auto begin = audio_streams_.front().begin(); auto end = begin + format_desc_.audio_samples_per_frame; - auto samples = std::vector(begin, end); + auto samples = core::audio_buffer(begin, end); audio_streams_.front().erase(begin, end); return samples; @@ -410,7 +410,7 @@ struct frame_muxer::implementation : boost::noncopyable frame_muxer::frame_muxer(double in_fps, const safe_ptr& frame_factory) : impl_(new implementation(in_fps, frame_factory)){} void frame_muxer::push(const std::shared_ptr& video_frame, int hints){impl_->push(video_frame, hints);} -void frame_muxer::push(const std::shared_ptr>& audio_samples){return impl_->push(audio_samples);} +void frame_muxer::push(const std::shared_ptr& audio_samples){return impl_->push(audio_samples);} void frame_muxer::commit(){impl_->commit();} safe_ptr frame_muxer::pop(){return impl_->pop();} size_t frame_muxer::size() const {return impl_->size();}