-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
@impl true | ||
def handle_inputs_change( | ||
inputs, | ||
_ctx, | ||
%{screenShare?: true} = state | ||
) do | ||
{inputs, state} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be modified? Because if I understand correctly, it won't even work, because inputs aren't a Scene
struct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should have been removed but I missed it
defp get_desired_stream_format(1, output_stream_format) do | ||
output_stream_format | ||
end | ||
|
||
defp get_desired_stream_format(2, %{width: width, height: height}) do | ||
%{ | ||
width: round(1 / 2 * width) - @padding * 2, | ||
height: height - @padding * 2 | ||
} | ||
end | ||
|
||
defp get_desired_stream_format(3, %{width: width, height: height}) do | ||
%{ | ||
width: round(1 / 2 * width) - @padding * 2, | ||
height: round(1 / 2 * height) - @padding * 2 | ||
} | ||
end | ||
|
||
defp get_placement(desired_stream_format, 1, 0, input_stream_format, _output_stream_format) do | ||
%BaseVideoPlacement{ | ||
position: {0, 0}, | ||
size: scale(desired_stream_format, input_stream_format), | ||
z_value: @z_value | ||
} | ||
end | ||
|
||
defp get_placement(desired_stream_format, 2, index, input_stream_format, %{width: width}) do | ||
%BaseVideoPlacement{ | ||
position: {round(1 / 2 * width) * index + @padding, @padding}, | ||
size: scale(desired_stream_format, input_stream_format), | ||
z_value: @z_value | ||
} | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whay do you think about moving these functions on the end of the file?
defp get_cropping(desired_stream_format, scaled_stream_format), | ||
do: %Cropping{ | ||
crop_top_left_corner: get_cropping_position(desired_stream_format, scaled_stream_format), | ||
crop_size: get_cropping_size(desired_stream_format, scaled_stream_format), | ||
cropped_video_position: :input_position | ||
} | ||
|
||
defp get_cropping_position(desired_stream_format, {width, height}) do | ||
if desired_stream_format.width == width, | ||
do: {0.0, (height - desired_stream_format.height) / (2 * height)}, | ||
else: {(width - desired_stream_format.width) / (2 * width), 0.0} | ||
end | ||
|
||
defp get_cropping_size(desired_stream_format, {width, height}) do | ||
if desired_stream_format.width == width, | ||
do: {1.0, desired_stream_format.height / height}, | ||
else: {desired_stream_format.width / width, 1.0} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about creating a utils module where these functions could be moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is around 200 lines so I don't think that we have to split it into smaller parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, one test fails.
bdb76a6
to
a09c5da
Compare
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
+ Coverage 62.91% 63.11% +0.20%
==========================================
Files 44 40 -4
Lines 2130 2055 -75
==========================================
- Hits 1340 1297 -43
+ Misses 790 758 -32
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
42abd54
to
1827c5a
Compare
d8e4de7
to
481bb6d
Compare
481bb6d
to
e39e79f
Compare
No description provided.