boost::circular_buffer<size_t> sync_buffer_ { audio_cadence_.size() };
spl::shared_ptr<core::frame_factory> frame_factory_;
core::audio_channel_layout channel_layout_;
- ffmpeg::frame_muxer muxer_ { in_format_desc_.framerate, frame_factory_, out_format_desc_, channel_layout_, filter_, ffmpeg::filter::is_deinterlacing(filter_) };
+ ffmpeg::frame_muxer muxer_ {
+ in_format_desc_.framerate,
+ { ffmpeg::create_input_pad(in_format_desc_, channel_layout_.num_channels) },
+ frame_factory_,
+ out_format_desc_,
+ channel_layout_,
+ filter_,
+ ffmpeg::filter::is_deinterlacing(filter_)
+ };
core::constraints constraints_ { in_format_desc_.width, in_format_desc_.height };
<< msg_info(print() + L" Failed to start input stream.")
<< boost::errinfo_api_function("StartStreams"));
+ // Wait for first frame until returning or give up after 2 seconds.
+ caspar::timer timeout_timer;
+
+ while (frame_buffer_.size() < 1 && timeout_timer.elapsed() < 2.0)
+ boost::this_thread::sleep_for(boost::chrono::milliseconds(1));
+
CASPAR_LOG(info) << print() << L" Initialized";
}
video_frame->data[0] = reinterpret_cast<uint8_t*>(video_bytes);
video_frame->linesize[0] = video->GetRowBytes();
- video_frame->format = PIX_FMT_UYVY422;
+ video_frame->format = AVPixelFormat::AV_PIX_FMT_UYVY422;
video_frame->width = video->GetWidth();
video_frame->height = video->GetHeight();
video_frame->interlaced_frame = in_format_desc_.field_mode != core::field_mode::progressive;
// PUSH
- muxer_.push(audio_buffer);
+ muxer_.push({ audio_buffer });
muxer_.push(static_cast<std::shared_ptr<AVFrame>>(video_frame));
// POLL