Skip to content

Commit 62b1538

Browse files
authored
Use forked twirp codegen lib (#187)
1 parent 4c872a7 commit 62b1538

File tree

13 files changed

+335
-387
lines changed

13 files changed

+335
-387
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ jobs:
3636
- name: Sync environment & install dev extras
3737
run: |
3838
uv sync --all-packages --all-extras --dev --all-groups
39-
uv remove twirp@git+https://github.com/tbarbugli/twirpy --group dev || true
40-
uv add twirp || true
4139
4240
- name: Build core distributions
4341
run: |

generate_webrtc.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,21 @@ fi
4343
echo "Installing Python dependencies..."
4444
uv sync --all-extras --dev --all-packages
4545

46-
# Install Twirp Python generator if not available
47-
if ! command -v protoc-gen-twirpy &> /dev/null; then
48-
echo "Installing protoc-gen-twirpy..."
49-
50-
# Ensure Go tools are available for Twirp
51-
if ! command -v go &> /dev/null; then
52-
echo "go is not installed. Please install it to generate Twirp client code."
53-
exit 1
54-
fi
55-
56-
go install github.com/verloop/twirpy/protoc-gen-twirpy@latest
57-
58-
# Ensure that Go path is in path otherwise protoc will not
59-
if ! echo "$PATH" | grep -q "$(go env GOPATH)/bin"; then
60-
echo "$(go env GOPATH)/bin is not in PATH"
61-
exit 1
62-
fi
46+
# Ensure Go tools are available for Twirp
47+
if ! command -v go &> /dev/null; then
48+
echo "go is not installed. Please install it to generate Twirp client code."
49+
exit 1
6350
fi
6451

52+
# Ensure that Go path is in path otherwise protoc will not
53+
if ! echo "$PATH" | grep -q "$(go env GOPATH)/bin"; then
54+
echo "$(go env GOPATH)/bin is not in PATH"
55+
exit 1
56+
fi
57+
58+
echo "Installing protoc-gen-twirpy..."
59+
go install github.com/tbarbugli/twirpy/protoc-gen-twirpy@423caa6
60+
6561
# Get the path to protoc
6662
PROTOC_PATH=$(command -v protoc)
6763
if [ -z "$PROTOC_PATH" ]; then

getstream/video/rtc/pb/stream/video/sfu/event/events_pb2.py

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

getstream/video/rtc/pb/stream/video/sfu/event/events_pb2.pyi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,7 @@ class JoinRequest(google.protobuf.message.Message):
689689

690690
TOKEN_FIELD_NUMBER: builtins.int
691691
SESSION_ID_FIELD_NUMBER: builtins.int
692+
UNIFIED_SESSION_ID_FIELD_NUMBER: builtins.int
692693
SUBSCRIBER_SDP_FIELD_NUMBER: builtins.int
693694
PUBLISHER_SDP_FIELD_NUMBER: builtins.int
694695
CLIENT_DETAILS_FIELD_NUMBER: builtins.int
@@ -698,8 +699,14 @@ class JoinRequest(google.protobuf.message.Message):
698699
PREFERRED_PUBLISH_OPTIONS_FIELD_NUMBER: builtins.int
699700
PREFERRED_SUBSCRIBE_OPTIONS_FIELD_NUMBER: builtins.int
700701
CAPABILITIES_FIELD_NUMBER: builtins.int
702+
SOURCE_FIELD_NUMBER: builtins.int
701703
token: builtins.str
702704
session_id: builtins.str
705+
unified_session_id: builtins.str
706+
"""user_session id can change during reconnects, this helps us to
707+
identify the user across reconnects and should remain consistent until the user explicitly
708+
disconnects, is kicked or the call is ended.
709+
"""
703710
subscriber_sdp: builtins.str
704711
"""dumb SDP that allow us to extract subscriber's decode codecs"""
705712
publisher_sdp: builtins.str
@@ -739,11 +746,13 @@ class JoinRequest(google.protobuf.message.Message):
739746
) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[
740747
video.sfu.models.models_pb2.ClientCapability.ValueType
741748
]: ...
749+
source: video.sfu.models.models_pb2.ParticipantSource.ValueType
742750
def __init__(
743751
self,
744752
*,
745753
token: builtins.str = ...,
746754
session_id: builtins.str = ...,
755+
unified_session_id: builtins.str = ...,
747756
subscriber_sdp: builtins.str = ...,
748757
publisher_sdp: builtins.str = ...,
749758
client_details: video.sfu.models.models_pb2.ClientDetails | None = ...,
@@ -762,6 +771,7 @@ class JoinRequest(google.protobuf.message.Message):
762771
video.sfu.models.models_pb2.ClientCapability.ValueType
763772
]
764773
| None = ...,
774+
source: video.sfu.models.models_pb2.ParticipantSource.ValueType = ...,
765775
) -> None: ...
766776
def HasField(
767777
self,
@@ -795,10 +805,14 @@ class JoinRequest(google.protobuf.message.Message):
795805
b"reconnect_details",
796806
"session_id",
797807
b"session_id",
808+
"source",
809+
b"source",
798810
"subscriber_sdp",
799811
b"subscriber_sdp",
800812
"token",
801813
b"token",
814+
"unified_session_id",
815+
b"unified_session_id",
802816
],
803817
) -> None: ...
804818

