Skip to content

Commit

Permalink
test のビルドが通るように修正する
Browse files Browse the repository at this point in the history
  • Loading branch information
enm10k committed May 7, 2024
1 parent 4861e13 commit 01ad4ff
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// WebRTC
#include <api/environment/environment_factory.h>

// Sora
#include <sora/sora_client_context.h>

Expand Down Expand Up @@ -197,8 +194,7 @@ int main(int argc, char* argv[]) {
sora::SoraClientContextConfig context_config;
context_config.use_audio_device = false;
context_config.use_hardware_encoder = false;
auto env = webrtc::CreateEnvironment();
auto context = sora::SoraClientContext::Create(context_config, env);
auto context = sora::SoraClientContext::Create(context_config);

auto messaging_recvonly_sample =
std::make_shared<MessagingRecvOnlySample>(context, config);
Expand Down
6 changes: 1 addition & 5 deletions examples/sdl_sample/src/sdl_sample.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// WebRTC
#include <api/environment/environment_factory.h>

// Sora
#include <sora/camera_device_capturer.h>
#include <sora/sora_client_context.h>
Expand Down Expand Up @@ -251,9 +248,8 @@ int main(int argc, char* argv[]) {
rtc::LogMessage::LogThreads();
}

auto env = webrtc::CreateEnvironment();
auto context =
sora::SoraClientContext::Create(sora::SoraClientContextConfig(), env);
sora::SoraClientContext::Create(sora::SoraClientContextConfig());
auto sdlsample = std::make_shared<SDLSample>(context, config);
sdlsample->Run();

Expand Down
6 changes: 1 addition & 5 deletions examples/sumomo/src/sumomo.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// WebRTC
#include <api/environment/environment_factory.h>

// Sora
#include <sora/camera_device_capturer.h>
#include <sora/sora_client_context.h>
Expand Down Expand Up @@ -450,8 +447,7 @@ int main(int argc, char* argv[]) {
context_config.use_hardware_encoder = *use_hardware_encoder;
}
context_config.openh264 = openh264;
auto env = webrtc::CreateEnvironment();
auto context = sora::SoraClientContext::Create(context_config, env);
auto context = sora::SoraClientContext::Create(context_config);
auto sumomo = std::make_shared<Sumomo>(context, config);
sumomo->Run();

Expand Down
8 changes: 8 additions & 0 deletions include/sora/sora_client_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -59,6 +60,13 @@ class SoraClientContext {
const SoraClientContextConfig& config,
webrtc::Environment& env);

static std::shared_ptr<SoraClientContext> Create(
const SoraClientContextConfig& config) {
// TODO(enm10k): ライフタイム的には env をクラスで保持した方が良さそうだが、 Create が static なメソッドなので難しい気がする
auto env = webrtc::CreateEnvironment();
return Create(SoraClientContextConfig(), env);
};

~SoraClientContext();

rtc::Thread* network_thread() const { return network_thread_.get(); }
Expand Down
1 change: 0 additions & 1 deletion src/sora_client_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <api/audio_codecs/builtin_audio_encoder_factory.h>
#include <api/create_peerconnection_factory.h>
#include <api/enable_media.h>
// #include <api/environment/environment_factory.h>
#include <api/rtc_event_log/rtc_event_log_factory.h>
#include <api/task_queue/default_task_queue_factory.h>
#include <call/call_config.h>
Expand Down

0 comments on commit 01ad4ff

Please sign in to comment.