livekit-server-sdk 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77f26a584a937bc38b3d303925f5e5119afa710751c98cc3e66daef682486635
4
- data.tar.gz: 6ef059111dbb04ba75c79dd753247b90cd18b636c060199c1e96e538e892c2ab
3
+ metadata.gz: e9c85210b0fa853c65cafa5b417c551fe14f7635a86c48b0143a53ff23064fec
4
+ data.tar.gz: 4c8abd79b0f363542106d6ddb557d07ea2ba09fd24213e83ad8d0a73ec58948e
5
5
  SHA512:
6
- metadata.gz: 80e8d8ce2fe6abbd2b7ea150ea2c6d0a5072713d47c554df5fc377724e2b5225efc436ea4a6e5c6c1b5b8e3e7363b5468433952562ec17bc64033a828776a989
7
- data.tar.gz: dd0e0edf976ce497fd07ea0aa315608099fa026ac3a7fddb798df1ad90c7f75dd0623a978fc0be7018d1ddc837db3805733a911dc1f755996c922a9cb8f81acf
6
+ metadata.gz: 985c491be79e895dd1d76b00b937a1cb69f054b9e00b1e56742690149899e2237c3f3931e5575bdc4dc7431dda2cf2d2e81ee78e1f79f67895448f9b0c6fceb3
7
+ data.tar.gz: ca786ab638a402357c00b5f756e76c9dcf7e18191312280898f50899e2a64dfd4eec76218c4ecd4c5467d808eb7685fe895ebddc48edb0304886e7c758c07641
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- livekit-server-sdk (0.2.2)
5
- google-protobuf (~> 3.19.2)
4
+ livekit-server-sdk (0.3.0)
5
+ google-protobuf (~> 3.21.0)
6
6
  jwt (~> 2.2.3)
7
7
  twirp (~> 1.9.0)
8
8
 
@@ -10,7 +10,7 @@ GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
12
  coderay (1.1.3)
13
- diff-lcs (1.4.4)
13
+ diff-lcs (1.5.0)
14
14
  faraday (1.10.0)
15
15
  faraday-em_http (~> 1.0)
16
16
  faraday-em_synchrony (~> 1.0)
@@ -27,42 +27,44 @@ GEM
27
27
  faraday-em_synchrony (1.0.0)
28
28
  faraday-excon (1.1.0)
29
29
  faraday-httpclient (1.0.1)
30
- faraday-multipart (1.0.3)
31
- multipart-post (>= 1.2, < 3)
30
+ faraday-multipart (1.0.4)
31
+ multipart-post (~> 2)
32
32
  faraday-net_http (1.0.1)
33
33
  faraday-net_http_persistent (1.2.0)
34
34
  faraday-patron (1.0.0)
35
35
  faraday-rack (1.0.0)
36
36
  faraday-retry (1.0.3)
37
- google-protobuf (3.19.4)
37
+ google-protobuf (3.21.1)
38
38
  jwt (2.2.3)
39
39
  method_source (1.0.0)
40
- multipart-post (2.1.1)
40
+ multipart-post (2.2.3)
41
41
  pry (0.14.1)
42
42
  coderay (~> 1.1)
43
43
  method_source (~> 1.0)
44
- pry-doc (1.1.0)
44
+ pry-doc (1.3.0)
45
45
  pry (~> 0.11)
46
46
  yard (~> 0.9.11)
47
47
  rake (13.0.6)
48
- rspec (3.10.0)
49
- rspec-core (~> 3.10.0)
50
- rspec-expectations (~> 3.10.0)
51
- rspec-mocks (~> 3.10.0)
52
- rspec-core (3.10.1)
53
- rspec-support (~> 3.10.0)
54
- rspec-expectations (3.10.1)
48
+ rspec (3.11.0)
49
+ rspec-core (~> 3.11.0)
50
+ rspec-expectations (~> 3.11.0)
51
+ rspec-mocks (~> 3.11.0)
52
+ rspec-core (3.11.0)
53
+ rspec-support (~> 3.11.0)
54
+ rspec-expectations (3.11.0)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.10.0)
57
- rspec-mocks (3.10.2)
56
+ rspec-support (~> 3.11.0)
57
+ rspec-mocks (3.11.1)
58
58
  diff-lcs (>= 1.2.0, < 2.0)
59
- rspec-support (~> 3.10.0)
60
- rspec-support (3.10.2)
59
+ rspec-support (~> 3.11.0)
60
+ rspec-support (3.11.0)
61
61
  ruby2_keywords (0.0.5)
62
62
  twirp (1.9.0)
63
63
  faraday (< 2)
64
64
  google-protobuf (~> 3.0, >= 3.7.0)
65
- yard (0.9.26)
65
+ webrick (1.7.0)
66
+ yard (0.9.28)
67
+ webrick (~> 1.7.0)
66
68
 
67
69
  PLATFORMS
68
70
  ruby
data/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -69,6 +69,49 @@ client.remove_participant(room: name, identity: 'participant')
69
69
  client.delete_room(room: name)
