Skip to content

Commit

Permalink
Merge pull request #353 from shiguredo/feature/update-webrtc-m128.661…
Browse files Browse the repository at this point in the history
…3.2.0

m128 ビルドの修正
  • Loading branch information
torikizi authored Sep 5, 2024
2 parents 78673c8 + 3d7c4a3 commit 5e663fa
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 16 deletions.
16 changes: 15 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,25 @@
- JetPack 5.1.1, 5.1.2 で動作を確認
- JetPack 5.1 では、互換性の問題で JetsonJpegDecoder がエラーになることを確認
- @enm10k
- [CHANGE] libwebrtc に定義されている継承元クラスが変更されたため `CreateVideoEncoder``CreateVideoDecoder``Create` に変更
- @melpon
- [CHANGE] hwenc_nvcodec 部分を Sora C++ SDK から移植
- @melpon
- [UPDATE] CLI11 を 2.4.2 に上げる
- @voluntas @torikizi
- [UPDATE] SDL を 2.30.3 に上げる
- @voluntas @torikizi
- [UPDATE] Boost を 1.85.0 に上げる
- @torikizi
- [UPDATE] WebRTC を m125.6422.2.5 に上げる
- [UPDATE] WebRTC を m128.6613.2.0 に上げる
- m128.6613.2.0 での変更点は以下の通り
- libwebrtc から helpers が削除され `crypto_random` に分割されたため、`rtc::CreateRandomString` を利用するために `crypto_random.h` を追加
- 参考 : https://source.chromium.org/chromium/_/webrtc/src/+/4158678b468135a017aa582f038731b5f7851c82
- libwebrtc から削除されたために webrtc-build で復活させた `proxy_info_revive.h``crypt_string_revive.h` を利用するように修正
- `init_allocator` の引数変更に追従
- webrtc-build の H.265 パッチの変更に追従し、`packetization_mode` とヘッダーを削除
- m128 以降は新規追加された ScreenCaptureKit の framework が必要となったため、`CMakeLists.txt` に追加
- 参考 : https://source.chromium.org/chromium/_/webrtc/src/+/d4a6c3f76fc3b187115d1cd65f4d1fffd7bebb7c
- @torikizi @melpon
- [UPDATE] WebRTC を m119 に上げたことで必要になった関連するライブラリもバージョンを上げる
- CMAKE_VERSION を 3.27.7 に上げる
Expand All @@ -52,6 +64,8 @@
- STL が要求する CUDA のバージョンが 12.4 以上であるため、他のプラットフォームに影響が出ないように無視するように修正
- 参考: https://stackoverflow.com/questions/78515942/cuda-compatibility-with-visual-studio-2022-version-17-10
- @torikizi
- [UPDATE] Github Actions で使用する Windows を 2022 にアップデート
- @melpon
- [ADD] ubuntu-22.04_armv8_jetson のパッケージを追加
- @melpon
- [ADD] Intel VPL の H.265 ハードウェアエンコーダ/デコーダに対応する
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ elseif (TARGET_OS STREQUAL "macos")
"-framework MetalKit"
"-framework OpenGL"
"-framework IOSurface"
"-framework ScreenCaptureKit"
)

elseif (TARGET_OS STREQUAL "linux")
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MOMO_VERSION=2023.1.0
WEBRTC_BUILD_VERSION=m125.6422.2.5
WEBRTC_BUILD_VERSION=m128.6613.2.0
BOOST_VERSION=1.85.0
CLI11_VERSION=v2.4.2
SDL2_VERSION=2.30.5
Expand Down
3 changes: 2 additions & 1 deletion src/momo_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

// WebRTC
#include <api/rtp_parameters.h>
#include <rtc_base/proxy_info.h>
#include <rtc_base/crypt_string_revive.h>
#include <rtc_base/proxy_info_revive.h>

#include "video_codec_info.h"

Expand Down
5 changes: 3 additions & 2 deletions src/rtc/rtc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void RTCManager::AddDataManager(std::shared_ptr<RTCDataManager> data_manager) {
data_manager_dispatcher_.Add(data_manager);
}

