├── .gitmodules
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
└── workflows
│ └── build.yml
├── mksrc.sh
├── nuget
├── mdk.nuspec
├── MDK.targets
└── README.md
├── ci-after-build.sh
├── mdk.podspec
├── CMakeLists.txt
├── mksdk.sh
├── upload.mk
├── README.sunxi.md
├── README.iOS.md
├── README.Android.md
├── README.rpi.md
├── README.WinRT.md
├── ci-before-build.sh
├── README.macOS.md
├── README.Windows.md
├── README.Linux.md
└── README.md
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "examples"]
2 | path = examples
3 | url = https://github.com/wang-bin/mdk-examples
4 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 | custom: ['https://www.paypal.me/ibingow']
3 | # ko_fi:
4 | # issuehunt:
5 | # liberapay:
6 |
--------------------------------------------------------------------------------
/mksrc.sh:
--------------------------------------------------------------------------------
1 |
2 | SRC_DIR=$1
3 | INSTALL_DIR=$2
4 |
5 | mkdir -p $INSTALL_DIR/src/{base,core,subtitle}
6 | cp -avf ${SRC_DIR}/core/*.cpp $INSTALL_DIR/src/core
7 | cp -avf ${SRC_DIR}/core/*.h $INSTALL_DIR/src/core
8 | cp -avf ${SRC_DIR}/base/*.h* $INSTALL_DIR/src/base
9 | cp -af ${SRC_DIR}/base/cppcompat $INSTALL_DIR/src/base
10 | cp -avf ${SRC_DIR}/subtitle/SubtitleImageProducer.h $INSTALL_DIR/src/subtitle
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 |
16 | **Expected behavior**
17 | A clear and concise description of what you expected to happen.
18 |
19 | **Environment:**
20 | - OS:
21 | - GPU: optional
22 |
23 | **Log**
24 | Add any other context about the problem here.
25 | ```cpp
26 | setLogHandler([&log_file](LogLevel level, const char* msg){
27 | //write_msg_to_a_file(msg); // it's better to add system time. example: https://github.com/wang-bin/mdk-examples/blob/master/GLFW/prettylog.h
28 | });
29 | ```
30 |
31 | **Crash**
32 | use lldb, gdb, visual studio to show the call stack.
--------------------------------------------------------------------------------
/nuget/mdk.nuspec:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | mdk
5 | 0.35.0.0
6 | MDK
7 | Wang Bin
8 | Wang Bin
9 | false
10 | MIT
11 |
12 | https://github.com/wang-bin/mdk-sdk
13 |
14 | C/C++ Multimedia Development Kit
15 | Cross platform multimedia development kit in C/C++
16 | https://github.com/wang-bin/mdk-sdk/releases
17 | Copyright 2025
18 | Multimedia MediaPlayer VideoPlayer Video Player Playback HDR DolbyVision FFmpeg CrossPlatform UWP WOA WinUI3 OpenGL Vulkan D3D11 D3D12 BRAW Hap R3D DCP HEVC-Alpha
19 | README.md
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ci-after-build.sh:
--------------------------------------------------------------------------------
1 | ls -lh build/${TARGET_OS}*
2 | if [ -f build/${TARGET_OS}/libmdk.so ]; then
3 | readelf -d build/${TARGET_OS}/libmdk.so
4 | fi
5 | if [ -f build/${TARGET_OS}/cmake_install.cmake ]; then
6 | cmake -P build/${TARGET_OS}/cmake_install.cmake
7 | tools/mksdk.sh mdk-sdk || echo done
8 | fi
9 | if [ -f mdk-sdk/lib/mdk.framework/mdk ]; then
10 | otool -l mdk-sdk/lib/mdk.framework/mdk
11 | otool -L mdk-sdk/lib/mdk.framework/mdk
12 | echo codesign
13 | codesign --force --sign - --deep --timestamp mdk-sdk/lib/mdk.framework
14 | fi
15 | for s in build/${TARGET_OS}-*; do
16 | echo "sdk: $s"
17 | a=${s/*${TARGET_OS}-/}
18 | echo "arch: $a"
19 | if [ -f build/${TARGET_OS}-$a/cmake_install.cmake ]; then
20 | cmake -P build/${TARGET_OS}-$a/cmake_install.cmake
21 | tools/mksdk.sh mdk-sdk-$a $a || echo done # FIXME: android arch
22 | fi
23 | done
24 | find mdk-sdk* -name "*.a" -delete
25 |
26 | echo stripping
27 | export PATH=$PATH:$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin:$OHOS_NDK/llvm/bin
28 | : ${STRIP:=llvm-strip-$LLVM_VER}
29 | which $STRIP || STRIP=llvm-strip
30 | [ "$TARGET_OS" == "macOS" ] && STRIP=strip && STRIP_ARGS="-u -r"
31 | ls -lh mdk-sdk*/bin/*
32 | which $STRIP && find mdk-sdk*/bin -type f -exec $STRIP $STRIP_ARGS {} \;
33 | ls -lh mdk-sdk*/bin/*
34 | export XZ_OPT="-T0" # -9e. -8/9 will disable mt?
35 | if [[ "$TARGET_OS" == "win"* || "$TARGET_OS" == "uwp"* || "$TARGET_OS" == "android" || "$TARGET_OS" == ohos ]]; then
36 | 7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off mdk-sdk-${TARGET_OS}.7z mdk-sdk
37 | ls -lh mdk-sdk-${TARGET_OS}.7z
38 | else
39 | TAR=tar
40 | # brew install gnu-tar. gtar result is 1/3 much smaller, but 1/2 slower, also no hidden files(GNUSparseFile.0). T0 is 2x faster than bsdtar
41 | which gtar && TAR=gtar
42 | $TAR Jcvf mdk-sdk-${TARGET_OS}.tar.xz mdk-sdk
43 | ls -lh mdk-sdk-${TARGET_OS}.tar.xz
44 | fi
45 | #if [ `which sshpass` ]; then
46 | #echo sshpass -p "$SF_PW" scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz $SF_USER@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
47 | #sshpass -e scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz $SF_USER@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
48 | #sshpass -e scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz $SF_USER@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
49 | #echo $?
50 | #fi
--------------------------------------------------------------------------------
/mdk.podspec:
--------------------------------------------------------------------------------
1 | Pod::Spec.new do |s|
2 | s.name = 'mdk'
3 | s.version = '0.35.0'
4 | s.summary = 'Multimedia Development Kit'
5 | s.homepage = 'https://github.com/wang-bin/mdk-sdk'
6 |
7 | s.author = { 'Wang Bin' => 'wbsecg1@gmail.com' }
8 | s.license = { :type => 'Commercial', :text => <<-LICENSE
9 | Copyright 2020-2025 WangBin
10 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 | 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 AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 | LICENSE
14 | }
15 |
16 | s.platform = :osx, :ios, :tvos, :visionos
17 | s.source = { :http => 'https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-apple.tar.xz' }
18 | s.vendored_frameworks = 'mdk-sdk/lib/mdk.xcframework'
19 | # s.osx.vendored_libraries = 'mdk-sdk/lib/mdk.xcframework/macos-arm64_x86_64/mdk.framework/Versions/A/libffmpeg.7.dylib', 'mdk-sdk/lib/mdk.xcframework/macos-arm64_x86_64/mdk.framework/Versions/A/libass.dylib', 'mdk-sdk/lib/mdk.xcframework/macos-arm64_x86_64/mdk.framework/Versions/A/libmdk-braw.dylib', 'mdk-sdk/lib/mdk.xcframework/macos-arm64_x86_64/mdk.framework/Versions/A/libmdk-r3d.dylib'
20 | s.osx.deployment_target = '10.13'
21 | s.ios.deployment_target = '12.0'
22 | s.tvos.deployment_target = '12.0'
23 | s.visionos.deployment_target = '1.0'
24 | s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=*simulator*]' => 'i386'}
25 | s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=*simulator*]' => 'i386'}
26 | s.visionos.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=*simulator*]' => 'x86_64'} # optional?
27 | s.visionos.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=*simulator*]' => 'x86_64'}
28 | # s.user_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => '' }
29 | # s.pod_target_xcconfig = { 'VALID_ARCHS[sdk=iphonesimulator*]' => '' } # VALID_ARCHS is removed in xcode12.0
30 | #s.pod_target_xcconfig = { 'ARCHS[sdk=iphonesimulator*]' => '$(ARCHS_STANDARD_64_BIT)' }
31 | end
32 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.16) # precompile headers
2 | if(NOT DEFINED PROJECT_NAME)
3 | set(PROJECT_NAME mdk)
4 | else()
5 | add_definitions(-DMDK_NS=${PROJECT_NAME})
6 | endif()
7 | if(POLICY CMP0091) # CMAKE_MSVC_RUNTIME_LIBRARY. since 3.15
8 | cmake_policy(SET CMP0091 NEW)
9 | endif()
10 |
11 | project(${PROJECT_NAME} VERSION 0.20.0 DESCRIPTION "Multimedia Dev Kit ${GIT_COMMIT}"
12 | #LANGUAGES C CXX OBJC OBJCXX
13 | )
14 | set(PROJECT_VERSION_TWEAK 0)
15 | set(TARGET_NAME ${PROJECT_NAME})
16 | # https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/ (global and specified target)
17 | set(CMAKE_CXX_STANDARD 20)
18 | set(CMAKE_CXX_STANDARD_REQUIRED ON)
19 | #set(ENV{PKG_CONFIG_SYSROOT_DIR} "=")
20 | #set(CMAKE_CXX_EXTENSIONS OFF)
21 | message("CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR}, CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}, CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}")
22 | message("CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}. CMAKE_CROSSCOMPILING: ${CMAKE_CROSSCOMPILING}. LINUX: ${LINUX}")
23 | message("CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
24 | message("CMAKE: ${CMAKE_VERSION}")
25 |
26 |
27 | include(CheckLibraryExists)
28 |
29 | set(SO_NAME ${TARGET_NAME})
30 |
31 | if(MSVC)
32 | add_definitions(-D_CRT_SECURE_NO_WARNINGS -DNOMINMAX)
33 | endif()
34 |
35 | include_directories(
36 | include
37 | src/
38 | src/base/cppcompat/include
39 | )
40 |
41 | file(GLOB SRC "src/core/*.cpp")
42 | add_library(${TARGET_NAME} SHARED
43 | ${SRC}
44 | )
45 | target_compile_definitions(${TARGET_NAME} PRIVATE -DBUILD_MDK_LIB)
46 | target_link_directories(${TARGET_NAME} PRIVATE lib)
47 | # vpl, snappy: download from artifacts of https://github.com/wang-bin/devpkgs/actions or https://sourceforge.net/projects/mdk-sdk/files/deps/dep.7z/download
48 | target_link_libraries(${TARGET_NAME} PRIVATE mdkObj avglue ugl ugs glva-static vpl snappy)
49 | set_target_properties(${TARGET_NAME} PROPERTIES
50 | MACOSX_RPATH ON
51 | FRAMEWORK ON
52 | MACOSX_FRAMEWORK_IDENTIFIER com.mediadevkit.${TARGET_NAME}
53 | MACOSX_FRAMEWORK_BUNDLE_VERSION ${PROJECT_VERSION}
54 | MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
55 | #MACOSX_FRAMEWORK_INFO_PLIST
56 | #XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY
57 | FRAMEWORK_VERSION A # codesign assumes framework version is A
58 | VERSION ${PROJECT_VERSION}
59 | SOVERSION ${PROJECT_VERSION_MAJOR}
60 | OUTPUT_NAME ${SO_NAME}
61 | CLEAN_DIRECT_OUTPUT 1
62 | )
63 |
64 | CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_LIBDL)
65 | if(HAVE_LIBDL)
66 | target_link_libraries(${TARGET_NAME} PRIVATE dl)
67 | endif()
68 | # only static libs are enough for reloc obj targets, otherwise static + shared
69 | target_link_libraries(${TARGET_NAME} PRIVATE ${EXTRA_LIBS})
70 | if(POLICY CMP0072)
71 | cmake_policy(SET CMP0072 NEW)
72 | endif()
73 | set(OpenGL_GL_PREFERENCE GLVND)
74 | include(FindOpenGL)
75 | if(OPENGL_FOUND)
76 | list(APPEND EXTRA_DYLIBS OpenGL::GL)
77 | target_link_libraries(${TARGET_NAME} PRIVATE OpenGL::GL)
78 | endif()
79 | find_package(Threads)
80 | target_link_libraries(${TARGET_NAME} PRIVATE Threads::Threads) # link_libraries() affect targets ONLY add later
81 |
82 | if(WIN32)
83 | target_link_libraries(${TARGET_NAME} PRIVATE
84 | mfplat mfuuid version wmcodecdspuuid
85 | xaudio2 dsound ole32 d3d11 user32 Mf gdi32
86 | advapi32
87 | )
88 | endif()
89 |
--------------------------------------------------------------------------------
/nuget/MDK.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UAP
5 | $(MSBuildThisFileDirectory)..\..\bin\$(mdk-DeviceType)\$(PlatformTarget)\
6 | $(MSBuildThisFileDirectory)..\..\lib\$(PlatformTarget)\
7 | $(MSBuildThisFileDirectory)..\..\include\
8 |
9 |
10 |
11 |
12 | $(mdk-LibPath);%(AdditionalLibraryDirectories)
13 | mdk.lib;%(AdditionalDependencies)
14 |
15 |
16 |
17 |
18 |
19 | $(mdk-IncPath);%(AdditionalIncludeDirectories)
20 |
21 |
22 |
23 |
24 |
25 | MdkBinaries
26 | $(ProjectName)
27 | %(Filename)%(Extension)
28 | True
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/mksdk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | SDK_DIR=$1
3 | ARCH=$2
4 | SDK_DIR_OUT=$SDK_DIR
5 | [ -n "$ARCH" ] && SDK_DIR_OUT=mdk-sdk
6 | mkdir -p $SDK_DIR_OUT
7 |
8 | mkdir -p $SDK_DIR/include # for apple
9 | SDK_INCLUDE=$SDK_DIR/include/mdk
10 | TMP=`mktemp -d`
11 | # TODO: cmake files for different arch
12 | #find $SDK_DIR/lib -name "*.dylib" -a ! -name "libmdk*.dylib" -exec strip -u -r {} \;
13 | tar cf $TMP/cmake.tar $SDK_DIR/lib/cmake/FindMDK.cmake
14 | if [ -d $SDK_DIR/lib/mdk.framework ]; then
15 | tar cf $TMP/h.tar $SDK_DIR/lib/mdk.framework
16 | rm -rf $SDK_DIR/lib/*
17 | tar xf $TMP/h.tar
18 | ln -sf lib $SDK_DIR/Frameworks
19 | [ -d $SDK_INCLUDE ] && rm -rf $SDK_INCLUDE
20 | [ -L $SDK_INCLUDE ] && rm -f $SDK_INCLUDE
21 | ln -sfv ../lib/mdk.framework/Headers $SDK_INCLUDE #gln -rsfv $SDK_DIR/lib/mdk.framework/Headers $SDK_INCLUDE
22 | mv -v $SDK_DIR/lib/mdk.framework/Versions/Current/mdk.dSYM $SDK_DIR/lib/mdk.framework.dSYM
23 | mv -v $SDK_DIR/lib/mdk.framework/mdk.dSYM $SDK_DIR/lib/mdk.framework.dSYM # iOS
24 | ffdso=(`find $SDK_DIR/lib/mdk.framework -name "libffmpeg.*.dylib"`)
25 | ffdso=${ffdso[$((${#ffdso[@]}-1))]}
26 | ffdso=${ffdso##*lib/}
27 | [ -n "$ffdso" ] && ln -sf $ffdso $SDK_DIR/lib/
28 | assdso=(`find $SDK_DIR/lib/mdk.framework -name "libass.*.dylib"`)
29 | assdso=${assdso[$((${#assdso[@]}-1))]}
30 | assdso=${assdso##*lib/}
31 | [ -n "$assdso" ] && ln -sf $assdso $SDK_DIR/lib/
32 | else
33 | tar cf $TMP/h.tar $SDK_DIR/include/mdk
34 | rm -rf $SDK_DIR/include/*
35 | tar xf $TMP/h.tar
36 | if [ -L "$SDK_DIR/lib/libmdk.so" ]; then # on macOS, a symlink is not a regular file, on linux it is
37 | cp -afv $SDK_DIR/lib/libmdk.so $TMP/
38 | cp -afvL $SDK_DIR/lib/libmdk-*.so $TMP/
39 | cp -afvL $SDK_DIR/lib/libmdk*.dsym $TMP/
40 | cp -afvL $SDK_DIR/lib/lib{ass,ffmpeg,mdk}.so.? $TMP/
41 | cp -afvL $SDK_DIR/lib/libc++.so.1 $TMP/
42 | elif [ -f "$SDK_DIR/lib/libmdk.so" ]; then # android, ohos
43 | cp -afvL $SDK_DIR/lib/lib{ass,ffmpeg,mdk-*}.so $TMP/
44 | cp -afvL $SDK_DIR/lib/libmdk.so $TMP/
45 | cp -afvL $SDK_DIR/lib/libmdk.so.dsym $TMP/
46 | elif [ -f "$SDK_DIR/lib/mdk.lib" ]; then
47 | cp -afvL $SDK_DIR/lib/mdk.lib $TMP/
48 | cp -afvL $SDK_DIR/bin/{ffmpeg,mdk}*.dll $TMP/
49 | cp -afvL $SDK_DIR/bin/libass*.dll $TMP/
50 | cp -afvL $SDK_DIR/bin/mdk*.pdb $TMP/
51 | elif [ -f "$SDK_DIR/lib/libmdk.dll.a" ]; then
52 | cp -afvL $SDK_DIR/lib/libmdk.dll.a $TMP/
53 | cp -afvL $SDK_DIR/bin/lib{ass,ffmpeg,mdk}*.dll $TMP/
54 | fi
55 | rm -rfv $SDK_DIR/lib/* $SDK_DIR/bin/*.{dll,pdb} # clean up unneeded files
56 |
57 | mkdir -p $SDK_DIR_OUT/bin/$ARCH
58 | mv $TMP/*mdk*.{dll,pdb} $TMP/*ffmpeg-?.dll $TMP/libass*.dll $SDK_DIR_OUT/bin/$ARCH
59 |
60 | mkdir -p $SDK_DIR_OUT/lib/$ARCH
61 | mv -v $TMP/libmdk* $TMP/mdk.lib $TMP/libffmpeg.so* $TMP/libass.so $TMP/libc++.so.1 $SDK_DIR_OUT/lib/$ARCH
62 | fi
63 | tar xf $TMP/cmake.tar
64 |
65 | if [ -d "$SDK_INCLUDE/cpp" ]; then
66 | rm -rf $SDK_INCLUDE/*.h
67 | hs=(`find "$SDK_INCLUDE/cpp" -name "*.h"`)
68 | for h in ${hs[@]}; do
69 | echo $h
70 | sed '/#include /s/\.\.\/c\//c\//g' $h > $SDK_INCLUDE/${h##*/}
71 | done
72 | rm -rf "$SDK_INCLUDE/cpp"
73 | fi
74 |
75 | [ -n "$ARCH" ] && {
76 | cp -anvf $SDK_DIR/include $SDK_DIR_OUT
77 | cp -anvf $SDK_DIR/build $SDK_DIR_OUT # for win
78 | cp -anvf $SDK_DIR/doc $SDK_DIR_OUT
79 | cp -nvf $SDK_DIR/* $SDK_DIR_OUT
80 | mkdir -p $SDK_DIR_OUT/lib/cmake/
81 | cp -anvf $SDK_DIR/lib/cmake/FindMDK.cmake $SDK_DIR_OUT/lib/cmake/
82 | BIN_DIR_OUT=$SDK_DIR_OUT/bin/$ARCH
83 | mkdir -p $BIN_DIR_OUT
84 | cp -nvf $SDK_DIR/bin/* $BIN_DIR_OUT
85 | }
86 | rm -rf $TMP
--------------------------------------------------------------------------------
/upload.mk:
--------------------------------------------------------------------------------
1 | all: apple_txz apple_zip mac_txz ios_txz tvos_txz visionos_txz upload_win_ltl upload_win upload_win64 upload_uwp upload_nupkg
2 |
3 | apple_txz:
4 | [ -f mdk-sdk-apple.tar.xz ] && sshpass -p $$SF_PW scp -o StrictHostKeyChecking=no mdk-sdk-apple.tar.xz $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-apple.tar.xz
5 | mac_txz:
6 | [ -f mdk-sdk-macOS.tar.xz ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-macOS.tar.xz $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-macOS.tar.xz
7 | apple_zip:
8 | [ -f mdk-sdk-apple.zip ] && sshpass -p $$SF_PW scp -o StrictHostKeyChecking=no mdk-sdk-apple.zip $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-apple.zip
9 | ios_txz:
10 | [ -f mdk-sdk-iOS.tar.xz ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-iOS.tar.xz $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-iOS.tar.xz
11 | tvos_txz:
12 | [ -f mdk-sdk-tvOS.tar.xz ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-tvOS.tar.xz $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-tvOS.tar.xz
13 | visionos_txz:
14 | [ -f mdk-sdk-visionOS.tar.xz ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-visionOS.tar.xz $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-visionOS.tar.xz
15 | upload_win_ltl:
16 | [ -f mdk-sdk-windows-desktop-vs2022-ltl.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022-ltl.7z $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/mdk-sdk-windows-ltl.7z || echo no mdk-sdk-windows-desktop-vs2022-ltl.7z
17 | [ -f mdk-sdk-windows-desktop-vs2022-ltl.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022-ltl.7z $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-windows-desktop-vs2022-ltl.7z
18 | upload_win:
19 | [ -f mdk-sdk-windows-desktop-vs2022.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022.7z $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/mdk-sdk-windows.7z || echo no mdk-sdk-windows-desktop-vs2022.7z
20 | [ -f mdk-sdk-windows-desktop-vs2022.7z.md5 ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022.7z.md5 $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/mdk-sdk-windows.7z.md5 || echo no mdk-sdk-windows-desktop-vs2022.7z.md5
21 | [ -f mdk-sdk-windows-desktop-vs2022.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022.7z* $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-windows-desktop-vs2022.7z
22 | upload_win64:
23 | [ -f mdk-sdk-windows-desktop-vs2022-x64.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022-x64.7z $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/mdk-sdk-windows-x64.7z || echo no mdk-sdk-windows-desktop-vs2022-x64.7z
24 | [ -f mdk-sdk-windows-desktop-vs2022-x64.7z.md5 ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022-x64.7z.md5 $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/mdk-sdk-windows-x64.7z.md5 || echo no mdk-sdk-windows-desktop-vs2022-x64.7z.md5
25 | [ -f mdk-sdk-windows-desktop-vs2022-x64.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-windows-desktop-vs2022-x64.7z* $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-windows-desktop-vs2022-x64.7z
26 | upload_uwp:
27 | [ -f mdk-sdk-uwp.7z ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-uwp.7z $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-sdk-uwp.7z
28 | upload_nupkg:
29 | [ -f mdk-vs2022.nupkg ] && sshpass -p $${SF_PW} scp -o StrictHostKeyChecking=no mdk-vs2022.nupkg $${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/ || echo no mdk-vs2022.nupkg
30 |
31 | .PHONY: all
32 |
--------------------------------------------------------------------------------
/README.sunxi.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows, UWP, Linux, macOS, Android, iOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display, HDR to SDR and SDR to HDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
16 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
17 | - [Smart FFmpeg runtime, dynamic load, compatible with 4.0~7.0 abi](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
18 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#braw), [R3D](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#r3d)
19 |
20 | ## About SDK for SUNXI
21 |
22 | mdk sdk for linux sunxi, with allwinner cedarv and vdpau decoder support
23 |
24 | SDK is cross built by clang 15.0 with
25 | - cmake toolchain file https://github.com/wang-bin/cmake-tools/blob/master/sunxi.clang.cmake
26 | - sysroot: https://sourceforge.net/projects/avbuild/files/sunxi/sunxi-sysroot.tar.xz/download
27 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/sunxi/ffmpeg-master-sunxi-clang-lite.tar.xz/download
28 | - libc++ 16.0
29 |
30 | SDK can be used by any C or C++11 compiler, e.g. g++, clang
31 |
32 | ### Runtime Requirements
33 | - https://linux-sunxi.org/CedarX
34 | - https://linux-sunxi.org/Cedrus/libvdpau-sunxi
35 |
36 | tested device info
37 | - pcdiuno, allwinner a10, sun4i, Linaro 12.11, Linux ubuntu 3.4.29+ #1 PREEMPT Tue Nov 26 15:20:06 CST 2013 armv7l armv7l armv7l GNU/Linux
38 |
39 | ### Examples
40 | - [Best performance] cedarv decoder via libvecore, texture uploading is accelerated by UMP:
41 |
42 | `./bin/mdkplay -c:v CedarX video_file`
43 |
44 | 1080p@24fps 7637kb/s h264 decoding + rendering ~28% cpu
45 |
46 | - cedarv decoder via libvecore, no UMP accelerated: `GLVA_HOST=1 ./bin/mdkplay -c:v CedarX video_file`
47 |
48 | 1080p@24fps 7637kb/s h264 decoding + rendering ~96% cpu
49 |
50 | - vdpau decoder copy mode: `GLVA_HOST=1 ./bin/mdkplay -c:v VDPAU video_file`
51 |
52 | 1080p@24fps 7637kb/s h264 decoding + rendering ~97% cpu
53 |
54 | - vdpau decoder zero copy mode via nv interop extension(not tested, I have no working vdpau driver): `./bin/mdkplay -c:v VDPAU video_file`
55 |
56 | - test decoder speed:
57 |
58 | ```
59 | ./bin/framereader -c:v CedarX video_file # 1080p h264 ~84fps
60 | ./bin/framereader -c:v FFmpeg video_file # 1080p h264 ~12fps
61 | ```
62 |
63 | if default audio device does not sound correctly, try to change the device name via environment var `ALSA_DEVICE`, e.g.
64 |
65 | `export ALSA_DEVICE="hw:0,0"`
66 |
67 | ### Use in CMake Projects
68 | ```
69 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
70 | target_link_libraries(your_target PRIVATE mdk)
71 | ```
72 |
73 | ## Source code:
74 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
75 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
76 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
77 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
78 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
79 |
80 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
81 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.iOS.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
16 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
17 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
18 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
19 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
20 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
21 |
22 |
23 | ## Swift
24 | https://github.com/wang-bin/swift-mdk
25 |
26 | ## About SDK for iOS
27 | SDK is built by Xcode 16 with
28 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/iOS/ffmpeg-master-iOS-lite-lto.tar.xz/download
29 | - Minimal system: iOS 8.0
30 | - Support Metal renderer
31 |
32 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
33 | - Metal: recommended
34 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
35 |
36 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
37 | - VT: videotoolbox hardware decoder. h264, hevc support. propertyes: threads, realTime, async, format, hardware, width, height. e.g. `player.setVideoDecoders({"VT:format=nv12:async=1", "FFmpeg"})`
38 | - VideoToolbox: via ffmpeg
39 | - FFmpeg. Direct rendering via property "pool=CVPixelBuffer"
40 |
41 | ### Use in CMake Projects
42 | ```
43 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
44 | target_link_libraries(your_target PRIVATE mdk)
45 | ```
46 |
47 | ### Qt qmake project
48 | ```qmake
49 | include($$MDK_SDK_DIR/mdk.pri)
50 | ```
51 |
52 |
53 | ### Recommended settings
54 |
55 | - macOS, iOS: `player.setDecoders(MediaType::Video, {"VT", "hap", "FFmpeg", "dav1d"});`
56 |
57 | ### Use in Xcode
58 | Choose any of
59 | - Add mdk.xcframework to your project(Embed & Sign)
60 | - install via cocoapods `pod 'mdk'`
61 |
62 | #### Code Sign
63 | Choose any of
64 | - In `Build Settings` add `--deep` to `Other Code Signing Flags`
65 | - (Recommended) In `Build Phase`, add a `New Run Script Phase` with content `[ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -name "libffmpeg*.dylib" -exec codesign -i mdk.framework.ffmpeg -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;`
66 |
67 |
68 | ## Source code:
69 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
70 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
71 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
72 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
73 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
74 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
75 |
76 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
77 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.Android.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
16 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
17 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
18 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
19 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
20 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
21 |
22 |
23 | ## About SDK for Android
24 | SDK is built with
25 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/android/ffmpeg-master-android-clang-lite-lto.tar.xz/download
26 | - ndk 28
27 | - requires ndk r23 and later because of ndk abi break in r23
28 |
29 | SDK can be used by any C or C++11 compiler, e.g. g++, clang
30 |
31 | dsym files are debug symbols, not required to deploy your programe.
32 |
33 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
34 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
35 | - Vulkan
36 |
37 | ### OpenGL Context
38 | - Create by mdk: use SurfaceView's Surface to initialize rendering thread
39 | - Created by user: use GLSurfaceView, TextureView or whatever
40 |
41 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
42 | - FFmpeg
43 | - MediaCodec: FFmpeg mediacodec implementation
44 | - AMediaCodec: builtin mediacodec implementation, using libmediandk or java api
45 |
46 | MediaCodec/AMediaCodec decoder will not be destroyed if app go to background, and continues to work when resumed.
47 |
48 | ### Audio Renderers
49 | - OpenSLES
50 | - AudioTrack (default)
51 |
52 | ### Data Source
53 | - `content:`
54 | - `android.resource:`
55 | - `assets:`
56 |
57 | ### Use in CMake Projects
58 | ```
59 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
60 | target_link_libraries(your_target PRIVATE mdk)
61 | ```
62 |
63 | ### Qt qmake project
64 | ```qmake
65 | include($$MDK_SDK_DIR/mdk.pri)
66 | ```
67 |
68 |
69 | ### Recommended settings
70 | ```cpp
71 | SetGlobalOption("JavaVM", JvmPtr); // REQUIRED
72 | player.setDecoders(MediaType::Video, {"AMediaCodec", "FFmpeg", "dav1d"});
73 | ```
74 |
75 | ## Source code:
76 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
77 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
78 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
79 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
80 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
81 | - [Android java wrapper and example](https://github.com/wang-bin/mdk-android)
82 | - [libmediandk and other java classes implemented in C++](https://github.com/wang-bin/AND)
83 | - [JNI Modern Interface](https://github.com/wang-bin/JMI)
84 |
85 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
86 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.rpi.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 |
3 | **Use generic linux sdk package for raspberry pi3/4 with modern RaspberryPi OS**
4 |
5 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
6 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 |
8 | ### Features
9 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
10 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
11 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
12 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
13 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
14 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
15 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
16 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
17 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
18 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
19 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
20 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
21 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
22 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
23 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
24 |
25 |
26 | ## About SDK for Legacy Raspberry Pi
27 | SDK is cross built by clang 19 with
28 | - cmake toolchain file https://github.com/wang-bin/cmake-tools/blob/master/raspberry-pi.clang.cmake
29 | - sysroot: https://sourceforge.net/projects/avbuild/files/raspberry-pi/raspberry-pi-sysroot.tar.xz/download
30 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/raspberry-pi/ffmpeg-master-raspberry-pi-clang-lite.tar.xz/download
31 | - libc++ 17
32 |
33 | SDK can be used by any C or C++11 compiler, e.g. g++, clang
34 |
35 | pi 4: ALSA_DEVICE=sysdefault
36 |
37 | clang >= 9 result dso can not be loaded on rpi1, maybe there is a bug in lld
38 |
39 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#linux-desktop-raspberry-pi-64bit)
40 | - gapless playback hardware decoders may requires 256M GPU memory
41 |
42 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
43 | - OpenGL
44 | - OpenGL ES2/3
45 |
46 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
47 | - mmal: builtin mmal decoder implementation
48 | - MMAL: FFmpeg mmal decoder implementation
49 | - V4L2: or "FFmpeg:hwaccel=v4l2m2m"
50 |
51 | ### Examples
52 | In legacy driver environment, hardware decoder (MMAL, mmal) supports zero copy rendering in GLES2 and has the best performance
53 | - legacy driver gles2: ./window -c:v MMAL test.mp4
54 |
55 |
56 | In mesa vc4/6 driver environment(fake/full kms), hardware decoder is available, but zero copy rendering is not
57 | - vc4/6 egl+es2: LD_PRELOAD=libX11.so.6 ./window -c:v MMAL test.mp4 # if not link against libX11(except weak) or libpulse
58 | - vc4/6 glx: GL_ES=0 LD_PRELOAD=libGL.so.1 ./window -c:v MMAL test.mp4 # if not link against libGL or libOpenGL
59 | - vc4/6 wayland: ./window -c:v MMAL test.mp4 # assume weston is running in x11 or CLI mode via weston-launch
60 | - vc4/6 gbm: ./window -surface gbm -c:v MMAL test.mp4 # assume weston is running # in CLI mode
61 |
62 | Tested on rpi1 and rpi3.
63 |
64 | > Note: the latest sdk links against libGL.so.1, so no need to set LD_PRELOAD.
65 |
66 | ### Use in CMake Projects
67 | ```
68 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
69 | target_link_libraries(your_target PRIVATE mdk)
70 | ```
71 |
72 | ### Qt qmake project
73 | ```qmake
74 | include($$MDK_SDK_DIR/mdk.pri)
75 | ```
76 |
77 |
78 | ## Source code:
79 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
80 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
81 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
82 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
83 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
84 |
85 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
86 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.WinRT.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
16 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
17 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
18 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
19 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
20 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
21 |
22 |
23 | ## About SDK for Windows Desktop & UWP
24 | SDK is built by
25 | - latest VS2022 with [FFmpeg win32](https://sourceforge.net/projects/avbuild/files/windows-desktop/ffmpeg-master-windows-desktop-vs2022-lite.7z/download) and [FFmpeg UWP](https://sourceforge.net/projects/avbuild/files/uwp/ffmpeg-master-uwp-vs2022-lite.7z/download)
26 |
27 | SDK can be used by any C or C++11 compiler, e.g. vs2015, vs2022, mingw g++, clang
28 |
29 | ### Use in Visual Studio
30 |
31 | #### Install via NuGet (Recommended)
32 | mdk is published on https://www.nuget.org/packages/mdk/. Now you can install it in visual studio.
33 |
34 | #### Import from Release Package
35 | mdk sdk can be imported by vs projects. Insert the following line in your vcxproj as the last element of `Project` (assume mdk-sdk is in the same dir as vcxproj)
36 |
37 |
38 |
39 |
40 | Once installed or imported, necessary compile flags and link flags will be added, runtime dlls will be copied to output dir.
41 |
42 | ### Use in CMake Projects
43 | ```
44 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
45 | target_link_libraries(your_target PRIVATE mdk)
46 | ```
47 |
48 | ### Qt qmake project
49 | ```qmake
50 | include($$MDK_SDK_DIR/mdk.pri)
51 | ```
52 |
53 |
54 | ### Recommended settings
55 | ```cpp
56 | player.setDecoders(MediaType::Video, {"MFT:d3d=11", "D3D11", "hap", "FFmpeg", "dav1d"});
57 | ```
58 |
59 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#uwp)
60 | Optional:
61 | - libEGL.dll, libGLESv2.dll, D3DCompiler_47/43.dll. Qt apps can use qt's dlls
62 |
63 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
64 | - D3D11: recommended
65 | - D3D12
66 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via ANGLE or others. The default if EGL runtime is found.
67 | - Vulkan(No UWP)
68 |
69 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
70 | - [FFmpeg](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#ffmpeg). options: threads=N. e.g. -c:v FFmpeg. -c:v FFmpeg:threads=4
71 | - [MFT](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#mft). options: d3d=0/9/11/12, pool=0/1. e.g. -c:v MFT(software), -c:v MFT:d3d=11(hardware) or MFT:d3d=12.
72 | - [D3D11](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#d3d11): via FFmpeg
73 | - [hap](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap)
74 |
75 | ## Source code:
76 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
77 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
78 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
79 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
80 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
81 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
82 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
83 |
84 |
85 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
86 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/nuget/README.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 |
3 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
4 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
5 |
6 |
7 | ### Features
8 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
9 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
10 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
11 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
12 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
13 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
14 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
15 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
16 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
17 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
18 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
19 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
20 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
21 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
22 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
23 |
24 |
25 | ## About SDK for Windows Desktop & UWP
26 | SDK is built by
27 | - latest VS2022 with [FFmpeg win32](https://sourceforge.net/projects/avbuild/files/windows-desktop/ffmpeg-master-windows-desktop-vs2022-lite.7z/download) and [FFmpeg UWP](https://sourceforge.net/projects/avbuild/files/uwp/ffmpeg-master-uwp-vs2022-lite.7z/download)
28 |
29 | SDK can be used by any C or C++11 compiler, e.g. vs2015, vs2022, mingw g++, clang
30 |
31 | ### Use in CMake Projects
32 | ```
33 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
34 | target_link_libraries(your_target PRIVATE mdk)
35 | ```
36 |
37 | ### Qt qmake project
38 | ```qmake
39 | include($$MDK_SDK_DIR/mdk.pri)
40 | ```
41 |
42 |
43 | ### Recommended settings
44 | ```cpp
45 | player.setDecoders(MediaType::Video, {"MFT:d3d=11", "D3D11", "CUDA", "hap", "FFmpeg", "dav1d"});
46 | ```
47 |
48 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#windows-desktop)
49 | - Vista+
50 | - ucrt, vc140+ runtime
51 |
52 | Optional:
53 | - libEGL.dll, libGLESv2.dll, D3DCompiler_47/43.dll. Qt apps can use qt's dlls
54 | - vulkan
55 |
56 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
57 | - D3D11: recommended
58 | - D3D12
59 | - [OpenGL(No UWP)](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via WGL. The default if EGL runtime is not found.
60 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via ANGLE or others. The default if EGL runtime is found.
61 | - Vulkan(No UWP)
62 |
63 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
64 | - [FFmpeg](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#ffmpeg). options: threads=N. e.g. -c:v FFmpeg. -c:v FFmpeg:threads=4
65 | - [MFT](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#mft). options: d3d=0/9/11/12, pool=0/1. e.g. -c:v MFT(software), -c:v MFT:d3d=11(hardware) or MFT:d3d=12.
66 | - [CUDA](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#cuda)(No UWP)
67 | - [D3D11](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#d3d11): via FFmpeg
68 | - [DXVA](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#dxva)(No UWP): via FFmpeg
69 | - [NVDEC](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#nvdec)(No UWP): via FFmpeg
70 | - CUVID(No UWP): via FFmpeg
71 | - [QSV](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#qsv)(No UWP): via FFmpeg
72 | - [BRAW](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#braw): Blackmagic RAW
73 | - [R3D](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#r3d): R3D RAW
74 | - [hap](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap)
75 | - [VAAPI](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#vaapi)
76 |
77 | ## Source code:
78 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
79 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
80 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
81 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
82 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
83 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
84 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
85 |
86 |
87 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
88 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/ci-before-build.sh:
--------------------------------------------------------------------------------
1 | NDK_HOST=linux
2 | FF_EXTRA=-clang
3 | FFPKG_EXT=tar.xz
4 |
5 | echo "EXTERNAL_DEP_CACHE_HIT: ${EXTERNAL_DEP_CACHE_HIT}"
6 | echo "DEVTOOLS_CACHE_HIT: ${DEVTOOLS_CACHE_HIT}"
7 |
8 | du -hc external
9 |
10 | tolower(){
11 | echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
12 | }
13 |
14 | crt_extra=$(tolower ${CRT_EXTRA})
15 |
16 | if [[ "$TARGET_OS" == mac* || "$TARGET_OS" == iOS* || "$TARGET_OS" == tvOS* || "$TARGET_OS" == xr* || "$TARGET_OS" == vision* || "$TARGET_OS" == android || "$TARGET_OS" == ohos ]]; then
17 | FF_EXTRA=
18 | fi
19 | if [[ "$TARGET_OS" == "win"* || "$TARGET_OS" == "uwp"* ]]; then
20 | FF_EXTRA=-vs2022${crt_extra}
21 | FFPKG_EXT=7z
22 | fi
23 | if [ `which dpkg` ]; then # TODO: multi arch
24 | pkgs="sshpass cmake ninja-build p7zip-full"
25 | #wget https://apt.llvm.org/llvm.sh
26 | if [[ "$TARGET_OS" != android && "$TARGET_OS" != ohos ]]; then
27 | #bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
28 | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
29 | source /etc/os-release
30 | sudo add-apt-repository -y "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME} main"
31 | sudo apt update
32 | pkgs+=" llvm-${LLVM_VER}-tools clang-${LLVM_VER} clang-tools-${LLVM_VER} clang-tidy-${LLVM_VER} lld-${LLVM_VER} libc++-${LLVM_VER}-dev libclang-rt-${LLVM_VER}-dev"
33 | fi
34 | if [ "$TARGET_OS" == "linux" ]; then
35 | pkgs+=" libopenal-dev libsdl2-dev"
36 | #pkgs+=" libegl1-mesa-dev libgles2-mesa-dev libgl1-mesa-dev libgbm-dev libx11-dev libwayland-dev libasound2-dev libopenal-dev libpulse-dev libva-dev libvdpau-dev"
37 | elif [ "$TARGET_OS" == "sunxi" -o "$TARGET_OS" == "raspberry-pi" ]; then
38 | pkgs+=" binutils-arm-linux-gnueabihf"
39 | fi
40 | sudo apt install -y $pkgs
41 | elif [ `which brew` ]; then
42 | export HOMEBREW_NO_AUTO_UPDATE=true
43 | #time brew update --preinstall
44 | export HOMEBREW_NO_AUTO_UPDATE=1
45 | pkgs="vulkan-headers dav1d md5sha1sum" # p7zip gnu-tar
46 | #pkgs+=" cmake" # visionOS simulator requires cmake 3.28.4
47 | if [[ "$DEVTOOLS_CACHE_HIT" != "true" ]]; then
48 | pkgs+=" hudochenkov/sshpass/sshpass"
49 | fi
50 | if [ "$TARGET_OS" == "macOS" ]; then
51 | pkgs+=" glfw sdl2"
52 | echo "$TARGET_ARCH" |grep arm >/dev/null || { # FIXME: arm64 host build
53 | pkgs+=" xquartz pulseaudio" # no more cask
54 | }
55 | fi
56 | time brew install $pkgs
57 | type -a cmake
58 | NDK_HOST=darwin
59 | fi
60 |
61 | OS=${TARGET_OS/r*pi/rpi}
62 | OS=${OS/*store/WinRT}
63 | OS=${OS/*uwp*/WinRT}
64 | OS=${OS%%-*}
65 | #OS=${OS/Simulator/} #
66 | [ "$TARGET_OS" == "linux" ] && OS=Linux
67 | [ "$TARGET_OS" == "ohos" ] && OS=OHOS
68 | mkdir -p external/{bin,lib}/$OS
69 |
70 | if [[ "$EXTERNAL_DEP_CACHE_HIT" != "true" ]]; then
71 | FFPKG=ffmpeg-${FF_VER}-${TARGET_OS}${FF_EXTRA}-lite${LTO_SUFFIX}
72 | curl -kL -o ffmpeg-${TARGET_OS}.${FFPKG_EXT} https://sourceforge.net/projects/avbuild/files/${TARGET_OS}/${FFPKG}.${FFPKG_EXT}/download
73 | if [[ "${FFPKG_EXT}" == 7z ]]; then
74 | 7z x ffmpeg-${TARGET_OS}.${FFPKG_EXT}
75 | else
76 | tar Jxf ffmpeg-${TARGET_OS}.${FFPKG_EXT}
77 | fi
78 | #find ${FFPKG}/lib -name "libav*.so*" -o -name "libsw*.so*" -delete
79 | find ${FFPKG}/lib -name "libffmpeg.a" -delete # FIXME: linking to libffmpeg.a(relocatable obj) by ci results in larger binary size
80 | cp -af ${FFPKG}/lib/* external/lib/$OS
81 | cp -af ${FFPKG}/include external/
82 | cp -af ${FFPKG}/bin/* external/bin/$OS # ffmpeg dll
83 |
84 | if [ "$TARGET_OS" == "sunxi" ]; then
85 | mkdir -p external/lib/sunxi/armv7
86 | cp -af ${FFPKG}/lib/* external/lib/sunxi/armv7 #single arch package
87 | elif [[ "$TARGET_OS" == "win"* ]]; then
88 | # TODO: download in cmake(if check_include_files failed)
89 | curl -kL -o vk.zip https://github.com/KhronosGroup/Vulkan-Headers/archive/main.zip
90 | 7z x vk.zip
91 | cp -af Vulkan-Headers-main/include/* external/include/
92 | fi
93 |
94 | if [[ "$TARGET_OS" == "win"* || "$TARGET_OS" == "uwp"* || "$TARGET_OS" == macOS ]]; then
95 | mkdir -p external/include/{EGL,GLES{2,3},KHR}
96 | for h in GLES2/gl2.h GLES2/gl2ext.h GLES2/gl2platform.h GLES3/gl3.h GLES3/gl3platform.h; do
97 | curl -kL -o external/include/${h} https://www.khronos.org/registry/OpenGL/api/${h}
98 | done
99 | for h in EGL/egl.h EGL/eglext.h EGL/eglplatform.h KHR/khrplatform.h; do
100 | curl -kL -o external/include/${h} https://www.khronos.org/registry/EGL/api/${h}
101 | done
102 | fi
103 | if [[ "$TARGET_OS" == "win"* || "$TARGET_OS" == macOS || "$TARGET_OS" == "linux" ]]; then
104 | curl -kL -o R3DSDK.7z https://sourceforge.net/projects/mdk-sdk/files/deps/r3d/R3DSDK.7z/download
105 | 7z x R3DSDK.7z -oexternal
106 | fi
107 | fi
108 |
109 | curl -kL -o libmdk-dep.zip https://nightly.link/wang-bin/devpkgs/workflows/build/main/libmdk-dep.zip
110 | 7z x libmdk-dep.zip
111 | 7z x dep.7z
112 | cp -avf dep/* external/
113 |
114 | if [[ "$SYSROOT_CACHE_HIT" != "true" ]]; then
115 | if [[ "$TARGET_OS" == "win"* || "$TARGET_OS" == "uwp"* ]]; then
116 | wget https://sourceforge.net/projects/avbuild/files/dep/msvcrt-dev.7z/download -O msvcrt-dev.7z
117 | echo 7z x msvcrt-dev.7z -o${WINDOWSSDKDIR%/?*}
118 | 7z x msvcrt-dev.7z -o${WINDOWSSDKDIR%/?*}
119 | wget https://sourceforge.net/projects/avbuild/files/dep/winsdk.7z/download -O winsdk.7z
120 | echo 7z x winsdk.7z -o${WINDOWSSDKDIR%/?*}
121 | 7z x winsdk.7z -o${WINDOWSSDKDIR%/?*}
122 | ${WINDOWSSDKDIR}/lowercase.sh
123 | ${WINDOWSSDKDIR}/mkvfs.sh
124 | fi
125 |
126 | if [ "$TARGET_OS" == "sunxi" -o "$TARGET_OS" == "raspberry-pi" -o "$TARGET_OS" == "linux" ]; then
127 | wget https://sourceforge.net/projects/avbuild/files/${TARGET_OS}/${TARGET_OS/r*pi/rpi}-sysroot.tar.xz/download -O sysroot.tar.xz
128 | tar Jxf sysroot.tar.xz
129 | fi
130 |
131 | if [ "$TARGET_OS" == "android" -a ! -d "$ANDROID_NDK_LATEST_HOME" ]; then
132 | wget https://dl.google.com/android/repository/android-ndk-${NDK_VERSION:-r25b}-${NDK_HOST}-x86_64.zip -O ndk.zip
133 | 7z x ndk.zip -o/tmp &>/dev/null
134 | mv /tmp/android-ndk-${NDK_VERSION:-r25b} ${ANDROID_NDK:-/tmp/android-ndk}
135 | fi
136 | fi
137 |
--------------------------------------------------------------------------------
/README.macOS.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
16 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
17 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
18 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
19 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
20 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
21 |
22 |
23 | ## Swift
24 | https://github.com/wang-bin/swift-mdk
25 |
26 | ## About SDK for macOS
27 |
28 | - Support Apple sillicon
29 | - Support Metal and Vulkan renderer
30 | - Support VP9 on macOS 11+
31 | - Support X11 if runtime libraries exist
32 |
33 | SDK is built by Xcode 16 with
34 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/macOS/ffmpeg-master-macOS-lite-lto.tar.xz/download
35 |
36 | ### macOS 10.15+
37 | Executables download from internet are not able to run. Try to run `./mdk-sdk/catalina.sh`
38 |
39 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#macos)
40 | Optional:
41 | - MoltenVK or Vulkan SDK
42 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via ANGLE project or PowerVR SDK. the default if EGL is available. 0-copy rendering VideoToolbox frames is supported for ANGLE. Can be disabled by environment var GL_EGL=0 or GLRenderAPI.
43 | - X11 via XQuartz
44 |
45 |
46 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
47 | - Metal: recommended
48 | - OpenGL
49 | - OpenGL ES2/3: via ANGLE or others. The default if EGL runtime is found.
50 | - Vulkan
51 |
52 |
53 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
54 | - FFmpeg. Direct rendering via property "pool=CVPixelBuffer"
55 | - VT: videotoolbox hardware decoder. h264, hevc, vp9 support. propertyes: threads, realTime, async, format, hardware, width, height. e.g. `player.setVideoDecoders({"VT:format=nv12:async=1", "FFmpeg"})`
56 | - VideoToolbox: via ffmpeg
57 |
58 | VT default use async mode, and the performance is better performance then FFmpeg's sync VideoToolbox
59 |
60 | ### Examples
61 | gapless playback for any audio and video: glfwplay/sdlplay video1 video2 ...
62 |
63 | N players for 1 video: multiplayers -share -c:v VideoToolbox -win N url
64 |
65 | N videos and N players: multiplayers -share -c:v VideoToolbox url1 url2 ... urlN
66 |
67 | N videos renderers for 1 player: multiwidnows url
68 |
69 | ### Use in CMake Projects
70 | ```
71 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
72 | target_link_libraries(your_target PRIVATE mdk)
73 | ```
74 |
75 | ### Qt qmake project
76 | ```qmake
77 | include($$MDK_SDK_DIR/mdk.pri)
78 | ```
79 |
80 |
81 | ### Recommended settings
82 |
83 | - macOS, iOS: `player.setDecoders(MediaType::Video, {"VT", "hap", "FFmpeg", "dav1d"});`
84 |
85 |
86 | ### Use in Xcode
87 | Choose any of
88 | - Add mdk.xcframework to your project(Embed & Sign)
89 | - install via cocoapods `pod 'mdk'`
90 |
91 | #### Code Sign
92 | Choose any of
93 | - In `Build Settings` add `--deep` to `Other Code Signing Flags`
94 | - (Recommended) In `Build Phase`, add a `New Run Script Phase` with content `[ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -name "libffmpeg*.dylib" -exec codesign -i mdk.framework.ffmpeg -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;`
95 |
96 |
97 | ## Source code:
98 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
99 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
100 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
101 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
102 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
103 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
104 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
105 |
106 |
107 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
108 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.Windows.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 |
3 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
4 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
5 |
6 |
7 | ### Features
8 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
9 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
10 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
11 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
12 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
13 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
14 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
15 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
16 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
17 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
18 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
19 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
20 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
21 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
22 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
23 |
24 |
25 | ## About SDK for Windows Desktop & UWP
26 | SDK is built by
27 | - latest VS2022 with [FFmpeg win32](https://sourceforge.net/projects/avbuild/files/windows-desktop/ffmpeg-master-windows-desktop-vs2022-lite.7z/download) and [FFmpeg UWP](https://sourceforge.net/projects/avbuild/files/uwp/ffmpeg-master-uwp-vs2022-lite.7z/download)
28 |
29 | SDK can be used by any C or C++11 compiler, e.g. vs2015, vs2022, mingw g++, clang
30 |
31 | ### Use in Visual Studio
32 |
33 | #### Install via NuGet (Recommended)
34 | mdk is published on https://www.nuget.org/packages/mdk/. Now you can install it in visual studio.
35 |
36 | #### Import from Release Package
37 | mdk sdk can be imported by vs projects. Insert the following line in your vcxproj as the last element of `Project` (assume mdk-sdk is in the same dir as vcxproj)
38 |
39 |
40 |
41 |
42 | Once installed or imported, necessary compile flags and link flags will be added, runtime dlls will be copied to output dir.
43 |
44 | ### Use in CMake Projects
45 | ```
46 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
47 | target_link_libraries(your_target PRIVATE mdk)
48 | ```
49 |
50 | ### Qt qmake project
51 | ```qmake
52 | include($$MDK_SDK_DIR/mdk.pri)
53 | ```
54 |
55 |
56 | ### Recommended settings
57 | ```cpp
58 | player.setDecoders(MediaType::Video, {"MFT:d3d=11", "D3D11", "CUDA", "hap", "FFmpeg", "dav1d"});
59 | ```
60 |
61 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#windows-desktop)
62 | - Vista+
63 | - ucrt, vc140+ runtime
64 |
65 | Optional:
66 | - libEGL.dll, libGLESv2.dll, D3DCompiler_47/43.dll. Qt apps can use qt's dlls
67 | - vulkan
68 |
69 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
70 | - D3D11: recommended
71 | - D3D12
72 | - [OpenGL(No UWP)](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via WGL. The default if EGL runtime is not found.
73 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via ANGLE or others. The default if EGL runtime is found.
74 | - Vulkan(No UWP)
75 |
76 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
77 | - [FFmpeg](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#ffmpeg). options: threads=N. e.g. -c:v FFmpeg. -c:v FFmpeg:threads=4
78 | - [MFT](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#mft). options: d3d=0/9/11/12, pool=0/1. e.g. -c:v MFT(software), -c:v MFT:d3d=11(hardware) or MFT:d3d=12.
79 | - [CUDA](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#cuda)(No UWP)
80 | - [D3D11](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#d3d11): via FFmpeg
81 | - [DXVA](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#dxva)(No UWP): via FFmpeg
82 | - [NVDEC](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#nvdec)(No UWP): via FFmpeg
83 | - CUVID(No UWP): via FFmpeg
84 | - [QSV](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#qsv)(No UWP): via FFmpeg
85 | - [BRAW](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#braw): Blackmagic RAW
86 | - [R3D](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#r3d): R3D RAW
87 | - [hap](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap)
88 | - [VAAPI](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#vaapi)
89 |
90 | ### Examples
91 | gapless playback for any audio and video: mdkplay.exe(or glfwplay.exe/window.exe/sdlplay.exe) file file2 ...
92 |
93 | N players for 1 video: multiplayers -es -share -c:v D3D11 -win N url
94 |
95 | N videos and N players: multiplayers -es -share -c:v D3D11 url1 url2 ... urlN
96 |
97 | N videos renderers for 1 player: multiwidnows url
98 |
99 | ## Source code:
100 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
101 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
102 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
103 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
104 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
105 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
106 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
107 |
108 |
109 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
110 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.Linux.md:
--------------------------------------------------------------------------------
1 | ## MDK: Multimedia Development Kit
2 | ### [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md)
3 | ### [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
4 |
5 | ### Features
6 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
7 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
8 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
9 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
10 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
11 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
12 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
13 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
14 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
15 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
16 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
17 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
18 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
19 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
20 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
21 |
22 |
23 | ## About SDK for Linux
24 | SDK is built by clang 22 with
25 | - ffmpeg: https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-master-linux-clang-lite-lto.tar.xz/download
26 | - libc++ 20. You can use delete libc++.so from sdk and use system libc++
27 |
28 | SDK can be used by any C or C++11 compiler, e.g. g++, clang
29 |
30 | dsym files are debug symbols, not required to deploy your programe.
31 |
32 | ### [Runtime Requirements](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements#linux-desktop-raspberry-pi-64bit)
33 |
34 | ubuntu>=14.04(maybe 12.04)
35 |
36 | - glibc >= 2.14
37 | - libc++1, libc++abi1: not using gnu stl because libc++ has better compatibility. previous sdks depend on glibc++ 3.4.22(g++6)
38 | - libva version 2 or 1: libva2, libva-x11-2, libva-drm2 or libva1, libva-x11-1, libva-drm1. Running `apt install vainfo` will install these
39 | - libasound2, libpulse0
40 | - libwayland-client0
41 | - libgbm1
42 | - libgl1-mesa-glx
43 |
44 | Optional:
45 | - libegl1-mesa: egl context
46 | - libvdpau1: vdpau rendering. (required by ffmpeg decoder)
47 | - libwayland-egl1: wayland surface and egl context support
48 | - libass5~9 to support subtitle
49 | - libopenal1
50 | - libsdl2: sdlplay example
51 |
52 | ### Environment Vars:
53 | - GL_EGL: 0 = use glx context, 1 = use egl context (if created by mdk)
54 | - GL_ES: 0 = use opengl, 1 = use opengl es (if created by mdk)
55 | - VDPAU_GL: video = interop with video surface, output = interop with output surface, pixmap = interop with x11 pixmap(required by egl from x11)
56 | - VAAPI_GL: x11 = interop with glx/egl(via x11 pixmap), drm = interop with drm prime, drm2 = interop with drm prime2
57 | - CUDA_STREAM: 0/1
58 | - CUDA_PBO: 0/1
59 | - CUDA_HOST: 0/1
60 | - CUDA_DEVICE: number
61 |
62 | ### [Supported Graphics APIs:](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
63 | - OpenGL
64 | - [OpenGL ES2/3](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix): via EGL, GLX, ANGLE or others. the default if EGL is available.
65 | - Vulkan: broken now
66 |
67 | ### [Supported Decoders:](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
68 | - FFmpeg, VDPAU, VAAPI, CUDA, QSV(not tested), NVDEC, rockchip
69 | - command line: -c:v decodername
70 |
71 | ### DRM Prime
72 | RaspberryPi OS system ffmpeg provides hevc and v4l2m2m drm_prime frame output, you can use system ffmpeg(delete libffmpeg.so.* in sdk package) with OpenGLES(desktop GL does not support hevc) contexts created from EGL to get maximum performance. glfwplay option to test:
73 | - x11: `./glfwplay -c:v V4L2M2M,FFmpeg:hwcontext=drm:sw_fallback=1 -gl test.mp4`
74 | - wayland: `./glfwplay -c:v V4L2M2M,FFmpeg:hwcontext=drm:sw_fallback=1 -es test.mp4`, you have to install glfw `sudo apt install libglfw3-wayland`
75 |
76 | RaspberryPi OS rendering performance is poor, you may have to disable log, log to file or minimize terminal to get higher fps, otherwise rendering log may slow down video rendering. wayland environment has better performance
77 |
78 | ### Examples
79 | GL Context
80 | - Created by MDK: glfwplay -gl:opengl=1, glfwplay -gl:opengl=1:egl=1, glfwplay -gl, mdkplay, x11win
81 | - Foreign Context: glfwplay, multiplayers, multiwindows (via glfw), sdlplay(via sdl)
82 |
83 | Gapless Playback for Any Media:
84 | - mdkplay(or glfwplay/window/sdlplay) file file2 ...
85 |
86 | N players for 1 video: multiplayers -share -win N url
87 |
88 | N videos and N players: multiplayers -share url1 url2 ... urlN
89 |
90 | N videos renderers for 1 player: multiwidnows url
91 |
92 | ### Use in CMake Projects
93 | ```
94 | include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
95 | target_link_libraries(your_target PRIVATE mdk)
96 | ```
97 |
98 | ### Qt qmake project
99 | ```qmake
100 | include($$MDK_SDK_DIR/mdk.pri)
101 | ```
102 |
103 |
104 | ### Recommended settings
105 | - Linux:
106 | ```cpp
107 | // XInitThreads(); // If using x11. before any x11 api call. some gui toolkits already call this, e.g. qt, glfw
108 | SetGlobalOption("X11Display", DisplayPtr); // If using x11. Requred by VAAPI, VDPAU
109 | player.setDecoders(MediaType::Video, {"VAAPI", "VDPAU", "CUDA", "hap", "FFmpeg", "dav1d"});
110 | ```
111 | - Raspberry Pi: use [mdk-sdk-linux.tar.xz](https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-linux.tar.xz/download), delete libffmpeg.so.* to use system ffmpeg to support h264, hevc hardware decoder and 0-copy rendering
112 | ```cpp
113 | player.setDecoders(MediaType::Video, {"V4L2M2M", "FFmpeg:hwcontext=drm", "FFmpeg"});
114 | ```
115 |
116 | ## Source code:
117 | - [some examples using mdk sdk](https://github.com/wang-bin/mdk-examples)
118 | - [OBS Studio plugin](https://github.com/wang-bin/obs-mdk)
119 | - [QtMultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
120 | - [MFT decoder module](https://github.com/wang-bin/mdk-mft)
121 | - [dav1d decoder module](https://github.com/wang-bin/mdk-dav1d)
122 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
123 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
124 |
125 |
126 | Copyright (c) 2016-2025 WangBin(the author of QtAV)
127 | Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://github.com/wang-bin/mdk-sdk/actions)
2 |
3 | [](https://dev.azure.com/kb137035/mdk/_build/latest?definitionId=2&branchName=master)
4 |
5 | **Download** latest [Nightly Build SDK from sourceforge](https://sourceforge.net/projects/mdk-sdk/files/nightly/) or [github actions](https://nightly.link/wang-bin/mdk-sdk/workflows/build/master)
6 |
7 |
8 | Sourceforge[](https://sourceforge.net/projects/mdk-sdk/files)
9 | Github Releases[](https://github.com/wang-bin/mdk-sdk/releases)
10 | NuGet[](https://www.nuget.org/packages/mdk)
11 |
12 |
13 | [Changelog](https://github.com/wang-bin/mdk-sdk/blob/master/Changelog.md).
14 | [API](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
15 |
16 | ## Features
17 |
18 | - [Simple and powerful API set](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs)
19 | - [Cross platform: Windows(x86, arm), UWP, Linux, macOS, Android, iOS, tvOS, visionOS, Raspberry Pi, RockChip](https://github.com/wang-bin/mdk-sdk/wiki/System-Requirements)
20 | - [Hardware accelerated decoders for all platforms](https://github.com/wang-bin/mdk-sdk/wiki/Decoders)
21 | - [0-copy GPU rendering for all platforms and all renderers(Vulkan is WIP.)](https://github.com/wang-bin/mdk-sdk/wiki/Zero-Copy-Renderer)
22 | - [Dynamic OpenGL](https://github.com/wang-bin/mdk-sdk/wiki/OpenGL-Support-Matrix)
23 | - [OpenGL, D3D11, D3D12, Vulkan and Metal rendering w/ or w/o user provided context](https://github.com/wang-bin/mdk-sdk/wiki/Render-API)
24 | - Integrated with any platform native ui apps, gui toolkits or other apps via [OpenGL, D3D11/12, Vulkan and Metal](https://github.com/wang-bin/mdk-sdk/wiki/Render-API) ([WinUI3](https://github.com/Damix48/WinUI3MDK/tree/main), [OBS](https://github.com/wang-bin/obs-mdk), [Flutter](https://pub.dev/packages/fvp), [Qt](https://github.com/wang-bin/mdk-examples/tree/master/Qt), [SDL](https://github.com/wang-bin/mdk-examples/tree/master/SDL), [GLFW](https://github.com/wang-bin/mdk-examples/tree/master/GLFW), [SFML](https://github.com/wang-bin/mdk-examples/tree/master/SFML), [.NET Avalonia](https://github.com/wang-bin/mdk-examples/tree/master/Avalonia) etc.) easily
25 | - [HDR display metadata passthrough, HDR <=> SDR tone mapping](https://github.com/wang-bin/mdk-sdk/wiki/HDR). You can use HDR display in [Qt6(6.6+ for macOS, 6.x for windows)](https://github.com/wang-bin/mdk-examples/tree/master/Qt/qmlrhi), [OBS Studio](https://github.com/wang-bin/obs-mdk), Android SurfaceView and more.
26 | - Dolby Vision rendering, including Profile 5. Support HEVC and AV1.
27 | - HEVC, VP8/9 transparent videos(alpha channel) support for all decoders and renderers
28 | - Professional codecs: GPU accelerated [HAP](https://github.com/wang-bin/mdk-sdk/wiki/Decoders#hap) codec rendering, [Blackmagic RAW](https://github.com/wang-bin/mdk-braw), [R3D](https://github.com/wang-bin/mdk-r3d), [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
29 | - Subtitle rendering, including ass, plain text, bitmap, closed caption
30 | - [Seamless/Gapless media and bitrate switch for any media](https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-setcolorspace-value-void-vo_opaque--nullptr)
31 | - Optimized Continuous seeking. As fast as mpv, but much lower cpu, memory and gpu load. Suitable for [timeline preview](https://github.com/wang-bin/mdk-sdk/wiki/Typical-Usage#timeline-preview)
32 | - [Smart FFmpeg runtime, dynamic load, binary compatible with 4.0~8.x](https://github.com/wang-bin/mdk-sdk/wiki/FFmpeg-Runtime)
33 |
34 |
35 | ## Install
36 |
37 | ### CMake
38 |
39 | ```cmake
40 | include(${MDK_SDK_DIR}/lib/cmake/FindMDK.cmake)
41 | target_link_libraries(your_target PRIVATE mdk)
42 | ```
43 |
44 | ### Qt qmake
45 | ```qmake
46 | include($$MDK_SDK_DIR/mdk.pri)
47 | ```
48 |
49 | ### CocoaPods
50 |
51 | #### (Objective-)C/C++ Users
52 | ```ruby
53 | pod 'mdk'
54 | ```
55 |
56 | Optionally you can use [mdk.xcframework](https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-apple.tar.xz/download) directly.
57 |
58 | #### Swift Users
59 | Add `swift-mdk` via swift package manager, or
60 | ```ruby
61 | pod 'swift-mdk'
62 | ```
63 | and
64 | ```swift
65 | import swift_mdk
66 | ```
67 |
68 | ### Nuget
69 |
70 | Install via [NuGet](https://www.nuget.org/packages/mdk) in Visual Studio for both Windows desktop and UWP
71 |
72 | ## macOS Hardened Runtime
73 | You may fail to run(or codesign) with default hardened runtime options because there are some dylib files in mdk.framework not signed correctly. You can either select `Disable Library Validation` in `Hardened Runtime` options, or sign dylib(**RECOMMENDED**): In `Build Phase`, add a `New Run Script Phase` with content
74 | ```bash
75 | [ -n "$CODE_SIGN_IDENTITY" ] && find "$BUILT_PRODUCTS_DIR" -depth -path "*mdk.framework/*" -name "lib*.dylib" -exec codesign -f -vvvv -s"${EXPANDED_CODE_SIGN_IDENTITY}" ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements,flags {} \;
76 | ```
77 |
78 | ## Distribute
79 | - mdk(libmdk.so.0/ibmdk.dylib/mdk.dll) and ffmpeg library(or standard ffmpeg libraries) are always REQUIRED
80 | - libass.dll/libass.dylib/ass.framework/libass.so can be optional if not using subtitle rendering
81 | - mdk-braw.dll/libmdk-braw.{so,dylib}: optional, for blackmagic raw videos
82 | - mdk-r3d.dll/libmdk-r3d.{so,dylib}: optional, for RED raw videos
83 | - mdk.pdb/libmdk.so*.dsym: debug symbols.
84 | - Add [libdav1d.dll/libdav1d.dylib/dav1d.framework/libdav1d.so](https://sourceforge.net/projects/mdk-sdk/files/deps/dep.7z/download) to support av1 software decoding
85 |
86 | ## Documents
87 |
88 | - [wiki](https://github.com/wang-bin/mdk-sdk/wiki)
89 | - sdk headers
90 |
91 |
92 | ### Recommended settings
93 | Since 0.35.0, `player.setProperty("video.decoders", GetGlobalOption("video.decoders.hint"))` will prefer hardware decoders over software ones, and the following `player.setDecoders()` is not required.
94 | - macOS, iOS: `player.setDecoders(MediaType::Video, {"VT", "hap", "FFmpeg", "dav1d"});`
95 | - Windows: `player.setDecoders(MediaType::Video, {"MFT:d3d=11", "D3D11", "DXVA", "CUDA", "hap", "FFmpeg", "dav1d"});`
96 | - Linux:
97 | ```cpp
98 | // XInitThreads(); // If using x11. before any x11 api call. some gui toolkits already call this, e.g. qt, glfw
99 | SetGlobalOption("X11Display", DisplayPtr); // If using x11. Requred by VAAPI, VDPAU
100 | player.setDecoders(MediaType::Video, {"VAAPI", "VDPAU", "CUDA", "hap", "FFmpeg", "dav1d"});
101 | ```
102 | - Raspberry Pi: use [mdk-sdk-linux.tar.xz](https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-linux.tar.xz/download), delete `libffmpeg.so.*` to use system ffmpeg to support hardware decoder and use EGL for 0-copy rendering
103 | ```cpp
104 | player.setDecoders(MediaType::Video, {"V4L2M2M", "FFmpeg:hwcontext=drm", "FFmpeg", "dav1d"});
105 | ```
106 |
107 | - RockChip: [mdk-sdk-linux.tar.xz](https://sourceforge.net/projects/mdk-sdk/files/nightly/mdk-sdk-linux.tar.xz/download) contains a [rockchip decoder plugin](https://github.com/wang-bin/mdk-rockchip). You can also use ffmpeg's `rkmpp` decoder: delete `libffmpeg.so.*` and use upstream ffmpeg or [ffmpeg-rockchip](https://github.com/nyanmisaka/ffmpeg-rockchip) with rkmpp enabled. OpenGL ES2/3 0-copy rendering is supported
108 |
109 | ```cpp
110 | SetGlobalOption("gl.ubo", "0"); // optional. required by some buggy drivers
111 | player.setDecoders(MediaType::Video, {"rockchip", "rkmpp", "FFmpeg", "dav1d"});
112 | ```
113 |
114 | - Android:
115 | ```cpp
116 | SetGlobalOption("JavaVM", JvmPtr); // REQUIRED
117 | player.setDecoders(MediaType::Video, {"AMediaCodec", "FFmpeg", "dav1d"});
118 | ```
119 |
120 | ## Open Source
121 | ### Modules and Dependencies
122 | - [License generator and validator](https://github.com/wang-bin/appkey)
123 | - [Android java wrapper and example](https://github.com/wang-bin/mdk-android)
124 | - [MediaFoundation decoder module](https://github.com/wang-bin/mdk-mft)
125 | - [av1 software decoder module](https://github.com/wang-bin/mdk-dav1d)
126 | - [sunxi decoder + renderer](https://github.com/wang-bin/mdk-sunxi)
127 | - [GFX surface and render loop](https://github.com/wang-bin/ugs)
128 | - [JNI C++ api](https://github.com/wang-bin/JMI)
129 | - [Android java and jni APIs in C++](https://github.com/wang-bin/AND)
130 | - [C++ TLS](https://github.com/wang-bin/ThreadLocal)
131 | - [C++ compatibility layer](https://github.com/wang-bin/cppcompat)
132 | - [cmake tools](https://github.com/wang-bin/cmake-tools)
133 | - [Blackmagic RAW](https://github.com/wang-bin/mdk-braw)
134 | - [R3D RAW](https://github.com/wang-bin/mdk-r3d)
135 | - [nvJPEG2000](https://github.com/wang-bin/mdk-nvjp2k)
136 | - [rockchip](https://github.com/wang-bin/mdk-rockchip)
137 |
138 | ### Examples and Plugins for Other Frameworks
139 | - [examples for different platforms and gui toolkits](https://github.com/wang-bin/mdk-examples)
140 | - [Swift player and QuickLook plugin for macOS](https://github.com/wang-bin/SPV)
141 | - [obs-studio video source plugin](https://github.com/wang-bin/obs-mdk)
142 | - [as a qtmultimedia plugin](https://github.com/wang-bin/qtmultimedia-plugins-mdk)
143 |
144 | ### Language Bindings
145 | - [Swift binding](https://github.com/wang-bin/swift-mdk)
146 | - [Flutter/Dart](https://pub.dev/packages/fvp)
147 | - [C#](https://github.com/axojhf/MDK.SDK.NET)
148 |
149 | ## Sponsors
150 | [](https://www.sportimization.com)
151 |
152 | ## Users
153 |
154 |
155 |
156 |
157 | [](https://www.sportimization.com)
158 |
159 | [](https://www.flyability.com)
160 | [](www.quipu.eu)
161 | [](https://gyroflow.xyz)
162 |
163 | [](https://www.connecting-technology.com)
164 |
165 | [NOTIONTHEORY](https://www.notiontheory.com/)
166 |
167 |
168 |
169 | [](https://teleguard.com)[!
170 | ](https://dakanji.app)
171 | [](https://pimosa.app)
172 |
173 |
174 |
175 |
176 | [Diem](https://www.downloaddiem.com)
177 | [easy live tv](https://github.com/aiyakuaile/easy_tv_live)
178 | [Kazumi](https://github.com/Predidit/Kazumi)
179 | [金嵘达科技](http://www.kingroda.com)
180 | [爱玩宝](https://www.aiwanbao.com)
181 |
182 |
183 |
184 |
185 | ## License
186 |
187 | - Free for opensource projects, QtAV donors and contributors: you can acquire a key from me. Can be commercial software
188 | - Free for [Flutter](https://pub.dev/packages/fvp) users. A key is already included. Can be commercial softwares.
189 | - Free for other non-commercial users: you can acquire a key from me.
190 | - Commercial license for other users: a key for an app for a single platform or multiple platforms.
191 | - Other users without a key: make sure your sdk is updated, otherwise you may see an QR image in the last frame.
192 |
193 |
194 | License key generator and validator is [open source](https://github.com/wang-bin/appkey)
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 | # TODO: nuget, vcpkg on macOS, $(brew --prefix llvm)/bin/clang (llvm11), llvm12 is default
3 | # https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry
4 | on:
5 | push:
6 | schedule:
7 | - cron: '0 12 * * 0'
8 | repository_dispatch:
9 |
10 | env:
11 | FF_VER: ${{ vars.FF_VER }}
12 | LLVM_VER: ${{ vars.LLVM_VER }}
13 | VC_LTL_VER: ${{ vars.VC_LTL_VER }}
14 | NINJA_STATUS: '[%f/%t %e %r]'
15 | SF_PW: ${{ secrets.SF_PW }}
16 | SF_USER: ${{ secrets.SF_USER }}
17 | SF_UPLOAD: ${{ github.event_name != 'repository_dispatch' || github.event.client_payload.ref == 'master' }}
18 | NVJP2K_SDK_PW: ${{ secrets.NVJP2K_SDK_PW }}
19 | CUDA_SDK_PW: ${{ secrets.CUDA_SDK_PW }}
20 |
21 | jobs:
22 | macOS:
23 | # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
24 | runs-on: macos-15 # 15. 1 xcode per image
25 | env:
26 | TARGET_OS: 'macOS'
27 | TARGET_ARCH: ${{ matrix.arch }}
28 | #LTO_SUFFIX: -lto # lto on master branch crashes in avio_open2 if open
29 | strategy:
30 | fail-fast: false
31 | matrix:
32 | config: [MinSizeRel]
33 | arch: [x86_64, arm64] # different minos
34 | steps:
35 | - uses: actions/checkout@v4
36 | - name: Checkout source
37 | uses: actions/checkout@v4
38 | with:
39 | repository: ${{ github.repository_owner }}/mdk
40 | path: mdk
41 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }} # https://docs.github.com/en/webhooks/webhook-events-and-payloads#repository_dispatch
42 | fetch-depth: 1
43 | token: ${{ secrets.CLONE_PAT }}
44 | submodules: 'recursive'
45 | - name: Setup Xcode
46 | run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
47 | - name: 'Restore External Dep cache'
48 | id: external-dep-cache
49 | uses: actions/cache@v4
50 | with:
51 | path: |
52 | ./mdk/external
53 | !./mdk/external/lib/macOS/libvulkan.tbd
54 | !./mdk/external/lib/libdav1d.tbd
55 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
56 | # why may failed to cache/restore /usr/local/bin/sshpass?
57 | # no build cache because build dir content changes but key should not, then no cache save.
58 | - name: Create Build Environment
59 | shell: bash
60 | env:
61 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
62 | working-directory: mdk
63 | run: ../ci-before-build.sh
64 |
65 | - name: Configure CMake
66 | if: ${{ matrix.arch == 'x86_64' }}
67 | # Use a bash shell so we can use the same syntax for environment variable
68 | # access regardless of the host operating system
69 | shell: bash
70 | working-directory: mdk # TODO: remove
71 | run: |
72 | pwd
73 | cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_X11=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -GNinja -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
74 | - name: Configure CMake
75 | if: ${{ startsWith(matrix.arch, 'arm64') }} # arm64, arm64e
76 | shell: bash
77 | working-directory: mdk
78 | run: |
79 | cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_X11=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -GNinja -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
80 | - name: Build
81 | shell: bash
82 | working-directory: mdk
83 | run: cmake --build build/${TARGET_OS} --parallel
84 | - name: Make SDK
85 | shell: bash
86 | working-directory: mdk
87 | run: |
88 | ../ci-after-build.sh
89 | mv mdk-sdk*.tar.xz ../mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch }}.tar.xz
90 | - name: Archieve SDK
91 | uses: actions/upload-artifact@v4
92 | with:
93 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch}}-${{ matrix.config }}
94 | path: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.arch}}.tar.xz
95 | - name: Upload to SourceForge
96 | if: ${{ matrix.config == 'RelWithDebInfo' && matrix.arch == 'x86_64' && env.SF_UPLOAD == 'true' }}
97 | shell: bash
98 | run: |
99 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-${{ matrix.arch }}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
100 |
101 | iOS:
102 | runs-on: macos-15
103 | env:
104 | TARGET_OS: ${{ matrix.os }}${{ matrix.simulator }}
105 | #LTO_SUFFIX: -lto # lto on master branch crashes in avio_open2 if open
106 | strategy:
107 | fail-fast: false
108 | matrix:
109 | os: [iOS, tvOS, visionOS, macCatalyst]
110 | config: [MinSizeRel]
111 | simulator: ['', Simulator]
112 | exclude:
113 | - os: macCatalyst
114 | simulator: Simulator
115 | steps:
116 | - uses: actions/checkout@v4
117 | - name: Checkout source
118 | uses: actions/checkout@v4
119 | with:
120 | repository: ${{ github.repository_owner }}/mdk
121 | path: mdk
122 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
123 | fetch-depth: 1
124 | token: ${{ secrets.CLONE_PAT }}
125 | submodules: 'recursive'
126 | - name: Setup Xcode
127 | run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
128 | - name: 'Restore External Dep cache'
129 | id: external-dep-cache
130 | uses: actions/cache@v4
131 | with:
132 | path: |
133 | ./mdk/external
134 | !./mdk/external/lib/macOS/libvulkan.tbd
135 | !./mdk/external/lib/libdav1d.tbd
136 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
137 | # why may failed to cache/restore /usr/local/bin/sshpass?
138 | # no build cache because build dir content changes but key should not, then no cache save.
139 | - name: Create Build Environment
140 | shell: bash
141 | env:
142 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
143 | working-directory: mdk
144 | run: ../ci-before-build.sh
145 | - name: Configure CMake
146 | if: ${{ matrix.os != 'macCatalyst' }}
147 | shell: bash
148 | working-directory: mdk
149 | run: |
150 | minver=8.0
151 | [[ "$TARGET_OS" == "tv"* ]] && minver=10.2 # VT: 10.2+
152 | [[ "$TARGET_OS" == "vision"* ]] && minver=1.0
153 | archs=arm64
154 | [[ "$TARGET_OS" == *"Simulator" ]] && {
155 | archs="arm64;x86_64"
156 | sdk=$TARGET_OS
157 | sdk=${sdk/iOSS/iphones}
158 | sdk=${sdk/tvOSS/appletvs}
159 | sdk=${sdk/visionOSS/xrs}
160 | sdk=${sdk/xrOSS/xrs}
161 | EXTRA_OPTS="-DCMAKE_OSX_SYSROOT=${sdk}"
162 | }
163 | [ ${{ matrix.os }} == visionOS ] && archs=arm64
164 | cmake -GNinja -DFFMPEG_EMBED=1 -DMIN_SIZE=1 -DUSE_LTO=1 -DWITH_DEB_INFO=1 -DCMAKE_SYSTEM_NAME=${{ matrix.os }} $EXTRA_OPTS -DCMAKE_OSX_DEPLOYMENT_TARGET=$minver -DCMAKE_OSX_ARCHITECTURES="$archs" -Bbuild/${TARGET_OS} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_IOS_INSTALL_COMBINED=YES -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO # FFMPEG_EMBED=0 to copy libffmpeg.5.dylib
165 | - name: Configure CMake
166 | if: ${{ matrix.os == 'macCatalyst' }}
167 | shell: bash
168 | working-directory: mdk
169 | run: cmake -GNinja -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/macCatalyst.cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -Bbuild/${TARGET_OS} -DCMAKE_VERBOSE_MAKEFILE=1 -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk
170 | - name: Build
171 | shell: bash
172 | working-directory: mdk
173 | run: cmake --build build/${TARGET_OS} --parallel
174 | - name: Make SDK
175 | shell: bash
176 | working-directory: mdk
177 | run: |
178 | ../ci-after-build.sh
179 | mv mdk-sdk*.tar.xz ..
180 | - name: Archieve SDK
181 | uses: actions/upload-artifact@v4
182 | with:
183 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
184 | path: mdk-sdk-${{ env.TARGET_OS }}.tar.xz
185 | - name: Upload to SourceForge
186 | if: ${{ env.SF_UPLOAD == 'true' && matrix.os == 'macCatalyst' }}
187 | shell: bash
188 | run: sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
189 |
190 | Apple:
191 | runs-on: macos-15
192 | needs: [macOS, iOS]
193 | steps:
194 | - name: Setup Xcode
195 | run: sudo xcode-select -s /Applications/Xcode_${{ vars.XCODE }}.app
196 | - uses: actions/checkout@v4
197 | - name: Download macOS x64 sdk
198 | uses: actions/download-artifact@v4
199 | with:
200 | name: mdk-sdk-macOS-x86_64-MinSizeRel
201 | - name: Download macOS arm64 sdk
202 | uses: actions/download-artifact@v4
203 | with:
204 | name: mdk-sdk-macOS-arm64-MinSizeRel
205 | - name: Download iOS sdk
206 | uses: actions/download-artifact@v4
207 | with:
208 | name: mdk-sdk-iOS-MinSizeRel
209 | - name: Download iOSSimulator sdk
210 | uses: actions/download-artifact@v4
211 | with:
212 | name: mdk-sdk-iOSSimulator-MinSizeRel
213 | - name: Download tvOS sdk
214 | uses: actions/download-artifact@v4
215 | with:
216 | name: mdk-sdk-tvOS-MinSizeRel
217 | - name: Download tvOSSimulator sdk
218 | uses: actions/download-artifact@v4
219 | with:
220 | name: mdk-sdk-tvOSSimulator-MinSizeRel
221 | - name: Download visionOS sdk
222 | uses: actions/download-artifact@v4
223 | with:
224 | name: mdk-sdk-visionOS-MinSizeRel
225 | - name: Download visionOSSimulator sdk
226 | uses: actions/download-artifact@v4
227 | with:
228 | name: mdk-sdk-visionOSSimulator-MinSizeRel
229 | - name: Download macCatalyst sdk
230 | uses: actions/download-artifact@v4
231 | with:
232 | name: mdk-sdk-macCatalyst-MinSizeRel
233 | - name: Install tools
234 | shell: bash
235 | run: brew install sshpass
236 | - name: make XCFramework and SDK
237 | shell: bash
238 | run: |
239 | export XZ_OPT="-9e -T0"
240 | mkdir -p macOS iOS iOSSimulator tvOS tvOSSimulator visionOS visionOSSimulator macCatalyst mdk-sdk/{Frameworks,include,lib} macOS-arm64 macOS-x86_64
241 | tar Jxf mdk-sdk-macOS-x86_64.tar.xz -C macOS-x86_64
242 | tar Jxf mdk-sdk-macOS-arm64.tar.xz -C macOS-arm64
243 | tar Jxf mdk-sdk-iOS.tar.xz -C iOS
244 | tar Jxf mdk-sdk-iOSSimulator.tar.xz -C iOSSimulator
245 | tar Jxf mdk-sdk-tvOS.tar.xz -C tvOS
246 | tar Jxf mdk-sdk-tvOSSimulator.tar.xz -C tvOSSimulator
247 | tar Jxf mdk-sdk-visionOS.tar.xz -C visionOS
248 | tar Jxf mdk-sdk-visionOSSimulator.tar.xz -C visionOSSimulator
249 | tar Jxf mdk-sdk-macCatalyst.tar.xz -C macCatalyst
250 | find .
251 | cp -af macOS-$(uname -m)/mdk-sdk macOS/ # libffmpeg is already fat
252 | lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/mdk -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/mdk
253 | lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework.dSYM/Contents/Resources/DWARF/mdk -output macOS/mdk-sdk/lib/mdk.framework.dSYM/Contents/Resources/DWARF/mdk
254 | if [ -f macOS-arm64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib -a -f macOS-x86_64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib ]; then
255 | lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-braw.dylib
256 | fi
257 | if [ -f macOS-arm64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib -a -f macOS-x86_64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib ]; then
258 | lipo -create macOS-{arm,x86_}64/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib -output macOS/mdk-sdk/lib/mdk.framework/Versions/Current/libmdk-r3d.dylib
259 | fi
260 | for b in `ls macOS-arm64/mdk-sdk/bin`; do # exes exist in both archs
261 | if [ -f macOS-x86_64/mdk-sdk/bin/$b ]; then
262 | lipo -create macOS-{arm,x86_}64/mdk-sdk/bin/$b -output macOS/mdk-sdk/bin/$b
263 | fi
264 | done
265 | codesign --force --sign - --deep --timestamp macOS/mdk-sdk/lib/mdk.framework
266 |
267 | libffmpeg=$(find macCatalyst/mdk-sdk/lib/mdk.framework -name "libffmpeg*.dylib")
268 | # xcrun bitcode_strip -r $libffmpeg -o $libffmpeg
269 | # xcrun bitcode_strip -r macCatalyst/mdk-sdk/lib/mdk.framework/mdk -o macCatalyst/mdk-sdk/lib/mdk.framework/Versions/Current/mdk
270 |
271 | cp -af macOS/mdk-sdk/{bin,doc,*.sh} mdk-sdk
272 | cp -af macOS/mdk-sdk/README.md mdk-sdk/README-macOS.md
273 | cp -af macOS/mdk-sdk/lib/cmake mdk-sdk/lib/
274 | cp -af iOS/mdk-sdk/README.md mdk-sdk/README-iOS.md
275 | # https://developer.apple.com/forums/thread/655768 (error: the path does not point to a valid debug symbols file: macOS/mdk-sdk/lib/mdk.framework.dSYM)
276 | xcodebuild -create-xcframework -framework macOS/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/macOS/mdk-sdk/lib/mdk.framework.dSYM -framework iOS/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/iOS/mdk-sdk/lib/mdk.framework.dSYM -framework iOSSimulator/mdk-sdk/lib/mdk.framework -framework tvOS/mdk-sdk/lib/mdk.framework -framework tvOSSimulator/mdk-sdk/lib/mdk.framework -framework visionOS/mdk-sdk/lib/mdk.framework -framework visionOSSimulator/mdk-sdk/lib/mdk.framework -framework macCatalyst/mdk-sdk/lib/mdk.framework -output mdk-sdk/lib/mdk.xcframework
277 | mdkfw=`find mdk-sdk/lib/mdk.xcframework -name "macos-*" -depth 1`
278 | # ensure bin/* can Find mdk and ffmpeg
279 | ln -sf ${mdkfw/mdk-sdk/..}/mdk.framework mdk-sdk/Frameworks
280 | ln -sf ../Frameworks/mdk.framework/Headers mdk-sdk/include/mdk
281 | codesign --force --sign - --deep --timestamp mdk-sdk/lib/mdk.xcframework
282 | # pod requires a file in tarball
283 | gtar Jcvf mdk-sdk-apple.tar.xz mdk-sdk README.md
284 | gtar Jcvf mdk-sdk-macOS.tar.xz -C macOS .
285 | 7z a mdk-sdk-apple.zip mdk-sdk
286 |
287 | for OS in iOS tvOS visionOS; do
288 | rm -rf mdk-sdk/{bin,Frameworks,include} mdk-sdk/lib/mdk.*
289 | xcodebuild -create-xcframework -framework ${OS}/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/${OS}/mdk-sdk/lib/mdk.framework.dSYM -framework ${OS}Simulator/mdk-sdk/lib/mdk.framework -debug-symbols $PWD/${OS}Simulator/mdk-sdk/lib/mdk.framework.dSYM -output mdk-sdk/lib/mdk.xcframework
290 | gtar Jcvf mdk-sdk-${OS}.tar.xz mdk-sdk
291 | done
292 |
293 | swift package compute-checksum mdk-sdk-apple.zip
294 | - name: Archieve XCFramework SDK
295 | uses: actions/upload-artifact@v4
296 | with:
297 | name: mdk-sdk-apple
298 | path: mdk-sdk-apple.tar.xz
299 | - name: Archieve XCFramework SDK zip
300 | uses: actions/upload-artifact@v4
301 | with:
302 | name: mdk-sdk-apple-zip
303 | path: mdk-sdk-apple.zip
304 | - name: Archieve macOS SDK
305 | uses: actions/upload-artifact@v4
306 | with:
307 | name: mdk-sdk-macOS
308 | path: mdk-sdk-macOS.tar.xz
309 | - name: Archieve iOS SDK
310 | uses: actions/upload-artifact@v4
311 | with:
312 | name: mdk-sdk-iOS
313 | path: mdk-sdk-iOS.tar.xz
314 | - name: Archieve tvOS SDK
315 | uses: actions/upload-artifact@v4
316 | with:
317 | name: mdk-sdk-tvOS
318 | path: mdk-sdk-tvOS.tar.xz
319 | - name: Archieve visionOS SDK
320 | uses: actions/upload-artifact@v4
321 | with:
322 | name: mdk-sdk-visionOS
323 | path: mdk-sdk-visionOS.tar.xz
324 | - name: Upload to SourceForge
325 | if: ${{ env.SF_UPLOAD == 'true' }}
326 | shell: bash
327 | run: |
328 | make -f upload.mk
329 |
330 |
331 | Windows:
332 | runs-on: windows-latest
333 | env:
334 | TARGET_OS: windows-desktop
335 | strategy:
336 | fail-fast: false
337 | matrix:
338 | config: [RelWithDebInfo]
339 | steps:
340 | - uses: actions/checkout@v4
341 | - name: Checkout source
342 | uses: actions/checkout@v4
343 | with:
344 | repository: ${{ github.repository_owner }}/mdk
345 | path: mdk
346 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
347 | fetch-depth: 1
348 | token: ${{ secrets.CLONE_PAT }}
349 | submodules: 'recursive'
350 | - name: 'Restore External Dep cache'
351 | id: external-dep-cache
352 | uses: actions/cache@v4
353 | with:
354 | path: ./mdk/external
355 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
356 | - name: Create Build Environment
357 | shell: bash
358 | env:
359 | SYSROOT_CACHE_HIT: true
360 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
361 | working-directory: mdk
362 | run: ../ci-before-build.sh
363 | - uses: seanmiddleditch/gha-setup-ninja@master
364 | - uses: ilammy/msvc-dev-cmd@v1
365 | with:
366 | arch: amd64_arm64
367 | - name: Configure for win arm64
368 | env:
369 | ARCH: arm64
370 | working-directory: mdk
371 | run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
372 | - name: Build for win arm64
373 | working-directory: mdk
374 | run: cmake --build build/${{ env.TARGET_OS }}-arm64
375 | - uses: ilammy/msvc-dev-cmd@v1
376 | with:
377 | arch: amd64_x86
378 | - name: Configure for win x86
379 | env:
380 | ARCH: x86
381 | R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
382 | working-directory: mdk
383 | run: cmake -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
384 | - name: Build for win x86
385 | working-directory: mdk
386 | run: cmake --build build/${{ env.TARGET_OS }}-x86
387 | - uses: ilammy/msvc-dev-cmd@v1
388 | with:
389 | arch: x64
390 | - name: Get nvJPEG2000 SDK
391 | shell: bash
392 | run: |
393 | curl -kL -o nvjpeg2000.zip https://github.com/user-attachments/files/17663661/nvjpeg2000.zip
394 | 7z x -y -p${{ env.NVJP2K_SDK_PW }} nvjpeg2000.zip
395 | curl -kL -o cuda.zip https://github.com/user-attachments/files/17663668/cuda.zip
396 | 7z x -y -p${{ env.CUDA_SDK_PW }} cuda.zip
397 | - name: Configure for win x64
398 | env:
399 | ARCH: x64
400 | R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
401 | working-directory: mdk
402 | run: cmake -DR3DSDK=${{ env.R3DSDK }} -DNVJP2K=1 -DCUDA_SDK_DIR=${{ github.workspace }}/cuda -DNVJPEG2K_PATH=${{ github.workspace }}/nvjpeg2000 -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
403 | - name: Build for win x64
404 | working-directory: mdk
405 | run: cmake --build build/${{ env.TARGET_OS }}-x64
406 | - name: Make SDK
407 | shell: bash
408 | working-directory: mdk
409 | run: |
410 | ../ci-after-build.sh
411 | mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
412 | rm -rf mdk-sdk/bin/{x86,arm*}
413 | 7z a -ssc -m0=lzma2 -mx=9 -ms=on -mf=off ../mdk-sdk-${{ env.TARGET_OS }}-vs2022-x64.7z mdk-sdk
414 | - name: Archieve SDK
415 | uses: actions/upload-artifact@v4
416 | with:
417 | name: mdk-sdk-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
418 | path: mdk-sdk-${{ env.TARGET_OS }}-vs2022*.7z
419 | # - name: Upload to SourceForge
420 | # if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
421 | # uses: garygrossgarten/github-action-scp@release
422 | # with:
423 | # host: 'frs.sourceforge.net'
424 | # username: ${{ secrets.SF_USER }}
425 | # password: ${{ secrets.SF_PW }}
426 | # local: mdk-sdk-${{ env.TARGET_OS }}-vs2022.7z
427 | # remote: '/home/frs/project/mdk-sdk/nightly/'
428 |
429 |
430 | Win64_SRC:
431 | if: false
432 | runs-on: windows-latest
433 | env:
434 | TARGET_OS: windows-desktop
435 | ARCH: x64
436 | strategy:
437 | fail-fast: false
438 | matrix:
439 | config: [Debug]
440 | steps:
441 | - uses: actions/checkout@v4
442 | - name: Checkout source
443 | uses: actions/checkout@v4
444 | with:
445 | repository: ${{ github.repository_owner }}/mdk
446 | path: mdk
447 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
448 | fetch-depth: 1
449 | token: ${{ secrets.CLONE_PAT }}
450 | submodules: 'recursive'
451 | - name: 'Restore External Dep cache'
452 | id: external-dep-cache
453 | uses: actions/cache@v4
454 | with:
455 | path: ./mdk/external
456 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
457 | - name: Create Build Environment
458 | shell: bash
459 | env:
460 | SYSROOT_CACHE_HIT: true
461 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
462 | working-directory: mdk
463 | run: ../ci-before-build.sh
464 | - uses: seanmiddleditch/gha-setup-ninja@master
465 | - uses: ilammy/msvc-dev-cmd@v1
466 | with:
467 | arch: x64
468 | - name: Configure for win x64
469 | env:
470 | R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
471 | working-directory: mdk
472 | run: cmake -DSOURCE_MODULES=core -DR3DSDK=${{ env.R3DSDK }} -DUSE_LTO=0 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
473 | - name: Build for win x64
474 | working-directory: mdk
475 | run: cmake --build build/${{ env.TARGET_OS }}-x64
476 | - name: Install for win x64
477 | working-directory: mdk
478 | run: cmake --install build/${{ env.TARGET_OS }}-x64
479 | - name: Make SRC SDK
480 | shell: bash
481 | working-directory: mdk
482 | run: |
483 | chmod +x ../mksrc.sh
484 | ../mksrc.sh $PWD mdk-sdk-${{ env.ARCH }}
485 | cp -avf ../CMakeLists.txt mdk-sdk-${{ env.ARCH }}
486 | if [[ ${{ matrix.config }} == Debug ]]; then
487 | CRT_SUFFIX=d
488 | fi
489 | cp -avf external/lib/windows/${{ env.ARCH }}/MD$CRT_SUFFIX/{vpl,snappy}.lib mdk-sdk-${{ env.ARCH }}/lib
490 | date +%m%d
491 | 7z a -p${{ secrets.SRC_USER }}`date +%m%d` -mhe ../mdk-src-${{ env.TARGET_OS }}-vs2022.7z mdk-sdk-${{ env.ARCH }}
492 | - name: Archieve SDK
493 | uses: actions/upload-artifact@v4
494 | with:
495 | name: mdk-src-vs2022-${{ env.TARGET_OS }}-${{ matrix.config }}
496 | path: mdk-src-${{ env.TARGET_OS }}-vs2022.7z
497 |
498 |
499 | Windows_LTL:
500 | runs-on: windows-latest
501 | env:
502 | TARGET_OS: windows-desktop
503 | CRT_EXTRA: LTL
504 | strategy:
505 | fail-fast: false
506 | matrix:
507 | config: [RelWithDebInfo]
508 | steps:
509 | - uses: actions/checkout@v4
510 | - name: Checkout source
511 | uses: actions/checkout@v4
512 | with:
513 | repository: ${{ github.repository_owner }}/mdk
514 | path: mdk
515 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
516 | fetch-depth: 1
517 | token: ${{ secrets.CLONE_PAT }}
518 | submodules: 'recursive'
519 | - name: 'Restore External Dep cache'
520 | id: external-dep-cache
521 | uses: actions/cache@v4
522 | with:
523 | path: ./mdk/external
524 | key: external-dep-${{ env.TARGET_OS }}-${{ env.CRT_EXTRA }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
525 | - name: 'Restore VC-LTL cache'
526 | id: ltl-cache
527 | uses: actions/cache@v4
528 | with:
529 | path: ./mdk/cmake/VC-LTL
530 | key: ltl-${{ vars.VC_LTL_VER }}
531 | - if: ${{ steps.ltl-cache.outputs.cache-hit != 'true' }}
532 | name: Get VC-LTL
533 | shell: bash
534 | working-directory: mdk/cmake
535 | run: |
536 | curl -kL -o ltl.7z https://github.com/Chuyu-Team/VC-LTL5/releases/download/v${VC_LTL_VER}/VC-LTL-Binary.7z
537 | 7z x ltl.7z -oVC-LTL
538 | - name: Create Build Environment
539 | shell: bash
540 | env:
541 | SYSROOT_CACHE_HIT: true
542 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
543 | working-directory: mdk
544 | run: ../ci-before-build.sh
545 | - uses: seanmiddleditch/gha-setup-ninja@master
546 | - uses: ilammy/msvc-dev-cmd@v1
547 | with:
548 | arch: amd64_x86
549 | - name: Configure for win x86
550 | env:
551 | ARCH: x86
552 | R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
553 | working-directory: mdk
554 | run: cmake -DVC_LTL=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
555 | - name: Build for win x86
556 | working-directory: mdk
557 | run: cmake --build build/${{ env.TARGET_OS }}-x86
558 | - uses: ilammy/msvc-dev-cmd@v1
559 | with:
560 | arch: x64
561 | - name: Configure for win x64
562 | env:
563 | ARCH: x64
564 | R3DSDK: ${{ github.workspace }}/mdk/external/R3DSDK
565 | working-directory: mdk
566 | run: cmake -DVC_LTL=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DR3DSDK=${{ env.R3DSDK }} -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -DCMAKE_SYSTEM_VERSION="6.0" -GNinja -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
567 | - name: Build for win x64
568 | working-directory: mdk
569 | run: cmake --build build/${{ env.TARGET_OS }}-x64
570 | - name: Make SDK
571 | shell: bash
572 | working-directory: mdk
573 | run: |
574 | ../ci-after-build.sh
575 | mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-vs2022-ltl.7z
576 | - name: Archieve SDK
577 | uses: actions/upload-artifact@v4
578 | with:
579 | name: mdk-sdk-vs2022-ltl-${{ env.TARGET_OS }}-${{ matrix.config }}
580 | path: mdk-sdk-${{ env.TARGET_OS }}-vs2022-ltl.7z
581 |
582 |
583 | UWP:
584 | runs-on: windows-latest
585 | env:
586 | TARGET_OS: uwp
587 | strategy:
588 | fail-fast: false
589 | matrix:
590 | config: [RelWithDebInfo]
591 | steps:
592 | - uses: actions/checkout@v4
593 | - name: Checkout source
594 | uses: actions/checkout@v4
595 | with:
596 | repository: ${{ github.repository_owner }}/mdk
597 | path: mdk
598 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
599 | fetch-depth: 1
600 | token: ${{ secrets.CLONE_PAT }}
601 | submodules: 'recursive'
602 | - name: 'Restore External Dep cache'
603 | id: external-dep-cache
604 | uses: actions/cache@v4
605 | with:
606 | path: ./mdk/external
607 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
608 | - name: Create Build Environment
609 | shell: bash
610 | env:
611 | SYSROOT_CACHE_HIT: true
612 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
613 | working-directory: mdk
614 | run: ../ci-before-build.sh
615 | - uses: seanmiddleditch/gha-setup-ninja@master
616 | - uses: ilammy/msvc-dev-cmd@v1
617 | with:
618 | arch: amd64_arm64
619 | uwp: true
620 | - name: Configure for uwp arm64
621 | env:
622 | ARCH: arm64
623 | working-directory: mdk
624 | run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
625 | - name: Build for win arm64
626 | working-directory: mdk
627 | run: cmake --build build/${{ env.TARGET_OS }}-arm64
628 | - uses: ilammy/msvc-dev-cmd@v1
629 | with:
630 | arch: x64
631 | uwp: true
632 | - name: Configure for uwp x64
633 | env:
634 | ARCH: x64
635 | working-directory: mdk
636 | run: cmake -DMIN_SIZE=1 -DUSE_LTO=1 -DCMAKE_SYSTEM_PROCESSOR=${{ env.ARCH }} -GNinja -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -Bbuild/${{ env.TARGET_OS }}-${{ env.ARCH }} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=mdk-sdk-${{ env.ARCH }} -DCMAKE_VERBOSE_MAKEFILE=1 .
637 | - name: Build for win x64
638 | working-directory: mdk
639 | run: cmake --build build/${{ env.TARGET_OS }}-x64
640 | - name: Make SDK
641 | shell: bash
642 | working-directory: mdk
643 | run: |
644 | ../ci-after-build.sh
645 | mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}.7z
646 | - name: Archieve SDK
647 | uses: actions/upload-artifact@v4
648 | with:
649 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
650 | path: mdk-sdk-${{ env.TARGET_OS }}.7z
651 |
652 |
653 | ClangCL:
654 | runs-on: ubuntu-latest
655 | env:
656 | TARGET_OS: ${{ matrix.os }}
657 | VCDIR: '/tmp/winsysroot/msvcrt-dev'
658 | WINDOWSSDKDIR: '/tmp/winsysroot/winsdk'
659 | strategy:
660 | fail-fast: false
661 | matrix:
662 | os: [windows-desktop]
663 | config: [MinSizeRel]
664 | steps:
665 | - uses: actions/checkout@v4
666 | - name: Checkout source
667 | uses: actions/checkout@v4
668 | with:
669 | repository: ${{ github.repository_owner }}/mdk
670 | path: mdk
671 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
672 | fetch-depth: 1
673 | token: ${{ secrets.CLONE_PAT }}
674 | submodules: 'recursive'
675 | - name: 'Restore External Dep cache'
676 | id: external-dep-cache
677 | uses: actions/cache@v4
678 | with:
679 | path: ./mdk/external
680 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
681 | - name: 'Restore sysroot cache'
682 | id: sysroot-cache
683 | uses: actions/cache@v4
684 | with:
685 | path: /tmp/winsysroot
686 | key: sysroot-${{ env.TARGET_OS }}${{ vars.WINSDKVER }}-vc${{ vars.VCVER }}
687 | - name: Create Build Environment
688 | shell: bash
689 | env:
690 | SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
691 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
692 | working-directory: mdk
693 | run: ../ci-before-build.sh
694 | - name: Configure for win arm64
695 | env:
696 | ARCH: arm64
697 | working-directory: mdk
698 | run: |
699 | export WindowsSdkDir=${WINDOWSSDKDIR}
700 | export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
701 | cmake -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
702 | - name: Build for arm64
703 | working-directory: mdk
704 | run: cmake --build build/${TARGET_OS}-arm64
705 | - name: Configure for win x86
706 | env:
707 | ARCH: x86
708 | working-directory: mdk
709 | run: |
710 | export WindowsSdkDir=${WINDOWSSDKDIR}
711 | export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
712 | cmake -DUSE_QSV=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
713 | - name: Build for x86
714 | working-directory: mdk
715 | run: cmake --build build/${TARGET_OS}-x86
716 | - name: Configure for win x64
717 | env:
718 | ARCH: x64
719 | working-directory: mdk
720 | run: |
721 | export WindowsSdkDir=${WINDOWSSDKDIR}
722 | export WindowsSDKVersion=$(cat ${WINDOWSSDKDIR}/.version)
723 | cmake -DUSE_QSV=0 -DR3DSDK=$PWD/external/R3DSDK -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/windows.clang.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
724 | - name: Build for x64
725 | working-directory: mdk
726 | run: cmake --build build/${TARGET_OS}-x64
727 | - name: Make SDK
728 | working-directory: mdk
729 | run: |
730 | ../ci-after-build.sh
731 | if [ -f $VCDIR/bin/x64/vcruntime140_1.dll ]; then
732 | mkdir -p mdk-sdk/bin/x64
733 | cp $VCDIR/bin/x64/vcruntime140_1.dll mdk-sdk/bin/x64
734 | 7z a mdk-sdk-*.7z mdk-sdk/bin/x64/vcruntime140_1.dll
735 | fi
736 | mv mdk-sdk-*.7z ../mdk-sdk-${{ env.TARGET_OS }}-clang.7z
737 | - name: Archieve SDK
738 | uses: actions/upload-artifact@v4
739 | with:
740 | name: mdk-sdk-clang-${{ env.TARGET_OS }}-${{ matrix.config }}
741 | path: mdk-sdk-${{ env.TARGET_OS }}-clang.7z
742 | - name: Upload to SourceForge
743 | if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
744 | run: sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-clang.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
745 |
746 | NuGet:
747 | runs-on: macos-latest
748 | needs: [Windows, UWP, Windows_LTL]
749 | steps:
750 | - uses: actions/checkout@v4
751 | - name: Download win32 vs2022 sdk
752 | uses: actions/download-artifact@v4
753 | with:
754 | name: mdk-sdk-vs2022-windows-desktop-RelWithDebInfo
755 | - name: Download win32 vs2022 ltl sdk
756 | uses: actions/download-artifact@v4
757 | with:
758 | name: mdk-sdk-vs2022-ltl-windows-desktop-RelWithDebInfo
759 | - name: Download uwp sdk
760 | uses: actions/download-artifact@v4
761 | with:
762 | name: mdk-sdk-uwp-RelWithDebInfo
763 | - name: update build version
764 | shell: bash
765 | run: sed -i .bak "s,\(.*\.\)[0-9]*\(\),\1${GITHUB_RUN_NUMBER}\2," nuget/mdk.nuspec
766 | - name: install tools
767 | run: brew install sshpass nuget 7zip md5sha1sum
768 | - name: Make nupkg (VS2022)
769 | run: |
770 | rm -rf mdk-sdk uwp
771 | md5sum mdk-sdk-windows-desktop-vs2022.7z | cut -d ' ' -f1 > mdk-sdk-windows-desktop-vs2022.7z.md5
772 | md5sum mdk-sdk-windows-desktop-vs2022-x64.7z | cut -d ' ' -f1 > mdk-sdk-windows-desktop-vs2022-x64.7z.md5
773 | 7z x mdk-sdk-windows-desktop-vs2022.7z
774 | 7z x mdk-sdk-uwp.7z -o"uwp"
775 | mkdir mdk-sdk/bin/UAP
776 | cp -af uwp/mdk-sdk/bin/* mdk-sdk/bin/UAP
777 | cp nuget/mdk.nuspec mdk-sdk
778 | cp -avf nuget/README.md mdk-sdk
779 | cd mdk-sdk
780 | nuget pack mdk.nuspec
781 | mv *.nupkg ../mdk-vs2022.nupkg
782 | - name: Archieve SDK
783 | uses: actions/upload-artifact@v4
784 | with:
785 | name: mdk-nuget
786 | path: 'mdk*.nupkg'
787 | - name: Upload to SourceForge
788 | if: ${{ env.SF_UPLOAD == 'true' }}
789 | shell: bash
790 | run: make -f upload.mk
791 |
792 | Linux:
793 | runs-on: ubuntu-latest
794 | env:
795 | TARGET_OS: linux
796 | LTO_SUFFIX: -lto
797 | strategy:
798 | fail-fast: false
799 | matrix:
800 | config: [MinSizeRel]
801 | steps:
802 | - uses: actions/checkout@v4
803 | - name: Checkout source
804 | uses: actions/checkout@v4
805 | with:
806 | repository: ${{ github.repository_owner }}/mdk
807 | path: mdk
808 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
809 | fetch-depth: 1
810 | token: ${{ secrets.CLONE_PAT }}
811 | submodules: 'recursive'
812 | - name: 'Restore External Dep cache'
813 | id: external-dep-cache
814 | uses: actions/cache@v4
815 | with:
816 | path: ./mdk/external
817 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
818 | - name: 'Restore sysroot cache'
819 | id: sysroot-cache
820 | uses: actions/cache@v4
821 | with:
822 | path: ./mdk/sysroot
823 | key: sysroot-${{ env.TARGET_OS }}-${{ vars.LINUX_SYSROOT_ID }}
824 | - name: Create Build Environment
825 | shell: bash
826 | env:
827 | SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
828 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
829 | working-directory: mdk
830 | run: |
831 | sudo apt remove -y libc++1-14 libc++abi1-14 libunwind-14 python3-lldb-14 # conflict with latest llvm
832 | ../ci-before-build.sh
833 | - name: Configure for x64
834 | env:
835 | ARCH: amd64
836 | shell: bash
837 | working-directory: mdk
838 | run: cmake -DR3DSDK=$PWD/external/R3DSDK -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
839 | - name: Build for x64
840 | shell: bash
841 | working-directory: mdk
842 | run: cmake --build build/${TARGET_OS}-amd64
843 | - name: Configure for aarch64
844 | env:
845 | ARCH: arm64
846 | shell: bash
847 | working-directory: mdk
848 | run: cmake -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
849 | - name: Build for aarch64
850 | shell: bash
851 | working-directory: mdk
852 | run: cmake --build build/${TARGET_OS}-arm64
853 | - name: Configure for armhf
854 | env:
855 | ARCH: armhf
856 | shell: bash
857 | working-directory: mdk
858 | run: cmake -DGLVA_STATIC_CXX=OFF -DUSE_LTO=1 -DUSE_LIBCXX=1 -DCMAKE_SYSTEM_PROCESSOR=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$PWD/cmake/tools/${TARGET_OS/r*pi/rpi}.clang.cmake -DLINUX_SYSROOT=$PWD/sysroot -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
859 | - name: Build for armhf
860 | shell: bash
861 | working-directory: mdk
862 | run: cmake --build build/${TARGET_OS}-armhf
863 | - name: Make SDK
864 | shell: bash
865 | working-directory: mdk
866 | run: |
867 | ../ci-after-build.sh
868 | mv mdk-sdk*.tar.xz ..
869 | rm -rf mdk-sdk/{bin,lib}/arm*
870 | tar Jcvf ../mdk-sdk-${{ env.TARGET_OS }}-x64.tar.xz mdk-sdk
871 | - name: Archieve SDK
872 | uses: actions/upload-artifact@v4
873 | with:
874 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
875 | path: mdk-sdk-${{ env.TARGET_OS }}*.tar.xz
876 | - name: Upload to SourceForge
877 | if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
878 | shell: bash
879 | run: |
880 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
881 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}-x64.tar.xz ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
882 | md5sum mdk-sdk-${TARGET_OS}.tar.xz | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}.tar.xz.md5
883 | md5sum mdk-sdk-${TARGET_OS}-x64.tar.xz | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}-x64.tar.xz.md5
884 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-*.md5 ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
885 |
886 | Android:
887 | runs-on: ubuntu-latest # ndk 25 removed
888 | env:
889 | #FF_VER: 6.1 # 7.0 and master is very slow in avformat_find_stream_info
890 | TARGET_OS: android
891 | LTO_SUFFIX: -lto
892 | MIN_API: 21
893 | NDK_32: r25c
894 | strategy:
895 | fail-fast: false
896 | matrix:
897 | config: [MinSizeRel] # https://github.com/android/ndk/issues/721
898 | steps:
899 | - uses: actions/checkout@v4
900 | - name: Checkout source
901 | uses: actions/checkout@v4
902 | with:
903 | repository: ${{ github.repository_owner }}/mdk
904 | path: mdk
905 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
906 | fetch-depth: 1
907 | token: ${{ secrets.CLONE_PAT }}
908 | submodules: 'recursive'
909 | - name: 'Restore External Dep cache'
910 | id: external-dep-cache
911 | uses: actions/cache@v4
912 | with:
913 | path: ./mdk/external
914 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
915 | - name: Create Build Environment
916 | shell: bash
917 | env:
918 | # SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
919 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
920 | working-directory: mdk
921 | run: ../ci-before-build.sh
922 | - name: Configure for arm64-v8a
923 | env:
924 | ARCH: arm64-v8a
925 | shell: bash
926 | working-directory: mdk
927 | run: |
928 | ls ${ANDROID_HOME}/ndk
929 | MIN_API_64=21
930 | [ $MIN_API -gt 21 ] && MIN_API_64=$MIN_API
931 | cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API_64} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
932 | - name: Build for arm64-v8a
933 | shell: bash
934 | working-directory: mdk
935 | run: cmake --build build/${TARGET_OS}-arm64-v8a
936 | - name: Configure for x86_64
937 | env:
938 | ARCH: x86_64
939 | shell: bash
940 | working-directory: mdk
941 | run: |
942 | MIN_API_64=21
943 | [ $MIN_API -gt 21 ] && MIN_API_64=$MIN_API
944 | cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API_64} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
945 | - name: Build for x86_64
946 | shell: bash
947 | working-directory: mdk
948 | run: cmake --build build/${TARGET_OS}-x86_64
949 | # - uses: nttld/setup-ndk@v1
950 | # id: setup-ndk
951 | # with:
952 | # ndk-version: ${{ env.NDK_32 }}
953 | # local-cache: false
954 | # - name: 'Restore ndk cache' # setup-ndk not fully cached
955 | # id: ndk-cache
956 | # uses: actions/cache@v4
957 | # with:
958 | # path: ${{ runner.tool_cache }}/ndk/${{ env.NDK_32 }} # /opt/hostedtoolcache
959 | # key: ndk-cache-${{ runner.os }}-${{ env.NDK_32 }}
960 | - name: Configure for armeabi-v7a
961 | env:
962 | ARCH: armeabi-v7a
963 | MIN_API: 21 # 19: android 4.4. ndk25
964 | # ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
965 | shell: bash
966 | working-directory: mdk
967 | run: cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
968 | - name: Build for armeabi-v7a
969 | shell: bash
970 | working-directory: mdk
971 | run: cmake --build build/${TARGET_OS}-armeabi-v7a
972 | - name: Configure for x86
973 | env:
974 | ARCH: x86
975 | MIN_API: 21 # 19: android 4.4. ndk25
976 | # ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
977 | shell: bash
978 | working-directory: mdk
979 | run: cmake -DUSE_LTO=1 -DANDROID_LD=lld -DANDROID_ABI=${ARCH} -DANDROID_PLATFORM=android-${MIN_API} -DANDROID_TOOLCHAIN=clang -DANDROID_STL=c++_shared -DANDROID_PIE=ON -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
980 | - name: Build for x86
981 | shell: bash
982 | working-directory: mdk
983 | run: cmake --build build/${TARGET_OS}-x86
984 | - name: Make SDK
985 | shell: bash
986 | working-directory: mdk
987 | run: |
988 | ../ci-after-build.sh
989 | mv mdk-sdk-*.7z ..
990 | - name: Archieve SDK
991 | uses: actions/upload-artifact@v4
992 | with:
993 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
994 | path: mdk-sdk-${{ env.TARGET_OS }}.7z
995 | - name: Upload to SourceForge
996 | if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
997 | shell: bash
998 | run: |
999 | 7z d -ssc -m0=lzma2 -mx=9 -ms=on -mf=off mdk-sdk-${TARGET_OS}.7z mdk-sdk/lib/{x86,x86_64}/libmdk.so.dsym
1000 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1001 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk/build/android-arm64-v8a/video/libqtav-mediacodec.so ${SF_USER}@frs.sourceforge.net:/home/frs/project/qtav/depends/mediacodec/arm64-v8a
1002 | md5sum mdk-sdk-${TARGET_OS}.7z | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}.7z.md5
1003 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-*.md5 ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1004 |
1005 | ohos:
1006 | runs-on: ubuntu-latest
1007 | env:
1008 | TARGET_OS: ohos
1009 | LTO_SUFFIX: -lto
1010 | strategy:
1011 | fail-fast: false
1012 | matrix:
1013 | config: [MinSizeRel]
1014 | steps:
1015 | - uses: actions/checkout@v4
1016 | - name: Checkout source
1017 | uses: actions/checkout@v4
1018 | with:
1019 | repository: ${{ github.repository_owner }}/mdk
1020 | path: mdk
1021 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
1022 | fetch-depth: 1
1023 | token: ${{ secrets.CLONE_PAT }}
1024 | submodules: 'recursive'
1025 | - name: Setup HarmonyOS CLI tools
1026 | uses: ErBWs/setup-ohos@v1
1027 | with:
1028 | version: latest
1029 | cache: true
1030 | - run: hvigorw -v
1031 | - name: 'Restore External Dep cache'
1032 | id: external-dep-cache
1033 | uses: actions/cache@v4
1034 | with:
1035 | path: ./mdk/external
1036 | key: external-dep-${{ env.TARGET_OS }}-ffmpeg-${{ env.FF_VER }}-${{ vars.FF_SDK_ID }}
1037 | - name: Create Build Environment
1038 | shell: bash
1039 | env:
1040 | # SYSROOT_CACHE_HIT: ${{ steps.sysroot-cache.outputs.cache-hit }}
1041 | EXTERNAL_DEP_CACHE_HIT: ${{ steps.external-dep-cache.outputs.cache-hit }}
1042 | working-directory: mdk
1043 | run: ../ci-before-build.sh
1044 | - name: Configure for arm64-v8a
1045 | env:
1046 | ARCH: arm64-v8a
1047 | shell: bash
1048 | working-directory: mdk
1049 | run: |
1050 | export OHOS_NDK=$OHOS_NDK_HOME/native
1051 | cmake -DUSE_LTO=1 -DOHOS_ARCH=${ARCH} -DCMAKE_TOOLCHAIN_FILE=$OHOS_NDK/build/cmake/ohos.toolchain.cmake -GNinja -H$PWD -B$PWD/build/${TARGET_OS}-${ARCH} -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_INSTALL_PREFIX=$PWD/mdk-sdk-${ARCH} -DCMAKE_VERBOSE_MAKEFILE=1
1052 | - name: Build for arm64-v8a
1053 | shell: bash
1054 | working-directory: mdk
1055 | run: cmake --build build/${TARGET_OS}-arm64-v8a
1056 | - name: Make SDK
1057 | shell: bash
1058 | working-directory: mdk
1059 | run: |
1060 | export OHOS_NDK=$OHOS_NDK_HOME/native
1061 | ../ci-after-build.sh
1062 | mv mdk-sdk-*.7z ..
1063 | - name: Archieve SDK
1064 | uses: actions/upload-artifact@v4
1065 | with:
1066 | name: mdk-sdk-${{ env.TARGET_OS }}-${{ matrix.config }}
1067 | path: mdk-sdk-${{ env.TARGET_OS }}.7z
1068 | - name: Upload to SourceForge
1069 | if: ${{ matrix.config == 'MinSizeRel' && env.SF_UPLOAD == 'true' }}
1070 | shell: bash
1071 | run: |
1072 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-sdk-${TARGET_OS}.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1073 | md5sum mdk-sdk-${TARGET_OS}.7z | cut -d ' ' -f1 > mdk-sdk-${TARGET_OS}.7z.md5
1074 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-*.md5 ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1075 |
1076 |
1077 | abi:
1078 | runs-on: ubuntu-latest
1079 | steps:
1080 | - uses: actions/checkout@v4
1081 | - name: Checkout source
1082 | uses: actions/checkout@v4
1083 | with:
1084 | repository: ${{ github.repository_owner }}/mdk
1085 | path: mdk
1086 | ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.ref || 'master' }}
1087 | fetch-depth: 1
1088 | token: ${{ secrets.CLONE_PAT }}
1089 | - name: Make SDK
1090 | shell: bash
1091 | run: |
1092 | mkdir -p mdk-sdk/include/abi/mdk
1093 | cp -avf mdk/include/mdk/{AudioFormat,AudioFrame,Buffer,ColorSpace,FrameReader,global,MediaInfo,Property,VideoBuffer,VideoFormat,VideoFrame,VideoDecoder,Packet,MediaIO}.h mdk-sdk/include/abi/mdk
1094 | - name: Archieve SDK
1095 | uses: actions/upload-artifact@v4
1096 | with:
1097 | name: mdk-abi-sdk
1098 | path: mdk-sdk/
1099 | - run: sudo apt install -y sshpass p7zip-full
1100 | - name: Upload to SourceForge
1101 | shell: bash
1102 | run: |
1103 | 7z a mdk-abi-sdk.7z mdk-sdk
1104 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no mdk-abi-sdk.7z ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1105 | cd mdk && git describe --always >.version
1106 | sshpass -p ${SF_PW} scp -o StrictHostKeyChecking=no .version ${SF_USER}@frs.sourceforge.net:/home/frs/project/mdk-sdk/nightly/
1107 |
1108 | - name: test
1109 | if: ${{ env.SF_UPLOAD == 'true' }}
1110 | run: echo bye
1111 |
1112 | # https://github.com/orgs/community/discussions/26323#discussioncomment-3251451
1113 | # https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow
1114 | # https://github.blog/changelog/2022-09-08-github-actions-use-github_token-with-workflow_dispatch-and-repository_dispatch/
1115 | Dispatch:
1116 | runs-on: ubuntu-latest
1117 | permissions: write-all
1118 | needs: [abi, NuGet, Apple, Linux, Android]
1119 | steps:
1120 | # - name: 'Trigger Workflow'
1121 | # uses: actions/github-script@v7
1122 | # with:
1123 | # script: |
1124 | # await github.rest.actions.createWorkflowDispatch({
1125 | # owner: '${{ github.repository_owner }}',
1126 | # repo: 'mdk-examples',
1127 | # workflow_id: 'workflows/main.yaml',
1128 | # ref: 'master',
1129 | # inputs: {
1130 | # run_id: ${{ github.run_id }}
1131 | # }
1132 | # });
1133 | - name: Dispatch
1134 | if: ${{ env.SF_UPLOAD == 'true' }}
1135 | run: |
1136 | gh workflow run main.yml --repo ${{ github.repository_owner }}/mdk-examples # -f run_id=${{ github.run_id }}
1137 | gh workflow run build.yml --repo ${{ github.repository_owner }}/SPV # -f run_id=${{ github.run_id }}
1138 | gh workflow run main.yml --repo ${{ github.repository_owner }}/mdk-braw -f run_id=${{ github.run_id }}
1139 | gh workflow run main.yml --repo ${{ github.repository_owner }}/mdk-nvjp2k -f run_id=${{ github.run_id }}
1140 | env:
1141 | GH_TOKEN: ${{ secrets.ACTION_PAT }} # GITHUB_TOKEN?
1142 |
1143 | Release:
1144 | runs-on: ubuntu-latest
1145 | if: startsWith(github.ref, 'refs/tags/')
1146 | needs: [Apple, NuGet, Linux, Android, ClangCL]
1147 | steps:
1148 | - name: Checkout
1149 | uses: actions/checkout@v4
1150 | - name: Download iOS sdk
1151 | uses: actions/download-artifact@v4
1152 | with:
1153 | name: mdk-sdk-iOS
1154 | - name: Download tvOS sdk
1155 | uses: actions/download-artifact@v4
1156 | with:
1157 | name: mdk-sdk-tvOS
1158 | - name: Download visionOS sdk
1159 | uses: actions/download-artifact@v4
1160 | with:
1161 | name: mdk-sdk-visionOS
1162 | - name: Download macCatalyst sdk
1163 | uses: actions/download-artifact@v4
1164 | with:
1165 | name: mdk-sdk-macCatalyst-MinSizeRel
1166 | - name: Download macOS sdk
1167 | uses: actions/download-artifact@v4
1168 | with:
1169 | name: mdk-sdk-macOS
1170 | - name: Download Apple sdk txz
1171 | uses: actions/download-artifact@v4
1172 | with:
1173 | name: mdk-sdk-apple
1174 | - name: Download Apple sdk zip
1175 | uses: actions/download-artifact@v4
1176 | with:
1177 | name: mdk-sdk-apple-zip
1178 | - name: Download win32 vs2022 sdk
1179 | uses: actions/download-artifact@v4
1180 | with:
1181 | name: mdk-sdk-vs2022-windows-desktop-RelWithDebInfo
1182 | - name: Download win32 vs2022 ltl sdk
1183 | uses: actions/download-artifact@v4
1184 | with:
1185 | name: mdk-sdk-vs2022-ltl-windows-desktop-RelWithDebInfo
1186 | - name: Download uwp sdk
1187 | uses: actions/download-artifact@v4
1188 | with:
1189 | name: mdk-sdk-uwp-RelWithDebInfo
1190 | - name: Download clang-cl sdk
1191 | uses: actions/download-artifact@v4
1192 | with:
1193 | name: mdk-sdk-clang-windows-desktop-MinSizeRel
1194 | - name: Download linux sdk
1195 | uses: actions/download-artifact@v4
1196 | with:
1197 | name: mdk-sdk-linux-MinSizeRel
1198 | - name: Download android sdk
1199 | uses: actions/download-artifact@v4
1200 | with:
1201 | name: mdk-sdk-android-MinSizeRel
1202 | - run: ls -lh
1203 | - name: Release
1204 | uses: softprops/action-gh-release@v2
1205 | with:
1206 | draft: true
1207 | body: "Changelog.md"
1208 | #body_path: Changelog.md
1209 | files: |
1210 | *.7z
1211 | *.xz
1212 | mdk-sdk-apple.zip
1213 |
--------------------------------------------------------------------------------