Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Draft: Add Control API on_start/on_stop callbacks #91

Draft
wants to merge 253 commits into
base: master
Choose a base branch
from

Conversation

evdokimovs
Copy link
Contributor

@evdokimovs evdokimovs commented Mar 11, 2020

Part of #27

Requires #90

Synopsis

We have on_start/on_stop callbacks in the WebRtcPlayEndpoint and WebRtcPublishEndpoint in the Callback Control API. This PR implements on_start on_stop callbacks.

This callbacks will rely firstly on client stats and for proofing that client doesn't lying we will check Coturn stats.

on_start callback for the WebRtcPlayEndpoint will be emitted when all MediaTracks of PeerConnection associated with this endpoint will start receiving traffic.

on_start callback for the WebRtcPublishEndpoint will be emitted when at least one PeerConnection (associated with this endpoint) will start sending traffic with all his MediaTracks.

E2E tests for this functional will be added in a another PR.

Solution

  • 1. Store PeerConnection stats, received from the Jason
  • 2. Subscribe on Coturn stats updates and store them
  • 3. Detect on_start by client stats
  • 4. Proof that client doesn't lying by checking Coturn stats
  • 5. Send on_start callback

Checklist

  • Created PR:
    • In draft mode
    • Name contains Draft: prefix
    • Name contains issue reference
    • Has k:: labels applied
    • Has assignee
  • Documentation is updated (if required)
  • Tests are updated (if required)
  • Changes conform code style
  • CHANGELOG entry is added (if required)
  • FCM (final commit message) is posted
    • and approved
  • Review is completed and changes are approved
  • Before merge:
    • Milestone is set
    • PR's name and description are correct and up-to-date
    • Draft: prefix is removed
    • All temporary labels are removed

evdokimovs and others added 12 commits May 4, 2020 13:16
# Conflicts:
#	src/signalling/room/command_handler.rs
#	src/signalling/room/dynamic_api.rs
#	src/signalling/room/mod.rs
#	src/signalling/room/peer_events_handler.rs
#	src/signalling/room/rpc_server.rs
# Conflicts:
#	src/api/control/refs/fid.rs
#	src/signalling/peers/media_traffic_state.rs
#	src/signalling/peers/metrics.rs
#	src/signalling/room/peer_events_handler.rs
#	src/signalling/room_service.rs
@alexlapa
Copy link
Collaborator

alexlapa commented Jun 1, 2020

@evdokimovs ,

TODO: Remove WrongTrafficFlowing?

@tyranron tyranron changed the title WIP: Add Control API on_start/on_stop callbacks Draft: Add Control API on_start/on_stop callbacks Aug 24, 2020
@tyranron tyranron marked this pull request as draft August 24, 2020 11:54
@alexlapa
Copy link
Collaborator

alexlapa commented Sep 4, 2020

В связи с необходимостью предусмотреть возможность одновременной публикации нескольких видео-треков (видео с камеры + захват экрана), уточняем логику отправки коллбеков:

  1. onStart уходит если есть flowing хотя бы одного трека.
  2. onStop уходит есть нет flowing'а по всем трекам.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request k::api Related to API (application interface) k::design Related to overall design and/or architecture k::monitoring Related to monitoring capabilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants