-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libwebrtc を m124.6367.3.1 にあげる #98
Changes from 7 commits
90207d6
4861e13
01ad4ff
ba5bb61
78843b9
cac00ea
01f5ba6
7e8622b
3e789b1
ba0da74
9d5eb9b
ecec7db
d95ab15
2ae98b7
fdb7947
7a21aa4
35b1eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
SORA_CPP_SDK_VERSION=2024.6.1 | ||
WEBRTC_BUILD_VERSION=m123.6312.3.5 | ||
BOOST_VERSION=1.85.0 | ||
WEBRTC_BUILD_VERSION=m124.6367.3.1 | ||
BOOST_VERSION=1.84.0 | ||
CMAKE_VERSION=3.28.1 | ||
SDL2_VERSION=2.30.3 | ||
CLI11_VERSION=v2.4.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
#define SORA_SORA_CLIENT_CONTEXT_H_ | ||
|
||
// WebRTC | ||
#include <api/environment/environment_factory.h> | ||
#include <api/peer_connection_interface.h> | ||
#include <media/engine/webrtc_media_engine.h> | ||
#include <pc/connection_context.h> | ||
|
@@ -55,6 +56,10 @@ struct SoraClientContextConfig { | |
// auto client = std::make_shared<MyClient>(context); | ||
class SoraClientContext { | ||
public: | ||
static std::shared_ptr<SoraClientContext> Create( | ||
const SoraClientContextConfig& config, | ||
webrtc::Environment& env); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Create に引数追加しなくても、SoraClientContextConfig に webrtc::Environment 入れてしまえば良さそうに見えます。 ただ、そもそも外から指定可能にする意味も無さそうに見えるので、SoraClientContext のメンバに env_ 持たせて内部で webrtc::CreateEnvironment すれば良さそう。 |
||
static std::shared_ptr<SoraClientContext> Create( | ||
const SoraClientContextConfig& config); | ||
|
||
|
@@ -76,6 +81,7 @@ class SoraClientContext { | |
? config_.get_android_application_context(env) | ||
: nullptr; | ||
} | ||
std::shared_ptr<webrtc::Environment> env; | ||
|
||
private: | ||
SoraClientContextConfig config_; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#include <vector> | ||
|
||
// WebRTC | ||
#include <api/environment/environment.h> | ||
#include <api/video/video_codec_type.h> | ||
#include <api/video_codecs/video_decoder_factory.h> | ||
|
||
|
@@ -52,7 +53,8 @@ class SoraVideoDecoderFactory : public webrtc::VideoDecoderFactory { | |
|
||
std::vector<webrtc::SdpVideoFormat> GetSupportedFormats() const override; | ||
|
||
std::unique_ptr<webrtc::VideoDecoder> CreateVideoDecoder( | ||
std::unique_ptr<webrtc::VideoDecoder> Create( | ||
const webrtc::Environment& env, | ||
const webrtc::SdpVideoFormat& format) override; | ||
|
||
private: | ||
|
@@ -62,10 +64,11 @@ class SoraVideoDecoderFactory : public webrtc::VideoDecoderFactory { | |
|
||
// ハードウェアデコーダを出来るだけ使おうとして、見つからなければソフトウェアデコーダを使う設定を返す | ||
SoraVideoDecoderFactoryConfig GetDefaultVideoDecoderFactoryConfig( | ||
webrtc::Environment& env, | ||
std::shared_ptr<CudaContext> cuda_context = nullptr, | ||
void* env = nullptr); | ||
void* jni_env = nullptr); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1番目に引数を追加すると破壊的変更になるので、ここらは内部で webrtc::CreateEnvironment を呼んで生成するか、一番うしろに引数を追加してデフォルトを webrtc::CreateEnvironment にしないといけないですね |
||
// ソフトウェアデコーダのみを使う設定を返す | ||
SoraVideoDecoderFactoryConfig GetSoftwareOnlyVideoDecoderFactoryConfig(); | ||
SoraVideoDecoderFactoryConfig GetSoftwareOnlyVideoDecoderFactoryConfig(webrtc::Environment& env); | ||
|
||
} // namespace sora | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ class PeerConnectionFactoryWithContext : public webrtc::PeerConnectionFactory { | |
PeerConnectionFactoryWithContext( | ||
webrtc::PeerConnectionFactoryDependencies dependencies) | ||
: PeerConnectionFactoryWithContext( | ||
// TODO(enm10k): environment を外部から設定できるようにする | ||
webrtc::ConnectionContext::Create(webrtc::CreateEnvironment(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @melpon There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これってそもそも複数作ったらいけないんですかね?いろんな場所で webrtc::CreateEnvironment() して動くならそれで良さそうな気も There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
自信が無いですが、クラスによっては? 複数作っても問題なさそうです
Sora C++ SDK の内部でで webrtc::CreateEnvironment() するのでも動くはずです There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
上記の部分について補足をすると、現在の webrtc::Environment のメンバーを見る限り、 field trials を Sora C++ SDK のユーザーが設定したい場合を除いて、 webrtc::Environment を外部から受け取る必要はなさそうです |
||
&dependencies), | ||
&dependencies) {} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
// WebRTC | ||
#include <absl/strings/match.h> | ||
#include <api/environment/environment.h> | ||
#include <api/video_codecs/sdp_video_format.h> | ||
#include <media/base/codec.h> | ||
#include <media/base/media_constants.h> | ||
|
@@ -67,8 +68,8 @@ SoraVideoDecoderFactory::GetSupportedFormats() const { | |
return r; | ||
} | ||
|
||
std::unique_ptr<webrtc::VideoDecoder> | ||
SoraVideoDecoderFactory::CreateVideoDecoder( | ||
std::unique_ptr<webrtc::VideoDecoder> SoraVideoDecoderFactory::Create( | ||
const webrtc::Environment& env, | ||
const webrtc::SdpVideoFormat& format) { | ||
webrtc::VideoCodecType specified_codec = | ||
webrtc::PayloadStringToCodecType(format.name); | ||
|
@@ -84,10 +85,10 @@ SoraVideoDecoderFactory::CreateVideoDecoder( | |
std::vector<webrtc::SdpVideoFormat> supported_formats = formats_[n++]; | ||
|
||
if (enc.factory != nullptr) { | ||
create_video_decoder = | ||
[factory = enc.factory.get()](const webrtc::SdpVideoFormat& format) { | ||
return factory->CreateVideoDecoder(format); | ||
}; | ||
create_video_decoder = [factory = enc.factory.get(), | ||
&env](const webrtc::SdpVideoFormat& format) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 参照でも動作するとは思いますけど、参照にする理由もないので There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2ae98b7 で修正しました |
||
return factory->Create(env, format); | ||
}; | ||
} else if (enc.create_video_decoder != nullptr) { | ||
create_video_decoder = enc.create_video_decoder; | ||
} | ||
|
@@ -108,20 +109,21 @@ SoraVideoDecoderFactory::CreateVideoDecoder( | |
} | ||
|
||
SoraVideoDecoderFactoryConfig GetDefaultVideoDecoderFactoryConfig( | ||
webrtc::Environment& env, | ||
std::shared_ptr<CudaContext> cuda_context, | ||
void* env) { | ||
auto config = GetSoftwareOnlyVideoDecoderFactoryConfig(); | ||
void* jni_env) { | ||
auto config = GetSoftwareOnlyVideoDecoderFactoryConfig(env); | ||
|
||
#if defined(__APPLE__) | ||
config.decoders.insert(config.decoders.begin(), | ||
VideoDecoderConfig(CreateMacVideoDecoderFactory())); | ||
#endif | ||
|
||
#if defined(SORA_CPP_SDK_ANDROID) | ||
if (env != nullptr) { | ||
if (jni_env != nullptr) { | ||
config.decoders.insert(config.decoders.begin(), | ||
VideoDecoderConfig(CreateAndroidVideoDecoderFactory( | ||
static_cast<JNIEnv*>(env)))); | ||
static_cast<JNIEnv*>(jni_env)))); | ||
} | ||
#endif | ||
|
||
|
@@ -249,11 +251,12 @@ SoraVideoDecoderFactoryConfig GetDefaultVideoDecoderFactoryConfig( | |
return config; | ||
} | ||
|
||
SoraVideoDecoderFactoryConfig GetSoftwareOnlyVideoDecoderFactoryConfig() { | ||
SoraVideoDecoderFactoryConfig GetSoftwareOnlyVideoDecoderFactoryConfig( | ||
webrtc::Environment& env) { | ||
SoraVideoDecoderFactoryConfig config; | ||
config.decoders.push_back(VideoDecoderConfig( | ||
webrtc::kVideoCodecVP8, | ||
[](auto format) { return webrtc::VP8Decoder::Create(); })); | ||
[&env](auto format) { return webrtc::CreateVp8Decoder(env); })); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 参照を渡すのは未定義動作なので There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2ae98b7 で修正しました |
||
config.decoders.push_back(VideoDecoderConfig( | ||
webrtc::kVideoCodecVP9, | ||
[](auto format) { return webrtc::VP9Decoder::Create(); })); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boost のバージョンが下がってる…?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらですが、現在 Sora C++ SDK でリリースされている最新の Boost のバージョンが 1.84.0 なため、
--sora-dir .
を指定しない場合ビルドが落ちるようです (= develop のsサンプル BOOST_VERSION を誤ってあげてしまっている)この PR のマージにもう少し時間がかかるようであれば、 develop ブランチを直接修正します
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1fa19e0
あやまってあげてしまってるってのがよくわからんのだが。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サンプルのビルド時は Sora C++ SDK のリリースに含まれる Boost のバイナリを取得してビルドする挙動がデフォルトとなっています。
そのため、 SDK とサンプルの Boost のバージョンを同時に上げられないようです。
(SDK の Boost のバージョンを上げてリリースした後、サンプルの Boost のバージョンをあげる必要がある)
0997648 でサンプルの BOOST_VERSION を 1.84.0 に戻しました