-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create async-source-duplication filter and source
- Loading branch information
0 parents
commit a0df66f
Showing
29 changed files
with
1,864 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# please use clang-format version 8 or later | ||
|
||
Standard: Cpp11 | ||
AccessModifierOffset: -8 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: false | ||
AlignConsecutiveDeclarations: false | ||
AlignEscapedNewlines: Left | ||
AlignOperands: true | ||
AlignTrailingComments: true | ||
#AllowAllArgumentsOnNextLine: false # requires clang-format 9 | ||
#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9 | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: false | ||
#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9 | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
AlwaysBreakTemplateDeclarations: false | ||
BinPackArguments: true | ||
BinPackParameters: true | ||
BraceWrapping: | ||
AfterClass: false | ||
AfterControlStatement: false | ||
AfterEnum: false | ||
AfterFunction: true | ||
AfterNamespace: false | ||
AfterObjCDeclaration: false | ||
AfterStruct: true | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeBraces: Custom | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeColon | ||
BreakStringLiterals: false # apparently unpredictable | ||
ColumnLimit: 120 | ||
CompactNamespaces: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ConstructorInitializerIndentWidth: 8 | ||
ContinuationIndentWidth: 8 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
FixNamespaceComments: false | ||
ForEachMacros: | ||
- 'json_object_foreach' | ||
- 'json_object_foreach_safe' | ||
- 'json_array_foreach' | ||
IncludeBlocks: Preserve | ||
IndentCaseLabels: false | ||
IndentPPDirectives: None | ||
IndentWidth: 8 | ||
IndentWrappedFunctionNames: false | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
#ObjCBinPackProtocolList: Auto # requires clang-format 7 | ||
ObjCBlockIndentWidth: 8 | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
|
||
PenaltyBreakAssignment: 10 | ||
PenaltyBreakBeforeFirstCallParameter: 30 | ||
PenaltyBreakComment: 10 | ||
PenaltyBreakFirstLessLess: 0 | ||
PenaltyBreakString: 10 | ||
PenaltyExcessCharacter: 100 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
|
||
PointerAlignment: Right | ||
ReflowComments: false | ||
SortIncludes: false | ||
SortUsingDeclarations: false | ||
SpaceAfterCStyleCast: false | ||
#SpaceAfterLogicalNot: false # requires clang-format 9 | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeAssignmentOperators: true | ||
#SpaceBeforeCtorInitializerColon: true # requires clang-format 7 | ||
#SpaceBeforeInheritanceColon: true # requires clang-format 7 | ||
SpaceBeforeParens: ControlStatements | ||
#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7 | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
#StatementMacros: # requires clang-format 8 | ||
# - 'Q_OBJECT' | ||
TabWidth: 8 | ||
#TypenameMacros: # requires clang-format 9 | ||
# - 'DARRAY' | ||
UseTab: ForContinuationAndIndentation | ||
--- | ||
Language: ObjC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Clang Format Check | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
clang: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Clang | ||
run: | | ||
sudo apt-get install -y clang-format-12 | ||
clang-format -i -fallback-style=none $(git ls-files | grep '\.\(c\|h\)$') | ||
- name: Check | ||
# Build your program with the given configuration | ||
run: | | ||
dirty=$(git ls-files --modified) | ||
set +x | ||
if [[ $dirty ]]; then | ||
git diff | ||
echo "Error: File(s) are not properly formatted." | ||
echo "$dirty" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*~ | ||
.DS_Store | ||
/build/ | ||
/build32/ | ||
/build64/ | ||
/release/ | ||
/installer/Output/ | ||
|
||
.vscode | ||
.idea | ||
|
||
# ignore generated files | ||
*.generated.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Change obs-plugintemplate to your plugin's name in a machine-readable format | ||
# (e.g.: obs-myawesomeplugin) and set | ||
project(obs-async-source-duplication) | ||
set(CMAKE_PROJECT_VERSION 0.1.0) # TODO: update cmake to 3.12 or later and put to 'project' | ||
|
||
# Replace `Your Name Here` with the name (yours or your organization's) you want | ||
# to see as the author of the plugin (in the plugin's metadata itself and in the installers) | ||
set(PLUGIN_AUTHOR "Norihiro Kamae") | ||
|
||
# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases | ||
# (used both in the installer and when submitting the installer for notarization) | ||
set(MACOS_BUNDLEID "net.nagater.obs-async-source-duplication") | ||
set(ID_PREFIX "net.nagater.obs.") | ||
|
||
# Replace `me@contoso.com` with the maintainer email address you want to put in Linux packages | ||
set(LINUX_MAINTAINER_EMAIL "norihiro@nagater.net") | ||
|
||
# TAKE NOTE: No need to edit things past this point | ||
|
||
set(CMAKE_PREFIX_PATH "${QTDIR}") | ||
set(CMAKE_AUTOMOC OFF) | ||
set(CMAKE_AUTOUIC OFF) | ||
|
||
# In case you need C++ | ||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if (WIN32 OR APPLE) | ||
include(external/FindLibObs.cmake) | ||
endif() | ||
|
||
find_package(LibObs REQUIRED) | ||
|
||
configure_file( | ||
src/plugin-macros.h.in | ||
../src/plugin-macros.generated.h | ||
) | ||
configure_file( | ||
installer/installer-Windows.iss.in | ||
../installer/installer-Windows.generated.iss | ||
) | ||
|
||
configure_file( | ||
ci/ci_includes.sh.in | ||
../ci/ci_includes.generated.sh | ||
) | ||
configure_file( | ||
ci/ci_includes.cmd.in | ||
../ci/ci_includes.generated.cmd | ||
) | ||
|
||
set(PLUGIN_SOURCES | ||
src/plugin-main.c | ||
src/async-source-duplication-filter.c | ||
src/async-source-duplication-source.c | ||
) | ||
|
||
set(PLUGIN_HEADERS | ||
src/plugin-macros.generated.h | ||
) | ||
|
||
if(MSVC) | ||
set(PLUGIN_PLATFORM_DEPS | ||
${W32_PTHREADS_LIB}) | ||
endif() | ||
|
||
|
||
# --- Platform-independent build settings --- | ||
add_library(${CMAKE_PROJECT_NAME} MODULE ${PLUGIN_SOURCES} ${PLUGIN_HEADERS}) | ||
|
||
include_directories( | ||
${LIBOBS_INCLUDE_DIR} | ||
) | ||
|
||
target_link_libraries(${CMAKE_PROJECT_NAME} | ||
libobs | ||
${PLUGIN_PLATFORM_DEPS} | ||
) | ||
|
||
# --- End of section --- | ||
|
||
# --- Windows-specific build settings and tasks --- | ||
if(WIN32) | ||
# Enable Multicore Builds and disable FH4 (to not depend on VCRUNTIME140_1.DLL when building with VS2019) | ||
if (MSVC) | ||
add_definitions(/MP /d2FH4-) | ||
add_definitions("-D_USE_MATH_DEFINES") | ||
endif() | ||
|
||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(ARCH_NAME "64bit") | ||
set(OBS_BUILDDIR_ARCH "build64") | ||
else() | ||
set(ARCH_NAME "32bit") | ||
set(OBS_BUILDDIR_ARCH "build32") | ||
endif() | ||
|
||
include_directories( | ||
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI" | ||
) | ||
|
||
target_link_libraries(${CMAKE_PROJECT_NAME} | ||
"${OBS_FRONTEND_LIB}" | ||
) | ||
|
||
# --- Release package helper --- | ||
# The "release" folder has a structure similar OBS' one on Windows | ||
set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release") | ||
|
||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD | ||
# If config is Release or RelWithDebInfo, package release files | ||
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 ( | ||
"${CMAKE_COMMAND}" -E make_directory | ||
"${RELEASE_DIR}/data/obs-plugins/${CMAKE_PROJECT_NAME}" | ||
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}" | ||
) | ||
|
||
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 ( | ||
"${CMAKE_COMMAND}" -E copy_directory | ||
"${PROJECT_SOURCE_DIR}/data" | ||
"${RELEASE_DIR}/data/obs-plugins/${CMAKE_PROJECT_NAME}" | ||
) | ||
|
||
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 ( | ||
"${CMAKE_COMMAND}" -E copy | ||
"$<TARGET_FILE:${CMAKE_PROJECT_NAME}>" | ||
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}" | ||
) | ||
|
||
# If config is RelWithDebInfo, copy the pdb file | ||
COMMAND if $<CONFIG:RelWithDebInfo>==1 ( | ||
"${CMAKE_COMMAND}" -E copy | ||
"$<TARGET_PDB_FILE:${CMAKE_PROJECT_NAME}>" | ||
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}" | ||
) | ||
|
||
# Copy to obs-studio dev environment for immediate testing | ||
COMMAND if $<CONFIG:Debug>==1 ( | ||
"${CMAKE_COMMAND}" -E copy | ||
"$<TARGET_FILE:${CMAKE_PROJECT_NAME}>" | ||
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}" | ||
) | ||
|
||
COMMAND if $<CONFIG:Debug>==1 ( | ||
"${CMAKE_COMMAND}" -E copy | ||
"$<TARGET_PDB_FILE:${CMAKE_PROJECT_NAME}>" | ||
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}" | ||
) | ||
|
||
COMMAND if $<CONFIG:Debug>==1 ( | ||
"${CMAKE_COMMAND}" -E make_directory | ||
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/${CMAKE_PROJECT_NAME}" | ||
) | ||
|
||
COMMAND if $<CONFIG:Debug>==1 ( | ||
"${CMAKE_COMMAND}" -E copy_directory | ||
"${PROJECT_SOURCE_DIR}/data" | ||
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/${CMAKE_PROJECT_NAME}" | ||
) | ||
) | ||
# --- End of sub-section --- | ||
|
||
endif() | ||
# --- End of section --- | ||
|
||
# --- Linux-specific build settings and tasks --- | ||
if(UNIX AND NOT APPLE) | ||
include(GNUInstallDirs) | ||
|
||
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "") | ||
|
||
install(TARGETS ${CMAKE_PROJECT_NAME} | ||
LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins") | ||
|
||
install(DIRECTORY data/ | ||
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/${CMAKE_PROJECT_NAME}") | ||
endif() | ||
# --- End of section --- | ||
|
||
# -- OS X specific build settings and tasks -- | ||
if(APPLE) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default") | ||
|
||
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES PREFIX "") | ||
target_link_libraries(${CMAKE_PROJECT_NAME} "${OBS_FRONTEND_LIB}") | ||
endif() | ||
# -- End of section -- |
Oops, something went wrong.