Commit ae2aee72 authored by Jeremy Tellaa's avatar Jeremy Tellaa Committed by jeremad

fix(rtmp): fix rtmp plugin compilation on windows

parent e1e316df
......@@ -103,7 +103,6 @@ endforeach(OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES)
option(DISABLE_RTMP "Create RTMP I/O plugin" OFF)
option(DISABLE_PORTAUDIO "Create Portaudio I/O plugin" ${CMAKE_CROSSCOMPILING})
#add_subdirectory(src/rtmp)
if(LINUX OR ANDROID)
add_subdirectory(src/v4l2)
endif(LINUX OR ANDROID)
......@@ -113,13 +112,16 @@ if(LINUX OR WINDOWS)
endif(LINUX OR WINDOWS)
if(WINDOWS)
find_library(libmfxhw64 libmfx HINTS "${INTEL_MEDIA_SDK_PATH}\\lib\\x64" REQUIRED)
find_library(libmfxhw64 libmfx_vs2015 HINTS "${INTEL_MEDIA_SDK_PATH}\\lib\\x64" REQUIRED)
include_directories("${INTEL_MEDIA_SDK_PATH}\\include")
include_directories("${INTEL_MEDIA_SDK_PATH}\\igfx_s3dcontrol\\include")
#add_subdirectory(src/aja)
add_subdirectory(src/decklink)
add_subdirectory(src/magewell)
add_subdirectory(src/magewellpro)
add_subdirectory(src/ximea_2)
endif(WINDOWS)
add_subdirectory(src/rtmp)
# ----------------------------------------------------------------------------
......
......@@ -29,7 +29,7 @@ Copyright(c) 2008-2013 Intel Corporation. All Rights Reserved.
#include <string.h>
#include <functional>
#include "mfx/mfxvideo.h"
#include "mfxvideo.h"
struct mfxAllocatorParams {
virtual ~mfxAllocatorParams(){};
......
......@@ -10,7 +10,7 @@ Copyright(c) 2013 Intel Corporation. All Rights Reserved.
#pragma once
#include "mfx/mfxvideo.h"
#include "mfxvideo.h"
#if defined(WIN32) || defined(WIN64)
#ifndef D3D_SURFACES_SUPPORT
......
......@@ -15,9 +15,9 @@
#include "libvideostitch/ptv.hpp"
#include <ostream>
#ifdef _MSC_VER
#ifdef DELAY_LOAD_ENABLED
SET_DELAY_LOAD_HOOK
#endif // _MSC_VER
#endif // DELAY_LOAD_ENABLED
/** \name Services for reader plugin. */
//\{
......
......@@ -227,12 +227,10 @@ endif(USE_AVFORMAT)
set_property(TARGET ${PLUGIN_NAME} PROPERTY CXX_STANDARD 14)
if(WINDOWS)
find_library(libx264 libx264 REQUIRED)
find_library(librtmp librtmp REQUIRED)
find_package(mp3lame CONFIG REQUIRED)
find_library(libmpghip libmpghip-static HINTS "${CMAKE_EXTERNAL_LIB}/lame" REQUIRED NO_DEFAULT_PATH)
find_library(libfaac libfaac HINTS "${CMAKE_EXTERNAL_LIB}/faac" REQUIRED NO_DEFAULT_PATH)
find_library(libmfxhw64 libmfx HINTS "${CMAKE_EXTERNAL_LIB}/Intel_Media_SDK" REQUIRED NO_DEFAULT_PATH)
find_library(libvfaad libfaad2 HINTS "${CMAKE_EXTERNAL_LIB}/faad" REQUIRED NO_DEFAULT_PATH)
set(DirectX_LIB
dxva2
d3d9
......@@ -240,8 +238,50 @@ if(WINDOWS)
d3d11
Ws2_32
Winmm)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} mp3lame:mp3lame ${libmfxhw64} ${DirectX_LIB})
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} mp3lame::mp3lame ${libmfxhw64} ${DirectX_LIB})
set_property(TARGET ${PLUGIN_NAME} APPEND_STRING PROPERTY LINK_FLAGS "/NODEFAULTLIB:libcmt /NODEFAULTLIB:libcmtd")
find_package(Git)
include(ExternalProject)
############################################################
## Build FAAC
############################################################
ExternalProject_Add(faac
GIT_REPOSITORY https://github.com/stitchEm/faac.git
GIT_TAG master
PATCH_COMMAND ""
CONFIGURE_COMMAND echo "Configure faac..."
BUILD_COMMAND msbuild
/p:Configuration=Release,Platform=x64
/m <SOURCE_DIR>/libfaac/libfaac_dll.sln
INSTALL_COMMAND echo "..."
LICENSE_FILES COPYING
)
ExternalProject_Get_Property(faac SOURCE_DIR)
target_include_directories(${PLUGIN_NAME} PRIVATE ${SOURCE_DIR}/include)
set(Faac_LIBRARY ${SOURCE_DIR}/libfaac/ReleaseDLL/libfaac.lib)
############################################################
## Build FAAD2
############################################################
ExternalProject_Add(faad2
GIT_REPOSITORY https://github.com/stitchEm/faad2.git
GIT_TAG xmms2
PATCH_COMMAND ""
CONFIGURE_COMMAND echo "Configure faad2..."
BUILD_COMMAND msbuild
/p:Configuration=Release,Platform=x64
/m <SOURCE_DIR>/libfaad/libfaad2_dll.sln
INSTALL_COMMAND echo "..."
LICENSE_FILES COPYING
)
ExternalProject_Get_Property(faad2 SOURCE_DIR)
add_dependencies(${PLUGIN_NAME} faad2 faac)
set(libfaad ${SOURCE_DIR}/libfaad/ReleaseDLL/libfaad2.lib)
target_include_directories(${PLUGIN_NAME} PRIVATE ${SOURCE_DIR}/include)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${Faac_LIBRARY} ${libfaad} ${CUVID})
endif()
if(LINUX OR ANDROID)
......@@ -267,10 +307,10 @@ if(LINUX OR ANDROID)
endif()
target_link_libraries(${PLUGIN_NAME} PRIVATE ${librtmp} ${libx264} ${libmp3lame} ${libfaac} ${libvfaad})
if(RTMP_QUICKSYNC)
find_library(libmfxhw64 mfxhw64 HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_DEFAULT_PATH)
find_library(igfx_s3dcontrol igfx_s3dcontrol PATH "${INTEL_MEDIA_SDK_PATH}\\igfx_s3dcontrol\\lib\\x64" REQUIRED)
find_library(libva va HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_SYSTEM_ENVIRONMENT_PATH)
find_library(libva_drm va-drm HINTS ${CMAKE_EXTERNAL_LIB} REQUIRED NO_SYSTEM_ENVIRONMENT_PATH)
target_link_libraries(${PLUGIN_NAME} PRIVATE ${libmfxhw64} ${libva} ${libva_drm})
target_link_libraries(${PLUGIN_NAME} PRIVATE ${libmfxhw64} ${libva} ${libva_drm} ${igfx_s3dcontrol})
endif()
endif()
......
......@@ -29,7 +29,7 @@ Copyright(c) 2008-2013 Intel Corporation. All Rights Reserved.
#include <string.h>
#include <functional>
#include "mfx/mfxvideo++.h"
#include "mfxvideo++.h"
struct mfxAllocatorParams {
virtual ~mfxAllocatorParams(){};
......
......@@ -13,7 +13,7 @@ Copyright(c) 2014 Intel Corporation. All Rights Reserved.
#include <stdio.h>
#include "mfx/mfxstructures.h"
#include "mfxstructures.h"
#include <atomic>
#include <mutex>
......
......@@ -10,7 +10,7 @@ Copyright(c) 2013 Intel Corporation. All Rights Reserved.
#pragma once
#include "mfx/mfxvideo++.h"
#include "mfxvideo++.h"
#if defined(WIN32) || defined(WIN64)
#ifndef D3D_SURFACES_SUPPORT
......
......@@ -22,7 +22,7 @@ Copyright(c) 2011-2015 Intel Corporation. All Rights Reserved.
#include "d3dDevice.hpp"
#include "d3dAllocator.hpp"
#include "mfx/igfx_s3dcontrol.h"
#include "igfx_s3dcontrol.h"
#include "atlbase.h"
......
......@@ -7,7 +7,7 @@
#include "audioDecoder.hpp"
#if defined(_WIN32)
#include "faad/faad.h"
#include "faad.h"
#else
#include <neaacdec.h>
#endif
......
......@@ -9,7 +9,7 @@
#include "librtmpIncludes.hpp"
#if defined(_WIN32)
#include "faac/faac.h"
#include "faac.h"
#else
#include <faac.h>
#endif
......
......@@ -22,7 +22,7 @@ extern "C" {
#endif
}
#include "mfx/mfxvideo++.h"
#include "mfxvideo++.h"
#define MFX_IMPL_VIA_MASK(x) (0x0f00 & (x))
#define MSDK_ALIGN16(value) (((value + 15) >> 4) << 4) // round up to a multiple of 16
......
......@@ -421,7 +421,7 @@ char* NvEncoder::metadata(char* enc, char* pend) {
extern "C" {
#if defined(_WIN32)
#include "x264/x264.h"
#include "x264.h"
#else
#include <unistd.h>
#include <inttypes.h>
......
......@@ -20,7 +20,7 @@ extern "C" {
#endif
}
#include "mfx/mfxvideo++.h"
#include "mfxvideo++.h"
#include <thread>
......
......@@ -24,9 +24,10 @@ if (WINDOWS)
include_directories("${VCPKG_PATH}\\${VCPKG_TARGET_TRIPLET}-static\\include")
include_directories(${OPENGL_INCLUDE_DIRS})
include_directories(${OPENCV_INCLUDE_DIRS})
include_directories("${NVIDIA_VIDEO_CODEC}\\include")
find_library(CUDA cuda PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" NO_DEFAULT_PATH)
find_library(CUDART cudart PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" NO_DEFAULT_PATH)
find_library(CUVID nvcuvid PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" NO_DEFAULT_PATH)
find_library(CUVID nvcuvid PATHS "${NVIDIA_VIDEO_CODEC}\\Lib\\Win32")
find_library(NVML nvml PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" NO_DEFAULT_PATH)
endif(WINDOWS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment