diff --git a/doc/docs.md b/doc/docs.md index 6acfa84..62b5fe2 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -65,6 +65,12 @@ - [Variant](#fishjam-media_events-Variant) +- [fishjam/notifications/shared.proto](#fishjam_notifications_shared-proto) + - [Track](#fishjam-notifications-Track) + + - [TrackEncoding](#fishjam-notifications-TrackEncoding) + - [TrackType](#fishjam-notifications-TrackType) + - [fishjam/peer_notifications.proto](#fishjam_peer_notifications-proto) - [PeerMessage](#fishjam-PeerMessage) - [PeerMessage.AuthRequest](#fishjam-PeerMessage-AuthRequest) @@ -103,12 +109,6 @@ - [ServerMessage.EventType](#fishjam-ServerMessage-EventType) -- [fishjam/shared_notifications.proto](#fishjam_shared_notifications-proto) - - [Track](#fishjam-Track) - - - [TrackEncoding](#fishjam-TrackEncoding) - - [TrackType](#fishjam-TrackType) - - [Scalar Value Types](#scalar-value-types) @@ -146,7 +146,7 @@ Request to add a track of the specified type | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| track | [Track](#fishjam-Track) | | Specification of the track to be added | +| track | [notifications.Track](#fishjam-notifications-Track) | | Specification of the track to be added | | codec_params | [AgentRequest.AddTrack.CodecParameters](#fishjam-AgentRequest-AddTrack-CodecParameters) | | Parameters of the input data stream | @@ -162,7 +162,7 @@ Request to add a track of the specified type | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| encoding | [TrackEncoding](#fishjam-TrackEncoding) | | The format of the input stream, defaults to pcm16 | +| encoding | [notifications.TrackEncoding](#fishjam-notifications-TrackEncoding) | | The format of the input stream, defaults to pcm16 | | sample_rate | [uint32](#uint32) | | The sample rate of the input stream, may be omitted for opus | | channels | [uint32](#uint32) | | The number of channels. 1 means mono, 2 means stereo | @@ -252,7 +252,7 @@ Notification containing a chunk of a track's data stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | peer_id | [string](#string) | | | -| track | [Track](#fishjam-Track) | | | +| track | [notifications.Track](#fishjam-notifications-Track) | | | | data | [bytes](#bytes) | | | @@ -1023,6 +1023,65 @@ Contains information about an ICE candidate which will be sent to the peer/serve + +

Top

+ +## fishjam/notifications/shared.proto + + + + + +### Track +Describes a media track + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | | +| type | [TrackType](#fishjam-notifications-TrackType) | | | +| metadata | [string](#string) | | | + + + + + + + + + + +### TrackEncoding + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TRACK_ENCODING_UNSPECIFIED | 0 | | +| TRACK_ENCODING_PCM16 | 1 | | +| TRACK_ENCODING_OPUS | 2 | | + + + + + +### TrackType +Defines types of tracks being published by peers and component + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TRACK_TYPE_UNSPECIFIED | 0 | | +| TRACK_TYPE_VIDEO | 1 | | +| TRACK_TYPE_AUDIO | 2 | | + + + + + + + + + +

Top

@@ -1481,7 +1540,7 @@ Notification sent when peer or component adds new track | room_id | [string](#string) | | | | peer_id | [string](#string) | | | | component_id | [string](#string) | | | -| track | [Track](#fishjam-Track) | | | +| track | [notifications.Track](#fishjam-notifications-Track) | | | @@ -1499,7 +1558,7 @@ Notification sent when metadata of a multimedia track is updated | room_id | [string](#string) | | | | peer_id | [string](#string) | | | | component_id | [string](#string) | | | -| track | [Track](#fishjam-Track) | | | +| track | [notifications.Track](#fishjam-notifications-Track) | | | @@ -1517,7 +1576,7 @@ Notification sent when a track is removed | room_id | [string](#string) | | | | peer_id | [string](#string) | | | | component_id | [string](#string) | | | -| track | [Track](#fishjam-Track) | | | +| track | [notifications.Track](#fishjam-notifications-Track) | | | @@ -1577,65 +1636,6 @@ Defines message groups for which peer can subscribe - -

Top

- -## fishjam/shared_notifications.proto - - - - - -### Track -Describes a media track - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [string](#string) | | | -| type | [TrackType](#fishjam-TrackType) | | | -| metadata | [string](#string) | | | - - - - - - - - - - -### TrackEncoding - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| TRACK_ENCODING_UNSPECIFIED | 0 | | -| TRACK_ENCODING_PCM16 | 1 | | -| TRACK_ENCODING_OPUS | 2 | | - - - - - -### TrackType -Defines types of tracks being published by peers and component - -| Name | Number | Description | -| ---- | ------ | ----------- | -| TRACK_TYPE_UNSPECIFIED | 0 | | -| TRACK_TYPE_VIDEO | 1 | | -| TRACK_TYPE_AUDIO | 2 | | - - - - - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/fishjam/agent_notifications.proto b/fishjam/agent_notifications.proto index f92189d..2ac3d12 100644 --- a/fishjam/agent_notifications.proto +++ b/fishjam/agent_notifications.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package fishjam; -import "fishjam/shared_notifications.proto"; +import "fishjam/notifications/shared.proto"; // Defines any type of message passed from agent peer to Fishjam message AgentRequest { @@ -15,7 +15,7 @@ message AgentRequest { message AddTrack { message CodecParameters { // The format of the input stream, defaults to pcm16 - fishjam.TrackEncoding encoding = 1; + notifications.TrackEncoding encoding = 1; // The sample rate of the input stream, may be omitted for opus uint32 sample_rate = 2; // The number of channels. 1 means mono, 2 means stereo @@ -23,7 +23,7 @@ message AgentRequest { } // Specification of the track to be added - fishjam.Track track = 1; + notifications.Track track = 1; // Parameters of the input data stream CodecParameters codec_params = 2; } @@ -55,7 +55,7 @@ message AgentResponse { // Notification containing a chunk of a track's data stream message TrackData { string peer_id = 1; - fishjam.Track track = 2; + notifications.Track track = 2; bytes data = 3; } diff --git a/fishjam/shared_notifications.proto b/fishjam/notifications/shared.proto similarity index 92% rename from fishjam/shared_notifications.proto rename to fishjam/notifications/shared.proto index 061353f..eca45b0 100644 --- a/fishjam/shared_notifications.proto +++ b/fishjam/notifications/shared.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -package fishjam; +package fishjam.notifications; // Defines types of tracks being published by peers and component enum TrackType { diff --git a/fishjam/server_notifications.proto b/fishjam/server_notifications.proto index b392df5..d74163a 100644 --- a/fishjam/server_notifications.proto +++ b/fishjam/server_notifications.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package fishjam; -import "fishjam/shared_notifications.proto"; +import "fishjam/notifications/shared.proto"; // Defines any type of message passed between FJ and server peer message ServerMessage { @@ -113,7 +113,7 @@ message ServerMessage { string peer_id = 2; string component_id = 3; } - fishjam.Track track = 4; + notifications.Track track = 4; } // Notification sent when a track is removed @@ -123,7 +123,7 @@ message ServerMessage { string peer_id = 2; string component_id = 3; } - fishjam.Track track = 4; + notifications.Track track = 4; } // Notification sent when metadata of a multimedia track is updated @@ -133,7 +133,7 @@ message ServerMessage { string peer_id = 2; string component_id = 3; } - fishjam.Track track = 4; + notifications.Track track = 4; } // Notification sent when streamer successfully connects diff --git a/fishjam_protos/lib/fishjam/agent_notifications.pb.ex b/fishjam_protos/lib/fishjam/agent_notifications.pb.ex index e1100d6..d40d1b7 100644 --- a/fishjam_protos/lib/fishjam/agent_notifications.pb.ex +++ b/fishjam_protos/lib/fishjam/agent_notifications.pb.ex @@ -11,7 +11,7 @@ defmodule Fishjam.AgentRequest.AddTrack.CodecParameters do use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 - field :encoding, 1, type: Fishjam.TrackEncoding, enum: true + field :encoding, 1, type: Fishjam.Notifications.TrackEncoding, enum: true field :sample_rate, 2, type: :uint32, json_name: "sampleRate" field :channels, 3, type: :uint32 end @@ -21,7 +21,7 @@ defmodule Fishjam.AgentRequest.AddTrack do use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 - field :track, 1, type: Fishjam.Track + field :track, 1, type: Fishjam.Notifications.Track field :codec_params, 2, type: Fishjam.AgentRequest.AddTrack.CodecParameters, @@ -79,7 +79,7 @@ defmodule Fishjam.AgentResponse.TrackData do use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 field :peer_id, 1, type: :string, json_name: "peerId" - field :track, 2, type: Fishjam.Track + field :track, 2, type: Fishjam.Notifications.Track field :data, 3, type: :bytes end diff --git a/fishjam_protos/lib/fishjam/notifications/shared.pb.ex b/fishjam_protos/lib/fishjam/notifications/shared.pb.ex new file mode 100644 index 0000000..27ee9c8 --- /dev/null +++ b/fishjam_protos/lib/fishjam/notifications/shared.pb.ex @@ -0,0 +1,29 @@ +defmodule Fishjam.Notifications.TrackType do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 + + field :TRACK_TYPE_UNSPECIFIED, 0 + field :TRACK_TYPE_VIDEO, 1 + field :TRACK_TYPE_AUDIO, 2 +end + +defmodule Fishjam.Notifications.TrackEncoding do + @moduledoc false + + use Protobuf, enum: true, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 + + field :TRACK_ENCODING_UNSPECIFIED, 0 + field :TRACK_ENCODING_PCM16, 1 + field :TRACK_ENCODING_OPUS, 2 +end + +defmodule Fishjam.Notifications.Track do + @moduledoc false + + use Protobuf, protoc_gen_elixir_version: "0.15.0", syntax: :proto3 + + field :id, 1, type: :string + field :type, 2, type: Fishjam.Notifications.TrackType, enum: true + field :metadata, 3, type: :string +end diff --git a/fishjam_protos/lib/fishjam/server_notifications.pb.ex b/fishjam_protos/lib/fishjam/server_notifications.pb.ex index e14a683..8134509 100644 --- a/fishjam_protos/lib/fishjam/server_notifications.pb.ex +++ b/fishjam_protos/lib/fishjam/server_notifications.pb.ex @@ -161,7 +161,7 @@ defmodule Fishjam.ServerMessage.TrackAdded do field :room_id, 1, type: :string, json_name: "roomId" field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 - field :track, 4, type: Fishjam.Track + field :track, 4, type: Fishjam.Notifications.Track end defmodule Fishjam.ServerMessage.TrackRemoved do @@ -174,7 +174,7 @@ defmodule Fishjam.ServerMessage.TrackRemoved do field :room_id, 1, type: :string, json_name: "roomId" field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 - field :track, 4, type: Fishjam.Track + field :track, 4, type: Fishjam.Notifications.Track end defmodule Fishjam.ServerMessage.TrackMetadataUpdated do @@ -187,7 +187,7 @@ defmodule Fishjam.ServerMessage.TrackMetadataUpdated do field :room_id, 1, type: :string, json_name: "roomId" field :peer_id, 2, type: :string, json_name: "peerId", oneof: 0 field :component_id, 3, type: :string, json_name: "componentId", oneof: 0 - field :track, 4, type: Fishjam.Track + field :track, 4, type: Fishjam.Notifications.Track end defmodule Fishjam.ServerMessage.StreamConnected do