[Bf-blender-cvs] [430b754] decklink: Add Windows DeckLink API, put Linux aside for now.

Benoit Bolsee noreply at git.blender.org
Sat Mar 21 23:59:28 CET 2015


Commit: 430b754f9ab1c768ea4c2f979fe4217f5df969da
Author: Benoit Bolsee
Date:   Sat Mar 21 23:15:59 2015 +0100
Branches: decklink
https://developer.blender.org/rB430b754f9ab1c768ea4c2f979fe4217f5df969da

Add Windows DeckLink API, put Linux aside for now.

The VideoDeckLink object is still a stub but now it compiles and links
with DeckLink COM API and nVidia DVP library.
Only Windows & CMake working at the moment.
The nVidia DVP library is added in SVN win64_vc12 repo.

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

M	CMakeLists.txt
M	build_files/cmake/macros.cmake
M	intern/CMakeLists.txt
M	intern/SConscript
M	intern/decklink/CMakeLists.txt
A	intern/decklink/DeckLinkAPI.cpp
M	intern/decklink/DeckLinkAPI.h
D	intern/decklink/DeckLinkAPIConfiguration.h
D	intern/decklink/DeckLinkAPIConfiguration_v10_2.h
D	intern/decklink/DeckLinkAPIDeckControl.h
D	intern/decklink/DeckLinkAPIDiscovery.h
D	intern/decklink/DeckLinkAPIDispatch.cpp
D	intern/decklink/DeckLinkAPIDispatch_v7_6.cpp
D	intern/decklink/DeckLinkAPIDispatch_v8_0.cpp
D	intern/decklink/DeckLinkAPIModes.h
D	intern/decklink/DeckLinkAPITypes.h
D	intern/decklink/DeckLinkAPIVersion.h
D	intern/decklink/DeckLinkAPI_v10_2.h
D	intern/decklink/DeckLinkAPI_v7_1.h
D	intern/decklink/DeckLinkAPI_v7_3.h
D	intern/decklink/DeckLinkAPI_v7_6.h
D	intern/decklink/DeckLinkAPI_v7_9.h
D	intern/decklink/DeckLinkAPI_v8_0.h
D	intern/decklink/DeckLinkAPI_v8_1.h
D	intern/decklink/DeckLinkAPI_v9_2.h
D	intern/decklink/DeckLinkAPI_v9_9.h
D	intern/decklink/LinuxCOM.h
D	intern/decklink/SConscript
A	intern/decklink/linux/DeckLinkAPI.h
A	intern/decklink/linux/DeckLinkAPIConfiguration.h
A	intern/decklink/linux/DeckLinkAPIConfiguration_v10_2.h
A	intern/decklink/linux/DeckLinkAPIDeckControl.h
A	intern/decklink/linux/DeckLinkAPIDiscovery.h
A	intern/decklink/linux/DeckLinkAPIDispatch.cpp
A	intern/decklink/linux/DeckLinkAPIDispatch_v7_6.cpp
A	intern/decklink/linux/DeckLinkAPIDispatch_v8_0.cpp
A	intern/decklink/linux/DeckLinkAPIModes.h
A	intern/decklink/linux/DeckLinkAPITypes.h
A	intern/decklink/linux/DeckLinkAPIVersion.h
A	intern/decklink/linux/DeckLinkAPI_v10_2.h
A	intern/decklink/linux/DeckLinkAPI_v7_1.h
A	intern/decklink/linux/DeckLinkAPI_v7_3.h
A	intern/decklink/linux/DeckLinkAPI_v7_6.h
A	intern/decklink/linux/DeckLinkAPI_v7_9.h
A	intern/decklink/linux/DeckLinkAPI_v8_0.h
A	intern/decklink/linux/DeckLinkAPI_v8_1.h
A	intern/decklink/linux/DeckLinkAPI_v9_2.h
A	intern/decklink/linux/DeckLinkAPI_v9_9.h
A	intern/decklink/linux/LinuxCOM.h
A	intern/decklink/win/DeckLinkAPI_h.h
A	intern/decklink/win/DeckLinkAPI_i.c
M	source/creator/CMakeLists.txt
M	source/gameengine/VideoTexture/CMakeLists.txt
M	source/gameengine/VideoTexture/VideoDeckLink.cpp
M	source/gameengine/VideoTexture/VideoDeckLink.h
M	source/gameengine/VideoTexture/blendVideoTex.cpp

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21efa66..d89ce9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -220,6 +220,9 @@ 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_OPENCOLORIO   "Enable OpenColorIO color management" ${_init_OPENCOLORIO})
 option(WITH_COMPOSITOR    "Enable the tile based nodal compositor" ON)
 