70
70
  ```
71
71
 
72
+ ### Egress Service
73
+
74
+ `EgressServiceClient` is a ruby client to EgressService. Refer to [docs](https://docs.livekit.io/guides/egress) for more usage examples
75
+
76
+ ```ruby
77
+ require 'livekit'
78
+
79
+ # starting a room composite to S3
80
+ const egressClient = LiveKit::EgressServiceClient.new(
81
+ "https://your-url",
82
+ api_key: 'key',
83
+ api_secret: 'secret'
84
+ );
85
+
86
+ info = egressClient.start_room_composite_egress(
87
+ 'room-name',
88
+ LiveKit::Proto::EncodedFileOutput.new(
89
+ file_type: LiveKit::Proto::EncodedFileType::MP4,
90
+ filepath: "my-recording.mp4",
91
+ s3: LiveKit::Proto::S3Upload.new(
92
+ access_key: 'access-key',
93
+ secret: 'secret',
94
+ region: 'bucket-region',
95
+ bucket: 'bucket'
96
+ )
97
+ )
98
+ )
99
+ puts info
100
+
101
+ # starting a track composite to RTMP
102
+ urls = Google::Protobuf::RepeatedField.new(:string, ['rtmp://url1', 'rtmps://url2'])
103
+ info = egressClient.start_track_composite_egress(
104
+ 'room-name',
105
+ LiveKit::Proto::StreamOutput.new(
106
+ protocol: LiveKit::Proto::StreamProtocol::RTMP,
107
+ urls: urls
108
+ ),
109
+ audio_track_id: 'TR_XXXXXXXXXXXX',
110
+ video_track_id: 'TR_XXXXXXXXXXXX'
111
+ )
112
+ puts info
113
+ ```
114
+
72
115
  ### Environment Variables
73
116
 
74
117
  You may store credentials in environment variables. If api-key or api-secret is not passed in when creating a `RoomServiceClient` or `AccessToken`, the values in the following env vars will be used:
@@ -78,4 +121,4 @@ You may store credentials in environment variables. If api-key or api-secret is
78
121
 
79
122
  ## License
80
123
 
81
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
124
+ The gem is available as open source under the terms of Apache 2.0 License.
data/Rakefile CHANGED
@@ -12,8 +12,8 @@ task :proto do
12
12
  "--ruby_out=lib/livekit/proto",
13
13
  "--twirp_ruby_out=lib/livekit/proto",
14
14
  "-Iprotocol",
15
+ "./protocol/livekit_egress.proto",
15
16
  "./protocol/livekit_models.proto",
16
- "./protocol/livekit_recording.proto",
17
17
  "./protocol/livekit_room.proto",
18
18
  "./protocol/livekit_webhook.proto")
19
19
  end
@@ -6,6 +6,7 @@ module LiveKit
6
6
  t = ::LiveKit::AccessToken.new(api_key: @api_key, api_secret: @api_secret)
7
7
  t.add_grant(video_grant)
8
8
  headers["Authorization"] = "Bearer #{t.to_jwt}"
9
+ headers["User-Agent"] = "LiveKit Ruby SDK"
9
10
  headers
10
11
  end
11
12
  end
@@ -0,0 +1,158 @@
1
+ require "livekit/proto/livekit_egress_twirp"
2
+ require "livekit/auth_mixin"
3
+
4
+ module LiveKit
5
+ class EgressServiceClient < Twirp::Client
6
+ client_for Proto::EgressService
7
+ include AuthMixin
8
+ attr_accessor :api_key, :api_secret
9
+
10
+ def initialize(base_url, api_key: nil, api_secret: nil)
11
+ super(File.join(base_url, "/twirp"))
12
+ @api_key = api_key
13
+ @api_secret = api_secret
14
+ end
15
+
16
+ def start_room_composite_egress(
17
+ room_name,
18
+ # one of EncodedFileOutput or StreamOutput
19
+ output,
20
+ # EncodingOptionsPreset, only one of preset or advanced could be set
21
+ preset: nil,
22
+ # EncodingOptions, only one of preset or advanced could be set
23
+ advanced: nil,
24
+ # egress template url, otherwise uses default templates
25
+ custom_base_url: nil,
26
+ # egress layout
27
+ layout: nil,
28
+ # true to record only audio
29
+ audio_only: false,
30
+ # true to record only video
31
+ video_only: false
32
+ )
33
+ request = Proto::RoomCompositeEgressRequest.new(
34
+ room_name: room_name,
35
+ preset: preset,
36
+ advanced: advanced,
37
+ layout: layout,
38
+ custom_base_url: custom_base_url,
39
+ audio_only: audio_only,
40
+ video_only: video_only,
41
+ )
42
+ self.set_output(request, output)
43
+ self.rpc(
44
+ :StartRoomCompositeEgress,
45
+ request,
46
+ headers: auth_header(roomRecord: true),
47
+ )
48
+ end
49
+
50
+ def start_track_composite_egress(
51
+ room_name,
52
+ # one of EncodedFileOutput or StreamOutput
53
+ output,
54
+ # TrackID of an audio track
55
+ audio_track_id: nil,
56
+ # TrackID of a video track
57
+ video_track_id: nil,
58
+ # EncodingOptionsPreset, only one of preset or advanced could be set
59
+ preset: nil,
60
+ # EncodingOptions, only one of preset or advanced could be set
61
+ advanced: nil
62
+ )
63
+ request = Proto::TrackCompositeEgressRequest.new(
64
+ room_name: room_name,
65
+ preset: preset,
66
+ advanced: advanced,
67
+ audio_track_id: audio_track_id,
68
+ video_track_id: video_track_id,
69
+ )
70
+ self.set_output(request, output)
71
+ self.rpc(
72
+ :StartTrackCompositeEgress,
73
+ request,
74
+ headers: auth_header(roomRecord: true),
75
+ )
76
+ end
77
+
78
+ def start_track_egress(
79
+ room_name,
80
+ # either a DirectFileOutput - egress to storage or string - egress to WebSocket URL
81
+ output,
82
+ track_id
83
+ )
84
+ request = Proto::TrackEgressRequest.new(
85
+ room_name: room_name,
86
+ track_id: track_id,
87
+ )
88
+ if output.filepath
89
+ request.file = output
90
+ else
91
+ request.websocket_url = output
92
+ end
93
+ self.rpc(
94
+ :StartTrackEgress,
95
+ request,
96
+ headers: auth_header(roomRecord: true),
97
+ )
98
+ end
99
+
100
+
101
+ def update_layout(egress_id, layout)
102
+ self.rpc(
103
+ :UpdateLayout,
104
+ Proto::UpdateLayoutRequest.new(
105
+ egress_id: egress_id,
106
+ layout: layout,
107
+ ),
108
+ headers: auth_header(roomRecord: true),
109
+ )
110
+ end
111
+
112
+ def update_stream(egress_id,
113
+ add_output_urls: [],
114
+ remove_output_urls: []
115
+ )
116
+ self.rpc(
117
+ :UpdateStream,
118
+ Proto::UpdateStreamRequest.new(
119
+ egress_id: egress_id,
120
+ add_output_urls: Google::Protobuf::RepeatedField.new(:string, add_output_urls.to_a),
121
+ remove_output_urls: Google::Protobuf::RepeatedField.new(:string, remove_output_urls.to_a),
122
+ ),
123
+ headers: auth_header(roomRecord: true),
124
+ )
125
+ end
126
+
127
+ # list all egress or only egress for a room
128
+ def list_egress(room_name: nil)
129
+ self.rpc(
130
+ :ListEgress,
131
+ Proto::ListEgressRequest.new(room_name: room_name),
132
+ headers: auth_header(roomRecord: true),
133
+ )
134
+ end
135
+
136
+ def stop_egress(egress_id)
137
+ self.rpc(
138
+ :StopEgress,
139
+ Proto::StopEgressRequest.new(egress_id: egress_id),
140
+ headers: auth_header(roomRecord: true),
141
+ )
142
+ end
143
+
144
+ private
145
+
146
+ # helper that sets output to file or stream
147
+ def set_output(request, output)
148
+ if output.nil?
149
+ raise "output cannot be nil"
150
+ end
151
+ if output.filepath
152
+ request.file = output
153
+ else
154
+ request.stream = output
155
+ end
156
+ end
157
+ end
158
+ end
File without changes
@@ -0,0 +1,203 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: livekit_egress.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("livekit_egress.proto", :syntax => :proto3) do
8
+ add_message "livekit.RoomCompositeEgressRequest" do
9
+ optional :room_name, :string, 1
10
+ optional :layout, :string, 2
11
+ optional :audio_only, :bool, 3
12
+ optional :video_only, :bool, 4
13
+ optional :custom_base_url, :string, 5
14
+ oneof :output do
15
+ optional :file, :message, 6, "livekit.EncodedFileOutput"
16
+ optional :stream, :message, 7, "livekit.StreamOutput"
17
+ end
18
+ oneof :options do
19
+ optional :preset, :enum, 8, "livekit.EncodingOptionsPreset"
20
+ optional :advanced, :message, 9, "livekit.EncodingOptions"
21
+ end
22
+ end
23
+ add_message "livekit.TrackCompositeEgressRequest" do
24
+ optional :room_name, :string, 1
25
+ optional :audio_track_id, :string, 2
26
+ optional :video_track_id, :string, 3
27
+ oneof :output do
28
+ optional :file, :message, 4, "livekit.EncodedFileOutput"
29
+ optional :stream, :message, 5, "livekit.StreamOutput"
30
+ end
31
+ oneof :options do
32
+ optional :preset, :enum, 6, "livekit.EncodingOptionsPreset"
33
+ optional :advanced, :message, 7, "livekit.EncodingOptions"
34
+ end
35
+ end
36
+ add_message "livekit.TrackEgressRequest" do
37
+ optional :room_name, :string, 1
38
+ optional :track_id, :string, 2
39
+ oneof :output do
40
+ optional :file, :message, 3, "livekit.DirectFileOutput"
41
+ optional :websocket_url, :string, 4
42
+ end
43
+ end
44
+ add_message "livekit.EncodedFileOutput" do
45
+ optional :file_type, :enum, 1, "livekit.EncodedFileType"
46
+ optional :filepath, :string, 2
47
+ oneof :output do
48
+ optional :s3, :message, 3, "livekit.S3Upload"
49
+ optional :gcp, :message, 4, "livekit.GCPUpload"
50
+ optional :azure, :message, 5, "livekit.AzureBlobUpload"
51
+ end
52
+ end
53
+ add_message "livekit.DirectFileOutput" do
54
+ optional :filepath, :string, 1
55
+ oneof :output do
56
+ optional :s3, :message, 2, "livekit.S3Upload"
57
+ optional :gcp, :message, 3, "livekit.GCPUpload"
58
+ optional :azure, :message, 4, "livekit.AzureBlobUpload"
59
+ end
60
+ end
61
+ add_message "livekit.S3Upload" do
62
+ optional :access_key, :string, 1
63
+ optional :secret, :string, 2
64
+ optional :region, :string, 3
65
+ optional :endpoint, :string, 4
66
+ optional :bucket, :string, 5
67
+ end
68
+ add_message "livekit.GCPUpload" do
69
+ optional :credentials, :bytes, 1
70
+ optional :bucket, :string, 2
71
+ end
72
+ add_message "livekit.AzureBlobUpload" do
73
+ optional :account_name, :string, 1
74
+ optional :account_key, :string, 2
75
+ optional :container_name, :string, 3
76
+ end
77
+ add_message "livekit.StreamOutput" do
78
+ optional :protocol, :enum, 1, "livekit.StreamProtocol"
79
+ repeated :urls, :string, 2
80
+ end
81
+ add_message "livekit.EncodingOptions" do
82
+ optional :width, :int32, 1
83
+ optional :height, :int32, 2
84
+ optional :depth, :int32, 3
85
+ optional :framerate, :int32, 4
86
+ optional :audio_codec, :enum, 5, "livekit.AudioCodec"
87
+ optional :audio_bitrate, :int32, 6
88
+ optional :audio_frequency, :int32, 7
89
+ optional :video_codec, :enum, 8, "livekit.VideoCodec"
90
+ optional :video_bitrate, :int32, 9
91
+ end
92
+ add_message "livekit.UpdateLayoutRequest" do
93
+ optional :egress_id, :string, 1
94
+ optional :layout, :string, 2
95
+ end
96
+ add_message "livekit.UpdateStreamRequest" do
97
+ optional :egress_id, :string, 1
98
+ repeated :add_output_urls, :string, 2
99
+ repeated :remove_output_urls, :string, 3
100
+ end
101
+ add_message "livekit.ListEgressRequest" do
102
+ optional :room_name, :string, 1
103
+ end
104
+ add_message "livekit.ListEgressResponse" do
105
+ repeated :items, :message, 1, "livekit.EgressInfo"
106
+ end
107
+ add_message "livekit.StopEgressRequest" do
108
+ optional :egress_id, :string, 1
109
+ end
110
+ add_message "livekit.EgressInfo" do
111
+ optional :egress_id, :string, 1
112
+ optional :room_id, :string, 2
113
+ optional :status, :enum, 3, "livekit.EgressStatus"
114
+ optional :started_at, :int64, 10
115
+ optional :ended_at, :int64, 11
116
+ optional :error, :string, 9
117
+ oneof :request do
118
+ optional :room_composite, :message, 4, "livekit.RoomCompositeEgressRequest"
119
+ optional :track_composite, :message, 5, "livekit.TrackCompositeEgressRequest"
120
+ optional :track, :message, 6, "livekit.TrackEgressRequest"
121
+ end
122
+ oneof :result do
123
+ optional :stream, :message, 7, "livekit.StreamInfoList"
124
+ optional :file, :message, 8, "livekit.FileInfo"
125
+ end
126
+ end
127
+ add_message "livekit.StreamInfoList" do
128
+ repeated :info, :message, 1, "livekit.StreamInfo"
129
+ end
130
+ add_message "livekit.StreamInfo" do
131
+ optional :url, :string, 1
132
+ optional :duration, :int64, 4
133
+ end
134
+ add_message "livekit.FileInfo" do
135
+ optional :filename, :string, 1
136
+ optional :duration, :int64, 6
137
+ optional :size, :int64, 4
138
+ optional :location, :string, 5
139
+ end
140
+ add_enum "livekit.EncodedFileType" do
141
+ value :DEFAULT_FILETYPE, 0
142
+ value :MP4, 1
143
+ value :OGG, 2
144
+ end
145
+ add_enum "livekit.StreamProtocol" do
146
+ value :DEFAULT_PROTOCOL, 0
147
+ value :RTMP, 1
148
+ end
149
+ add_enum "livekit.AudioCodec" do
150
+ value :DEFAULT_AC, 0
151
+ value :OPUS, 1
152
+ value :AAC, 2
153
+ end
154
+ add_enum "livekit.VideoCodec" do
155
+ value :DEFAULT_VC, 0
156
+ value :H264_BASELINE, 1
157
+ value :H264_MAIN, 2
158
+ value :H264_HIGH, 3
159
+ end
160
+ add_enum "livekit.EncodingOptionsPreset" do
161
+ value :H264_720P_30, 0
162
+ value :H264_720P_60, 1
163
+ value :H264_1080P_30, 2
164
+ value :H264_1080P_60, 3
165
+ end
166
+ add_enum "livekit.EgressStatus" do
167
+ value :EGRESS_STARTING, 0
168
+ value :EGRESS_ACTIVE, 1
169
+ value :EGRESS_ENDING, 2
170
+ value :EGRESS_COMPLETE, 3
171
+ end
172
+ end
173
+ end
174
+
175
+ module LiveKit
176
+ module Proto
177
+ RoomCompositeEgressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RoomCompositeEgressRequest").msgclass
178
+ TrackCompositeEgressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.TrackCompositeEgressRequest").msgclass
179
+ TrackEgressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.TrackEgressRequest").msgclass
180
+ EncodedFileOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EncodedFileOutput").msgclass
181
+ DirectFileOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.DirectFileOutput").msgclass
182
+ S3Upload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.S3Upload").msgclass
183
+ GCPUpload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.GCPUpload").msgclass
184
+ AzureBlobUpload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.AzureBlobUpload").msgclass
185
+ StreamOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StreamOutput").msgclass
186
+ EncodingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EncodingOptions").msgclass
187
+ UpdateLayoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UpdateLayoutRequest").msgclass
188
+ UpdateStreamRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UpdateStreamRequest").msgclass
189
+ ListEgressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ListEgressRequest").msgclass
190
+ ListEgressResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ListEgressResponse").msgclass
191
+ StopEgressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StopEgressRequest").msgclass
192
+ EgressInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EgressInfo").msgclass
193
+ StreamInfoList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StreamInfoList").msgclass
194
+ StreamInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StreamInfo").msgclass
195
+ FileInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.FileInfo").msgclass
196
+ EncodedFileType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EncodedFileType").enummodule
197
+ StreamProtocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StreamProtocol").enummodule
198
+ AudioCodec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.AudioCodec").enummodule
199
+ VideoCodec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.VideoCodec").enummodule
200
+ EncodingOptionsPreset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EncodingOptionsPreset").enummodule
201
+ EgressStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EgressStatus").enummodule
202
+ end
203
+ end
@@ -0,0 +1,23 @@
1
+ # Code generated by protoc-gen-twirp_ruby 1.9.0, DO NOT EDIT.
2
+ require 'twirp'
3
+ require_relative 'livekit_egress_pb.rb'
4
+
5
+ module LiveKit
6
+ module Proto
7
+ class EgressService < Twirp::Service
8
+ package 'livekit'
9
+ service 'Egress'
10
+ rpc :StartRoomCompositeEgress, RoomCompositeEgressRequest, EgressInfo, :ruby_method => :start_room_composite_egress
11
+ rpc :StartTrackCompositeEgress, TrackCompositeEgressRequest, EgressInfo, :ruby_method => :start_track_composite_egress
12
+ rpc :StartTrackEgress, TrackEgressRequest, EgressInfo, :ruby_method => :start_track_egress
13
+ rpc :UpdateLayout, UpdateLayoutRequest, EgressInfo, :ruby_method => :update_layout
14
+ rpc :UpdateStream, UpdateStreamRequest, EgressInfo, :ruby_method => :update_stream
15
+ rpc :ListEgress, ListEgressRequest, ListEgressResponse, :ruby_method => :list_egress
16
+ rpc :StopEgress, StopEgressRequest, EgressInfo, :ruby_method => :stop_egress
17
+ end
18
+
19
+ class EgressClient < Twirp::Client
20
+ client_for EgressService
21
+ end
22
+ end
23
+ end
@@ -3,6 +3,8 @@
3
3
 
4
4
  require 'google/protobuf'
5
5
 
6
+ require 'google/protobuf/timestamp_pb'
7
+
6
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
9
  add_file("livekit_models.proto", :syntax => :proto3) do
8
10
  add_message "livekit.Room" do
@@ -21,6 +23,13 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
21
23
  optional :mime, :string, 1
22
24
  optional :fmtp_line, :string, 2
23
25
  end
26
+ add_message "livekit.ParticipantPermission" do
27
+ optional :can_subscribe, :bool, 1
28
+ optional :can_publish, :bool, 2
29
+ optional :can_publish_data, :bool, 3
30
+ optional :hidden, :bool, 7
31
+ optional :recorder, :bool, 8
32
+ end
24
33
  add_message "livekit.ParticipantInfo" do
25
34
  optional :sid, :string, 1
26
35
  optional :identity, :string, 2
@@ -28,9 +37,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
37
  repeated :tracks, :message, 4, "livekit.TrackInfo"
29
38
  optional :metadata, :string, 5
30
39
  optional :joined_at, :int64, 6
31
- optional :hidden, :bool, 7
32
- optional :recorder, :bool, 8
33
40
  optional :name, :string, 9
41
+ optional :version, :uint32, 10
42
+ optional :permission, :message, 11, "livekit.ParticipantPermission"
43
+ optional :region, :string, 12
44
+ optional :is_publisher, :bool, 13
34
45
  end
35
46
  add_enum "livekit.ParticipantInfo.State" do
36
47
  value :JOINING, 0
@@ -38,6 +49,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
38
49
  value :ACTIVE, 2
39
50
  value :DISCONNECTED, 3
40
51
  end
52
+ add_message "livekit.SimulcastCodecInfo" do
53
+ optional :mime_type, :string, 1
54
+ optional :mid, :string, 2
55
+ optional :cid, :string, 3
56
+ repeated :layers, :message, 4, "livekit.VideoLayer"
57
+ end
41
58
  add_message "livekit.TrackInfo" do
42
59
  optional :sid, :string, 1
43
60
  optional :type, :enum, 2, "livekit.TrackType"
@@ -50,12 +67,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
50
67
  optional :source, :enum, 9, "livekit.TrackSource"
51
68
  repeated :layers, :message, 10, "livekit.VideoLayer"
52
69
  optional :mime_type, :string, 11
70
+ optional :mid, :string, 12
71
+ repeated :codecs, :message, 13, "livekit.SimulcastCodecInfo"
53
72
  end
54
73
  add_message "livekit.VideoLayer" do
55
74
  optional :quality, :enum, 1, "livekit.VideoQuality"
56
75
  optional :width, :uint32, 2
57
76
  optional :height, :uint32, 3
58
77
  optional :bitrate, :uint32, 4
78
+ optional :ssrc, :uint32, 5
59
79
  end
60
80
  add_message "livekit.DataPacket" do
61
81
  optional :kind, :enum, 1, "livekit.DataPacket.Kind"
@@ -85,6 +105,74 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
85
105
  optional :participant_sid, :string, 1
86
106
  repeated :track_sids, :string, 2
87
107
  end
108
+ add_message "livekit.ClientInfo" do
109
+ optional :sdk, :enum, 1, "livekit.ClientInfo.SDK"
110
+ optional :version, :string, 2
111
+ optional :protocol, :int32, 3
112
+ optional :os, :string, 4
113
+ optional :os_version, :string, 5
114
+ optional :device_model, :string, 6
115
+ optional :browser, :string, 7
116
+ optional :browser_version, :string, 8
117
+ optional :address, :string, 9
118
+ end
119
+ add_enum "livekit.ClientInfo.SDK" do
120
+ value :UNKNOWN, 0
121
+ value :JS, 1
122
+ value :SWIFT, 2
123
+ value :ANDROID, 3
124
+ value :FLUTTER, 4
125
+ value :GO, 5
126
+ value :UNITY, 6
127
+ end
128
+ add_message "livekit.ClientConfiguration" do
129
+ optional :video, :message, 1, "livekit.VideoConfiguration"
130
+ optional :screen, :message, 2, "livekit.VideoConfiguration"
131
+ optional :resume_connection, :enum, 3, "livekit.ClientConfigSetting"
132
+ end
133
+ add_message "livekit.VideoConfiguration" do
134
+ optional :hardware_encoder, :enum, 1, "livekit.ClientConfigSetting"
135
+ end
136
+ add_message "livekit.RTPStats" do
137
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
138
+ optional :end_time, :message, 2, "google.protobuf.Timestamp"
139
+ optional :duration, :double, 3
140
+ optional :packets, :uint32, 4
141
+ optional :packet_rate, :double, 5
142
+ optional :bytes, :uint64, 6
143
+ optional :bitrate, :double, 7
144
+ optional :packets_lost, :uint32, 8
145
+ optional :packet_loss_rate, :double, 9
146
+ optional :packet_loss_percentage, :float, 10
147
+ optional :packets_duplicate, :uint32, 11
148
+ optional :packet_duplicate_rate, :double, 12
149
+ optional :bytes_duplicate, :uint64, 13
150
+ optional :bitrate_duplicate, :double, 14
151
+ optional :packets_padding, :uint32, 15
152
+ optional :packet_padding_rate, :double, 16
153
+ optional :bytes_padding, :uint64, 17
154
+ optional :bitrate_padding, :double, 18
155
+ optional :packets_out_of_order, :uint32, 19
156
+ optional :frames, :uint32, 20
157
+ optional :frame_rate, :double, 21
158
+ optional :jitter_current, :double, 22
159
+ optional :jitter_max, :double, 23
160
+ map :gap_histogram, :int32, :uint32, 24
161
+ optional :nacks, :uint32, 25
162
+ optional :nack_acks, :uint32, 37
163
+ optional :nack_misses, :uint32, 26
164
+ optional :nack_repeated, :uint32, 38
165
+ optional :plis, :uint32, 27
166
+ optional :last_pli, :message, 28, "google.protobuf.Timestamp"
167
+ optional :firs, :uint32, 29
168
+ optional :last_fir, :message, 30, "google.protobuf.Timestamp"
169
+ optional :rtt_current, :uint32, 31
170
+ optional :rtt_max, :uint32, 32
171
+ optional :key_frames, :uint32, 33
172
+ optional :last_key_frame, :message, 34, "google.protobuf.Timestamp"
173
+ optional :layer_lock_plis, :uint32, 35
174
+ optional :last_layer_lock_pli, :message, 36, "google.protobuf.Timestamp"
175
+ end
88
176
  add_enum "livekit.TrackType" do
89
177
  value :AUDIO, 0
90
178
  value :VIDEO, 1
@@ -108,6 +196,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
108
196
  value :GOOD, 1
109
197
  value :EXCELLENT, 2
110
198
  end
199
+ add_enum "livekit.ClientConfigSetting" do
200
+ value :UNSET, 0
201
+ value :DISABLED, 1
202
+ value :ENABLED, 2
203
+ end
111
204
  end
112
205
  end
113
206
 
@@ -115,8 +208,10 @@ module LiveKit
115
208
  module Proto
116
209
  Room = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.Room").msgclass
117
210
  Codec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.Codec").msgclass
211
+ ParticipantPermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ParticipantPermission").msgclass
118
212
  ParticipantInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ParticipantInfo").msgclass
119
213
  ParticipantInfo::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ParticipantInfo.State").enummodule
214
+ SimulcastCodecInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.SimulcastCodecInfo").msgclass
120
215
  TrackInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.TrackInfo").msgclass
121
216
  VideoLayer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.VideoLayer").msgclass
122
217
  DataPacket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.DataPacket").msgclass
@@ -125,9 +220,15 @@ module LiveKit
125
220
  SpeakerInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.SpeakerInfo").msgclass
126
221
  UserPacket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UserPacket").msgclass
127
222
  ParticipantTracks = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ParticipantTracks").msgclass
223
+ ClientInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ClientInfo").msgclass
224
+ ClientInfo::SDK = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ClientInfo.SDK").enummodule
225
+ ClientConfiguration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ClientConfiguration").msgclass
226
+ VideoConfiguration = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.VideoConfiguration").msgclass
227
+ RTPStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RTPStats").msgclass
128
228
  TrackType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.TrackType").enummodule
129
229
  TrackSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.TrackSource").enummodule
130
230
  VideoQuality = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.VideoQuality").enummodule
131
231
  ConnectionQuality = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ConnectionQuality").enummodule
232
+ ClientConfigSetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ClientConfigSetting").enummodule
132
233
  end
133
234
  end
@@ -46,11 +46,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
46
46
  add_message "livekit.MuteRoomTrackResponse" do
47
47
  optional :track, :message, 1, "livekit.TrackInfo"
48
48
  end
49
- add_message "livekit.ParticipantPermission" do
50
- optional :can_subscribe, :bool, 1
51
- optional :can_publish, :bool, 2
52
- optional :can_publish_data, :bool, 3
53
- end
54
49
  add_message "livekit.UpdateParticipantRequest" do
55
50
  optional :room, :string, 1
56
51
  optional :identity, :string, 2
@@ -94,7 +89,6 @@ module LiveKit
94
89
  RemoveParticipantResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RemoveParticipantResponse").msgclass
95
90
  MuteRoomTrackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.MuteRoomTrackRequest").msgclass
96
91
  MuteRoomTrackResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.MuteRoomTrackResponse").msgclass
97
- ParticipantPermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.ParticipantPermission").msgclass
98
92
  UpdateParticipantRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UpdateParticipantRequest").msgclass
99
93
  UpdateSubscriptionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UpdateSubscriptionsRequest").msgclass
100
94
  UpdateSubscriptionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.UpdateSubscriptionsResponse").msgclass
@@ -4,6 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'livekit_models_pb'
7
+ require 'livekit_egress_pb'
7
8
  require 'livekit_recording_pb'
8
9
 
9
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
@@ -13,6 +14,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
13
14
  optional :room, :message, 2, "livekit.Room"
14
15
  optional :participant, :message, 3, "livekit.ParticipantInfo"
15
16
  optional :recording_info, :message, 5, "livekit.RecordingInfo"
17
+ optional :egress_info, :message, 9, "livekit.EgressInfo"
18
+ optional :track, :message, 8, "livekit.TrackInfo"
16
19
  optional :id, :string, 6
17
20
  optional :created_at, :int64, 7
18
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LiveKit
4
- VERSION = "0.2.2"
4
+ VERSION = "0.3.0"
5
5
  end
data/lib/livekit.rb CHANGED
@@ -9,3 +9,4 @@ require "livekit/version"
9
9
  # required since generated protobufs does use `require` instead of `require_relative`
10
10
  $LOAD_PATH.unshift(File.expand_path("livekit/proto", __dir__))
11
11
  require "livekit/room_service_client"
12
+ require "livekit/egress_service_client"
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  spec.summary = "LiveKit Server SDK for Ruby"
12
12
  spec.homepage = "https://livekit.io"
13
- spec.license = "MIT"
13
+ spec.license = "Apache-2.0"
14
14
  spec.required_ruby_version = ">= 2.6.0"
15
15
 
16
16
  # spec.metadata["homepage_uri"] = spec.homepage
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "google-protobuf", "~> 3.19.2"
29
+ spec.add_dependency "google-protobuf", "~> 3.21.0"
30
30
  spec.add_dependency "jwt", "~> 2.2.3"
31
31
  spec.add_dependency "twirp", "~> 1.9.0"
32
32
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livekit-server-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omri Gabay
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-05-16 00:00:00.000000000 Z
12
+ date: 2022-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-protobuf
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 3.19.2
20
+ version: 3.21.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 3.19.2
27
+ version: 3.21.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: jwt
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ files:
74
74
  - CODE_OF_CONDUCT.md
75
75
  - Gemfile
76
76
  - Gemfile.lock
77
- - LICENSE.txt
77
+ - LICENSE
78
78
  - README.md
79
79
  - Rakefile
80
80
  - bin/bootstrap.sh
@@ -95,11 +95,13 @@ files:
95
95
  - lib/livekit.rb
96
96
  - lib/livekit/access_token.rb
97
97
  - lib/livekit/auth_mixin.rb
98
+ - lib/livekit/egress_service_client.rb
99
+ - lib/livekit/egress_types.rb
98
100
  - lib/livekit/grants.rb
101
+ - lib/livekit/proto/livekit_egress_pb.rb
102
+ - lib/livekit/proto/livekit_egress_twirp.rb
99
103
  - lib/livekit/proto/livekit_models_pb.rb
100
104
  - lib/livekit/proto/livekit_models_twirp.rb
101
- - lib/livekit/proto/livekit_recording_pb.rb
102
- - lib/livekit/proto/livekit_recording_twirp.rb
103
105
  - lib/livekit/proto/livekit_room_pb.rb
104
106
  - lib/livekit/proto/livekit_room_twirp.rb
105
107
  - lib/livekit/proto/livekit_webhook_pb.rb
@@ -111,7 +113,7 @@ files:
111
113
  - livekit_server_sdk.gemspec
112
114
  homepage: https://livekit.io
113
115
  licenses:
114
- - MIT
116
+ - Apache-2.0
115
117
  metadata: {}
116
118
  post_install_message:
117
119
  rdoc_options: []
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2021 Omri Gabay
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,95 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: livekit_recording.proto
3
-
4
- require 'google/protobuf'
5
-
6
- require 'google/protobuf/empty_pb'
7
-
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("livekit_recording.proto", :syntax => :proto3) do
10
- add_message "livekit.StartRecordingRequest" do
11
- optional :options, :message, 5, "livekit.RecordingOptions"
12
- oneof :input do
13
- optional :url, :string, 1
14
- optional :template, :message, 2, "livekit.RecordingTemplate"
15
- end
16
- oneof :output do
17
- optional :rtmp, :message, 3, "livekit.RtmpOutput"
18
- optional :filepath, :string, 4
19
- end
20
- end
21
- add_message "livekit.RecordingTemplate" do
22
- optional :layout, :string, 1
23
- optional :room_name, :string, 2
24
- optional :base_url, :string, 3
25
- end
26
- add_message "livekit.RtmpOutput" do
27
- repeated :urls, :string, 1
28
- end
29
- add_message "livekit.RecordingOptions" do
30
- optional :preset, :enum, 1, "livekit.RecordingPreset"
31
- optional :width, :int32, 2
32
- optional :height, :int32, 3
33
- optional :depth, :int32, 4
34
- optional :framerate, :int32, 5
35
- optional :audio_bitrate, :int32, 6
36
- optional :audio_frequency, :int32, 7
37
- optional :video_bitrate, :int32, 8
38
- optional :profile, :string, 9
39
- end
40
- add_message "livekit.StartRecordingResponse" do
41
- optional :recording_id, :string, 1
42
- end
43
- add_message "livekit.AddOutputRequest" do
44
- optional :recording_id, :string, 1
45
- optional :rtmp_url, :string, 2
46
- end
47
- add_message "livekit.RemoveOutputRequest" do
48
- optional :recording_id, :string, 1
49
- optional :rtmp_url, :string, 2
50
- end
51
- add_message "livekit.EndRecordingRequest" do
52
- optional :recording_id, :string, 1
53
- end
54
- add_message "livekit.RecordingInfo" do
55
- optional :id, :string, 1
56
- optional :room_name, :string, 2
57
- optional :active, :bool, 3
58
- optional :error, :string, 4
59
- optional :file, :message, 5, "livekit.FileResult"
60
- repeated :rtmp, :message, 6, "livekit.RtmpResult"
61
- end
62
- add_message "livekit.FileResult" do
63
- optional :download_url, :string, 1
64
- optional :duration, :int64, 2
65
- end
66
- add_message "livekit.RtmpResult" do
67
- optional :stream_url, :string, 1
68
- optional :duration, :int64, 2
69
- end
70
- add_enum "livekit.RecordingPreset" do
71
- value :NONE, 0
72
- value :HD_30, 1
73
- value :HD_60, 2
74
- value :FULL_HD_30, 3
75
- value :FULL_HD_60, 4
76
- end
77
- end
78
- end
79
-
80
- module LiveKit
81
- module Proto
82
- StartRecordingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StartRecordingRequest").msgclass
83
- RecordingTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RecordingTemplate").msgclass
84
- RtmpOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RtmpOutput").msgclass
85
- RecordingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RecordingOptions").msgclass
86
- StartRecordingResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.StartRecordingResponse").msgclass
87
- AddOutputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.AddOutputRequest").msgclass
88
- RemoveOutputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RemoveOutputRequest").msgclass
89
- EndRecordingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.EndRecordingRequest").msgclass
90
- RecordingInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RecordingInfo").msgclass
91
- FileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.FileResult").msgclass
92
- RtmpResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RtmpResult").msgclass
93
- RecordingPreset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("livekit.RecordingPreset").enummodule
94
- end
95
- end
@@ -1,20 +0,0 @@
1
- # Code generated by protoc-gen-twirp_ruby 1.9.0, DO NOT EDIT.
2
- require 'twirp'
3
- require_relative 'livekit_recording_pb.rb'
4
-
5
- module LiveKit
6
- module Proto
7
- class RecordingServiceService < Twirp::Service
8
- package 'livekit'
9
- service 'RecordingService'
10
- rpc :StartRecording, StartRecordingRequest, StartRecordingResponse, :ruby_method => :start_recording
11
- rpc :AddOutput, AddOutputRequest, Google::Protobuf::Empty, :ruby_method => :add_output
12
- rpc :RemoveOutput, RemoveOutputRequest, Google::Protobuf::Empty, :ruby_method => :remove_output
13
- rpc :EndRecording, EndRecordingRequest, Google::Protobuf::Empty, :ruby_method => :end_recording
14
- end
15
-
16
- class RecordingServiceClient < Twirp::Client
17
- client_for RecordingServiceService
18
- end
19
- end
20
- end