]> git.sesse.net Git - casparcg/commitdiff
2.0.0.2:
authorronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 15 Nov 2010 18:47:10 +0000 (18:47 +0000)
committerronag <ronag@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Mon, 15 Nov 2010 18:47:10 +0000 (18:47 +0000)
 - Removed aligned_memcpy, replaced by regular memcpy.
 - Remoed find_file, replaced by inlined code.

git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@250 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

22 files changed:
common/common.vcxproj
common/common.vcxproj.filters
common/gl/pixel_buffer_object.cpp
common/utility/find_file.cpp [deleted file]
common/utility/find_file.h [deleted file]
common/utility/memory.cpp [deleted file]
common/utility/memory.h [deleted file]
core/consumer/decklink/DecklinkVideoConsumer.cpp
core/consumer/ogl/ogl_consumer.cpp
core/processor/composite_frame.cpp
core/processor/frame.cpp
core/producer/ffmpeg/audio/audio_decoder.cpp
core/producer/ffmpeg/ffmpeg_producer.cpp
core/producer/ffmpeg/input.cpp
core/producer/ffmpeg/video/video_transformer.cpp
core/producer/flash/ct_producer.cpp
core/producer/flash/flash_producer.cpp
core/producer/frame_producer_device.cpp
core/producer/image/image_loader.cpp
core/producer/image/image_producer.cpp
core/producer/image/image_scroll_producer.cpp
core/producer/transition/transition_producer.cpp

index 31d3b016220b2ecbcb49675e2ced2f6d19a05e57..b98536fe799dae013c74273632b86526f215f559 100644 (file)
     <ClInclude Include="io\SocketInfo.h" />\r
     <ClInclude Include="log\log.h" />\r
     <ClInclude Include="stdafx.h" />\r
-    <ClInclude Include="utility\find_file.h" />\r
-    <ClInclude Include="utility\memory.h" />\r
     <ClInclude Include="utility\scope_exit.h" />\r
     <ClInclude Include="utility\string_convert.h" />\r
   </ItemGroup>\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>\r
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>\r
     </ClCompile>\r
-    <ClCompile Include="utility\find_file.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
-    <ClCompile Include="utility\memory.cpp">\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
-      <PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">../StdAfx.h</PrecompiledHeaderFile>\r
-    </ClCompile>\r
   </ItemGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
   <ImportGroup Label="ExtensionTargets">\r
index 67cfa237bf4bda9778d1cb4c36c4a7c15cd2ec94..c3cdb151b9e47abfe95de73dcc85782c1b5aaec1 100644 (file)
     <ClCompile Include="concurrency\Thread.cpp">\r
       <Filter>Source\concurrency</Filter>\r
     </ClCompile>\r
-    <ClCompile Include="utility\find_file.cpp">\r
-      <Filter>Source\utility</Filter>\r
-    </ClCompile>\r
-    <ClCompile Include="utility\memory.cpp">\r
-      <Filter>Source\utility</Filter>\r
-    </ClCompile>\r
     <ClCompile Include="gl\frame_buffer_object.cpp">\r
       <Filter>Source\gl</Filter>\r
     </ClCompile>\r
     <ClInclude Include="utility\scope_exit.h">\r
       <Filter>Source\utility</Filter>\r
     </ClInclude>\r
-    <ClInclude Include="utility\find_file.h">\r
-      <Filter>Source\utility</Filter>\r
-    </ClInclude>\r
-    <ClInclude Include="utility\memory.h">\r
-      <Filter>Source\utility</Filter>\r
-    </ClInclude>\r
     <ClInclude Include="gl\pixel_buffer_object.h">\r
       <Filter>Source\gl</Filter>\r
     </ClInclude>\r
index e4b46cba1f504f54106ecc3b3c4d154ee6817949..4cf8f82f01d184c3d77c8795bfb4fdc3cb4b1b10 100644 (file)
@@ -4,7 +4,6 @@
 \r
 #include "../../common/exception/exceptions.h"\r
 #include "../../common/gl/utility.h"\r
