Skip to content

Commit

Permalink
Merge branch 'release/2022.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Oct 6, 2022
2 parents 9228c8b + 7f54a13 commit fefef11
Show file tree
Hide file tree
Showing 84 changed files with 1,460 additions and 6,557 deletions.
49 changes: 20 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,26 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get Versions
- name: Install deps
run: |
source VERSION
echo "::set-output name=boost_version::${BOOST_VERSION}"
id: versions
- name: Cache Boost ${{ steps.versions.outputs.boost_version }}
id: cache-boost
uses: actions/cache@v2
with:
path: _cache/boost
key: ${{ matrix.name }}-boost-${{ steps.versions.outputs.boost_version }}.tar.gz.v2
- run: ./build.sh --no-tty --no-mount --package ${{ matrix.name }}
working-directory: build
timeout-minutes: 120
- name: Output package name
DEBIAN_FRONTEND=noninteractive sudo apt-get -y install libva-dev libdrm-dev
- run: python3 run.py ${{ matrix.name }} --package
- name: Get package name
shell: bash
run: |
source VERSION
echo "PACKAGE_NAME=zakuro-${ZAKURO_VERSION}_${{ matrix.name }}.tar.gz" >> ${{ matrix.name }}.env
echo "CONTENT_TYPE=application/gzip" >> ${{ matrix.name }}.env
echo "::set-output name=name::zakuro-${ZAKURO_VERSION}_${{ matrix.name }}.tar.gz"
source _package/${{ matrix.name }}/release/zakuro.env
echo "::set-output name=name::${PACKAGE_NAME}"
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}.env
path: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/zakuro.env
create-release:
name: Create Release
if: contains(github.ref, 'tags/202')
Expand All @@ -62,7 +50,7 @@ jobs:
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -74,7 +62,7 @@ jobs:
shell: bash
run: echo "UPLOAD_URL='${{ steps.create_release.outputs.upload_url }}'" > create-release.env
- name: Upload create-release Environment
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: create-release.env
path: create-release.env
Expand All @@ -89,26 +77,29 @@ jobs:
name:
- ubuntu-20.04_x86_64
steps:
- uses: actions/download-artifact@v1
- uses: actions/download-artifact@v3
with:
name: ${{ matrix.name }}.env
- uses: actions/download-artifact@v1
path: ${{ matrix.name }}.env
- uses: actions/download-artifact@v3
with:
name: create-release.env
path: create-release.env
- name: Env to output
shell: bash
run: |
source ${{ matrix.name }}.env/${{ matrix.name }}.env
source ${{ matrix.name }}.env/zakuro.env
source create-release.env/create-release.env
echo "::set-output name=package_name::$PACKAGE_NAME"
echo "::set-output name=content_type::$CONTENT_TYPE"
echo "::set-output name=upload_url::$UPLOAD_URL"
id: env
- uses: actions/download-artifact@v1
- uses: actions/download-artifact@v3
with:
name: ${{ steps.env.outputs.package_name }}
path: ${{ steps.env.outputs.package_name }}
- name: Upload ${{ matrix.name }} Release Asset
uses: actions/[email protected].1
uses: actions/[email protected].2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ webrtc_logs_0
.DS_Store
*.swp

/_build
/_package
/build/macos/_source
/build/macos/_build
Expand All @@ -50,3 +49,7 @@ webrtc_logs_0
/build/ubuntu-20.04_x86_64/_cache

*.yaml

/_source
/_build
/_install
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

## develop

## 2022.7.0 (2022-10-06)

- [UPDATE] Sora C++ SDK を利用するように変更
- @melpon
- [CHANGE] VCS を 100 から 1000 に増やす
- @voluntas

## 2022.6.0 (2022-09-05)

- [UPDATE] asmjit と blend2d を最新版に上げる
- @voluntas
- [UPDATE] `cmake``3.24.1` に上げる
Expand Down
189 changes: 28 additions & 161 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,83 +1,36 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.23)

# Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0054 NEW)
# MSVC runtime library flags are selected by an abstraction.
cmake_policy(SET CMP0091 NEW)

