Skip to content
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
51 changes: 23 additions & 28 deletions api/alphacc_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,32 @@ bool ParseAlphaCCConfig(const std::string& file_path) {

RETURN_ON_FAIL(reader.parse(is, top));

RETURN_ON_FAIL(GetValue(top, "server_connection", &second));
RETURN_ON_FAIL(GetString(second, "ip", &config->conn_server_ip));
RETURN_ON_FAIL(GetInt(second, "port", &config->conn_server_port));
RETURN_ON_FAIL(GetBool(second, "autoconnect", &config->conn_autoconnect));
RETURN_ON_FAIL(GetBool(second, "autocall", &config->conn_autocall));
RETURN_ON_FAIL(GetInt(second, "autoclose", &config->conn_autoclose));
if (GetValue(top, "server_connection", &second)) {
RETURN_ON_FAIL(GetString(second, "ip", &config->conn_server_ip));
RETURN_ON_FAIL(GetInt(second, "port", &config->conn_server_port));
RETURN_ON_FAIL(GetBool(second, "autoconnect", &config->conn_autoconnect));
RETURN_ON_FAIL(GetBool(second, "autocall", &config->conn_autocall));
RETURN_ON_FAIL(GetInt(second, "autoclose", &config->conn_autoclose));
}
second.clear();

RETURN_ON_FAIL(GetValue(top, "serverless_connection", &second));
RETURN_ON_FAIL(GetValue(second, "sender", &third));
RETURN_ON_FAIL(GetBool(third, "enabled", &config->is_sender));
if (config->is_sender) {
RETURN_ON_FAIL(GetString(third, "dest_ip", &config->dest_ip));
RETURN_ON_FAIL(GetInt(third, "dest_port", &config->dest_port));
}
third.clear();
RETURN_ON_FAIL(GetValue(second, "receiver", &third));
RETURN_ON_FAIL(GetBool(third, "enabled", &config->is_receiver));
if (config->is_receiver) {
RETURN_ON_FAIL(GetString(third, "listening_ip", &config->listening_ip));
RETURN_ON_FAIL(GetInt(third, "listening_port", &config->listening_port));
if (GetValue(top, "serverless_connection", &second)) {
RETURN_ON_FAIL(GetInt(second, "autoclose", &config->conn_autoclose));
RETURN_ON_FAIL(GetValue(second, "sender", &third));
RETURN_ON_FAIL(GetBool(third, "enabled", &config->is_sender));
if (config->is_sender) {
RETURN_ON_FAIL(GetString(third, "dest_ip", &config->dest_ip));
RETURN_ON_FAIL(GetInt(third, "dest_port", &config->dest_port));
}
third.clear();
RETURN_ON_FAIL(GetValue(second, "receiver", &third));
RETURN_ON_FAIL(GetBool(third, "enabled", &config->is_receiver));
if (config->is_receiver) {
RETURN_ON_FAIL(GetString(third, "listening_ip", &config->listening_ip));
RETURN_ON_FAIL(GetInt(third, "listening_port", &config->listening_port));
}
third.clear();
}
third.clear();
second.clear();

RETURN_ON_FAIL(
Expand All @@ -70,14 +73,6 @@ bool ParseAlphaCCConfig(const std::string& file_path) {
GetString(second, "onnx_model_path", &config->onnx_model_path));
second.clear();

RETURN_ON_FAIL(GetValue(top, "redis", &second));
RETURN_ON_FAIL(GetString(second, "ip", &config->redis_ip));
RETURN_ON_FAIL(GetInt(second, "port", &config->redis_port));
RETURN_ON_FAIL(GetString(second, "session_id", &config->redis_sid));
RETURN_ON_FAIL(GetInt(second, "redis_update_duration",
&config->redis_update_duration_ms));
second.clear();

bool enabled = false;
RETURN_ON_FAIL(GetValue(top, "video_source", &second));
RETURN_ON_FAIL(GetValue(second, "video_disabled", &third));
Expand Down
25 changes: 9 additions & 16 deletions api/alphacc_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,21 @@ struct AlphaCCConfig {

// The address to connect to
std::string dest_ip;
int dest_port;
int dest_port = 0;
std::string listening_ip;
int listening_port;
int listening_port = 0;

// Redis server configuration
std::string redis_ip;
int redis_port;
// Redis session id
std::string redis_sid;
int redis_update_duration_ms;

int bwe_feedback_duration_ms;
int bwe_feedback_duration_ms = 0;
std::string onnx_model_path;

enum class VideoSourceOption {
kVideoDisabled,
kWebcam,
kVideoFile,
} video_source_option;
int video_height;
int video_width;
int video_fps;
int video_height = 0;
int video_width = 0;
int video_fps = 0;
std::string video_file_path;

enum class AudioSourceOption { kMicrophone, kAudioFile } audio_source_option;
Expand All @@ -67,9 +60,9 @@ struct AlphaCCConfig {
bool save_to_file = false;
std::string video_output_path;
std::string audio_output_path;
int video_output_height;
int video_output_width;
int video_output_fps;
int video_output_height = 0;
int video_output_width = 0;
int video_output_fps = 0;
};

// Get alphaCC global configurations
Expand Down
12 changes: 0 additions & 12 deletions api/peer_connection_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,18 +646,6 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// passed.
bool offer_extmap_allow_mixed = false;

// The ip of Redis Service
absl::optional<std::string> redis_ip;

// The port of Redis Service
int redis_port = kUndefined;

// The session id of Redis service
absl::optional<std::string> redis_sid;

// The time period of collecting states in milliseconds
int redis_update_ms = kUndefined;

// The path of the onnx model
absl::optional<std::string> onnx_model_path;

Expand Down
7 changes: 0 additions & 7 deletions examples/peerconnection/client/webrtc_config_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
"onnx_model_path": "C:\\Users\\v-rutong\\AlphaRTC\\rtc\\src\\out\\Default\rl_model.onnx"
},

"redis": {
"ip": "10.150.146.96",
"port": 6379,
"session_id": "test_sid_00",
"redis_update_duration": 500
},

"video_source":{
"video_disabled": {
"enabled": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ The duration the receiver sends its estimated target rate every time(*in millise
### **onnx**
- **onnx_model_path**: The path of the onnx model.

### **redis**

Redis is **NO NEEDED** in peerconnection_serverless.

- **ip**: The ip of Redis Service.
- **port**: The port of Redis Service.
- **session_id**: The session id of Redis Service
- **redis_update_duration**: The duration that the client collects status and push into redis(*in millisecond*).

### **video_source**
- **video_disabled**:
- enabled: If set to `true`, the client will not take any video source as input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
"onnx_model_path": "C:\\Users\\v-puzhou\\Desktop\\AlphaRTC\\rtc\\src\\out\\Default\\onnx-model_pretrain.onnx"
},

"redis": {
"ip": "10.150.146.96",
"port": 6379,
"session_id": "test_sid_00",
"redis_update_duration": 500
},

"video_source":{
"video_disabled": {
"enabled": false
Expand Down
7 changes: 0 additions & 7 deletions examples/peerconnection/serverless/webrtc_config_sender.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
"onnx_model_path": "C:\\Users\\v-puzhou\\Desktop\\AlphaRTC\\rtc\\src\\out\\Default\\onnx-model_pretrain.onnx"
},

"redis": {
"ip": "10.150.146.96",
"port": 6379,
"session_id": "test_sid_00",
"redis_update_duration": 500
},

"video_source":{
"video_disabled": {
"enabled": false
Expand Down
8 changes: 0 additions & 8 deletions pc/peer_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,6 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
absl::optional<bool> use_datagram_transport;
absl::optional<CryptoOptions> crypto_options;
bool offer_extmap_allow_mixed;
absl::optional<std::string> redis_ip;
int redis_port;
absl::optional<std::string> redis_sid;
int redis_update_ms;
absl::optional<std::string> onnx_model_path;
int rate_update_ms;
};
Expand Down Expand Up @@ -838,10 +834,6 @@ bool PeerConnectionInterface::RTCConfiguration::operator==(
use_datagram_transport == o.use_datagram_transport &&
crypto_options == o.crypto_options &&
offer_extmap_allow_mixed == o.offer_extmap_allow_mixed &&
redis_ip == o.redis_ip &&
redis_port == o.redis_port &&
redis_sid == o.redis_sid &&
redis_update_ms == o.redis_update_ms &&
onnx_model_path == o.onnx_model_path &&
rate_update_ms == o.rate_update_ms;
}
Expand Down
6 changes: 0 additions & 6 deletions peerconnection-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ The duration the receiver sends its estimated target rate every time(*in millise
### **onnx**
- **onnx_model_path**: The path of the onnx model.

### **redis**
- **ip**: The ip of Redis Service.
- **port**: The port of Redis Service.
- **session_id**: The session id of Redis Service
- **redis_update_duration**: The duration that the client collects status and push into redis(*in millisecond*).

### **video_source**
- **video_disabled**:
- enabled: If set to `true`, the client will not take any video source as input.
Expand Down