-#include "../../common/utility/memory.h"\r
 \r
 namespace caspar { namespace common { namespace gl {\r
                                                                                                                                                                                                                                                                                                                        \r
diff --git a/common/utility/find_file.cpp b/common/utility/find_file.cpp
deleted file mode 100644 (file)
index 0ff2621..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "../stdafx.h"\r
-\r
-#include "find_file.h"\r
-\r
-#include <boost/filesystem.hpp>\r
-\r
-#include <string>\r
-#include <algorithm>\r
-\r
-namespace caspar { namespace common {\r
-\r
-std::wstring find_file(const std::wstring& filename, const std::vector<std::wstring> extensions)\r
-{\r
-       auto it = std::find_if(extensions.cbegin(), extensions.cend(), [&](const std::wstring& extension) -> bool\r
-               {                                       \r
-                       auto filePath = boost::filesystem::wpath(filename);\r
-                       filePath.replace_extension(extension);\r
-                       return boost::filesystem::exists(filePath) && boost::filesystem::is_regular_file(filePath);\r
-               });\r
-\r
-       return it != extensions.end() ? filename + L"." + *it : L"";\r
-}\r
-\r
-}}
\ No newline at end of file
diff --git a/common/utility/find_file.h b/common/utility/find_file.h
deleted file mode 100644 (file)
index 5286aa2..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once\r
-\r
-#include <string>\r
-#include <vector>\r
-\r
-namespace caspar { namespace common {\r
-\r
-std::wstring find_file(const std::wstring& filename, const std::vector<std::wstring> extensions);\r
-\r
-}}
\ No newline at end of file
diff --git a/common/utility/memory.cpp b/common/utility/memory.cpp
deleted file mode 100644 (file)
index 7a5e506..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "../stdafx.h"\r
-\r
-#include "memory.h"\r
-\r
-#include <intrin.h>\r
-\r
-#include <tbb/parallel_for.h>\r
-#include <tbb/blocked_range.h>\r
-\r
-namespace caspar { namespace common {\r
-       \r
-void* aligned_memcpy(void* dest, const void* source, size_t num)\r
-{      \r
-       if(num < 128)\r
-               return memcpy(dest, source, num);\r
-\r
-       size_t r = num % 128;\r
-       num -= r;\r
-\r
-       __asm\r
-       {\r
-               mov esi, source;    \r
-               mov edi, dest;   \r
\r
-               mov ebx, num; \r
-               shr ebx, 7;      \r
-  \r
-               cpy:\r
-                       prefetchnta [esi+80h];\r
\r
-                       movdqa xmm0, [esi+00h];\r
-                       movdqa xmm1, [esi+10h];\r
-                       movdqa xmm2, [esi+20h];\r
-                       movdqa xmm3, [esi+30h];\r
-         \r
-                       movntdq [edi+00h], xmm0;\r
-                       movntdq [edi+10h], xmm1;\r
-                       movntdq [edi+20h], xmm2;\r
-                       movntdq [edi+30h], xmm3;\r
-                       \r
-                       prefetchnta [esi+0C0h];\r
-                       \r
-                       movdqa xmm4, [esi+40h];\r
-                       movdqa xmm5, [esi+50h];\r
-                       movdqa xmm6, [esi+60h];\r
-                       movdqa xmm7, [esi+70h];\r
-         \r
-                       movntdq [edi+40h], xmm4;\r
-                       movntdq [edi+50h], xmm5;\r
-                       movntdq [edi+60h], xmm6;\r
-                       movntdq [edi+70h], xmm7;\r
\r
-                       lea edi, [edi+80h];\r
-                       lea esi, [esi+80h];\r
-                       dec ebx;\r
\r
-               jnz cpy;\r
-       }\r
-\r
-       return r == 0 ? dest : memcpy(reinterpret_cast<char*>(dest) + num, reinterpret_cast<const char*>(source) + num, r);\r
-}\r
-\r
-void* aligned_parallel_memcpy(void* dest, const void* source, size_t num)\r
-{      \r
-       if(num < 128)\r
-               return memcpy(dest, source, num);\r
-\r
-       tbb::parallel_for(tbb::blocked_range<size_t>(0, num/128), [&](const tbb::blocked_range<size_t>& r)\r
-       {\r
-               aligned_memcpy(reinterpret_cast<char*>(dest) + r.begin()*128, reinterpret_cast<const char*>(source) + r.begin()*128, r.size()*128);\r
-       });\r
-\r
-       return dest;\r
-}\r
-\r
-void* clear(void* dest, size_t size)\r
-{\r
-       tbb::parallel_for(tbb::blocked_range<size_t>(0, size/16), [&](const tbb::blocked_range<size_t>& r)\r
-       {\r
-               __m128i val = _mm_setzero_si128();\r
-               __m128i* ptr = reinterpret_cast<__m128i*>(dest)+r.begin();\r
-               __m128i* end = ptr + r.size();\r
-\r
-               while(ptr != end)       \r
-                       _mm_stream_si128(ptr++, val);\r
-       });     \r
-       return dest;\r
-}\r
-\r
-}}
\ No newline at end of file
diff --git a/common/utility/memory.h b/common/utility/memory.h
deleted file mode 100644 (file)
index 477b59c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once\r
-\r
-namespace caspar { namespace common {\r
-               \r
-void* aligned_memcpy(void* dest, const void* source, size_t size);\r
-void* aligned_parallel_memcpy(void* dest, const void* source, size_t size);\r
-void* clear(void* dest, size_t size);\r
-\r
-}}
\ No newline at end of file
index ea13ab91c02e4e7b1a0d5be87f0a3cc5c4adf2eb..b0cf332b29a5ae9c7d4df4c7edcdc6b896b61f69 100644 (file)
@@ -29,7 +29,6 @@
 #include "DeckLinkAPI_h.h"\r
 \r
 #include "../../format/video_format.h"\r
-#include "../../../common/utility/memory.h"\r
 \r
 #include "../../producer/frame_producer_device.h"\r
 \r
@@ -129,7 +128,7 @@ struct DecklinkVideoConsumer::Implementation : public IDeckLinkVideoOutputCallba
                                std::shared_ptr<DecklinkVideoFrame> pTempFrame = GetReservedFrame();\r
                                if(pTempFrame && frame->size() == pTempFrame->size())\r
                                {\r
-                                       common::aligned_parallel_memcpy(pTempFrame->data(), frame->data(), pTempFrame->size());\r
+                                       memcpy(pTempFrame->data(), frame->data(), pTempFrame->size());\r
                                        DoRender(pTempFrame);\r
                                }\r
                                else\r
index d0c644fd027002307e602255e61f6dd1deaebe88..2e5cd979075ed0a95f42dbfbfeaa30d1ceda21f6 100644 (file)
@@ -24,7 +24,6 @@
 \r
 #include "../../format/video_format.h"\r
 #include "../../processor/frame.h"\r
-#include "../../../common/utility/memory.h"\r
 #include "../../../common/gl/utility.h"\r
 #include "../../../common/gl/pixel_buffer_object.h"\r
 \r
@@ -161,7 +160,7 @@ struct consumer::implementation : boost::noncopyable
                int next_index = (index_ + 1) % 2;\r
                                \r
                auto ptr = pbos_[index_].end_write();\r
-               common::aligned_parallel_memcpy(ptr, frame->data(), format_desc_.size);\r
+               memcpy(ptr, frame->data(), format_desc_.size);\r
 \r
                GL(glClear(GL_COLOR_BUFFER_BIT));       \r
                pbos_[next_index].bind_texture();                               \r
index 0aeed7c924e25d59c7e24fe9201d2df5ede68b4f..7056647b50d655aaec4a9447aa31ae5c961df25f 100644 (file)
@@ -2,7 +2,6 @@
 \r
 #include "composite_frame.h"\r
 #include "../../common/gl/utility.h"\r
-#include "../../common/utility/memory.h"\r
 \r
 #include <boost/range/algorithm.hpp>\r
 #include <boost/range/algorithm_ext/erase.hpp>\r
index a4dd0406fd6ce802188a778f64eaea2aed5a00df..09fd22f414a98d2194214b1695c546e745e7c1b0 100644 (file)
@@ -2,7 +2,6 @@
 \r
 #include "frame.h"\r
 #include "../format/pixel_format.h"\r
-#include "../../common/utility/memory.h"\r
 #include "../../common/gl/utility.h"\r
 #include "../../common/gl/pixel_buffer_object.h"\r
 \r
index d337a1c79a775931dfd994d5387bec67db4be327..4f5e07b5dfb34a2950f00f474568c7c461fe8ef7 100644 (file)
@@ -2,8 +2,6 @@
 \r
 #include "audio_decoder.h"\r
 \r
-#include "../../../../common/utility/memory.h"\r
-\r
 #include <queue>\r
 \r
 #include <tbb/cache_aligned_allocator.h>\r
index 8174a4034e6e21d3341e4af74e317b4e29080e07..ac38941f2c80b21479ee0141f34e946d0222b0d4 100644 (file)
@@ -28,8 +28,6 @@ extern "C"
 #include "video/video_transformer.h"\r
 \r
 #include "../../format/video_format.h"\r
-#include "../../../common/utility/find_file.h"\r
-#include "../../../common/utility/memory.h"\r
 #include "../../../common/utility/scope_exit.h"\r
 #include "../../server.h"\r
 \r
@@ -175,13 +173,19 @@ public:
 };\r
 \r
 frame_producer_ptr create_ffmpeg_producer(const  std::vector<std::wstring>& params)\r
-{\r
-       std::wstring filename = params[0];\r
-       std::wstring result_filename = common::find_file(server::media_folder() + filename, list_of(L"mpg")(L"avi")(L"mov")(L"dv")(L"wav")(L"mp3")(L"mp4")(L"f4v")(L"flv"));\r
-       if(result_filename.empty())\r
+{      \r
+       static const std::vector<std::wstring> extensions = list_of(L"mpg")(L"avi")(L"mov")(L"dv")(L"wav")(L"mp3")(L"mp4")(L"f4v")(L"flv");\r
+       std::wstring filename = server::media_folder() + L"\\" + params[0];\r
+       \r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+               {                                       \r
+                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+               });\r
+\r
+       if(ext == extensions.end())\r
                return nullptr;\r
 \r
-       return std::make_shared<ffmpeg_producer>(result_filename, params);\r
+       return std::make_shared<ffmpeg_producer>(filename + L"." + *ext, params);\r
 }\r
 \r
 }}}