set(ZAKURO_PACKAGE_NAME "" CACHE STRING "ビルド設定を自動化するパッケージ名")
set(TARGET_OS "" CACHE STRING "ビルド対象の動作する OS。\n有効な値は macos, linux")
set(BOOST_ROOT_DIR "" CACHE PATH "Boost のインストール先ディレクトリ\n空文字だった場合はデフォルト検索パスの Boost を利用する")
set(CLI11_ROOT_DIR "" CACHE PATH "CLI11 のインストール先ディレクトリ")
set(BLEND2D_ROOT_DIR "" CACHE PATH "Blend2D のインストール先ディレクトリ")
set(OPENH264_ROOT_DIR "" CACHE PATH "OpenH264 のインストール先ディレクトリ")
set(WEBRTC_INCLUDE_DIR "" CACHE PATH "WebRTC のインクルードディレクトリ")
set(WEBRTC_LIBRARY_DIR "" CACHE PATH "WebRTC のライブラリディレクトリ")
set(WEBRTC_LIBRARY_NAME "webrtc" CACHE STRING "WebRTC のライブラリ名")
set(CLANG_ROOT "" CACHE PATH "コンパイルに利用する clang コンパイラの配置場所")
set(USE_LIBCXX OFF CACHE BOOL "libstdc++ の代わりに libc++ を使うかどうか")
set(LIBCXX_INCLUDE_DIR "" CACHE PATH "libc++ を使う場合の libc++ のインクルードディレクトリ\n空文字だった場合はデフォルト検索パスの libc++ を利用する")
set(ZAKURO_VERSION "unspecified" CACHE STRING "Zakuro のバージョン")
set(ZAKURO_COMMIT "<commit>" CACHE STRING "Zakuro のコミットハッシュ")
set(WEBRTC_BUILD_VERSION "unspecified" CACHE STRING "webrtc-build のバージョン")
set(WEBRTC_READABLE_VERSION "unspecified" CACHE STRING "WebRTC の読みやすいバージョン")
set(WEBRTC_COMMIT "<commit>" CACHE STRING "WebRTC のコミットハッシュ")

if(ZAKURO_PACKAGE_NAME STREQUAL "macos")

set(_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/build/macos/_install)

set(TARGET_OS "macos")
set(BOOST_ROOT_DIR ${_INSTALL_DIR}/boost)
set(CLI11_ROOT_DIR ${_INSTALL_DIR}/CLI11)
set(BLEND2D_ROOT_DIR ${_INSTALL_DIR}/blend2d)
set(OPENH264_ROOT_DIR ${_INSTALL_DIR}/openh264)
set(YAML_CPP_ROOT_DIR ${_INSTALL_DIR}/yaml-cpp)
set(WEBRTC_INCLUDE_DIR ${_INSTALL_DIR}/webrtc/include)
set(WEBRTC_LIBRARY_DIR ${_INSTALL_DIR}/webrtc/lib)
#set(CLANG_ROOT ${_INSTALL_DIR}/llvm/clang)

set(LIBCXX_INCLUDE_DIR ${_INSTALL_DIR}/llvm/libcxx/include)

elseif(ZAKURO_PACKAGE_NAME STREQUAL "ubuntu-20.04_x86_64")

set(TARGET_OS "linux")
set(TARGET_OS_LINUX "ubuntu-20.04")
set(BOOST_ROOT_DIR /root/boost)
set(CLI11_ROOT_DIR /root/CLI11)
set(BLEND2D_ROOT_DIR /root/blend2d)
set(OPENH264_ROOT_DIR /root/openh264)
set(YAML_CPP_ROOT_DIR /root/yaml-cpp)
set(WEBRTC_INCLUDE_DIR /root/webrtc/include)
set(WEBRTC_LIBRARY_DIR /root/webrtc/lib)

set(CLANG_ROOT /root/llvm/clang)
set(LIBCXX_INCLUDE_DIR /root/llvm/libcxx/include)

else()
endif()

if (NOT "${CLANG_ROOT}" STREQUAL "")
set(CMAKE_C_COMPILER ${CLANG_ROOT}/bin/clang)
set(CMAKE_CXX_COMPILER ${CLANG_ROOT}/bin/clang++)
endif()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
list(APPEND CMAKE_PREFIX_PATH ${BOOST_ROOT_DIR} ${YAML_CPP_ROOT_DIR})

project(zakuro C CXX)

list(APPEND CMAKE_PREFIX_PATH ${SORA_DIR} ${YAML_ROOT_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${SORA_DIR}/share/cmake)

set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)

set(WEBRTC_LIBRARY_NAME webrtc)
find_package(Boost REQUIRED COMPONENTS json filesystem)
find_package(WebRTC REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem json)
find_package(CLI11 REQUIRED)
find_package(Sora REQUIRED)
find_package(Threads REQUIRED)
find_package(Blend2D REQUIRED)
find_package(CLI11 REQUIRED)
find_package(yaml-cpp REQUIRED)

if (ZAKURO_PLATFORM STREQUAL "ubuntu-20.04_x86_64")
find_package(Libva REQUIRED)
find_package(Libdrm REQUIRED)
endif()

add_executable(zakuro)

set_target_properties(zakuro PROPERTIES CXX_STANDARD 17 C_STANDARD 17)
set_target_properties(zakuro PROPERTIES POSITION_INDEPENDENT_CODE ON)

string(SUBSTRING "${ZAKURO_COMMIT}" 0 8 ZAKURO_COMMIT_SHORT)
string(SUBSTRING "${WEBRTC_COMMIT}" 0 8 WEBRTC_COMMIT_SHORT)
configure_file(src/zakuro_version.gen.h.template ${CMAKE_CURRENT_BINARY_DIR}/zakuro_version.gen.h)
Expand All @@ -87,45 +40,28 @@ target_include_directories(zakuro PRIVATE ${OPENH264_ROOT_DIR}/include)

