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

Seekable source #40

Merged
merged 8 commits into from
Aug 1, 2023
Merged

Seekable source #40

merged 8 commits into from
Aug 1, 2023

Conversation

varsill
Copy link
Contributor

@varsill varsill commented Jun 5, 2023

No description provided.

@varsill varsill marked this pull request as ready for review June 6, 2023 07:42
@varsill varsill requested a review from mat-hek June 6, 2023 07:42
Comment on lines 6 to 12
Can work in two modes, determined by the `seekable?` option.
With `seekable?: false`, the source will start reading data from the file exactly the moment it starts
playing and will read it till the end of file, setting the `end_of_stream` action on the `:output` pad
when the reading is done.
With `seekable?: true`, the process of reading is driven by receiving `Membrane.File.SeekSourceEvent` events.
The source working in `seekable?: true` mode won't send any data before that event is received.
For more information about how to steer reading in `seekable?: true` mode, see: `Membrane.File.SeekSourceEvent`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd only mention that its behaviour can be configured by the seekable option and put this in the option's description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

lib/membrane_file/seek_source_event.ex Show resolved Hide resolved
) do
@common_file.seek!(state.fd, seek_start)

{[event: {:output, %Membrane.File.NewSeekEvent{}}, redemand: :output],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's alias this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 134 to 142
if state.should_send_eos? and (state.size_to_read == 0 or supplied_size < to_supply_size) do
[end_of_stream: :output]
else
if to_supply_size == supplied_size do
redemand
else
[]
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert to cond

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mat-hek mat-hek self-requested a review August 1, 2023 08:54
@varsill varsill merged commit 732915d into master Aug 1, 2023
@varsill varsill deleted the seek_in_source branch August 1, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants