Skip to content

Commit

Permalink
Merge branch 'setup-project' into create-encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Noarkhh committed Jun 27, 2024
2 parents 5b4a946 + 947e263 commit 3e26b10
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions lib/membrane_vpx/decoder/vpx_decoder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ defmodule Membrane.VPx.Decoder do

@type t :: %__MODULE__{
codec: :vp8 | :vp9,
codec_module: VP8 | VP9,
width: non_neg_integer() | nil,
height: non_neg_integer() | nil,
framerate: {non_neg_integer(), pos_integer()} | nil,
decoder_ref: reference() | nil
}

@enforce_keys [:codec, :codec_module, :width, :height, :framerate]
@enforce_keys [:codec, :width, :height, :framerate]
defstruct @enforce_keys ++
[
decoder_ref: nil
Expand All @@ -33,13 +32,6 @@ defmodule Membrane.VPx.Decoder do
opts
|> Map.take([:width, :height, :framerate])
|> Map.put(:codec, codec)
|> Map.put(
:codec_module,
case codec do
:vp8 -> VP8
:vp9 -> VP9
end
)

{[], struct(State, state_fields)}
end
Expand Down Expand Up @@ -80,11 +72,7 @@ defmodule Membrane.VPx.Decoder do
RawVideo.pixel_format(),
State.t()
) :: RawVideo.t()
defp get_output_stream_format(
input_stream_format,
pixel_format,
%State{codec_module: codec_module} = state
) do
defp get_output_stream_format(input_stream_format, pixel_format, state) do
{width, height, framerate} =
case input_stream_format do
%RemoteStream{} ->
Expand All @@ -94,7 +82,7 @@ defmodule Membrane.VPx.Decoder do
state.framerate
}

%^codec_module{width: width, height: height} ->
%{width: width, height: height} ->
{
width,
height,
Expand Down

0 comments on commit 3e26b10

Please sign in to comment.