Skip to content

Commit

Permalink
Merge pull request #94 from shiguredo/feature/update-libwebrtc-to-m123
Browse files Browse the repository at this point in the history
libwebrtc を m123 にあげる
  • Loading branch information
enm10k authored May 7, 2024
2 parents d521321 + e595052 commit 8a8d29f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
- @enm10k
- [UPDATE] SDL2 を 2.30.2 にあげる
- @enm10k
- [UPDATE] libwebrtc を m123.6312.3.5 にあげる
- Android の test アプリのリンク時に発生したエラーを解決するために、リンカーを Android NDK に含まれるものから libwebrtc のものに変更した
- リンカーのバージョンの違いによる互換性の問題でエラーが発生していたため、次回 Android NDK のバージョンを更新する際に、修正箇所を元に戻せる可能性がある
- @melpon @enm10k
- [ADD] sumomo に `--openh264``--use-hardware-encoder` オプションを追加
- @melpon
- [ADD] sumomo に `--video-h264-params``--video-h265-params` オプションを追加
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SORA_CPP_SDK_VERSION=2024.6.1
WEBRTC_BUILD_VERSION=m122.6261.1.0
WEBRTC_BUILD_VERSION=m123.6312.3.5
BOOST_VERSION=1.85.0
CMAKE_VERSION=3.28.1
CUDA_VERSION=11.8.0-1
Expand Down
2 changes: 1 addition & 1 deletion examples/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SORA_CPP_SDK_VERSION=2024.6.1
WEBRTC_BUILD_VERSION=m122.6261.1.0
WEBRTC_BUILD_VERSION=m123.6312.3.5
BOOST_VERSION=1.85.0
CMAKE_VERSION=3.28.1
SDL2_VERSION=2.30.2
Expand Down
8 changes: 5 additions & 3 deletions test/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ android {
"-DWEBRTC_INCLUDE_DIR=$projectDir/../../../_install/android/release/webrtc/include",
"-DWEBRTC_LIBRARY_DIR=$projectDir/../../../_install/android/release/webrtc/lib/arm64-v8a",
"-DLIBCXX_INCLUDE_DIR=$projectDir/../../../_install/android/release/llvm/libcxx/include",
// "-DWEBRTC_INCLUDE_DIR=$projectDir/../../../_source/android/release/webrtc/src",
// "-DWEBRTC_LIBRARY_DIR=$projectDir/../../../_build/android/release/webrtc",
// "-DLIBCXX_INCLUDE_DIR=$projectDir/../../../_source/android/release/webrtc/src/buildtools/third_party/libc++/trunk/include",
"-DLLVM_DIR=$projectDir/../../../_install/android/release/llvm/clang",
// "-DWEBRTC_INCLUDE_DIR=$projectDir/../../../../webrtc-build/_source/android/webrtc/src",
// "-DWEBRTC_LIBRARY_DIR=$projectDir/../../../../webrtc-build/_build/android/release/webrtc/arm64-v8a",
// "-DLIBCXX_INCLUDE_DIR=$projectDir/../../../../webrtc-build/_source/android/webrtc/src/third_party/libc++/src/include",
// "-DLLVM_DIR=$projectDir/../../../../webrtc-build/_source/android/webrtc/src/third_party/llvm-build/Release+Asserts",
"-DANDROID_STL=none",
"-DANDROID_NATIVE_API_LEVEL=29",
"-DANDROID_PLATFORM=29",
Expand Down
10 changes: 10 additions & 0 deletions test/android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ target_link_libraries(hello PRIVATE Sora::sora ${Blend2D_LIBRARY})
target_compile_definitions(hello PRIVATE BL_STATIC=1)
target_include_directories(hello PRIVATE ${BLEND2D_ROOT_DIR}/include)

# libwebrtc が ELF フォーマットの新しい仕様を使ってリンクしているため、
# Android NDK に用意されている標準のリンカーだと以下のようなリンクエラーになってしまう。
#
# C/C++: ld.lld: error: /home/runner/work/sora-cpp-sdk/sora-cpp-sdk/_install/android/release/webrtc/lib/arm64-v8a/libwebrtc.a(jsep_ice_candidate.o):(.rodata+0x4): unknown relocation (315) against symbol typeinfo for webrtc::JsepIceCandidate
#
# なので libwebrtc と同じバージョンのリンカーを使ってリンクするために -B でリンカーのパスを指定する。
#
# 新しい仕様の該当コミット: https://github.com/llvm/llvm-project/commit/04a906ec980e7bf49ffda0808766f51d08e8ae76
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -B ${LLVM_DIR}/bin")

target_compile_options(hello
PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>"
Expand Down

0 comments on commit 8a8d29f

Please sign in to comment.