]> git.sesse.net Git - casparcg/blobdiff - modules/bluefish/consumer/bluefish_consumer.cpp
2.0. Updated namespaces.
[casparcg] / modules / bluefish / consumer / bluefish_consumer.cpp
index c52a0b50ffa606cd80e14b5e15036a89d44e4247..62e840670f79c40b74d0479b06d3c96e5109bea8 100644 (file)
@@ -43,7 +43,7 @@
 #include <memory>\r
 #include <array>\r
 \r
-namespace caspar { \r
+namespace caspar { namespace bluefish { \r
                        \r
 struct bluefish_consumer : boost::noncopyable\r
 {\r
@@ -208,7 +208,7 @@ public:
        \r
        void schedule_next_video(const safe_ptr<core::read_frame>& frame)\r
        {\r
-               static std::vector<int8_t> silence(MAX_HANC_BUFFER_SIZE, 0);\r
+               static std::vector<int16_t> silence(MAX_HANC_BUFFER_SIZE, 0);\r
                \r
                executor_.begin_invoke([=]\r
                {\r
@@ -242,7 +242,7 @@ public:
 \r
                                if(embedded_audio_)\r
                                {               \r
-                                       auto frame_audio          = core::audio_32_to_24(frame->audio_data());\r
+                                       auto frame_audio          = core::audio_32_to_16_sse(frame->audio_data());\r
                                        auto frame_audio_data = frame_audio.size() != audio_samples ? silence.data() : frame_audio.data();      \r
 \r
                                        encode_hanc(reinterpret_cast<BLUE_UINT32*>(reserved_frames_.front()->hanc_data()), frame_audio_data, audio_samples, audio_nchannels);\r
@@ -289,7 +289,7 @@ public:
 \r
        void encode_hanc(BLUE_UINT32* hanc_data, void* audio_data, size_t audio_samples, size_t audio_nchannels)\r
        {       \r
-               const auto sample_type = AUDIO_CHANNEL_24BIT | AUDIO_CHANNEL_LITTLEENDIAN;\r
+               const auto sample_type = AUDIO_CHANNEL_16BIT | AUDIO_CHANNEL_LITTLEENDIAN;\r
                const auto emb_audio_flag = blue_emb_audio_enable | blue_emb_audio_group1_enable;\r
                \r
                hanc_stream_info_struct hanc_stream_info;\r
@@ -356,7 +356,7 @@ public:
        }\r
 };     \r
 \r
-safe_ptr<core::frame_consumer> create_bluefish_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"BLUEFISH")\r
                return core::frame_consumer::empty();\r
@@ -369,7 +369,7 @@ safe_ptr<core::frame_consumer> create_bluefish_consumer(const std::vector<std::w
        return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
 }\r
 \r
-safe_ptr<core::frame_consumer> create_bluefish_consumer(const boost::property_tree::ptree& ptree) \r
+safe_ptr<core::frame_consumer> create_consumer(const boost::property_tree::ptree& ptree) \r
 {      \r
        const auto device_index         = ptree.get("device",             1);\r
        const auto embedded_audio       = ptree.get("embedded-audio", false);\r
@@ -378,4 +378,4 @@ safe_ptr<core::frame_consumer> create_bluefish_consumer(const boost::property_tr
        return make_safe<bluefish_consumer_proxy>(device_index, embedded_audio, key_only);\r
 }\r
 \r
-}
\ No newline at end of file
+}}
\ No newline at end of file