-
Notifications
You must be signed in to change notification settings - Fork 12
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
マルチ転送フィルターの追加 #108
base: develop
Are you sure you want to change the base?
マルチ転送フィルターの追加 #108
Conversation
Sora/Sora.cs
Outdated
public ForwardingFilter ForwardingFilter; | ||
public ForwardingFilters? ForwardingFilters; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public List<ForwardingFilter> ForwardingFilters
で良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご指摘のとおり修正しました。
Sora/Sora.cs
Outdated
var ffs = new SoraConf.Internal.ForwardingFilters(); | ||
foreach (var filter in config.ForwardingFilters.Filters) | ||
{ | ||
var ff = new SoraConf.Internal.ForwardingFilter(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このあたりのロジックは ForwardingFilter に対する処理と共通化できるはず
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c55e160 で共通化しました。
@@ -80,6 +86,7 @@ message ConnectConfig { | |||
string audio_streaming_language_code = 48; | |||
string signaling_notify_metadata = 49; | |||
optional ForwardingFilter forwarding_filter = 51; | |||
optional ForwardingFilters forwarding_filters = 52; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional repeated ForwardingFilter forwarding_filters
とは書けないんでしたっけ。できないならそのままで良いです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
書けないようです。ビルドエラーとなりました。
src/sora.cpp
Outdated
if (cc.has_forwarding_filters()) { | ||
std::vector<sora::SoraSignalingConfig::ForwardingFilter> filters; | ||
for (const auto& filter : cc.forwarding_filters.filters) { | ||
sora::SoraSignalingConfig::ForwardingFilter ff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このあたりのロジックは forwarding_filter に対する処理と共通化できるはず
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c55e160 にて共通化しました。
Sora/Sora.cs
Outdated
@@ -85,7 +86,10 @@ public class Rule | |||
public string? Version; | |||
public string? Metadata; | |||
} | |||
|
|||
public class ForwardingFilters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これはもう不要なはず
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました。
Sora/Sora.cs
Outdated
@@ -522,6 +507,48 @@ public void Disconnect() | |||
sora_disconnect(p); | |||
} | |||
|
|||
private SoraConf.Internal.ForwardingFilter ConvertToInternalFilter(ForwardingFilter filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forwarding filter で1個の機能なので、ConvertToInternalForwardingFilter
の方が良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あとこの関数は static で良いはず
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名前の変更と static へ変更しました
Sora/Sora.cs
Outdated
cc.SetForwardingFilter(ConvertToInternalFilter(config.ForwardingFilter)); | ||
} | ||
|
||
if (config.ForwardingFilters != null && config.ForwardingFilters.Count > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config.ForwardingFilters.Count == 0
の時に空の SoraConf.Internal.ForwardingFilters
を設定しないといけないので、config.ForwardingFilters.Count > 0
の条件は外した方が良いです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご指摘の通りに修正しました。
src/sora.cpp
Outdated
@@ -761,6 +740,48 @@ bool Sora::InitADM(rtc::scoped_refptr<webrtc::AudioDeviceModule> adm, | |||
return true; | |||
} | |||
|
|||
sora::SoraSignalingConfig::ForwardingFilter Sora::convertForwardingFilter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- convertForwardingFilter だと、
sora::SoraSignalingConfig::ForwardingFilter
をsora_conf::internal::ForwardingFilter
に変換する関数に読めるので、convertToForwardingFilter
の方が良さそう - 全体的に関数名は UpperCamelCase で書いてるので
ConvertToForwardingFilter
にした方が良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ConvertToForwardingFilter に修正しました
src/sora.h
Outdated
@@ -80,6 +80,10 @@ class Sora : public std::enable_shared_from_this<Sora>, | |||
void* GetAndroidApplicationContext(void* env); | |||
static sora_conf::ErrorCode ToErrorCode(sora::SoraSignalingErrorCode ec); | |||
|
|||
private: | |||
sora::SoraSignalingConfig::ForwardingFilter convertForwardingFilter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この関数は static にできるはず
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpp の修正と合わせて static に変更しました。
Sora/Sora.cs
Outdated
@@ -85,7 +86,7 @@ public class Rule | |||
public string? Version; | |||
public string? Metadata; | |||
} | |||
|
|||
public List<ForwardingFilter> Filters = new List<ForwardingFilter>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これ要らないですよね…?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
失礼しました。ご指摘の通り不要でした。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう
This pull request introduces several enhancements to the
Sora
class and related protobuf definitions, primarily focusing on the forwarding filter functionality. The changes add new fields to theForwardingFilter
class and introduce a newForwardingFilters
class to handle multiple filters.Enhancements to forwarding filter functionality:
Sora/Sora.cs
: AddedName
andPriority
fields to theForwardingFilter
class and created a newForwardingFilters
class to manage a list ofForwardingFilter
objects. Updated theConfig
class to include an optionalForwardingFilters
property. Enhanced theConnect
method to handle the new fields and iterate through multiple filters if provided. [1] [2] [3] [4] [5]Protobuf updates:
proto/sora_conf_internal.proto
: Addedname
andpriority
fields to theForwardingFilter
message. Introduced a newForwardingFilters
message to encapsulate multipleForwardingFilter
objects. Updated theConnectConfig
message to include the newForwardingFilters
field. [1] [2] [3]C++ implementation updates:
src/sora.cpp
: Updated theDoConnect
method to handle the newname
andpriority
fields inForwardingFilter
. Added logic to process the newForwardingFilters
message, iterating over multiple filters and setting their respective fields. [1] [2]