struct frame_muxer::implementation : boost::noncopyable\r
{ \r
std::deque<std::queue<safe_ptr<write_frame>>> video_streams_;\r
- std::deque<std::vector<int16_t>> audio_streams_;\r
+ std::deque<core::audio_buffer> audio_streams_;\r
std::deque<safe_ptr<basic_frame>> frame_buffer_;\r
display_mode::type display_mode_;\r
const double in_fps_;\r
\r
// Fix field-order if needed\r
if(frame->get_type() == core::field_mode::lower && format_desc_.field_mode == core::field_mode::upper)\r
- frame->get_frame_transform().fill_translation[1] += 0.5/static_cast<double>(frame->get_pixel_format_desc().planes[0].height);\r
+ frame->get_frame_transform().fill_translation[1] += 1.0/static_cast<double>(format_desc_.height);\r
else if(frame->get_type() == core::field_mode::upper && format_desc_.field_mode == core::field_mode::lower)\r
- frame->get_frame_transform().fill_translation[1] -= 0.5/static_cast<double>(frame->get_pixel_format_desc().planes[0].height);\r
+ frame->get_frame_transform().fill_translation[1] -= 1.0/static_cast<double>(format_desc_.height);\r
\r
video_streams_.back().push(frame);\r
++video_frame_count_;\r
}\r
\r
if(video_streams_.back().size() > 8)\r
- BOOST_THROW_EXCEPTION(invalid_operation() << source_info("frame_muxer") << msg_info("audio-stream overflow. This can be caused by incorrect frame-rate. Check clip meta-data."));\r
+ 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."));\r
}\r
\r
- void push(const std::shared_ptr<std::vector<int16_t>>& audio_samples)\r
+ void push(const std::shared_ptr<core::audio_buffer>& audio_samples)\r
{\r
if(!audio_samples) \r
{\r
CASPAR_LOG(debug) << L"audio-chunk-count: " << audio_sample_count_/format_desc_.audio_samples_per_frame;\r
- audio_streams_.push_back(std::vector<int16_t>());\r
+ audio_streams_.push_back(core::audio_buffer());\r
audio_sample_count_ = 0;\r
return;\r
}\r
return frame;\r
}\r
\r
- std::vector<int16_t> pop_audio()\r
+ core::audio_buffer pop_audio()\r
{\r
CASPAR_VERIFY(audio_streams_.front().size() >= format_desc_.audio_samples_per_frame);\r
\r
auto begin = audio_streams_.front().begin();\r
auto end = begin + format_desc_.audio_samples_per_frame;\r
\r
- auto samples = std::vector<int16_t>(begin, end);\r
+ auto samples = core::audio_buffer(begin, end);\r
audio_streams_.front().erase(begin, end);\r
\r
return samples;\r
frame_muxer::frame_muxer(double in_fps, const safe_ptr<core::frame_factory>& frame_factory)\r
: impl_(new implementation(in_fps, frame_factory)){}\r
void frame_muxer::push(const std::shared_ptr<AVFrame>& video_frame, int hints){impl_->push(video_frame, hints);}\r
-void frame_muxer::push(const std::shared_ptr<std::vector<int16_t>>& audio_samples){return impl_->push(audio_samples);}\r
+void frame_muxer::push(const std::shared_ptr<core::audio_buffer>& audio_samples){return impl_->push(audio_samples);}\r
void frame_muxer::commit(){impl_->commit();}\r
safe_ptr<basic_frame> frame_muxer::pop(){return impl_->pop();}\r
size_t frame_muxer::size() const {return impl_->size();}\r