diff --git a/.gitignore b/.gitignore index d40d484..8fd886b 100644 --- a/.gitignore +++ b/.gitignore @@ -67,6 +67,7 @@ callgrind.out.* *_qmlcache.qrc test.o-* object_script.* +*.user # Ignore files generated by Python # #################################### diff --git a/cmio/cmio.pro b/CMakeLists.txt similarity index 70% rename from cmio/cmio.pro rename to CMakeLists.txt index c2df1ed..e8473b8 100644 --- a/cmio/cmio.pro +++ b/CMakeLists.txt @@ -1,26 +1,33 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -TEMPLATE = subdirs -CONFIG += ordered - -SUBDIRS = \ - PlatformUtils \ - VCamIPC \ - Assistant \ - VirtualCamera +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(AkVirtualCamera) + +include(commons.cmake) + +add_subdirectory(VCamUtils) + +if (APPLE) + add_subdirectory(cmio) +elseif (WIN32) + add_subdirectory(dshow) +endif () + +add_subdirectory(Manager) diff --git a/Manager/CMakeLists.txt b/Manager/CMakeLists.txt new file mode 100644 index 0000000..fc5d29d --- /dev/null +++ b/Manager/CMakeLists.txt @@ -0,0 +1,77 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(Manager LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +if (APPLE) + include(../cmio/cmio.cmake) + set(INSTALLPATH ${CMIO_PLUGIN_NAME}.plugin/Contents/Resources) +elseif (WIN32) + include(../dshow/dshow.cmake) + set(INSTALLPATH ${DSHOW_PLUGIN_NAME}.plugin/${TARGET_ARCH}) +endif () + +add_executable(Manager + src/cmdparser.h + src/main.cpp + src/cmdparser.cpp) +set_target_properties(Manager PROPERTIES + OUTPUT_NAME AkVCamManager + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALLPATH}") +add_dependencies(Manager VCamIPC PlatformUtils VCamUtils) +target_include_directories(Manager + PRIVATE ..) +target_link_libraries(Manager + VCamIPC + PlatformUtils + VCamUtils) + +if (APPLE) + find_library(COREFOUNDATION_FRAMEWORK NAMES CoreFoundation) + find_library(COREMEDIA_FRAMEWORK NAMES CoreMedia) + find_library(COREMEDIAIO_FRAMEWORK NAMES CoreMediaIO) + find_library(COREVIDEO_FRAMEWORK NAMES CoreVideo) + find_library(FOUNDATION_FRAMEWORK NAMES Foundation) + find_library(IOKIT_FRAMEWORK NAMES IOKit) + find_library(IOSURFACE_FRAMEWORK NAMES IOSurface) + set(EXTRA_LIBS ${COREFOUNDATION_FRAMEWORK} + ${COREMEDIA_FRAMEWORK} + ${COREMEDIAIO_FRAMEWORK} + ${COREVIDEO_FRAMEWORK} + ${FOUNDATION_FRAMEWORK} + ${IOKIT_FRAMEWORK} + ${IOSURFACE_FRAMEWORK}) + target_link_libraries(Manager + ${EXTRA_LIBS}) +elseif (WIN32) + target_link_libraries(Manager + advapi32 + gdi32 + strmiids + uuid + ole32 + oleaut32 + shell32) +endif () + +install(TARGETS Manager DESTINATION ${INSTALLPATH}) diff --git a/Manager/Manager.pro b/Manager/Manager.pro deleted file mode 100644 index b2b779c..0000000 --- a/Manager/Manager.pro +++ /dev/null @@ -1,86 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../commons.pri) { - include(../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -win32: include(../dshow/dshow.pri) -macx: include(../cmio/cmio.pri) - -TEMPLATE = app -CONFIG += console link_prl -CONFIG -= app_bundle -CONFIG -= qt - -TARGET = AkVCamManager - -HEADERS = \ - src/cmdparser.h - -SOURCES = \ - src/main.cpp \ - src/cmdparser.cpp - -INCLUDEPATH += \ - .. \ - ../.. - -win32: LIBS += \ - -L$${OUT_PWD}/../dshow/VCamIPC/$${BIN_DIR} -lVCamIPC \ - -L$${OUT_PWD}/../dshow/PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -ladvapi32 \ - -lgdi32 \ - -lstrmiids \ - -luuid \ - -lole32 \ - -loleaut32 \ - -lshell32 -macx: LIBS += \ - -L$${OUT_PWD}/../cmio/VCamIPC/$${BIN_DIR} -lVCamIPC \ - -L$${OUT_PWD}/../cmio/PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -framework CoreFoundation \ - -framework CoreMedia \ - -framework CoreMediaIO \ - -framework CoreVideo \ - -framework Foundation \ - -framework IOKit \ - -framework IOSurface -LIBS += \ - -L$${OUT_PWD}/../VCamUtils/$${BIN_DIR} -lVCamUtils - -isEmpty(STATIC_BUILD) | isEqual(STATIC_BUILD, 0) { - win32-g++: QMAKE_LFLAGS = -static -static-libgcc -static-libstdc++ -} - -win32 { - INSTALLPATH = $${DSHOW_PLUGIN_NAME}.plugin/$$normalizedArch(TARGET_ARCH) -} else { - INSTALLPATH = $${CMIO_PLUGIN_NAME}.plugin/Contents/Resources -} - -DESTDIR = $${OUT_PWD}/../$${INSTALLPATH} - -INSTALLS += target -target.path = $${PREFIX}/$${INSTALLPATH} diff --git a/Manager/src/cmdparser.cpp b/Manager/src/cmdparser.cpp index 178915d..f430a0d 100644 --- a/Manager/src/cmdparser.cpp +++ b/Manager/src/cmdparser.cpp @@ -36,8 +36,8 @@ #include "cmdparser.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/settings.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/logger.h" #define AKVCAM_BIND_FUNC(member) \ diff --git a/VCamUtils/CMakeLists.txt b/VCamUtils/CMakeLists.txt new file mode 100644 index 0000000..b021668 --- /dev/null +++ b/VCamUtils/CMakeLists.txt @@ -0,0 +1,47 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.14) + +project(VCamUtils LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(VCamUtils STATIC + src/color.h + src/fraction.cpp + src/fraction.h + src/ipcbridge.h + src/logger.cpp + src/logger.h + src/settings.cpp + src/settings.h + src/timer.cpp + src/timer.h + src/utils.cpp + src/utils.h + src/videoformat.cpp + src/videoformat.h + src/videoformattypes.h + src/videoframe.cpp + src/videoframe.h + src/videoframetypes.h) + +target_compile_definitions(VCamUtils PRIVATE VCAMUTILS_LIBRARY) diff --git a/VCamUtils/VCamUtils.pro b/VCamUtils/VCamUtils.pro deleted file mode 100644 index 6c6e268..0000000 --- a/VCamUtils/VCamUtils.pro +++ /dev/null @@ -1,65 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../commons.pri) { - include(../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -CONFIG += \ - staticlib \ - create_prl \ - no_install_prl -CONFIG -= qt - -DESTDIR = $${OUT_PWD}/$${BIN_DIR} - -TARGET = VCamUtils - -TEMPLATE = lib - -SOURCES += \ - src/fraction.cpp \ - src/image/videoformat.cpp \ - src/image/videoframe.cpp \ - src/logger.cpp \ - src/settings.cpp \ - src/timer.cpp \ - src/utils.cpp - -HEADERS += \ - src/fraction.h \ - src/image/color.h \ - src/image/videoformat.h \ - src/image/videoframe.h \ - src/image/videoframetypes.h \ - src/image/videoformattypes.h \ - src/ipcbridge.h \ - src/logger.h \ - src/settings.h \ - src/timer.h \ - src/utils.h - -isEmpty(STATIC_BUILD) | isEqual(STATIC_BUILD, 0) { - win32-g++: QMAKE_LFLAGS = -static -static-libgcc -static-libstdc++ -} diff --git a/VCamUtils/src/image/color.h b/VCamUtils/src/color.h similarity index 100% rename from VCamUtils/src/image/color.h rename to VCamUtils/src/color.h diff --git a/VCamUtils/src/ipcbridge.h b/VCamUtils/src/ipcbridge.h index 5e4dfa3..3dec9e6 100644 --- a/VCamUtils/src/ipcbridge.h +++ b/VCamUtils/src/ipcbridge.h @@ -23,8 +23,8 @@ #include #include -#include "image/videoformattypes.h" -#include "image/videoframetypes.h" +#include "videoformattypes.h" +#include "videoframetypes.h" #include "utils.h" namespace AkVCam diff --git a/VCamUtils/src/image/videoformat.cpp b/VCamUtils/src/videoformat.cpp similarity index 99% rename from VCamUtils/src/image/videoformat.cpp rename to VCamUtils/src/videoformat.cpp index d7ca89e..e6372d5 100644 --- a/VCamUtils/src/image/videoformat.cpp +++ b/VCamUtils/src/videoformat.cpp @@ -22,7 +22,7 @@ #include #include "videoformat.h" -#include "../utils.h" +#include "utils.h" namespace AkVCam { diff --git a/VCamUtils/src/image/videoformat.h b/VCamUtils/src/videoformat.h similarity index 99% rename from VCamUtils/src/image/videoformat.h rename to VCamUtils/src/videoformat.h index f36946b..ed3ec3f 100644 --- a/VCamUtils/src/image/videoformat.h +++ b/VCamUtils/src/videoformat.h @@ -24,7 +24,7 @@ #include #include "videoformattypes.h" -#include "../fraction.h" +#include "fraction.h" namespace AkVCam { diff --git a/VCamUtils/src/image/videoformattypes.h b/VCamUtils/src/videoformattypes.h similarity index 100% rename from VCamUtils/src/image/videoformattypes.h rename to VCamUtils/src/videoformattypes.h diff --git a/VCamUtils/src/image/videoframe.cpp b/VCamUtils/src/videoframe.cpp similarity index 99% rename from VCamUtils/src/image/videoframe.cpp rename to VCamUtils/src/videoframe.cpp index 816ff2c..8d2d920 100644 --- a/VCamUtils/src/image/videoframe.cpp +++ b/VCamUtils/src/videoframe.cpp @@ -24,7 +24,7 @@ #include "videoframe.h" #include "videoformat.h" -#include "../utils.h" +#include "utils.h" namespace AkVCam { diff --git a/VCamUtils/src/image/videoframe.h b/VCamUtils/src/videoframe.h similarity index 100% rename from VCamUtils/src/image/videoframe.h rename to VCamUtils/src/videoframe.h diff --git a/VCamUtils/src/image/videoframetypes.h b/VCamUtils/src/videoframetypes.h similarity index 100% rename from VCamUtils/src/image/videoframetypes.h rename to VCamUtils/src/videoframetypes.h diff --git a/cmio/Assistant/Assistant.pro b/cmio/Assistant/Assistant.pro deleted file mode 100644 index 1616c4f..0000000 --- a/cmio/Assistant/Assistant.pro +++ /dev/null @@ -1,61 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../cmio.pri) - -CONFIG += console link_prl -CONFIG -= app_bundle -CONFIG -= qt - -TARGET = $${CMIO_PLUGIN_ASSISTANT_NAME} - -TEMPLATE = app - -SOURCES += \ - src/main.cpp \ - src/assistant.cpp - -LIBS += \ - -L$${OUT_PWD}/../PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -framework CoreFoundation - -HEADERS += \ - src/assistantglobals.h \ - src/assistant.h - -INCLUDEPATH += \ - .. \ - ../.. - -INSTALLPATH = $${CMIO_PLUGIN_NAME}.plugin/Contents/Resources - -DESTDIR = $${OUT_PWD}/../../$${INSTALLPATH} - -INSTALLS += target -target.path = $${PREFIX}/$${INSTALLPATH} diff --git a/cmio/Assistant/CMakeLists.txt b/cmio/Assistant/CMakeLists.txt new file mode 100644 index 0000000..dfccb27 --- /dev/null +++ b/cmio/Assistant/CMakeLists.txt @@ -0,0 +1,47 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(Assistant LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../cmio.cmake) +set(INSTALLPATH ${CMIO_PLUGIN_NAME}.plugin/Contents/Resources) + +add_executable(Assistant + src/assistant.cpp + src/assistant.h + src/assistantglobals.h + src/main.cpp) +set_target_properties(Assistant PROPERTIES + OUTPUT_NAME ${CMIO_PLUGIN_ASSISTANT_NAME} + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALLPATH}") +add_dependencies(Assistant PlatformUtils VCamUtils) +target_include_directories(Assistant + PRIVATE .. + PRIVATE ../..) +find_library(COREFOUNDATION_FRAMEWORK NAMES CoreFoundation) +set(EXTRA_LIBS ${COREFOUNDATION_FRAMEWORK}) +target_link_libraries(Assistant + PlatformUtils + VCamUtils + ${EXTRA_LIBS}) +install(TARGETS Assistant DESTINATION ${INSTALLPATH}) diff --git a/cmio/Assistant/src/assistant.cpp b/cmio/Assistant/src/assistant.cpp index a6bd986..9423c44 100644 --- a/cmio/Assistant/src/assistant.cpp +++ b/cmio/Assistant/src/assistant.cpp @@ -27,8 +27,8 @@ #include "assistant.h" #include "assistantglobals.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/logger.h" diff --git a/dshow/dshow.pro b/cmio/CMakeLists.txt similarity index 75% rename from dshow/dshow.pro rename to cmio/CMakeLists.txt index c2df1ed..19e34ae 100644 --- a/dshow/dshow.pro +++ b/cmio/CMakeLists.txt @@ -1,26 +1,26 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -TEMPLATE = subdirs -CONFIG += ordered - -SUBDIRS = \ - PlatformUtils \ - VCamIPC \ - Assistant \ - VirtualCamera +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(dshow) + +add_subdirectory(PlatformUtils) +add_subdirectory(VCamIPC) +add_subdirectory(Assistant) +add_subdirectory(VirtualCamera) diff --git a/cmio/PlatformUtils/CMakeLists.txt b/cmio/PlatformUtils/CMakeLists.txt new file mode 100644 index 0000000..679769c --- /dev/null +++ b/cmio/PlatformUtils/CMakeLists.txt @@ -0,0 +1,44 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.14) + +project(PlatformUtils LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../cmio.cmake) + +add_library(PlatformUtils STATIC + src/preferences.cpp + src/preferences.h + src/utils.cpp + src/utils.h) + +add_dependencies(PlatformUtils VCamUtils) +target_compile_definitions(PlatformUtils PRIVATE PLATFORMUTILS_LIBRARY) +target_include_directories(PlatformUtils PRIVATE ../..) +find_library(COREFOUNDATION_FRAMEWORK NAMES CoreFoundation) +find_library(COREGRAPHICS_FRAMEWORK NAMES CoreGraphics) +set(EXTRA_LIBS ${COREFOUNDATION_FRAMEWORK} + ${COREGRAPHICS_FRAMEWORK}) +target_link_libraries(PlatformUtils + VCamUtils + ${EXTRA_LIBS}) diff --git a/cmio/PlatformUtils/src/preferences.cpp b/cmio/PlatformUtils/src/preferences.cpp index fcf4b2c..cb6a05e 100644 --- a/cmio/PlatformUtils/src/preferences.cpp +++ b/cmio/PlatformUtils/src/preferences.cpp @@ -21,7 +21,7 @@ #include "preferences.h" #include "utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/logger.h" #define PREFERENCES_ID CFSTR(CMIO_ASSISTANT_NAME) diff --git a/cmio/PlatformUtils/src/utils.cpp b/cmio/PlatformUtils/src/utils.cpp index 4e8388d..3a7a142 100644 --- a/cmio/PlatformUtils/src/utils.cpp +++ b/cmio/PlatformUtils/src/utils.cpp @@ -26,8 +26,8 @@ #include "utils.h" #include "VCamUtils/src/logger.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" namespace AkVCam { namespace Utils { diff --git a/cmio/PlatformUtils/src/utils.h b/cmio/PlatformUtils/src/utils.h index 2e131d7..371d0e7 100644 --- a/cmio/PlatformUtils/src/utils.h +++ b/cmio/PlatformUtils/src/utils.h @@ -25,7 +25,7 @@ #include #include -#include "VCamUtils/src/image/videoformattypes.h" +#include "VCamUtils/src/videoformattypes.h" namespace AkVCam { diff --git a/cmio/VCamIPC/VCamIPC.pro b/cmio/VCamIPC/CMakeLists.txt similarity index 51% rename from cmio/VCamIPC/VCamIPC.pro rename to cmio/VCamIPC/CMakeLists.txt index edac20b..24d686b 100644 --- a/cmio/VCamIPC/VCamIPC.pro +++ b/cmio/VCamIPC/CMakeLists.txt @@ -1,5 +1,5 @@ # akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone +# Copyright (C) 2021 Gonzalo Exequiel Pedone # # akvirtualcamera is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,40 +16,26 @@ # # Web-Site: http://webcamoid.github.io/ -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} +cmake_minimum_required(VERSION 3.14) -include(../cmio.pri) +project(VCamIPC LANGUAGES CXX OBJCXX) -CONFIG += \ - staticlib \ - create_prl \ - no_install_prl -CONFIG -= qt +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -DESTDIR = $${OUT_PWD}/$${BIN_DIR} +include(../cmio.cmake) -TARGET = VCamIPC +add_library(VCamIPC STATIC + src/ipcbridge.mm) -TEMPLATE = lib - -LIBS = \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -framework Foundation - -OBJECTIVE_SOURCES = \ - src/ipcbridge.mm - -HEADERS = \ - ../../ipcbridge.h - -INCLUDEPATH += \ - .. \ - ../.. +add_dependencies(VCamIPC VCamUtils) +target_compile_definitions(VCamIPC PRIVATE VCAMIPC_LIBRARY) +target_include_directories(VCamIPC + PRIVATE .. + PRIVATE ../..) +find_library(FOUNDATION_FRAMEWORK NAMES Foundation) +set(EXTRA_LIBS ${FOUNDATION_FRAMEWORK}) +target_link_libraries(VCamIPC + VCamUtils + ${EXTRA_LIBS}) diff --git a/cmio/VCamIPC/src/ipcbridge.mm b/cmio/VCamIPC/src/ipcbridge.mm index 9b80861..2152bb3 100644 --- a/cmio/VCamIPC/src/ipcbridge.mm +++ b/cmio/VCamIPC/src/ipcbridge.mm @@ -36,8 +36,8 @@ #include "Assistant/src/assistantglobals.h" #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/logger.h" #include "VCamUtils/src/utils.h" diff --git a/cmio/VirtualCamera/CMakeLists.txt b/cmio/VirtualCamera/CMakeLists.txt new file mode 100644 index 0000000..0891c8b --- /dev/null +++ b/cmio/VirtualCamera/CMakeLists.txt @@ -0,0 +1,83 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.14) + +project(VirtualCamera LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../cmio.cmake) + +set(CONTENTSPATH ${CMIO_PLUGIN_NAME}.plugin/Contents) +set(MACBINPATH ${CONTENTSPATH}/MacOS) + +add_library(VirtualCamera SHARED + src/clock.cpp + src/clock.h + src/device.cpp + src/device.h + src/object.cpp + src/object.h + src/objectinterface.cpp + src/objectinterface.h + src/objectproperties.cpp + src/objectproperties.h + src/plugin.cpp + src/plugin.h + src/plugininterface.cpp + src/plugininterface.h + src/queue.h + src/stream.cpp + src/stream.h) +configure_file(Info.plist.in "${CMAKE_BINARY_DIR}/${CONTENTSPATH}/Info.plist") +set_target_properties(VirtualCamera PROPERTIES + OUTPUT_NAME ${CMIO_PLUGIN_NAME} + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${MACBINPATH}" + PREFIX "" + SUFFIX "") +add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) +target_compile_definitions(VirtualCamera PRIVATE VIRTUALCAMERA_LIBRARY) +target_include_directories(VirtualCamera + PRIVATE .. + PRIVATE ../..) +find_library(COREFOUNDATION_FRAMEWORK NAMES CoreFoundation) +find_library(COREGRAPHICS_FRAMEWORK NAMES CoreGraphics) +find_library(COREMEDIA_FRAMEWORK NAMES CoreMedia) +find_library(COREMEDIAIO_FRAMEWORK NAMES CoreMediaIO) +find_library(COREVIDEO_FRAMEWORK NAMES CoreVideo) +find_library(FOUNDATION_FRAMEWORK NAMES Foundation) +find_library(IOKIT_FRAMEWORK NAMES IOKit) +find_library(IOSURFACE_FRAMEWORK NAMES IOSurface) +set(EXTRA_LIBS ${COREFOUNDATION_FRAMEWORK} + ${COREGRAPHICS_FRAMEWORK} + ${COREMEDIA_FRAMEWORK} + ${COREMEDIAIO_FRAMEWORK} + ${COREVIDEO_FRAMEWORK} + ${FOUNDATION_FRAMEWORK} + ${IOKIT_FRAMEWORK} + ${IOSURFACE_FRAMEWORK}) +target_link_libraries(VirtualCamera + PlatformUtils + VCamUtils + VCamIPC + ${EXTRA_LIBS}) +install(TARGETS VirtualCamera DESTINATION ${MACBINPATH}) +install(FILES "${CMAKE_BINARY_DIR}/${CONTENTSPATH}/Info.plist" DESTINATION ${CONTENTSPATH}) diff --git a/cmio/VirtualCamera/Info.plist.in b/cmio/VirtualCamera/Info.plist.in index 5c4cc52..8dd12ae 100644 --- a/cmio/VirtualCamera/Info.plist.in +++ b/cmio/VirtualCamera/Info.plist.in @@ -17,11 +17,11 @@ CFBundlePackageType BNDL CFBundleShortVersionString - $$VERSION + @VERSION@ CFBundleSignature ???? CFBundleVersion - $$VERSION + @VERSION@ CFBundleSupportedPlatforms MacOSX diff --git a/cmio/VirtualCamera/VirtualCamera.pro b/cmio/VirtualCamera/VirtualCamera.pro deleted file mode 100644 index ece6e8d..0000000 --- a/cmio/VirtualCamera/VirtualCamera.pro +++ /dev/null @@ -1,103 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../cmio.pri) - -CONFIG -= qt link_prl -CONFIG += \ - unversioned_libname \ - unversioned_soname - -DESTDIR = $${OUT_PWD}/$${BIN_DIR} - -INCLUDEPATH += \ - .. \ - ../.. - -LIBS = \ - -L$${OUT_PWD}/../PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -L$${OUT_PWD}/../VCamIPC/$${BIN_DIR} -lVCamIPC \ - -framework CoreFoundation \ - -framework CoreGraphics \ - -framework CoreMedia \ - -framework CoreMediaIO \ - -framework CoreVideo \ - -framework Foundation \ - -framework IOKit \ - -framework IOSurface - -TARGET = $${CMIO_PLUGIN_NAME} -TEMPLATE = lib - -HEADERS += \ - src/plugin.h \ - src/plugininterface.h \ - src/device.h \ - src/object.h \ - src/stream.h \ - src/objectinterface.h \ - src/objectproperties.h \ - src/clock.h \ - src/queue.h - -SOURCES += \ - src/plugin.cpp \ - src/plugininterface.cpp \ - src/device.cpp \ - src/object.cpp \ - src/stream.cpp \ - src/objectinterface.cpp \ - src/objectproperties.cpp \ - src/clock.cpp - -QMAKE_SUBSTITUTES += Info.plist.in - -OTHER_FILES = \ - Info.plist.in - -CONTENTSPATH = $${CMIO_PLUGIN_NAME}.plugin/Contents -MACBINPATH = $${CONTENTSPATH}/MacOS -RESOURCESPATH = $${CONTENTSPATH}/Resources - -INSTALLS += \ - targetLib \ - infoPlist - -targetLib.files = $$shell_path($${OUT_PWD}/../../$${MACBINPATH}/$${CMIO_PLUGIN_NAME}) -targetLib.path = $${PREFIX}/$${MACBINPATH} -targetLib.CONFIG += no_check_exist - -infoPlist.files = $$shell_path($${OUT_PWD}/Info.plist) -infoPlist.path = $${PREFIX}/$${CONTENTSPATH} -infoPlist.CONFIG += no_check_exist - -QMAKE_POST_LINK = \ - $$sprintf($$QMAKE_MKDIR_CMD, $$shell_path($${OUT_PWD}/../../$${MACBINPATH})) $${CMD_SEP} \ - $(COPY) $$shell_path($${OUT_PWD}/Info.plist) $$shell_path($${OUT_PWD}/../../$${CONTENTSPATH}) $${CMD_SEP} \ - $(COPY) $$shell_path($${OUT_PWD}/$${BIN_DIR}/lib$${CMIO_PLUGIN_NAME}.$${QMAKE_EXTENSION_SHLIB}) $$shell_path($${OUT_PWD}/../../$${MACBINPATH}/$${CMIO_PLUGIN_NAME}) $${CMD_SEP} diff --git a/cmio/VirtualCamera/src/objectproperties.cpp b/cmio/VirtualCamera/src/objectproperties.cpp index 19146c6..0c206a2 100644 --- a/cmio/VirtualCamera/src/objectproperties.cpp +++ b/cmio/VirtualCamera/src/objectproperties.cpp @@ -21,7 +21,7 @@ #include "object.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" namespace AkVCam { diff --git a/cmio/VirtualCamera/src/plugininterface.cpp b/cmio/VirtualCamera/src/plugininterface.cpp index deee02b..33729ac 100644 --- a/cmio/VirtualCamera/src/plugininterface.cpp +++ b/cmio/VirtualCamera/src/plugininterface.cpp @@ -26,7 +26,7 @@ #include "Assistant/src/assistantglobals.h" #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/logger.h" diff --git a/cmio/VirtualCamera/src/stream.cpp b/cmio/VirtualCamera/src/stream.cpp index adb73e9..0deca5a 100644 --- a/cmio/VirtualCamera/src/stream.cpp +++ b/cmio/VirtualCamera/src/stream.cpp @@ -29,8 +29,8 @@ #include "clock.h" #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/logger.h" namespace AkVCam diff --git a/cmio/VirtualCamera/src/stream.h b/cmio/VirtualCamera/src/stream.h index 21f65e2..45cd69a 100644 --- a/cmio/VirtualCamera/src/stream.h +++ b/cmio/VirtualCamera/src/stream.h @@ -21,7 +21,7 @@ #define STREAM_H #include "VCamUtils/src/fraction.h" -#include "VCamUtils/src/image/videoframetypes.h" +#include "VCamUtils/src/videoframetypes.h" #include "VCamUtils/src/ipcbridge.h" #include "object.h" #include "queue.h" diff --git a/cmio/cmio.cmake b/cmio/cmio.cmake new file mode 100644 index 0000000..89930ce --- /dev/null +++ b/cmio/cmio.cmake @@ -0,0 +1,34 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +include("${CMAKE_CURRENT_LIST_DIR}/../commons.cmake") + +set(CMIO_PLUGIN_NAME AkVirtualCamera) +set(CMIO_PLUGIN_ASSISTANT_NAME AkVCamAssistant) +set(CMIO_PLUGIN_DEVICE_PREFIX AkVCamVideoDevice) +set(CMIO_PLUGIN_VENDOR "Webcamoid Project") +set(CMIO_PLUGIN_PRODUCT ${CMIO_PLUGIN_NAME}) +set(CMIO_ASSISTANT_NAME "org.webcamoid.cmio.AkVCam.Assistant") + +add_definitions(-DCMIO_PLUGIN_NAME="\\"${CMIO_PLUGIN_NAME}\\"" + -DCMIO_PLUGIN_NAME_L="\\"${CMIO_PLUGIN_NAME}\\"" + -DCMIO_PLUGIN_ASSISTANT_NAME="\\"${CMIO_PLUGIN_ASSISTANT_NAME}\\"" + -DCMIO_PLUGIN_DEVICE_PREFIX="\\"${CMIO_PLUGIN_DEVICE_PREFIX}\\"" + -DCMIO_PLUGIN_VENDOR="\\"${CMIO_PLUGIN_VENDOR}\\"" + -DCMIO_PLUGIN_PRODUCT="\\"${CMIO_PLUGIN_PRODUCT}\\"" + -DCMIO_ASSISTANT_NAME="\\"${CMIO_ASSISTANT_NAME}\\"") diff --git a/cmio/cmio.pri b/cmio/cmio.pri deleted file mode 100644 index bb8ca2f..0000000 --- a/cmio/cmio.pri +++ /dev/null @@ -1,39 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -isEmpty(CMIO_PLUGIN_NAME): - CMIO_PLUGIN_NAME = AkVirtualCamera -isEmpty(CMIO_PLUGIN_ASSISTANT_NAME): - CMIO_PLUGIN_ASSISTANT_NAME = AkVCamAssistant -isEmpty(CMIO_PLUGIN_DEVICE_PREFIX): - CMIO_PLUGIN_DEVICE_PREFIX = AkVCamVideoDevice -isEmpty(CMIO_PLUGIN_VENDOR): - CMIO_PLUGIN_VENDOR = "Webcamoid Project" -isEmpty(CMIO_PLUGIN_PRODUCT): - CMIO_PLUGIN_PRODUCT = $$CMIO_PLUGIN_NAME -isEmpty(CMIO_ASSISTANT_NAME): - CMIO_ASSISTANT_NAME = "org.webcamoid.cmio.AkVCam.Assistant" - -DEFINES += \ - CMIO_PLUGIN_NAME=\"\\\"$$CMIO_PLUGIN_NAME\\\"\" \ - CMIO_PLUGIN_NAME_L=\"L\\\"$$CMIO_PLUGIN_NAME\\\"\" \ - CMIO_PLUGIN_ASSISTANT_NAME=\"\\\"$$CMIO_PLUGIN_ASSISTANT_NAME\\\"\" \ - CMIO_PLUGIN_DEVICE_PREFIX=\"\\\"$$CMIO_PLUGIN_DEVICE_PREFIX\\\"\" \ - CMIO_PLUGIN_VENDOR=\"\\\"$$CMIO_PLUGIN_VENDOR\\\"\" \ - CMIO_PLUGIN_PRODUCT=\"\\\"$$CMIO_PLUGIN_PRODUCT\\\"\" \ - CMIO_ASSISTANT_NAME=\"\\\"$$CMIO_ASSISTANT_NAME\\\"\" diff --git a/commons.cmake b/commons.cmake new file mode 100644 index 0000000..b26f189 --- /dev/null +++ b/commons.cmake @@ -0,0 +1,64 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +set(COMMONS_APPNAME AkVirtualCamera) +string(TOLOWER ${COMMONS_APPNAME} COMMONS_TARGET) + +set(VER_MAJ 9) +set(VER_MIN 0) +set(VER_PAT 0) +set(VERSION ${VER_MAJ}.${VER_MIN}.${VER_PAT}) + +add_definitions(-DCOMMONS_APPNAME="\\"${COMMONS_APPNAME}\\"" + -DCOMMONS_TARGET="\\"${COMMONS_TARGET}\\"" + -DCOMMONS_VER_MAJ="\\"${VER_MAJ}\\"" + -DCOMMONS_VERSION="\\"${VERSION}\\"" + -DPREFIX="\\"${PREFIX}\\"") + +if (WIN32) + include(CheckCXXSourceCompiles) + + check_cxx_source_compiles(" + #if !defined(__amd64__) \\ + && !defined(__amd64) \\ + && !defined(__x86_64_) \\ + && !defined(__x86_64) \\ + && !defined(_M_X64) \\ + && !defined(_M_AMD64) + #error Not x64 + #endif + + int main() + { + return 0; + }" HAVE_X64) + + if (HAVE_X64) + set(TARGET_ARCH x64) + else () + set(TARGET_ARCH x86) + endif() + + add_definitions(-DUNICODE -D_UNICODE) +endif () + +if (NOT APPLE AND NOT WIN32) + message(FATAL_ERROR "This driver only works in Mac an Windows. For Linux check 'akvcam' instead.") +endif () diff --git a/commons.pri b/commons.pri deleted file mode 100644 index 7d9741f..0000000 --- a/commons.pri +++ /dev/null @@ -1,92 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -COMMONS_APPNAME = "AkVirtualCamera" -COMMONS_TARGET = $$lower($${COMMONS_APPNAME}) -COMMONS_TARGET = $$replace(COMMONS_TARGET, lib, "") - -VER_MAJ = 9 -VER_MIN = 0 -VER_PAT = 0 -VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT} - -win32 { - host_name = $$lower($$QMAKE_HOST.os) - - !isEmpty(ProgramW6432) { - DEFAULT_PREFIX = $(ProgramW6432) - } else: !isEmpty(ProgramFiles) { - DEFAULT_PREFIX = $(ProgramFiles) - } else: contains(host_name, linux) { - DEFAULT_PREFIX = / - } else { - DEFAULT_PREFIX = C:/ - } -} -macx: DEFAULT_PREFIX = /Applications - -isEmpty(PREFIX): PREFIX = $${DEFAULT_PREFIX} - -DEFINES += \ - COMMONS_APPNAME=\"\\\"$$COMMONS_APPNAME\\\"\" \ - COMMONS_TARGET=\"\\\"$$COMMONS_TARGET\\\"\" \ - COMMONS_VER_MAJ=\"\\\"$$VER_MAJ\\\"\" \ - COMMONS_VERSION=\"\\\"$$VERSION\\\"\" \ - PREFIX=\"\\\"$$PREFIX\\\"\" - -msvc { - TARGET_ARCH = $${QMAKE_TARGET.arch} - TARGET_ARCH = $$basename(TARGET_ARCH) - TARGET_ARCH = $$replace(TARGET_ARCH, x64, x86_64) -} else { - TARGET_ARCH = $$system($${QMAKE_CXX} -dumpmachine) - TARGET_ARCH = $$split(TARGET_ARCH, -) - TARGET_ARCH = $$first(TARGET_ARCH) -} - -COMPILER = $$basename(QMAKE_CXX) -COMPILER = $$replace(COMPILER, \+\+, pp) -COMPILER = $$join(COMPILER, _) - -CONFIG(debug, debug|release) { - COMMONS_BUILD_PATH = debug/$${COMPILER}/$${TARGET_ARCH} -} else { - COMMONS_BUILD_PATH = release/$$COMPILER/$${TARGET_ARCH} -} - -BIN_DIR = $${COMMONS_BUILD_PATH}/bin -MOC_DIR = $${COMMONS_BUILD_PATH}/moc -OBJECTS_DIR = $${COMMONS_BUILD_PATH}/obj -RCC_DIR = $${COMMONS_BUILD_PATH}/rcc -UI_DIR = $${COMMONS_BUILD_PATH}/ui - -win32 { - CONFIG += skip_target_version_ext - !isEmpty(STATIC_BUILD):!isEqual(STATIC_BUILD, 0) { - win32-g++: QMAKE_LFLAGS = -static-libgcc -static-libstdc++ - } -} - -# Enable c++11 support in all platforms -!CONFIG(c++11): CONFIG += c++11 - -!win32: !macx { - error("This driver only works in Mac an Windows. For Linux check 'akvcam' instead.") -} - -CMD_SEP = $$escape_expand(\n\t) diff --git a/dshow/Assistant/Assistant.pro b/dshow/Assistant/Assistant.pro deleted file mode 100644 index f3c843f..0000000 --- a/dshow/Assistant/Assistant.pro +++ /dev/null @@ -1,70 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../dshow.pri) - -TEMPLATE = app -CONFIG += console link_prl -CONFIG -= app_bundle -CONFIG -= qt - -TARGET = $${DSHOW_PLUGIN_ASSISTANT_NAME} - -SOURCES += \ - src/main.cpp \ - src/service.cpp - -HEADERS += \ - src/service.h - -INCLUDEPATH += \ - .. \ - ../.. - -LIBS += \ - -L$${OUT_PWD}/../PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -ladvapi32 \ - -lgdi32 \ - -lole32 \ - -lshell32 \ - -lstrmiids \ - -luuid - -win32-g++: LIBS += -lssp - -isEmpty(STATIC_BUILD) | isEqual(STATIC_BUILD, 0) { - win32-g++: QMAKE_LFLAGS = -static -static-libgcc -static-libstdc++ -} - -INSTALLPATH = $${DSHOW_PLUGIN_NAME}.plugin/$$normalizedArch(TARGET_ARCH) - -DESTDIR = $${OUT_PWD}/../../$${INSTALLPATH} - -INSTALLS += target -target.path = $${PREFIX}/$${INSTALLPATH} diff --git a/dshow/Assistant/CMakeLists.txt b/dshow/Assistant/CMakeLists.txt new file mode 100644 index 0000000..82782c7 --- /dev/null +++ b/dshow/Assistant/CMakeLists.txt @@ -0,0 +1,48 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(Assistant LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../dshow.cmake) +set(INSTALLPATH ${DSHOW_PLUGIN_NAME}.plugin/${TARGET_ARCH}) + +add_executable(Assistant + src/main.cpp + src/service.cpp + src/service.h) +set_target_properties(Assistant PROPERTIES + OUTPUT_NAME ${DSHOW_PLUGIN_ASSISTANT_NAME} + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALLPATH}") +add_dependencies(Assistant PlatformUtils VCamUtils) +target_include_directories(Assistant + PRIVATE .. + PRIVATE ../..) +target_link_libraries(Assistant + PlatformUtils + advapi32 + gdi32 + ole32 + shell32 + strmiids + uuid) +install(TARGETS Assistant DESTINATION ${INSTALLPATH}) diff --git a/dshow/Assistant/src/service.cpp b/dshow/Assistant/src/service.cpp index f2f91ac..b1e88e5 100644 --- a/dshow/Assistant/src/service.cpp +++ b/dshow/Assistant/src/service.cpp @@ -32,8 +32,8 @@ #include "service.h" #include "PlatformUtils/src/messageserver.h" #include "PlatformUtils/src/preferences.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/timer.h" #include "VCamUtils/src/logger.h" diff --git a/akvirtualcamera.pro b/dshow/CMakeLists.txt similarity index 75% rename from akvirtualcamera.pro rename to dshow/CMakeLists.txt index 95833a7..19e34ae 100644 --- a/akvirtualcamera.pro +++ b/dshow/CMakeLists.txt @@ -1,25 +1,26 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -TEMPLATE = subdirs -CONFIG += ordered - -SUBDIRS = VCamUtils -macx: SUBDIRS += cmio -win32: SUBDIRS += dshow -SUBDIRS += Manager +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.5) + +project(dshow) + +add_subdirectory(PlatformUtils) +add_subdirectory(VCamIPC) +add_subdirectory(Assistant) +add_subdirectory(VirtualCamera) diff --git a/dshow/PlatformUtils/CMakeLists.txt b/dshow/PlatformUtils/CMakeLists.txt new file mode 100644 index 0000000..1822388 --- /dev/null +++ b/dshow/PlatformUtils/CMakeLists.txt @@ -0,0 +1,51 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.14) + +project(PlatformUtils LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../dshow.cmake) + +add_library(PlatformUtils STATIC + src/messagecommons.h + src/messageserver.cpp + src/messageserver.h + src/mutex.cpp + src/mutex.h + src/preferences.cpp + src/preferences.h + src/sharedmemory.cpp + src/sharedmemory.h + src/utils.cpp + src/utils.h) + +add_dependencies(PlatformUtils VCamUtils) +target_compile_definitions(PlatformUtils PRIVATE PLATFORMUTILS_LIBRARY) +target_include_directories(PlatformUtils PRIVATE ../..) +target_link_libraries(PlatformUtils + VCamUtils + advapi32 + kernel32 + gdi32 + shell32 + windowscodecs) diff --git a/dshow/PlatformUtils/PlatformUtils.pro b/dshow/PlatformUtils/PlatformUtils.pro deleted file mode 100644 index 4f921e7..0000000 --- a/dshow/PlatformUtils/PlatformUtils.pro +++ /dev/null @@ -1,66 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../dshow.pri) - -CONFIG += \ - staticlib \ - create_prl \ - no_install_prl -CONFIG -= qt - -DESTDIR = $${OUT_PWD}/$${BIN_DIR} - -TARGET = PlatformUtils - -TEMPLATE = lib - -LIBS = \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -ladvapi32 \ - -lkernel32 \ - -lgdi32 \ - -lshell32 \ - -lwindowscodecs - -SOURCES = \ - src/messageserver.cpp \ - src/mutex.cpp \ - src/preferences.cpp \ - src/utils.cpp \ - src/sharedmemory.cpp - -HEADERS = \ - src/messagecommons.h \ - src/messageserver.h \ - src/mutex.h \ - src/preferences.h \ - src/utils.h \ - src/sharedmemory.h - -INCLUDEPATH += ../.. diff --git a/dshow/PlatformUtils/src/messagecommons.h b/dshow/PlatformUtils/src/messagecommons.h index 1ffd58b..b960ead 100644 --- a/dshow/PlatformUtils/src/messagecommons.h +++ b/dshow/PlatformUtils/src/messagecommons.h @@ -24,7 +24,7 @@ #include #include -#include "VCamUtils/src/image/videoframetypes.h" +#include "VCamUtils/src/videoframetypes.h" #define AKVCAM_ASSISTANT_CLIENT_NAME "AkVCam_Client" #define AKVCAM_ASSISTANT_SERVER_NAME "AkVCam_Server" diff --git a/dshow/PlatformUtils/src/preferences.cpp b/dshow/PlatformUtils/src/preferences.cpp index d7f8626..ad7584a 100644 --- a/dshow/PlatformUtils/src/preferences.cpp +++ b/dshow/PlatformUtils/src/preferences.cpp @@ -27,7 +27,7 @@ #include "preferences.h" #include "utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/logger.h" #define REG_PREFIX "SOFTWARE\\Webcamoid\\VirtualCamera" diff --git a/dshow/PlatformUtils/src/utils.cpp b/dshow/PlatformUtils/src/utils.cpp index 443493c..d43510c 100644 --- a/dshow/PlatformUtils/src/utils.cpp +++ b/dshow/PlatformUtils/src/utils.cpp @@ -29,8 +29,8 @@ #include "utils.h" #include "messagecommons.h" #include "VCamUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #define TIME_BASE 1.0e7 diff --git a/dshow/PlatformUtils/src/utils.h b/dshow/PlatformUtils/src/utils.h index fce3042..21b67f5 100644 --- a/dshow/PlatformUtils/src/utils.h +++ b/dshow/PlatformUtils/src/utils.h @@ -23,7 +23,7 @@ #include #include -#include "VCamUtils/src/image/videoformattypes.h" +#include "VCamUtils/src/videoformattypes.h" #include "VCamUtils/src/logger.h" #define AkLogInterface(interface, instance) \ diff --git a/cmio/PlatformUtils/PlatformUtils.pro b/dshow/VCamIPC/CMakeLists.txt similarity index 52% rename from cmio/PlatformUtils/PlatformUtils.pro rename to dshow/VCamIPC/CMakeLists.txt index 39b3886..4b89e47 100644 --- a/cmio/PlatformUtils/PlatformUtils.pro +++ b/dshow/VCamIPC/CMakeLists.txt @@ -1,5 +1,5 @@ # akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone +# Copyright (C) 2021 Gonzalo Exequiel Pedone # # akvirtualcamera is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,41 +16,26 @@ # # Web-Site: http://webcamoid.github.io/ -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} +cmake_minimum_required(VERSION 3.14) -include(../cmio.pri) +project(VCamIPC LANGUAGES CXX) -CONFIG += \ - staticlib \ - create_prl \ - no_install_prl -CONFIG -= qt +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) -DESTDIR = $${OUT_PWD}/$${BIN_DIR} +include(../dshow.cmake) -TARGET = PlatformUtils +add_library(VCamIPC STATIC + src/ipcbridge.cpp) -TEMPLATE = lib - -LIBS = \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -framework CoreFoundation \ - -framework CoreGraphics - -SOURCES = \ - src/preferences.cpp \ - src/utils.cpp - -HEADERS = \ - src/preferences.h \ - src/utils.h - -INCLUDEPATH += ../.. +add_dependencies(VCamIPC PlatformUtils VCamUtils) +target_compile_definitions(VCamIPC PRIVATE VCAMIPC_LIBRARY) +target_include_directories(VCamIPC + PRIVATE .. + PRIVATE ../..) +target_link_libraries(VCamIPC + PlatformUtils + advapi32 + kernel32 + psapi) diff --git a/dshow/VCamIPC/VCamIPC.pro b/dshow/VCamIPC/VCamIPC.pro deleted file mode 100644 index c833993..0000000 --- a/dshow/VCamIPC/VCamIPC.pro +++ /dev/null @@ -1,64 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../dshow.pri) - -CONFIG += \ - staticlib \ - create_prl \ - no_install_prl -CONFIG -= qt - -DESTDIR = $${OUT_PWD}/$${BIN_DIR} - -TARGET = VCamIPC - -TEMPLATE = lib - -LIBS = \ - -L$${OUT_PWD}/../PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -ladvapi32 \ - -lkernel32 \ - -lpsapi - -win32-g++: LIBS += -lssp - -SOURCES = \ - src/ipcbridge.cpp - -HEADERS = \ - ../../ipcbridge.h - -INCLUDEPATH += \ - .. \ - ../.. - -DEFINES += \ - DSHOW_PLUGIN_ARCH=\"\\\"$$normalizedArch(TARGET_ARCH)\\\"\" \ - DSHOW_PLUGIN_ARCH_L=\"L\\\"$$normalizedArch(TARGET_ARCH)\\\"\" diff --git a/dshow/VCamIPC/src/ipcbridge.cpp b/dshow/VCamIPC/src/ipcbridge.cpp index 478afb0..de3ebd5 100644 --- a/dshow/VCamIPC/src/ipcbridge.cpp +++ b/dshow/VCamIPC/src/ipcbridge.cpp @@ -34,8 +34,8 @@ #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/sharedmemory.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/logger.h" diff --git a/dshow/VirtualCamera/CMakeLists.txt b/dshow/VirtualCamera/CMakeLists.txt new file mode 100644 index 0000000..6a0534e --- /dev/null +++ b/dshow/VirtualCamera/CMakeLists.txt @@ -0,0 +1,104 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +cmake_minimum_required(VERSION 3.14) + +project(VirtualCamera LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +include(../dshow.cmake) +set(INSTALLPATH ${DSHOW_PLUGIN_NAME}.plugin/${TARGET_ARCH}) + +add_library(VirtualCamera SHARED + src/basefilter.cpp + src/basefilter.h + src/classfactory.cpp + src/classfactory.h + src/cunknown.cpp + src/cunknown.h + src/enummediatypes.cpp + src/enummediatypes.h + src/enumpins.cpp + src/enumpins.h + src/filtermiscflags.cpp + src/filtermiscflags.h + src/latency.cpp + src/latency.h + src/mediafilter.cpp + src/mediafilter.h + src/mediasample.cpp + src/mediasample.h + src/mediasample2.cpp + src/mediasample2.h + src/memallocator.cpp + src/memallocator.h + src/persist.cpp + src/persist.h + src/persistpropertybag.cpp + src/persistpropertybag.h + src/pin.cpp + src/pin.h + src/plugin.cpp + src/plugin.h + src/plugininterface.cpp + src/plugininterface.h + src/propertyset.cpp + src/propertyset.h + src/pushsource.cpp + src/pushsource.h + src/qualitycontrol.cpp + src/qualitycontrol.h + src/referenceclock.cpp + src/referenceclock.h + src/specifypropertypages.cpp + src/specifypropertypages.h + src/streamconfig.cpp + src/streamconfig.h + src/videocontrol.cpp + src/videocontrol.h + src/videoprocamp.cpp + src/videoprocamp.h + VirtualCamera.def) +set_target_properties(VirtualCamera PROPERTIES + OUTPUT_NAME ${DSHOW_PLUGIN_NAME} + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALLPATH}" + PREFIX "") +add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) +target_compile_definitions(VirtualCamera PRIVATE VIRTUALCAMERA_LIBRARY) +target_include_directories(VirtualCamera + PRIVATE .. + PRIVATE ../..) +target_link_libraries(VirtualCamera + VCamIPC + PlatformUtils + VCamUtils + advapi32 + gdi32 + kernel32 + ole32 + oleaut32 + psapi + shell32 + strmiids + user32 + uuid + winmm) +install(TARGETS VirtualCamera DESTINATION ${INSTALLPATH}) diff --git a/dshow/VirtualCamera/VirtualCamera.def b/dshow/VirtualCamera/VirtualCamera.def index 98f97fe..d1a28ba 100644 --- a/dshow/VirtualCamera/VirtualCamera.def +++ b/dshow/VirtualCamera/VirtualCamera.def @@ -16,7 +16,7 @@ ; ; Web-Site: http://webcamoid.github.io/ -LIBRARY VirtualCameraSource.dll +LIBRARY AkVirtualCamera.dll EXPORTS DllMain PRIVATE diff --git a/dshow/VirtualCamera/VirtualCamera.pro b/dshow/VirtualCamera/VirtualCamera.pro deleted file mode 100644 index 231e97c..0000000 --- a/dshow/VirtualCamera/VirtualCamera.pro +++ /dev/null @@ -1,126 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -exists(commons.pri) { - include(commons.pri) -} else { - exists(../../commons.pri) { - include(../../commons.pri) - } else { - error("commons.pri file not found.") - } -} - -include(../dshow.pri) - -CONFIG -= qt -CONFIG += link_prl - -INCLUDEPATH += \ - .. \ - ../.. - -LIBS += \ - -L$${OUT_PWD}/../VCamIPC/$${BIN_DIR} -lVCamIPC \ - -L$${OUT_PWD}/../PlatformUtils/$${BIN_DIR} -lPlatformUtils \ - -L$${OUT_PWD}/../../VCamUtils/$${BIN_DIR} -lVCamUtils \ - -ladvapi32 \ - -lgdi32 \ - -lkernel32 \ - -lole32 \ - -loleaut32 \ - -lpsapi \ - -lshell32 \ - -lstrmiids \ - -luser32 \ - -luuid \ - -lwinmm - -TARGET = $${DSHOW_PLUGIN_NAME} -TEMPLATE = lib - -HEADERS += \ - src/basefilter.h \ - src/classfactory.h \ - src/cunknown.h \ - src/enummediatypes.h \ - src/enumpins.h \ - src/filtermiscflags.h \ - src/latency.h \ - src/mediafilter.h \ - src/mediasample.h \ - src/mediasample2.h \ - src/memallocator.h \ - src/persist.h \ - src/persistpropertybag.h \ - src/pin.h \ - src/plugin.h \ - src/plugininterface.h \ - src/propertyset.h \ - src/pushsource.h \ - src/qualitycontrol.h \ - src/referenceclock.h \ - src/specifypropertypages.h \ - src/streamconfig.h \ - src/videocontrol.h \ - src/videoprocamp.h - -SOURCES += \ - src/basefilter.cpp \ - src/classfactory.cpp \ - src/cunknown.cpp \ - src/enummediatypes.cpp \ - src/enumpins.cpp \ - src/filtermiscflags.cpp \ - src/latency.cpp \ - src/mediafilter.cpp \ - src/mediasample.cpp \ - src/mediasample2.cpp \ - src/memallocator.cpp \ - src/persist.cpp \ - src/persistpropertybag.cpp \ - src/pin.cpp \ - src/plugin.cpp \ - src/plugininterface.cpp \ - src/propertyset.cpp \ - src/pushsource.cpp \ - src/qualitycontrol.cpp \ - src/referenceclock.cpp \ - src/specifypropertypages.cpp \ - src/streamconfig.cpp \ - src/videocontrol.cpp \ - src/videoprocamp.cpp - -OTHER_FILES = \ - VirtualCamera.def - -DEF_FILE = VirtualCamera.def - -isEmpty(STATIC_BUILD) | isEqual(STATIC_BUILD, 0) { - win32-g++: QMAKE_LFLAGS = -static -static-libgcc -static-libstdc++ -} - -INSTALLPATH = $${DSHOW_PLUGIN_NAME}.plugin/$$normalizedArch(TARGET_ARCH) -RESOURCESPATH = $${DSHOW_PLUGIN_NAME}.plugin/share - -DESTDIR = $${OUT_PWD}/../../$${INSTALLPATH} - -INSTALLS += \ - target - -target.path = $${PREFIX}/$${INSTALLPATH} diff --git a/dshow/VirtualCamera/src/basefilter.cpp b/dshow/VirtualCamera/src/basefilter.cpp index 20d726f..cd2649d 100644 --- a/dshow/VirtualCamera/src/basefilter.cpp +++ b/dshow/VirtualCamera/src/basefilter.cpp @@ -31,7 +31,7 @@ #include "videoprocamp.h" #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/ipcbridge.h" #include "VCamUtils/src/utils.h" diff --git a/dshow/VirtualCamera/src/enummediatypes.cpp b/dshow/VirtualCamera/src/enummediatypes.cpp index ef68dda..8d0316f 100644 --- a/dshow/VirtualCamera/src/enummediatypes.cpp +++ b/dshow/VirtualCamera/src/enummediatypes.cpp @@ -21,7 +21,7 @@ #include "enummediatypes.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/utils.h" namespace AkVCam diff --git a/dshow/VirtualCamera/src/memallocator.cpp b/dshow/VirtualCamera/src/memallocator.cpp index 3dfa7c1..ca17d35 100644 --- a/dshow/VirtualCamera/src/memallocator.cpp +++ b/dshow/VirtualCamera/src/memallocator.cpp @@ -25,7 +25,7 @@ #include "memallocator.h" #include "mediasample.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" #include "VCamUtils/src/utils.h" namespace AkVCam diff --git a/dshow/VirtualCamera/src/pin.cpp b/dshow/VirtualCamera/src/pin.cpp index 7640061..3f55aa1 100644 --- a/dshow/VirtualCamera/src/pin.cpp +++ b/dshow/VirtualCamera/src/pin.cpp @@ -38,8 +38,8 @@ #include "videoprocamp.h" #include "PlatformUtils/src/preferences.h" #include "PlatformUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" -#include "VCamUtils/src/image/videoframe.h" +#include "VCamUtils/src/videoformat.h" +#include "VCamUtils/src/videoframe.h" #include "VCamUtils/src/utils.h" namespace AkVCam @@ -208,7 +208,7 @@ HRESULT AkVCam::Pin::stateChanged(void *userData, FILTER_STATE state) self->d->m_ptsDrift = 0; self->d->m_sendFrameEvent = - CreateSemaphore(nullptr, 1, 1, L"SendFrame"); + CreateSemaphore(nullptr, 1, 1, TEXT("SendFrame")); self->d->m_running = true; self->d->m_sendFrameThread = diff --git a/dshow/VirtualCamera/src/pin.h b/dshow/VirtualCamera/src/pin.h index 837e3ce..b942e0a 100644 --- a/dshow/VirtualCamera/src/pin.h +++ b/dshow/VirtualCamera/src/pin.h @@ -23,7 +23,7 @@ #include #include -#include "VCamUtils/src/image/videoframetypes.h" +#include "VCamUtils/src/videoframetypes.h" #include "VCamUtils/src/ipcbridge.h" #include "streamconfig.h" diff --git a/dshow/VirtualCamera/src/videocontrol.cpp b/dshow/VirtualCamera/src/videocontrol.cpp index 0b81b5d..418a4c2 100644 --- a/dshow/VirtualCamera/src/videocontrol.cpp +++ b/dshow/VirtualCamera/src/videocontrol.cpp @@ -29,7 +29,7 @@ #include "referenceclock.h" #include "PlatformUtils/src/utils.h" #include "VCamUtils/src/utils.h" -#include "VCamUtils/src/image/videoformat.h" +#include "VCamUtils/src/videoformat.h" namespace AkVCam { diff --git a/dshow/dshow.cmake b/dshow/dshow.cmake new file mode 100644 index 0000000..e9b4722 --- /dev/null +++ b/dshow/dshow.cmake @@ -0,0 +1,35 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera 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 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera 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 akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +include("${CMAKE_CURRENT_LIST_DIR}/../commons.cmake") + +set(DSHOW_PLUGIN_NAME AkVirtualCamera) +set(DSHOW_PLUGIN_ASSISTANT_NAME AkVCamAssistant) +set(DSHOW_PLUGIN_ASSISTANT_DESCRIPTION "Webcamoid virtual camera service") +set(DSHOW_PLUGIN_DESCRIPTION "Webcamoid Virtual Camera") +set(DSHOW_PLUGIN_DESCRIPTION_EXT "Central service for communicating between virtual cameras and clients") +set(DSHOW_PLUGIN_DEVICE_PREFIX AkVCamVideoDevice) +set(DSHOW_PLUGIN_VENDOR "Webcamoid Project") + +add_definitions(-DDSHOW_PLUGIN_NAME="\\"${DSHOW_PLUGIN_NAME}\\"" + -DDSHOW_PLUGIN_ASSISTANT_NAME="\\"${DSHOW_PLUGIN_ASSISTANT_NAME}\\"" + -DDSHOW_PLUGIN_ASSISTANT_DESCRIPTION="\\"${DSHOW_PLUGIN_ASSISTANT_DESCRIPTION}\\"" + -DDSHOW_PLUGIN_DESCRIPTION="\\"${DSHOW_PLUGIN_DESCRIPTION}\\"" + -DDSHOW_PLUGIN_DESCRIPTION_EXT="\\"${DSHOW_PLUGIN_DESCRIPTION_EXT}\\"" + -DDSHOW_PLUGIN_DEVICE_PREFIX="\\"${DSHOW_PLUGIN_DEVICE_PREFIX}\\"" + -DDSHOW_PLUGIN_VENDOR="\\"${DSHOW_PLUGIN_VENDOR}\\"") diff --git a/dshow/dshow.pri b/dshow/dshow.pri deleted file mode 100644 index 870580e..0000000 --- a/dshow/dshow.pri +++ /dev/null @@ -1,51 +0,0 @@ -# akvirtualcamera, virtual camera for Mac and Windows. -# Copyright (C) 2020 Gonzalo Exequiel Pedone -# -# akvirtualcamera 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 3 of the License, or -# (at your option) any later version. -# -# akvirtualcamera 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 akvirtualcamera. If not, see . -# -# Web-Site: http://webcamoid.github.io/ - -isEmpty(DSHOW_PLUGIN_NAME): - DSHOW_PLUGIN_NAME = AkVirtualCamera -isEmpty(DSHOW_PLUGIN_ASSISTANT_NAME): - DSHOW_PLUGIN_ASSISTANT_NAME = AkVCamAssistant -isEmpty(DSHOW_PLUGIN_ASSISTANT_DESCRIPTION): - DSHOW_PLUGIN_ASSISTANT_DESCRIPTION = "Webcamoid virtual camera service" -isEmpty(DSHOW_PLUGIN_DESCRIPTION): - DSHOW_PLUGIN_DESCRIPTION = "Webcamoid Virtual Camera" -isEmpty(DSHOW_PLUGIN_DESCRIPTION_EXT): - DSHOW_PLUGIN_DESCRIPTION_EXT = "Central service for communicating between virtual cameras and clients" -isEmpty(DSHOW_PLUGIN_DEVICE_PREFIX): - DSHOW_PLUGIN_DEVICE_PREFIX = AkVCamVideoDevice -isEmpty(DSHOW_PLUGIN_VENDOR): - DSHOW_PLUGIN_VENDOR = "Webcamoid Project" - -DEFINES += \ - DSHOW_PLUGIN_NAME=\"\\\"$$DSHOW_PLUGIN_NAME\\\"\" \ - DSHOW_PLUGIN_ASSISTANT_NAME=\"\\\"$$DSHOW_PLUGIN_ASSISTANT_NAME\\\"\" \ - DSHOW_PLUGIN_ASSISTANT_DESCRIPTION=\"\\\"$$DSHOW_PLUGIN_ASSISTANT_DESCRIPTION\\\"\" \ - DSHOW_PLUGIN_DESCRIPTION=\"\\\"$$DSHOW_PLUGIN_DESCRIPTION\\\"\" \ - DSHOW_PLUGIN_DESCRIPTION_EXT=\"\\\"$$DSHOW_PLUGIN_DESCRIPTION_EXT\\\"\" \ - DSHOW_PLUGIN_DEVICE_PREFIX=\"\\\"$$DSHOW_PLUGIN_DEVICE_PREFIX\\\"\" \ - DSHOW_PLUGIN_VENDOR=\"\\\"$$DSHOW_PLUGIN_VENDOR\\\"\" - -defineReplace(normalizedArch) { - arch = $$replace($$1, i386, x86) - arch = $$replace(arch, i486, x86) - arch = $$replace(arch, i586, x86) - arch = $$replace(arch, i686, x86) - arch = $$replace(arch, x86_64, x64) - - return($$arch) -}