\ No newline at end of file
index bc78f7883d3d35cc0c82ada7cc2e61a078180c18..fa766fb1f93213a4dddf7f4265481cf91f2a4404 100644 (file)
@@ -3,7 +3,6 @@
 #include "input.h"\r
 \r
 #include "../../format/video_format.h"\r
-#include "../../../common/utility/memory.h"\r
 #include "../../../common/utility/scope_exit.h"\r
 \r
 #include <tbb/concurrent_queue.h>\r
index a7e6235ccbd9f4fba0bd83b8679347a361830c04..9dd9c01387d29e9ba43e05e1ff30009e9d8b7f9f 100644 (file)
@@ -3,8 +3,6 @@
 #include "video_transformer.h"\r
 \r
 #include "../../../format/video_format.h"\r
-#include "../../../../common/utility/memory.h"\r
-#include "../../../processor/frame.h"\r
 #include "../../../processor/frame.h"\r
 #include "../../../processor/frame_processor_device.h"\r
 \r
index 3eb1e4f4706115075c7824e469aa22221a10a2ca..cfb90f8c391b3c97ecccd415399bbd5e9ee0d1da 100644 (file)
@@ -24,7 +24,6 @@
 \r
 #include "cg_producer.h"\r
 \r
-#include "../../../common/utility/find_file.h"\r
 #include "../../processor/frame.h"\r
 #include "../../server.h"\r
 \r