@@ -1348,6 +1351,8 @@ elseif(WIN32)
 			)
 		endif()
 
+		set(NVIDIA_GPUDIRECT_INCLUDE_DIRS ${LIBDIR}/NVIDIA_GPUDirect/include)
+
 		if(WITH_CODEC_FFMPEG)
 			set(FFMPEG_INCLUDE_DIRS
 				${LIBDIR}/ffmpeg/include
@@ -1368,6 +1373,15 @@ elseif(WIN32)
 			endif()
 		endif()
 
+		if(WITH_DECKLINK)
+			set(NVIDIA_GPUDIRECT_LIBRARIES
+				${LIBDIR}/NVIDIA_GPUDirect/lib/dvp.lib
+			)
+			set(NVIDIA_GPUDIRECT_LIBPATH
+				${LIBDIR}/NVIDIA_GPUDirect/lib
+			)
+		endif()
+
 		if(WITH_IMAGE_OPENEXR)
 			set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
 			set(OPENEXR_VERSION "2.1")
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 679a42d..68953e8 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -284,7 +284,9 @@ macro(SETUP_LIBDIRS)
 	if(WITH_MEM_JEMALLOC)
 		link_directories(${JEMALLOC_LIBPATH})
 	endif()
-
+	if(WITH_DECKLINK)
+		link_directories(${NVIDIA_GPUDIRECT_LIBPATH})
+	endif()
 	if(WIN32 AND NOT UNIX)
 		link_directories(${PTHREADS_LIBPATH})
 	endif()
@@ -383,6 +385,9 @@ macro(setup_liblinks
 	if(WITH_CODEC_FFMPEG)
 		target_link_libraries(${target} ${FFMPEG_LIBRARIES})
 	endif()
+	if(WIN32 AND WITH_DECKLINK)
+		target_link_libraries(${target} ${NVIDIA_GPUDIRECT_LIBRARIES})
+	endif()
 	if(WITH_OPENCOLLADA)
 		if(WIN32 AND NOT UNIX)
 			file_list_suffix(OPENCOLLADA_LIBRARIES_DEBUG "${OPENCOLLADA_LIBRARIES}" "_d")
@@ -564,7 +569,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
 		bf_intern_mikktspace
 		bf_intern_dualcon
 		bf_intern_cycles
-		bf_intern_decklink
 		cycles_render
 		cycles_bvh
 		cycles_device
@@ -656,6 +660,10 @@ macro(SETUP_BLENDER_SORTED_LIBS)
 		list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
 	endif()
 
+	if(WIN32)
+		list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
+	endif()
+
 	foreach(SORTLIB ${BLENDER_SORTED_LIBS})
 		set(REMLIB ${SORTLIB})
 		foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt
index fbafe56..76c0ee2 100644
--- a/intern/CMakeLists.txt
+++ b/intern/CMakeLists.txt
@@ -32,7 +32,10 @@ add_subdirectory(opencolorio)
 add_subdirectory(mikktspace)
 add_subdirectory(raskter)
 add_subdirectory(glew-mx)
-add_subdirectory(decklink)
+
+if (WITH_DECKLINK)
+	add_subdirectory(decklink)
+endif()
 
 if(WITH_AUDASPACE)
 	add_subdirectory(audaspace)
diff --git a/intern/SConscript b/intern/SConscript
index 742b31b..c0dafe3 100644
--- a/intern/SConscript
+++ b/intern/SConscript
@@ -60,9 +60,6 @@ if env['WITH_BF_INTERNATIONAL']:
 if env['WITH_BF_BULLET']:
     SConscript (['rigidbody/SConscript'])
 
-if env['WITH_BF_DECKLINK']
-    SConscript (['decklink/SConscript'])
-
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-mingw', 'linuxcross', 'win64-vc'):
     SConscript(['utfconv/SConscript'])
 
diff --git a/intern/decklink/CMakeLists.txt b/intern/decklink/CMakeLists.txt
index a440b74..37919d6 100644
--- a/intern/decklink/CMakeLists.txt
+++ b/intern/decklink/CMakeLists.txt
@@ -32,14 +32,16 @@ set(INC_SYS
 )
 
 set(SRC
-	DeckLinkAPIDispatch.cpp
+	DeckLinkAPI.cpp
 	DeckLinkAPI.h
-	LinuxCOM.h
-	DeckLinkAPITypes.h
-	DeckLinkAPIModes.h
-	DeckLinkAPIDiscovery.h
-	DeckLinkAPIConfiguration.h
-	DeckLinkAPIDeckControl.h
 )
 
+if (WIN32)
+	list(APPEND SRC
+		win/DeckLinkAPI_h.h
+		win/DeckLinkAPI_i.c
+	)
+endif()
+
+
 blender_add_lib(bf_intern_decklink "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/intern/decklink/DeckLinkAPI.cpp b/intern/decklink/DeckLinkAPI.cpp
new file mode 100644
index 0000000..a21acfe
--- /dev/null
+++ b/intern/decklink/DeckLinkAPI.cpp
@@ -0,0 +1,46 @@
+/*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+* Contributor(s): Benoit Bolsee
+*
+* ***** END GPL LICENSE BLOCK *****
+*/
+
+/** \file decklink/DeckLinkAPI.cpp
+*  \ingroup decklink
+*/
+
+#ifdef WIN32
+#include <windows.h>
+#include <objbase.h>
+#include <comutil.h>
+#endif
+
+#include "DeckLinkAPI.h"
+
+#ifdef WIN32
+IDeckLinkIterator* BMD_CreateDeckLinkIterator(void)
+{
+	HRESULT result;
+	IDeckLinkIterator* pDLIterator = NULL;
+
+	result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL, IID_IDeckLinkIterator, (void**)&pDLIterator);
+	if (FAILED(result))
+		return NULL;
+	return pDLIterator;
+}
+#endif
diff --git a/intern/decklink/DeckLinkAPI.h b/intern/decklink/DeckLinkAPI.h
index 91a1b85..efb0c2b 100644
--- a/intern/decklink/DeckLinkAPI.h
+++ b/intern/decklink/DeckLinkAPI.h
@@ -1,765 +1,39 @@
-/* -LICENSE-START-
-** Copyright (c) 2014 Blackmagic Design
-**
-** Permission is hereby granted, free of charge, to any person or organization
-** obtaining a copy of the software and accompanying documentation covered by
-** this license (the "Software") to use, reproduce, display, distribute,
-** execute, and transmit the Software, and to prepare derivative works of the
-** Software, and to permit third-parties to whom the Software is furnished to
-** do so, all subject to the following:
-** 
-** The copyright notices in the Software and this entire statement, including
-** the above license grant, this restriction and the following disclaimer,
-** must be included in all copies of the Software, in whole or in part, and
-** all derivative works of the Software, unless such copies or derivative
-** works are solely in the form of machine-executable object code generated by
-** a source language processor.
-** 
-** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-** DEALINGS IN THE SOFTWARE.
-** -LICENSE-END-
+/*
+* ***** BEGIN GPL LICENSE BLOCK *****
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software Foundation,
+* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*
+* Contributor(s): Benoit Bolsee
+*
+* ***** END GPL LICENSE BLOCK *****
 */
 
-#ifndef BMD_DECKLINKAPI_H
-#define BMD_DECKLINKAPI_H
-
-
-#ifndef BMD_CONST
-    #if defined(_MSC_VER)
-        #define BMD_CONST __declspec(selectany) static const
-    #else
-        #define BMD_CONST static const
-    #endif
-#endif
-
-/* DeckLink API */
-
-#include <stdint.h>
-#include "LinuxCOM.h"
-
-#include "DeckLinkAPITypes.h"
-#include "DeckLinkAPIModes.h"
-#include "DeckLinkAPIDiscovery.h"
-#include "DeckLinkAPIConfiguration.h"
-#include "DeckLinkAPIDeckControl.h"
-
-#define BLACKMAGIC_DECKLINK_API_MAGIC	1
-
-// Type Declarations
-
-
-// Interface ID Declarations
-
-BMD_CONST REFIID IID_IDeckLinkVideoOutputCallback                 = /* 20AA5225-1958-47CB-820B-80A8D521A6EE */ {0x20,0xAA,0x52,0x25,0x19,0x58,0x47,0xCB,0x82,0x0B,0x80,0xA8,0xD5,0x21,0xA6,0xEE};
-BMD_CONST REFIID IID_IDeckLinkInputCallback                       = /* DD04E5EC-7415-42AB-AE4A-E80C4DFC044A */ {0xDD,0x04,0xE5,0xEC,0x74,0x15,0x42,0xAB,0xAE,0x4A,0xE8,0x0C,0x4D,0xFC,0x04,0x4A};
-BMD_CONST REFIID IID_IDeckLinkMemoryAllocator                     = /* B36EB6E7-9D29-4AA8-92EF-843B87A289E8 */ {0xB3,0x6E,0xB6,0xE7,0x9D,0x29,0x4A,0xA8,0x92,0xEF,0x84,0x3B,0x87,0xA2,0x89,0xE8};
-BMD_CONST REFIID IID_IDeckLinkAudioOutputCallback                 = /* 403C681B-7F46-4A12-B993-2BB127084EE6 */ {0x40,0x3C,0x68,0x1B,0x7F,0x46,0x4A,0x12,0xB9,0x93,0x2B,0xB1,0x27,0x08,0x4E,0xE6};
-BMD_CONST REFIID IID_IDeckLinkIterator                            = /* 50FB36CD-3063-4B73-BDBB-958087F2D8BA */ {0x50,0xFB,0x36,0xCD,0x30,0x63,0x4B,0x73,0xBD,0xBB,0x95,0x80,0x87,0xF2,0xD8,0xBA};
-BMD_CONST REFIID IID_IDeckLinkAPIInformation                      = /* 7BEA3C68-730D-4322-AF34-8A7152B532A4 */ {0x7B,0xEA,0x3C,0x68,0x73,0x0D,0x43,0x22,0xAF,0x34,0x8A,0x71,0x52,0xB5,0x32,0xA4};
-BMD_CONST REFIID IID_IDeckLinkOutput                              = /* CC5C8A6E-3F2F-4B3A-87EA-FD78AF300564 */ {0xCC,0x5C,0x8A,0x6E,0x3F,0x2F,0x4B,0x3A,0x87,0xEA,0xFD,0x78,0xAF,0x30,0x05,0x64};
-BMD_CONST REFIID IID_IDeckLinkInput                               = /* AF22762B-DFAC-4846-AA79-FA8883560995 */ {0xAF,0x22,0x76,0x2B,0xDF,0xAC,0x48,0x46,0xAA,0x79,0xFA,0x88,0x83,0x56,0x09,0x95};
-BMD_CONST REFIID IID_IDeckLinkVideoFrame    

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list