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

connect メッセージの multistream 送信仕様の変更 #150

Merged
merged 7 commits into from
Jan 28, 2025

Conversation

zztkm
Copy link
Contributor

@zztkm zztkm commented Jan 28, 2025

  • [CHANGE] connect メッセージの multistream を true 固定で送信する処理を削除する破壊的変更
    • SoraMediaOption.enableSpotlight を実行したときに multistream を true にする処理を削除
    • ConnectMessage 初期化時に渡す multistream の値を SoraMediaOption.multistreamEnabled に変更
      • SoraMediaOption.multistreamIsRequired 利用しなくなったので削除
    • @zztkm
  • [UPDATE] SoraMediaOption.enableMultistream を非推奨にする
  • [UPDATE] SoraMediaOptionenableLegacyStream を追加する
    • レガシーストリームのための関数だが、レガシーストリームは廃止予定なので最初から非推奨にしている
    • @zztkm

This pull request includes several changes to the sora-android-sdk to improve the handling of multistream options and deprecate legacy features. The most important changes include removing the fixed multistream value, updating the SoraMediaOption class, and deprecating certain methods.

Changes to multistream handling:

  • Removed the fixed multistream value from the connect message and modified the initialization to use SoraMediaOption.multistreamEnabled instead. (CHANGES.md, sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/Catalog.kt, sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/signaling/message/MessageConverter.kt) [1] [2] [3]
  • Changed multistreamEnabled in SoraMediaOption from a Boolean to a nullable Boolean to allow for more flexible handling. (sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraMediaOption.kt)
  • Updated the logic in SoraMediaChannel to check multistreamEnabled against true explicitly. (sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/SoraMediaChannel.kt)

Deprecation of legacy features:

  • Deprecated the enableMultistream method and added a new enableLegacyStream method, which is also marked as deprecated from the start. (sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraMediaOption.kt)
  • Removed the multistreamIsRequired property and associated logic from SoraMediaOption as it is no longer used. (sora-android-sdk/src/main/kotlin/jp/shiguredo/sora/sdk/channel/option/SoraMediaOption.kt)

These changes aim to simplify the codebase and prepare for the upcoming deprecation of legacy stream features.

@zztkm zztkm changed the title [WIP] connect メッセージの multistream 送信仕様の変更 Jan 28, 2025
@zztkm zztkm requested a review from miosakuma January 28, 2025 07:25
@zztkm zztkm self-assigned this Jan 28, 2025
Copy link
Contributor

@miosakuma miosakuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 点確認をお願いします。

@@ -502,7 +502,7 @@ class SoraMediaChannel @JvmOverloads constructor(

override fun onAddRemoteStream(ms: MediaStream) {
SoraLogger.d(TAG, "[channel:$role] @peer:onAddRemoteStream msid=:${ms.id}, connectionId=$connectionId")
if (mediaOption.multistreamEnabled && connectionId != null && ms.id == connectionId) {
if (mediaOption.multistreamEnabled == true && connectionId != null && ms.id == connectionId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mediaOption.multistreamEnabled が null の時はこの分岐にはいるのでしょうか。入らない場合は、Sora のデフォルトはマルチストリームなので「mediaOption.multistreamEnabled が false ではない」という条件にした方が良いように思いました。

ここは自分自身のストリームが通知された時にイベントを発行させないようにする処理だと思いますが、実際に sora-android-quickstart で動作をさせたところ、自分自身のストリームが入った通知は来ませんでした。
予期せぬケースを想定しているのかもしれません。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あ、たしかに仰る通りですね...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

24125a6 で修正しました。

Copy link
Contributor

@miosakuma miosakuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認しました、対応ありがとうございます。

@zztkm zztkm merged commit d6f0cc2 into develop Jan 28, 2025
1 check passed
@zztkm zztkm deleted the feature/no-multistream-modification branch January 28, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants