Skip to content

Commit

Permalink
Add support for egress ImageOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
biglittlebigben committed Feb 26, 2024
1 parent ae2ad16 commit c54c752
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions lib/livekit/egress_service_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def initialize(base_url, api_key: nil, api_secret: nil)

def start_room_composite_egress(
room_name,
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, or array containing up to one of each
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, ImageOutput or array containing up to one of each
output,
# EncodingOptionsPreset, only one of preset or advanced could be set
preset: nil,
Expand Down Expand Up @@ -50,7 +50,7 @@ def start_room_composite_egress(
def start_participant_egress(
room_name,
identity,
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, or array containing up to one of each
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, ImageOutput, or array containing up to one of each
output,
# true to record the participant's screenshare and screenshare_audio track
screen_share: false,
Expand All @@ -76,7 +76,7 @@ def start_participant_egress(

def start_track_composite_egress(
room_name,
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, or array containing up to one of each
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, ImageOutput, or array containing up to one of each
output,
# TrackID of an audio track
audio_track_id: nil,
Expand Down Expand Up @@ -126,7 +126,7 @@ def start_track_egress(

def start_web_egress(
url,
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, or array containing up to one of each
# EncodedFileOutput, SegmentedFileOutput, StreamOutput, ImageOutput, or array containing up to one of each
output,
# EncodingOptionsPreset, only one of preset or advanced could be set
preset: nil,
Expand Down Expand Up @@ -222,6 +222,9 @@ def set_output(request, output)
elsif out.is_a? Livekit::Proto::StreamOutput
raise "cannot add multiple stream outputs" if request.stream_outputs.any?
request.stream_outputs = Google::Protobuf::RepeatedField.new(:message, Proto::StreamOutput, [out])
elsif out.is_a? LiveKit::Proto::ImageOutput
raise "cannot add multiple image outputs" if request.image_outputs.any?
request.image_outputs = Google::Protobuf::RepeatedField.new(:message, Proto::ImageOutput, [out])
end
end
elsif output.is_a? LiveKit::Proto::EncodedFileOutput
Expand All @@ -233,6 +236,8 @@ def set_output(request, output)
elsif output.is_a? LiveKit::Proto::StreamOutput
request.stream = output
request.stream_outputs = Google::Protobuf::RepeatedField.new(:message, Proto::StreamOutput, [output])
elsif output.is_a? LiveKit::Proto::ImageOutput
request.image_outputs = Google::Protobuf::RepeatedField.new(:message, Proto::ImageOutput, [output])
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion protocol
Submodule protocol updated 136 files

0 comments on commit c54c752

Please sign in to comment.