class RawCryptString : public rtc::CryptStringImpl {
class RawCryptString : public rtc::revive::CryptStringImpl {
public:
RawCryptString(const std::string& str) : str_(str) {}
size_t GetLength() const override { return str_.size(); }
Expand Down Expand Up @@ -270,7 +270,8 @@ std::shared_ptr<RTCConnection> RTCManager::CreateConnection(
pi.username = config_.proxy_username;
}
if (!config_.proxy_password.empty()) {
pi.password = rtc::CryptString(RawCryptString(config_.proxy_password));
pi.password =
rtc::revive::CryptString(RawCryptString(config_.proxy_password));
}
dependencies.allocator->set_proxy("WebRTC Native Client Momo", pi);
}
Expand Down
3 changes: 0 additions & 3 deletions src/sora-cpp-sdk/src/hwenc_jetson/jetson_video_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// WebRTC
#include <common_video/libyuv/include/webrtc_libyuv.h>
#include <modules/video_coding/codecs/h264/include/h264.h>
#include <modules/video_coding/codecs/h265/include/h265_globals.h>
#include <modules/video_coding/include/video_codec_interface.h>
#include <modules/video_coding/include/video_error_codes.h>
#include <modules/video_coding/svc/create_scalability_structure.h>
Expand Down Expand Up @@ -849,8 +848,6 @@ int32_t JetsonVideoEncoder::SendFrame(
webrtc::EncodedImageBuffer::Create(buffer, size);
encoded_image_.SetEncodedData(encoded_image_buffer);

codec_specific.codecSpecific.H265.packetization_mode =
webrtc::H265PacketizationMode::NonInterleaved;
} else if (codec_.codecType == webrtc::kVideoCodecAV1 ||
codec_.codecType == webrtc::kVideoCodecVP9 ||
codec_.codecType == webrtc::kVideoCodecVP8) {
Expand Down
2 changes: 0 additions & 2 deletions src/sora-cpp-sdk/src/hwenc_nvcodec/nvcodec_video_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,6 @@ int32_t NvCodecVideoEncoderImpl::Encode(
encoded_image_.qp_ = h264_bitstream_parser_.GetLastSliceQp().value_or(-1);
} else if (codec_ == CudaVideoCodec::H265) {
codec_specific.codecType = webrtc::kVideoCodecH265;
codec_specific.codecSpecific.H265.packetization_mode =
webrtc::H265PacketizationMode::NonInterleaved;

h265_bitstream_parser_.ParseBitstream(encoded_image_);
encoded_image_.qp_ = h265_bitstream_parser_.GetLastSliceQp().value_or(-1);
Expand Down
3 changes: 0 additions & 3 deletions src/sora-cpp-sdk/src/hwenc_vpl/vpl_video_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <common_video/h265/h265_bitstream_parser.h>
#include <common_video/include/bitrate_adjuster.h>
#include <modules/video_coding/codecs/h264/include/h264.h>
#include <modules/video_coding/codecs/h265/include/h265_globals.h>
#include <modules/video_coding/codecs/vp9/include/vp9_globals.h>
#include <modules/video_coding/include/video_codec_interface.h>
#include <modules/video_coding/include/video_error_codes.h>
Expand Down Expand Up @@ -587,8 +586,6 @@ int32_t VplVideoEncoderImpl::Encode(
encoded_image_.qp_ = h264_bitstream_parser_.GetLastSliceQp().value_or(-1);
} else if (codec_ == MFX_CODEC_HEVC) {
codec_specific.codecType = webrtc::kVideoCodecH265;
codec_specific.codecSpecific.H265.packetization_mode =
webrtc::H265PacketizationMode::NonInterleaved;

h265_bitstream_parser_.ParseBitstream(encoded_image_);
encoded_image_.qp_ = h265_bitstream_parser_.GetLastSliceQp().value_or(-1);
Expand Down
4 changes: 2 additions & 2 deletions src/sora-cpp-sdk/src/open_h264_video_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <absl/container/inlined_vector.h>
#include <absl/strings/match.h>
#include <absl/types/optional.h>
#include <api/transport/rtp/dependency_descriptor.h>
#include <api/environment/environment_factory.h>
#include <api/transport/rtp/dependency_descriptor.h>
#include <api/video/i420_buffer.h>
#include <api/video/video_codec_constants.h>
#include <api/video_codecs/scalability_mode.h>
Expand Down Expand Up @@ -512,7 +512,7 @@ int32_t OpenH264VideoEncoder::InitEncode(
}
}

SimulcastRateAllocator init_allocator(codec_);
SimulcastRateAllocator init_allocator(env_, codec_);
VideoBitrateAllocation allocation =
init_allocator.Allocate(VideoBitrateAllocationParameters(
DataRate::KilobitsPerSec(codec_.startBitrate), codec_.maxFramerate));
Expand Down
2 changes: 1 addition & 1 deletion src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <boost/preprocessor/stringize.hpp>

// WebRTC
#include <rtc_base/helpers.h>
#include <rtc_base/crypto_random.h>

#include "momo_version.h"

Expand Down

0 comments on commit 5e663fa

Please sign in to comment.