Skip to content
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

Fake network の機能を削除 #42

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
- @melpon
- [CHANGE] multistream のオプションを削除
- @torikizi
- [CHANGE] FakeNetwork 系の機能を削除
- @melpon
- [UPDATE] Sora C++ SDK を `2024.8.0` に上げる
- それに伴って以下のライブラリのバージョンも上げる
- libwebrtc のバージョンを `m128.6613.2.0` に上げる
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ target_include_directories(zakuro PRIVATE ${OPENH264_ROOT_DIR}/include)
target_sources(zakuro
PRIVATE
src/embedded_binary.cpp
src/enable_media_with_fake_call.cpp
src/fake_video_capturer.cpp
src/main.cpp
src/nop_video_decoder.cpp
Expand Down
68 changes: 0 additions & 68 deletions src/enable_media_with_fake_call.cpp

This file was deleted.

12 changes: 0 additions & 12 deletions src/enable_media_with_fake_call.h

This file was deleted.

52 changes: 0 additions & 52 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,58 +259,6 @@ void Util::ParseArgs(const std::vector<std::string>& cargs,
"DataChannels (default: none)")
->check(is_json);

// Fake network 系
app.add_option("--fake-network-send-queue-length-packets",
config.fake_network_send.queue_length_packets,
"Queue length in number of packets for sending");
app.add_option("--fake-network-send-queue-delay-ms",
config.fake_network_send.queue_delay_ms,
"Delay in addition to capacity induced delay for sending");
app.add_option("--fake-network-send-delay-standard-deviation-ms",
config.fake_network_send.delay_standard_deviation_ms,
"Standard deviation of the extra delay for sending");
app.add_option("--fake-network-send-link-capacity-kbps",
config.fake_network_send.link_capacity_kbps,
"Link capacity in kbps for sending");
app.add_option("--fake-network-send-loss-percent",
config.fake_network_send.loss_percent,
"Random packet loss for sending");
app.add_option("--fake-network-send-allow-reordering",
config.fake_network_send.allow_reordering,
"If packets are allowed to be reordered for sending")
->transform(CLI::CheckedTransformer(bool_map, CLI::ignore_case));
app.add_option("--fake-network-send-avg-burst-loss-length",
config.fake_network_send.avg_burst_loss_length,
"The average length of a burst of lost packets for sending");
app.add_option("--fake-network-send-packet-overhead",
config.fake_network_send.packet_overhead,
"Additional bytes to add to packet size for sending");
app.add_option("--fake-network-receive-queue-length-packets",
config.fake_network_receive.queue_length_packets,
"Queue length in number of packets for receiving");
app.add_option("--fake-network-receive-queue-delay-ms",
config.fake_network_receive.queue_delay_ms,
"Delay in addition to capacity induced delay for receiving");
app.add_option("--fake-network-receive-delay-standard-deviation-ms",
config.fake_network_receive.delay_standard_deviation_ms,
"Standard deviation of the extra delay for receiving");
app.add_option("--fake-network-receive-link-capacity-kbps",
config.fake_network_receive.link_capacity_kbps,
"Link capacity in kbps for receiving");
app.add_option("--fake-network-receive-loss-percent",
config.fake_network_receive.loss_percent,
"Random packet loss for receiving");
app.add_option("--fake-network-receive-allow-reordering",
config.fake_network_receive.allow_reordering,
"If packets are allowed to be reordered for receiving")
->transform(CLI::CheckedTransformer(bool_map, CLI::ignore_case));
app.add_option("--fake-network-receive-avg-burst-loss-length",
config.fake_network_receive.avg_burst_loss_length,
"The average length of a burst of lost packets for receiving");
app.add_option("--fake-network-receive-packet-overhead",
config.fake_network_receive.packet_overhead,
"Additional bytes to add to packet size for receiving");

try {
app.parse(args);
} catch (const CLI::ParseError& e) {
Expand Down
6 changes: 0 additions & 6 deletions src/virtual_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// Sora C++ SDK
#include <sora/sora_client_context.h>

// WebRTC
#include <call/degraded_call.h>

// Boost
#include <boost/asio/io_context.hpp>

Expand Down Expand Up @@ -55,9 +52,6 @@ struct VirtualClientConfig {
int sample_rate;
int channels;

webrtc::DegradedCall::TimeScopedNetworkConfig fake_network_send;
webrtc::DegradedCall::TimeScopedNetworkConfig fake_network_receive;

std::string openh264;

std::shared_ptr<sora::SoraClientContext> context;
Expand Down
9 changes: 4 additions & 5 deletions src/zakuro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
#include <thread>
#include <vector>

// WebRTC
#include <api/enable_media.h>

// Sora C++ SDK
#include <sora/camera_device_capturer.h>
#include <sora/sora_video_encoder_factory.h>

#include "enable_media_with_fake_call.h"
#include "fake_audio_key_trigger.h"
#include "fake_video_capturer.h"
#include "game/game_kuzushi.h"
Expand Down Expand Up @@ -280,8 +282,6 @@ int Zakuro::Run() {
vc_config.fixed_resolution = config_.fixed_resolution;
vc_config.priority = config_.priority;
vc_config.openh264 = config_.openh264;
vc_config.fake_network_send = config_.fake_network_send;
vc_config.fake_network_receive = config_.fake_network_receive;
vc_config.initial_mute_video = config_.initial_mute_video;
vc_config.initial_mute_audio = config_.initial_mute_audio;
if (config_.no_audio_device) {
Expand Down Expand Up @@ -365,8 +365,7 @@ int Zakuro::Run() {
std::move(sw_config));
dependencies.video_decoder_factory.reset(new NopVideoDecoderFactory());

EnableMediaWithFakeCall(dependencies, vc.fake_network_send,
vc.fake_network_receive);
webrtc::EnableMedia(dependencies);
};

vc_config.context = sora::SoraClientContext::Create(context_config);
Expand Down
7 changes: 0 additions & 7 deletions src/zakuro.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#include <cstdlib>
#include <string>

// WebRTC
#include <api/test/simulated_network.h>
#include <call/degraded_call.h>

// Boost
#include <boost/json.hpp>
#include <boost/optional.hpp>
Expand Down Expand Up @@ -79,9 +75,6 @@ struct ZakuroConfig {
boost::json::value sora_signaling_notify_metadata;
boost::json::value sora_data_channels;

webrtc::DegradedCall::TimeScopedNetworkConfig fake_network_send;
webrtc::DegradedCall::TimeScopedNetworkConfig fake_network_receive;

std::shared_ptr<GameKeyCore> key_core;

std::shared_ptr<ZakuroStats> stats;
Expand Down