Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHandle buffer offset in servosrc #239
Merged
Conversation
|
@ferjm r? |
Seeking requires a strict handling of each buffer offset. Though appsrc do some offset handling, but only for live stream (not seeking). When random-access is enabled the application must take care of marking each buffer offset correctly. This patch extends servosrc's method push_buffer() so it will count the current offset and stamps it on the pushed buffer. Also, it honors the buffer's block size defined in appsrc, splitting the input data in several buffers if it's bigger, fixing some problems with the buffering mechanism in playbin. When a seek operation is done, the current media offset must be updated with the requested position. As per media/player design, it is required that the user must push synchronized the data from the requested position by the seek.
Rather that "guess" when the source element has enough data in its adapter, let's just use the its signal to semaphore when to fail push_data() method.
|
Looks great. Thanks! r=me |
examples/player/player_wrapper.rs
Outdated
| .push_data(Vec::from(&buffer[0..size])) | ||
| { | ||
| println!("Can't push data: {:?}", e); | ||
| //break; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ceyusa
Apr 19, 2019
Author
Contributor
Actually it is a hack left behind. Let bring back the break if it is not a enough data.
|
@bors-servo r=ferjm |
|
|
bors-servo
added a commit
that referenced
this pull request
Apr 19, 2019
Handle buffer offset in servosrc Seeking requires a strict handling of each buffer offset. Though appsrc do some offset handling, but only for live stream (not seeking). When random-access is enabled the application must take care of marking each buffer offset correctly. This patch extends servosrc's method push_buffer() so it will count the current offset and stamps it on the pushed buffer. Also, it honors the buffer's block size defined in appsrc, splitting the input data in several buffers if it's bigger, fixing some problems with the buffering mechanism in playbin. When a seek operation is done, the current media offset must be updated with the requested position. As per media/player design, it is required that the user must push synchronized the data from the requested position by the seek.
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ceyusa commentedApr 18, 2019
Seeking requires a strict handling of each buffer offset. Though appsrc do some offset handling, but only for live stream (not seeking). When random-access is enabled the application must take care of marking each buffer offset correctly.
This patch extends servosrc's method push_buffer() so it will count the current offset and stamps it on the pushed buffer. Also, it honors the buffer's block size defined in appsrc, splitting the input data in several buffers if it's bigger, fixing some problems with the buffering mechanism in playbin.
When a seek operation is done, the current media offset must be updated with the requested position.
As per media/player design, it is required that the user must push synchronized the data from the requested position by the seek.