@@ -36,19 +35,20 @@ namespace caspar { namespace core { namespace flash {
        \r
 frame_producer_ptr create_ct_producer(const std::vector<std::wstring>& params) \r
 {\r
-       std::wstring filename = params[0];\r
-       std::wstring result_filename = common::find_file(server::media_folder() + filename, list_of(L"ct"));\r
-       if(result_filename.empty())\r
-               return nullptr;\r
+       static const std::vector<std::wstring> extensions = list_of(L"ct");\r
+       std::wstring filename = server::media_folder() + L"\\" + params[0];\r
        \r
-       std::wstring fixed_filename = result_filename;\r
-       std::wstring::size_type pos = 0;\r
-       while((pos = fixed_filename.find(TEXT('\\'), pos)) != std::wstring::npos) \r
-               fixed_filename[pos] = TEXT('/');\r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+               {                                       \r
+                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+               });\r
+\r
+       if(ext == extensions.end())\r
+               return nullptr;\r
        \r
-       cg_producer_ptr cg_producer(new cg_producer());\r
-       cg_producer->add(0, filename, 1);\r
-       return cg_producer;\r
+       auto producer = std::make_shared<cg_producer>();\r
+       producer->add(0, filename, 1);\r
+       return producer;\r
 }\r
 \r
 }\r
index a55c030de61a1a4afb54c000b208ef1be3015cff..41e9a4b6183db2dcb7071280e723bd6b79e1cfa7 100644 (file)
 #include "bitmap.h"\r
 \r
 #include "../../format/video_format.h"\r
-#include "../../../common/utility/find_file.h"\r
 #include "../../server.h"\r
 #include "../../../common/concurrency/executor.h"\r
-#include "../../../common/utility/memory.h"\r
 #include "../../../common/utility/scope_exit.h"\r
 \r
 #include "../../processor/frame.h"\r
@@ -254,13 +252,13 @@ struct flash_producer::implementation
                        bitmap_ptr frame;               \r
                        if(current_frame_ == nullptr)                           \r
                                current_frame_ = std::make_shared<bitmap>(format_desc.width, format_desc.height);\r
-                       common::clear(current_frame_->data(), current_frame_->size());\r
+                       memset(current_frame_->data(), 0, current_frame_->size());\r
                        \r
                        flashax_container_->DrawControl(current_frame_->hdc());\r
                }       \r
 \r
                auto frame = frame_processor_->create_frame(format_desc.width, format_desc.height);\r
