Skip to content

Commit

Permalink
PeerConnectionFactoryDependencies の audio_decoder_factory, audio_enco…
Browse files Browse the repository at this point in the history
…der_factory を直接設定すると処理が進むが、以下のエラーが発生する

\# Fatal error in: ../../../../_source/macos_arm64/debug/webrtc/src/modules/audio_device/audio_device_buffer.cc, line 77
\# last system error: 0
\# Check failed: (&main_thread_checker_)->IsCurrent()
\# \# Expected: TQ: 0x1426089b0 Thread: 0x16f623000
\# Actual:   TQ: 0x0 Thread: 0x1d6879ec0
TaskQueue doesn't match
  • Loading branch information
enm10k committed Jan 23, 2024
1 parent 7f84c5e commit 12bcfab
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/sora_client_context.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <iostream>

#include "sora/sora_client_context.h"

// WebRTC
Expand Down Expand Up @@ -118,23 +120,24 @@ std::shared_ptr<SoraClientContext> SoraClientContext::Create(
c->config_.configure_media_dependencies(dependencies, media_dependencies);
}

dependencies.audio_decoder_factory = sora::CreateBuiltinAudioDecoderFactory();
dependencies.audio_encoder_factory = sora::CreateBuiltinAudioEncoderFactory();
std::cout << "webrtc::EnableMedia" << std::endl;
webrtc::EnableMedia(dependencies);

/*
自分で CreateMediaEngine しなくても良さそう
// TODO: CallConfig のコンストラクタの第2引数の扱いについて理解する
auto webrtc_env = webrtc::CreateEnvironment();
// webrtc::CallConfig call_config(webrtc_env);
// dependencies.media_factory->CreateCall(call_config);
// TODO: Environment に task_queue_factory を持たせる必要があるかもしれない
dependencies.media_factory->CreateMediaEngine(webrtc_env, dependencies);
*/

if (c->config_.configure_dependencies) {
c->config_.configure_dependencies(dependencies);
}

/*
auto webrtc_env =
webrtc::CreateEnvironment(dependencies.task_queue_factory.get());
std::cout << "HOGE: webrtc::ConnectionContext::Create(" << std::endl;
c->connection_context_ =
webrtc::ConnectionContext::Create(webrtc_env, &dependencies);
*/

c->factory_ = sora::CreateModularPeerConnectionFactoryWithContext(
std::move(dependencies), c->connection_context_);

Expand Down

0 comments on commit 12bcfab

Please sign in to comment.