target_sources(zakuro
PRIVATE
src/dynamic_h264_video_encoder.cpp
src/embedded_binary.cpp
src/fake_network_call_factory.cpp
src/fake_video_capturer.cpp
src/main.cpp
src/rtc/device_video_capturer.cpp
src/rtc/dynamic_h264_video_encoder.cpp
src/rtc/fake_network_call_factory.cpp
src/rtc/nop_video_decoder.cpp
src/rtc/peer_connection_observer.cpp
src/rtc/rtc_connection.cpp
src/rtc/rtc_manager.cpp
src/rtc/rtc_ssl_verifier.cpp
src/rtc/scalable_track_source.cpp
src/rtc/sctp_transport_factory.cpp
src/rtc/software_video_encoder.cpp
src/rtc/zakuro_audio_device_module.cpp
src/sora/sora_client.cpp
src/sora/sora_server.cpp
src/sora/sora_session.cpp
src/ssl_verifier.cpp
src/url_parts.cpp
src/nop_video_decoder.cpp
src/sctp_transport_factory.cpp
src/util.cpp
src/virtual_client.cpp
src/watchdog.cpp
src/wav_reader.cpp
src/websocket.cpp
src/xorshift.cpp
src/y4m_reader.cpp
src/zakuro_version.cpp
src/zakuro.cpp
src/zakuro_audio_device_module.cpp
src/zakuro_version.cpp
)

target_include_directories(zakuro PRIVATE src)
set_target_properties(zakuro PROPERTIES CXX_STANDARD 17 C_STANDARD 99)

target_link_libraries(zakuro
PRIVATE
WebRTC::WebRTC
Sora::sora
Boost::filesystem
Boost::json
CLI11::CLI11
Blend2D::Blend2D
yaml-cpp
Expand All @@ -141,12 +77,6 @@ target_compile_definitions(zakuro
BOOST_NO_CXX98_FUNCTION_BASE
)

target_compile_options(zakuro
PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>"
"$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:LIBCXX_INCLUDE_DIR>>:-isystem${LIBCXX_INCLUDE_DIR}>"
)

# リソースファイルを作る
list(APPEND RESOURCE_FILES
Kosugi-Regular.ttf
Expand Down Expand Up @@ -218,9 +148,9 @@ foreach(n RANGE ${RESOURCE_FILES_LENGTH_MINUS_ONE})
string(REGEX REPLACE "[-.]" "_" file_name_linux "${file}")

# バイナリの組み込み
if (TARGET_OS STREQUAL "macos")
if (ZAKURO_PLATFORM STREQUAL "macos_arm64")
target_link_options(zakuro PRIVATE "SHELL:-sectcreate __DATA ${file_name_macos} ${CMAKE_CURRENT_SOURCE_DIR}/resource/${file}")
elseif (TARGET_OS STREQUAL "linux")
elseif (ZAKURO_PLATFORM STREQUAL "ubuntu-20.04_x86_64")
set(objfile ${file}.o)
add_custom_command(OUTPUT ${objfile}
COMMAND ld
Expand Down Expand Up @@ -252,73 +182,10 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/embedded_binary.generated.priv.h
@ONLY)

if (TARGET_OS STREQUAL "macos")
target_sources(zakuro
PRIVATE
src/mac_helper/mac_capturer.mm
src/mac_helper/macos_version.mm
)

if (ZAKURO_PLATFORM STREQUAL "macos_arm64")
target_compile_options(zakuro PRIVATE -fconstant-string-class=NSConstantString)
target_link_options(zakuro PRIVATE -ObjC)
set_target_properties(zakuro PROPERTIES CXX_VISIBILITY_PRESET hidden)

target_link_libraries(zakuro
PRIVATE
"-framework Foundation"
"-framework AVFoundation"
"-framework QuartzCore"
"-framework CoreServices"
"-framework CoreFoundation"
"-framework AudioUnit"
"-framework AudioToolbox"
"-framework CoreAudio"
"-framework CoreGraphics"
"-framework CoreMedia"
"-framework CoreVideo"
"-framework VideoToolbox"
"-framework AppKit"
"-framework Metal"
"-framework MetalKit"
"-framework OpenGL"
)

target_compile_definitions(zakuro
PRIVATE
WEBRTC_POSIX
WEBRTC_MAC
)

elseif (TARGET_OS STREQUAL "linux")
find_package(Threads REQUIRED)

target_compile_definitions(zakuro
PRIVATE
WEBRTC_POSIX
_LIBCPP_ABI_NAMESPACE=Cr
_LIBCPP_ABI_VERSION=2
_LIBCPP_DISABLE_AVAILABILITY
)
target_sources(zakuro
PRIVATE
src/v4l2_video_capturer/v4l2_video_capturer.cpp
)

set_target_properties(zakuro PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(zakuro
PRIVATE
X11
Xau
xcb
plds4
Xext
expat
dl
nss3
nssutil3
plc4
nspr4
rt
Threads::Threads
)
elseif (ZAKURO_PLATFORM STREQUAL "ubuntu-20.04_x86_64")
endif()
Loading

0 comments on commit fefef11

Please sign in to comment.