-               common::aligned_parallel_memcpy(frame->data(), current_frame_->data(), current_frame_->size()); \r
+               memcpy(frame->data(), current_frame_->data(), current_frame_->size());  \r
 \r
                return frame;\r
        }\r
@@ -313,11 +311,18 @@ std::wstring flash_producer::find_template(const std::wstring& template_name)
 \r
 flash_producer_ptr create_flash_producer(const std::vector<std::wstring>& params)\r
 {\r
-       // TODO: Check for flash support\r
-       auto filename = params[0];\r
-       std::wstring result_filename = common::find_file(server::media_folder() + filename, list_of(L"swf"));\r
+       static const std::vector<std::wstring> extensions = list_of(L"swf");\r
+       std::wstring filename = server::media_folder() + L"\\" + params[0];\r
+       \r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+               {                                       \r
+                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+               });\r
+\r
+       if(ext == extensions.end())\r
+               return nullptr;\r
 \r
-       return result_filename.empty() ? nullptr : std::make_shared<flash_producer>(result_filename);\r
+       return std::make_shared<flash_producer>(filename + L"." + *ext);\r
 }\r
 \r
 }}}
\ No newline at end of file
index 34cd130c59af6714d5064d6e7789c5bbf672a9fb..36fbd2364b95c1f9613ebcfacbbde22d2c1d82e0 100644 (file)
@@ -8,7 +8,6 @@
 #include "../processor/composite_frame.h"\r
 \r
 #include "../../common/utility/scope_exit.h"\r
-#include "../../common/utility/memory.h"\r
 \r
 #include <boost/thread.hpp>\r
 #include <boost/range/algorithm_ext/erase.hpp>\r
index 4ab918a771267ae23edc9a18058b61631f853fd2..2202fe27c0432eb4e590cf0ad276d5973708f7ee 100644 (file)
@@ -5,7 +5,6 @@
 #include "../../../common/exception/Exceptions.h"\r
 \r
 #include "../../processor/frame.h"\r
-#include "../../../common/utility/memory.h"\r
 \r
 #if defined(_MSC_VER)\r
 #pragma warning (disable : 4714) // marked as __forceinline not inlined\r
index bab9a94484935398b8a83dc62c86ebd504dd8ab2..abcf21377d892f3be72dafdf4bf8db5f45b5d828 100644 (file)
@@ -6,8 +6,6 @@
 #include "../../processor/frame_processor_device.h"\r
 #include "../../format/video_format.h"\r
 #include "../../server.h"\r
-#include "../../../common/utility/find_file.h"\r
-#include "../../../common/utility/memory.h"\r
 \r
 #include <boost/assign.hpp>\r
 \r
@@ -27,7 +25,7 @@ struct image_producer : public frame_producer
                auto bitmap = load_image(filename_);\r
                FreeImage_FlipVertical(bitmap.get());\r
                auto frame = frame_processor->create_frame(FreeImage_GetWidth(bitmap.get()), FreeImage_GetHeight(bitmap.get()));\r
-               common::aligned_parallel_memcpy(frame->data(), FreeImage_GetBits(bitmap.get()), frame->size());\r
+               memcpy(frame->data(), FreeImage_GetBits(bitmap.get()), frame->size());\r
                frame_ = frame;\r
        }\r
        \r