getstream/video/rtc/pb/stream/video/sfu/models/models_pb2.py

Lines changed: 78 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

getstream/video/rtc/pb/stream/video/sfu/models/models_pb2.pyi

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,63 @@ TRACK_TYPE_SCREEN_SHARE: TrackType.ValueType # 3
115115
TRACK_TYPE_SCREEN_SHARE_AUDIO: TrackType.ValueType # 4
116116
global___TrackType = TrackType
117117

118+
class _ParticipantSource:
119+
ValueType = typing.NewType("ValueType", builtins.int)
120+
V: typing_extensions.TypeAlias = ValueType
121+
122+
class _ParticipantSourceEnumTypeWrapper(
123+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
124+
_ParticipantSource.ValueType
125+
],
126+
builtins.type,
127+
):
128+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
129+
PARTICIPANT_SOURCE_WEBRTC_UNSPECIFIED: _ParticipantSource.ValueType # 0
130+
PARTICIPANT_SOURCE_RTMP: _ParticipantSource.ValueType # 1
131+
PARTICIPANT_SOURCE_WHIP: _ParticipantSource.ValueType # 2
132+
PARTICIPANT_SOURCE_SIP: _ParticipantSource.ValueType # 3
133+
PARTICIPANT_SOURCE_RTSP: _ParticipantSource.ValueType # 4
134+
PARTICIPANT_SOURCE_SRT: _ParticipantSource.ValueType # 5
135+
136+
class ParticipantSource(
137+
_ParticipantSource, metaclass=_ParticipantSourceEnumTypeWrapper
138+
):
139+
"""must be aligned with kit"""
140+
141+
PARTICIPANT_SOURCE_WEBRTC_UNSPECIFIED: ParticipantSource.ValueType # 0
142+
PARTICIPANT_SOURCE_RTMP: ParticipantSource.ValueType # 1
143+
PARTICIPANT_SOURCE_WHIP: ParticipantSource.ValueType # 2
144+
PARTICIPANT_SOURCE_SIP: ParticipantSource.ValueType # 3
145+
PARTICIPANT_SOURCE_RTSP: ParticipantSource.ValueType # 4
146+
PARTICIPANT_SOURCE_SRT: ParticipantSource.ValueType # 5
147+
global___ParticipantSource = ParticipantSource
148+
149+
class _AudioBitrateProfile:
150+
ValueType = typing.NewType("ValueType", builtins.int)
151+
V: typing_extensions.TypeAlias = ValueType
152+
153+
class _AudioBitrateProfileEnumTypeWrapper(
154+
google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
155+
_AudioBitrateProfile.ValueType
156+
],
157+
builtins.type,
158+
):
159+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
160+
AUDIO_BITRATE_PROFILE_VOICE_STANDARD_UNSPECIFIED: (
161+
_AudioBitrateProfile.ValueType
162+
) # 0
163+
AUDIO_BITRATE_PROFILE_VOICE_HIGH_QUALITY: _AudioBitrateProfile.ValueType # 1
164+
AUDIO_BITRATE_PROFILE_MUSIC_HIGH_QUALITY: _AudioBitrateProfile.ValueType # 2
165+
166+
class AudioBitrateProfile(
167+
_AudioBitrateProfile, metaclass=_AudioBitrateProfileEnumTypeWrapper
168+
): ...
169+
170+
AUDIO_BITRATE_PROFILE_VOICE_STANDARD_UNSPECIFIED: AudioBitrateProfile.ValueType # 0
171+
AUDIO_BITRATE_PROFILE_VOICE_HIGH_QUALITY: AudioBitrateProfile.ValueType # 1
172+
AUDIO_BITRATE_PROFILE_MUSIC_HIGH_QUALITY: AudioBitrateProfile.ValueType # 2
173+
global___AudioBitrateProfile = AudioBitrateProfile
174+
118175
class _ErrorCode:
119176
ValueType = typing.NewType("ValueType", builtins.int)
120177
V: typing_extensions.TypeAlias = ValueType
@@ -587,6 +644,7 @@ class Participant(google.protobuf.message.Message):
587644
IMAGE_FIELD_NUMBER: builtins.int
588645
CUSTOM_FIELD_NUMBER: builtins.int
589646
ROLES_FIELD_NUMBER: builtins.int
647+
SOURCE_FIELD_NUMBER: builtins.int
590648
user_id: builtins.str
591649
session_id: builtins.str
592650
@property
@@ -613,6 +671,7 @@ class Participant(google.protobuf.message.Message):
613671
) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[
614672
builtins.str
615673
]: ...
674+
source: global___ParticipantSource.ValueType
616675
def __init__(
617676
self,
618677
*,
@@ -630,6 +689,7 @@ class Participant(google.protobuf.message.Message):
630689
image: builtins.str = ...,
631690
custom: google.protobuf.struct_pb2.Struct | None = ...,
632691
roles: collections.abc.Iterable[builtins.str] | None = ...,
692+
source: global___ParticipantSource.ValueType = ...,
633693
) -> None: ...
634694
def HasField(
635695
self,
@@ -662,6 +722,8 @@ class Participant(google.protobuf.message.Message):
662722
b"roles",
663723
"session_id",
664724
b"session_id",
725+
"source",
726+
b"source",
665727
"track_lookup_prefix",
666728
b"track_lookup_prefix",
667729
"user_id",
@@ -810,6 +872,7 @@ class PublishOption(google.protobuf.message.Message):
810872
VIDEO_DIMENSION_FIELD_NUMBER: builtins.int
811873
ID_FIELD_NUMBER: builtins.int
812874
USE_SINGLE_LAYER_FIELD_NUMBER: builtins.int
875+
AUDIO_BITRATE_PROFILES_FIELD_NUMBER: builtins.int
813876
track_type: global___TrackType.ValueType
814877
"""The type of the track being published (e.g., video, screenshare)."""
815878
@property
@@ -860,6 +923,13 @@ class PublishOption(google.protobuf.message.Message):
860923
disabling all lower layers. This applies to simulcast encodings.
861924
For SVC codecs, prefer using the L1T3 (single spatial, 3 temporal layers) mode instead.
862925
"""
926+
@property
927+
def audio_bitrate_profiles(
928+
self,
929+
) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
930+
global___AudioBitrate
931+
]:
932+
"""Audio bitrate profiles for different audio quality profiles."""
863933
def __init__(
864934
self,
865935
*,
@@ -872,6 +942,8 @@ class PublishOption(google.protobuf.message.Message):
872942
video_dimension: global___VideoDimension | None = ...,
873943
id: builtins.int = ...,
874944
use_single_layer: builtins.bool = ...,
945+
audio_bitrate_profiles: collections.abc.Iterable[global___AudioBitrate]
946+
| None = ...,
875947
) -> None: ...
876948
def HasField(
877949
self,
@@ -882,6 +954,8 @@ class PublishOption(google.protobuf.message.Message):
882954
def ClearField(
883955
self,
884956
field_name: typing_extensions.Literal[
957+
"audio_bitrate_profiles",
958+
b"audio_bitrate_profiles",
885959
"bitrate",
886960
b"bitrate",
887961
"codec",
@@ -977,6 +1051,29 @@ class ICETrickle(google.protobuf.message.Message):
9771051

9781052
global___ICETrickle = ICETrickle
9791053

1054+
@typing_extensions.final
1055+
class AudioBitrate(google.protobuf.message.Message):
1056+
DESCRIPTOR: google.protobuf.descriptor.Descriptor
1057+
1058+
PROFILE_FIELD_NUMBER: builtins.int
1059+
BITRATE_FIELD_NUMBER: builtins.int
1060+
profile: global___AudioBitrateProfile.ValueType
1061+
bitrate: builtins.int
1062+
def __init__(
1063+
self,
1064+
*,
1065+
profile: global___AudioBitrateProfile.ValueType = ...,
1066+
bitrate: builtins.int = ...,
1067+
) -> None: ...
1068+
def ClearField(
1069+
self,
1070+
field_name: typing_extensions.Literal[
1071+
"bitrate", b"bitrate", "profile", b"profile"
1072+
],
1073+
) -> None: ...
1074+
1075+
global___AudioBitrate = AudioBitrate
1076+
9801077
@typing_extensions.final
9811078
class TrackInfo(google.protobuf.message.Message):
9821079
DESCRIPTOR: google.protobuf.descriptor.Descriptor

getstream/video/rtc/pb/stream/video/sfu/signal_rpc/signal_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)