From 907be698fdb6f59d5058fa89b72b3c6e8474a15e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Monnom?= Date: Tue, 3 Oct 2023 14:10:05 -0700 Subject: [PATCH] feat: initial monorepo & server sdk (#61) Co-authored-by: David Zhao --- .gitattributes | 4 +- .github/workflows/build-api.yml | 63 + .../{build-wheels.yml => build-rtc.yml} | 38 +- .gitmodules | 5 +- examples/basic_room.py | 68 +- examples/e2ee.py | 35 +- examples/face_landmark/face_landmark.py | 20 +- examples/publish_hue.py | 27 +- examples/publish_wave.py | 27 +- examples/whisper/whisper.py | 31 +- livekit-api/README.md | 0 livekit-api/generate_proto.sh | 39 + livekit-api/livekit/api/__init__.py | 21 + livekit-api/livekit/api/_proto/__init__.py | 0 .../livekit/api/_proto/livekit_egress_pb2.py | 132 ++ .../livekit/api/_proto/livekit_egress_pb2.pyi | 1290 +++++++++++++++++ .../livekit/api/_proto/livekit_ingress_pb2.py | 62 + .../api/_proto/livekit_ingress_pb2.pyi | 542 +++++++ .../livekit/api/_proto/livekit_models_pb2.py | 106 ++ .../livekit/api/_proto/livekit_models_pb2.pyi | 1158 +++++++++++++++ .../livekit/api/_proto/livekit_room_pb2.py | 67 + .../livekit/api/_proto/livekit_room_pb2.pyi | 416 ++++++ .../livekit/api/_proto/livekit_webhook_pb2.py | 30 + .../api/_proto/livekit_webhook_pb2.pyi | 86 ++ livekit-api/livekit/api/_service.py | 22 + livekit-api/livekit/api/_twirp_client.py | 83 ++ livekit-api/livekit/api/access_token.py | 112 ++ livekit-api/livekit/api/room_service.py | 65 + livekit-api/livekit/api/version.py | 1 + livekit-api/protocol | 1 + livekit-api/pyproject.toml | 5 + livekit-api/setup.py | 59 + livekit-rtc/README.md | 1 + .../generate_proto.sh | 12 +- .../livekit/rtc}/__init__.py | 2 +- .../livekit/rtc}/_ffi_client.py | 2 +- .../livekit/rtc}/_proto/__init__.py | 0 .../livekit/rtc}/_proto/audio_frame_pb2.py | 0 .../livekit/rtc}/_proto/audio_frame_pb2.pyi | 0 .../livekit/rtc}/_proto/e2ee_pb2.py | 0 .../livekit/rtc}/_proto/e2ee_pb2.pyi | 0 .../livekit/rtc}/_proto/ffi_pb2.py | 0 .../livekit/rtc}/_proto/ffi_pb2.pyi | 0 .../livekit/rtc}/_proto/handle_pb2.py | 0 .../livekit/rtc}/_proto/handle_pb2.pyi | 0 .../livekit/rtc}/_proto/participant_pb2.py | 0 .../livekit/rtc}/_proto/participant_pb2.pyi | 0 .../livekit/rtc}/_proto/room_pb2.py | 0 .../livekit/rtc}/_proto/room_pb2.pyi | 0 .../livekit/rtc}/_proto/track_pb2.py | 0 .../livekit/rtc}/_proto/track_pb2.pyi | 0 .../livekit/rtc}/_proto/video_frame_pb2.py | 0 .../livekit/rtc}/_proto/video_frame_pb2.pyi | 0 .../livekit/rtc}/_utils.py | 0 .../livekit/rtc}/audio_frame.py | 0 .../livekit/rtc}/audio_source.py | 0 .../livekit/rtc}/audio_stream.py | 0 {livekit => livekit-rtc/livekit/rtc}/e2ee.py | 0 .../livekit/rtc}/participant.py | 0 .../livekit/rtc}/resources/.gitignore | 0 {livekit => livekit-rtc/livekit/rtc}/room.py | 0 {livekit => livekit-rtc/livekit/rtc}/track.py | 0 .../livekit/rtc}/track_publication.py | 3 +- .../livekit/rtc}/version.py | 0 .../livekit/rtc}/video_frame.py | 0 .../livekit/rtc}/video_source.py | 0 .../livekit/rtc}/video_stream.py | 0 pyproject.toml => livekit-rtc/pyproject.toml | 16 +- rust-sdks => livekit-rtc/rust-sdks | 0 setup.py => livekit-rtc/setup.py | 21 +- 70 files changed, 4510 insertions(+), 162 deletions(-) create mode 100644 .github/workflows/build-api.yml rename .github/workflows/{build-wheels.yml => build-rtc.yml} (71%) create mode 100644 livekit-api/README.md create mode 100755 livekit-api/generate_proto.sh create mode 100644 livekit-api/livekit/api/__init__.py create mode 100644 livekit-api/livekit/api/_proto/__init__.py create mode 100644 livekit-api/livekit/api/_proto/livekit_egress_pb2.py create mode 100644 livekit-api/livekit/api/_proto/livekit_egress_pb2.pyi create mode 100644 livekit-api/livekit/api/_proto/livekit_ingress_pb2.py create mode 100644 livekit-api/livekit/api/_proto/livekit_ingress_pb2.pyi create mode 100644 livekit-api/livekit/api/_proto/livekit_models_pb2.py create mode 100644 livekit-api/livekit/api/_proto/livekit_models_pb2.pyi create mode 100644 livekit-api/livekit/api/_proto/livekit_room_pb2.py create mode 100644 livekit-api/livekit/api/_proto/livekit_room_pb2.pyi create mode 100644 livekit-api/livekit/api/_proto/livekit_webhook_pb2.py create mode 100644 livekit-api/livekit/api/_proto/livekit_webhook_pb2.pyi create mode 100644 livekit-api/livekit/api/_service.py create mode 100644 livekit-api/livekit/api/_twirp_client.py create mode 100644 livekit-api/livekit/api/access_token.py create mode 100644 livekit-api/livekit/api/room_service.py create mode 100644 livekit-api/livekit/api/version.py create mode 160000 livekit-api/protocol create mode 100644 livekit-api/pyproject.toml create mode 100644 livekit-api/setup.py create mode 100644 livekit-rtc/README.md rename generate_proto.sh => livekit-rtc/generate_proto.sh (85%) rename {livekit => livekit-rtc/livekit/rtc}/__init__.py (98%) rename {livekit => livekit-rtc/livekit/rtc}/_ffi_client.py (98%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/__init__.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/audio_frame_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/audio_frame_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/e2ee_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/e2ee_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/ffi_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/ffi_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/handle_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/handle_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/participant_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/participant_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/room_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/room_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/track_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/track_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/video_frame_pb2.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/_proto/video_frame_pb2.pyi (100%) rename {livekit => livekit-rtc/livekit/rtc}/_utils.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/audio_frame.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/audio_source.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/audio_stream.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/e2ee.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/participant.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/resources/.gitignore (100%) rename {livekit => livekit-rtc/livekit/rtc}/room.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/track.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/track_publication.py (97%) rename {livekit => livekit-rtc/livekit/rtc}/version.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/video_frame.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/video_source.py (100%) rename {livekit => livekit-rtc/livekit/rtc}/video_stream.py (100%) rename pyproject.toml => livekit-rtc/pyproject.toml (66%) rename rust-sdks => livekit-rtc/rust-sdks (100%) rename setup.py => livekit-rtc/setup.py (85%) diff --git a/.gitattributes b/.gitattributes index e050fdfa..d550bff9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ **/*.dll filter=lfs diff=lfs merge=lfs -text **/*.so filter=lfs diff=lfs merge=lfs -text -**/*.dylib filter=lfs diff=lfs merge=lfs -text \ No newline at end of file +**/*.dylib filter=lfs diff=lfs merge=lfs -text +livekit-api/livekit/api/_proto/** linguist-generated=true +livekit-rtc/livekit/rtc/_proto/** linguist-generated=true diff --git a/.github/workflows/build-api.yml b/.github/workflows/build-api.yml new file mode 100644 index 00000000..e9677e2c --- /dev/null +++ b/.github/workflows/build-api.yml @@ -0,0 +1,63 @@ +name: Build API + +on: + push: + paths: + - livekit-api/** + pull_request: + paths: + - livekit-api/** + workflow_dispatch: + +env: + PACKAGE_DIR: ./livekit-api + +jobs: + build_wheels: + name: Build API wheel/sdist + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ env.PACKAGE_DIR }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - uses: actions/setup-python@v4 + + - name: Build wheel + run: | + pip3 install build wheel + python3 -m build --wheel + env: + CIBW_ARCHS: ${{ matrix.archs }} + CIBW_SKIP: "*-musllinux_*" + + - name: Build SDist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + name: api-release + path: | + livekit-api/dist/*.whl + livekit-api/dist/*.tar.gz + + publish: + name: Publish API release + needs: build_wheels + runs-on: ubuntu-latest + permissions: + id-token: write + if: startsWith(github.ref, 'refs/tags/api-v') + steps: + - uses: actions/download-artifact@v3 + with: + name: api-release + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-rtc.yml similarity index 71% rename from .github/workflows/build-wheels.yml rename to .github/workflows/build-rtc.yml index 25b702d6..c6551ee7 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-rtc.yml @@ -1,15 +1,20 @@ -name: Build +name: Build RTC on: push: - branches: ["main"] - tags: ["v*"] + paths: + - livekit-rtc/** pull_request: + paths: + - livekit-rtc/** workflow_dispatch: +env: + PACKAGE_DIR: ./livekit-rtc + jobs: build_wheels: - name: Build wheels (${{ matrix.archs }}) + name: Build RTC wheels (${{ matrix.archs }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -24,7 +29,9 @@ jobs: archs: AMD64 # ignore windows arm64 for now - os: macos-latest archs: x86_64 arm64 - + defaults: + run: + working-directory: ${{ env.PACKAGE_DIR }} steps: - uses: actions/checkout@v3 with: @@ -39,16 +46,18 @@ jobs: run: python3 -m cibuildwheel --output-dir dist env: CIBW_ARCHS: ${{ matrix.archs }} - CIBW_SKIP: "*-musllinux_*" - uses: actions/upload-artifact@v3 with: - name: release - path: dist/*.whl + name: rtc-release + path: livekit-rtc/dist/*.whl make_sdist: - name: Make SDist + name: Make RTC sdist runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ env.PACKAGE_DIR }} steps: - uses: actions/checkout@v3 with: @@ -59,21 +68,20 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: release - path: dist/*.tar.gz + name: rtc-release + path: livekit-rtc/dist/*.tar.gz publish: - name: Publish + name: Publish RTC release needs: [build_wheels, make_sdist] runs-on: ubuntu-latest permissions: id-token: write - # only execute on tag push v1 or workflow_dispatch - if: (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch' + if: startsWith(github.ref, 'refs/tags/rtc-v') steps: - uses: actions/download-artifact@v3 with: - name: release + name: rtc-release path: dist - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitmodules b/.gitmodules index 7bd5abd1..7d1503a3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "client-sdk-rust"] - path = rust-sdks + path = livekit-rtc/rust-sdks url = https://github.com/livekit/rust-sdks +[submodule "livekit-api/protocol"] + path = livekit-api/protocol + url = https://github.com/livekit/protocol diff --git a/examples/basic_room.py b/examples/basic_room.py index 3c071407..dd80dc5f 100644 --- a/examples/basic_room.py +++ b/examples/basic_room.py @@ -3,98 +3,98 @@ from signal import SIGINT, SIGTERM from typing import Union -import livekit +from livekit import rtc URL = 'ws://localhost:7880' TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY' # noqa -async def main(room: livekit.Room) -> None: +async def main(room: rtc.Room) -> None: @room.listens_to("participant_connected") - def on_participant_connected(participant: livekit.RemoteParticipant) -> None: + def on_participant_connected(participant: rtc.RemoteParticipant) -> None: logging.info( "participant connected: %s %s", participant.sid, participant.identity) @room.listens_to("participant_disconnected") - def on_participant_disconnected(participant: livekit.RemoteParticipant): + def on_participant_disconnected(participant: rtc.RemoteParticipant): logging.info("participant disconnected: %s %s", participant.sid, participant.identity) @room.listens_to("local_track_published") - def on_local_track_published(publication: livekit.LocalTrackPublication, - track: Union[livekit.LocalAudioTrack, - livekit.LocalVideoTrack]): + def on_local_track_published(publication: rtc.LocalTrackPublication, + track: Union[rtc.LocalAudioTrack, + rtc.LocalVideoTrack]): logging.info("local track published: %s", publication.sid) @room.listens_to("active_speakers_changed") - def on_active_speakers_changed(speakers: list[livekit.Participant]): + def on_active_speakers_changed(speakers: list[rtc.Participant]): logging.info("active speakers changed: %s", speakers) @room.listens_to("local_track_unpublished") - def on_local_track_unpublished(publication: livekit.LocalTrackPublication): + def on_local_track_unpublished(publication: rtc.LocalTrackPublication): logging.info("local track unpublished: %s", publication.sid) @room.listens_to("track_published") - def on_track_published(publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_published(publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track published: %s from participant %s (%s)", publication.sid, participant.sid, participant.identity) @room.listens_to("track_unpublished") - def on_track_unpublished(publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_unpublished(publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track unpublished: %s", publication.sid) @room.listens_to("track_subscribed") - def on_track_subscribed(track: livekit.Track, - publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_subscribed(track: rtc.Track, + publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track subscribed: %s", publication.sid) - if track.kind == livekit.TrackKind.KIND_VIDEO: - _video_stream = livekit.VideoStream(track) + if track.kind == rtc.TrackKind.KIND_VIDEO: + _video_stream = rtc.VideoStream(track) # video_stream is an async iterator that yields VideoFrame - elif track.kind == livekit.TrackKind.KIND_AUDIO: + elif track.kind == rtc.TrackKind.KIND_AUDIO: print("Subscribed to an Audio Track") - _audio_stream = livekit.AudioStream(track) + _audio_stream = rtc.AudioStream(track) # audio_stream is an async iterator that yields AudioFrame @room.listens_to("track_unsubscribed") - def on_track_unsubscribed(track: livekit.Track, - publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_unsubscribed(track: rtc.Track, + publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track unsubscribed: %s", publication.sid) @room.listens_to("track_muted") - def on_track_muted(publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_muted(publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track muted: %s", publication.sid) @room.listens_to("track_unmuted") - def on_track_unmuted(publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_unmuted(publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("track unmuted: %s", publication.sid) @room.listens_to("data_received") def on_data_received(data: bytes, - kind: livekit.DataPacketKind, - participant: livekit.Participant): + kind: rtc.DataPacketKind, + participant: rtc.Participant): logging.info("received data from %s: %s", participant.identity, data) @room.listens_to("connection_quality_changed") - def on_connection_quality_changed(participant: livekit.Participant, - quality: livekit.ConnectionQuality): + def on_connection_quality_changed(participant: rtc.Participant, + quality: rtc.ConnectionQuality): logging.info("connection quality changed for %s", participant.identity) @room.listens_to("track_subscription_failed") - def on_track_subscription_failed(participant: livekit.RemoteParticipant, + def on_track_subscription_failed(participant: rtc.RemoteParticipant, track_sid: str, error: str): logging.info("track subscription failed: %s %s", participant.identity, error) @room.listens_to("connection_state_changed") - def on_connection_state_changed(state: livekit.ConnectionState): + def on_connection_state_changed(state: rtc.ConnectionState): logging.info("connection state changed: %s", state) @room.listens_to("connected") @@ -127,7 +127,7 @@ def on_reconnected() -> None: logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/examples/e2ee.py b/examples/e2ee.py index a5f0dc62..99403784 100644 --- a/examples/e2ee.py +++ b/examples/e2ee.py @@ -3,17 +3,16 @@ from signal import SIGINT, SIGTERM import numpy as np - -import livekit +from livekit import rtc URL = 'ws://localhost:7880' TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY' # noqa # ("livekitrocks") this is our shared key, it must match the one used by your clients -SHARED_KEY = b"livekitrocks" +SHARED_KEY = b"liveitrocks" -async def draw_cube(source: livekit.VideoSource): +async def draw_cube(source: rtc.VideoSource): W, H, MID_W, MID_H = 1280, 720, 640, 360 cube_size = 60 vertices = (np.array([[-1, -1, -1], [1, -1, -1], [1, 1, -1], [-1, 1, -1], @@ -21,7 +20,7 @@ async def draw_cube(source: livekit.VideoSource): edges = [[0, 1], [1, 2], [2, 3], [3, 0], [4, 5], [5, 6], [6, 7], [7, 4], [0, 4], [1, 5], [2, 6], [3, 7]] - frame = livekit.ArgbFrame(livekit.VideoFormatType.FORMAT_ARGB, W, H) + frame = rtc.ArgbFrame(livekit.VideoFormatType.FORMAT_ARGB, W, H) arr = np.ctypeslib.as_array(frame.data) angle = 0 @@ -48,8 +47,8 @@ async def draw_cube(source: livekit.VideoSource): idx = (y + dy) * W * 4 + (x + dx) * 4 arr[idx:idx+4] = [255, 255, 255, 255] - f = livekit.VideoFrame( - 0, livekit.VideoRotation.VIDEO_ROTATION_0, frame.to_i420()) + f = rtc.VideoFrame( + 0, rtc.VideoRotation.VIDEO_ROTATION_0, frame.to_i420()) source.capture_frame(f) angle += 0.02 @@ -57,32 +56,32 @@ async def draw_cube(source: livekit.VideoSource): await asyncio.sleep(1 / 30 - code_duration) -async def main(room: livekit.Room): +async def main(room: rtc.Room): @room.listens_to("e2ee_state_changed") - def on_e2ee_state_changed(participant: livekit.Participant, - state: livekit.EncryptionState) -> None: + def on_e2ee_state_changed(participant: rtc.Participant, + state: rtc.EncryptionState) -> None: logging.info("e2ee state changed: %s %s", participant.identity, state) logging.info("connecting to %s", URL) try: - e2ee_options = livekit.E2EEOptions() + e2ee_options = rtc.E2EEOptions() e2ee_options.key_provider_options.shared_key = SHARED_KEY - await room.connect(URL, TOKEN, options=livekit.RoomOptions( + await room.connect(URL, TOKEN, options=rtc.RoomOptions( auto_subscribe=True, e2ee=e2ee_options )) logging.info("connected to room %s", room.name) - except livekit.ConnectError as e: + except rtc.ConnectError as e: logging.error("failed to connect to the room: %s", e) return False # publish a track - source = livekit.VideoSource() - track = livekit.LocalVideoTrack.create_video_track("cube", source) - options = livekit.TrackPublishOptions() - options.source = livekit.TrackSource.SOURCE_CAMERA + source = rtc.VideoSource() + track = rtc.LocalVideoTrack.create_video_track("cube", source) + options = rtc.TrackPublishOptions() + options.source = rtc.TrackSource.SOURCE_CAMERA publication = await room.local_participant.publish_track(track, options) logging.info("published track %s", publication.sid) @@ -94,7 +93,7 @@ def on_e2ee_state_changed(participant: livekit.Participant, logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/examples/face_landmark/face_landmark.py b/examples/face_landmark/face_landmark.py index 6a085f04..3843d014 100644 --- a/examples/face_landmark/face_landmark.py +++ b/examples/face_landmark/face_landmark.py @@ -9,7 +9,7 @@ from mediapipe import solutions from mediapipe.framework.formats import landmark_pb2 -import livekit +from livekit import rtc URL = 'ws://localhost:7880' TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY' # noqa @@ -69,18 +69,18 @@ def draw_landmarks_on_image(rgb_image, detection_result): .get_default_face_mesh_iris_connections_style()) -async def frame_loop(video_stream: livekit.VideoStream) -> None: +async def frame_loop(video_stream: rtc.VideoStream) -> None: landmarker = FaceLandmarker.create_from_options(options) argb_frame = None - cv2.namedWindow('livekit_video', cv2.WINDOW_AUTOSIZE) + cv2.namedWindow('rtc_video', cv2.WINDOW_AUTOSIZE) cv2.startWindowThread() async for frame in video_stream: buffer = frame.buffer if argb_frame is None or argb_frame.width != buffer.width \ or argb_frame.height != buffer.height: - argb_frame = livekit.ArgbFrame( - livekit.VideoFormatType.FORMAT_ABGR, buffer.width, buffer.height) + argb_frame = rtc.ArgbFrame( + rtc.VideoFormatType.FORMAT_ABGR, buffer.width, buffer.height) buffer.to_argb(argb_frame) @@ -106,19 +106,19 @@ async def frame_loop(video_stream: livekit.VideoStream) -> None: cv2.destroyAllWindows() -async def main(room: livekit.Room) -> None: +async def main(room: rtc.Room) -> None: video_stream = None @room.on("track_subscribed") - def on_track_subscribed(track: livekit.Track, *_): - if track.kind == livekit.TrackKind.KIND_VIDEO: + def on_track_subscribed(track: rtc.Track, *_): + if track.kind == rtc.TrackKind.KIND_VIDEO: nonlocal video_stream if video_stream is not None: # only process the first stream received return print("subscribed to track: " + track.name) - video_stream = livekit.VideoStream(track) + video_stream = rtc.VideoStream(track) task = asyncio.create_task(frame_loop(video_stream)) tasks.add(task) task.add_done_callback(tasks.remove) @@ -133,7 +133,7 @@ def on_track_subscribed(track: livekit.Track, *_): logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/examples/publish_hue.py b/examples/publish_hue.py index 81d0832d..a59cae44 100644 --- a/examples/publish_hue.py +++ b/examples/publish_hue.py @@ -4,16 +4,15 @@ from signal import SIGINT, SIGTERM import numpy as np - -import livekit +from livekit import rtc URL = 'ws://localhost:7880' TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY' # noqa -async def draw_color_cycle(source: livekit.VideoSource): - argb_frame = livekit.ArgbFrame( - livekit.VideoFormatType.FORMAT_ARGB, 1280, 720) +async def draw_color_cycle(source: rtc.VideoSource): + argb_frame = rtc.ArgbFrame( + rtc.VideoFormatType.FORMAT_ARGB, 1280, 720) arr = np.ctypeslib.as_array(argb_frame.data) @@ -32,8 +31,8 @@ async def draw_color_cycle(source: livekit.VideoSource): arr.flat[2::4] = argb_color[2] arr.flat[3::4] = argb_color[3] - frame = livekit.VideoFrame( - 0, livekit.VideoRotation.VIDEO_ROTATION_0, argb_frame.to_i420()) + frame = rtc.VideoFrame( + 0, rtc.VideoRotation.VIDEO_ROTATION_0, argb_frame.to_i420()) source.capture_frame(frame) hue = (hue + framerate / 3) % 1.0 @@ -41,20 +40,20 @@ async def draw_color_cycle(source: livekit.VideoSource): await asyncio.sleep(1 / 30 - code_duration) -async def main(room: livekit.Room): +async def main(room: rtc.Room): logging.info("connecting to %s", URL) try: await room.connect(URL, TOKEN) logging.info("connected to room %s", room.name) - except livekit.ConnectError as e: + except rtc.ConnectError as e: logging.error("failed to connect to the room: %s", e) return # publish a track - source = livekit.VideoSource() - track = livekit.LocalVideoTrack.create_video_track("hue", source) - options = livekit.TrackPublishOptions() - options.source = livekit.TrackSource.SOURCE_CAMERA + source = rtc.VideoSource() + track = rtc.LocalVideoTrack.create_video_track("hue", source) + options = rtc.TrackPublishOptions() + options.source = rtc.TrackSource.SOURCE_CAMERA publication = await room.local_participant.publish_track(track, options) logging.info("published track %s", publication.sid) @@ -67,7 +66,7 @@ async def main(room: livekit.Room): logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/examples/publish_wave.py b/examples/publish_wave.py index 7929bacf..a742a11a 100644 --- a/examples/publish_wave.py +++ b/examples/publish_wave.py @@ -4,8 +4,7 @@ from signal import SIGINT, SIGTERM import numpy as np - -import livekit +from livekit import rtc URL = 'ws://localhost:7880' TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE5MDY2MTMyODgsImlzcyI6IkFQSVRzRWZpZFpqclFvWSIsIm5hbWUiOiJuYXRpdmUiLCJuYmYiOjE2NzI2MTMyODgsInN1YiI6Im5hdGl2ZSIsInZpZGVvIjp7InJvb20iOiJ0ZXN0Iiwicm9vbUFkbWluIjp0cnVlLCJyb29tQ3JlYXRlIjp0cnVlLCJyb29tSm9pbiI6dHJ1ZSwicm9vbUxpc3QiOnRydWV9fQ.uSNIangMRu8jZD5mnRYoCHjcsQWCrJXgHCs0aNIgBFY' # noqa @@ -13,12 +12,12 @@ SAMPLE_RATE = 48000 NUM_CHANNELS = 1 -async def publish_frames(source: livekit.AudioSource, frequency: int): +async def publish_frames(source: rtc.AudioSource, frequency: int): amplitude = 32767 # for 16-bit audio samples_per_channel = 480 # 10ms at 48kHz time = np.arange(samples_per_channel) / SAMPLE_RATE total_samples = 0 - audio_frame = livekit.AudioFrame.create( + audio_frame = rtc.AudioFrame.create( SAMPLE_RATE, NUM_CHANNELS, samples_per_channel) audio_data = np.ctypeslib.as_array(audio_frame.data) while True: @@ -29,29 +28,27 @@ async def publish_frames(source: livekit.AudioSource, frequency: int): await source.capture_frame(audio_frame) total_samples += samples_per_channel -async def main(room: livekit.Room) -> None: +async def main(room: rtc.Room) -> None: @room.on("participant_disconnected") - def on_participant_disconnect(participant: livekit.Participant, *_): + def on_participant_disconnect(participant: rtc.Participant, *_): logging.info("participant disconnected: %s", participant.identity) logging.info("connecting to %s", URL) try: - e2ee_options = livekit.E2EEOptions() - - await room.connect(URL, TOKEN, options=livekit.RoomOptions( + await room.connect(URL, TOKEN, options=rtc.RoomOptions( auto_subscribe=True, )) logging.info("connected to room %s", room.name) - except livekit.ConnectError as e: + except rtc.ConnectError as e: logging.error("failed to connect to the room: %s", e) return # publish a track - source = livekit.AudioSource(SAMPLE_RATE, NUM_CHANNELS) - track = livekit.LocalAudioTrack.create_audio_track("sinewave", source) - options = livekit.TrackPublishOptions() - options.source = livekit.TrackSource.SOURCE_MICROPHONE + source = rtc.AudioSource(SAMPLE_RATE, NUM_CHANNELS) + track = rtc.LocalAudioTrack.create_audio_track("sinewave", source) + options = rtc.TrackPublishOptions() + options.source = rtc.TrackSource.SOURCE_MICROPHONE publication = await room.local_participant.publish_track(track, options) logging.info("published track %s", publication.sid) @@ -64,7 +61,7 @@ def on_participant_disconnect(participant: livekit.Participant, *_): logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/examples/whisper/whisper.py b/examples/whisper/whisper.py index 15aa7dcd..17c5c203 100644 --- a/examples/whisper/whisper.py +++ b/examples/whisper/whisper.py @@ -6,8 +6,7 @@ from signal import SIGINT, SIGTERM import numpy as np - -import livekit +from livekit import rtc os = platform.system().lower() if os == "windows": @@ -99,7 +98,7 @@ class WhisperFullParams(ctypes.Structure): ctx = whisper.whisper_init_from_file(fname_model.encode('utf-8')) -async def whisper_task(stream: livekit.AudioStream): +async def whisper_task(stream: rtc.AudioStream): data_30_secs = np.zeros(SAMPLES_30_SECS, dtype=np.float32) written_samples = 0 # nb. of samples written to data_30_secs for the cur. inference @@ -150,34 +149,34 @@ async def whisper_task(stream: livekit.AudioStream): written_samples = 0 -async def main(room: livekit.Room): +async def main(room: rtc.Room): @room.listens_to("track_published") - def on_track_published(publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_published(publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): # Only subscribe to the audio tracks coming from the microphone - if publication.kind == livekit.TrackKind.KIND_AUDIO \ - and publication.source == livekit.TrackSource.SOURCE_MICROPHONE: + if publication.kind == rtc.TrackKind.KIND_AUDIO \ + and publication.source == rtc.TrackSource.SOURCE_MICROPHONE: logging.info("track published: %s from participant %s (%s), subscribing...", publication.sid, participant.sid, participant.identity) publication.set_subscribed(True) @room.listens_to("track_subscribed") - def on_track_subscribed(track: livekit.Track, - publication: livekit.RemoteTrackPublication, - participant: livekit.RemoteParticipant): + def on_track_subscribed(track: rtc.Track, + publication: rtc.RemoteTrackPublication, + participant: rtc.RemoteParticipant): logging.info("starting listening to: %s", participant.identity) - audio_stream = livekit.AudioStream(track) + audio_stream = rtc.AudioStream(track) asyncio.create_task(whisper_task(audio_stream)) - await room.connect(URL, TOKEN, livekit.RoomOptions(auto_subscribe=False)) + await room.connect(URL, TOKEN, rtc.RoomOptions(auto_subscribe=False)) logging.info("connected to room %s", room.name) # check if there are already published audio tracks for participant in room.participants.values(): for track in participant.tracks.values(): - if track.kind == livekit.TrackKind.KIND_AUDIO \ - and track.source == livekit.TrackSource.SOURCE_MICROPHONE: + if track.kind == rtc.TrackKind.KIND_AUDIO \ + and track.source == rtc.TrackSource.SOURCE_MICROPHONE: track.set_subscribed(True) @@ -187,7 +186,7 @@ def on_track_subscribed(track: livekit.Track, logging.StreamHandler()]) loop = asyncio.get_event_loop() - room = livekit.Room(loop=loop) + room = rtc.Room(loop=loop) async def cleanup(): await room.disconnect() diff --git a/livekit-api/README.md b/livekit-api/README.md new file mode 100644 index 00000000..e69de29b diff --git a/livekit-api/generate_proto.sh b/livekit-api/generate_proto.sh new file mode 100755 index 00000000..3c50a81c --- /dev/null +++ b/livekit-api/generate_proto.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# This script requires protobuf-compiler and https://github.com/nipunn1313/mypy-protobuf + +API_PROTOCOL=./protocol +API_OUT_PYTHON=./livekit/api/_proto + +# api + +protoc \ + -I=$API_PROTOCOL \ + --python_out=$API_OUT_PYTHON \ + --mypy_out=$API_OUT_PYTHON \ + $API_PROTOCOL/livekit_egress.proto \ + $API_PROTOCOL/livekit_room.proto \ + $API_PROTOCOL/livekit_webhook.proto \ + $API_PROTOCOL/livekit_ingress.proto \ + $API_PROTOCOL/livekit_models.proto + + +touch -a "$API_OUT_PYTHON/__init__.py" + +for f in "$API_OUT_PYTHON"/*.py "$API_OUT_PYTHON"/*.pyi; do + perl -i -pe 's|^(import (livekit_egress_pb2\|livekit_room_pb2\|livekit_webhook_pb2\|livekit_ingress_pb2\|livekit_models_pb2))|from . $1|g' "$f" +done diff --git a/livekit-api/livekit/api/__init__.py b/livekit-api/livekit/api/__init__.py new file mode 100644 index 00000000..9f8183f9 --- /dev/null +++ b/livekit-api/livekit/api/__init__.py @@ -0,0 +1,21 @@ +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""LiveKit API SDK +""" + +# flake8: noqa +from .version import __version__ +from .access_token import VideoGrants, AccessToken +from .room_service import RoomService diff --git a/livekit-api/livekit/api/_proto/__init__.py b/livekit-api/livekit/api/_proto/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/livekit-api/livekit/api/_proto/livekit_egress_pb2.py b/livekit-api/livekit/api/_proto/livekit_egress_pb2.py new file mode 100644 index 00000000..8a8a5244 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_egress_pb2.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: livekit_egress.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import livekit_models_pb2 as livekit__models__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14livekit_egress.proto\x12\x07livekit\x1a\x14livekit_models.proto\"\xcd\x04\n\x1aRoomCompositeEgressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x0e\n\x06layout\x18\x02 \x01(\t\x12\x12\n\naudio_only\x18\x03 \x01(\x08\x12\x12\n\nvideo_only\x18\x04 \x01(\x08\x12\x17\n\x0f\x63ustom_base_url\x18\x05 \x01(\t\x12.\n\x04\x66ile\x18\x06 \x01(\x0b\x32\x1a.livekit.EncodedFileOutputB\x02\x18\x01H\x00\x12+\n\x06stream\x18\x07 \x01(\x0b\x32\x15.livekit.StreamOutputB\x02\x18\x01H\x00\x12\x34\n\x08segments\x18\n \x01(\x0b\x32\x1c.livekit.SegmentedFileOutputB\x02\x18\x01H\x00\x12\x30\n\x06preset\x18\x08 \x01(\x0e\x32\x1e.livekit.EncodingOptionsPresetH\x01\x12,\n\x08\x61\x64vanced\x18\t \x01(\x0b\x32\x18.livekit.EncodingOptionsH\x01\x12\x30\n\x0c\x66ile_outputs\x18\x0b \x03(\x0b\x32\x1a.livekit.EncodedFileOutput\x12-\n\x0estream_outputs\x18\x0c \x03(\x0b\x32\x15.livekit.StreamOutput\x12\x35\n\x0fsegment_outputs\x18\r \x03(\x0b\x32\x1c.livekit.SegmentedFileOutput\x12+\n\rimage_outputs\x18\x0e \x03(\x0b\x32\x14.livekit.ImageOutputB\x08\n\x06outputB\t\n\x07options\"\xb0\x04\n\x10WebEgressRequest\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x12\n\naudio_only\x18\x02 \x01(\x08\x12\x12\n\nvideo_only\x18\x03 \x01(\x08\x12\x1a\n\x12\x61wait_start_signal\x18\x0c \x01(\x08\x12.\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x1a.livekit.EncodedFileOutputB\x02\x18\x01H\x00\x12+\n\x06stream\x18\x05 \x01(\x0b\x32\x15.livekit.StreamOutputB\x02\x18\x01H\x00\x12\x34\n\x08segments\x18\x06 \x01(\x0b\x32\x1c.livekit.SegmentedFileOutputB\x02\x18\x01H\x00\x12\x30\n\x06preset\x18\x07 \x01(\x0e\x32\x1e.livekit.EncodingOptionsPresetH\x01\x12,\n\x08\x61\x64vanced\x18\x08 \x01(\x0b\x32\x18.livekit.EncodingOptionsH\x01\x12\x30\n\x0c\x66ile_outputs\x18\t \x03(\x0b\x32\x1a.livekit.EncodedFileOutput\x12-\n\x0estream_outputs\x18\n \x03(\x0b\x32\x15.livekit.StreamOutput\x12\x35\n\x0fsegment_outputs\x18\x0b \x03(\x0b\x32\x1c.livekit.SegmentedFileOutput\x12+\n\rimage_outputs\x18\r \x03(\x0b\x32\x14.livekit.ImageOutputB\x08\n\x06outputB\t\n\x07options\"\x85\x03\n\x18ParticipantEgressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x14\n\x0cscreen_share\x18\x03 \x01(\x08\x12\x30\n\x06preset\x18\x04 \x01(\x0e\x32\x1e.livekit.EncodingOptionsPresetH\x00\x12,\n\x08\x61\x64vanced\x18\x05 \x01(\x0b\x32\x18.livekit.EncodingOptionsH\x00\x12\x30\n\x0c\x66ile_outputs\x18\x06 \x03(\x0b\x32\x1a.livekit.EncodedFileOutput\x12-\n\x0estream_outputs\x18\x07 \x03(\x0b\x32\x15.livekit.StreamOutput\x12\x35\n\x0fsegment_outputs\x18\x08 \x03(\x0b\x32\x1c.livekit.SegmentedFileOutput\x12+\n\rimage_outputs\x18\t \x03(\x0b\x32\x14.livekit.ImageOutputB\t\n\x07options\"\xad\x04\n\x1bTrackCompositeEgressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x16\n\x0e\x61udio_track_id\x18\x02 \x01(\t\x12\x16\n\x0evideo_track_id\x18\x03 \x01(\t\x12.\n\x04\x66ile\x18\x04 \x01(\x0b\x32\x1a.livekit.EncodedFileOutputB\x02\x18\x01H\x00\x12+\n\x06stream\x18\x05 \x01(\x0b\x32\x15.livekit.StreamOutputB\x02\x18\x01H\x00\x12\x34\n\x08segments\x18\x08 \x01(\x0b\x32\x1c.livekit.SegmentedFileOutputB\x02\x18\x01H\x00\x12\x30\n\x06preset\x18\x06 \x01(\x0e\x32\x1e.livekit.EncodingOptionsPresetH\x01\x12,\n\x08\x61\x64vanced\x18\x07 \x01(\x0b\x32\x18.livekit.EncodingOptionsH\x01\x12\x30\n\x0c\x66ile_outputs\x18\x0b \x03(\x0b\x32\x1a.livekit.EncodedFileOutput\x12-\n\x0estream_outputs\x18\x0c \x03(\x0b\x32\x15.livekit.StreamOutput\x12\x35\n\x0fsegment_outputs\x18\r \x03(\x0b\x32\x1c.livekit.SegmentedFileOutput\x12+\n\rimage_outputs\x18\x0e \x03(\x0b\x32\x14.livekit.ImageOutputB\x08\n\x06outputB\t\n\x07options\"\x87\x01\n\x12TrackEgressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x10\n\x08track_id\x18\x02 \x01(\t\x12)\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x19.livekit.DirectFileOutputH\x00\x12\x17\n\rwebsocket_url\x18\x04 \x01(\tH\x00\x42\x08\n\x06output\"\x8e\x02\n\x11\x45ncodedFileOutput\x12+\n\tfile_type\x18\x01 \x01(\x0e\x32\x18.livekit.EncodedFileType\x12\x10\n\x08\x66ilepath\x18\x02 \x01(\t\x12\x18\n\x10\x64isable_manifest\x18\x06 \x01(\x08\x12\x1f\n\x02s3\x18\x03 \x01(\x0b\x32\x11.livekit.S3UploadH\x00\x12!\n\x03gcp\x18\x04 \x01(\x0b\x32\x12.livekit.GCPUploadH\x00\x12)\n\x05\x61zure\x18\x05 \x01(\x0b\x32\x18.livekit.AzureBlobUploadH\x00\x12\'\n\x06\x61liOSS\x18\x07 \x01(\x0b\x32\x15.livekit.AliOSSUploadH\x00\x42\x08\n\x06output\"\xa0\x03\n\x13SegmentedFileOutput\x12\x30\n\x08protocol\x18\x01 \x01(\x0e\x32\x1e.livekit.SegmentedFileProtocol\x12\x17\n\x0f\x66ilename_prefix\x18\x02 \x01(\t\x12\x15\n\rplaylist_name\x18\x03 \x01(\t\x12\x1a\n\x12live_playlist_name\x18\x0b \x01(\t\x12\x18\n\x10segment_duration\x18\x04 \x01(\r\x12\x35\n\x0f\x66ilename_suffix\x18\n \x01(\x0e\x32\x1c.livekit.SegmentedFileSuffix\x12\x18\n\x10\x64isable_manifest\x18\x08 \x01(\x08\x12\x1f\n\x02s3\x18\x05 \x01(\x0b\x32\x11.livekit.S3UploadH\x00\x12!\n\x03gcp\x18\x06 \x01(\x0b\x32\x12.livekit.GCPUploadH\x00\x12)\n\x05\x61zure\x18\x07 \x01(\x0b\x32\x18.livekit.AzureBlobUploadH\x00\x12\'\n\x06\x61liOSS\x18\t \x01(\x0b\x32\x15.livekit.AliOSSUploadH\x00\x42\x08\n\x06output\"\xe0\x01\n\x10\x44irectFileOutput\x12\x10\n\x08\x66ilepath\x18\x01 \x01(\t\x12\x18\n\x10\x64isable_manifest\x18\x05 \x01(\x08\x12\x1f\n\x02s3\x18\x02 \x01(\x0b\x32\x11.livekit.S3UploadH\x00\x12!\n\x03gcp\x18\x03 \x01(\x0b\x32\x12.livekit.GCPUploadH\x00\x12)\n\x05\x61zure\x18\x04 \x01(\x0b\x32\x18.livekit.AzureBlobUploadH\x00\x12\'\n\x06\x61liOSS\x18\x06 \x01(\x0b\x32\x15.livekit.AliOSSUploadH\x00\x42\x08\n\x06output\"\xf8\x02\n\x0bImageOutput\x12\x18\n\x10\x63\x61pture_interval\x18\x01 \x01(\r\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x17\n\x0f\x66ilename_prefix\x18\x04 \x01(\t\x12\x31\n\x0f\x66ilename_suffix\x18\x05 \x01(\x0e\x32\x18.livekit.ImageFileSuffix\x12(\n\x0bimage_codec\x18\x06 \x01(\x0e\x32\x13.livekit.ImageCodec\x12\x18\n\x10\x64isable_manifest\x18\x07 \x01(\x08\x12\x1f\n\x02s3\x18\x08 \x01(\x0b\x32\x11.livekit.S3UploadH\x00\x12!\n\x03gcp\x18\t \x01(\x0b\x32\x12.livekit.GCPUploadH\x00\x12)\n\x05\x61zure\x18\n \x01(\x0b\x32\x18.livekit.AzureBlobUploadH\x00\x12\'\n\x06\x61liOSS\x18\x0b \x01(\x0b\x32\x15.livekit.AliOSSUploadH\x00\x42\x08\n\x06output\"\xef\x01\n\x08S3Upload\x12\x12\n\naccess_key\x18\x01 \x01(\t\x12\x0e\n\x06secret\x18\x02 \x01(\t\x12\x0e\n\x06region\x18\x03 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x04 \x01(\t\x12\x0e\n\x06\x62ucket\x18\x05 \x01(\t\x12\x18\n\x10\x66orce_path_style\x18\x06 \x01(\x08\x12\x31\n\x08metadata\x18\x07 \x03(\x0b\x32\x1f.livekit.S3Upload.MetadataEntry\x12\x0f\n\x07tagging\x18\x08 \x01(\t\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"0\n\tGCPUpload\x12\x13\n\x0b\x63redentials\x18\x01 \x01(\t\x12\x0e\n\x06\x62ucket\x18\x02 \x01(\t\"T\n\x0f\x41zureBlobUpload\x12\x14\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\t\x12\x13\n\x0b\x61\x63\x63ount_key\x18\x02 \x01(\t\x12\x16\n\x0e\x63ontainer_name\x18\x03 \x01(\t\"d\n\x0c\x41liOSSUpload\x12\x12\n\naccess_key\x18\x01 \x01(\t\x12\x0e\n\x06secret\x18\x02 \x01(\t\x12\x0e\n\x06region\x18\x03 \x01(\t\x12\x10\n\x08\x65ndpoint\x18\x04 \x01(\t\x12\x0e\n\x06\x62ucket\x18\x05 \x01(\t\"G\n\x0cStreamOutput\x12)\n\x08protocol\x18\x01 \x01(\x0e\x32\x17.livekit.StreamProtocol\x12\x0c\n\x04urls\x18\x02 \x03(\t\"\x89\x02\n\x0f\x45ncodingOptions\x12\r\n\x05width\x18\x01 \x01(\x05\x12\x0e\n\x06height\x18\x02 \x01(\x05\x12\r\n\x05\x64\x65pth\x18\x03 \x01(\x05\x12\x11\n\tframerate\x18\x04 \x01(\x05\x12(\n\x0b\x61udio_codec\x18\x05 \x01(\x0e\x32\x13.livekit.AudioCodec\x12\x15\n\raudio_bitrate\x18\x06 \x01(\x05\x12\x17\n\x0f\x61udio_frequency\x18\x07 \x01(\x05\x12(\n\x0bvideo_codec\x18\x08 \x01(\x0e\x32\x13.livekit.VideoCodec\x12\x15\n\rvideo_bitrate\x18\t \x01(\x05\x12\x1a\n\x12key_frame_interval\x18\n \x01(\x01\"8\n\x13UpdateLayoutRequest\x12\x11\n\tegress_id\x18\x01 \x01(\t\x12\x0e\n\x06layout\x18\x02 \x01(\t\"]\n\x13UpdateStreamRequest\x12\x11\n\tegress_id\x18\x01 \x01(\t\x12\x17\n\x0f\x61\x64\x64_output_urls\x18\x02 \x03(\t\x12\x1a\n\x12remove_output_urls\x18\x03 \x03(\t\"\x8e\x01\n\x14UpdateOutputsRequest\x12\x11\n\tegress_id\x18\x01 \x01(\t\x12/\n\x11\x61\x64\x64_image_outputs\x18\x02 \x03(\x0b\x32\x14.livekit.ImageOutput\x12\x32\n\x14remove_image_outputs\x18\x03 \x03(\x0b\x32\x14.livekit.ImageOutput\"I\n\x11ListEgressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x11\n\tegress_id\x18\x02 \x01(\t\x12\x0e\n\x06\x61\x63tive\x18\x03 \x01(\x08\"8\n\x12ListEgressResponse\x12\"\n\x05items\x18\x01 \x03(\x0b\x32\x13.livekit.EgressInfo\"&\n\x11StopEgressRequest\x12\x11\n\tegress_id\x18\x01 \x01(\t\"\x91\x06\n\nEgressInfo\x12\x11\n\tegress_id\x18\x01 \x01(\t\x12\x0f\n\x07room_id\x18\x02 \x01(\t\x12\x11\n\troom_name\x18\r \x01(\t\x12%\n\x06status\x18\x03 \x01(\x0e\x32\x15.livekit.EgressStatus\x12\x12\n\nstarted_at\x18\n \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x0b \x01(\x03\x12\x12\n\nupdated_at\x18\x12 \x01(\x03\x12\r\n\x05\x65rror\x18\t \x01(\t\x12=\n\x0eroom_composite\x18\x04 \x01(\x0b\x32#.livekit.RoomCompositeEgressRequestH\x00\x12(\n\x03web\x18\x0e \x01(\x0b\x32\x19.livekit.WebEgressRequestH\x00\x12\x38\n\x0bparticipant\x18\x13 \x01(\x0b\x32!.livekit.ParticipantEgressRequestH\x00\x12?\n\x0ftrack_composite\x18\x05 \x01(\x0b\x32$.livekit.TrackCompositeEgressRequestH\x00\x12,\n\x05track\x18\x06 \x01(\x0b\x32\x1b.livekit.TrackEgressRequestH\x00\x12-\n\x06stream\x18\x07 \x01(\x0b\x32\x17.livekit.StreamInfoListB\x02\x18\x01H\x01\x12%\n\x04\x66ile\x18\x08 \x01(\x0b\x32\x11.livekit.FileInfoB\x02\x18\x01H\x01\x12-\n\x08segments\x18\x0c \x01(\x0b\x32\x15.livekit.SegmentsInfoB\x02\x18\x01H\x01\x12+\n\x0estream_results\x18\x0f \x03(\x0b\x32\x13.livekit.StreamInfo\x12\'\n\x0c\x66ile_results\x18\x10 \x03(\x0b\x32\x11.livekit.FileInfo\x12.\n\x0fsegment_results\x18\x11 \x03(\x0b\x32\x15.livekit.SegmentsInfo\x12*\n\rimage_results\x18\x14 \x03(\x0b\x32\x13.livekit.ImagesInfoB\t\n\x07requestB\x08\n\x06result\"7\n\x0eStreamInfoList\x12!\n\x04info\x18\x01 \x03(\x0b\x32\x13.livekit.StreamInfo:\x02\x18\x01\"\xbc\x01\n\nStreamInfo\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x12\n\nstarted_at\x18\x02 \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x03 \x01(\x03\x12\x10\n\x08\x64uration\x18\x04 \x01(\x03\x12*\n\x06status\x18\x05 \x01(\x0e\x32\x1a.livekit.StreamInfo.Status\x12\r\n\x05\x65rror\x18\x06 \x01(\t\".\n\x06Status\x12\n\n\x06\x41\x43TIVE\x10\x00\x12\x0c\n\x08\x46INISHED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\"t\n\x08\x46ileInfo\x12\x10\n\x08\x66ilename\x18\x01 \x01(\t\x12\x12\n\nstarted_at\x18\x02 \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x03 \x01(\x03\x12\x10\n\x08\x64uration\x18\x06 \x01(\x03\x12\x0c\n\x04size\x18\x04 \x01(\x03\x12\x10\n\x08location\x18\x05 \x01(\t\"\xd9\x01\n\x0cSegmentsInfo\x12\x15\n\rplaylist_name\x18\x01 \x01(\t\x12\x1a\n\x12live_playlist_name\x18\x08 \x01(\t\x12\x10\n\x08\x64uration\x18\x02 \x01(\x03\x12\x0c\n\x04size\x18\x03 \x01(\x03\x12\x19\n\x11playlist_location\x18\x04 \x01(\t\x12\x1e\n\x16live_playlist_location\x18\t \x01(\t\x12\x15\n\rsegment_count\x18\x05 \x01(\x03\x12\x12\n\nstarted_at\x18\x06 \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x07 \x01(\x03\"G\n\nImagesInfo\x12\x13\n\x0bimage_count\x18\x01 \x01(\x03\x12\x12\n\nstarted_at\x18\x02 \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x03 \x01(\x03\"\xeb\x01\n\x15\x41utoParticipantEgress\x12\x30\n\x06preset\x18\x01 \x01(\x0e\x32\x1e.livekit.EncodingOptionsPresetH\x00\x12,\n\x08\x61\x64vanced\x18\x02 \x01(\x0b\x32\x18.livekit.EncodingOptionsH\x00\x12\x30\n\x0c\x66ile_outputs\x18\x03 \x03(\x0b\x32\x1a.livekit.EncodedFileOutput\x12\x35\n\x0fsegment_outputs\x18\x04 \x03(\x0b\x32\x1c.livekit.SegmentedFileOutputB\t\n\x07options\"\xb6\x01\n\x0f\x41utoTrackEgress\x12\x10\n\x08\x66ilepath\x18\x01 \x01(\t\x12\x18\n\x10\x64isable_manifest\x18\x05 \x01(\x08\x12\x1f\n\x02s3\x18\x02 \x01(\x0b\x32\x11.livekit.S3UploadH\x00\x12!\n\x03gcp\x18\x03 \x01(\x0b\x32\x12.livekit.GCPUploadH\x00\x12)\n\x05\x61zure\x18\x04 \x01(\x0b\x32\x18.livekit.AzureBlobUploadH\x00\x42\x08\n\x06output*9\n\x0f\x45ncodedFileType\x12\x14\n\x10\x44\x45\x46\x41ULT_FILETYPE\x10\x00\x12\x07\n\x03MP4\x10\x01\x12\x07\n\x03OGG\x10\x02*N\n\x15SegmentedFileProtocol\x12#\n\x1f\x44\x45\x46\x41ULT_SEGMENTED_FILE_PROTOCOL\x10\x00\x12\x10\n\x0cHLS_PROTOCOL\x10\x01*/\n\x13SegmentedFileSuffix\x12\t\n\x05INDEX\x10\x00\x12\r\n\tTIMESTAMP\x10\x01*E\n\x0fImageFileSuffix\x12\x16\n\x12IMAGE_SUFFIX_INDEX\x10\x00\x12\x1a\n\x16IMAGE_SUFFIX_TIMESTAMP\x10\x01*0\n\x0eStreamProtocol\x12\x14\n\x10\x44\x45\x46\x41ULT_PROTOCOL\x10\x00\x12\x08\n\x04RTMP\x10\x01*\xcf\x01\n\x15\x45ncodingOptionsPreset\x12\x10\n\x0cH264_720P_30\x10\x00\x12\x10\n\x0cH264_720P_60\x10\x01\x12\x11\n\rH264_1080P_30\x10\x02\x12\x11\n\rH264_1080P_60\x10\x03\x12\x19\n\x15PORTRAIT_H264_720P_30\x10\x04\x12\x19\n\x15PORTRAIT_H264_720P_60\x10\x05\x12\x1a\n\x16PORTRAIT_H264_1080P_30\x10\x06\x12\x1a\n\x16PORTRAIT_H264_1080P_60\x10\x07*\x9f\x01\n\x0c\x45gressStatus\x12\x13\n\x0f\x45GRESS_STARTING\x10\x00\x12\x11\n\rEGRESS_ACTIVE\x10\x01\x12\x11\n\rEGRESS_ENDING\x10\x02\x12\x13\n\x0f\x45GRESS_COMPLETE\x10\x03\x12\x11\n\rEGRESS_FAILED\x10\x04\x12\x12\n\x0e\x45GRESS_ABORTED\x10\x05\x12\x18\n\x14\x45GRESS_LIMIT_REACHED\x10\x06\x32\xe1\x05\n\x06\x45gress\x12T\n\x18StartRoomCompositeEgress\x12#.livekit.RoomCompositeEgressRequest\x1a\x13.livekit.EgressInfo\x12@\n\x0eStartWebEgress\x12\x19.livekit.WebEgressRequest\x1a\x13.livekit.EgressInfo\x12P\n\x16StartParticipantEgress\x12!.livekit.ParticipantEgressRequest\x1a\x13.livekit.EgressInfo\x12V\n\x19StartTrackCompositeEgress\x12$.livekit.TrackCompositeEgressRequest\x1a\x13.livekit.EgressInfo\x12\x44\n\x10StartTrackEgress\x12\x1b.livekit.TrackEgressRequest\x1a\x13.livekit.EgressInfo\x12\x41\n\x0cUpdateLayout\x12\x1c.livekit.UpdateLayoutRequest\x1a\x13.livekit.EgressInfo\x12\x41\n\x0cUpdateStream\x12\x1c.livekit.UpdateStreamRequest\x1a\x13.livekit.EgressInfo\x12\x43\n\rUpdateOutputs\x12\x1d.livekit.UpdateOutputsRequest\x1a\x13.livekit.EgressInfo\x12\x45\n\nListEgress\x12\x1a.livekit.ListEgressRequest\x1a\x1b.livekit.ListEgressResponse\x12=\n\nStopEgress\x12\x1a.livekit.StopEgressRequest\x1a\x13.livekit.EgressInfoBFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'livekit_egress_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto' + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['file']._options = None + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['file']._serialized_options = b'\030\001' + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['stream']._options = None + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['stream']._serialized_options = b'\030\001' + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['segments']._options = None + _ROOMCOMPOSITEEGRESSREQUEST.fields_by_name['segments']._serialized_options = b'\030\001' + _WEBEGRESSREQUEST.fields_by_name['file']._options = None + _WEBEGRESSREQUEST.fields_by_name['file']._serialized_options = b'\030\001' + _WEBEGRESSREQUEST.fields_by_name['stream']._options = None + _WEBEGRESSREQUEST.fields_by_name['stream']._serialized_options = b'\030\001' + _WEBEGRESSREQUEST.fields_by_name['segments']._options = None + _WEBEGRESSREQUEST.fields_by_name['segments']._serialized_options = b'\030\001' + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['file']._options = None + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['file']._serialized_options = b'\030\001' + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['stream']._options = None + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['stream']._serialized_options = b'\030\001' + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['segments']._options = None + _TRACKCOMPOSITEEGRESSREQUEST.fields_by_name['segments']._serialized_options = b'\030\001' + _S3UPLOAD_METADATAENTRY._options = None + _S3UPLOAD_METADATAENTRY._serialized_options = b'8\001' + _EGRESSINFO.fields_by_name['stream']._options = None + _EGRESSINFO.fields_by_name['stream']._serialized_options = b'\030\001' + _EGRESSINFO.fields_by_name['file']._options = None + _EGRESSINFO.fields_by_name['file']._serialized_options = b'\030\001' + _EGRESSINFO.fields_by_name['segments']._options = None + _EGRESSINFO.fields_by_name['segments']._serialized_options = b'\030\001' + _STREAMINFOLIST._options = None + _STREAMINFOLIST._serialized_options = b'\030\001' + _globals['_ENCODEDFILETYPE']._serialized_start=6760 + _globals['_ENCODEDFILETYPE']._serialized_end=6817 + _globals['_SEGMENTEDFILEPROTOCOL']._serialized_start=6819 + _globals['_SEGMENTEDFILEPROTOCOL']._serialized_end=6897 + _globals['_SEGMENTEDFILESUFFIX']._serialized_start=6899 + _globals['_SEGMENTEDFILESUFFIX']._serialized_end=6946 + _globals['_IMAGEFILESUFFIX']._serialized_start=6948 + _globals['_IMAGEFILESUFFIX']._serialized_end=7017 + _globals['_STREAMPROTOCOL']._serialized_start=7019 + _globals['_STREAMPROTOCOL']._serialized_end=7067 + _globals['_ENCODINGOPTIONSPRESET']._serialized_start=7070 + _globals['_ENCODINGOPTIONSPRESET']._serialized_end=7277 + _globals['_EGRESSSTATUS']._serialized_start=7280 + _globals['_EGRESSSTATUS']._serialized_end=7439 + _globals['_ROOMCOMPOSITEEGRESSREQUEST']._serialized_start=56 + _globals['_ROOMCOMPOSITEEGRESSREQUEST']._serialized_end=645 + _globals['_WEBEGRESSREQUEST']._serialized_start=648 + _globals['_WEBEGRESSREQUEST']._serialized_end=1208 + _globals['_PARTICIPANTEGRESSREQUEST']._serialized_start=1211 + _globals['_PARTICIPANTEGRESSREQUEST']._serialized_end=1600 + _globals['_TRACKCOMPOSITEEGRESSREQUEST']._serialized_start=1603 + _globals['_TRACKCOMPOSITEEGRESSREQUEST']._serialized_end=2160 + _globals['_TRACKEGRESSREQUEST']._serialized_start=2163 + _globals['_TRACKEGRESSREQUEST']._serialized_end=2298 + _globals['_ENCODEDFILEOUTPUT']._serialized_start=2301 + _globals['_ENCODEDFILEOUTPUT']._serialized_end=2571 + _globals['_SEGMENTEDFILEOUTPUT']._serialized_start=2574 + _globals['_SEGMENTEDFILEOUTPUT']._serialized_end=2990 + _globals['_DIRECTFILEOUTPUT']._serialized_start=2993 + _globals['_DIRECTFILEOUTPUT']._serialized_end=3217 + _globals['_IMAGEOUTPUT']._serialized_start=3220 + _globals['_IMAGEOUTPUT']._serialized_end=3596 + _globals['_S3UPLOAD']._serialized_start=3599 + _globals['_S3UPLOAD']._serialized_end=3838 + _globals['_S3UPLOAD_METADATAENTRY']._serialized_start=3791 + _globals['_S3UPLOAD_METADATAENTRY']._serialized_end=3838 + _globals['_GCPUPLOAD']._serialized_start=3840 + _globals['_GCPUPLOAD']._serialized_end=3888 + _globals['_AZUREBLOBUPLOAD']._serialized_start=3890 + _globals['_AZUREBLOBUPLOAD']._serialized_end=3974 + _globals['_ALIOSSUPLOAD']._serialized_start=3976 + _globals['_ALIOSSUPLOAD']._serialized_end=4076 + _globals['_STREAMOUTPUT']._serialized_start=4078 + _globals['_STREAMOUTPUT']._serialized_end=4149 + _globals['_ENCODINGOPTIONS']._serialized_start=4152 + _globals['_ENCODINGOPTIONS']._serialized_end=4417 + _globals['_UPDATELAYOUTREQUEST']._serialized_start=4419 + _globals['_UPDATELAYOUTREQUEST']._serialized_end=4475 + _globals['_UPDATESTREAMREQUEST']._serialized_start=4477 + _globals['_UPDATESTREAMREQUEST']._serialized_end=4570 + _globals['_UPDATEOUTPUTSREQUEST']._serialized_start=4573 + _globals['_UPDATEOUTPUTSREQUEST']._serialized_end=4715 + _globals['_LISTEGRESSREQUEST']._serialized_start=4717 + _globals['_LISTEGRESSREQUEST']._serialized_end=4790 + _globals['_LISTEGRESSRESPONSE']._serialized_start=4792 + _globals['_LISTEGRESSRESPONSE']._serialized_end=4848 + _globals['_STOPEGRESSREQUEST']._serialized_start=4850 + _globals['_STOPEGRESSREQUEST']._serialized_end=4888 + _globals['_EGRESSINFO']._serialized_start=4891 + _globals['_EGRESSINFO']._serialized_end=5676 + _globals['_STREAMINFOLIST']._serialized_start=5678 + _globals['_STREAMINFOLIST']._serialized_end=5733 + _globals['_STREAMINFO']._serialized_start=5736 + _globals['_STREAMINFO']._serialized_end=5924 + _globals['_STREAMINFO_STATUS']._serialized_start=5878 + _globals['_STREAMINFO_STATUS']._serialized_end=5924 + _globals['_FILEINFO']._serialized_start=5926 + _globals['_FILEINFO']._serialized_end=6042 + _globals['_SEGMENTSINFO']._serialized_start=6045 + _globals['_SEGMENTSINFO']._serialized_end=6262 + _globals['_IMAGESINFO']._serialized_start=6264 + _globals['_IMAGESINFO']._serialized_end=6335 + _globals['_AUTOPARTICIPANTEGRESS']._serialized_start=6338 + _globals['_AUTOPARTICIPANTEGRESS']._serialized_end=6573 + _globals['_AUTOTRACKEGRESS']._serialized_start=6576 + _globals['_AUTOTRACKEGRESS']._serialized_end=6758 + _globals['_EGRESS']._serialized_start=7442 + _globals['_EGRESS']._serialized_end=8179 +# @@protoc_insertion_point(module_scope) diff --git a/livekit-api/livekit/api/_proto/livekit_egress_pb2.pyi b/livekit-api/livekit/api/_proto/livekit_egress_pb2.pyi new file mode 100644 index 00000000..dab30165 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_egress_pb2.pyi @@ -0,0 +1,1290 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright 2023 LiveKit, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +from . import livekit_models_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _EncodedFileType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _EncodedFileTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_EncodedFileType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DEFAULT_FILETYPE: _EncodedFileType.ValueType # 0 + """file type chosen based on codecs""" + MP4: _EncodedFileType.ValueType # 1 + OGG: _EncodedFileType.ValueType # 2 + +class EncodedFileType(_EncodedFileType, metaclass=_EncodedFileTypeEnumTypeWrapper): ... + +DEFAULT_FILETYPE: EncodedFileType.ValueType # 0 +"""file type chosen based on codecs""" +MP4: EncodedFileType.ValueType # 1 +OGG: EncodedFileType.ValueType # 2 +global___EncodedFileType = EncodedFileType + +class _SegmentedFileProtocol: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _SegmentedFileProtocolEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SegmentedFileProtocol.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DEFAULT_SEGMENTED_FILE_PROTOCOL: _SegmentedFileProtocol.ValueType # 0 + HLS_PROTOCOL: _SegmentedFileProtocol.ValueType # 1 + +class SegmentedFileProtocol(_SegmentedFileProtocol, metaclass=_SegmentedFileProtocolEnumTypeWrapper): ... + +DEFAULT_SEGMENTED_FILE_PROTOCOL: SegmentedFileProtocol.ValueType # 0 +HLS_PROTOCOL: SegmentedFileProtocol.ValueType # 1 +global___SegmentedFileProtocol = SegmentedFileProtocol + +class _SegmentedFileSuffix: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _SegmentedFileSuffixEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SegmentedFileSuffix.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + INDEX: _SegmentedFileSuffix.ValueType # 0 + TIMESTAMP: _SegmentedFileSuffix.ValueType # 1 + +class SegmentedFileSuffix(_SegmentedFileSuffix, metaclass=_SegmentedFileSuffixEnumTypeWrapper): ... + +INDEX: SegmentedFileSuffix.ValueType # 0 +TIMESTAMP: SegmentedFileSuffix.ValueType # 1 +global___SegmentedFileSuffix = SegmentedFileSuffix + +class _ImageFileSuffix: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ImageFileSuffixEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ImageFileSuffix.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + IMAGE_SUFFIX_INDEX: _ImageFileSuffix.ValueType # 0 + IMAGE_SUFFIX_TIMESTAMP: _ImageFileSuffix.ValueType # 1 + +class ImageFileSuffix(_ImageFileSuffix, metaclass=_ImageFileSuffixEnumTypeWrapper): ... + +IMAGE_SUFFIX_INDEX: ImageFileSuffix.ValueType # 0 +IMAGE_SUFFIX_TIMESTAMP: ImageFileSuffix.ValueType # 1 +global___ImageFileSuffix = ImageFileSuffix + +class _StreamProtocol: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _StreamProtocolEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_StreamProtocol.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DEFAULT_PROTOCOL: _StreamProtocol.ValueType # 0 + """protocol chosen based on urls""" + RTMP: _StreamProtocol.ValueType # 1 + +class StreamProtocol(_StreamProtocol, metaclass=_StreamProtocolEnumTypeWrapper): ... + +DEFAULT_PROTOCOL: StreamProtocol.ValueType # 0 +"""protocol chosen based on urls""" +RTMP: StreamProtocol.ValueType # 1 +global___StreamProtocol = StreamProtocol + +class _EncodingOptionsPreset: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _EncodingOptionsPresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_EncodingOptionsPreset.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + H264_720P_30: _EncodingOptionsPreset.ValueType # 0 + """ 1280x720, 30fps, 3000kpbs, H.264_MAIN / OPUS""" + H264_720P_60: _EncodingOptionsPreset.ValueType # 1 + """ 1280x720, 60fps, 4500kbps, H.264_MAIN / OPUS""" + H264_1080P_30: _EncodingOptionsPreset.ValueType # 2 + """1920x1080, 30fps, 4500kbps, H.264_MAIN / OPUS""" + H264_1080P_60: _EncodingOptionsPreset.ValueType # 3 + """1920x1080, 60fps, 6000kbps, H.264_MAIN / OPUS""" + PORTRAIT_H264_720P_30: _EncodingOptionsPreset.ValueType # 4 + """ 720x1280, 30fps, 3000kpbs, H.264_MAIN / OPUS""" + PORTRAIT_H264_720P_60: _EncodingOptionsPreset.ValueType # 5 + """ 720x1280, 60fps, 4500kbps, H.264_MAIN / OPUS""" + PORTRAIT_H264_1080P_30: _EncodingOptionsPreset.ValueType # 6 + """1080x1920, 30fps, 4500kbps, H.264_MAIN / OPUS""" + PORTRAIT_H264_1080P_60: _EncodingOptionsPreset.ValueType # 7 + """1080x1920, 60fps, 6000kbps, H.264_MAIN / OPUS""" + +class EncodingOptionsPreset(_EncodingOptionsPreset, metaclass=_EncodingOptionsPresetEnumTypeWrapper): ... + +H264_720P_30: EncodingOptionsPreset.ValueType # 0 +""" 1280x720, 30fps, 3000kpbs, H.264_MAIN / OPUS""" +H264_720P_60: EncodingOptionsPreset.ValueType # 1 +""" 1280x720, 60fps, 4500kbps, H.264_MAIN / OPUS""" +H264_1080P_30: EncodingOptionsPreset.ValueType # 2 +"""1920x1080, 30fps, 4500kbps, H.264_MAIN / OPUS""" +H264_1080P_60: EncodingOptionsPreset.ValueType # 3 +"""1920x1080, 60fps, 6000kbps, H.264_MAIN / OPUS""" +PORTRAIT_H264_720P_30: EncodingOptionsPreset.ValueType # 4 +""" 720x1280, 30fps, 3000kpbs, H.264_MAIN / OPUS""" +PORTRAIT_H264_720P_60: EncodingOptionsPreset.ValueType # 5 +""" 720x1280, 60fps, 4500kbps, H.264_MAIN / OPUS""" +PORTRAIT_H264_1080P_30: EncodingOptionsPreset.ValueType # 6 +"""1080x1920, 30fps, 4500kbps, H.264_MAIN / OPUS""" +PORTRAIT_H264_1080P_60: EncodingOptionsPreset.ValueType # 7 +"""1080x1920, 60fps, 6000kbps, H.264_MAIN / OPUS""" +global___EncodingOptionsPreset = EncodingOptionsPreset + +class _EgressStatus: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _EgressStatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_EgressStatus.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + EGRESS_STARTING: _EgressStatus.ValueType # 0 + EGRESS_ACTIVE: _EgressStatus.ValueType # 1 + EGRESS_ENDING: _EgressStatus.ValueType # 2 + EGRESS_COMPLETE: _EgressStatus.ValueType # 3 + EGRESS_FAILED: _EgressStatus.ValueType # 4 + EGRESS_ABORTED: _EgressStatus.ValueType # 5 + EGRESS_LIMIT_REACHED: _EgressStatus.ValueType # 6 + +class EgressStatus(_EgressStatus, metaclass=_EgressStatusEnumTypeWrapper): ... + +EGRESS_STARTING: EgressStatus.ValueType # 0 +EGRESS_ACTIVE: EgressStatus.ValueType # 1 +EGRESS_ENDING: EgressStatus.ValueType # 2 +EGRESS_COMPLETE: EgressStatus.ValueType # 3 +EGRESS_FAILED: EgressStatus.ValueType # 4 +EGRESS_ABORTED: EgressStatus.ValueType # 5 +EGRESS_LIMIT_REACHED: EgressStatus.ValueType # 6 +global___EgressStatus = EgressStatus + +@typing_extensions.final +class RoomCompositeEgressRequest(google.protobuf.message.Message): + """composite using a web browser""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + LAYOUT_FIELD_NUMBER: builtins.int + AUDIO_ONLY_FIELD_NUMBER: builtins.int + VIDEO_ONLY_FIELD_NUMBER: builtins.int + CUSTOM_BASE_URL_FIELD_NUMBER: builtins.int + FILE_FIELD_NUMBER: builtins.int + STREAM_FIELD_NUMBER: builtins.int + SEGMENTS_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + ADVANCED_FIELD_NUMBER: builtins.int + FILE_OUTPUTS_FIELD_NUMBER: builtins.int + STREAM_OUTPUTS_FIELD_NUMBER: builtins.int + SEGMENT_OUTPUTS_FIELD_NUMBER: builtins.int + IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + room_name: builtins.str + """required""" + layout: builtins.str + """(optional)""" + audio_only: builtins.bool + """(default false)""" + video_only: builtins.bool + """(default false)""" + custom_base_url: builtins.str + """template base url (default https://recorder.livekit.io)""" + @property + def file(self) -> global___EncodedFileOutput: ... + @property + def stream(self) -> global___StreamOutput: ... + @property + def segments(self) -> global___SegmentedFileOutput: ... + preset: global___EncodingOptionsPreset.ValueType + """(default H264_720P_30)""" + @property + def advanced(self) -> global___EncodingOptions: + """(optional)""" + @property + def file_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EncodedFileOutput]: ... + @property + def stream_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamOutput]: ... + @property + def segment_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentedFileOutput]: ... + @property + def image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + def __init__( + self, + *, + room_name: builtins.str = ..., + layout: builtins.str = ..., + audio_only: builtins.bool = ..., + video_only: builtins.bool = ..., + custom_base_url: builtins.str = ..., + file: global___EncodedFileOutput | None = ..., + stream: global___StreamOutput | None = ..., + segments: global___SegmentedFileOutput | None = ..., + preset: global___EncodingOptionsPreset.ValueType = ..., + advanced: global___EncodingOptions | None = ..., + file_outputs: collections.abc.Iterable[global___EncodedFileOutput] | None = ..., + stream_outputs: collections.abc.Iterable[global___StreamOutput] | None = ..., + segment_outputs: collections.abc.Iterable[global___SegmentedFileOutput] | None = ..., + image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "file", b"file", "options", b"options", "output", b"output", "preset", b"preset", "segments", b"segments", "stream", b"stream"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "audio_only", b"audio_only", "custom_base_url", b"custom_base_url", "file", b"file", "file_outputs", b"file_outputs", "image_outputs", b"image_outputs", "layout", b"layout", "options", b"options", "output", b"output", "preset", b"preset", "room_name", b"room_name", "segment_outputs", b"segment_outputs", "segments", b"segments", "stream", b"stream", "stream_outputs", b"stream_outputs", "video_only", b"video_only"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["options", b"options"]) -> typing_extensions.Literal["preset", "advanced"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["file", "stream", "segments"] | None: ... + +global___RoomCompositeEgressRequest = RoomCompositeEgressRequest + +@typing_extensions.final +class WebEgressRequest(google.protobuf.message.Message): + """record any website""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + URL_FIELD_NUMBER: builtins.int + AUDIO_ONLY_FIELD_NUMBER: builtins.int + VIDEO_ONLY_FIELD_NUMBER: builtins.int + AWAIT_START_SIGNAL_FIELD_NUMBER: builtins.int + FILE_FIELD_NUMBER: builtins.int + STREAM_FIELD_NUMBER: builtins.int + SEGMENTS_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + ADVANCED_FIELD_NUMBER: builtins.int + FILE_OUTPUTS_FIELD_NUMBER: builtins.int + STREAM_OUTPUTS_FIELD_NUMBER: builtins.int + SEGMENT_OUTPUTS_FIELD_NUMBER: builtins.int + IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + url: builtins.str + audio_only: builtins.bool + video_only: builtins.bool + await_start_signal: builtins.bool + @property + def file(self) -> global___EncodedFileOutput: ... + @property + def stream(self) -> global___StreamOutput: ... + @property + def segments(self) -> global___SegmentedFileOutput: ... + preset: global___EncodingOptionsPreset.ValueType + @property + def advanced(self) -> global___EncodingOptions: ... + @property + def file_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EncodedFileOutput]: ... + @property + def stream_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamOutput]: ... + @property + def segment_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentedFileOutput]: ... + @property + def image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + def __init__( + self, + *, + url: builtins.str = ..., + audio_only: builtins.bool = ..., + video_only: builtins.bool = ..., + await_start_signal: builtins.bool = ..., + file: global___EncodedFileOutput | None = ..., + stream: global___StreamOutput | None = ..., + segments: global___SegmentedFileOutput | None = ..., + preset: global___EncodingOptionsPreset.ValueType = ..., + advanced: global___EncodingOptions | None = ..., + file_outputs: collections.abc.Iterable[global___EncodedFileOutput] | None = ..., + stream_outputs: collections.abc.Iterable[global___StreamOutput] | None = ..., + segment_outputs: collections.abc.Iterable[global___SegmentedFileOutput] | None = ..., + image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "file", b"file", "options", b"options", "output", b"output", "preset", b"preset", "segments", b"segments", "stream", b"stream"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "audio_only", b"audio_only", "await_start_signal", b"await_start_signal", "file", b"file", "file_outputs", b"file_outputs", "image_outputs", b"image_outputs", "options", b"options", "output", b"output", "preset", b"preset", "segment_outputs", b"segment_outputs", "segments", b"segments", "stream", b"stream", "stream_outputs", b"stream_outputs", "url", b"url", "video_only", b"video_only"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["options", b"options"]) -> typing_extensions.Literal["preset", "advanced"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["file", "stream", "segments"] | None: ... + +global___WebEgressRequest = WebEgressRequest + +@typing_extensions.final +class ParticipantEgressRequest(google.protobuf.message.Message): + """record audio and video from a single participant""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + SCREEN_SHARE_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + ADVANCED_FIELD_NUMBER: builtins.int + FILE_OUTPUTS_FIELD_NUMBER: builtins.int + STREAM_OUTPUTS_FIELD_NUMBER: builtins.int + SEGMENT_OUTPUTS_FIELD_NUMBER: builtins.int + IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + room_name: builtins.str + """required""" + identity: builtins.str + """required""" + screen_share: builtins.bool + """(default false)""" + preset: global___EncodingOptionsPreset.ValueType + """(default H264_720P_30)""" + @property + def advanced(self) -> global___EncodingOptions: + """(optional)""" + @property + def file_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EncodedFileOutput]: ... + @property + def stream_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamOutput]: ... + @property + def segment_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentedFileOutput]: ... + @property + def image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + def __init__( + self, + *, + room_name: builtins.str = ..., + identity: builtins.str = ..., + screen_share: builtins.bool = ..., + preset: global___EncodingOptionsPreset.ValueType = ..., + advanced: global___EncodingOptions | None = ..., + file_outputs: collections.abc.Iterable[global___EncodedFileOutput] | None = ..., + stream_outputs: collections.abc.Iterable[global___StreamOutput] | None = ..., + segment_outputs: collections.abc.Iterable[global___SegmentedFileOutput] | None = ..., + image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "options", b"options", "preset", b"preset"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "file_outputs", b"file_outputs", "identity", b"identity", "image_outputs", b"image_outputs", "options", b"options", "preset", b"preset", "room_name", b"room_name", "screen_share", b"screen_share", "segment_outputs", b"segment_outputs", "stream_outputs", b"stream_outputs"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["options", b"options"]) -> typing_extensions.Literal["preset", "advanced"] | None: ... + +global___ParticipantEgressRequest = ParticipantEgressRequest + +@typing_extensions.final +class TrackCompositeEgressRequest(google.protobuf.message.Message): + """containerize up to one audio and one video track""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + AUDIO_TRACK_ID_FIELD_NUMBER: builtins.int + VIDEO_TRACK_ID_FIELD_NUMBER: builtins.int + FILE_FIELD_NUMBER: builtins.int + STREAM_FIELD_NUMBER: builtins.int + SEGMENTS_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + ADVANCED_FIELD_NUMBER: builtins.int + FILE_OUTPUTS_FIELD_NUMBER: builtins.int + STREAM_OUTPUTS_FIELD_NUMBER: builtins.int + SEGMENT_OUTPUTS_FIELD_NUMBER: builtins.int + IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + room_name: builtins.str + """required""" + audio_track_id: builtins.str + """(optional)""" + video_track_id: builtins.str + """(optional)""" + @property + def file(self) -> global___EncodedFileOutput: ... + @property + def stream(self) -> global___StreamOutput: ... + @property + def segments(self) -> global___SegmentedFileOutput: ... + preset: global___EncodingOptionsPreset.ValueType + """(default H264_720P_30)""" + @property + def advanced(self) -> global___EncodingOptions: + """(optional)""" + @property + def file_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EncodedFileOutput]: ... + @property + def stream_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamOutput]: ... + @property + def segment_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentedFileOutput]: ... + @property + def image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + def __init__( + self, + *, + room_name: builtins.str = ..., + audio_track_id: builtins.str = ..., + video_track_id: builtins.str = ..., + file: global___EncodedFileOutput | None = ..., + stream: global___StreamOutput | None = ..., + segments: global___SegmentedFileOutput | None = ..., + preset: global___EncodingOptionsPreset.ValueType = ..., + advanced: global___EncodingOptions | None = ..., + file_outputs: collections.abc.Iterable[global___EncodedFileOutput] | None = ..., + stream_outputs: collections.abc.Iterable[global___StreamOutput] | None = ..., + segment_outputs: collections.abc.Iterable[global___SegmentedFileOutput] | None = ..., + image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "file", b"file", "options", b"options", "output", b"output", "preset", b"preset", "segments", b"segments", "stream", b"stream"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "audio_track_id", b"audio_track_id", "file", b"file", "file_outputs", b"file_outputs", "image_outputs", b"image_outputs", "options", b"options", "output", b"output", "preset", b"preset", "room_name", b"room_name", "segment_outputs", b"segment_outputs", "segments", b"segments", "stream", b"stream", "stream_outputs", b"stream_outputs", "video_track_id", b"video_track_id"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["options", b"options"]) -> typing_extensions.Literal["preset", "advanced"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["file", "stream", "segments"] | None: ... + +global___TrackCompositeEgressRequest = TrackCompositeEgressRequest + +@typing_extensions.final +class TrackEgressRequest(google.protobuf.message.Message): + """record tracks individually, without transcoding""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + TRACK_ID_FIELD_NUMBER: builtins.int + FILE_FIELD_NUMBER: builtins.int + WEBSOCKET_URL_FIELD_NUMBER: builtins.int + room_name: builtins.str + """required""" + track_id: builtins.str + """required""" + @property + def file(self) -> global___DirectFileOutput: ... + websocket_url: builtins.str + def __init__( + self, + *, + room_name: builtins.str = ..., + track_id: builtins.str = ..., + file: global___DirectFileOutput | None = ..., + websocket_url: builtins.str = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["file", b"file", "output", b"output", "websocket_url", b"websocket_url"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["file", b"file", "output", b"output", "room_name", b"room_name", "track_id", b"track_id", "websocket_url", b"websocket_url"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["file", "websocket_url"] | None: ... + +global___TrackEgressRequest = TrackEgressRequest + +@typing_extensions.final +class EncodedFileOutput(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FILE_TYPE_FIELD_NUMBER: builtins.int + FILEPATH_FIELD_NUMBER: builtins.int + DISABLE_MANIFEST_FIELD_NUMBER: builtins.int + S3_FIELD_NUMBER: builtins.int + GCP_FIELD_NUMBER: builtins.int + AZURE_FIELD_NUMBER: builtins.int + ALIOSS_FIELD_NUMBER: builtins.int + file_type: global___EncodedFileType.ValueType + """(optional)""" + filepath: builtins.str + """see egress docs for templating (default {room_name}-{time})""" + disable_manifest: builtins.bool + """disable upload of manifest file (default false)""" + @property + def s3(self) -> global___S3Upload: ... + @property + def gcp(self) -> global___GCPUpload: ... + @property + def azure(self) -> global___AzureBlobUpload: ... + @property + def aliOSS(self) -> global___AliOSSUpload: ... + def __init__( + self, + *, + file_type: global___EncodedFileType.ValueType = ..., + filepath: builtins.str = ..., + disable_manifest: builtins.bool = ..., + s3: global___S3Upload | None = ..., + gcp: global___GCPUpload | None = ..., + azure: global___AzureBlobUpload | None = ..., + aliOSS: global___AliOSSUpload | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "disable_manifest", b"disable_manifest", "file_type", b"file_type", "filepath", b"filepath", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["s3", "gcp", "azure", "aliOSS"] | None: ... + +global___EncodedFileOutput = EncodedFileOutput + +@typing_extensions.final +class SegmentedFileOutput(google.protobuf.message.Message): + """Used to generate HLS segments or other kind of segmented output""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PROTOCOL_FIELD_NUMBER: builtins.int + FILENAME_PREFIX_FIELD_NUMBER: builtins.int + PLAYLIST_NAME_FIELD_NUMBER: builtins.int + LIVE_PLAYLIST_NAME_FIELD_NUMBER: builtins.int + SEGMENT_DURATION_FIELD_NUMBER: builtins.int + FILENAME_SUFFIX_FIELD_NUMBER: builtins.int + DISABLE_MANIFEST_FIELD_NUMBER: builtins.int + S3_FIELD_NUMBER: builtins.int + GCP_FIELD_NUMBER: builtins.int + AZURE_FIELD_NUMBER: builtins.int + ALIOSS_FIELD_NUMBER: builtins.int + protocol: global___SegmentedFileProtocol.ValueType + """(optional)""" + filename_prefix: builtins.str + """(optional)""" + playlist_name: builtins.str + """(optional)""" + live_playlist_name: builtins.str + """(optional, disabled if not provided). Path of a live playlist""" + segment_duration: builtins.int + """in seconds (optional)""" + filename_suffix: global___SegmentedFileSuffix.ValueType + """(optional, default INDEX)""" + disable_manifest: builtins.bool + """disable upload of manifest file (default false)""" + @property + def s3(self) -> global___S3Upload: ... + @property + def gcp(self) -> global___GCPUpload: ... + @property + def azure(self) -> global___AzureBlobUpload: ... + @property + def aliOSS(self) -> global___AliOSSUpload: ... + def __init__( + self, + *, + protocol: global___SegmentedFileProtocol.ValueType = ..., + filename_prefix: builtins.str = ..., + playlist_name: builtins.str = ..., + live_playlist_name: builtins.str = ..., + segment_duration: builtins.int = ..., + filename_suffix: global___SegmentedFileSuffix.ValueType = ..., + disable_manifest: builtins.bool = ..., + s3: global___S3Upload | None = ..., + gcp: global___GCPUpload | None = ..., + azure: global___AzureBlobUpload | None = ..., + aliOSS: global___AliOSSUpload | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "disable_manifest", b"disable_manifest", "filename_prefix", b"filename_prefix", "filename_suffix", b"filename_suffix", "gcp", b"gcp", "live_playlist_name", b"live_playlist_name", "output", b"output", "playlist_name", b"playlist_name", "protocol", b"protocol", "s3", b"s3", "segment_duration", b"segment_duration"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["s3", "gcp", "azure", "aliOSS"] | None: ... + +global___SegmentedFileOutput = SegmentedFileOutput + +@typing_extensions.final +class DirectFileOutput(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FILEPATH_FIELD_NUMBER: builtins.int + DISABLE_MANIFEST_FIELD_NUMBER: builtins.int + S3_FIELD_NUMBER: builtins.int + GCP_FIELD_NUMBER: builtins.int + AZURE_FIELD_NUMBER: builtins.int + ALIOSS_FIELD_NUMBER: builtins.int + filepath: builtins.str + """see egress docs for templating (default {track_id}-{time})""" + disable_manifest: builtins.bool + """disable upload of manifest file (default false)""" + @property + def s3(self) -> global___S3Upload: ... + @property + def gcp(self) -> global___GCPUpload: ... + @property + def azure(self) -> global___AzureBlobUpload: ... + @property + def aliOSS(self) -> global___AliOSSUpload: ... + def __init__( + self, + *, + filepath: builtins.str = ..., + disable_manifest: builtins.bool = ..., + s3: global___S3Upload | None = ..., + gcp: global___GCPUpload | None = ..., + azure: global___AzureBlobUpload | None = ..., + aliOSS: global___AliOSSUpload | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "disable_manifest", b"disable_manifest", "filepath", b"filepath", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["s3", "gcp", "azure", "aliOSS"] | None: ... + +global___DirectFileOutput = DirectFileOutput + +@typing_extensions.final +class ImageOutput(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CAPTURE_INTERVAL_FIELD_NUMBER: builtins.int + WIDTH_FIELD_NUMBER: builtins.int + HEIGHT_FIELD_NUMBER: builtins.int + FILENAME_PREFIX_FIELD_NUMBER: builtins.int + FILENAME_SUFFIX_FIELD_NUMBER: builtins.int + IMAGE_CODEC_FIELD_NUMBER: builtins.int + DISABLE_MANIFEST_FIELD_NUMBER: builtins.int + S3_FIELD_NUMBER: builtins.int + GCP_FIELD_NUMBER: builtins.int + AZURE_FIELD_NUMBER: builtins.int + ALIOSS_FIELD_NUMBER: builtins.int + capture_interval: builtins.int + """in seconds (required)""" + width: builtins.int + """(optional, defaults to track width)""" + height: builtins.int + """(optional, defaults to track height)""" + filename_prefix: builtins.str + """(optional)""" + filename_suffix: global___ImageFileSuffix.ValueType + """(optional, default INDEX)""" + image_codec: livekit_models_pb2.ImageCodec.ValueType + """(optional)""" + disable_manifest: builtins.bool + """disable upload of manifest file (default false)""" + @property + def s3(self) -> global___S3Upload: ... + @property + def gcp(self) -> global___GCPUpload: ... + @property + def azure(self) -> global___AzureBlobUpload: ... + @property + def aliOSS(self) -> global___AliOSSUpload: ... + def __init__( + self, + *, + capture_interval: builtins.int = ..., + width: builtins.int = ..., + height: builtins.int = ..., + filename_prefix: builtins.str = ..., + filename_suffix: global___ImageFileSuffix.ValueType = ..., + image_codec: livekit_models_pb2.ImageCodec.ValueType = ..., + disable_manifest: builtins.bool = ..., + s3: global___S3Upload | None = ..., + gcp: global___GCPUpload | None = ..., + azure: global___AzureBlobUpload | None = ..., + aliOSS: global___AliOSSUpload | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["aliOSS", b"aliOSS", "azure", b"azure", "capture_interval", b"capture_interval", "disable_manifest", b"disable_manifest", "filename_prefix", b"filename_prefix", "filename_suffix", b"filename_suffix", "gcp", b"gcp", "height", b"height", "image_codec", b"image_codec", "output", b"output", "s3", b"s3", "width", b"width"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["s3", "gcp", "azure", "aliOSS"] | None: ... + +global___ImageOutput = ImageOutput + +@typing_extensions.final +class S3Upload(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final + class MetadataEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: builtins.str + value: builtins.str + def __init__( + self, + *, + key: builtins.str = ..., + value: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ... + + ACCESS_KEY_FIELD_NUMBER: builtins.int + SECRET_FIELD_NUMBER: builtins.int + REGION_FIELD_NUMBER: builtins.int + ENDPOINT_FIELD_NUMBER: builtins.int + BUCKET_FIELD_NUMBER: builtins.int + FORCE_PATH_STYLE_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + TAGGING_FIELD_NUMBER: builtins.int + access_key: builtins.str + secret: builtins.str + region: builtins.str + endpoint: builtins.str + bucket: builtins.str + force_path_style: builtins.bool + @property + def metadata(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]: ... + tagging: builtins.str + def __init__( + self, + *, + access_key: builtins.str = ..., + secret: builtins.str = ..., + region: builtins.str = ..., + endpoint: builtins.str = ..., + bucket: builtins.str = ..., + force_path_style: builtins.bool = ..., + metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ..., + tagging: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["access_key", b"access_key", "bucket", b"bucket", "endpoint", b"endpoint", "force_path_style", b"force_path_style", "metadata", b"metadata", "region", b"region", "secret", b"secret", "tagging", b"tagging"]) -> None: ... + +global___S3Upload = S3Upload + +@typing_extensions.final +class GCPUpload(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CREDENTIALS_FIELD_NUMBER: builtins.int + BUCKET_FIELD_NUMBER: builtins.int + credentials: builtins.str + bucket: builtins.str + def __init__( + self, + *, + credentials: builtins.str = ..., + bucket: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["bucket", b"bucket", "credentials", b"credentials"]) -> None: ... + +global___GCPUpload = GCPUpload + +@typing_extensions.final +class AzureBlobUpload(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ACCOUNT_NAME_FIELD_NUMBER: builtins.int + ACCOUNT_KEY_FIELD_NUMBER: builtins.int + CONTAINER_NAME_FIELD_NUMBER: builtins.int + account_name: builtins.str + account_key: builtins.str + container_name: builtins.str + def __init__( + self, + *, + account_name: builtins.str = ..., + account_key: builtins.str = ..., + container_name: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["account_key", b"account_key", "account_name", b"account_name", "container_name", b"container_name"]) -> None: ... + +global___AzureBlobUpload = AzureBlobUpload + +@typing_extensions.final +class AliOSSUpload(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ACCESS_KEY_FIELD_NUMBER: builtins.int + SECRET_FIELD_NUMBER: builtins.int + REGION_FIELD_NUMBER: builtins.int + ENDPOINT_FIELD_NUMBER: builtins.int + BUCKET_FIELD_NUMBER: builtins.int + access_key: builtins.str + secret: builtins.str + region: builtins.str + endpoint: builtins.str + bucket: builtins.str + def __init__( + self, + *, + access_key: builtins.str = ..., + secret: builtins.str = ..., + region: builtins.str = ..., + endpoint: builtins.str = ..., + bucket: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["access_key", b"access_key", "bucket", b"bucket", "endpoint", b"endpoint", "region", b"region", "secret", b"secret"]) -> None: ... + +global___AliOSSUpload = AliOSSUpload + +@typing_extensions.final +class StreamOutput(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PROTOCOL_FIELD_NUMBER: builtins.int + URLS_FIELD_NUMBER: builtins.int + protocol: global___StreamProtocol.ValueType + """required""" + @property + def urls(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """required""" + def __init__( + self, + *, + protocol: global___StreamProtocol.ValueType = ..., + urls: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["protocol", b"protocol", "urls", b"urls"]) -> None: ... + +global___StreamOutput = StreamOutput + +@typing_extensions.final +class EncodingOptions(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + WIDTH_FIELD_NUMBER: builtins.int + HEIGHT_FIELD_NUMBER: builtins.int + DEPTH_FIELD_NUMBER: builtins.int + FRAMERATE_FIELD_NUMBER: builtins.int + AUDIO_CODEC_FIELD_NUMBER: builtins.int + AUDIO_BITRATE_FIELD_NUMBER: builtins.int + AUDIO_FREQUENCY_FIELD_NUMBER: builtins.int + VIDEO_CODEC_FIELD_NUMBER: builtins.int + VIDEO_BITRATE_FIELD_NUMBER: builtins.int + KEY_FRAME_INTERVAL_FIELD_NUMBER: builtins.int + width: builtins.int + """(default 1920)""" + height: builtins.int + """(default 1080)""" + depth: builtins.int + """(default 24)""" + framerate: builtins.int + """(default 30)""" + audio_codec: livekit_models_pb2.AudioCodec.ValueType + """(default OPUS)""" + audio_bitrate: builtins.int + """(default 128)""" + audio_frequency: builtins.int + """(default 44100)""" + video_codec: livekit_models_pb2.VideoCodec.ValueType + """(default H264_MAIN)""" + video_bitrate: builtins.int + """(default 4500)""" + key_frame_interval: builtins.float + """in seconds (default 4s for streaming, segment duration for segmented output, encoder default for files)""" + def __init__( + self, + *, + width: builtins.int = ..., + height: builtins.int = ..., + depth: builtins.int = ..., + framerate: builtins.int = ..., + audio_codec: livekit_models_pb2.AudioCodec.ValueType = ..., + audio_bitrate: builtins.int = ..., + audio_frequency: builtins.int = ..., + video_codec: livekit_models_pb2.VideoCodec.ValueType = ..., + video_bitrate: builtins.int = ..., + key_frame_interval: builtins.float = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["audio_bitrate", b"audio_bitrate", "audio_codec", b"audio_codec", "audio_frequency", b"audio_frequency", "depth", b"depth", "framerate", b"framerate", "height", b"height", "key_frame_interval", b"key_frame_interval", "video_bitrate", b"video_bitrate", "video_codec", b"video_codec", "width", b"width"]) -> None: ... + +global___EncodingOptions = EncodingOptions + +@typing_extensions.final +class UpdateLayoutRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EGRESS_ID_FIELD_NUMBER: builtins.int + LAYOUT_FIELD_NUMBER: builtins.int + egress_id: builtins.str + layout: builtins.str + def __init__( + self, + *, + egress_id: builtins.str = ..., + layout: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["egress_id", b"egress_id", "layout", b"layout"]) -> None: ... + +global___UpdateLayoutRequest = UpdateLayoutRequest + +@typing_extensions.final +class UpdateStreamRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EGRESS_ID_FIELD_NUMBER: builtins.int + ADD_OUTPUT_URLS_FIELD_NUMBER: builtins.int + REMOVE_OUTPUT_URLS_FIELD_NUMBER: builtins.int + egress_id: builtins.str + @property + def add_output_urls(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + @property + def remove_output_urls(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + egress_id: builtins.str = ..., + add_output_urls: collections.abc.Iterable[builtins.str] | None = ..., + remove_output_urls: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["add_output_urls", b"add_output_urls", "egress_id", b"egress_id", "remove_output_urls", b"remove_output_urls"]) -> None: ... + +global___UpdateStreamRequest = UpdateStreamRequest + +@typing_extensions.final +class UpdateOutputsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EGRESS_ID_FIELD_NUMBER: builtins.int + ADD_IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + REMOVE_IMAGE_OUTPUTS_FIELD_NUMBER: builtins.int + egress_id: builtins.str + @property + def add_image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + @property + def remove_image_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImageOutput]: ... + def __init__( + self, + *, + egress_id: builtins.str = ..., + add_image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + remove_image_outputs: collections.abc.Iterable[global___ImageOutput] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["add_image_outputs", b"add_image_outputs", "egress_id", b"egress_id", "remove_image_outputs", b"remove_image_outputs"]) -> None: ... + +global___UpdateOutputsRequest = UpdateOutputsRequest + +@typing_extensions.final +class ListEgressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + EGRESS_ID_FIELD_NUMBER: builtins.int + ACTIVE_FIELD_NUMBER: builtins.int + room_name: builtins.str + """(optional, filter by room name)""" + egress_id: builtins.str + """(optional, filter by egress ID)""" + active: builtins.bool + """(optional, list active egress only)""" + def __init__( + self, + *, + room_name: builtins.str = ..., + egress_id: builtins.str = ..., + active: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["active", b"active", "egress_id", b"egress_id", "room_name", b"room_name"]) -> None: ... + +global___ListEgressRequest = ListEgressRequest + +@typing_extensions.final +class ListEgressResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ITEMS_FIELD_NUMBER: builtins.int + @property + def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EgressInfo]: ... + def __init__( + self, + *, + items: collections.abc.Iterable[global___EgressInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["items", b"items"]) -> None: ... + +global___ListEgressResponse = ListEgressResponse + +@typing_extensions.final +class StopEgressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EGRESS_ID_FIELD_NUMBER: builtins.int + egress_id: builtins.str + def __init__( + self, + *, + egress_id: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["egress_id", b"egress_id"]) -> None: ... + +global___StopEgressRequest = StopEgressRequest + +@typing_extensions.final +class EgressInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EGRESS_ID_FIELD_NUMBER: builtins.int + ROOM_ID_FIELD_NUMBER: builtins.int + ROOM_NAME_FIELD_NUMBER: builtins.int + STATUS_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + UPDATED_AT_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + ROOM_COMPOSITE_FIELD_NUMBER: builtins.int + WEB_FIELD_NUMBER: builtins.int + PARTICIPANT_FIELD_NUMBER: builtins.int + TRACK_COMPOSITE_FIELD_NUMBER: builtins.int + TRACK_FIELD_NUMBER: builtins.int + STREAM_FIELD_NUMBER: builtins.int + FILE_FIELD_NUMBER: builtins.int + SEGMENTS_FIELD_NUMBER: builtins.int + STREAM_RESULTS_FIELD_NUMBER: builtins.int + FILE_RESULTS_FIELD_NUMBER: builtins.int + SEGMENT_RESULTS_FIELD_NUMBER: builtins.int + IMAGE_RESULTS_FIELD_NUMBER: builtins.int + egress_id: builtins.str + room_id: builtins.str + room_name: builtins.str + status: global___EgressStatus.ValueType + started_at: builtins.int + ended_at: builtins.int + updated_at: builtins.int + error: builtins.str + @property + def room_composite(self) -> global___RoomCompositeEgressRequest: ... + @property + def web(self) -> global___WebEgressRequest: ... + @property + def participant(self) -> global___ParticipantEgressRequest: ... + @property + def track_composite(self) -> global___TrackCompositeEgressRequest: ... + @property + def track(self) -> global___TrackEgressRequest: ... + @property + def stream(self) -> global___StreamInfoList: ... + @property + def file(self) -> global___FileInfo: ... + @property + def segments(self) -> global___SegmentsInfo: ... + @property + def stream_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamInfo]: ... + @property + def file_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FileInfo]: ... + @property + def segment_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentsInfo]: ... + @property + def image_results(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___ImagesInfo]: ... + def __init__( + self, + *, + egress_id: builtins.str = ..., + room_id: builtins.str = ..., + room_name: builtins.str = ..., + status: global___EgressStatus.ValueType = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + updated_at: builtins.int = ..., + error: builtins.str = ..., + room_composite: global___RoomCompositeEgressRequest | None = ..., + web: global___WebEgressRequest | None = ..., + participant: global___ParticipantEgressRequest | None = ..., + track_composite: global___TrackCompositeEgressRequest | None = ..., + track: global___TrackEgressRequest | None = ..., + stream: global___StreamInfoList | None = ..., + file: global___FileInfo | None = ..., + segments: global___SegmentsInfo | None = ..., + stream_results: collections.abc.Iterable[global___StreamInfo] | None = ..., + file_results: collections.abc.Iterable[global___FileInfo] | None = ..., + segment_results: collections.abc.Iterable[global___SegmentsInfo] | None = ..., + image_results: collections.abc.Iterable[global___ImagesInfo] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["file", b"file", "participant", b"participant", "request", b"request", "result", b"result", "room_composite", b"room_composite", "segments", b"segments", "stream", b"stream", "track", b"track", "track_composite", b"track_composite", "web", b"web"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["egress_id", b"egress_id", "ended_at", b"ended_at", "error", b"error", "file", b"file", "file_results", b"file_results", "image_results", b"image_results", "participant", b"participant", "request", b"request", "result", b"result", "room_composite", b"room_composite", "room_id", b"room_id", "room_name", b"room_name", "segment_results", b"segment_results", "segments", b"segments", "started_at", b"started_at", "status", b"status", "stream", b"stream", "stream_results", b"stream_results", "track", b"track", "track_composite", b"track_composite", "updated_at", b"updated_at", "web", b"web"]) -> None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["request", b"request"]) -> typing_extensions.Literal["room_composite", "web", "participant", "track_composite", "track"] | None: ... + @typing.overload + def WhichOneof(self, oneof_group: typing_extensions.Literal["result", b"result"]) -> typing_extensions.Literal["stream", "file", "segments"] | None: ... + +global___EgressInfo = EgressInfo + +@typing_extensions.final +class StreamInfoList(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INFO_FIELD_NUMBER: builtins.int + @property + def info(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___StreamInfo]: ... + def __init__( + self, + *, + info: collections.abc.Iterable[global___StreamInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["info", b"info"]) -> None: ... + +global___StreamInfoList = StreamInfoList + +@typing_extensions.final +class StreamInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Status: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _StatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[StreamInfo._Status.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + ACTIVE: StreamInfo._Status.ValueType # 0 + FINISHED: StreamInfo._Status.ValueType # 1 + FAILED: StreamInfo._Status.ValueType # 2 + + class Status(_Status, metaclass=_StatusEnumTypeWrapper): ... + ACTIVE: StreamInfo.Status.ValueType # 0 + FINISHED: StreamInfo.Status.ValueType # 1 + FAILED: StreamInfo.Status.ValueType # 2 + + URL_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + STATUS_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + url: builtins.str + started_at: builtins.int + ended_at: builtins.int + duration: builtins.int + status: global___StreamInfo.Status.ValueType + error: builtins.str + def __init__( + self, + *, + url: builtins.str = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + duration: builtins.int = ..., + status: global___StreamInfo.Status.ValueType = ..., + error: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["duration", b"duration", "ended_at", b"ended_at", "error", b"error", "started_at", b"started_at", "status", b"status", "url", b"url"]) -> None: ... + +global___StreamInfo = StreamInfo + +@typing_extensions.final +class FileInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FILENAME_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + SIZE_FIELD_NUMBER: builtins.int + LOCATION_FIELD_NUMBER: builtins.int + filename: builtins.str + started_at: builtins.int + ended_at: builtins.int + duration: builtins.int + size: builtins.int + location: builtins.str + def __init__( + self, + *, + filename: builtins.str = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + duration: builtins.int = ..., + size: builtins.int = ..., + location: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["duration", b"duration", "ended_at", b"ended_at", "filename", b"filename", "location", b"location", "size", b"size", "started_at", b"started_at"]) -> None: ... + +global___FileInfo = FileInfo + +@typing_extensions.final +class SegmentsInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PLAYLIST_NAME_FIELD_NUMBER: builtins.int + LIVE_PLAYLIST_NAME_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + SIZE_FIELD_NUMBER: builtins.int + PLAYLIST_LOCATION_FIELD_NUMBER: builtins.int + LIVE_PLAYLIST_LOCATION_FIELD_NUMBER: builtins.int + SEGMENT_COUNT_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + playlist_name: builtins.str + live_playlist_name: builtins.str + duration: builtins.int + size: builtins.int + playlist_location: builtins.str + live_playlist_location: builtins.str + segment_count: builtins.int + started_at: builtins.int + ended_at: builtins.int + def __init__( + self, + *, + playlist_name: builtins.str = ..., + live_playlist_name: builtins.str = ..., + duration: builtins.int = ..., + size: builtins.int = ..., + playlist_location: builtins.str = ..., + live_playlist_location: builtins.str = ..., + segment_count: builtins.int = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["duration", b"duration", "ended_at", b"ended_at", "live_playlist_location", b"live_playlist_location", "live_playlist_name", b"live_playlist_name", "playlist_location", b"playlist_location", "playlist_name", b"playlist_name", "segment_count", b"segment_count", "size", b"size", "started_at", b"started_at"]) -> None: ... + +global___SegmentsInfo = SegmentsInfo + +@typing_extensions.final +class ImagesInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + IMAGE_COUNT_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + image_count: builtins.int + started_at: builtins.int + ended_at: builtins.int + def __init__( + self, + *, + image_count: builtins.int = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["ended_at", b"ended_at", "image_count", b"image_count", "started_at", b"started_at"]) -> None: ... + +global___ImagesInfo = ImagesInfo + +@typing_extensions.final +class AutoParticipantEgress(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PRESET_FIELD_NUMBER: builtins.int + ADVANCED_FIELD_NUMBER: builtins.int + FILE_OUTPUTS_FIELD_NUMBER: builtins.int + SEGMENT_OUTPUTS_FIELD_NUMBER: builtins.int + preset: global___EncodingOptionsPreset.ValueType + """(default H264_720P_30)""" + @property + def advanced(self) -> global___EncodingOptions: + """(optional)""" + @property + def file_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___EncodedFileOutput]: ... + @property + def segment_outputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SegmentedFileOutput]: ... + def __init__( + self, + *, + preset: global___EncodingOptionsPreset.ValueType = ..., + advanced: global___EncodingOptions | None = ..., + file_outputs: collections.abc.Iterable[global___EncodedFileOutput] | None = ..., + segment_outputs: collections.abc.Iterable[global___SegmentedFileOutput] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "options", b"options", "preset", b"preset"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["advanced", b"advanced", "file_outputs", b"file_outputs", "options", b"options", "preset", b"preset", "segment_outputs", b"segment_outputs"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["options", b"options"]) -> typing_extensions.Literal["preset", "advanced"] | None: ... + +global___AutoParticipantEgress = AutoParticipantEgress + +@typing_extensions.final +class AutoTrackEgress(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + FILEPATH_FIELD_NUMBER: builtins.int + DISABLE_MANIFEST_FIELD_NUMBER: builtins.int + S3_FIELD_NUMBER: builtins.int + GCP_FIELD_NUMBER: builtins.int + AZURE_FIELD_NUMBER: builtins.int + filepath: builtins.str + """see docs for templating (default {track_id}-{time})""" + disable_manifest: builtins.bool + """disables upload of json manifest file (default false)""" + @property + def s3(self) -> global___S3Upload: ... + @property + def gcp(self) -> global___GCPUpload: ... + @property + def azure(self) -> global___AzureBlobUpload: ... + def __init__( + self, + *, + filepath: builtins.str = ..., + disable_manifest: builtins.bool = ..., + s3: global___S3Upload | None = ..., + gcp: global___GCPUpload | None = ..., + azure: global___AzureBlobUpload | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["azure", b"azure", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["azure", b"azure", "disable_manifest", b"disable_manifest", "filepath", b"filepath", "gcp", b"gcp", "output", b"output", "s3", b"s3"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["output", b"output"]) -> typing_extensions.Literal["s3", "gcp", "azure"] | None: ... + +global___AutoTrackEgress = AutoTrackEgress diff --git a/livekit-api/livekit/api/_proto/livekit_ingress_pb2.py b/livekit-api/livekit/api/_proto/livekit_ingress_pb2.py new file mode 100644 index 00000000..e44c6cfb --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_ingress_pb2.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: livekit_ingress.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import livekit_models_pb2 as livekit__models__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15livekit_ingress.proto\x12\x07livekit\x1a\x14livekit_models.proto\"\x9d\x02\n\x14\x43reateIngressRequest\x12)\n\ninput_type\x18\x01 \x01(\x0e\x32\x15.livekit.IngressInput\x12\x0b\n\x03url\x18\t \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\troom_name\x18\x03 \x01(\t\x12\x1c\n\x14participant_identity\x18\x04 \x01(\t\x12\x18\n\x10participant_name\x18\x05 \x01(\t\x12\x1a\n\x12\x62ypass_transcoding\x18\x08 \x01(\x08\x12+\n\x05\x61udio\x18\x06 \x01(\x0b\x32\x1c.livekit.IngressAudioOptions\x12+\n\x05video\x18\x07 \x01(\x0b\x32\x1c.livekit.IngressVideoOptions\"\xcd\x01\n\x13IngressAudioOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x06source\x18\x02 \x01(\x0e\x32\x14.livekit.TrackSource\x12\x35\n\x06preset\x18\x03 \x01(\x0e\x32#.livekit.IngressAudioEncodingPresetH\x00\x12\x37\n\x07options\x18\x04 \x01(\x0b\x32$.livekit.IngressAudioEncodingOptionsH\x00\x42\x12\n\x10\x65ncoding_options\"\xcd\x01\n\x13IngressVideoOptions\x12\x0c\n\x04name\x18\x01 \x01(\t\x12$\n\x06source\x18\x02 \x01(\x0e\x32\x14.livekit.TrackSource\x12\x35\n\x06preset\x18\x03 \x01(\x0e\x32#.livekit.IngressVideoEncodingPresetH\x00\x12\x37\n\x07options\x18\x04 \x01(\x0b\x32$.livekit.IngressVideoEncodingOptionsH\x00\x42\x12\n\x10\x65ncoding_options\"\x7f\n\x1bIngressAudioEncodingOptions\x12(\n\x0b\x61udio_codec\x18\x01 \x01(\x0e\x32\x13.livekit.AudioCodec\x12\x0f\n\x07\x62itrate\x18\x02 \x01(\r\x12\x13\n\x0b\x64isable_dtx\x18\x03 \x01(\x08\x12\x10\n\x08\x63hannels\x18\x04 \x01(\r\"\x80\x01\n\x1bIngressVideoEncodingOptions\x12(\n\x0bvideo_codec\x18\x01 \x01(\x0e\x32\x13.livekit.VideoCodec\x12\x12\n\nframe_rate\x18\x02 \x01(\x01\x12#\n\x06layers\x18\x03 \x03(\x0b\x32\x13.livekit.VideoLayer\"\xf4\x02\n\x0bIngressInfo\x12\x12\n\ningress_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\nstream_key\x18\x03 \x01(\t\x12\x0b\n\x03url\x18\x04 \x01(\t\x12)\n\ninput_type\x18\x05 \x01(\x0e\x32\x15.livekit.IngressInput\x12\x1a\n\x12\x62ypass_transcoding\x18\r \x01(\x08\x12+\n\x05\x61udio\x18\x06 \x01(\x0b\x32\x1c.livekit.IngressAudioOptions\x12+\n\x05video\x18\x07 \x01(\x0b\x32\x1c.livekit.IngressVideoOptions\x12\x11\n\troom_name\x18\x08 \x01(\t\x12\x1c\n\x14participant_identity\x18\t \x01(\t\x12\x18\n\x10participant_name\x18\n \x01(\t\x12\x10\n\x08reusable\x18\x0b \x01(\x08\x12$\n\x05state\x18\x0c \x01(\x0b\x32\x15.livekit.IngressState\"\x8a\x03\n\x0cIngressState\x12,\n\x06status\x18\x01 \x01(\x0e\x32\x1c.livekit.IngressState.Status\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\'\n\x05video\x18\x03 \x01(\x0b\x32\x18.livekit.InputVideoState\x12\'\n\x05\x61udio\x18\x04 \x01(\x0b\x32\x18.livekit.InputAudioState\x12\x0f\n\x07room_id\x18\x05 \x01(\t\x12\x12\n\nstarted_at\x18\x07 \x01(\x03\x12\x10\n\x08\x65nded_at\x18\x08 \x01(\x03\x12\x13\n\x0bresource_id\x18\t \x01(\t\x12\"\n\x06tracks\x18\x06 \x03(\x0b\x32\x12.livekit.TrackInfo\"{\n\x06Status\x12\x15\n\x11\x45NDPOINT_INACTIVE\x10\x00\x12\x16\n\x12\x45NDPOINT_BUFFERING\x10\x01\x12\x17\n\x13\x45NDPOINT_PUBLISHING\x10\x02\x12\x12\n\x0e\x45NDPOINT_ERROR\x10\x03\x12\x15\n\x11\x45NDPOINT_COMPLETE\x10\x04\"o\n\x0fInputVideoState\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x17\n\x0f\x61verage_bitrate\x18\x02 \x01(\r\x12\r\n\x05width\x18\x03 \x01(\r\x12\x0e\n\x06height\x18\x04 \x01(\r\x12\x11\n\tframerate\x18\x05 \x01(\x01\"d\n\x0fInputAudioState\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x17\n\x0f\x61verage_bitrate\x18\x02 \x01(\r\x12\x10\n\x08\x63hannels\x18\x03 \x01(\r\x12\x13\n\x0bsample_rate\x18\x04 \x01(\r\"\x95\x02\n\x14UpdateIngressRequest\x12\x12\n\ningress_id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\troom_name\x18\x03 \x01(\t\x12\x1c\n\x14participant_identity\x18\x04 \x01(\t\x12\x18\n\x10participant_name\x18\x05 \x01(\t\x12\x1f\n\x12\x62ypass_transcoding\x18\x08 \x01(\x08H\x00\x88\x01\x01\x12+\n\x05\x61udio\x18\x06 \x01(\x0b\x32\x1c.livekit.IngressAudioOptions\x12+\n\x05video\x18\x07 \x01(\x0b\x32\x1c.livekit.IngressVideoOptionsB\x15\n\x13_bypass_transcoding\";\n\x12ListIngressRequest\x12\x11\n\troom_name\x18\x01 \x01(\t\x12\x12\n\ningress_id\x18\x02 \x01(\t\":\n\x13ListIngressResponse\x12#\n\x05items\x18\x01 \x03(\x0b\x32\x14.livekit.IngressInfo\"*\n\x14\x44\x65leteIngressRequest\x12\x12\n\ningress_id\x18\x01 \x01(\t*=\n\x0cIngressInput\x12\x0e\n\nRTMP_INPUT\x10\x00\x12\x0e\n\nWHIP_INPUT\x10\x01\x12\r\n\tURL_INPUT\x10\x02*I\n\x1aIngressAudioEncodingPreset\x12\x16\n\x12OPUS_STEREO_96KBPS\x10\x00\x12\x13\n\x0fOPUS_MONO_64KBS\x10\x01*\x84\x03\n\x1aIngressVideoEncodingPreset\x12\x1c\n\x18H264_720P_30FPS_3_LAYERS\x10\x00\x12\x1d\n\x19H264_1080P_30FPS_3_LAYERS\x10\x01\x12\x1c\n\x18H264_540P_25FPS_2_LAYERS\x10\x02\x12\x1b\n\x17H264_720P_30FPS_1_LAYER\x10\x03\x12\x1c\n\x18H264_1080P_30FPS_1_LAYER\x10\x04\x12(\n$H264_720P_30FPS_3_LAYERS_HIGH_MOTION\x10\x05\x12)\n%H264_1080P_30FPS_3_LAYERS_HIGH_MOTION\x10\x06\x12(\n$H264_540P_25FPS_2_LAYERS_HIGH_MOTION\x10\x07\x12\'\n#H264_720P_30FPS_1_LAYER_HIGH_MOTION\x10\x08\x12(\n$H264_1080P_30FPS_1_LAYER_HIGH_MOTION\x10\t2\xa5\x02\n\x07Ingress\x12\x44\n\rCreateIngress\x12\x1d.livekit.CreateIngressRequest\x1a\x14.livekit.IngressInfo\x12\x44\n\rUpdateIngress\x12\x1d.livekit.UpdateIngressRequest\x1a\x14.livekit.IngressInfo\x12H\n\x0bListIngress\x12\x1b.livekit.ListIngressRequest\x1a\x1c.livekit.ListIngressResponse\x12\x44\n\rDeleteIngress\x12\x1d.livekit.DeleteIngressRequest\x1a\x14.livekit.IngressInfoBFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'livekit_ingress_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto' + _globals['_INGRESSINPUT']._serialized_start=2452 + _globals['_INGRESSINPUT']._serialized_end=2513 + _globals['_INGRESSAUDIOENCODINGPRESET']._serialized_start=2515 + _globals['_INGRESSAUDIOENCODINGPRESET']._serialized_end=2588 + _globals['_INGRESSVIDEOENCODINGPRESET']._serialized_start=2591 + _globals['_INGRESSVIDEOENCODINGPRESET']._serialized_end=2979 + _globals['_CREATEINGRESSREQUEST']._serialized_start=57 + _globals['_CREATEINGRESSREQUEST']._serialized_end=342 + _globals['_INGRESSAUDIOOPTIONS']._serialized_start=345 + _globals['_INGRESSAUDIOOPTIONS']._serialized_end=550 + _globals['_INGRESSVIDEOOPTIONS']._serialized_start=553 + _globals['_INGRESSVIDEOOPTIONS']._serialized_end=758 + _globals['_INGRESSAUDIOENCODINGOPTIONS']._serialized_start=760 + _globals['_INGRESSAUDIOENCODINGOPTIONS']._serialized_end=887 + _globals['_INGRESSVIDEOENCODINGOPTIONS']._serialized_start=890 + _globals['_INGRESSVIDEOENCODINGOPTIONS']._serialized_end=1018 + _globals['_INGRESSINFO']._serialized_start=1021 + _globals['_INGRESSINFO']._serialized_end=1393 + _globals['_INGRESSSTATE']._serialized_start=1396 + _globals['_INGRESSSTATE']._serialized_end=1790 + _globals['_INGRESSSTATE_STATUS']._serialized_start=1667 + _globals['_INGRESSSTATE_STATUS']._serialized_end=1790 + _globals['_INPUTVIDEOSTATE']._serialized_start=1792 + _globals['_INPUTVIDEOSTATE']._serialized_end=1903 + _globals['_INPUTAUDIOSTATE']._serialized_start=1905 + _globals['_INPUTAUDIOSTATE']._serialized_end=2005 + _globals['_UPDATEINGRESSREQUEST']._serialized_start=2008 + _globals['_UPDATEINGRESSREQUEST']._serialized_end=2285 + _globals['_LISTINGRESSREQUEST']._serialized_start=2287 + _globals['_LISTINGRESSREQUEST']._serialized_end=2346 + _globals['_LISTINGRESSRESPONSE']._serialized_start=2348 + _globals['_LISTINGRESSRESPONSE']._serialized_end=2406 + _globals['_DELETEINGRESSREQUEST']._serialized_start=2408 + _globals['_DELETEINGRESSREQUEST']._serialized_end=2450 + _globals['_INGRESS']._serialized_start=2982 + _globals['_INGRESS']._serialized_end=3275 +# @@protoc_insertion_point(module_scope) diff --git a/livekit-api/livekit/api/_proto/livekit_ingress_pb2.pyi b/livekit-api/livekit/api/_proto/livekit_ingress_pb2.pyi new file mode 100644 index 00000000..4867b22f --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_ingress_pb2.pyi @@ -0,0 +1,542 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright 2023 LiveKit, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +from . import livekit_models_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _IngressInput: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _IngressInputEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_IngressInput.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + RTMP_INPUT: _IngressInput.ValueType # 0 + WHIP_INPUT: _IngressInput.ValueType # 1 + URL_INPUT: _IngressInput.ValueType # 2 + """Pull from the provided URL. Only HTTP url are supported, serving either a single media file or a HLS stream""" + +class IngressInput(_IngressInput, metaclass=_IngressInputEnumTypeWrapper): ... + +RTMP_INPUT: IngressInput.ValueType # 0 +WHIP_INPUT: IngressInput.ValueType # 1 +URL_INPUT: IngressInput.ValueType # 2 +"""Pull from the provided URL. Only HTTP url are supported, serving either a single media file or a HLS stream""" +global___IngressInput = IngressInput + +class _IngressAudioEncodingPreset: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _IngressAudioEncodingPresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_IngressAudioEncodingPreset.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + OPUS_STEREO_96KBPS: _IngressAudioEncodingPreset.ValueType # 0 + """OPUS, 2 channels, 96kbps""" + OPUS_MONO_64KBS: _IngressAudioEncodingPreset.ValueType # 1 + """OPUS, 1 channel, 64kbps""" + +class IngressAudioEncodingPreset(_IngressAudioEncodingPreset, metaclass=_IngressAudioEncodingPresetEnumTypeWrapper): ... + +OPUS_STEREO_96KBPS: IngressAudioEncodingPreset.ValueType # 0 +"""OPUS, 2 channels, 96kbps""" +OPUS_MONO_64KBS: IngressAudioEncodingPreset.ValueType # 1 +"""OPUS, 1 channel, 64kbps""" +global___IngressAudioEncodingPreset = IngressAudioEncodingPreset + +class _IngressVideoEncodingPreset: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _IngressVideoEncodingPresetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_IngressVideoEncodingPreset.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + H264_720P_30FPS_3_LAYERS: _IngressVideoEncodingPreset.ValueType # 0 + """1280x720, 30fps, 1900kbps main layer, 3 layers total""" + H264_1080P_30FPS_3_LAYERS: _IngressVideoEncodingPreset.ValueType # 1 + """1980x1080, 30fps, 3500kbps main layer, 3 layers total""" + H264_540P_25FPS_2_LAYERS: _IngressVideoEncodingPreset.ValueType # 2 + """ 960x540, 25fps, 1000kbps main layer, 2 layers total""" + H264_720P_30FPS_1_LAYER: _IngressVideoEncodingPreset.ValueType # 3 + """1280x720, 30fps, 1900kbps, no simulcast""" + H264_1080P_30FPS_1_LAYER: _IngressVideoEncodingPreset.ValueType # 4 + """1980x1080, 30fps, 3500kbps, no simulcast""" + H264_720P_30FPS_3_LAYERS_HIGH_MOTION: _IngressVideoEncodingPreset.ValueType # 5 + """1280x720, 30fps, 2500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content""" + H264_1080P_30FPS_3_LAYERS_HIGH_MOTION: _IngressVideoEncodingPreset.ValueType # 6 + """1980x1080, 30fps, 4500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content""" + H264_540P_25FPS_2_LAYERS_HIGH_MOTION: _IngressVideoEncodingPreset.ValueType # 7 + """ 960x540, 25fps, 1300kbps main layer, 2 layers total, higher bitrate for high motion, harder to encode content""" + H264_720P_30FPS_1_LAYER_HIGH_MOTION: _IngressVideoEncodingPreset.ValueType # 8 + """1280x720, 30fps, 2500kbps, no simulcast, higher bitrate for high motion, harder to encode content""" + H264_1080P_30FPS_1_LAYER_HIGH_MOTION: _IngressVideoEncodingPreset.ValueType # 9 + """1980x1080, 30fps, 4500kbps, no simulcast, higher bitrate for high motion, harder to encode content""" + +class IngressVideoEncodingPreset(_IngressVideoEncodingPreset, metaclass=_IngressVideoEncodingPresetEnumTypeWrapper): ... + +H264_720P_30FPS_3_LAYERS: IngressVideoEncodingPreset.ValueType # 0 +"""1280x720, 30fps, 1900kbps main layer, 3 layers total""" +H264_1080P_30FPS_3_LAYERS: IngressVideoEncodingPreset.ValueType # 1 +"""1980x1080, 30fps, 3500kbps main layer, 3 layers total""" +H264_540P_25FPS_2_LAYERS: IngressVideoEncodingPreset.ValueType # 2 +""" 960x540, 25fps, 1000kbps main layer, 2 layers total""" +H264_720P_30FPS_1_LAYER: IngressVideoEncodingPreset.ValueType # 3 +"""1280x720, 30fps, 1900kbps, no simulcast""" +H264_1080P_30FPS_1_LAYER: IngressVideoEncodingPreset.ValueType # 4 +"""1980x1080, 30fps, 3500kbps, no simulcast""" +H264_720P_30FPS_3_LAYERS_HIGH_MOTION: IngressVideoEncodingPreset.ValueType # 5 +"""1280x720, 30fps, 2500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content""" +H264_1080P_30FPS_3_LAYERS_HIGH_MOTION: IngressVideoEncodingPreset.ValueType # 6 +"""1980x1080, 30fps, 4500kbps main layer, 3 layers total, higher bitrate for high motion, harder to encode content""" +H264_540P_25FPS_2_LAYERS_HIGH_MOTION: IngressVideoEncodingPreset.ValueType # 7 +""" 960x540, 25fps, 1300kbps main layer, 2 layers total, higher bitrate for high motion, harder to encode content""" +H264_720P_30FPS_1_LAYER_HIGH_MOTION: IngressVideoEncodingPreset.ValueType # 8 +"""1280x720, 30fps, 2500kbps, no simulcast, higher bitrate for high motion, harder to encode content""" +H264_1080P_30FPS_1_LAYER_HIGH_MOTION: IngressVideoEncodingPreset.ValueType # 9 +"""1980x1080, 30fps, 4500kbps, no simulcast, higher bitrate for high motion, harder to encode content""" +global___IngressVideoEncodingPreset = IngressVideoEncodingPreset + +@typing_extensions.final +class CreateIngressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INPUT_TYPE_FIELD_NUMBER: builtins.int + URL_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + ROOM_NAME_FIELD_NUMBER: builtins.int + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + PARTICIPANT_NAME_FIELD_NUMBER: builtins.int + BYPASS_TRANSCODING_FIELD_NUMBER: builtins.int + AUDIO_FIELD_NUMBER: builtins.int + VIDEO_FIELD_NUMBER: builtins.int + input_type: global___IngressInput.ValueType + url: builtins.str + """Where to pull media from, only for URL input type""" + name: builtins.str + """User provided identifier for the ingress""" + room_name: builtins.str + """room to publish to""" + participant_identity: builtins.str + """publish as participant""" + participant_name: builtins.str + """name of publishing participant (used for display only)""" + bypass_transcoding: builtins.bool + """whether to pass through the incoming media without transcoding, only compatible with some input types""" + @property + def audio(self) -> global___IngressAudioOptions: ... + @property + def video(self) -> global___IngressVideoOptions: ... + def __init__( + self, + *, + input_type: global___IngressInput.ValueType = ..., + url: builtins.str = ..., + name: builtins.str = ..., + room_name: builtins.str = ..., + participant_identity: builtins.str = ..., + participant_name: builtins.str = ..., + bypass_transcoding: builtins.bool = ..., + audio: global___IngressAudioOptions | None = ..., + video: global___IngressVideoOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["audio", b"audio", "video", b"video"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["audio", b"audio", "bypass_transcoding", b"bypass_transcoding", "input_type", b"input_type", "name", b"name", "participant_identity", b"participant_identity", "participant_name", b"participant_name", "room_name", b"room_name", "url", b"url", "video", b"video"]) -> None: ... + +global___CreateIngressRequest = CreateIngressRequest + +@typing_extensions.final +class IngressAudioOptions(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + SOURCE_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + OPTIONS_FIELD_NUMBER: builtins.int + name: builtins.str + source: livekit_models_pb2.TrackSource.ValueType + preset: global___IngressAudioEncodingPreset.ValueType + @property + def options(self) -> global___IngressAudioEncodingOptions: ... + def __init__( + self, + *, + name: builtins.str = ..., + source: livekit_models_pb2.TrackSource.ValueType = ..., + preset: global___IngressAudioEncodingPreset.ValueType = ..., + options: global___IngressAudioEncodingOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["encoding_options", b"encoding_options", "options", b"options", "preset", b"preset"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["encoding_options", b"encoding_options", "name", b"name", "options", b"options", "preset", b"preset", "source", b"source"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["encoding_options", b"encoding_options"]) -> typing_extensions.Literal["preset", "options"] | None: ... + +global___IngressAudioOptions = IngressAudioOptions + +@typing_extensions.final +class IngressVideoOptions(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + SOURCE_FIELD_NUMBER: builtins.int + PRESET_FIELD_NUMBER: builtins.int + OPTIONS_FIELD_NUMBER: builtins.int + name: builtins.str + source: livekit_models_pb2.TrackSource.ValueType + preset: global___IngressVideoEncodingPreset.ValueType + @property + def options(self) -> global___IngressVideoEncodingOptions: ... + def __init__( + self, + *, + name: builtins.str = ..., + source: livekit_models_pb2.TrackSource.ValueType = ..., + preset: global___IngressVideoEncodingPreset.ValueType = ..., + options: global___IngressVideoEncodingOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["encoding_options", b"encoding_options", "options", b"options", "preset", b"preset"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["encoding_options", b"encoding_options", "name", b"name", "options", b"options", "preset", b"preset", "source", b"source"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["encoding_options", b"encoding_options"]) -> typing_extensions.Literal["preset", "options"] | None: ... + +global___IngressVideoOptions = IngressVideoOptions + +@typing_extensions.final +class IngressAudioEncodingOptions(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + AUDIO_CODEC_FIELD_NUMBER: builtins.int + BITRATE_FIELD_NUMBER: builtins.int + DISABLE_DTX_FIELD_NUMBER: builtins.int + CHANNELS_FIELD_NUMBER: builtins.int + audio_codec: livekit_models_pb2.AudioCodec.ValueType + """desired audio codec to publish to room""" + bitrate: builtins.int + disable_dtx: builtins.bool + channels: builtins.int + def __init__( + self, + *, + audio_codec: livekit_models_pb2.AudioCodec.ValueType = ..., + bitrate: builtins.int = ..., + disable_dtx: builtins.bool = ..., + channels: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["audio_codec", b"audio_codec", "bitrate", b"bitrate", "channels", b"channels", "disable_dtx", b"disable_dtx"]) -> None: ... + +global___IngressAudioEncodingOptions = IngressAudioEncodingOptions + +@typing_extensions.final +class IngressVideoEncodingOptions(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + VIDEO_CODEC_FIELD_NUMBER: builtins.int + FRAME_RATE_FIELD_NUMBER: builtins.int + LAYERS_FIELD_NUMBER: builtins.int + video_codec: livekit_models_pb2.VideoCodec.ValueType + """desired codec to publish to room""" + frame_rate: builtins.float + @property + def layers(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[livekit_models_pb2.VideoLayer]: + """simulcast layers to publish, when empty, should usually be set to layers at 1/2 and 1/4 of the dimensions""" + def __init__( + self, + *, + video_codec: livekit_models_pb2.VideoCodec.ValueType = ..., + frame_rate: builtins.float = ..., + layers: collections.abc.Iterable[livekit_models_pb2.VideoLayer] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["frame_rate", b"frame_rate", "layers", b"layers", "video_codec", b"video_codec"]) -> None: ... + +global___IngressVideoEncodingOptions = IngressVideoEncodingOptions + +@typing_extensions.final +class IngressInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INGRESS_ID_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + STREAM_KEY_FIELD_NUMBER: builtins.int + URL_FIELD_NUMBER: builtins.int + INPUT_TYPE_FIELD_NUMBER: builtins.int + BYPASS_TRANSCODING_FIELD_NUMBER: builtins.int + AUDIO_FIELD_NUMBER: builtins.int + VIDEO_FIELD_NUMBER: builtins.int + ROOM_NAME_FIELD_NUMBER: builtins.int + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + PARTICIPANT_NAME_FIELD_NUMBER: builtins.int + REUSABLE_FIELD_NUMBER: builtins.int + STATE_FIELD_NUMBER: builtins.int + ingress_id: builtins.str + name: builtins.str + stream_key: builtins.str + url: builtins.str + """URL to point the encoder to for push (RTMP, WHIP), or location to pull media from for pull (URL)""" + input_type: global___IngressInput.ValueType + """for RTMP input, it'll be a rtmp:// URL + for FILE input, it'll be a http:// URL + for SRT input, it'll be a srt:// URL + """ + bypass_transcoding: builtins.bool + @property + def audio(self) -> global___IngressAudioOptions: ... + @property + def video(self) -> global___IngressVideoOptions: ... + room_name: builtins.str + participant_identity: builtins.str + participant_name: builtins.str + reusable: builtins.bool + @property + def state(self) -> global___IngressState: + """Description of error/stream non compliance and debug info for publisher otherwise (received bitrate, resolution, bandwidth)""" + def __init__( + self, + *, + ingress_id: builtins.str = ..., + name: builtins.str = ..., + stream_key: builtins.str = ..., + url: builtins.str = ..., + input_type: global___IngressInput.ValueType = ..., + bypass_transcoding: builtins.bool = ..., + audio: global___IngressAudioOptions | None = ..., + video: global___IngressVideoOptions | None = ..., + room_name: builtins.str = ..., + participant_identity: builtins.str = ..., + participant_name: builtins.str = ..., + reusable: builtins.bool = ..., + state: global___IngressState | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["audio", b"audio", "state", b"state", "video", b"video"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["audio", b"audio", "bypass_transcoding", b"bypass_transcoding", "ingress_id", b"ingress_id", "input_type", b"input_type", "name", b"name", "participant_identity", b"participant_identity", "participant_name", b"participant_name", "reusable", b"reusable", "room_name", b"room_name", "state", b"state", "stream_key", b"stream_key", "url", b"url", "video", b"video"]) -> None: ... + +global___IngressInfo = IngressInfo + +@typing_extensions.final +class IngressState(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Status: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _StatusEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[IngressState._Status.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + ENDPOINT_INACTIVE: IngressState._Status.ValueType # 0 + ENDPOINT_BUFFERING: IngressState._Status.ValueType # 1 + ENDPOINT_PUBLISHING: IngressState._Status.ValueType # 2 + ENDPOINT_ERROR: IngressState._Status.ValueType # 3 + ENDPOINT_COMPLETE: IngressState._Status.ValueType # 4 + + class Status(_Status, metaclass=_StatusEnumTypeWrapper): ... + ENDPOINT_INACTIVE: IngressState.Status.ValueType # 0 + ENDPOINT_BUFFERING: IngressState.Status.ValueType # 1 + ENDPOINT_PUBLISHING: IngressState.Status.ValueType # 2 + ENDPOINT_ERROR: IngressState.Status.ValueType # 3 + ENDPOINT_COMPLETE: IngressState.Status.ValueType # 4 + + STATUS_FIELD_NUMBER: builtins.int + ERROR_FIELD_NUMBER: builtins.int + VIDEO_FIELD_NUMBER: builtins.int + AUDIO_FIELD_NUMBER: builtins.int + ROOM_ID_FIELD_NUMBER: builtins.int + STARTED_AT_FIELD_NUMBER: builtins.int + ENDED_AT_FIELD_NUMBER: builtins.int + RESOURCE_ID_FIELD_NUMBER: builtins.int + TRACKS_FIELD_NUMBER: builtins.int + status: global___IngressState.Status.ValueType + error: builtins.str + """Error/non compliance description if any""" + @property + def video(self) -> global___InputVideoState: ... + @property + def audio(self) -> global___InputAudioState: ... + room_id: builtins.str + """ID of the current/previous room published to""" + started_at: builtins.int + ended_at: builtins.int + resource_id: builtins.str + @property + def tracks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[livekit_models_pb2.TrackInfo]: ... + def __init__( + self, + *, + status: global___IngressState.Status.ValueType = ..., + error: builtins.str = ..., + video: global___InputVideoState | None = ..., + audio: global___InputAudioState | None = ..., + room_id: builtins.str = ..., + started_at: builtins.int = ..., + ended_at: builtins.int = ..., + resource_id: builtins.str = ..., + tracks: collections.abc.Iterable[livekit_models_pb2.TrackInfo] | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["audio", b"audio", "video", b"video"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["audio", b"audio", "ended_at", b"ended_at", "error", b"error", "resource_id", b"resource_id", "room_id", b"room_id", "started_at", b"started_at", "status", b"status", "tracks", b"tracks", "video", b"video"]) -> None: ... + +global___IngressState = IngressState + +@typing_extensions.final +class InputVideoState(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MIME_TYPE_FIELD_NUMBER: builtins.int + AVERAGE_BITRATE_FIELD_NUMBER: builtins.int + WIDTH_FIELD_NUMBER: builtins.int + HEIGHT_FIELD_NUMBER: builtins.int + FRAMERATE_FIELD_NUMBER: builtins.int + mime_type: builtins.str + average_bitrate: builtins.int + width: builtins.int + height: builtins.int + framerate: builtins.float + def __init__( + self, + *, + mime_type: builtins.str = ..., + average_bitrate: builtins.int = ..., + width: builtins.int = ..., + height: builtins.int = ..., + framerate: builtins.float = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["average_bitrate", b"average_bitrate", "framerate", b"framerate", "height", b"height", "mime_type", b"mime_type", "width", b"width"]) -> None: ... + +global___InputVideoState = InputVideoState + +@typing_extensions.final +class InputAudioState(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MIME_TYPE_FIELD_NUMBER: builtins.int + AVERAGE_BITRATE_FIELD_NUMBER: builtins.int + CHANNELS_FIELD_NUMBER: builtins.int + SAMPLE_RATE_FIELD_NUMBER: builtins.int + mime_type: builtins.str + average_bitrate: builtins.int + channels: builtins.int + sample_rate: builtins.int + def __init__( + self, + *, + mime_type: builtins.str = ..., + average_bitrate: builtins.int = ..., + channels: builtins.int = ..., + sample_rate: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["average_bitrate", b"average_bitrate", "channels", b"channels", "mime_type", b"mime_type", "sample_rate", b"sample_rate"]) -> None: ... + +global___InputAudioState = InputAudioState + +@typing_extensions.final +class UpdateIngressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INGRESS_ID_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + ROOM_NAME_FIELD_NUMBER: builtins.int + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + PARTICIPANT_NAME_FIELD_NUMBER: builtins.int + BYPASS_TRANSCODING_FIELD_NUMBER: builtins.int + AUDIO_FIELD_NUMBER: builtins.int + VIDEO_FIELD_NUMBER: builtins.int + ingress_id: builtins.str + name: builtins.str + room_name: builtins.str + participant_identity: builtins.str + participant_name: builtins.str + bypass_transcoding: builtins.bool + @property + def audio(self) -> global___IngressAudioOptions: ... + @property + def video(self) -> global___IngressVideoOptions: ... + def __init__( + self, + *, + ingress_id: builtins.str = ..., + name: builtins.str = ..., + room_name: builtins.str = ..., + participant_identity: builtins.str = ..., + participant_name: builtins.str = ..., + bypass_transcoding: builtins.bool | None = ..., + audio: global___IngressAudioOptions | None = ..., + video: global___IngressVideoOptions | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_bypass_transcoding", b"_bypass_transcoding", "audio", b"audio", "bypass_transcoding", b"bypass_transcoding", "video", b"video"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_bypass_transcoding", b"_bypass_transcoding", "audio", b"audio", "bypass_transcoding", b"bypass_transcoding", "ingress_id", b"ingress_id", "name", b"name", "participant_identity", b"participant_identity", "participant_name", b"participant_name", "room_name", b"room_name", "video", b"video"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["_bypass_transcoding", b"_bypass_transcoding"]) -> typing_extensions.Literal["bypass_transcoding"] | None: ... + +global___UpdateIngressRequest = UpdateIngressRequest + +@typing_extensions.final +class ListIngressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_NAME_FIELD_NUMBER: builtins.int + INGRESS_ID_FIELD_NUMBER: builtins.int + room_name: builtins.str + """when blank, lists all ingress endpoints + (optional, filter by room name) + """ + ingress_id: builtins.str + """(optional, filter by ingress ID)""" + def __init__( + self, + *, + room_name: builtins.str = ..., + ingress_id: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["ingress_id", b"ingress_id", "room_name", b"room_name"]) -> None: ... + +global___ListIngressRequest = ListIngressRequest + +@typing_extensions.final +class ListIngressResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ITEMS_FIELD_NUMBER: builtins.int + @property + def items(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___IngressInfo]: ... + def __init__( + self, + *, + items: collections.abc.Iterable[global___IngressInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["items", b"items"]) -> None: ... + +global___ListIngressResponse = ListIngressResponse + +@typing_extensions.final +class DeleteIngressRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + INGRESS_ID_FIELD_NUMBER: builtins.int + ingress_id: builtins.str + def __init__( + self, + *, + ingress_id: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["ingress_id", b"ingress_id"]) -> None: ... + +global___DeleteIngressRequest = DeleteIngressRequest diff --git a/livekit-api/livekit/api/_proto/livekit_models_pb2.py b/livekit-api/livekit/api/_proto/livekit_models_pb2.py new file mode 100644 index 00000000..259273d4 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_models_pb2.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: livekit_models.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14livekit_models.proto\x12\x07livekit\x1a\x1fgoogle/protobuf/timestamp.proto\"\x86\x02\n\x04Room\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x15\n\rempty_timeout\x18\x03 \x01(\r\x12\x18\n\x10max_participants\x18\x04 \x01(\r\x12\x15\n\rcreation_time\x18\x05 \x01(\x03\x12\x15\n\rturn_password\x18\x06 \x01(\t\x12&\n\x0e\x65nabled_codecs\x18\x07 \x03(\x0b\x32\x0e.livekit.Codec\x12\x10\n\x08metadata\x18\x08 \x01(\t\x12\x18\n\x10num_participants\x18\t \x01(\r\x12\x16\n\x0enum_publishers\x18\x0b \x01(\r\x12\x18\n\x10\x61\x63tive_recording\x18\n \x01(\x08\"(\n\x05\x43odec\x12\x0c\n\x04mime\x18\x01 \x01(\t\x12\x11\n\tfmtp_line\x18\x02 \x01(\t\"9\n\x0cPlayoutDelay\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x0b\n\x03min\x18\x02 \x01(\r\x12\x0b\n\x03max\x18\x03 \x01(\r\"\xcf\x01\n\x15ParticipantPermission\x12\x15\n\rcan_subscribe\x18\x01 \x01(\x08\x12\x13\n\x0b\x63\x61n_publish\x18\x02 \x01(\x08\x12\x18\n\x10\x63\x61n_publish_data\x18\x03 \x01(\x08\x12\x31\n\x13\x63\x61n_publish_sources\x18\t \x03(\x0e\x32\x14.livekit.TrackSource\x12\x0e\n\x06hidden\x18\x07 \x01(\x08\x12\x10\n\x08recorder\x18\x08 \x01(\x08\x12\x1b\n\x13\x63\x61n_update_metadata\x18\n \x01(\x08\"\xe1\x02\n\x0fParticipantInfo\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\x12-\n\x05state\x18\x03 \x01(\x0e\x32\x1e.livekit.ParticipantInfo.State\x12\"\n\x06tracks\x18\x04 \x03(\x0b\x32\x12.livekit.TrackInfo\x12\x10\n\x08metadata\x18\x05 \x01(\t\x12\x11\n\tjoined_at\x18\x06 \x01(\x03\x12\x0c\n\x04name\x18\t \x01(\t\x12\x0f\n\x07version\x18\n \x01(\r\x12\x32\n\npermission\x18\x0b \x01(\x0b\x32\x1e.livekit.ParticipantPermission\x12\x0e\n\x06region\x18\x0c \x01(\t\x12\x14\n\x0cis_publisher\x18\r \x01(\x08\">\n\x05State\x12\x0b\n\x07JOINING\x10\x00\x12\n\n\x06JOINED\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x10\n\x0c\x44ISCONNECTED\x10\x03\"3\n\nEncryption\"%\n\x04Type\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03GCM\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\"f\n\x12SimulcastCodecInfo\x12\x11\n\tmime_type\x18\x01 \x01(\t\x12\x0b\n\x03mid\x18\x02 \x01(\t\x12\x0b\n\x03\x63id\x18\x03 \x01(\t\x12#\n\x06layers\x18\x04 \x03(\x0b\x32\x13.livekit.VideoLayer\"\x99\x03\n\tTrackInfo\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12 \n\x04type\x18\x02 \x01(\x0e\x32\x12.livekit.TrackType\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05muted\x18\x04 \x01(\x08\x12\r\n\x05width\x18\x05 \x01(\r\x12\x0e\n\x06height\x18\x06 \x01(\r\x12\x11\n\tsimulcast\x18\x07 \x01(\x08\x12\x13\n\x0b\x64isable_dtx\x18\x08 \x01(\x08\x12$\n\x06source\x18\t \x01(\x0e\x32\x14.livekit.TrackSource\x12#\n\x06layers\x18\n \x03(\x0b\x32\x13.livekit.VideoLayer\x12\x11\n\tmime_type\x18\x0b \x01(\t\x12\x0b\n\x03mid\x18\x0c \x01(\t\x12+\n\x06\x63odecs\x18\r \x03(\x0b\x32\x1b.livekit.SimulcastCodecInfo\x12\x0e\n\x06stereo\x18\x0e \x01(\x08\x12\x13\n\x0b\x64isable_red\x18\x0f \x01(\x08\x12,\n\nencryption\x18\x10 \x01(\x0e\x32\x18.livekit.Encryption.Type\x12\x0e\n\x06stream\x18\x11 \x01(\t\"r\n\nVideoLayer\x12&\n\x07quality\x18\x01 \x01(\x0e\x32\x15.livekit.VideoQuality\x12\r\n\x05width\x18\x02 \x01(\r\x12\x0e\n\x06height\x18\x03 \x01(\r\x12\x0f\n\x07\x62itrate\x18\x04 \x01(\r\x12\x0c\n\x04ssrc\x18\x05 \x01(\r\"\xb4\x01\n\nDataPacket\x12&\n\x04kind\x18\x01 \x01(\x0e\x32\x18.livekit.DataPacket.Kind\x12#\n\x04user\x18\x02 \x01(\x0b\x32\x13.livekit.UserPacketH\x00\x12/\n\x07speaker\x18\x03 \x01(\x0b\x32\x1c.livekit.ActiveSpeakerUpdateH\x00\"\x1f\n\x04Kind\x12\x0c\n\x08RELIABLE\x10\x00\x12\t\n\x05LOSSY\x10\x01\x42\x07\n\x05value\"=\n\x13\x41\x63tiveSpeakerUpdate\x12&\n\x08speakers\x18\x01 \x03(\x0b\x32\x14.livekit.SpeakerInfo\"9\n\x0bSpeakerInfo\x12\x0b\n\x03sid\x18\x01 \x01(\t\x12\r\n\x05level\x18\x02 \x01(\x02\x12\x0e\n\x06\x61\x63tive\x18\x03 \x01(\x08\"\xac\x01\n\nUserPacket\x12\x17\n\x0fparticipant_sid\x18\x01 \x01(\t\x12\x1c\n\x14participant_identity\x18\x05 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x12\x18\n\x10\x64\x65stination_sids\x18\x03 \x03(\t\x12\x1e\n\x16\x64\x65stination_identities\x18\x06 \x03(\t\x12\x12\n\x05topic\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_topic\"@\n\x11ParticipantTracks\x12\x17\n\x0fparticipant_sid\x18\x01 \x01(\t\x12\x12\n\ntrack_sids\x18\x02 \x03(\t\"\xb6\x01\n\nServerInfo\x12,\n\x07\x65\x64ition\x18\x01 \x01(\x0e\x32\x1b.livekit.ServerInfo.Edition\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08protocol\x18\x03 \x01(\x05\x12\x0e\n\x06region\x18\x04 \x01(\t\x12\x0f\n\x07node_id\x18\x05 \x01(\t\x12\x12\n\ndebug_info\x18\x06 \x01(\t\"\"\n\x07\x45\x64ition\x12\x0c\n\x08Standard\x10\x00\x12\t\n\x05\x43loud\x10\x01\"\xdd\x02\n\nClientInfo\x12$\n\x03sdk\x18\x01 \x01(\x0e\x32\x17.livekit.ClientInfo.SDK\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x10\n\x08protocol\x18\x03 \x01(\x05\x12\n\n\x02os\x18\x04 \x01(\t\x12\x12\n\nos_version\x18\x05 \x01(\t\x12\x14\n\x0c\x64\x65vice_model\x18\x06 \x01(\t\x12\x0f\n\x07\x62rowser\x18\x07 \x01(\t\x12\x17\n\x0f\x62rowser_version\x18\x08 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\t \x01(\t\x12\x0f\n\x07network\x18\n \x01(\t\"\x83\x01\n\x03SDK\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x06\n\x02JS\x10\x01\x12\t\n\x05SWIFT\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x0b\n\x07\x46LUTTER\x10\x04\x12\x06\n\x02GO\x10\x05\x12\t\n\x05UNITY\x10\x06\x12\x10\n\x0cREACT_NATIVE\x10\x07\x12\x08\n\x04RUST\x10\x08\x12\n\n\x06PYTHON\x10\t\x12\x07\n\x03\x43PP\x10\n\"\x8c\x02\n\x13\x43lientConfiguration\x12*\n\x05video\x18\x01 \x01(\x0b\x32\x1b.livekit.VideoConfiguration\x12+\n\x06screen\x18\x02 \x01(\x0b\x32\x1b.livekit.VideoConfiguration\x12\x37\n\x11resume_connection\x18\x03 \x01(\x0e\x32\x1c.livekit.ClientConfigSetting\x12\x30\n\x0f\x64isabled_codecs\x18\x04 \x01(\x0b\x32\x17.livekit.DisabledCodecs\x12\x31\n\x0b\x66orce_relay\x18\x05 \x01(\x0e\x32\x1c.livekit.ClientConfigSetting\"L\n\x12VideoConfiguration\x12\x36\n\x10hardware_encoder\x18\x01 \x01(\x0e\x32\x1c.livekit.ClientConfigSetting\"Q\n\x0e\x44isabledCodecs\x12\x1e\n\x06\x63odecs\x18\x01 \x03(\x0b\x32\x0e.livekit.Codec\x12\x1f\n\x07publish\x18\x02 \x03(\x0b\x32\x0e.livekit.Codec\"\x80\x02\n\x08RTPDrift\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x64uration\x18\x03 \x01(\x01\x12\x17\n\x0fstart_timestamp\x18\x04 \x01(\x04\x12\x15\n\rend_timestamp\x18\x05 \x01(\x04\x12\x17\n\x0frtp_clock_ticks\x18\x06 \x01(\x04\x12\x15\n\rdrift_samples\x18\x07 \x01(\x03\x12\x10\n\x08\x64rift_ms\x18\x08 \x01(\x01\x12\x12\n\nclock_rate\x18\t \x01(\x01\"\xef\t\n\x08RTPStats\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x10\n\x08\x64uration\x18\x03 \x01(\x01\x12\x0f\n\x07packets\x18\x04 \x01(\r\x12\x13\n\x0bpacket_rate\x18\x05 \x01(\x01\x12\r\n\x05\x62ytes\x18\x06 \x01(\x04\x12\x14\n\x0cheader_bytes\x18\' \x01(\x04\x12\x0f\n\x07\x62itrate\x18\x07 \x01(\x01\x12\x14\n\x0cpackets_lost\x18\x08 \x01(\r\x12\x18\n\x10packet_loss_rate\x18\t \x01(\x01\x12\x1e\n\x16packet_loss_percentage\x18\n \x01(\x02\x12\x19\n\x11packets_duplicate\x18\x0b \x01(\r\x12\x1d\n\x15packet_duplicate_rate\x18\x0c \x01(\x01\x12\x17\n\x0f\x62ytes_duplicate\x18\r \x01(\x04\x12\x1e\n\x16header_bytes_duplicate\x18( \x01(\x04\x12\x19\n\x11\x62itrate_duplicate\x18\x0e \x01(\x01\x12\x17\n\x0fpackets_padding\x18\x0f \x01(\r\x12\x1b\n\x13packet_padding_rate\x18\x10 \x01(\x01\x12\x15\n\rbytes_padding\x18\x11 \x01(\x04\x12\x1c\n\x14header_bytes_padding\x18) \x01(\x04\x12\x17\n\x0f\x62itrate_padding\x18\x12 \x01(\x01\x12\x1c\n\x14packets_out_of_order\x18\x13 \x01(\r\x12\x0e\n\x06\x66rames\x18\x14 \x01(\r\x12\x12\n\nframe_rate\x18\x15 \x01(\x01\x12\x16\n\x0ejitter_current\x18\x16 \x01(\x01\x12\x12\n\njitter_max\x18\x17 \x01(\x01\x12:\n\rgap_histogram\x18\x18 \x03(\x0b\x32#.livekit.RTPStats.GapHistogramEntry\x12\r\n\x05nacks\x18\x19 \x01(\r\x12\x11\n\tnack_acks\x18% \x01(\r\x12\x13\n\x0bnack_misses\x18\x1a \x01(\r\x12\x15\n\rnack_repeated\x18& \x01(\r\x12\x0c\n\x04plis\x18\x1b \x01(\r\x12,\n\x08last_pli\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04\x66irs\x18\x1d \x01(\r\x12,\n\x08last_fir\x18\x1e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0brtt_current\x18\x1f \x01(\r\x12\x0f\n\x07rtt_max\x18 \x01(\r\x12\x12\n\nkey_frames\x18! \x01(\r\x12\x32\n\x0elast_key_frame\x18\" \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0flayer_lock_plis\x18# \x01(\r\x12\x37\n\x13last_layer_lock_pli\x18$ \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x0cpacket_drift\x18, \x01(\x0b\x32\x11.livekit.RTPDrift\x12\'\n\x0creport_drift\x18- \x01(\x0b\x32\x11.livekit.RTPDrift\x1a\x33\n\x11GapHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\x05\x12\r\n\x05value\x18\x02 \x01(\r:\x02\x38\x01\"1\n\x0cTimedVersion\x12\x12\n\nunix_micro\x18\x01 \x01(\x03\x12\r\n\x05ticks\x18\x02 \x01(\x05*/\n\nAudioCodec\x12\x0e\n\nDEFAULT_AC\x10\x00\x12\x08\n\x04OPUS\x10\x01\x12\x07\n\x03\x41\x41\x43\x10\x02*V\n\nVideoCodec\x12\x0e\n\nDEFAULT_VC\x10\x00\x12\x11\n\rH264_BASELINE\x10\x01\x12\r\n\tH264_MAIN\x10\x02\x12\r\n\tH264_HIGH\x10\x03\x12\x07\n\x03VP8\x10\x04*)\n\nImageCodec\x12\x0e\n\nIC_DEFAULT\x10\x00\x12\x0b\n\x07IC_JPEG\x10\x01*+\n\tTrackType\x12\t\n\x05\x41UDIO\x10\x00\x12\t\n\x05VIDEO\x10\x01\x12\x08\n\x04\x44\x41TA\x10\x02*`\n\x0bTrackSource\x12\x0b\n\x07UNKNOWN\x10\x00\x12\n\n\x06\x43\x41MERA\x10\x01\x12\x0e\n\nMICROPHONE\x10\x02\x12\x10\n\x0cSCREEN_SHARE\x10\x03\x12\x16\n\x12SCREEN_SHARE_AUDIO\x10\x04*6\n\x0cVideoQuality\x12\x07\n\x03LOW\x10\x00\x12\n\n\x06MEDIUM\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\x07\n\x03OFF\x10\x03*6\n\x11\x43onnectionQuality\x12\x08\n\x04POOR\x10\x00\x12\x08\n\x04GOOD\x10\x01\x12\r\n\tEXCELLENT\x10\x02*;\n\x13\x43lientConfigSetting\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\x0b\n\x07\x45NABLED\x10\x02*\xba\x01\n\x10\x44isconnectReason\x12\x12\n\x0eUNKNOWN_REASON\x10\x00\x12\x14\n\x10\x43LIENT_INITIATED\x10\x01\x12\x16\n\x12\x44UPLICATE_IDENTITY\x10\x02\x12\x13\n\x0fSERVER_SHUTDOWN\x10\x03\x12\x17\n\x13PARTICIPANT_REMOVED\x10\x04\x12\x10\n\x0cROOM_DELETED\x10\x05\x12\x12\n\x0eSTATE_MISMATCH\x10\x06\x12\x10\n\x0cJOIN_FAILURE\x10\x07*\x89\x01\n\x0fReconnectReason\x12\x0e\n\nRR_UNKNOWN\x10\x00\x12\x1a\n\x16RR_SIGNAL_DISCONNECTED\x10\x01\x12\x17\n\x13RR_PUBLISHER_FAILED\x10\x02\x12\x18\n\x14RR_SUBSCRIBER_FAILED\x10\x03\x12\x17\n\x13RR_SWITCH_CANDIDATE\x10\x04*T\n\x11SubscriptionError\x12\x0e\n\nSE_UNKNOWN\x10\x00\x12\x18\n\x14SE_CODEC_UNSUPPORTED\x10\x01\x12\x15\n\x11SE_TRACK_NOTFOUND\x10\x02\x42\x46Z#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'livekit_models_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto' + _RTPSTATS_GAPHISTOGRAMENTRY._options = None + _RTPSTATS_GAPHISTOGRAMENTRY._serialized_options = b'8\001' + _globals['_AUDIOCODEC']._serialized_start=4774 + _globals['_AUDIOCODEC']._serialized_end=4821 + _globals['_VIDEOCODEC']._serialized_start=4823 + _globals['_VIDEOCODEC']._serialized_end=4909 + _globals['_IMAGECODEC']._serialized_start=4911 + _globals['_IMAGECODEC']._serialized_end=4952 + _globals['_TRACKTYPE']._serialized_start=4954 + _globals['_TRACKTYPE']._serialized_end=4997 + _globals['_TRACKSOURCE']._serialized_start=4999 + _globals['_TRACKSOURCE']._serialized_end=5095 + _globals['_VIDEOQUALITY']._serialized_start=5097 + _globals['_VIDEOQUALITY']._serialized_end=5151 + _globals['_CONNECTIONQUALITY']._serialized_start=5153 + _globals['_CONNECTIONQUALITY']._serialized_end=5207 + _globals['_CLIENTCONFIGSETTING']._serialized_start=5209 + _globals['_CLIENTCONFIGSETTING']._serialized_end=5268 + _globals['_DISCONNECTREASON']._serialized_start=5271 + _globals['_DISCONNECTREASON']._serialized_end=5457 + _globals['_RECONNECTREASON']._serialized_start=5460 + _globals['_RECONNECTREASON']._serialized_end=5597 + _globals['_SUBSCRIPTIONERROR']._serialized_start=5599 + _globals['_SUBSCRIPTIONERROR']._serialized_end=5683 + _globals['_ROOM']._serialized_start=67 + _globals['_ROOM']._serialized_end=329 + _globals['_CODEC']._serialized_start=331 + _globals['_CODEC']._serialized_end=371 + _globals['_PLAYOUTDELAY']._serialized_start=373 + _globals['_PLAYOUTDELAY']._serialized_end=430 + _globals['_PARTICIPANTPERMISSION']._serialized_start=433 + _globals['_PARTICIPANTPERMISSION']._serialized_end=640 + _globals['_PARTICIPANTINFO']._serialized_start=643 + _globals['_PARTICIPANTINFO']._serialized_end=996 + _globals['_PARTICIPANTINFO_STATE']._serialized_start=934 + _globals['_PARTICIPANTINFO_STATE']._serialized_end=996 + _globals['_ENCRYPTION']._serialized_start=998 + _globals['_ENCRYPTION']._serialized_end=1049 + _globals['_ENCRYPTION_TYPE']._serialized_start=1012 + _globals['_ENCRYPTION_TYPE']._serialized_end=1049 + _globals['_SIMULCASTCODECINFO']._serialized_start=1051 + _globals['_SIMULCASTCODECINFO']._serialized_end=1153 + _globals['_TRACKINFO']._serialized_start=1156 + _globals['_TRACKINFO']._serialized_end=1565 + _globals['_VIDEOLAYER']._serialized_start=1567 + _globals['_VIDEOLAYER']._serialized_end=1681 + _globals['_DATAPACKET']._serialized_start=1684 + _globals['_DATAPACKET']._serialized_end=1864 + _globals['_DATAPACKET_KIND']._serialized_start=1824 + _globals['_DATAPACKET_KIND']._serialized_end=1855 + _globals['_ACTIVESPEAKERUPDATE']._serialized_start=1866 + _globals['_ACTIVESPEAKERUPDATE']._serialized_end=1927 + _globals['_SPEAKERINFO']._serialized_start=1929 + _globals['_SPEAKERINFO']._serialized_end=1986 + _globals['_USERPACKET']._serialized_start=1989 + _globals['_USERPACKET']._serialized_end=2161 + _globals['_PARTICIPANTTRACKS']._serialized_start=2163 + _globals['_PARTICIPANTTRACKS']._serialized_end=2227 + _globals['_SERVERINFO']._serialized_start=2230 + _globals['_SERVERINFO']._serialized_end=2412 + _globals['_SERVERINFO_EDITION']._serialized_start=2378 + _globals['_SERVERINFO_EDITION']._serialized_end=2412 + _globals['_CLIENTINFO']._serialized_start=2415 + _globals['_CLIENTINFO']._serialized_end=2764 + _globals['_CLIENTINFO_SDK']._serialized_start=2633 + _globals['_CLIENTINFO_SDK']._serialized_end=2764 + _globals['_CLIENTCONFIGURATION']._serialized_start=2767 + _globals['_CLIENTCONFIGURATION']._serialized_end=3035 + _globals['_VIDEOCONFIGURATION']._serialized_start=3037 + _globals['_VIDEOCONFIGURATION']._serialized_end=3113 + _globals['_DISABLEDCODECS']._serialized_start=3115 + _globals['_DISABLEDCODECS']._serialized_end=3196 + _globals['_RTPDRIFT']._serialized_start=3199 + _globals['_RTPDRIFT']._serialized_end=3455 + _globals['_RTPSTATS']._serialized_start=3458 + _globals['_RTPSTATS']._serialized_end=4721 + _globals['_RTPSTATS_GAPHISTOGRAMENTRY']._serialized_start=4670 + _globals['_RTPSTATS_GAPHISTOGRAMENTRY']._serialized_end=4721 + _globals['_TIMEDVERSION']._serialized_start=4723 + _globals['_TIMEDVERSION']._serialized_end=4772 +# @@protoc_insertion_point(module_scope) diff --git a/livekit-api/livekit/api/_proto/livekit_models_pb2.pyi b/livekit-api/livekit/api/_proto/livekit_models_pb2.pyi new file mode 100644 index 00000000..756f31a1 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_models_pb2.pyi @@ -0,0 +1,1158 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright 2023 LiveKit, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.internal.enum_type_wrapper +import google.protobuf.message +import google.protobuf.timestamp_pb2 +import sys +import typing + +if sys.version_info >= (3, 10): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +class _AudioCodec: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _AudioCodecEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_AudioCodec.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DEFAULT_AC: _AudioCodec.ValueType # 0 + OPUS: _AudioCodec.ValueType # 1 + AAC: _AudioCodec.ValueType # 2 + +class AudioCodec(_AudioCodec, metaclass=_AudioCodecEnumTypeWrapper): ... + +DEFAULT_AC: AudioCodec.ValueType # 0 +OPUS: AudioCodec.ValueType # 1 +AAC: AudioCodec.ValueType # 2 +global___AudioCodec = AudioCodec + +class _VideoCodec: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _VideoCodecEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_VideoCodec.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + DEFAULT_VC: _VideoCodec.ValueType # 0 + H264_BASELINE: _VideoCodec.ValueType # 1 + H264_MAIN: _VideoCodec.ValueType # 2 + H264_HIGH: _VideoCodec.ValueType # 3 + VP8: _VideoCodec.ValueType # 4 + +class VideoCodec(_VideoCodec, metaclass=_VideoCodecEnumTypeWrapper): ... + +DEFAULT_VC: VideoCodec.ValueType # 0 +H264_BASELINE: VideoCodec.ValueType # 1 +H264_MAIN: VideoCodec.ValueType # 2 +H264_HIGH: VideoCodec.ValueType # 3 +VP8: VideoCodec.ValueType # 4 +global___VideoCodec = VideoCodec + +class _ImageCodec: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ImageCodecEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ImageCodec.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + IC_DEFAULT: _ImageCodec.ValueType # 0 + IC_JPEG: _ImageCodec.ValueType # 1 + +class ImageCodec(_ImageCodec, metaclass=_ImageCodecEnumTypeWrapper): ... + +IC_DEFAULT: ImageCodec.ValueType # 0 +IC_JPEG: ImageCodec.ValueType # 1 +global___ImageCodec = ImageCodec + +class _TrackType: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _TrackTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TrackType.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + AUDIO: _TrackType.ValueType # 0 + VIDEO: _TrackType.ValueType # 1 + DATA: _TrackType.ValueType # 2 + +class TrackType(_TrackType, metaclass=_TrackTypeEnumTypeWrapper): ... + +AUDIO: TrackType.ValueType # 0 +VIDEO: TrackType.ValueType # 1 +DATA: TrackType.ValueType # 2 +global___TrackType = TrackType + +class _TrackSource: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _TrackSourceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_TrackSource.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNKNOWN: _TrackSource.ValueType # 0 + CAMERA: _TrackSource.ValueType # 1 + MICROPHONE: _TrackSource.ValueType # 2 + SCREEN_SHARE: _TrackSource.ValueType # 3 + SCREEN_SHARE_AUDIO: _TrackSource.ValueType # 4 + +class TrackSource(_TrackSource, metaclass=_TrackSourceEnumTypeWrapper): ... + +UNKNOWN: TrackSource.ValueType # 0 +CAMERA: TrackSource.ValueType # 1 +MICROPHONE: TrackSource.ValueType # 2 +SCREEN_SHARE: TrackSource.ValueType # 3 +SCREEN_SHARE_AUDIO: TrackSource.ValueType # 4 +global___TrackSource = TrackSource + +class _VideoQuality: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _VideoQualityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_VideoQuality.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + LOW: _VideoQuality.ValueType # 0 + MEDIUM: _VideoQuality.ValueType # 1 + HIGH: _VideoQuality.ValueType # 2 + OFF: _VideoQuality.ValueType # 3 + +class VideoQuality(_VideoQuality, metaclass=_VideoQualityEnumTypeWrapper): ... + +LOW: VideoQuality.ValueType # 0 +MEDIUM: VideoQuality.ValueType # 1 +HIGH: VideoQuality.ValueType # 2 +OFF: VideoQuality.ValueType # 3 +global___VideoQuality = VideoQuality + +class _ConnectionQuality: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ConnectionQualityEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ConnectionQuality.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + POOR: _ConnectionQuality.ValueType # 0 + GOOD: _ConnectionQuality.ValueType # 1 + EXCELLENT: _ConnectionQuality.ValueType # 2 + +class ConnectionQuality(_ConnectionQuality, metaclass=_ConnectionQualityEnumTypeWrapper): ... + +POOR: ConnectionQuality.ValueType # 0 +GOOD: ConnectionQuality.ValueType # 1 +EXCELLENT: ConnectionQuality.ValueType # 2 +global___ConnectionQuality = ConnectionQuality + +class _ClientConfigSetting: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ClientConfigSettingEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ClientConfigSetting.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNSET: _ClientConfigSetting.ValueType # 0 + DISABLED: _ClientConfigSetting.ValueType # 1 + ENABLED: _ClientConfigSetting.ValueType # 2 + +class ClientConfigSetting(_ClientConfigSetting, metaclass=_ClientConfigSettingEnumTypeWrapper): ... + +UNSET: ClientConfigSetting.ValueType # 0 +DISABLED: ClientConfigSetting.ValueType # 1 +ENABLED: ClientConfigSetting.ValueType # 2 +global___ClientConfigSetting = ClientConfigSetting + +class _DisconnectReason: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _DisconnectReasonEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_DisconnectReason.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNKNOWN_REASON: _DisconnectReason.ValueType # 0 + CLIENT_INITIATED: _DisconnectReason.ValueType # 1 + DUPLICATE_IDENTITY: _DisconnectReason.ValueType # 2 + SERVER_SHUTDOWN: _DisconnectReason.ValueType # 3 + PARTICIPANT_REMOVED: _DisconnectReason.ValueType # 4 + ROOM_DELETED: _DisconnectReason.ValueType # 5 + STATE_MISMATCH: _DisconnectReason.ValueType # 6 + JOIN_FAILURE: _DisconnectReason.ValueType # 7 + +class DisconnectReason(_DisconnectReason, metaclass=_DisconnectReasonEnumTypeWrapper): ... + +UNKNOWN_REASON: DisconnectReason.ValueType # 0 +CLIENT_INITIATED: DisconnectReason.ValueType # 1 +DUPLICATE_IDENTITY: DisconnectReason.ValueType # 2 +SERVER_SHUTDOWN: DisconnectReason.ValueType # 3 +PARTICIPANT_REMOVED: DisconnectReason.ValueType # 4 +ROOM_DELETED: DisconnectReason.ValueType # 5 +STATE_MISMATCH: DisconnectReason.ValueType # 6 +JOIN_FAILURE: DisconnectReason.ValueType # 7 +global___DisconnectReason = DisconnectReason + +class _ReconnectReason: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _ReconnectReasonEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_ReconnectReason.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + RR_UNKNOWN: _ReconnectReason.ValueType # 0 + RR_SIGNAL_DISCONNECTED: _ReconnectReason.ValueType # 1 + RR_PUBLISHER_FAILED: _ReconnectReason.ValueType # 2 + RR_SUBSCRIBER_FAILED: _ReconnectReason.ValueType # 3 + RR_SWITCH_CANDIDATE: _ReconnectReason.ValueType # 4 + +class ReconnectReason(_ReconnectReason, metaclass=_ReconnectReasonEnumTypeWrapper): ... + +RR_UNKNOWN: ReconnectReason.ValueType # 0 +RR_SIGNAL_DISCONNECTED: ReconnectReason.ValueType # 1 +RR_PUBLISHER_FAILED: ReconnectReason.ValueType # 2 +RR_SUBSCRIBER_FAILED: ReconnectReason.ValueType # 3 +RR_SWITCH_CANDIDATE: ReconnectReason.ValueType # 4 +global___ReconnectReason = ReconnectReason + +class _SubscriptionError: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + +class _SubscriptionErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_SubscriptionError.ValueType], builtins.type): + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + SE_UNKNOWN: _SubscriptionError.ValueType # 0 + SE_CODEC_UNSUPPORTED: _SubscriptionError.ValueType # 1 + SE_TRACK_NOTFOUND: _SubscriptionError.ValueType # 2 + +class SubscriptionError(_SubscriptionError, metaclass=_SubscriptionErrorEnumTypeWrapper): ... + +SE_UNKNOWN: SubscriptionError.ValueType # 0 +SE_CODEC_UNSUPPORTED: SubscriptionError.ValueType # 1 +SE_TRACK_NOTFOUND: SubscriptionError.ValueType # 2 +global___SubscriptionError = SubscriptionError + +@typing_extensions.final +class Room(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SID_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + EMPTY_TIMEOUT_FIELD_NUMBER: builtins.int + MAX_PARTICIPANTS_FIELD_NUMBER: builtins.int + CREATION_TIME_FIELD_NUMBER: builtins.int + TURN_PASSWORD_FIELD_NUMBER: builtins.int + ENABLED_CODECS_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + NUM_PARTICIPANTS_FIELD_NUMBER: builtins.int + NUM_PUBLISHERS_FIELD_NUMBER: builtins.int + ACTIVE_RECORDING_FIELD_NUMBER: builtins.int + sid: builtins.str + name: builtins.str + empty_timeout: builtins.int + max_participants: builtins.int + creation_time: builtins.int + turn_password: builtins.str + @property + def enabled_codecs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Codec]: ... + metadata: builtins.str + num_participants: builtins.int + num_publishers: builtins.int + active_recording: builtins.bool + def __init__( + self, + *, + sid: builtins.str = ..., + name: builtins.str = ..., + empty_timeout: builtins.int = ..., + max_participants: builtins.int = ..., + creation_time: builtins.int = ..., + turn_password: builtins.str = ..., + enabled_codecs: collections.abc.Iterable[global___Codec] | None = ..., + metadata: builtins.str = ..., + num_participants: builtins.int = ..., + num_publishers: builtins.int = ..., + active_recording: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["active_recording", b"active_recording", "creation_time", b"creation_time", "empty_timeout", b"empty_timeout", "enabled_codecs", b"enabled_codecs", "max_participants", b"max_participants", "metadata", b"metadata", "name", b"name", "num_participants", b"num_participants", "num_publishers", b"num_publishers", "sid", b"sid", "turn_password", b"turn_password"]) -> None: ... + +global___Room = Room + +@typing_extensions.final +class Codec(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MIME_FIELD_NUMBER: builtins.int + FMTP_LINE_FIELD_NUMBER: builtins.int + mime: builtins.str + fmtp_line: builtins.str + def __init__( + self, + *, + mime: builtins.str = ..., + fmtp_line: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["fmtp_line", b"fmtp_line", "mime", b"mime"]) -> None: ... + +global___Codec = Codec + +@typing_extensions.final +class PlayoutDelay(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ENABLED_FIELD_NUMBER: builtins.int + MIN_FIELD_NUMBER: builtins.int + MAX_FIELD_NUMBER: builtins.int + enabled: builtins.bool + min: builtins.int + max: builtins.int + def __init__( + self, + *, + enabled: builtins.bool = ..., + min: builtins.int = ..., + max: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["enabled", b"enabled", "max", b"max", "min", b"min"]) -> None: ... + +global___PlayoutDelay = PlayoutDelay + +@typing_extensions.final +class ParticipantPermission(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CAN_SUBSCRIBE_FIELD_NUMBER: builtins.int + CAN_PUBLISH_FIELD_NUMBER: builtins.int + CAN_PUBLISH_DATA_FIELD_NUMBER: builtins.int + CAN_PUBLISH_SOURCES_FIELD_NUMBER: builtins.int + HIDDEN_FIELD_NUMBER: builtins.int + RECORDER_FIELD_NUMBER: builtins.int + CAN_UPDATE_METADATA_FIELD_NUMBER: builtins.int + can_subscribe: builtins.bool + """allow participant to subscribe to other tracks in the room""" + can_publish: builtins.bool + """allow participant to publish new tracks to room""" + can_publish_data: builtins.bool + """allow participant to publish data""" + @property + def can_publish_sources(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[global___TrackSource.ValueType]: + """sources that are allowed to be published""" + hidden: builtins.bool + """indicates that it's hidden to others""" + recorder: builtins.bool + """indicates it's a recorder instance""" + can_update_metadata: builtins.bool + """indicates that participant can update own metadata""" + def __init__( + self, + *, + can_subscribe: builtins.bool = ..., + can_publish: builtins.bool = ..., + can_publish_data: builtins.bool = ..., + can_publish_sources: collections.abc.Iterable[global___TrackSource.ValueType] | None = ..., + hidden: builtins.bool = ..., + recorder: builtins.bool = ..., + can_update_metadata: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["can_publish", b"can_publish", "can_publish_data", b"can_publish_data", "can_publish_sources", b"can_publish_sources", "can_subscribe", b"can_subscribe", "can_update_metadata", b"can_update_metadata", "hidden", b"hidden", "recorder", b"recorder"]) -> None: ... + +global___ParticipantPermission = ParticipantPermission + +@typing_extensions.final +class ParticipantInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _State: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _StateEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ParticipantInfo._State.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + JOINING: ParticipantInfo._State.ValueType # 0 + """websocket' connected, but not offered yet""" + JOINED: ParticipantInfo._State.ValueType # 1 + """server received client offer""" + ACTIVE: ParticipantInfo._State.ValueType # 2 + """ICE connectivity established""" + DISCONNECTED: ParticipantInfo._State.ValueType # 3 + """WS disconnected""" + + class State(_State, metaclass=_StateEnumTypeWrapper): ... + JOINING: ParticipantInfo.State.ValueType # 0 + """websocket' connected, but not offered yet""" + JOINED: ParticipantInfo.State.ValueType # 1 + """server received client offer""" + ACTIVE: ParticipantInfo.State.ValueType # 2 + """ICE connectivity established""" + DISCONNECTED: ParticipantInfo.State.ValueType # 3 + """WS disconnected""" + + SID_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + STATE_FIELD_NUMBER: builtins.int + TRACKS_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + JOINED_AT_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + PERMISSION_FIELD_NUMBER: builtins.int + REGION_FIELD_NUMBER: builtins.int + IS_PUBLISHER_FIELD_NUMBER: builtins.int + sid: builtins.str + identity: builtins.str + state: global___ParticipantInfo.State.ValueType + @property + def tracks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TrackInfo]: ... + metadata: builtins.str + joined_at: builtins.int + """timestamp when participant joined room, in seconds""" + name: builtins.str + version: builtins.int + @property + def permission(self) -> global___ParticipantPermission: ... + region: builtins.str + is_publisher: builtins.bool + """indicates the participant has an active publisher connection + and can publish to the server + """ + def __init__( + self, + *, + sid: builtins.str = ..., + identity: builtins.str = ..., + state: global___ParticipantInfo.State.ValueType = ..., + tracks: collections.abc.Iterable[global___TrackInfo] | None = ..., + metadata: builtins.str = ..., + joined_at: builtins.int = ..., + name: builtins.str = ..., + version: builtins.int = ..., + permission: global___ParticipantPermission | None = ..., + region: builtins.str = ..., + is_publisher: builtins.bool = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["permission", b"permission"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["identity", b"identity", "is_publisher", b"is_publisher", "joined_at", b"joined_at", "metadata", b"metadata", "name", b"name", "permission", b"permission", "region", b"region", "sid", b"sid", "state", b"state", "tracks", b"tracks", "version", b"version"]) -> None: ... + +global___ParticipantInfo = ParticipantInfo + +@typing_extensions.final +class Encryption(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Type: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Encryption._Type.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + NONE: Encryption._Type.ValueType # 0 + GCM: Encryption._Type.ValueType # 1 + CUSTOM: Encryption._Type.ValueType # 2 + + class Type(_Type, metaclass=_TypeEnumTypeWrapper): ... + NONE: Encryption.Type.ValueType # 0 + GCM: Encryption.Type.ValueType # 1 + CUSTOM: Encryption.Type.ValueType # 2 + + def __init__( + self, + ) -> None: ... + +global___Encryption = Encryption + +@typing_extensions.final +class SimulcastCodecInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + MIME_TYPE_FIELD_NUMBER: builtins.int + MID_FIELD_NUMBER: builtins.int + CID_FIELD_NUMBER: builtins.int + LAYERS_FIELD_NUMBER: builtins.int + mime_type: builtins.str + mid: builtins.str + cid: builtins.str + @property + def layers(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___VideoLayer]: ... + def __init__( + self, + *, + mime_type: builtins.str = ..., + mid: builtins.str = ..., + cid: builtins.str = ..., + layers: collections.abc.Iterable[global___VideoLayer] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["cid", b"cid", "layers", b"layers", "mid", b"mid", "mime_type", b"mime_type"]) -> None: ... + +global___SimulcastCodecInfo = SimulcastCodecInfo + +@typing_extensions.final +class TrackInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SID_FIELD_NUMBER: builtins.int + TYPE_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + MUTED_FIELD_NUMBER: builtins.int + WIDTH_FIELD_NUMBER: builtins.int + HEIGHT_FIELD_NUMBER: builtins.int + SIMULCAST_FIELD_NUMBER: builtins.int + DISABLE_DTX_FIELD_NUMBER: builtins.int + SOURCE_FIELD_NUMBER: builtins.int + LAYERS_FIELD_NUMBER: builtins.int + MIME_TYPE_FIELD_NUMBER: builtins.int + MID_FIELD_NUMBER: builtins.int + CODECS_FIELD_NUMBER: builtins.int + STEREO_FIELD_NUMBER: builtins.int + DISABLE_RED_FIELD_NUMBER: builtins.int + ENCRYPTION_FIELD_NUMBER: builtins.int + STREAM_FIELD_NUMBER: builtins.int + sid: builtins.str + type: global___TrackType.ValueType + name: builtins.str + muted: builtins.bool + width: builtins.int + """original width of video (unset for audio) + clients may receive a lower resolution version with simulcast + """ + height: builtins.int + """original height of video (unset for audio)""" + simulcast: builtins.bool + """true if track is simulcasted""" + disable_dtx: builtins.bool + """true if DTX (Discontinuous Transmission) is disabled for audio""" + source: global___TrackSource.ValueType + """source of media""" + @property + def layers(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___VideoLayer]: ... + mime_type: builtins.str + """mime type of codec""" + mid: builtins.str + @property + def codecs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SimulcastCodecInfo]: ... + stereo: builtins.bool + disable_red: builtins.bool + """true if RED (Redundant Encoding) is disabled for audio""" + encryption: global___Encryption.Type.ValueType + stream: builtins.str + def __init__( + self, + *, + sid: builtins.str = ..., + type: global___TrackType.ValueType = ..., + name: builtins.str = ..., + muted: builtins.bool = ..., + width: builtins.int = ..., + height: builtins.int = ..., + simulcast: builtins.bool = ..., + disable_dtx: builtins.bool = ..., + source: global___TrackSource.ValueType = ..., + layers: collections.abc.Iterable[global___VideoLayer] | None = ..., + mime_type: builtins.str = ..., + mid: builtins.str = ..., + codecs: collections.abc.Iterable[global___SimulcastCodecInfo] | None = ..., + stereo: builtins.bool = ..., + disable_red: builtins.bool = ..., + encryption: global___Encryption.Type.ValueType = ..., + stream: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["codecs", b"codecs", "disable_dtx", b"disable_dtx", "disable_red", b"disable_red", "encryption", b"encryption", "height", b"height", "layers", b"layers", "mid", b"mid", "mime_type", b"mime_type", "muted", b"muted", "name", b"name", "sid", b"sid", "simulcast", b"simulcast", "source", b"source", "stereo", b"stereo", "stream", b"stream", "type", b"type", "width", b"width"]) -> None: ... + +global___TrackInfo = TrackInfo + +@typing_extensions.final +class VideoLayer(google.protobuf.message.Message): + """provide information about available spatial layers""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + QUALITY_FIELD_NUMBER: builtins.int + WIDTH_FIELD_NUMBER: builtins.int + HEIGHT_FIELD_NUMBER: builtins.int + BITRATE_FIELD_NUMBER: builtins.int + SSRC_FIELD_NUMBER: builtins.int + quality: global___VideoQuality.ValueType + """for tracks with a single layer, this should be HIGH""" + width: builtins.int + height: builtins.int + bitrate: builtins.int + """target bitrate in bit per second (bps), server will measure actual""" + ssrc: builtins.int + def __init__( + self, + *, + quality: global___VideoQuality.ValueType = ..., + width: builtins.int = ..., + height: builtins.int = ..., + bitrate: builtins.int = ..., + ssrc: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["bitrate", b"bitrate", "height", b"height", "quality", b"quality", "ssrc", b"ssrc", "width", b"width"]) -> None: ... + +global___VideoLayer = VideoLayer + +@typing_extensions.final +class DataPacket(google.protobuf.message.Message): + """new DataPacket API""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Kind: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _KindEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DataPacket._Kind.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + RELIABLE: DataPacket._Kind.ValueType # 0 + LOSSY: DataPacket._Kind.ValueType # 1 + + class Kind(_Kind, metaclass=_KindEnumTypeWrapper): ... + RELIABLE: DataPacket.Kind.ValueType # 0 + LOSSY: DataPacket.Kind.ValueType # 1 + + KIND_FIELD_NUMBER: builtins.int + USER_FIELD_NUMBER: builtins.int + SPEAKER_FIELD_NUMBER: builtins.int + kind: global___DataPacket.Kind.ValueType + @property + def user(self) -> global___UserPacket: ... + @property + def speaker(self) -> global___ActiveSpeakerUpdate: ... + def __init__( + self, + *, + kind: global___DataPacket.Kind.ValueType = ..., + user: global___UserPacket | None = ..., + speaker: global___ActiveSpeakerUpdate | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["speaker", b"speaker", "user", b"user", "value", b"value"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["kind", b"kind", "speaker", b"speaker", "user", b"user", "value", b"value"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["value", b"value"]) -> typing_extensions.Literal["user", "speaker"] | None: ... + +global___DataPacket = DataPacket + +@typing_extensions.final +class ActiveSpeakerUpdate(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SPEAKERS_FIELD_NUMBER: builtins.int + @property + def speakers(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___SpeakerInfo]: ... + def __init__( + self, + *, + speakers: collections.abc.Iterable[global___SpeakerInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["speakers", b"speakers"]) -> None: ... + +global___ActiveSpeakerUpdate = ActiveSpeakerUpdate + +@typing_extensions.final +class SpeakerInfo(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + SID_FIELD_NUMBER: builtins.int + LEVEL_FIELD_NUMBER: builtins.int + ACTIVE_FIELD_NUMBER: builtins.int + sid: builtins.str + level: builtins.float + """audio level, 0-1.0, 1 is loudest""" + active: builtins.bool + """true if speaker is currently active""" + def __init__( + self, + *, + sid: builtins.str = ..., + level: builtins.float = ..., + active: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["active", b"active", "level", b"level", "sid", b"sid"]) -> None: ... + +global___SpeakerInfo = SpeakerInfo + +@typing_extensions.final +class UserPacket(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANT_SID_FIELD_NUMBER: builtins.int + PARTICIPANT_IDENTITY_FIELD_NUMBER: builtins.int + PAYLOAD_FIELD_NUMBER: builtins.int + DESTINATION_SIDS_FIELD_NUMBER: builtins.int + DESTINATION_IDENTITIES_FIELD_NUMBER: builtins.int + TOPIC_FIELD_NUMBER: builtins.int + participant_sid: builtins.str + """participant ID of user that sent the message""" + participant_identity: builtins.str + payload: builtins.bytes + """user defined payload""" + @property + def destination_sids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """the ID of the participants who will receive the message (sent to all by default)""" + @property + def destination_identities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """identities of participants who will receive the message (sent to all by default)""" + topic: builtins.str + """topic under which the message was published""" + def __init__( + self, + *, + participant_sid: builtins.str = ..., + participant_identity: builtins.str = ..., + payload: builtins.bytes = ..., + destination_sids: collections.abc.Iterable[builtins.str] | None = ..., + destination_identities: collections.abc.Iterable[builtins.str] | None = ..., + topic: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_topic", b"_topic", "topic", b"topic"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_topic", b"_topic", "destination_identities", b"destination_identities", "destination_sids", b"destination_sids", "participant_identity", b"participant_identity", "participant_sid", b"participant_sid", "payload", b"payload", "topic", b"topic"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["_topic", b"_topic"]) -> typing_extensions.Literal["topic"] | None: ... + +global___UserPacket = UserPacket + +@typing_extensions.final +class ParticipantTracks(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANT_SID_FIELD_NUMBER: builtins.int + TRACK_SIDS_FIELD_NUMBER: builtins.int + participant_sid: builtins.str + """participant ID of participant to whom the tracks belong""" + @property + def track_sids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ... + def __init__( + self, + *, + participant_sid: builtins.str = ..., + track_sids: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["participant_sid", b"participant_sid", "track_sids", b"track_sids"]) -> None: ... + +global___ParticipantTracks = ParticipantTracks + +@typing_extensions.final +class ServerInfo(google.protobuf.message.Message): + """details about the server""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _Edition: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _EditionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ServerInfo._Edition.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + Standard: ServerInfo._Edition.ValueType # 0 + Cloud: ServerInfo._Edition.ValueType # 1 + + class Edition(_Edition, metaclass=_EditionEnumTypeWrapper): ... + Standard: ServerInfo.Edition.ValueType # 0 + Cloud: ServerInfo.Edition.ValueType # 1 + + EDITION_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + PROTOCOL_FIELD_NUMBER: builtins.int + REGION_FIELD_NUMBER: builtins.int + NODE_ID_FIELD_NUMBER: builtins.int + DEBUG_INFO_FIELD_NUMBER: builtins.int + edition: global___ServerInfo.Edition.ValueType + version: builtins.str + protocol: builtins.int + region: builtins.str + node_id: builtins.str + debug_info: builtins.str + """additional debugging information. sent only if server is in development mode""" + def __init__( + self, + *, + edition: global___ServerInfo.Edition.ValueType = ..., + version: builtins.str = ..., + protocol: builtins.int = ..., + region: builtins.str = ..., + node_id: builtins.str = ..., + debug_info: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["debug_info", b"debug_info", "edition", b"edition", "node_id", b"node_id", "protocol", b"protocol", "region", b"region", "version", b"version"]) -> None: ... + +global___ServerInfo = ServerInfo + +@typing_extensions.final +class ClientInfo(google.protobuf.message.Message): + """details about the client""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + class _SDK: + ValueType = typing.NewType("ValueType", builtins.int) + V: typing_extensions.TypeAlias = ValueType + + class _SDKEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ClientInfo._SDK.ValueType], builtins.type): # noqa: F821 + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor + UNKNOWN: ClientInfo._SDK.ValueType # 0 + JS: ClientInfo._SDK.ValueType # 1 + SWIFT: ClientInfo._SDK.ValueType # 2 + ANDROID: ClientInfo._SDK.ValueType # 3 + FLUTTER: ClientInfo._SDK.ValueType # 4 + GO: ClientInfo._SDK.ValueType # 5 + UNITY: ClientInfo._SDK.ValueType # 6 + REACT_NATIVE: ClientInfo._SDK.ValueType # 7 + RUST: ClientInfo._SDK.ValueType # 8 + PYTHON: ClientInfo._SDK.ValueType # 9 + CPP: ClientInfo._SDK.ValueType # 10 + + class SDK(_SDK, metaclass=_SDKEnumTypeWrapper): ... + UNKNOWN: ClientInfo.SDK.ValueType # 0 + JS: ClientInfo.SDK.ValueType # 1 + SWIFT: ClientInfo.SDK.ValueType # 2 + ANDROID: ClientInfo.SDK.ValueType # 3 + FLUTTER: ClientInfo.SDK.ValueType # 4 + GO: ClientInfo.SDK.ValueType # 5 + UNITY: ClientInfo.SDK.ValueType # 6 + REACT_NATIVE: ClientInfo.SDK.ValueType # 7 + RUST: ClientInfo.SDK.ValueType # 8 + PYTHON: ClientInfo.SDK.ValueType # 9 + CPP: ClientInfo.SDK.ValueType # 10 + + SDK_FIELD_NUMBER: builtins.int + VERSION_FIELD_NUMBER: builtins.int + PROTOCOL_FIELD_NUMBER: builtins.int + OS_FIELD_NUMBER: builtins.int + OS_VERSION_FIELD_NUMBER: builtins.int + DEVICE_MODEL_FIELD_NUMBER: builtins.int + BROWSER_FIELD_NUMBER: builtins.int + BROWSER_VERSION_FIELD_NUMBER: builtins.int + ADDRESS_FIELD_NUMBER: builtins.int + NETWORK_FIELD_NUMBER: builtins.int + sdk: global___ClientInfo.SDK.ValueType + version: builtins.str + protocol: builtins.int + os: builtins.str + os_version: builtins.str + device_model: builtins.str + browser: builtins.str + browser_version: builtins.str + address: builtins.str + network: builtins.str + """wifi, wired, cellular, vpn, empty if not known""" + def __init__( + self, + *, + sdk: global___ClientInfo.SDK.ValueType = ..., + version: builtins.str = ..., + protocol: builtins.int = ..., + os: builtins.str = ..., + os_version: builtins.str = ..., + device_model: builtins.str = ..., + browser: builtins.str = ..., + browser_version: builtins.str = ..., + address: builtins.str = ..., + network: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["address", b"address", "browser", b"browser", "browser_version", b"browser_version", "device_model", b"device_model", "network", b"network", "os", b"os", "os_version", b"os_version", "protocol", b"protocol", "sdk", b"sdk", "version", b"version"]) -> None: ... + +global___ClientInfo = ClientInfo + +@typing_extensions.final +class ClientConfiguration(google.protobuf.message.Message): + """server provided client configuration""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + VIDEO_FIELD_NUMBER: builtins.int + SCREEN_FIELD_NUMBER: builtins.int + RESUME_CONNECTION_FIELD_NUMBER: builtins.int + DISABLED_CODECS_FIELD_NUMBER: builtins.int + FORCE_RELAY_FIELD_NUMBER: builtins.int + @property + def video(self) -> global___VideoConfiguration: ... + @property + def screen(self) -> global___VideoConfiguration: ... + resume_connection: global___ClientConfigSetting.ValueType + @property + def disabled_codecs(self) -> global___DisabledCodecs: ... + force_relay: global___ClientConfigSetting.ValueType + def __init__( + self, + *, + video: global___VideoConfiguration | None = ..., + screen: global___VideoConfiguration | None = ..., + resume_connection: global___ClientConfigSetting.ValueType = ..., + disabled_codecs: global___DisabledCodecs | None = ..., + force_relay: global___ClientConfigSetting.ValueType = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["disabled_codecs", b"disabled_codecs", "screen", b"screen", "video", b"video"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["disabled_codecs", b"disabled_codecs", "force_relay", b"force_relay", "resume_connection", b"resume_connection", "screen", b"screen", "video", b"video"]) -> None: ... + +global___ClientConfiguration = ClientConfiguration + +@typing_extensions.final +class VideoConfiguration(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + HARDWARE_ENCODER_FIELD_NUMBER: builtins.int + hardware_encoder: global___ClientConfigSetting.ValueType + def __init__( + self, + *, + hardware_encoder: global___ClientConfigSetting.ValueType = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["hardware_encoder", b"hardware_encoder"]) -> None: ... + +global___VideoConfiguration = VideoConfiguration + +@typing_extensions.final +class DisabledCodecs(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + CODECS_FIELD_NUMBER: builtins.int + PUBLISH_FIELD_NUMBER: builtins.int + @property + def codecs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Codec]: + """disabled for both publish and subscribe""" + @property + def publish(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___Codec]: + """only disable for publish""" + def __init__( + self, + *, + codecs: collections.abc.Iterable[global___Codec] | None = ..., + publish: collections.abc.Iterable[global___Codec] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["codecs", b"codecs", "publish", b"publish"]) -> None: ... + +global___DisabledCodecs = DisabledCodecs + +@typing_extensions.final +class RTPDrift(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + START_TIME_FIELD_NUMBER: builtins.int + END_TIME_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + START_TIMESTAMP_FIELD_NUMBER: builtins.int + END_TIMESTAMP_FIELD_NUMBER: builtins.int + RTP_CLOCK_TICKS_FIELD_NUMBER: builtins.int + DRIFT_SAMPLES_FIELD_NUMBER: builtins.int + DRIFT_MS_FIELD_NUMBER: builtins.int + CLOCK_RATE_FIELD_NUMBER: builtins.int + @property + def start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + @property + def end_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + duration: builtins.float + start_timestamp: builtins.int + end_timestamp: builtins.int + rtp_clock_ticks: builtins.int + drift_samples: builtins.int + drift_ms: builtins.float + clock_rate: builtins.float + def __init__( + self, + *, + start_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + end_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + duration: builtins.float = ..., + start_timestamp: builtins.int = ..., + end_timestamp: builtins.int = ..., + rtp_clock_ticks: builtins.int = ..., + drift_samples: builtins.int = ..., + drift_ms: builtins.float = ..., + clock_rate: builtins.float = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end_time", b"end_time", "start_time", b"start_time"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["clock_rate", b"clock_rate", "drift_ms", b"drift_ms", "drift_samples", b"drift_samples", "duration", b"duration", "end_time", b"end_time", "end_timestamp", b"end_timestamp", "rtp_clock_ticks", b"rtp_clock_ticks", "start_time", b"start_time", "start_timestamp", b"start_timestamp"]) -> None: ... + +global___RTPDrift = RTPDrift + +@typing_extensions.final +class RTPStats(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + @typing_extensions.final + class GapHistogramEntry(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + KEY_FIELD_NUMBER: builtins.int + VALUE_FIELD_NUMBER: builtins.int + key: builtins.int + value: builtins.int + def __init__( + self, + *, + key: builtins.int = ..., + value: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["key", b"key", "value", b"value"]) -> None: ... + + START_TIME_FIELD_NUMBER: builtins.int + END_TIME_FIELD_NUMBER: builtins.int + DURATION_FIELD_NUMBER: builtins.int + PACKETS_FIELD_NUMBER: builtins.int + PACKET_RATE_FIELD_NUMBER: builtins.int + BYTES_FIELD_NUMBER: builtins.int + HEADER_BYTES_FIELD_NUMBER: builtins.int + BITRATE_FIELD_NUMBER: builtins.int + PACKETS_LOST_FIELD_NUMBER: builtins.int + PACKET_LOSS_RATE_FIELD_NUMBER: builtins.int + PACKET_LOSS_PERCENTAGE_FIELD_NUMBER: builtins.int + PACKETS_DUPLICATE_FIELD_NUMBER: builtins.int + PACKET_DUPLICATE_RATE_FIELD_NUMBER: builtins.int + BYTES_DUPLICATE_FIELD_NUMBER: builtins.int + HEADER_BYTES_DUPLICATE_FIELD_NUMBER: builtins.int + BITRATE_DUPLICATE_FIELD_NUMBER: builtins.int + PACKETS_PADDING_FIELD_NUMBER: builtins.int + PACKET_PADDING_RATE_FIELD_NUMBER: builtins.int + BYTES_PADDING_FIELD_NUMBER: builtins.int + HEADER_BYTES_PADDING_FIELD_NUMBER: builtins.int + BITRATE_PADDING_FIELD_NUMBER: builtins.int + PACKETS_OUT_OF_ORDER_FIELD_NUMBER: builtins.int + FRAMES_FIELD_NUMBER: builtins.int + FRAME_RATE_FIELD_NUMBER: builtins.int + JITTER_CURRENT_FIELD_NUMBER: builtins.int + JITTER_MAX_FIELD_NUMBER: builtins.int + GAP_HISTOGRAM_FIELD_NUMBER: builtins.int + NACKS_FIELD_NUMBER: builtins.int + NACK_ACKS_FIELD_NUMBER: builtins.int + NACK_MISSES_FIELD_NUMBER: builtins.int + NACK_REPEATED_FIELD_NUMBER: builtins.int + PLIS_FIELD_NUMBER: builtins.int + LAST_PLI_FIELD_NUMBER: builtins.int + FIRS_FIELD_NUMBER: builtins.int + LAST_FIR_FIELD_NUMBER: builtins.int + RTT_CURRENT_FIELD_NUMBER: builtins.int + RTT_MAX_FIELD_NUMBER: builtins.int + KEY_FRAMES_FIELD_NUMBER: builtins.int + LAST_KEY_FRAME_FIELD_NUMBER: builtins.int + LAYER_LOCK_PLIS_FIELD_NUMBER: builtins.int + LAST_LAYER_LOCK_PLI_FIELD_NUMBER: builtins.int + PACKET_DRIFT_FIELD_NUMBER: builtins.int + REPORT_DRIFT_FIELD_NUMBER: builtins.int + @property + def start_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + @property + def end_time(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + duration: builtins.float + packets: builtins.int + packet_rate: builtins.float + bytes: builtins.int + header_bytes: builtins.int + bitrate: builtins.float + packets_lost: builtins.int + packet_loss_rate: builtins.float + packet_loss_percentage: builtins.float + packets_duplicate: builtins.int + packet_duplicate_rate: builtins.float + bytes_duplicate: builtins.int + header_bytes_duplicate: builtins.int + bitrate_duplicate: builtins.float + packets_padding: builtins.int + packet_padding_rate: builtins.float + bytes_padding: builtins.int + header_bytes_padding: builtins.int + bitrate_padding: builtins.float + packets_out_of_order: builtins.int + frames: builtins.int + frame_rate: builtins.float + jitter_current: builtins.float + jitter_max: builtins.float + @property + def gap_histogram(self) -> google.protobuf.internal.containers.ScalarMap[builtins.int, builtins.int]: ... + nacks: builtins.int + nack_acks: builtins.int + nack_misses: builtins.int + nack_repeated: builtins.int + plis: builtins.int + @property + def last_pli(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + firs: builtins.int + @property + def last_fir(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + rtt_current: builtins.int + rtt_max: builtins.int + key_frames: builtins.int + @property + def last_key_frame(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + layer_lock_plis: builtins.int + @property + def last_layer_lock_pli(self) -> google.protobuf.timestamp_pb2.Timestamp: ... + @property + def packet_drift(self) -> global___RTPDrift: ... + @property + def report_drift(self) -> global___RTPDrift: + """NEXT_ID: 46""" + def __init__( + self, + *, + start_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + end_time: google.protobuf.timestamp_pb2.Timestamp | None = ..., + duration: builtins.float = ..., + packets: builtins.int = ..., + packet_rate: builtins.float = ..., + bytes: builtins.int = ..., + header_bytes: builtins.int = ..., + bitrate: builtins.float = ..., + packets_lost: builtins.int = ..., + packet_loss_rate: builtins.float = ..., + packet_loss_percentage: builtins.float = ..., + packets_duplicate: builtins.int = ..., + packet_duplicate_rate: builtins.float = ..., + bytes_duplicate: builtins.int = ..., + header_bytes_duplicate: builtins.int = ..., + bitrate_duplicate: builtins.float = ..., + packets_padding: builtins.int = ..., + packet_padding_rate: builtins.float = ..., + bytes_padding: builtins.int = ..., + header_bytes_padding: builtins.int = ..., + bitrate_padding: builtins.float = ..., + packets_out_of_order: builtins.int = ..., + frames: builtins.int = ..., + frame_rate: builtins.float = ..., + jitter_current: builtins.float = ..., + jitter_max: builtins.float = ..., + gap_histogram: collections.abc.Mapping[builtins.int, builtins.int] | None = ..., + nacks: builtins.int = ..., + nack_acks: builtins.int = ..., + nack_misses: builtins.int = ..., + nack_repeated: builtins.int = ..., + plis: builtins.int = ..., + last_pli: google.protobuf.timestamp_pb2.Timestamp | None = ..., + firs: builtins.int = ..., + last_fir: google.protobuf.timestamp_pb2.Timestamp | None = ..., + rtt_current: builtins.int = ..., + rtt_max: builtins.int = ..., + key_frames: builtins.int = ..., + last_key_frame: google.protobuf.timestamp_pb2.Timestamp | None = ..., + layer_lock_plis: builtins.int = ..., + last_layer_lock_pli: google.protobuf.timestamp_pb2.Timestamp | None = ..., + packet_drift: global___RTPDrift | None = ..., + report_drift: global___RTPDrift | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["end_time", b"end_time", "last_fir", b"last_fir", "last_key_frame", b"last_key_frame", "last_layer_lock_pli", b"last_layer_lock_pli", "last_pli", b"last_pli", "packet_drift", b"packet_drift", "report_drift", b"report_drift", "start_time", b"start_time"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["bitrate", b"bitrate", "bitrate_duplicate", b"bitrate_duplicate", "bitrate_padding", b"bitrate_padding", "bytes", b"bytes", "bytes_duplicate", b"bytes_duplicate", "bytes_padding", b"bytes_padding", "duration", b"duration", "end_time", b"end_time", "firs", b"firs", "frame_rate", b"frame_rate", "frames", b"frames", "gap_histogram", b"gap_histogram", "header_bytes", b"header_bytes", "header_bytes_duplicate", b"header_bytes_duplicate", "header_bytes_padding", b"header_bytes_padding", "jitter_current", b"jitter_current", "jitter_max", b"jitter_max", "key_frames", b"key_frames", "last_fir", b"last_fir", "last_key_frame", b"last_key_frame", "last_layer_lock_pli", b"last_layer_lock_pli", "last_pli", b"last_pli", "layer_lock_plis", b"layer_lock_plis", "nack_acks", b"nack_acks", "nack_misses", b"nack_misses", "nack_repeated", b"nack_repeated", "nacks", b"nacks", "packet_drift", b"packet_drift", "packet_duplicate_rate", b"packet_duplicate_rate", "packet_loss_percentage", b"packet_loss_percentage", "packet_loss_rate", b"packet_loss_rate", "packet_padding_rate", b"packet_padding_rate", "packet_rate", b"packet_rate", "packets", b"packets", "packets_duplicate", b"packets_duplicate", "packets_lost", b"packets_lost", "packets_out_of_order", b"packets_out_of_order", "packets_padding", b"packets_padding", "plis", b"plis", "report_drift", b"report_drift", "rtt_current", b"rtt_current", "rtt_max", b"rtt_max", "start_time", b"start_time"]) -> None: ... + +global___RTPStats = RTPStats + +@typing_extensions.final +class TimedVersion(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + UNIX_MICRO_FIELD_NUMBER: builtins.int + TICKS_FIELD_NUMBER: builtins.int + unix_micro: builtins.int + ticks: builtins.int + def __init__( + self, + *, + unix_micro: builtins.int = ..., + ticks: builtins.int = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["ticks", b"ticks", "unix_micro", b"unix_micro"]) -> None: ... + +global___TimedVersion = TimedVersion diff --git a/livekit-api/livekit/api/_proto/livekit_room_pb2.py b/livekit-api/livekit/api/_proto/livekit_room_pb2.py new file mode 100644 index 00000000..f47fa6a9 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_room_pb2.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: livekit_room.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import livekit_models_pb2 as livekit__models__pb2 +from . import livekit_egress_pb2 as livekit__egress__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12livekit_room.proto\x12\x07livekit\x1a\x14livekit_models.proto\x1a\x14livekit_egress.proto\"\xe6\x01\n\x11\x43reateRoomRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rempty_timeout\x18\x02 \x01(\r\x12\x18\n\x10max_participants\x18\x03 \x01(\r\x12\x0f\n\x07node_id\x18\x04 \x01(\t\x12\x10\n\x08metadata\x18\x05 \x01(\t\x12#\n\x06\x65gress\x18\x06 \x01(\x0b\x32\x13.livekit.RoomEgress\x12\x19\n\x11min_playout_delay\x18\x07 \x01(\r\x12\x19\n\x11max_playout_delay\x18\x08 \x01(\r\x12\x14\n\x0csync_streams\x18\t \x01(\x08\"\x9e\x01\n\nRoomEgress\x12\x31\n\x04room\x18\x01 \x01(\x0b\x32#.livekit.RoomCompositeEgressRequest\x12\x33\n\x0bparticipant\x18\x03 \x01(\x0b\x32\x1e.livekit.AutoParticipantEgress\x12(\n\x06tracks\x18\x02 \x01(\x0b\x32\x18.livekit.AutoTrackEgress\"!\n\x10ListRoomsRequest\x12\r\n\x05names\x18\x01 \x03(\t\"1\n\x11ListRoomsResponse\x12\x1c\n\x05rooms\x18\x01 \x03(\x0b\x32\r.livekit.Room\"!\n\x11\x44\x65leteRoomRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\"\x14\n\x12\x44\x65leteRoomResponse\"\'\n\x17ListParticipantsRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\"J\n\x18ListParticipantsResponse\x12.\n\x0cparticipants\x18\x01 \x03(\x0b\x32\x18.livekit.ParticipantInfo\"9\n\x17RoomParticipantIdentity\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\"\x1b\n\x19RemoveParticipantResponse\"X\n\x14MuteRoomTrackRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x11\n\ttrack_sid\x18\x03 \x01(\t\x12\r\n\x05muted\x18\x04 \x01(\x08\":\n\x15MuteRoomTrackResponse\x12!\n\x05track\x18\x01 \x01(\x0b\x32\x12.livekit.TrackInfo\"\x8e\x01\n\x18UpdateParticipantRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x10\n\x08metadata\x18\x03 \x01(\t\x12\x32\n\npermission\x18\x04 \x01(\x0b\x32\x1e.livekit.ParticipantPermission\x12\x0c\n\x04name\x18\x05 \x01(\t\"\x9b\x01\n\x1aUpdateSubscriptionsRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x10\n\x08identity\x18\x02 \x01(\t\x12\x12\n\ntrack_sids\x18\x03 \x03(\t\x12\x11\n\tsubscribe\x18\x04 \x01(\x08\x12\x36\n\x12participant_tracks\x18\x05 \x03(\x0b\x32\x1a.livekit.ParticipantTracks\"\x1d\n\x1bUpdateSubscriptionsResponse\"\xb1\x01\n\x0fSendDataRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\x12&\n\x04kind\x18\x03 \x01(\x0e\x32\x18.livekit.DataPacket.Kind\x12\x1c\n\x10\x64\x65stination_sids\x18\x04 \x03(\tB\x02\x18\x01\x12\x1e\n\x16\x64\x65stination_identities\x18\x06 \x03(\t\x12\x12\n\x05topic\x18\x05 \x01(\tH\x00\x88\x01\x01\x42\x08\n\x06_topic\"\x12\n\x10SendDataResponse\";\n\x19UpdateRoomMetadataRequest\x12\x0c\n\x04room\x18\x01 \x01(\t\x12\x10\n\x08metadata\x18\x02 \x01(\t2\xe6\x06\n\x0bRoomService\x12\x37\n\nCreateRoom\x12\x1a.livekit.CreateRoomRequest\x1a\r.livekit.Room\x12\x42\n\tListRooms\x12\x19.livekit.ListRoomsRequest\x1a\x1a.livekit.ListRoomsResponse\x12\x45\n\nDeleteRoom\x12\x1a.livekit.DeleteRoomRequest\x1a\x1b.livekit.DeleteRoomResponse\x12W\n\x10ListParticipants\x12 .livekit.ListParticipantsRequest\x1a!.livekit.ListParticipantsResponse\x12L\n\x0eGetParticipant\x12 .livekit.RoomParticipantIdentity\x1a\x18.livekit.ParticipantInfo\x12Y\n\x11RemoveParticipant\x12 .livekit.RoomParticipantIdentity\x1a\".livekit.RemoveParticipantResponse\x12S\n\x12MutePublishedTrack\x12\x1d.livekit.MuteRoomTrackRequest\x1a\x1e.livekit.MuteRoomTrackResponse\x12P\n\x11UpdateParticipant\x12!.livekit.UpdateParticipantRequest\x1a\x18.livekit.ParticipantInfo\x12`\n\x13UpdateSubscriptions\x12#.livekit.UpdateSubscriptionsRequest\x1a$.livekit.UpdateSubscriptionsResponse\x12?\n\x08SendData\x12\x18.livekit.SendDataRequest\x1a\x19.livekit.SendDataResponse\x12G\n\x12UpdateRoomMetadata\x12\".livekit.UpdateRoomMetadataRequest\x1a\r.livekit.RoomBFZ#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'livekit_room_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto' + _SENDDATAREQUEST.fields_by_name['destination_sids']._options = None + _SENDDATAREQUEST.fields_by_name['destination_sids']._serialized_options = b'\030\001' + _globals['_CREATEROOMREQUEST']._serialized_start=76 + _globals['_CREATEROOMREQUEST']._serialized_end=306 + _globals['_ROOMEGRESS']._serialized_start=309 + _globals['_ROOMEGRESS']._serialized_end=467 + _globals['_LISTROOMSREQUEST']._serialized_start=469 + _globals['_LISTROOMSREQUEST']._serialized_end=502 + _globals['_LISTROOMSRESPONSE']._serialized_start=504 + _globals['_LISTROOMSRESPONSE']._serialized_end=553 + _globals['_DELETEROOMREQUEST']._serialized_start=555 + _globals['_DELETEROOMREQUEST']._serialized_end=588 + _globals['_DELETEROOMRESPONSE']._serialized_start=590 + _globals['_DELETEROOMRESPONSE']._serialized_end=610 + _globals['_LISTPARTICIPANTSREQUEST']._serialized_start=612 + _globals['_LISTPARTICIPANTSREQUEST']._serialized_end=651 + _globals['_LISTPARTICIPANTSRESPONSE']._serialized_start=653 + _globals['_LISTPARTICIPANTSRESPONSE']._serialized_end=727 + _globals['_ROOMPARTICIPANTIDENTITY']._serialized_start=729 + _globals['_ROOMPARTICIPANTIDENTITY']._serialized_end=786 + _globals['_REMOVEPARTICIPANTRESPONSE']._serialized_start=788 + _globals['_REMOVEPARTICIPANTRESPONSE']._serialized_end=815 + _globals['_MUTEROOMTRACKREQUEST']._serialized_start=817 + _globals['_MUTEROOMTRACKREQUEST']._serialized_end=905 + _globals['_MUTEROOMTRACKRESPONSE']._serialized_start=907 + _globals['_MUTEROOMTRACKRESPONSE']._serialized_end=965 + _globals['_UPDATEPARTICIPANTREQUEST']._serialized_start=968 + _globals['_UPDATEPARTICIPANTREQUEST']._serialized_end=1110 + _globals['_UPDATESUBSCRIPTIONSREQUEST']._serialized_start=1113 + _globals['_UPDATESUBSCRIPTIONSREQUEST']._serialized_end=1268 + _globals['_UPDATESUBSCRIPTIONSRESPONSE']._serialized_start=1270 + _globals['_UPDATESUBSCRIPTIONSRESPONSE']._serialized_end=1299 + _globals['_SENDDATAREQUEST']._serialized_start=1302 + _globals['_SENDDATAREQUEST']._serialized_end=1479 + _globals['_SENDDATARESPONSE']._serialized_start=1481 + _globals['_SENDDATARESPONSE']._serialized_end=1499 + _globals['_UPDATEROOMMETADATAREQUEST']._serialized_start=1501 + _globals['_UPDATEROOMMETADATAREQUEST']._serialized_end=1560 + _globals['_ROOMSERVICE']._serialized_start=1563 + _globals['_ROOMSERVICE']._serialized_end=2433 +# @@protoc_insertion_point(module_scope) diff --git a/livekit-api/livekit/api/_proto/livekit_room_pb2.pyi b/livekit-api/livekit/api/_proto/livekit_room_pb2.pyi new file mode 100644 index 00000000..794e3c96 --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_room_pb2.pyi @@ -0,0 +1,416 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright 2023 LiveKit, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import builtins +import collections.abc +import google.protobuf.descriptor +import google.protobuf.internal.containers +import google.protobuf.message +from . import livekit_egress_pb2 +from . import livekit_models_pb2 +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing_extensions.final +class CreateRoomRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAME_FIELD_NUMBER: builtins.int + EMPTY_TIMEOUT_FIELD_NUMBER: builtins.int + MAX_PARTICIPANTS_FIELD_NUMBER: builtins.int + NODE_ID_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + EGRESS_FIELD_NUMBER: builtins.int + MIN_PLAYOUT_DELAY_FIELD_NUMBER: builtins.int + MAX_PLAYOUT_DELAY_FIELD_NUMBER: builtins.int + SYNC_STREAMS_FIELD_NUMBER: builtins.int + name: builtins.str + """name of the room""" + empty_timeout: builtins.int + """number of seconds to keep the room open if no one joins""" + max_participants: builtins.int + """limit number of participants that can be in a room""" + node_id: builtins.str + """override the node room is allocated to, for debugging""" + metadata: builtins.str + """metadata of room""" + @property + def egress(self) -> global___RoomEgress: + """egress""" + min_playout_delay: builtins.int + """playout delay of subscriber""" + max_playout_delay: builtins.int + sync_streams: builtins.bool + """improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use + so not recommended for rooms with frequent subscription changes + """ + def __init__( + self, + *, + name: builtins.str = ..., + empty_timeout: builtins.int = ..., + max_participants: builtins.int = ..., + node_id: builtins.str = ..., + metadata: builtins.str = ..., + egress: global___RoomEgress | None = ..., + min_playout_delay: builtins.int = ..., + max_playout_delay: builtins.int = ..., + sync_streams: builtins.bool = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["egress", b"egress"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["egress", b"egress", "empty_timeout", b"empty_timeout", "max_participants", b"max_participants", "max_playout_delay", b"max_playout_delay", "metadata", b"metadata", "min_playout_delay", b"min_playout_delay", "name", b"name", "node_id", b"node_id", "sync_streams", b"sync_streams"]) -> None: ... + +global___CreateRoomRequest = CreateRoomRequest + +@typing_extensions.final +class RoomEgress(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + PARTICIPANT_FIELD_NUMBER: builtins.int + TRACKS_FIELD_NUMBER: builtins.int + @property + def room(self) -> livekit_egress_pb2.RoomCompositeEgressRequest: ... + @property + def participant(self) -> livekit_egress_pb2.AutoParticipantEgress: ... + @property + def tracks(self) -> livekit_egress_pb2.AutoTrackEgress: ... + def __init__( + self, + *, + room: livekit_egress_pb2.RoomCompositeEgressRequest | None = ..., + participant: livekit_egress_pb2.AutoParticipantEgress | None = ..., + tracks: livekit_egress_pb2.AutoTrackEgress | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["participant", b"participant", "room", b"room", "tracks", b"tracks"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["participant", b"participant", "room", b"room", "tracks", b"tracks"]) -> None: ... + +global___RoomEgress = RoomEgress + +@typing_extensions.final +class ListRoomsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + NAMES_FIELD_NUMBER: builtins.int + @property + def names(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """when set, will only return rooms with name match""" + def __init__( + self, + *, + names: collections.abc.Iterable[builtins.str] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["names", b"names"]) -> None: ... + +global___ListRoomsRequest = ListRoomsRequest + +@typing_extensions.final +class ListRoomsResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOMS_FIELD_NUMBER: builtins.int + @property + def rooms(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[livekit_models_pb2.Room]: ... + def __init__( + self, + *, + rooms: collections.abc.Iterable[livekit_models_pb2.Room] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["rooms", b"rooms"]) -> None: ... + +global___ListRoomsResponse = ListRoomsResponse + +@typing_extensions.final +class DeleteRoomRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + room: builtins.str + """name of the room""" + def __init__( + self, + *, + room: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["room", b"room"]) -> None: ... + +global___DeleteRoomRequest = DeleteRoomRequest + +@typing_extensions.final +class DeleteRoomResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___DeleteRoomResponse = DeleteRoomResponse + +@typing_extensions.final +class ListParticipantsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + room: builtins.str + """name of the room""" + def __init__( + self, + *, + room: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["room", b"room"]) -> None: ... + +global___ListParticipantsRequest = ListParticipantsRequest + +@typing_extensions.final +class ListParticipantsResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + PARTICIPANTS_FIELD_NUMBER: builtins.int + @property + def participants(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[livekit_models_pb2.ParticipantInfo]: ... + def __init__( + self, + *, + participants: collections.abc.Iterable[livekit_models_pb2.ParticipantInfo] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["participants", b"participants"]) -> None: ... + +global___ListParticipantsResponse = ListParticipantsResponse + +@typing_extensions.final +class RoomParticipantIdentity(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + room: builtins.str + """name of the room""" + identity: builtins.str + """identity of the participant""" + def __init__( + self, + *, + room: builtins.str = ..., + identity: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["identity", b"identity", "room", b"room"]) -> None: ... + +global___RoomParticipantIdentity = RoomParticipantIdentity + +@typing_extensions.final +class RemoveParticipantResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___RemoveParticipantResponse = RemoveParticipantResponse + +@typing_extensions.final +class MuteRoomTrackRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + TRACK_SID_FIELD_NUMBER: builtins.int + MUTED_FIELD_NUMBER: builtins.int + room: builtins.str + """name of the room""" + identity: builtins.str + track_sid: builtins.str + """sid of the track to mute""" + muted: builtins.bool + """set to true to mute, false to unmute""" + def __init__( + self, + *, + room: builtins.str = ..., + identity: builtins.str = ..., + track_sid: builtins.str = ..., + muted: builtins.bool = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["identity", b"identity", "muted", b"muted", "room", b"room", "track_sid", b"track_sid"]) -> None: ... + +global___MuteRoomTrackRequest = MuteRoomTrackRequest + +@typing_extensions.final +class MuteRoomTrackResponse(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + TRACK_FIELD_NUMBER: builtins.int + @property + def track(self) -> livekit_models_pb2.TrackInfo: ... + def __init__( + self, + *, + track: livekit_models_pb2.TrackInfo | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["track", b"track"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["track", b"track"]) -> None: ... + +global___MuteRoomTrackResponse = MuteRoomTrackResponse + +@typing_extensions.final +class UpdateParticipantRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + PERMISSION_FIELD_NUMBER: builtins.int + NAME_FIELD_NUMBER: builtins.int + room: builtins.str + identity: builtins.str + metadata: builtins.str + """metadata to update. skipping updates if left empty""" + @property + def permission(self) -> livekit_models_pb2.ParticipantPermission: + """set to update the participant's permissions""" + name: builtins.str + """display name to update""" + def __init__( + self, + *, + room: builtins.str = ..., + identity: builtins.str = ..., + metadata: builtins.str = ..., + permission: livekit_models_pb2.ParticipantPermission | None = ..., + name: builtins.str = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["permission", b"permission"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["identity", b"identity", "metadata", b"metadata", "name", b"name", "permission", b"permission", "room", b"room"]) -> None: ... + +global___UpdateParticipantRequest = UpdateParticipantRequest + +@typing_extensions.final +class UpdateSubscriptionsRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + IDENTITY_FIELD_NUMBER: builtins.int + TRACK_SIDS_FIELD_NUMBER: builtins.int + SUBSCRIBE_FIELD_NUMBER: builtins.int + PARTICIPANT_TRACKS_FIELD_NUMBER: builtins.int + room: builtins.str + identity: builtins.str + @property + def track_sids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """list of sids of tracks""" + subscribe: builtins.bool + """set to true to subscribe, false to unsubscribe from tracks""" + @property + def participant_tracks(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[livekit_models_pb2.ParticipantTracks]: + """list of participants and their tracks""" + def __init__( + self, + *, + room: builtins.str = ..., + identity: builtins.str = ..., + track_sids: collections.abc.Iterable[builtins.str] | None = ..., + subscribe: builtins.bool = ..., + participant_tracks: collections.abc.Iterable[livekit_models_pb2.ParticipantTracks] | None = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["identity", b"identity", "participant_tracks", b"participant_tracks", "room", b"room", "subscribe", b"subscribe", "track_sids", b"track_sids"]) -> None: ... + +global___UpdateSubscriptionsRequest = UpdateSubscriptionsRequest + +@typing_extensions.final +class UpdateSubscriptionsResponse(google.protobuf.message.Message): + """empty for now""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___UpdateSubscriptionsResponse = UpdateSubscriptionsResponse + +@typing_extensions.final +class SendDataRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + DATA_FIELD_NUMBER: builtins.int + KIND_FIELD_NUMBER: builtins.int + DESTINATION_SIDS_FIELD_NUMBER: builtins.int + DESTINATION_IDENTITIES_FIELD_NUMBER: builtins.int + TOPIC_FIELD_NUMBER: builtins.int + room: builtins.str + data: builtins.bytes + kind: livekit_models_pb2.DataPacket.Kind.ValueType + @property + def destination_sids(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """mark deprecated""" + @property + def destination_identities(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: + """when set, only forward to these identities""" + topic: builtins.str + def __init__( + self, + *, + room: builtins.str = ..., + data: builtins.bytes = ..., + kind: livekit_models_pb2.DataPacket.Kind.ValueType = ..., + destination_sids: collections.abc.Iterable[builtins.str] | None = ..., + destination_identities: collections.abc.Iterable[builtins.str] | None = ..., + topic: builtins.str | None = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["_topic", b"_topic", "topic", b"topic"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["_topic", b"_topic", "data", b"data", "destination_identities", b"destination_identities", "destination_sids", b"destination_sids", "kind", b"kind", "room", b"room", "topic", b"topic"]) -> None: ... + def WhichOneof(self, oneof_group: typing_extensions.Literal["_topic", b"_topic"]) -> typing_extensions.Literal["topic"] | None: ... + +global___SendDataRequest = SendDataRequest + +@typing_extensions.final +class SendDataResponse(google.protobuf.message.Message): + """""" + + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + def __init__( + self, + ) -> None: ... + +global___SendDataResponse = SendDataResponse + +@typing_extensions.final +class UpdateRoomMetadataRequest(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + ROOM_FIELD_NUMBER: builtins.int + METADATA_FIELD_NUMBER: builtins.int + room: builtins.str + metadata: builtins.str + """metadata to update. skipping updates if left empty""" + def __init__( + self, + *, + room: builtins.str = ..., + metadata: builtins.str = ..., + ) -> None: ... + def ClearField(self, field_name: typing_extensions.Literal["metadata", b"metadata", "room", b"room"]) -> None: ... + +global___UpdateRoomMetadataRequest = UpdateRoomMetadataRequest diff --git a/livekit-api/livekit/api/_proto/livekit_webhook_pb2.py b/livekit-api/livekit/api/_proto/livekit_webhook_pb2.py new file mode 100644 index 00000000..789448dc --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_webhook_pb2.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: livekit_webhook.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import livekit_models_pb2 as livekit__models__pb2 +from . import livekit_egress_pb2 as livekit__egress__pb2 +from . import livekit_ingress_pb2 as livekit__ingress__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15livekit_webhook.proto\x12\x07livekit\x1a\x14livekit_models.proto\x1a\x14livekit_egress.proto\x1a\x15livekit_ingress.proto\"\x97\x02\n\x0cWebhookEvent\x12\r\n\x05\x65vent\x18\x01 \x01(\t\x12\x1b\n\x04room\x18\x02 \x01(\x0b\x32\r.livekit.Room\x12-\n\x0bparticipant\x18\x03 \x01(\x0b\x32\x18.livekit.ParticipantInfo\x12(\n\x0b\x65gress_info\x18\t \x01(\x0b\x32\x13.livekit.EgressInfo\x12*\n\x0cingress_info\x18\n \x01(\x0b\x32\x14.livekit.IngressInfo\x12!\n\x05track\x18\x08 \x01(\x0b\x32\x12.livekit.TrackInfo\x12\n\n\x02id\x18\x06 \x01(\t\x12\x12\n\ncreated_at\x18\x07 \x01(\x03\x12\x13\n\x0bnum_dropped\x18\x0b \x01(\x05\x42\x46Z#github.com/livekit/protocol/livekit\xaa\x02\rLiveKit.Proto\xea\x02\x0eLiveKit::Protob\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'livekit_webhook_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z#github.com/livekit/protocol/livekit\252\002\rLiveKit.Proto\352\002\016LiveKit::Proto' + _globals['_WEBHOOKEVENT']._serialized_start=102 + _globals['_WEBHOOKEVENT']._serialized_end=381 +# @@protoc_insertion_point(module_scope) diff --git a/livekit-api/livekit/api/_proto/livekit_webhook_pb2.pyi b/livekit-api/livekit/api/_proto/livekit_webhook_pb2.pyi new file mode 100644 index 00000000..72584e2a --- /dev/null +++ b/livekit-api/livekit/api/_proto/livekit_webhook_pb2.pyi @@ -0,0 +1,86 @@ +""" +@generated by mypy-protobuf. Do not edit manually! +isort:skip_file +Copyright 2023 LiveKit, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +import builtins +import google.protobuf.descriptor +import google.protobuf.message +from . import livekit_egress_pb2 +from . import livekit_ingress_pb2 +from . import livekit_models_pb2 +import sys + +if sys.version_info >= (3, 8): + import typing as typing_extensions +else: + import typing_extensions + +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor + +@typing_extensions.final +class WebhookEvent(google.protobuf.message.Message): + DESCRIPTOR: google.protobuf.descriptor.Descriptor + + EVENT_FIELD_NUMBER: builtins.int + ROOM_FIELD_NUMBER: builtins.int + PARTICIPANT_FIELD_NUMBER: builtins.int + EGRESS_INFO_FIELD_NUMBER: builtins.int + INGRESS_INFO_FIELD_NUMBER: builtins.int + TRACK_FIELD_NUMBER: builtins.int + ID_FIELD_NUMBER: builtins.int + CREATED_AT_FIELD_NUMBER: builtins.int + NUM_DROPPED_FIELD_NUMBER: builtins.int + event: builtins.str + """one of room_started, room_finished, participant_joined, participant_left, + track_published, track_unpublished, egress_started, egress_updated, egress_ended, + ingress_started, ingress_ended + """ + @property + def room(self) -> livekit_models_pb2.Room: ... + @property + def participant(self) -> livekit_models_pb2.ParticipantInfo: + """set when event is participant_* or track_*""" + @property + def egress_info(self) -> livekit_egress_pb2.EgressInfo: + """set when event is egress_*""" + @property + def ingress_info(self) -> livekit_ingress_pb2.IngressInfo: + """set when event is ingress_*""" + @property + def track(self) -> livekit_models_pb2.TrackInfo: + """set when event is track_*""" + id: builtins.str + """unique event uuid""" + created_at: builtins.int + """timestamp in seconds""" + num_dropped: builtins.int + def __init__( + self, + *, + event: builtins.str = ..., + room: livekit_models_pb2.Room | None = ..., + participant: livekit_models_pb2.ParticipantInfo | None = ..., + egress_info: livekit_egress_pb2.EgressInfo | None = ..., + ingress_info: livekit_ingress_pb2.IngressInfo | None = ..., + track: livekit_models_pb2.TrackInfo | None = ..., + id: builtins.str = ..., + created_at: builtins.int = ..., + num_dropped: builtins.int = ..., + ) -> None: ... + def HasField(self, field_name: typing_extensions.Literal["egress_info", b"egress_info", "ingress_info", b"ingress_info", "participant", b"participant", "room", b"room", "track", b"track"]) -> builtins.bool: ... + def ClearField(self, field_name: typing_extensions.Literal["created_at", b"created_at", "egress_info", b"egress_info", "event", b"event", "id", b"id", "ingress_info", b"ingress_info", "num_dropped", b"num_dropped", "participant", b"participant", "room", b"room", "track", b"track"]) -> None: ... + +global___WebhookEvent = WebhookEvent diff --git a/livekit-api/livekit/api/_service.py b/livekit-api/livekit/api/_service.py new file mode 100644 index 00000000..1fc89ffe --- /dev/null +++ b/livekit-api/livekit/api/_service.py @@ -0,0 +1,22 @@ + +from typing import Dict + +from ._twirp_client import TwirpClient +from .access_token import AccessToken, VideoGrants + +AUTHORIZATION = "authorization" + + +class Service: + def __init__(self, host: str, api_key: str, api_secret: str): + self._client = TwirpClient(host, "livekit") + self.api_key = api_key + self.api_secret = api_secret + + def _auth_header(self, grants: VideoGrants) -> Dict[str, str]: + token = AccessToken( + self.api_key, self.api_secret).with_grants(grants).to_jwt() + + headers = {} + headers[AUTHORIZATION] = "Bearer {}".format(token) + return headers diff --git a/livekit-api/livekit/api/_twirp_client.py b/livekit-api/livekit/api/_twirp_client.py new file mode 100644 index 00000000..88977297 --- /dev/null +++ b/livekit-api/livekit/api/_twirp_client.py @@ -0,0 +1,83 @@ +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Dict, Optional, Type, TypeVar + +import aiohttp +from google.protobuf.message import Message + +DEFAULT_PREFIX = "/twirp" + + +class TwirpError(Exception): + def __init__(self, code: str, msg: str) -> None: + self.code = code + self.msg = msg + + +class TwirpErrorCode: + CANCELED = "canceled" + UNKNOWN = "unknown" + INVALID_ARGUMENT = "invalid_argument" + MALFORMED = "malformed" + DEADLINE_EXCEEDED = "deadline_exceeded" + NOT_FOUND = "not_found" + BAD_ROUTE = "bad_route" + ALREADY_EXISTS = "already_exists" + PERMISSION_DENIED = "permission_denied" + UNAUTHENTICATED = "unauthenticated" + RESOURCE_EXHAUSTED = "resource_exhausted" + FAILED_PRECONDITION = "failed_precondition" + ABORTED = "aborted" + OUT_OF_RANGE = "out_of_range" + UNIMPLEMENTED = "unimplemented" + INTERNAL = "internal" + UNAVAILABLE = "unavailable" + DATA_LOSS = "dataloss" + + +T = TypeVar('T', bound=Message, type=None) + + +class TwirpClient: + def __init__(self, host: str, pkg: str, prefix: str = DEFAULT_PREFIX) -> None: + self.host = host + self.pkg = pkg + self.prefix = prefix + self.session = aiohttp.ClientSession() + + async def request( + self, + service: str, + method: str, + data: Message, + headers: Dict[str, str], + response_class: Type[T] = None + ) -> T: + url = f"{self.host}/{self.prefix}/{self.pkg}.{service}/{method}" + headers["Content-Type"] = "application/protobuf" + + serialized_data = data.SerializeToString() + async with self.session.post(url, + headers=headers, + data=serialized_data) as resp: + if resp.status == 200: + return response_class.FromString(await resp.read()) + else: + # when we have an error, Twirp always encode it in json + error_data = await resp.json() + raise TwirpError(error_data["code"], error_data["msg"]) + + async def close(self): + await self.session.close() diff --git a/livekit-api/livekit/api/access_token.py b/livekit-api/livekit/api/access_token.py new file mode 100644 index 00000000..f39ce7e8 --- /dev/null +++ b/livekit-api/livekit/api/access_token.py @@ -0,0 +1,112 @@ +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import calendar +import dataclasses +import datetime + +import jwt + +DEFAULT_TTL = datetime.timedelta(hours=6) + + +@dataclasses.dataclass +class VideoGrants: + # actions on rooms + room_create: bool = False + room_list: bool = False + room_record: bool = False + + # actions on a particular room + room_admin: bool = False + room_join: bool = False + room: str = "" + + # permissions within a room + can_publish: bool = True + can_subscribe: bool = True + can_publish_data: bool = True + + # TrackSource types that a participant may publish. + # When set, it supercedes CanPublish. Only sources explicitly set here can be + # published + can_publish_sources: list[str] = [] # keys keep track of each source + + # by default, a participant is not allowed to update its own metadata + can_update_own_metadata: bool = False + + # actions on ingresses + ingress_admin: bool = False # applies to all ingress + + # participant is not visible to other participants (useful when making bots) + hidden: bool = False + + # indicates to the room that current participant is a recorder + recorder: bool = False + + +@dataclasses.dataclass +class Claims: + name: str = "" + video: VideoGrants = dataclasses.field(default_factory=VideoGrants) + metadata: str = "" + sha256: str = "" + + +class AccessToken: + def __init__(self, api_key: str, api_secret: str) -> None: + self.api_key = api_key # iss + self.api_secret = api_secret + self.claims = Claims() + + # default jwt claims + self.identity = "" # sub + self.ttl = DEFAULT_TTL # exp + + def with_ttl(self, ttl: datetime.timedelta) -> 'AccessToken': + self.ttl = ttl + return self + + def with_grants(self, grants: VideoGrants) -> 'AccessToken': + self.claims.video = grants + return self + + def with_identity(self, identity: str) -> 'AccessToken': + self.identity = identity + return self + + def with_name(self, name: str) -> 'AccessToken': + self.claims.name = name + return self + + def with_metadata(self, metadata: str) -> 'AccessToken': + self.claims.metadata = metadata + return self + + def with_sha256(self, sha256: str) -> 'AccessToken': + self.claims.sha256 = sha256 + return self + + def to_jwt(self) -> str: + claims = { + 'sub': self.identity, + "iss": self.api_key, + "nbf": calendar.timegm(datetime.datetime.utcnow().utctimetuple()), + "exp": calendar.timegm( + (datetime.datetime.utcnow() + self.ttl).utctimetuple() + ), + } + + claims.update(dataclasses.asdict(self.claims)) + return jwt.encode(claims, self.api_secret, algorithm='HS256') diff --git a/livekit-api/livekit/api/room_service.py b/livekit-api/livekit/api/room_service.py new file mode 100644 index 00000000..76373083 --- /dev/null +++ b/livekit-api/livekit/api/room_service.py @@ -0,0 +1,65 @@ + +from ._proto import livekit_models_pb2 as proto_models +from ._proto import livekit_room_pb2 as proto_room +from ._service import Service +from .access_token import VideoGrants + +SVC = "RoomService" + + +class RoomService(Service): + def __init__(self, host: str, api_key: str, api_secret: str): + super().__init__(host, api_key, api_secret) + + async def create_room(self, create: proto_room.CreateRoomRequest) \ + -> proto_models.Room: + return await self._client.request(SVC, "CreateRoom", create, + self._auth_header( + VideoGrants(room_create=True)), + proto_models.Room) + + async def list_rooms(self, list: proto_room.ListRoomsRequest) \ + -> proto_room.ListRoomsResponse: + return await self._client.request(SVC, "ListRooms", list, + self._auth_header( + VideoGrants(room_list=True)), + proto_room.ListRoomsResponse) + + async def delete_room(self, delete: proto_room.DeleteRoomRequest) \ + -> proto_room.DeleteRoomResponse: + return await self._client.request(SVC, "DeleteRoom", delete, + self._auth_header( + VideoGrants(room_create=True)), + proto_room.DeleteRoomResponse) + + async def update_room_metadata(self, update: proto_room.UpdateRoomMetadataRequest) \ + -> proto_models.Room: + return await self._client.request(SVC, "UpdateRoomMetadata", update, + self._auth_header( + VideoGrants(room_admin=True, + room=update.room)), + proto_models.Room) + + async def list_participants(self, list: proto_room.ListParticipantsRequest) \ + -> proto_room.ListParticipantsResponse: + return await self._client.request(SVC, "ListParticipants", list, + self._auth_header( + VideoGrants(room_admin=True, + room=list.room)), + proto_room.ListParticipantsResponse) + + async def get_participant(self, get: proto_room.RoomParticipantIdentity) \ + -> proto_models.ParticipantInfo: + return await self._client.request(SVC, "GetParticipant", get, + self._auth_header( + VideoGrants(room_admin=True, + jroom=get.room)), + proto_models.ParticipantInfo) + + async def remove_participant(self, remove: proto_room.RoomParticipantIdentity) \ + -> None: + return await self._client.request(SVC, "remove_participant", remove, + self._auth_header( + VideoGrants(room_admin=True, + room=remove.room)), + None) diff --git a/livekit-api/livekit/api/version.py b/livekit-api/livekit/api/version.py new file mode 100644 index 00000000..3dc1f76b --- /dev/null +++ b/livekit-api/livekit/api/version.py @@ -0,0 +1 @@ +__version__ = "0.1.0" diff --git a/livekit-api/protocol b/livekit-api/protocol new file mode 160000 index 00000000..525419ad --- /dev/null +++ b/livekit-api/protocol @@ -0,0 +1 @@ +Subproject commit 525419ade0bf5626cfb52f4bd59f85e92b51be53 diff --git a/livekit-api/pyproject.toml b/livekit-api/pyproject.toml new file mode 100644 index 00000000..15caa0ee --- /dev/null +++ b/livekit-api/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = [ + "setuptools>=42", +] +build-backend = "setuptools.build_meta" diff --git a/livekit-api/setup.py b/livekit-api/setup.py new file mode 100644 index 00000000..541c583a --- /dev/null +++ b/livekit-api/setup.py @@ -0,0 +1,59 @@ +# Copyright 2023 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import pathlib + +import setuptools + +here = pathlib.Path(__file__).parent.resolve() +about = {} +with open(os.path.join(here, 'livekit', 'api', 'version.py'), 'r') as f: + exec(f.read(), about) + + +setuptools.setup( + name="livekit-api", + version=about['__version__'], + description="LiveKit Python Server for LiveKit", + long_description=(here / "README.md").read_text(encoding="utf-8"), + long_description_content_type="text/markdown", + url="https://github.com/livekit/client-sdk-python", + classifiers=[ + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Topic :: Multimedia :: Sound/Audio", + "Topic :: Multimedia :: Video", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3 :: Only", + ], + keywords=["webrtc", "realtime", "audio", "video", "livekit"], + license="Apache-2.0", + packages=setuptools.find_namespace_packages(include=['livekit.*']), + python_requires=">=3.7.0", + install_requires=["pyjwt>=2.0.0", + "aiohttp>=3.8.0", + "protobuf>=3.1.0", + "types-protobuf>=3.1.0"], + project_urls={ + "Documentation": "https://docs.livekit.io", + "Website": "https://livekit.io/", + "Source": "https://github.com/livekit/client-sdk-python/", + }, +) diff --git a/livekit-rtc/README.md b/livekit-rtc/README.md new file mode 100644 index 00000000..d552dede --- /dev/null +++ b/livekit-rtc/README.md @@ -0,0 +1 @@ +# livekit-rtc diff --git a/generate_proto.sh b/livekit-rtc/generate_proto.sh similarity index 85% rename from generate_proto.sh rename to livekit-rtc/generate_proto.sh index 342bc2ec..b237d799 100755 --- a/generate_proto.sh +++ b/livekit-rtc/generate_proto.sh @@ -17,12 +17,13 @@ # This script requires protobuf-compiler and https://github.com/nipunn1313/mypy-protobuf FFI_PROTOCOL=./rust-sdks/livekit-ffi/protocol -OUT_PYTHON=./livekit/_proto +FFI_OUT_PYTHON=./livekit/rtc/_proto +# ffi protoc \ -I=$FFI_PROTOCOL \ - --python_out=$OUT_PYTHON \ - --mypy_out=$OUT_PYTHON \ + --python_out=$FFI_OUT_PYTHON \ + --mypy_out=$FFI_OUT_PYTHON \ $FFI_PROTOCOL/audio_frame.proto \ $FFI_PROTOCOL/ffi.proto \ $FFI_PROTOCOL/handle.proto \ @@ -32,9 +33,8 @@ protoc \ $FFI_PROTOCOL/video_frame.proto \ $FFI_PROTOCOL/e2ee.proto -touch -a "$OUT_PYTHON/__init__.py" +touch -a "$FFI_OUT_PYTHON/__init__.py" -for f in "$OUT_PYTHON"/*.py "$OUT_PYTHON"/*.pyi; do +for f in "$FFI_OUT_PYTHON"/*.py "$FFI_OUT_PYTHON"/*.pyi; do perl -i -pe 's|^(import (audio_frame_pb2\|ffi_pb2\|handle_pb2\|participant_pb2\|room_pb2\|track_pb2\|video_frame_pb2\|e2ee_pb2))|from . $1|g' "$f" done - diff --git a/livekit/__init__.py b/livekit-rtc/livekit/rtc/__init__.py similarity index 98% rename from livekit/__init__.py rename to livekit-rtc/livekit/rtc/__init__.py index 822bba0b..3c83ea74 100644 --- a/livekit/__init__.py +++ b/livekit-rtc/livekit/rtc/__init__.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""LiveKit Client SDK +"""LiveKit RTC SDK """ # flake8: noqa diff --git a/livekit/_ffi_client.py b/livekit-rtc/livekit/rtc/_ffi_client.py similarity index 98% rename from livekit/_ffi_client.py rename to livekit-rtc/livekit/rtc/_ffi_client.py index e533ed6c..f685be18 100644 --- a/livekit/_ffi_client.py +++ b/livekit-rtc/livekit/rtc/_ffi_client.py @@ -43,7 +43,7 @@ def get_ffi_lib_path(): Set LIVEKIT_LIB_PATH to specify a the lib path") libpath = pkg_resources.resource_filename( - 'livekit', os.path.join('resources', libname)) + 'livekit.rtc', os.path.join('resources', libname)) return libpath diff --git a/livekit/_proto/__init__.py b/livekit-rtc/livekit/rtc/_proto/__init__.py similarity index 100% rename from livekit/_proto/__init__.py rename to livekit-rtc/livekit/rtc/_proto/__init__.py diff --git a/livekit/_proto/audio_frame_pb2.py b/livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.py similarity index 100% rename from livekit/_proto/audio_frame_pb2.py rename to livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.py diff --git a/livekit/_proto/audio_frame_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.pyi similarity index 100% rename from livekit/_proto/audio_frame_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/audio_frame_pb2.pyi diff --git a/livekit/_proto/e2ee_pb2.py b/livekit-rtc/livekit/rtc/_proto/e2ee_pb2.py similarity index 100% rename from livekit/_proto/e2ee_pb2.py rename to livekit-rtc/livekit/rtc/_proto/e2ee_pb2.py diff --git a/livekit/_proto/e2ee_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/e2ee_pb2.pyi similarity index 100% rename from livekit/_proto/e2ee_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/e2ee_pb2.pyi diff --git a/livekit/_proto/ffi_pb2.py b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.py similarity index 100% rename from livekit/_proto/ffi_pb2.py rename to livekit-rtc/livekit/rtc/_proto/ffi_pb2.py diff --git a/livekit/_proto/ffi_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi similarity index 100% rename from livekit/_proto/ffi_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/ffi_pb2.pyi diff --git a/livekit/_proto/handle_pb2.py b/livekit-rtc/livekit/rtc/_proto/handle_pb2.py similarity index 100% rename from livekit/_proto/handle_pb2.py rename to livekit-rtc/livekit/rtc/_proto/handle_pb2.py diff --git a/livekit/_proto/handle_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/handle_pb2.pyi similarity index 100% rename from livekit/_proto/handle_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/handle_pb2.pyi diff --git a/livekit/_proto/participant_pb2.py b/livekit-rtc/livekit/rtc/_proto/participant_pb2.py similarity index 100% rename from livekit/_proto/participant_pb2.py rename to livekit-rtc/livekit/rtc/_proto/participant_pb2.py diff --git a/livekit/_proto/participant_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/participant_pb2.pyi similarity index 100% rename from livekit/_proto/participant_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/participant_pb2.pyi diff --git a/livekit/_proto/room_pb2.py b/livekit-rtc/livekit/rtc/_proto/room_pb2.py similarity index 100% rename from livekit/_proto/room_pb2.py rename to livekit-rtc/livekit/rtc/_proto/room_pb2.py diff --git a/livekit/_proto/room_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/room_pb2.pyi similarity index 100% rename from livekit/_proto/room_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/room_pb2.pyi diff --git a/livekit/_proto/track_pb2.py b/livekit-rtc/livekit/rtc/_proto/track_pb2.py similarity index 100% rename from livekit/_proto/track_pb2.py rename to livekit-rtc/livekit/rtc/_proto/track_pb2.py diff --git a/livekit/_proto/track_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/track_pb2.pyi similarity index 100% rename from livekit/_proto/track_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/track_pb2.pyi diff --git a/livekit/_proto/video_frame_pb2.py b/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.py similarity index 100% rename from livekit/_proto/video_frame_pb2.py rename to livekit-rtc/livekit/rtc/_proto/video_frame_pb2.py diff --git a/livekit/_proto/video_frame_pb2.pyi b/livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi similarity index 100% rename from livekit/_proto/video_frame_pb2.pyi rename to livekit-rtc/livekit/rtc/_proto/video_frame_pb2.pyi diff --git a/livekit/_utils.py b/livekit-rtc/livekit/rtc/_utils.py similarity index 100% rename from livekit/_utils.py rename to livekit-rtc/livekit/rtc/_utils.py diff --git a/livekit/audio_frame.py b/livekit-rtc/livekit/rtc/audio_frame.py similarity index 100% rename from livekit/audio_frame.py rename to livekit-rtc/livekit/rtc/audio_frame.py diff --git a/livekit/audio_source.py b/livekit-rtc/livekit/rtc/audio_source.py similarity index 100% rename from livekit/audio_source.py rename to livekit-rtc/livekit/rtc/audio_source.py diff --git a/livekit/audio_stream.py b/livekit-rtc/livekit/rtc/audio_stream.py similarity index 100% rename from livekit/audio_stream.py rename to livekit-rtc/livekit/rtc/audio_stream.py diff --git a/livekit/e2ee.py b/livekit-rtc/livekit/rtc/e2ee.py similarity index 100% rename from livekit/e2ee.py rename to livekit-rtc/livekit/rtc/e2ee.py diff --git a/livekit/participant.py b/livekit-rtc/livekit/rtc/participant.py similarity index 100% rename from livekit/participant.py rename to livekit-rtc/livekit/rtc/participant.py diff --git a/livekit/resources/.gitignore b/livekit-rtc/livekit/rtc/resources/.gitignore similarity index 100% rename from livekit/resources/.gitignore rename to livekit-rtc/livekit/rtc/resources/.gitignore diff --git a/livekit/room.py b/livekit-rtc/livekit/rtc/room.py similarity index 100% rename from livekit/room.py rename to livekit-rtc/livekit/rtc/room.py diff --git a/livekit/track.py b/livekit-rtc/livekit/rtc/track.py similarity index 100% rename from livekit/track.py rename to livekit-rtc/livekit/rtc/track.py diff --git a/livekit/track_publication.py b/livekit-rtc/livekit/rtc/track_publication.py similarity index 97% rename from livekit/track_publication.py rename to livekit-rtc/livekit/rtc/track_publication.py index 0ff344f5..4306794c 100644 --- a/livekit/track_publication.py +++ b/livekit-rtc/livekit/rtc/track_publication.py @@ -14,11 +14,10 @@ from typing import Optional -from livekit._proto import track_pb2 as proto_track - from ._ffi_client import FfiHandle, ffi_client from ._proto import e2ee_pb2 as proto_e2ee from ._proto import ffi_pb2 as proto_ffi +from ._proto import track_pb2 as proto_track from .track import Track diff --git a/livekit/version.py b/livekit-rtc/livekit/rtc/version.py similarity index 100% rename from livekit/version.py rename to livekit-rtc/livekit/rtc/version.py diff --git a/livekit/video_frame.py b/livekit-rtc/livekit/rtc/video_frame.py similarity index 100% rename from livekit/video_frame.py rename to livekit-rtc/livekit/rtc/video_frame.py diff --git a/livekit/video_source.py b/livekit-rtc/livekit/rtc/video_source.py similarity index 100% rename from livekit/video_source.py rename to livekit-rtc/livekit/rtc/video_source.py diff --git a/livekit/video_stream.py b/livekit-rtc/livekit/rtc/video_stream.py similarity index 100% rename from livekit/video_stream.py rename to livekit-rtc/livekit/rtc/video_stream.py diff --git a/pyproject.toml b/livekit-rtc/pyproject.toml similarity index 66% rename from pyproject.toml rename to livekit-rtc/pyproject.toml index 7203bbc0..34ece544 100644 --- a/pyproject.toml +++ b/livekit-rtc/pyproject.toml @@ -6,19 +6,9 @@ requires = [ ] build-backend = "setuptools.build_meta" -[tool.ruff] -select = [ - "E", # pycodestyle - "F", # pyflakes - "I", # isort -] -exclude = [ - 'examples/whisper/whisper.cpp', - 'livekit/_proto', -] - [tool.cibuildwheel] -build = "cp39-*" +build = "cp37-*" +skip = "*-musllinux_*" # not supported (libwebrtc is using glibc) manylinux-x86_64-image = "manylinux_2_28" manylinux-i686-image = "manylinux_2_28" @@ -27,4 +17,4 @@ manylinux-ppc64le-image = "manylinux_2_28" manylinux-s390x-image = "manylinux_2_28" manylinux-pypy_x86_64-image = "manylinux_2_28" manylinux-pypy_i686-image = "manylinux_2_28" -manylinux-pypy_aarch64-image = "manylinux_2_28" \ No newline at end of file +manylinux-pypy_aarch64-image = "manylinux_2_28" diff --git a/rust-sdks b/livekit-rtc/rust-sdks similarity index 100% rename from rust-sdks rename to livekit-rtc/rust-sdks diff --git a/setup.py b/livekit-rtc/setup.py similarity index 85% rename from setup.py rename to livekit-rtc/setup.py index b1831c1c..c56298f6 100644 --- a/setup.py +++ b/livekit-rtc/setup.py @@ -24,7 +24,7 @@ here = pathlib.Path(__file__).parent.resolve() about = {} -with open(os.path.join(here, 'livekit', 'version.py'), 'r') as f: +with open(os.path.join(here, 'livekit', 'rtc', 'version.py'), 'r') as f: exec(f.read(), about) @@ -40,8 +40,8 @@ class BuildPyCommand(setuptools.command.build_py.build_py): def run(self): download_script = here / 'rust-sdks' / 'download_ffi.py' - cmd = ['python3', download_script.absolute(), '--output', - 'livekit/resources'] + output = here / 'livekit' / 'rtc' / 'resources' + cmd = ['python3', str(download_script.absolute()), '--output', str(output.absolute())] # cibuildwheel is crosscompiling to arm64 on macos, make sure we download the # right binary (kind of a hack here...) @@ -49,18 +49,9 @@ def run(self): and "arm64" in os.environ.get("ARCHFLAGS", ""): cmd += ['--arch', 'arm64'] - subprocess.run(cmd, capture_output=True, check=True) + subprocess.run(cmd, check=True) setuptools.command.build_py.build_py.run(self) - -if platform.system() == "Linux": - libname = "liblivekit_ffi.so" -elif platform.system() == "Darwin": - libname = "liblivekit_ffi.dylib" -elif platform.system() == "Windows": - libname = "livekit_ffi.dll" - - setuptools.setup( name="livekit", version=about['__version__'], @@ -87,13 +78,13 @@ def run(self): ], keywords=["webrtc", "realtime", "audio", "video", "livekit"], license="Apache-2.0", - packages=["livekit"], + packages=setuptools.find_namespace_packages(include=['livekit.*']), python_requires=">=3.7.0", install_requires=["pyee>=11.0.0", "protobuf>=3.1.0", "types-protobuf>=3.1.0"], package_data={ - "livekit": [f'resources/{libname}', '_proto/*.py'], + "livekit.rtc": ['resources/*', '_proto/*.py'], }, project_urls={ "Documentation": "https://docs.livekit.io",