@@ -38,12 +36,18 @@ struct image_producer : public frame_producer
 \r
 frame_producer_ptr create_image_producer(const  std::vector<std::wstring>& params)\r
 {\r
-       std::wstring filename = params[0];\r
-       std::wstring resultFilename = common::find_file(server::media_folder() + filename, list_of(L"png")(L"tga")(L"bmp")(L"jpg")(L"jpeg"));\r
-       if(!resultFilename.empty())\r
-               return std::make_shared<image_producer>(resultFilename);\r
+       static const std::vector<std::wstring> extensions = list_of(L"png")(L"tga")(L"bmp")(L"jpg")(L"jpeg");\r
+       std::wstring filename = server::media_folder() + L"\\" + params[0];\r
+       \r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+               {                                       \r
+                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+               });\r
+\r
+       if(ext == extensions.end())\r
+               return nullptr;\r
 \r
-       return nullptr;\r
+       return std::make_shared<image_producer>(filename + L"." + *ext);\r
 }\r
 \r
 }}}
\ No newline at end of file
index 375c13faf17326826305356baa905fc2bf84e5f1..7757825b79ed645db321313d4e3ffd1645f0f2de 100644 (file)
@@ -9,8 +9,6 @@
 #include "../../format/video_format.h"\r
 #include "../../processor/frame_processor_device.h"\r
 #include "../../server.h"\r
-#include "../../../common/utility/find_file.h"\r
-#include "../../../common/utility/memory.h"\r
 \r
 #include <tbb/parallel_for.h>\r
 #include <tbb/parallel_invoke.h>\r
@@ -63,18 +61,18 @@ struct image_scroll_producer : public frame_producer
                image_height_ = std::max(height, format_desc_.height);\r
 \r
                image_ = std::shared_ptr<unsigned char>(static_cast<unsigned char*>(scalable_aligned_malloc(image_width_*image_height_*4, 16)));\r
-               common::clear(image_.get(), image_width_*image_height_*4);\r
+               memset(image_.get(), 0, image_width_*image_height_*4);\r
 \r
                unsigned char* pBits = FreeImage_GetBits(pBitmap.get());\r
                \r
                for (size_t i = 0; i < height; ++i)\r
-                       common::aligned_parallel_memcpy(&image_.get()[i * image_width_ * 4], &pBits[i* width * 4], width * 4);\r
+                       memcpy(&image_.get()[i * image_width_ * 4], &pBits[i* width * 4], width * 4);\r
        }\r
 \r
        frame_ptr do_render_frame()\r
        {\r
                frame_ptr frame = frame_processor_->create_frame(format_desc_.width, format_desc_.height);\r
-               common::clear(frame->data(), format_desc_.size);\r
+               memset(frame->data(), 0, format_desc_.size);\r
 \r
                const int delta_x = direction_ == direction::Left ? speed_ : -speed_;\r
                const int delta_y = direction_ == direction::Up ? speed_ : -speed_;\r
@@ -164,12 +162,18 @@ struct image_scroll_producer : public frame_producer
 \r
 frame_producer_ptr create_image_scroll_producer(const std::vector<std::wstring>& params)\r
 {\r
-       std::wstring filename = params[0];\r
-       auto result_filename = common::find_file(server::media_folder() + filename, list_of(L"spng")(L"stga")(L"sbmp")(L"sjpg")(L"sjpeg"));\r
-       if(!result_filename.empty())\r
-               return std::make_shared<image_scroll_producer>(result_filename, params);\r
+       static const std::vector<std::wstring> extensions = list_of(L"spng")(L"stga")(L"sbmp")(L"sjpg")(L"sjpeg");\r
+       std::wstring filename = server::media_folder() + L"\\" + params[0];\r
+       \r
+       auto ext = std::find_if(extensions.begin(), extensions.end(), [&](const std::wstring& ex) -> bool\r
+               {                                       \r
+                       return boost::filesystem::is_regular_file(boost::filesystem::wpath(filename).replace_extension(ex));\r
+               });\r
+\r
+       if(ext == extensions.end())\r
+               return nullptr;\r
 \r
-       return nullptr;\r
+       return std::make_shared<image_scroll_producer>(filename + L"." + *ext, params);\r
 }\r
 \r
 }}}
\ No newline at end of file
index 26927182749bd8d895c04033044243d34a266255..79977207e5adc7b51a62aa2b869a282139f6457a 100644 (file)
@@ -26,7 +26,6 @@
 #include "../../processor/composite_frame.h"\r
 #include "../../processor/frame_processor_device.h"\r
 \r
-#include "../../../common/utility/memory.h"\r
 #include "../../producer/frame_producer_device.h"\r
 \r
 #include <boost/range/algorithm/copy.hpp>\r