Commit: 50a139cf496ac549ef27d7139aeae11e48667659
Author: Benoit Bolsee
Date:   Wed Apr 8 20:51:25 2015 +0200
Branches: decklink
https://developer.blender.org/rB50a139cf496ac549ef27d7139aeae11e48667659

BGE: Support VideoDeckLink in Linux, compiling but not yet working.

===================================================================

M       CMakeLists.txt
M       build_files/cmake/macros.cmake
M       intern/decklink/CMakeLists.txt
M       intern/decklink/DeckLinkAPI.cpp
M       intern/decklink/DeckLinkAPI.h
M       source/blenderplayer/CMakeLists.txt
M       source/gameengine/VideoTexture/VideoDeckLink.cpp
M       source/gameengine/VideoTexture/VideoDeckLink.h

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc7fa86..d0a9b7f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,9 +220,7 @@ option(WITH_SYSTEM_BULLET "Use the systems bullet library 
(currently unsupported
 mark_as_advanced(WITH_SYSTEM_BULLET)
 option(WITH_GAMEENGINE    "Enable Game Engine" ${_init_GAMEENGINE})
 option(WITH_PLAYER        "Build Player" OFF)
-if (WIN32)
-       option(WITH_DECKLINK      "Support BlackMagicDesign DeckLink cards in 
the BGE" OFF)
-endif()
+option(WITH_DECKLINK      "Support BlackMagicDesign DeckLink cards in the BGE" 
OFF)
 option(WITH_OPENCOLORIO   "Enable OpenColorIO color management" 
${_init_OPENCOLORIO})
 option(WITH_COMPOSITOR    "Enable the tile based nodal compositor" ON)
 
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index eed013c..d660f1f 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -654,8 +654,12 @@ macro(SETUP_BLENDER_SORTED_LIBS)
                list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" 
"extern_bullet")
        endif()
 
+       if(WITH_DECKLINK)
+               list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
+       endif()
+
        if(WIN32)
-               list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink 
bf_intern_gpudirect)
+               list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
        endif()
 
        foreach(SORTLIB ${BLENDER_SORTED_LIBS})
diff --git a/intern/decklink/CMakeLists.txt b/intern/decklink/CMakeLists.txt
index 37919d6..41dc029 100644
--- a/intern/decklink/CMakeLists.txt
+++ b/intern/decklink/CMakeLists.txt
@@ -43,5 +43,19 @@ if (WIN32)
        )
 endif()
 
+if (UNIX AND NOT APPLE)
+        list(APPEND SRC
+                linux/DeckLinkAPI.h
+                linux/DeckLinkAPIConfiguration.h
+                linux/DeckLinkAPIDeckControl.h
+                linux/DeckLinkAPIDiscovery.h
+                linux/DeckLinkAPIDispatch.cpp
+                linux/DeckLinkAPIModes.h
+                linux/DeckLinkAPIVersion.h
+                linux/DeckLinkAPITypes.h
+                linux/LinuxCOM.h
+        )
+endif()
+
 
 blender_add_lib(bf_intern_decklink "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/decklink/DeckLinkAPI.cpp b/intern/decklink/DeckLinkAPI.cpp
index a21acfe..fa2a2e2 100644
--- a/intern/decklink/DeckLinkAPI.cpp
+++ b/intern/decklink/DeckLinkAPI.cpp
@@ -43,4 +43,9 @@ IDeckLinkIterator* BMD_CreateDeckLinkIterator(void)
                return NULL;
        return pDLIterator;
 }
-#endif
+#else
+IDeckLinkIterator* BMD_CreateDeckLinkIterator(void)
+{
+    return CreateDeckLinkIteratorInstance();
+}
+#endif  // WIN32
diff --git a/intern/decklink/DeckLinkAPI.h b/intern/decklink/DeckLinkAPI.h
index efb0c2b..2208f39 100644
--- a/intern/decklink/DeckLinkAPI.h
+++ b/intern/decklink/DeckLinkAPI.h
@@ -31,8 +31,17 @@
 
 #ifdef WIN32
        #include "win/DeckLinkAPI_h.h"
