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

Feat webrtc sdk #283

Merged
merged 49 commits into from
May 21, 2024
Merged

Feat webrtc sdk #283

merged 49 commits into from
May 21, 2024

Conversation

giangndm
Copy link
Contributor

@giangndm giangndm commented May 6, 2024

Pull Request

Description

This PR implement Webrtc SDK Protocol based on RFC-0005.

SDK Implement: 8xFF/atm0s-media-sdk-ts#2

Features:

  • Session restart-ice
  • Session restore new server
  • Join room first
  • Join room lazy
  • Room info: peers
  • Room info: tracks
  • Remote Track: first create
  • Remote Track: lazy create
  • Remote Track: share with simple stream
  • Remote Track: share with simulcast/SVC
  • Remote Track: attach, detach source in-air
  • Remote Track: config on-air
  • Remote Track: multi tracks with multi connections
  • Local Track: first create
  • Local Track: lazy create
  • Local Track: attach, detach
  • Local Track: config on air

Related Issue

If this pull request is related to any issue, please mention it here.

Checklist

  • I have tested the changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation, if necessary.
  • I have added appropriate tests, if applicable.

Screenshots

If applicable, add screenshots to help explain the changes made.

Additional Notes

Add any additional notes or context about the pull request here.

Copy link

coderabbitai bot commented May 6, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Commits Files that changed from the base of the PR and between bfffca6 and 516759b.
Files ignored due to path filters (6)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
  • Cargo.toml is excluded by !**/*.toml
  • bin/Cargo.toml is excluded by !**/*.toml
  • packages/media_runner/Cargo.toml is excluded by !**/*.toml
  • packages/protocol/Cargo.toml is excluded by !**/*.toml
  • packages/transport_webrtc/Cargo.toml is excluded by !**/*.toml
Files selected for processing (57)
  • .github/workflows/release.yml (2 hunks)
  • .github/workflows/rust.yml (1 hunks)
  • README.md (1 hunks)
  • bin/node1.sh (1 hunks)
  • bin/node2.sh (1 hunks)
  • bin/src/http/api_media.rs (8 hunks)
  • bin/src/http/utils/mod.rs (1 hunks)
  • bin/src/http/utils/payload_protobuf.rs (1 hunks)
  • bin/src/http/utils/user_agent.rs (1 hunks)
  • bin/src/server/media.rs (3 hunks)
  • bin/src/server/media/runtime_worker.rs (7 hunks)
  • packages/media_core/src/cluster.rs (10 hunks)
  • packages/media_core/src/cluster/room.rs (3 hunks)
  • packages/media_core/src/cluster/room/channel_pub.rs (4 hunks)
  • packages/media_core/src/cluster/room/channel_sub.rs (10 hunks)
  • packages/media_core/src/cluster/room/metadata.rs (21 hunks)
  • packages/media_core/src/endpoint.rs (6 hunks)
  • packages/media_core/src/endpoint/internal.rs (5 hunks)
  • packages/media_core/src/endpoint/internal/bitrate_allocator.rs (3 hunks)
  • packages/media_core/src/endpoint/internal/local_track.rs (6 hunks)
  • packages/media_core/src/endpoint/internal/local_track/packet_selector.rs (11 hunks)
  • packages/media_core/src/endpoint/internal/local_track/packet_selector/video_h264_sim.rs (5 hunks)
  • packages/media_core/src/endpoint/internal/local_track/packet_selector/video_single.rs (1 hunks)
  • packages/media_core/src/endpoint/internal/local_track/packet_selector/video_vp8_sim.rs (5 hunks)
  • packages/media_core/src/endpoint/internal/local_track/packet_selector/video_vp9_svc.rs (4 hunks)
  • packages/media_core/src/endpoint/internal/remote_track.rs (4 hunks)
  • packages/media_core/src/errors.rs (1 hunks)
  • packages/media_core/src/transport.rs (7 hunks)
  • packages/media_runner/src/worker.rs (8 hunks)
  • packages/protocol/build.rs (1 hunks)
  • packages/protocol/proto/conn.proto (1 hunks)
  • packages/protocol/proto/features.proto (1 hunks)
  • packages/protocol/proto/features_mix_minus.proto (1 hunks)
  • packages/protocol/proto/gateway.proto (1 hunks)
  • packages/protocol/proto/shared.proto (1 hunks)
  • packages/protocol/src/endpoint.rs (5 hunks)
  • packages/protocol/src/lib.rs (1 hunks)
  • packages/protocol/src/media.rs (5 hunks)
  • packages/protocol/src/protobuf/conn.rs (1 hunks)
  • packages/protocol/src/protobuf/features.rs (1 hunks)
  • packages/protocol/src/protobuf/gateway.rs (1 hunks)
  • packages/protocol/src/protobuf/mix_minus.rs (1 hunks)
  • packages/protocol/src/protobuf/mod.rs (1 hunks)
  • packages/protocol/src/protobuf/shared.rs (1 hunks)
  • packages/protocol/src/transport.rs (5 hunks)
  • packages/protocol/src/transport/webrtc.rs (1 hunks)
  • packages/transport_webrtc/src/lib.rs (1 hunks)
  • packages/transport_webrtc/src/media/h264.rs (1 hunks)
  • packages/transport_webrtc/src/media/mod.rs (3 hunks)
  • packages/transport_webrtc/src/shared_port.rs (2 hunks)
  • packages/transport_webrtc/src/transport.rs (7 hunks)
  • packages/transport_webrtc/src/transport/bwe_state.rs (11 hunks)
  • packages/transport_webrtc/src/transport/webrtc.rs (1 hunks)
  • packages/transport_webrtc/src/transport/webrtc/local_track.rs (1 hunks)
  • packages/transport_webrtc/src/transport/webrtc/remote_track.rs (1 hunks)
  • packages/transport_webrtc/src/transport/whep.rs (5 hunks)
  • packages/transport_webrtc/src/transport/whip.rs (6 hunks)
 ______________________________________________________________
< How would you like your code review? Scrambled or over-easy? >
 --------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 26.48084% with 1688 lines in your changes are missing coverage. Please review.

Project coverage is 46.70%. Comparing base (5855b17) to head (516759b).
Report is 1 commits behind head on master.

Files Patch % Lines
packages/transport_webrtc/src/transport/webrtc.rs 17.73% 422 Missing ⚠️
packages/media_runner/src/worker.rs 0.00% 106 Missing ⚠️
packages/media_core/src/endpoint/internal.rs 47.44% 103 Missing ⚠️
packages/transport_webrtc/src/transport/whep.rs 0.00% 101 Missing ⚠️
packages/transport_webrtc/src/transport.rs 0.00% 100 Missing ⚠️
bin/src/http/api_media.rs 0.00% 87 Missing ⚠️
...es/media_core/src/endpoint/internal/local_track.rs 0.00% 75 Missing ⚠️
packages/protocol/src/protobuf/conn.rs 0.00% 70 Missing ⚠️
packages/protocol/src/protobuf/shared.rs 0.00% 63 Missing ⚠️
...s/media_core/src/endpoint/internal/remote_track.rs 0.00% 60 Missing ⚠️
... and 32 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #283      +/-   ##
==========================================
- Coverage   51.22%   46.70%   -4.52%     
==========================================
  Files          53       63      +10     
  Lines        5808     7012    +1204     
==========================================
+ Hits         2975     3275     +300     
- Misses       2833     3737     +904     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,13 @@
use std::io::Result;

#[cfg(any(feature = "build-protobuf"))]

Check warning

Code scanning / clippy

unneeded sub cfg when there is only one condition Warning

unneeded sub cfg when there is only one condition
@giangndm
Copy link
Contributor Author

Currently webrtc dont send media with mid when we restart-ice to new server if the stream is simulcast. It will be move to separated ticket.

@giangndm giangndm marked this pull request as ready for review May 21, 2024 08:38
@giangndm giangndm merged commit 1c362cd into 8xFF:master May 21, 2024
8 of 10 checks passed
@github-actions github-actions bot mentioned this pull request May 21, 2024
@giangndm giangndm deleted the feat-webrtc-sdk branch June 6, 2024 00:44
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.

None yet

1 participant