-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement non_fast_start optimization in MP4 ISOM demuxer. #73
Conversation
…he non_fast_start optimization. Change the File.SeekEvent into File.SeekSinkEvent.
…e_mp4_plugin into non_fast_start_demuxer
…orks properly with fast_start files. Fix a bug
…ramework/membrane_mp4_plugin into non_fast_start_demuxer
lib/membrane_mp4/demuxer/isom.ex
Outdated
def handle_demand( | ||
Pad.ref(:output, _track_id), | ||
_size, | ||
:buffers, | ||
_ctx, | ||
state | ||
) do | ||
{[], state} | ||
end | ||
|
||
def handle_process( | ||
:input, | ||
_buffer, | ||
_ctx, | ||
%{ | ||
fsm_state: fsm_state | ||
} = state | ||
) | ||
when fsm_state in [:mdat_skipping, :going_back_to_mdat] do |
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 formatting got quite bulky here
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.
I have improved it, done
lib/membrane_mp4/demuxer/isom.ex
Outdated
{[], state} | ||
def handle_event( | ||
:input, | ||
%Membrane.File.NewSeekEvent{}, |
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.
let's alias it
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.
done
lib/membrane_mp4/demuxer/isom.ex
Outdated
end | ||
|
||
defp handle_non_fast_start_optimization(%{fsm_state: :go_back_to_mdat} = state) do | ||
seek(state, state.mdat_beginning, state.mdat_size + @header_size, true) |
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.
seek(state, state.mdat_beginning, state.mdat_size + @header_size, true) | |
seek(state, state.mdat_beginning, state.mdat_size + @header_size, false) |
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.
done
lib/membrane_mp4/demuxer/isom.ex
Outdated
end | ||
end | ||
|
||
defp update_fsm_state(state) do |
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.
as we discussed, add the context argument
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.
done
… the formating less bulky
def handle_process( | ||
:input, | ||
_buffer, | ||
_ctx, | ||
%{ | ||
fsm_state: fsm_state | ||
} = state | ||
) | ||
when fsm_state in [:mdat_skipping, :going_back_to_mdat] do | ||
{[demand: :input], state} | ||
end | ||
|
||
@impl true | ||
def handle_process( | ||
:input, | ||
buffer, | ||
ctx, | ||
%{all_pads_connected?: true, samples_info: %SamplesInfo{}} = state | ||
%{ | ||
fsm_state: :samples_info_present_and_all_pads_connected | ||
} = state |
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.
fix formatting
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.
as discussed
lib/membrane_mp4/demuxer/isom.ex
Outdated
end | ||
end | ||
|
||
defp update_fsm_state(state, ctx \\ []) do |
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.
Context could be just an atom, a keyword list is overkill IMO. But do as you prefer
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.
done
We need to wait until membraneframework/membrane_file_plugin#40 is merged and new version of membrane_file_plugin is released, so that we can change the deps in this PR |
…s with formats versions. Remove `blocking?: true` from `Pipeline.terminate`
No description provided.