-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RTP Muxer #173
Open
Noarkhh
wants to merge
17
commits into
rtp-demuxer
Choose a base branch
from
rtp-muxer
base: rtp-demuxer
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
RTP Muxer #173
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e08c824
Start working on the muxer
Noarkhh 0aed32c
Add working test
Noarkhh f784097
WIP
Noarkhh 13bce85
Add demuxer_muxer test
Noarkhh 5a54e7f
Remove muxer_demuxer test
Noarkhh f0f7956
Improve demuxer_muxer_test
Noarkhh 2e99376
Satisfy credo
Noarkhh 7788973
Satisfy credo
Noarkhh 03c2afb
Adapt to new resolve return type
Noarkhh 66db5f7
Adjust test
Noarkhh d449441
Bump version
Noarkhh c994a1c
Remove unused deps
Noarkhh 3c4c797
Remove an unused field from State
Noarkhh 02c5615
Restore removed deps
Noarkhh 2f6849d
Apply reviewers suggestion
Noarkhh 4ae7c63
Add muxer demuxer test
Noarkhh e996f96
Apply reviewers suggestion
Noarkhh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have a test where we demux and mux packets two times and check if we get the same results? That would need to happen on a stream that's already past the jitter buffer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
defmodule Membrane.RTP.MuxerDemuxerTest do | ||
@moduledoc false | ||
use ExUnit.Case | ||
import Membrane.Testing.Assertions | ||
alias Membrane.RTP | ||
alias Membrane.Testing | ||
|
||
@input_path "test/fixtures/rtp/h264/bun.h264" | ||
|
||
defmodule MuxerDemuxerPipeline do | ||
use Membrane.Pipeline | ||
|
||
@impl true | ||
def handle_init(_ctx, opts) do | ||
%{clock_rate: clock_rate} = RTP.PayloadFormat.resolve(encoding_name: :H264) | ||
|
||
spec = [ | ||
child(:source, %Membrane.File.Source{location: opts.input_path}) | ||
|> child(:h264_parser, %Membrane.H264.Parser{ | ||
output_alignment: :nalu, | ||
generate_best_effort_timestamps: %{framerate: {30, 1}} | ||
}) | ||
|> child(:rtp_h264_payloader, Membrane.RTP.H264.Payloader) | ||
|> via_in(:input, options: [encoding: :H264]) | ||
|> child(:rtp_muxer, Membrane.RTP.Muxer) | ||
|> child(:rtp_demuxer, Membrane.RTP.Demuxer) | ||
|> via_out(:output, options: [stream_id: {:encoding_name, :H264}]) | ||
|> child(:jitter_buffer, %Membrane.RTP.JitterBuffer{clock_rate: clock_rate}) | ||
|> child(:rtp_h264_depayloader, Membrane.RTP.H264.Depayloader) | ||
|> child(:sink, %Membrane.File.Sink{location: opts.output_path}) | ||
] | ||
|
||
{[spec: spec], %{}} | ||
end | ||
end | ||
|
||
@tag :tmp_dir | ||
test "Muxed and demuxed stream is the same as unchanged one", %{tmp_dir: tmp_dir} do | ||
output_path = Path.join(tmp_dir, "output.h264") | ||
|
||
pipeline = | ||
Testing.Pipeline.start_supervised!( | ||
module: MuxerDemuxerPipeline, | ||
custom_args: %{input_path: @input_path, output_path: output_path} | ||
) | ||
|
||
assert_start_of_stream(pipeline, :sink) | ||
assert_end_of_stream(pipeline, :sink) | ||
|
||
assert File.read!(@input_path) == File.read!(output_path) | ||
|
||
Testing.Pipeline.terminate(pipeline) | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The first line is used as a short description