Skip to content
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

Fix stream format #63

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/membrane_h264_plugin/h264_parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule Membrane.H264.Parser do
* `:au_aligned` - each input buffer contains a single access unit's payload

The parser's mode is set automatically, based on the input stream format received by that element:
* Receiving `%Membrane.RemoteStream{type: :bytestream}` results in the parser mode being set to `:bytestream`
* Receiving `Membrane.RemoteStream` results in the parser mode being set to `:bytestream`
* Receiving `%Membrane.H264{alignment: :nalu}` results in the parser mode being set to `:nalu_aligned`
* Receiving `%Membrane.H264{alignment: :au}` results in the parser mode being set to `:au_aligned`

Expand Down Expand Up @@ -57,7 +57,7 @@ defmodule Membrane.H264.Parser do

def_input_pad :input,
flow_control: :auto,
accepted_format: any_of(%RemoteStream{type: :bytestream}, H264)
accepted_format: any_of(RemoteStream, H264)

def_output_pad :output,
flow_control: :auto,
Expand Down Expand Up @@ -211,7 +211,7 @@ defmodule Membrane.H264.Parser do
def parse_raw_input_stream_structure(stream_format) do
{alignment, input_raw_stream_structure} =
case stream_format do
%RemoteStream{type: :bytestream} ->
%RemoteStream{} ->
{:bytestream, :annexb}

%H264{alignment: alignment, stream_structure: stream_structure} ->
Expand Down
6 changes: 3 additions & 3 deletions lib/membrane_h264_plugin/h265_parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Membrane.H265.Parser do
* `:au_aligned` - each input buffer contains a single access unit's payload

The parser's mode is set automatically, based on the input stream format received by that element:
* Receiving `%Membrane.RemoteStream{type: :bytestream}` results in the parser mode being set to `:bytestream`
* Receiving `Membrane.RemoteStream` results in the parser mode being set to `:bytestream`
* Receiving `%Membrane.H265{alignment: :nalu}` results in the parser mode being set to `:nalu_aligned`.
* Receiving `%Membrane.H265{alignment: :au}` results in the parser mode being set to `:au_aligned`.

Expand All @@ -43,7 +43,7 @@ defmodule Membrane.H265.Parser do

def_input_pad :input,
flow_control: :auto,
accepted_format: any_of(%RemoteStream{type: :bytestream}, H265)
accepted_format: any_of(RemoteStream, H265)

def_output_pad :output,
flow_control: :auto,
Expand Down Expand Up @@ -215,7 +215,7 @@ defmodule Membrane.H265.Parser do
def parse_raw_input_stream_structure(stream_format) do
{alignment, input_raw_stream_structure} =
case stream_format do
%RemoteStream{type: :bytestream} ->
%RemoteStream{} ->
{:bytestream, :annexb}

%H265{alignment: alignment, stream_structure: stream_structure} ->
Expand Down
4 changes: 2 additions & 2 deletions test/support/test_source.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Membrane.H26x.Support.TestSource do
flow_control: :push,
accepted_format:
any_of(
%Membrane.RemoteStream{type: :bytestream},
%Membrane.RemoteStream{type: :packetized},
%Membrane.H264{alignment: alignment} when alignment in [:au, :nalu],
%Membrane.H265{alignment: alignment} when alignment in [:au, :nalu]
)
Expand All @@ -36,7 +36,7 @@ defmodule Membrane.H26x.Support.TestSource do
stream_format =
case {state.codec, state.mode} do
{_codec, :bytestream} ->
%Membrane.RemoteStream{type: :bytestream}
%Membrane.RemoteStream{type: :packetized}

{:H264, :nalu_aligned} ->
%Membrane.H264{alignment: :nalu, stream_structure: state.output_raw_stream_structure}
Expand Down
Loading