+    typedef unsigned long   dl_size_t;
+#else
+    #include "linux/DeckLinkAPI.h"
+    /* Windows COM API uses BOOL, linux uses bool */
+    #define BOOL bool
+    typedef uint32_t    dl_size_t;
 #endif
 
+
+
+
 /* OS independent function to get the device iterator */
 IDeckLinkIterator* BMD_CreateDeckLinkIterator(void);
 
diff --git a/source/blenderplayer/CMakeLists.txt 
b/source/blenderplayer/CMakeLists.txt
index 9ba4771..03ca541 100644
--- a/source/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -104,8 +104,6 @@ endif()
                bf_intern_string 
                bf_intern_ghost
                bf_intern_ghostndof3dconnexion
-               bf_intern_decklink
-               bf_intern_gpudirect
                bf_rna
                bf_blenkernel
                bf_physics
@@ -211,6 +209,14 @@ endif()
                list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
        endif()
 
+        if(WITH_DECKLINK)
+                list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
+        endif()
+
+        if(WIN32)
+                list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
+        endif()
+
        foreach(SORTLIB ${BLENDER_SORTED_LIBS})
                set(REMLIB ${SORTLIB})
                foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
diff --git a/source/gameengine/VideoTexture/VideoDeckLink.cpp 
b/source/gameengine/VideoTexture/VideoDeckLink.cpp
index cbf1e08..3d421e4 100644
--- a/source/gameengine/VideoTexture/VideoDeckLink.cpp
+++ b/source/gameengine/VideoTexture/VideoDeckLink.cpp
@@ -393,7 +393,7 @@ ULONG STDMETHODCALLTYPE             
PinnedMemoryAllocator::Release(void)
 }
 
 // IDeckLinkMemoryAllocator methods
-HRESULT STDMETHODCALLTYPE      PinnedMemoryAllocator::AllocateBuffer(unsigned 
long bufferSize, void* *allocatedBuffer)
+HRESULT STDMETHODCALLTYPE      PinnedMemoryAllocator::AllocateBuffer(dl_size_t 
bufferSize, void* *allocatedBuffer)
 {
        Lock();
        if (mBufferCache.empty())
@@ -881,7 +881,7 @@ void VideoDeckLink::calcImage (unsigned int texId, double 
ts)
                                if (mUse3D) {
                                        IDeckLinkVideoFrame3DExtensions 
*if3DExtensions = NULL;
                                        IDeckLinkVideoFrame *rightEyeFrame = 
NULL;
-                                       if 
(pFrame->QueryInterface(&if3DExtensions) == S_OK &&
+                    if 
(pFrame->QueryInterface(IID_IDeckLinkVideoFrame3DExtensions, (void 
**)&if3DExtensions) == S_OK &&
                                                
if3DExtensions->GetFrameForRightEye(&rightEyeFrame) == S_OK) {
                                                
rightEyeFrame->GetBytes(&rightEyePixels);
                                                textureSize += 
((uint64_t)rightEyePixels - (uint64_t)videoPixels);
diff --git a/source/gameengine/VideoTexture/VideoDeckLink.h 
b/source/gameengine/VideoTexture/VideoDeckLink.h
index 5a8b7fd..e9d14d4 100644
--- a/source/gameengine/VideoTexture/VideoDeckLink.h
+++ b/source/gameengine/VideoTexture/VideoDeckLink.h
@@ -72,6 +72,8 @@ struct TextureDesc
        }
 };
 
+class CaptureDelegate;
+
 // type VideoDeckLink declaration
 class VideoDeckLink : public VideoBase
 {
@@ -183,7 +185,7 @@ public:
        virtual ULONG STDMETHODCALLTYPE         Release(void);
 
        // IDeckLinkMemoryAllocator methods
-       virtual HRESULT STDMETHODCALLTYPE       AllocateBuffer(unsigned long 
bufferSize, void* *allocatedBuffer);
+    virtual HRESULT STDMETHODCALLTYPE  AllocateBuffer(dl_size_t bufferSize, 
void* *allocatedBuffer);
        virtual HRESULT STDMETHODCALLTYPE       ReleaseBuffer(void* buffer);
        virtual HRESULT STDMETHODCALLTYPE       Commit();
        virtual HRESULT STDMETHODCALLTYPE       Decommit();

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to