Skip to content
This repository was archived by the owner on Apr 23, 2026. It is now read-only.

Pass precise position timestamp within PlayerEvent#460

Merged
jdm merged 1 commit into
servo:mainfrom
tharkum:gstreamer-precise-position-timestamps
Nov 12, 2025
Merged

Pass precise position timestamp within PlayerEvent#460
jdm merged 1 commit into
servo:mainfrom
tharkum:gstreamer-precise-position-timestamps

Conversation

@tharkum
Copy link
Copy Markdown
Contributor

@tharkum tharkum commented Nov 11, 2025

The following PlayerEvent::PositionChanged/SeekDone events should contains the precise position timestamps to pass them to back to client, otherwise there are no possibility to identify timestamp changes between two PositionChanged events on the client side.

gst (5.104499333) -> servo (5)
gst (5.153333333) -> servo (5)

@tharkum
Copy link
Copy Markdown
Contributor Author

tharkum commented Nov 11, 2025

@jdm @sdroege < Please take a look. Thanks

Comment thread player/lib.rs
Comment on lines 78 to +80
SeekData(u64, SeekLock),
/// The player has performed a seek to the given offset.
SeekDone(u64),
SeekDone(f64),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These two types should probably be kept in sync?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually no, for SeekData offset in bytes (ServoSource), while for SeekDone in seconds (GstPlay)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh I see. Probably a good idea to document that so the next person is not as confused as me :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes all sense to me otherwise, I'd just document the units of all those integers (or use proper types for that)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Please take a look

tharkum added a commit to tharkum/servo that referenced this pull request Nov 11, 2025
Align the `PlayerEvent::PositionChanged/SeekDone` events
to support precise position timestamps (u64 -> f64).

Also set precise HTMLMediaElement `duration` value
(seconds with fractional part) from metadata `duration`.

servo-media:
- Pass precise position timestamp within PlayerEvent (servo/media#460)

Testing: No expected changes in test results

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
The following `PlayerEvent::PositionChanged/SeekDone` events
should contains the precise position timestamps to pass them
to back to client, otherwise there are no possibility to
identify timestamp changes between two `PositionChanged` events
on the client side.

gst (5.104499333) -> servo (5)
gst (5.153333333) -> servo (5)

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
@tharkum tharkum force-pushed the gstreamer-precise-position-timestamps branch from abeb3b3 to 7e02bd4 Compare November 11, 2025 14:07
@jdm jdm added this pull request to the merge queue Nov 11, 2025
@jdm jdm removed this pull request from the merge queue due to a manual request Nov 11, 2025
@jdm
Copy link
Copy Markdown
Member

jdm commented Nov 11, 2025

Actually I'll wait to merge until the Servo PR is ready.

@tharkum
Copy link
Copy Markdown
Contributor Author

tharkum commented Nov 11, 2025

The servo PR is ready (I marked it as draft until media PR will be merged).
Need to have the valid media commit hash, to update Cargo.lock

@Gae24
Copy link
Copy Markdown

Gae24 commented Nov 11, 2025

The servo PR is ready (I marked it as draft until media PR will be merged). Need to have the valid media commit hash, to update Cargo.lock

One usually patch a dependency to point to the open pr branch, to confirm everything is fine from the Servo side.

@tharkum
Copy link
Copy Markdown
Contributor Author

tharkum commented Nov 12, 2025

The servo PR is ready (I marked it as draft until media PR will be merged). Need to have the valid media commit hash, to update Cargo.lock

One usually patch a dependency to point to the open pr branch, to confirm everything is fine from the Servo side.

Thanks for information (never did it with cargo + github)

tharkum added a commit to tharkum/servo that referenced this pull request Nov 12, 2025
Updated the `PlayerEvent::PositionChanged/SeekDone` events
to support precise position timestamps (u64 -> f64).

Also set precise time value (seconds with fractional part)
for the HTMLMediaElement `duration` from media metadata
to sync with `PlayerEvent` changes.

servo-media:
- Pass precise position timestamp within PlayerEvent (servo/media#460)

Testing: No expected changes in test results

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
@tharkum
Copy link
Copy Markdown
Contributor Author

tharkum commented Nov 12, 2025

@jdm < Linux WPT results with this servo-media PR (servo/servo#40563 (comment))

Patched servo-media with gstreamer-precise-position-timestamps branch: link

@jdm jdm added this pull request to the merge queue Nov 12, 2025
Merged via the queue into servo:main with commit 8aca9f7 Nov 12, 2025
3 checks passed
@tharkum tharkum deleted the gstreamer-precise-position-timestamps branch November 12, 2025 13:11
tharkum added a commit to tharkum/servo that referenced this pull request Nov 12, 2025
Updated the `PlayerEvent::PositionChanged/SeekDone` events
to support precise position timestamps (u64 -> f64).

Also set precise time value (seconds with fractional part)
for the HTMLMediaElement `duration` from media metadata
to sync with `PlayerEvent` changes.

servo-media:
- Pass precise position timestamp within PlayerEvent (servo/media#460)

Testing: No expected changes in test results

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Nov 12, 2025
Updated the `PlayerEvent::PositionChanged/SeekDone` events to support
precise position timestamps (u64 -> f64).
    
Also set precise time value (seconds with fractional part) for the
HTMLMediaElement `duration` from media metadata to sync with
`PlayerEvent` changes.

servo-media:
- Pass precise position timestamp within PlayerEvent
(servo/media#460)

Testing: No expected changes in test results

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
github-merge-queue Bot pushed a commit to servo/servo that referenced this pull request Nov 12, 2025
Updated the `PlayerEvent::PositionChanged/SeekDone` events to support
precise position timestamps (u64 -> f64).
    
Also set precise time value (seconds with fractional part) for the
HTMLMediaElement `duration` from media metadata to sync with
`PlayerEvent` changes.

servo-media:
- Pass precise position timestamp within PlayerEvent
(servo/media#460)

Testing: No expected changes in test results

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
tharkum added a commit to tharkum/servo-media that referenced this pull request Nov 20, 2025
Buffered ranges from the gstreamer backend must contain
the precise position timestamps (not rounded to the nearest
second).

Continuation servo#460

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
github-merge-queue Bot pushed a commit that referenced this pull request Nov 20, 2025
Buffered ranges from the gstreamer backend must contain
the precise position timestamps (not rounded to the nearest
second).

Continuation #460

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants