-
Notifications
You must be signed in to change notification settings - Fork 1
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
Seekable source #40
Conversation
…Rename SeekEvent into SeekSinkEvent.
… event and extend the moduledoc for source.
lib/membrane_file/source.ex
Outdated
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`. |
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'd only mention that its behaviour can be configured by the seekable
option and put this in the option's description
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_file/source.ex
Outdated
) do | ||
@common_file.seek!(state.fd, seek_start) | ||
|
||
{[event: {:output, %Membrane.File.NewSeekEvent{}}, redemand: :output], |
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 this
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_file/source.ex
Outdated
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 |
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.
convert to cond
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
No description provided.