Skip to content

Commit

Permalink
DataChannel に header を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Oct 24, 2024
1 parent 604d14d commit 2f78ce9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
- @melpon
- [ADD] SoraSignalingConfig に audio_opus_params を追加
- @melpon
- [ADD] SoraSignalingConfig::DataChennel に header を追加
- @melpon
- [FIX] HTTP Proxy 利用時の Websocket 初期化で insecure_ メンバ変数が初期化されていなかったのを修正
- @melpon
- [FIX] SoraSignalingConfig の client_cert と client_key に渡す必要がある値を、ファイルパスからファイルの内容に修正
Expand Down
1 change: 1 addition & 0 deletions include/sora/sora_signaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ struct SoraSignalingConfig {
boost::optional<int32_t> max_retransmits;
boost::optional<std::string> protocol;
boost::optional<bool> compress;
boost::optional<std::vector<boost::json::value>> header;
};
std::vector<DataChannel> data_channels;

Expand Down
3 changes: 3 additions & 0 deletions src/sora_signaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ void SoraSignaling::DoSendConnect(bool redirect) {
if (d.compress) {
obj["compress"] = *d.compress;
}
if (d.header) {
obj["header"] = boost::json::array(d.header->begin(), d.header->end());
}
ar.push_back(obj);
}
m["data_channels"] = ar;
Expand Down
3 changes: 3 additions & 0 deletions test/.testparam.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
// "max_retransmits": null,
// "protocol": null,
// "compress": null,
// "header": [
// {"type": "sender_connection_id"},
// ],
// }
// ],
"data_channels": null,
Expand Down
3 changes: 3 additions & 0 deletions test/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ int main(int argc, char* argv[]) {
if (get(dc, "compress", x)) {
data_channel.compress = x.as_bool();
}
if (get(dc, "header", x)) {
data_channel.header.emplace(x.as_array().begin(), x.as_array().end());
}
config.data_channels.push_back(data_channel);
}
}
Expand Down

0 comments on commit 2f78ce9

Please sign in to comment.