Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bartkrak committed Aug 22, 2024
1 parent 2618977 commit 8ad0b56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions lib/boombox/pipeline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ defmodule Boombox.Pipeline do
output: opts |> Keyword.fetch!(:output) |> parse_output(),
status: :init
}
IO.inspect(state.input)

proceed(ctx, state)
end

Expand Down Expand Up @@ -272,10 +272,6 @@ defmodule Boombox.Pipeline do
defp create_input({:rtmp, src}, ctx) do
Boombox.RTMP.create_input(src, ctx.utility_supervisor)
end
defp create_input(any, ctx) do
IO.inspect(any)
# Boombox.RTMP.create_input(src, ctx.utility_supervisor)
end

@spec create_output(Boombox.output(), Membrane.Pipeline.CallbackContext.t()) ::
Ready.t() | Wait.t()
Expand Down
3 changes: 1 addition & 2 deletions lib/boombox/rtmp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ defmodule Boombox.RTMP do
alias Membrane.{RTMP, RTMPServer}

@spec create_input(String.t() | pid(), pid()) :: Wait.t()
def create_input(client_ref, utility_supervisor) when is_pid(client_ref) do
IO.puts("GOT PID #{inspect(client_ref)}")
def create_input(client_ref, _utility_supervisor) when is_pid(client_ref) do
handle_connection(client_ref)
end

Expand Down
9 changes: 3 additions & 6 deletions test/boombox_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,29 @@ defmodule BoomboxTest do
send(parent_process_pid, {:client_ref, client_ref, app, stream_key})
end

# start RTMP server to listen for connections
{:ok, server} =
Membrane.RTMPServer.start_link(
handler: %Membrane.RTMP.Source.ClientHandlerImpl{controlling_process: self()},
port: port,
use_ssl?: use_ssl?,
new_client_callback: new_client_callback,
client_timeout: 9_000
client_timeout: 1_000
)

# send RTMP stream
p = send_rtmp(url)

# wait for a client to connect
{:ok, client_ref} =
receive do
{:client_ref, client_ref, ^app, ^stream_key} ->
{:ok, client_ref}
after
10_000 -> :timeout
5_000 -> :timeout
end

# run boombox with client_ref
t = Task.async(fn -> Boombox.run(input: client_ref, output: output) end)
Task.await(t, 30_000)
Testing.Pipeline.terminate(p)
Process.exit(server, :normal)
Compare.compare(output, "test/fixtures/ref_bun10s_aac.mp4")
end

Expand Down

0 comments on commit 8ad0b56

Please sign in to comment.