diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 593d0e3..bf09d11 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -46,7 +46,7 @@ jobs:
if: ${{ !cancelled() && steps.compile.outcome == 'success' }}
run: mix format --check-formatted
- check-protobufs-update:
+ check-fishjam-protos-update:
runs-on: ubuntu-latest
name: Fishjam protos update
strategy:
@@ -62,7 +62,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- - name: Install protobuf compiler (protoc) if needed
+ - name: Install protobuf compiler (protoc)
run: |
sudo apt update
sudo apt install -y protobuf-compiler
@@ -75,10 +75,45 @@ jobs:
run: bash compile_proto.sh
working-directory: fishjam_protos
- - name: Check for changes in protobuf files
+ - name: Check for changes in fishjam_protos files
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Generated protobuf files are not up to date. Please regenerate them and commit the changes."
git diff
exit 1
fi
+
+ - name: Generate docs
+ run: bash compile_proto.sh
+ working-directory: fishjam_protos
+
+ check-protobufs-docs:
+ runs-on: ubuntu-latest
+ name: Protobuf docs update
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Setup Go
+ uses: actions/setup-go@v5
+
+ - name: Install protobuf compiler (protoc)
+ run: |
+ sudo apt update
+ sudo apt install -y protobuf-compiler
+
+ - name: Install protobuf docs generator
+ run: |
+ go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
+
+ - name: Generate docs
+ run: |
+ find fishjam/ -name "*.proto" | sort | xargs protoc --doc_out=./doc --doc_opt=markdown,docs.md
+
+ - name: Check for changes in docs files
+ run: |
+ if [[ -n $(git status --porcelain) ]]; then
+ echo "Generated docs files are not up to date. Please regenerate them and commit the changes."
+ git diff
+ exit 1
+ fi
diff --git a/README.md b/README.md
index 74301b2..a6b2d52 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ Install [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) plugin.
Use the command below:
```command
-protoc --doc_out=./doc --doc_opt=markdown,docs.md fishjam/**/*.proto
+find fishjam/ -name "*.proto" | sort | xargs protoc --doc_out=./doc --doc_opt=markdown,docs.md
```
## Lint and formatting
diff --git a/doc/docs.md b/doc/docs.md
index 42424f7..0a493d2 100644
--- a/doc/docs.md
+++ b/doc/docs.md
@@ -14,6 +14,7 @@
- [MediaEvent.SdpOffer.MidToTrackIdEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-MidToTrackIdEntry)
- [MediaEvent.SdpOffer.TrackIdToBitratesEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-TrackIdToBitratesEntry)
- [MediaEvent.SdpOffer.TrackIdToMetadataJsonEntry](#fishjam-media_events-peer-MediaEvent-SdpOffer-TrackIdToMetadataJsonEntry)
+ - [MediaEvent.SetTargetTrackVariant](#fishjam-media_events-peer-MediaEvent-SetTargetTrackVariant)
- [MediaEvent.TrackBitrates](#fishjam-media_events-peer-MediaEvent-TrackBitrates)
- [MediaEvent.UpdateEndpointMetadata](#fishjam-media_events-peer-MediaEvent-UpdateEndpointMetadata)
- [MediaEvent.UpdateTrackMetadata](#fishjam-media_events-peer-MediaEvent-UpdateTrackMetadata)
@@ -118,6 +119,7 @@ SCHEMAS
| track_bitrates | [MediaEvent.TrackBitrates](#fishjam-media_events-peer-MediaEvent-TrackBitrates) | | |
| enable_track_variant | [MediaEvent.EnableTrackVariant](#fishjam-media_events-peer-MediaEvent-EnableTrackVariant) | | |
| disable_track_variant | [MediaEvent.DisableTrackVariant](#fishjam-media_events-peer-MediaEvent-DisableTrackVariant) | | |
+| set_target_track_variant | [MediaEvent.SetTargetTrackVariant](#fishjam-media_events-peer-MediaEvent-SetTargetTrackVariant) | | |
@@ -259,6 +261,22 @@ The "mid" is an identifier used to associate an RTP packet with an MLine
+
+
+### MediaEvent.SetTargetTrackVariant
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| track_id | [string](#string) | | |
+| variant | [fishjam.media_events.Variant](#fishjam-media_events-Variant) | | |
+
+
+
+
+
+
### MediaEvent.TrackBitrates
diff --git a/fishjam/media_events/peer/peer.proto b/fishjam/media_events/peer/peer.proto
index b3bd23b..1b7ea07 100644
--- a/fishjam/media_events/peer/peer.proto
+++ b/fishjam/media_events/peer/peer.proto
@@ -65,6 +65,11 @@ message MediaEvent {
media_events.Variant variant = 2;
}
+ message SetTargetTrackVariant {
+ string track_id = 1;
+ media_events.Variant variant = 2;
+ }
+
oneof content {
Connect connect = 1;
Disconnect disconnect = 2;
@@ -76,5 +81,6 @@ message MediaEvent {
TrackBitrates track_bitrates = 8;
EnableTrackVariant enable_track_variant = 9;
DisableTrackVariant disable_track_variant = 10;
+ SetTargetTrackVariant set_target_track_variant = 11;
}
}
diff --git a/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex b/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex
index 11e4b43..d5c524a 100644
--- a/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex
+++ b/fishjam_protos/lib/fishjam/media_events/peer/peer.pb.ex
@@ -128,6 +128,15 @@ defmodule Fishjam.MediaEvents.Peer.MediaEvent.EnableTrackVariant do
field :variant, 2, type: Fishjam.MediaEvents.Variant, enum: true
end
+defmodule Fishjam.MediaEvents.Peer.MediaEvent.SetTargetTrackVariant do
+ @moduledoc false
+
+ use Protobuf, syntax: :proto3, protoc_gen_elixir_version: "0.13.0"
+
+ field :track_id, 1, type: :string, json_name: "trackId"
+ field :variant, 2, type: Fishjam.MediaEvents.Variant, enum: true
+end
+
defmodule Fishjam.MediaEvents.Peer.MediaEvent do
@moduledoc false
@@ -174,4 +183,9 @@ defmodule Fishjam.MediaEvents.Peer.MediaEvent do
type: Fishjam.MediaEvents.Peer.MediaEvent.DisableTrackVariant,
json_name: "disableTrackVariant",
oneof: 0
+
+ field :set_target_track_variant, 11,
+ type: Fishjam.MediaEvents.Peer.MediaEvent.SetTargetTrackVariant,
+ json_name: "setTargetTrackVariant",
+ oneof: 0
end