X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fdecklink%2Fproducer%2Fdecklink_producer.cpp;h=a6ead70661933b9bf96cc44f518ccd0ff0bc96da;hb=e0e1a2b1fdcab66e8da72e3eaa2db5564f8f9d72;hp=e08b3a6d5d52462f1051eabcf75f666dd3ff9780;hpb=726897adbf881d3b75f171fff24f2b917ba5f05a;p=casparcg diff --git a/modules/decklink/producer/decklink_producer.cpp b/modules/decklink/producer/decklink_producer.cpp index e08b3a6d5..a6ead7066 100644 --- a/modules/decklink/producer/decklink_producer.cpp +++ b/modules/decklink/producer/decklink_producer.cpp @@ -113,7 +113,15 @@ class decklink_producer : boost::noncopyable, public IDeckLinkInputCallback boost::circular_buffer sync_buffer_ { audio_cadence_.size() }; spl::shared_ptr 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 }; @@ -171,6 +179,12 @@ public: << 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"; } @@ -220,7 +234,7 @@ public: video_frame->data[0] = reinterpret_cast(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; @@ -269,7 +283,7 @@ public: // PUSH - muxer_.push(audio_buffer); + muxer_.push({ audio_buffer }); muxer_.push(static_cast>(video_frame)); // POLL