]> git.sesse.net Git - casparcg/blobdiff - modules/decklink/producer/decklink_producer.cpp
2.0. audio:
[casparcg] / modules / decklink / producer / decklink_producer.cpp
index 54c84152be7b6dd9da1cb8c9d036b2c19f53d17d..f5734796641bd2b7354fadf797abd3e590590c6b 100644 (file)
@@ -36,7 +36,7 @@
 #include <common/memory/memclr.h>\r
 \r
 #include <core/mixer/write_frame.h>\r
-#include <core/producer/frame/audio_transform.h>\r
+#include <core/producer/frame/frame_transform.h>\r
 #include <core/producer/frame/frame_factory.h>\r
 \r
 #include <tbb/concurrent_queue.h>\r
@@ -124,7 +124,7 @@ public:
                                                                        << msg_info(narrow(print()) + " Could not enable video input.")\r
                                                                        << boost::errinfo_api_function("EnableVideoInput"));\r
 \r
-               if(FAILED(input_->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType16bitInteger, 2))) \r
+               if(FAILED(input_->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, 2))) \r
                        BOOST_THROW_EXCEPTION(caspar_exception() \r
                                                                        << msg_info(narrow(print()) + " Could not enable audio input.")\r
                                                                        << boost::errinfo_api_function("EnableAudioInput"));\r
@@ -184,8 +184,8 @@ public:
                        av_frame->format                        = PIX_FMT_UYVY422;\r
                        av_frame->width                         = video->GetWidth();\r
                        av_frame->height                        = video->GetHeight();\r
-                       av_frame->interlaced_frame      = format_desc_.mode != core::video_mode::progressive;\r
-                       av_frame->top_field_first       = format_desc_.mode == core::video_mode::upper ? 1 : 0;\r
+                       av_frame->interlaced_frame      = format_desc_.field_mode != core::field_mode::progressive;\r
+                       av_frame->top_field_first       = format_desc_.field_mode == core::field_mode::upper ? 1 : 0;\r
                                        \r
                        BOOST_FOREACH(auto& av_frame2, filter_.execute(av_frame))\r
                                muxer_.push(av_frame2);         \r
@@ -194,11 +194,11 @@ public:
                        if(audio && SUCCEEDED(audio->GetBytes(&bytes)))\r
                        {\r
                                auto sample_frame_count = audio->GetSampleFrameCount();\r
-                               auto audio_data = reinterpret_cast<short*>(bytes);\r
-                               muxer_.push(std::make_shared<std::vector<int16_t>>(audio_data, audio_data + sample_frame_count*2));\r
+                               auto audio_data = reinterpret_cast<int32_t*>(bytes);\r
+                               muxer_.push(std::make_shared<core::audio_buffer>(audio_data, audio_data + sample_frame_count*sizeof(int32_t)));\r
                        }\r
                        else\r
-                               muxer_.push(std::make_shared<std::vector<int16_t>>(frame_factory_->get_video_format_desc().audio_samples_per_frame, 0));\r
+                               muxer_.push(std::make_shared<core::audio_buffer>(frame_factory_->get_video_format_desc().audio_samples_per_frame, 0));\r
                                        \r
                        muxer_.commit();\r
 \r