Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ Use the command below:
git submodule add https://github.com/fishjam-cloud/protos.git`
```

## Generating elixir protos

To run the `fishjam_protos/compile_proto.sh` one needs to install the proto plugin for elixir.

To install the plugin:

```bash
mix escript.install hex protobuf 0.15.0 # or any other version
```

## How to update docs

Install [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) plugin.
Expand All @@ -22,7 +32,7 @@ Use the command below:
find fishjam/ -name "*.proto" | sort | xargs protoc --doc_out=./doc --doc_opt=markdown,docs.md
```

or
or

```command
find fishjam -name "*.proto" | sort | xargs docker run --rm -v $(pwd)/doc:/out -v $(pwd):/protos pseudomuto/protoc-gen-doc --doc_opt=markdown,docs.md
Expand Down
86 changes: 80 additions & 6 deletions doc/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@

- [fishjam/media_events/shared.proto](#fishjam_media_events_shared-proto)
- [Candidate](#fishjam-media_events-Candidate)
- [ChannelMessage](#fishjam-media_events-ChannelMessage)
- [ChannelMessageBinaryPayload](#fishjam-media_events-ChannelMessageBinaryPayload)

- [Variant](#fishjam-media_events-Variant)

Expand All @@ -85,6 +87,8 @@
- [ServerMessage](#fishjam-ServerMessage)
- [ServerMessage.AuthRequest](#fishjam-ServerMessage-AuthRequest)
- [ServerMessage.Authenticated](#fishjam-ServerMessage-Authenticated)
- [ServerMessage.ChannelAdded](#fishjam-ServerMessage-ChannelAdded)
- [ServerMessage.ChannelRemoved](#fishjam-ServerMessage-ChannelRemoved)
- [ServerMessage.ComponentCrashed](#fishjam-ServerMessage-ComponentCrashed)
- [ServerMessage.HlsPlayable](#fishjam-ServerMessage-HlsPlayable)
- [ServerMessage.HlsUploadCrashed](#fishjam-ServerMessage-HlsUploadCrashed)
Expand Down Expand Up @@ -384,7 +388,7 @@ Sent when client enables one of the track variants
<a name="fishjam-media_events-peer-MediaEvent-RenegotiateTracks"></a>

### MediaEvent.RenegotiateTracks
Sent when peer wants to renegatiate connection due to adding a track or removing a track
Sent when peer wants to renegotiate connection due to adding a track or removing a track



Expand All @@ -403,7 +407,7 @@ The &#34;mid&#34; is an identifier used to associate an RTP packet with an MLine
| ----- | ---- | ----- | ----------- |
| sdp | [string](#string) | | The value of the `sessionDescription.sdp` |
| track_id_to_metadata_json | [MediaEvent.SdpOffer.TrackIdToMetadataJsonEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-TrackIdToMetadataJsonEntry) | repeated | |
| track_id_to_bitrates | [MediaEvent.SdpOffer.TrackIdToBitratesEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-TrackIdToBitratesEntry) | repeated | Maps track_id to its bitrate. The track_id in the TrackBitrates message is ignored (we use the map key), so it can be ommited. |
| track_id_to_bitrates | [MediaEvent.SdpOffer.TrackIdToBitratesEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-TrackIdToBitratesEntry) | repeated | Maps track_id to its bitrate. The track_id in the TrackBitrates message is ignored (we use the map key), so it can be omitted. |
| mid_to_track_id | [MediaEvent.SdpOffer.MidToTrackIdEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-MidToTrackIdEntry) | repeated | |


Expand Down Expand Up @@ -958,7 +962,7 @@ Sent to informs that one of the peers has removed one or more tracks.
<a name="fishjam-media_events-server-MediaEvent-VadNotification"></a>

### MediaEvent.VadNotification
Sent to inform that the track denoted by `trackId` has changed their voice actiivty
Sent to inform that the track denoted by `trackId` has changed their voice activity
For this notification to work, the server must be configured to use VAD extension
and the sender must support it.

Expand Down Expand Up @@ -1019,6 +1023,38 @@ Contains information about an ICE candidate which will be sent to the peer/serve




<a name="fishjam-media_events-ChannelMessage"></a>

### ChannelMessage



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| source | [string](#string) | | |
| destinations | [string](#string) | repeated | |
| binary | [ChannelMessageBinaryPayload](#fishjam-media_events-ChannelMessageBinaryPayload) | | |






<a name="fishjam-media_events-ChannelMessageBinaryPayload"></a>

### ChannelMessageBinaryPayload



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| data | [bytes](#bytes) | | |








Expand Down Expand Up @@ -1163,7 +1199,7 @@ Response sent by FJ, confirming successful authentication
<a name="fishjam-PeerMessage-MediaEvent"></a>

### PeerMessage.MediaEvent
Any type of WebRTC messages passed betweend FJ and peer
Any type of WebRTC messages passed between FJ and peer


| Field | Type | Label | Description |
Expand Down Expand Up @@ -1255,6 +1291,8 @@ Defines any type of message passed between FJ and server peer
| viewer_disconnected | [ServerMessage.ViewerDisconnected](#fishjam-ServerMessage-ViewerDisconnected) | | |
| streamer_connected | [ServerMessage.StreamerConnected](#fishjam-ServerMessage-StreamerConnected) | | |
| streamer_disconnected | [ServerMessage.StreamerDisconnected](#fishjam-ServerMessage-StreamerDisconnected) | | |
| channel_added | [ServerMessage.ChannelAdded](#fishjam-ServerMessage-ChannelAdded) | | |
| channel_removed | [ServerMessage.ChannelRemoved](#fishjam-ServerMessage-ChannelRemoved) | | |



Expand Down Expand Up @@ -1286,6 +1324,42 @@ Response sent by FJ, confirming successfull authentication



<a name="fishjam-ServerMessage-ChannelAdded"></a>

### ServerMessage.ChannelAdded
Notification sent when a peer creates a channel


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| room_id | [string](#string) | | |
| peer_id | [string](#string) | | |
| component_id | [string](#string) | | |
| channel_id | [string](#string) | | |






<a name="fishjam-ServerMessage-ChannelRemoved"></a>

### ServerMessage.ChannelRemoved
Notification sent when a peer deletes a channel


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| room_id | [string](#string) | | |
| peer_id | [string](#string) | | |
| component_id | [string](#string) | | |
| channel_id | [string](#string) | | |






<a name="fishjam-ServerMessage-ComponentCrashed"></a>

### ServerMessage.ComponentCrashed
Expand Down Expand Up @@ -1336,7 +1410,7 @@ Notification sent when the upload of HLS recording to AWS S3 fails
<a name="fishjam-ServerMessage-HlsUploaded"></a>

### ServerMessage.HlsUploaded
Notification sent when the HLS recording is successfully uploded to AWS S3
Notification sent when the HLS recording is successfully uploaded to AWS S3


| Field | Type | Label | Description |
Expand Down Expand Up @@ -1562,7 +1636,7 @@ Notification sent when streamer disconnects
<a name="fishjam-ServerMessage-SubscribeRequest"></a>

### ServerMessage.SubscribeRequest
Request sent by peer to subsribe for certain message type
Request sent by peer to subscribe for certain message type


| Field | Type | Label | Description |
Expand Down
4 changes: 2 additions & 2 deletions fishjam/media_events/peer/peer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ message MediaEvent {
string metadata_json = 2;
}

// Sent when peer wants to renegatiate connection due to adding a track or removing a track
// Sent when peer wants to renegotiate connection due to adding a track or removing a track
message RenegotiateTracks {}

// Sent as a response to `offerData` media event during renegotiation
Expand All @@ -43,7 +43,7 @@ message MediaEvent {
message SdpOffer {
string sdp = 1; // The value of the `sessionDescription.sdp`
map<string, string> track_id_to_metadata_json = 2;
map<string, TrackBitrates> track_id_to_bitrates = 3; // Maps track_id to its bitrate. The track_id in the TrackBitrates message is ignored (we use the map key), so it can be ommited.
map<string, TrackBitrates> track_id_to_bitrates = 3; // Maps track_id to its bitrate. The track_id in the TrackBitrates message is ignored (we use the map key), so it can be omitted.
map<string, string> mid_to_track_id = 4;
}

Expand Down
2 changes: 1 addition & 1 deletion fishjam/media_events/server/server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ message MediaEvent {
map<string, string> mid_to_track_id = 2;
}

// Sent to inform that the track denoted by `trackId` has changed their voice actiivty
// Sent to inform that the track denoted by `trackId` has changed their voice activity
// For this notification to work, the server must be configured to use VAD extension
// and the sender must support it.
message VadNotification {
Expand Down
13 changes: 13 additions & 0 deletions fishjam/media_events/shared.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,16 @@ enum Variant {
VARIANT_MEDIUM = 2;
VARIANT_HIGH = 3;
}

message ChannelMessageBinaryPayload {
bytes data = 1;
}

message ChannelMessage {
string source = 1;
repeated string destinations = 2;

oneof payload {
ChannelMessageBinaryPayload binary = 3;
}
}
2 changes: 1 addition & 1 deletion fishjam/peer_notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ message PeerMessage {
string data = 1;
}

// Any type of WebRTC messages passed betweend FJ and peer
// Any type of WebRTC messages passed between FJ and peer
message MediaEvent {
string data = 1;
}
Expand Down
26 changes: 24 additions & 2 deletions fishjam/server_notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ message ServerMessage {
EVENT_TYPE_SERVER_NOTIFICATION = 1;
}

// Request sent by peer to subsribe for certain message type
// Request sent by peer to subscribe for certain message type
message SubscribeRequest {
EventType event_type = 1;
}
Expand All @@ -100,7 +100,7 @@ message ServerMessage {
string component_id = 2;
}

// Notification sent when the HLS recording is successfully uploded to AWS S3
// Notification sent when the HLS recording is successfully uploaded to AWS S3
message HlsUploaded {
string room_id = 1;
}
Expand Down Expand Up @@ -148,6 +148,26 @@ message ServerMessage {
notifications.Track track = 4;
}

// Notification sent when a peer creates a channel
message ChannelAdded {
string room_id = 1;
oneof endpoint_info {
string peer_id = 2;
string component_id = 3;
}
string channel_id = 4;
}

// Notification sent when a peer deletes a channel
message ChannelRemoved {
string room_id = 1;
oneof endpoint_info {
string peer_id = 2;
string component_id = 3;
}
string channel_id = 4;
}

// Notification sent when streamer successfully connects
message StreamConnected {
string stream_id = 1;
Expand Down Expand Up @@ -209,5 +229,7 @@ message ServerMessage {
ViewerDisconnected viewer_disconnected = 25;
StreamerConnected streamer_connected = 26;
StreamerDisconnected streamer_disconnected = 27;
ChannelAdded channel_added = 28;
ChannelRemoved channel_removed = 29;
}
}
Loading
Loading