]> git.sesse.net Git - casparcg/commitdiff
Fixed build errors under windows
authorHelge Norberg <helge.norberg@svt.se>
Thu, 26 Mar 2015 14:25:25 +0000 (15:25 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Thu, 26 Mar 2015 14:25:25 +0000 (15:25 +0100)
common/endian.h
modules/ffmpeg/producer/util/util.h
modules/image/producer/image_scroll_producer.cpp
modules/image/util/image_algorithms.h
shell/CMakeLists.txt

index 272dad8e98e4fa1eda0d6ee35ce5f46cac77ecbb..e29a4be0599dbc197f5aef72d17b34f9c91cc60e 100644 (file)
@@ -38,18 +38,18 @@ typename std::enable_if<sizeof(T) == sizeof(std::uint8_t), T>::type swap_byte_or
        return value;
 }
 
-/*template<typename T>
+template<typename T>
 typename std::enable_if<sizeof(T) == sizeof(std::uint16_t), T>::type swap_byte_order(
                const T& value)
 {
 #ifdef _MSC_VER
        auto swapped = _byteswap_ushort(reinterpret_cast<const unsigned short&>(value));
 #elif __GNUC__
-       auto swapped = __builtin_bswap32(value);
+       auto swapped = __builtin_bswap16(value);
 #endif
 
        return reinterpret_cast<const T&>(swapped);
-}*/
+}
 
 template<typename T>
 typename std::enable_if<sizeof(T) == sizeof(std::uint32_t), T>::type swap_byte_order(
index d3c6880b8d6862b6552bcafcf2e96e75d9fdab6c..4df2d9638d8692bdf82e99cf4f3281236e2f1a6e 100644 (file)
 
 #include <array>
 
+#if defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4244)
+#endif
+extern "C"
+{
 #include <libavutil/avutil.h>
+}
+#if defined(_MSC_VER)
+#pragma warning (pop)
+#endif
 
 struct AVFrame;
 struct AVFormatContext;
index 3140f2c11af00ba7403967875f57a8a795f7019b..4313ad0a630f03955ca3d1939770477d2f337042 100644 (file)
@@ -156,7 +156,7 @@ struct image_scroll_producer : public core::frame_producer_base
 
                        blurred_copy.reset(new uint8_t[count]);
                        image_view<bgra_pixel> blurred_view(blurred_copy.get(), width_, height_);
-                       core::tweener blur_tweener(L"easeInQuad");
+                       caspar::tweener blur_tweener(L"easeInQuad");
                        blur(original_view, blurred_view, angle, motion_blur_px, blur_tweener);
                        bytes = blurred_copy.get();
                        bitmap.reset();
index cbd3aa707daa546da68c56d41ef7d2bce68df49e..f8c23f3d692ce581635d387d1789ec355557055d 100644 (file)
@@ -62,7 +62,7 @@ public:
 };
 
 template<class T>
-std::vector<T> get_tweened_values(const core::tweener& tweener, size_t num_values, T from, T to)
+std::vector<T> get_tweened_values(const caspar::tweener& tweener, size_t num_values, T from, T to)
 {
        std::vector<T> result;
        result.reserve(num_values);
@@ -104,7 +104,7 @@ void blur(
        const SrcView& src,
        DstView& dst,
        const std::vector<std::pair<int, int>>& motion_trail_coordinates, 
-       const core::tweener& tweener)
+       const caspar::tweener& tweener)
 {
        auto blur_px = motion_trail_coordinates.size();
        auto tweened_weights_y = get_tweened_values<uint8_t>(tweener, blur_px + 2, 255, 0);
@@ -167,7 +167,7 @@ void blur(
        DstView& dst,
        double angle_radians,
        int blur_px, 
-       const core::tweener& tweener)
+       const caspar::tweener& tweener)
 {
        auto motion_trail = get_line_points(blur_px, angle_radians);
 
index 2315d84d8b317a4d6ebc753c3e2710fb7f81e731..f39048b68cb5b00930a014e50b7e5aa62f7bf16a 100644 (file)
@@ -1,18 +1,26 @@
 cmake_minimum_required (VERSION 2.6)
 project (shell)
 
+if (MSVC)
+       set(OS_SPECIFIC_SOURCES
+                       resource.h
+                       shell.rc
+       )
+elseif (CMAKE_COMPILER_IS_GNUCXX)
+       set(OS_SPECIFIC_SOURCES
+       )
+endif ()
 set(SOURCES
                main.cpp
                server.cpp
                stdafx.cpp
 )
 set(HEADERS
-               resource.h
                server.h
                stdafx.h
 )
 
-add_executable(casparcg ${SOURCES} ${HEADERS})
+add_executable(casparcg ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
 add_precompiled_header(casparcg stdafx.h FORCEINCLUDE)
 
 include_directories(..)