#include <boost/circular_buffer.hpp>\r
#include <boost/timer.hpp>\r
\r
-namespace caspar { \r
+namespace caspar { namespace decklink { \r
\r
struct configuration\r
{\r
\r
size_t preroll_count_;\r
\r
- boost::circular_buffer<std::vector<int16_t>> audio_container_;\r
+ boost::circular_buffer<std::vector<int32_t>> audio_container_;\r
\r
tbb::concurrent_bounded_queue<std::shared_ptr<core::read_frame>> video_frame_buffer_;\r
tbb::concurrent_bounded_queue<std::shared_ptr<core::read_frame>> audio_frame_buffer_;\r
\r
void enable_audio()\r
{\r
- if(FAILED(output_->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType16bitInteger, 2, bmdAudioOutputStreamTimestamped)))\r
+ if(FAILED(output_->EnableAudioOutput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, 2, bmdAudioOutputStreamTimestamped)))\r
BOOST_THROW_EXCEPTION(caspar_exception() << msg_info(narrow(print()) + " Could not enable audio output."));\r
\r
if(FAILED(output_->SetAudioCallback(this)))\r
\r
std::shared_ptr<core::read_frame> frame; \r
video_frame_buffer_.pop(frame); \r
- schedule_next_video(make_safe(frame)); \r
+ schedule_next_video(make_safe_ptr(frame)); \r
}\r
catch(...)\r
{\r
{\r
std::shared_ptr<core::read_frame> frame;\r
audio_frame_buffer_.pop(frame);\r
- schedule_next_audio(make_safe(frame)); \r
+ schedule_next_audio(make_safe_ptr(frame)); \r
}\r
}\r
catch(...)\r
{\r
const int sample_frame_count = frame->audio_data().size()/format_desc_.audio_channels;\r
\r
- audio_container_.push_back(std::vector<int16_t>(frame->audio_data().begin(), frame->audio_data().end()));\r
+ audio_container_.push_back(std::vector<int32_t>(frame->audio_data().begin(), frame->audio_data().end()));\r
\r
if(FAILED(output_->ScheduleAudioSamples(audio_container_.back().data(), sample_frame_count, (audio_scheduled_++) * sample_frame_count, format_desc_.audio_sample_rate, nullptr)))\r
CASPAR_LOG(error) << print() << L" Failed to schedule audio.";\r
}\r
}; \r
\r
-safe_ptr<core::frame_consumer> create_decklink_consumer(const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_consumer> create_consumer(const std::vector<std::wstring>& params) \r
{\r
if(params.size() < 1 || params[0] != L"DECKLINK")\r
return core::frame_consumer::empty();\r
return make_safe<decklink_consumer_proxy>(config);\r
}\r
\r
-safe_ptr<core::frame_consumer> create_decklink_consumer(const boost::property_tree::ptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
{\r
configuration config;\r
\r
return make_safe<decklink_consumer_proxy>(config);\r
}\r
\r
-}\r
+}}\r
\r
/*\r
##############################################################################\r