From 0a99e9f97aaf4c71c1e21068e20e9929a6dddf4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= Date: Tue, 16 Jan 2024 16:30:01 +0100 Subject: [PATCH 1/4] Add track notifications --- jellyfish/server_notifications.proto | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/jellyfish/server_notifications.proto b/jellyfish/server_notifications.proto index 1c0c925..c9fe045 100644 --- a/jellyfish/server_notifications.proto +++ b/jellyfish/server_notifications.proto @@ -72,6 +72,29 @@ message ServerMessage { string room_id = 1; } + message Track { + string track_id = 1; + oneof endpoint_id { + string peer_id = 2; + string component_id = 3; + } + } + + message TrackAdded { + string room_id = 1; + Track track = 2; + } + + message TrackMetadataUpdated { + string room_id = 1; + Track track = 2; + } + + message TrackRemoved { + string room_id = 1; + Track track = 2; + } + oneof content { RoomCrashed room_crashed = 1; PeerConnected peer_connected = 2; @@ -88,5 +111,7 @@ message ServerMessage { HlsPlayable hls_playable = 13; HlsUploaded hls_uploaded = 14; HlsUploadCrashed hls_upload_crashed = 15; + TrackAdded track_added = 16; + TrackRemoved track_removed = 17; } } From 3ab521472ed98b81a38573494ea9a00729e83f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= Date: Tue, 30 Jan 2024 09:57:09 +0100 Subject: [PATCH 2/4] Peer metadata updated message --- jellyfish/server_notifications.proto | 56 ++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/jellyfish/server_notifications.proto b/jellyfish/server_notifications.proto index c9fe045..6f71c10 100644 --- a/jellyfish/server_notifications.proto +++ b/jellyfish/server_notifications.proto @@ -72,27 +72,57 @@ message ServerMessage { string room_id = 1; } + message PeerMetadataUpdated { + string room_id = 1; + string peer_id = 2; + string metadata = 3; + } + + enum Encoding { + ENCODING_UNSPECIFIED = 0; + ENCODING_H264 = 1; + ENCODING_VP8 = 2; + ENCODING_OPUS = 3; + } + + enum TrackType { + TRACK_TYPE_UNSPECIFIED = 0; + TRACK_TYPE_VIDEO = 1; + TRACK_TYPE_AUDIO = 2; + } + message Track { - string track_id = 1; - oneof endpoint_id { - string peer_id = 2; - string component_id = 3; - } + string id = 1; + TrackType type = 2; + Encoding encoding = 3; + string metadata = 4; } message TrackAdded { string room_id = 1; - Track track = 2; + oneof endpoint_info { + string peer_id = 2; + string component_id = 3; + } + Track track = 4; } - message TrackMetadataUpdated { + message TrackRemoved { string room_id = 1; - Track track = 2; + oneof endpoint_info { + string peer_id = 2; + string component_id = 3; + } + Track track = 4; } - message TrackRemoved { + message TrackMetadataUpdated { string room_id = 1; - Track track = 2; + oneof endpoint_info { + string peer_id = 2; + string component_id = 3; + } + Track track = 4; } oneof content { @@ -111,7 +141,9 @@ message ServerMessage { HlsPlayable hls_playable = 13; HlsUploaded hls_uploaded = 14; HlsUploadCrashed hls_upload_crashed = 15; - TrackAdded track_added = 16; - TrackRemoved track_removed = 17; + PeerMetadataUpdated peer_metadata_updated = 16; + TrackAdded track_added = 17; + TrackRemoved track_removed = 18; + TrackMetadataUpdated track_metadata_updated = 19; } } From 54cf8af74a0a1b7a2cd45a707dde1443b94cde61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= Date: Fri, 2 Feb 2024 14:28:51 +0100 Subject: [PATCH 3/4] Remove track encoding --- jellyfish/server_notifications.proto | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/jellyfish/server_notifications.proto b/jellyfish/server_notifications.proto index 6f71c10..d8be7d0 100644 --- a/jellyfish/server_notifications.proto +++ b/jellyfish/server_notifications.proto @@ -78,13 +78,6 @@ message ServerMessage { string metadata = 3; } - enum Encoding { - ENCODING_UNSPECIFIED = 0; - ENCODING_H264 = 1; - ENCODING_VP8 = 2; - ENCODING_OPUS = 3; - } - enum TrackType { TRACK_TYPE_UNSPECIFIED = 0; TRACK_TYPE_VIDEO = 1; @@ -94,8 +87,7 @@ message ServerMessage { message Track { string id = 1; TrackType type = 2; - Encoding encoding = 3; - string metadata = 4; + string metadata = 3; } message TrackAdded { From 4e556e24c080eb6252ca44ff547379aeb76d6294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Ro=C5=BCnawski?= Date: Wed, 7 Feb 2024 13:58:07 +0100 Subject: [PATCH 4/4] Add docstrings --- jellyfish/peer_notifications.proto | 4 ++++ jellyfish/server_notifications.proto | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/jellyfish/peer_notifications.proto b/jellyfish/peer_notifications.proto index ffcc17e..269a018 100644 --- a/jellyfish/peer_notifications.proto +++ b/jellyfish/peer_notifications.proto @@ -2,13 +2,17 @@ syntax = "proto3"; package jellyfish; +// Defines any type of message sent between JF and a peer message PeerMessage { + // Response sent by JF, confirming successfull authentication message Authenticated {} + // Request sent by peer, to authenticate to JF server message AuthRequest { string token = 1; } + // Any type of WebRTC messages passed betweend JF and peer message MediaEvent { string data = 1; } diff --git a/jellyfish/server_notifications.proto b/jellyfish/server_notifications.proto index d8be7d0..f8e200d 100644 --- a/jellyfish/server_notifications.proto +++ b/jellyfish/server_notifications.proto @@ -2,94 +2,115 @@ syntax = "proto3"; package jellyfish; +// Defines any type of message passed between JF and server client message ServerMessage { + // Notification sent when a room crashes message RoomCrashed { string room_id = 1; } + // Notification sent when a peer connects message PeerConnected { string room_id = 1; string peer_id = 2; } + // Notification sent when a peer disconnects from JF message PeerDisconnected { string room_id = 1; string peer_id = 2; } + // Notification sent when a peer crashes message PeerCrashed { string room_id = 1; string peer_id = 2; } + // Notification sent when a component crashes message ComponentCrashed { string room_id = 1; string component_id = 2; } + // Response sent by JF, confirming successfull authentication message Authenticated {} + // Request sent by client, to authenticate to JF server message AuthRequest { string token = 1; } + // Defines message groups for which client can subscribe enum EventType { EVENT_TYPE_UNSPECIFIED = 0; EVENT_TYPE_SERVER_NOTIFICATION = 1; EVENT_TYPE_METRICS = 2; } + // Request sent by client to subsribe for certain message type message SubscribeRequest { EventType event_type = 1; } + // Response sent by JF, confirming subscription for message type message SubscribeResponse { EventType event_type = 1; } + // Notification sent when a room is created message RoomCreated { string room_id = 1; } + // Notification sent when a room is deleted message RoomDeleted { string room_id = 1; } + // Message containing WebRTC metrics from JF message MetricsReport { string metrics = 1; } + // Notification sent when the HLS stream becomes available in a room message HlsPlayable { string room_id = 1; string component_id = 2; } + // Notification sent when the HLS recording is successfully uploded to AWS S3 message HlsUploaded { string room_id = 1; } + // Notification sent when the upload of HLS recording to AWS S3 fails message HlsUploadCrashed { string room_id = 1; } + // Notification sent when peer updates its metadata message PeerMetadataUpdated { string room_id = 1; string peer_id = 2; string metadata = 3; } + // Defines types of tracks being published by peers and component enum TrackType { TRACK_TYPE_UNSPECIFIED = 0; TRACK_TYPE_VIDEO = 1; TRACK_TYPE_AUDIO = 2; } + // Describes a media track message Track { string id = 1; TrackType type = 2; string metadata = 3; } + // Notification sent when peer or component adds new track message TrackAdded { string room_id = 1; oneof endpoint_info { @@ -99,6 +120,7 @@ message ServerMessage { Track track = 4; } + // Notification sent when a track is removed message TrackRemoved { string room_id = 1; oneof endpoint_info { @@ -108,6 +130,7 @@ message ServerMessage { Track track = 4; } + // Notification sent when metadata of a multimedia track is updated message TrackMetadataUpdated { string room_id = 1; oneof endpoint_info {