S027: MSE DOM to spec (attach/detach, events through tasks, buffered/seekable, removeSourceBuffer, abort, changeType, sequence mode, object URLs per global, weak event sink, pref switch); gst_mse remove, abort, reset and appendWindowStart fixes; spec smoke cases and leak check
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
parent
49ed08cf06
commit
23964ea43f
1 changed files with 1866 additions and 229 deletions
|
|
@ -87,8 +87,58 @@ like Servo's player (appsink sinks, `download` flag, 500 MiB `buffer-size`). The
|
|||
15 runs failed while a smoke loop ran, 0 of 30 on an idle machine), so the evidence is Nacre's
|
||||
`tests/smoke/mse.txt` `?split` page: 10 of 10 played with the patch, against 6 stalls in 23 runs before it.
|
||||
|
||||
## 5. remove() is a stub (S027)
|
||||
|
||||
**What.** `gst_source_buffer_remove()` returned TRUE and removed nothing, so `buffered` never shrank and players that
|
||||
trim old media (YouTube does, to stay under quota) kept growing the buffer until eviction.
|
||||
|
||||
**Fix.** It removes, synchronously, every coded frame group (key frame to key frame) that lies inside `[start, end)`
|
||||
from every track buffer (`gst_media_source_track_buffer_remove_range`, the helper eviction already uses), then
|
||||
recomputes the size. A group that only overlaps the range stays, so no kept frame loses its key frame; the spec removes
|
||||
partial groups up to the next random access point, so Nacre keeps slightly more than a spec browser. Nacre's backend
|
||||
still reports `update`/`updateend` itself (the library signals nothing for a removal). **Test:** `/mse/remove`.
|
||||
|
||||
## 6. abort() breaks the source buffer (S027)
|
||||
|
||||
**What.** `gst_source_buffer_abort()` sent end-of-stream into the append pipeline's appsrc. Every later append then
|
||||
failed, so a page that aborted (on a seek, a quality switch, `changeType`) could never append again.
|
||||
|
||||
**Fix.** abort drops the pending data; if an append is inside the pipeline it waits for it (new `appending` /
|
||||
`abort_requested` flags and `append_done_cond`; the append task discards that append's result and signals nothing)
|
||||
and then runs the spec's "reset parser state" (`reset_parser_state_unlocked`, as the append error path does) and
|
||||
clears `updating`. The next append must start with an initialization segment (the reset forgets the old one; the spec
|
||||
keeps it). **Test:** `/mse/abort-then-append`.
|
||||
|
||||
## 7. Parser reset leaves the old appsinks in the append pipeline (S027)
|
||||
|
||||
**What.** `gst_append_pipeline_reset()` emptied its track list but left the tracks' appsinks in the bin. The next
|
||||
initialization segment named its appsink `video-0` again, `gst_bin_add()` refused the duplicate and freed it, and
|
||||
`add_track()` used the freed element: a crash on the first append after any reset (abort, changeType, append error).
|
||||
|
||||
**Fix.** The reset sets each old appsink to NULL and removes it from the bin first. **Test:** `/mse/abort-then-append`
|
||||
(abort after the init segment was parsed, then append; crashed before).
|
||||
|
||||
## 8. Track feeds keyed by object, not by track id (S027)
|
||||
|
||||
**What.** After a reset, the new initialization segment brings new `GstMediaSourceTrack` objects with the same ids.
|
||||
`track_buffers` is keyed by id and finds the existing buffer, but `track_feeds` used `g_direct_hash`, so the new
|
||||
samples hit `get_track_feed_unlocked: assertion ... failed` (fatal in the tests).
|
||||
|
||||
**Fix.** `track_feeds` uses the same id hash and equality as `track_buffers`, so samples after a reset reach the
|
||||
existing feeds and msesrc's streams. **Test:** `/mse/abort-then-append`.
|
||||
|
||||
## 9. appendWindowStart refuses every valid value (S027)
|
||||
|
||||
**What.** `gst_source_buffer_set_append_window_start()` failed when `start <= append_window_end`, the inverse of the
|
||||
spec's check, so any start below the end (all valid ones) gave a TYPE error. `SourceBuffer.abort()` resets the window
|
||||
to `0..+inf`, so it failed too.
|
||||
|
||||
**Fix.** The check is `start >= append_window_end` (an end of `GST_CLOCK_TIME_NONE` is +infinity in the unsigned
|
||||
compare). **Test:** `/mse/remove` sets the window.
|
||||
|
||||
## Found, not fixed here
|
||||
|
||||
- `gst_source_buffer_remove()` is a stub in 1.28.9: it returns TRUE, removes nothing and signals nothing. Nacre's
|
||||
backend (`vendor/servo-media-gstreamer/mse.rs`) reports the removal as finished itself so pages get `updateend`.
|
||||
Coded frame removal belongs in the library (follow-up).
|
||||
- `gst_source_buffer_change_content_type()` always fails (NotSupported). Nacre's backend accepts a change within the
|
||||
same container (parser reset, the next init segment may bring other codecs) and refuses another container.
|
||||
- `timestampOffset` is a `GstClockTime` in the API: negative offsets clamp to 0.
|
||||
- Duration: `gst_media_source_end_of_stream()` doesn't apply the spec's duration change; Nacre's DOM does.
|
||||
|
|
|
|||
Loading…
Reference in a new issue