-
Notifications
You must be signed in to change notification settings - Fork 128
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
Implement SourceBuffer.writeHead attribute #4559
Conversation
This change implements a partial interface for SourceBuffer, adding the writeHead attribute. This attribute returns the highest buffer presentation timestamp written to the SbPlayer. The writeHead attribute is guarded by a Runtime Enabled Feature SourceBufferWriteHead. This feature is enabled by default for Cobalt builds and disabled for all other builds. Link to the original PR with most of the functional changes: youtube#121 b/326652276
Just realized that since the new interface is only included in Cobalt Starboard media builds, we may not need to guard it by a RuntimeEnabledFeature. I can remove that if needed |
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.
Looks pretty straight forward
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.
Ideally we'd add a web test for this in https://github.com/youtube/cobalt/tree/main/third_party/blink/web_tests/external/wpt/media-source/
third_party/blink/renderer/modules/mediasource/source_buffer_write_head.idl
Show resolved
Hide resolved
third_party/blink/web_tests/external/wpt/media-source/SourceBuffer-writeHead.html
Show resolved
Hide resolved
third_party/blink/web_tests/external/wpt/media-source/SourceBuffer-writeHead.html
Outdated
Show resolved
Hide resolved
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.
Drive-by! Sorry I got here late :)
#if BUILDFLAG(USE_STARBOARD_MEDIA) | ||
for (auto&& buffer : buffers) { | ||
if (!buffer->end_of_stream()) { | ||
write_head_ = std::max(write_head_, buffer->timestamp()); |
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.
Did we consider extending media/filters/chunk_demuxer_unittest.cc for the new behaviour?
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.
There's an existing bug to address this b/380001431, it's unblocked now so I'll be able to add tests for this and other ChunkDemuxer changes
|
||
[ | ||
ImplementedAs=SourceBufferWriteHead | ||
] partial interface SourceBuffer { |
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.
Since this is an interface extension, could we put it in a blink/renderer/modules/cobalt or some such? That way it'd make it easier down the line to identify all Cobalt Web Platform extensions.
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.
Sure, is that the practice we'll have going forward? I approached it how it would look if it were merged to Chrome.
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'm less sure about the right way to approach this change, because my understanding is that it's more likely to be upstreamed (and I think relatively soon?), so we actually wouldn't want it to be separate from the other changes. But maybe we want to always separate it out until it's actually accepted upstream as it may also change once it goes in upstream. I'll think about it and add it to go/cobalt-web-api-design
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.
Decided this should be in a cobalt-owned location in the discussion at https://docs.google.com/document/d/1RhlGcSINBxBkPeA45JAtkQHt9lrnkl7b1rYbQ2PFLCI/edit?resourcekey=0-OpkmEwqsdvkmlwC22Npjpw&tab=t.0#bookmark=id.pkppexmi8025
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 can move this as soon as we have a defined location for these interface changes to go
This change implements a partial interface for SourceBuffer, adding the writeHead attribute. This attribute returns the highest buffer presentation timestamp written to the Renderer. The writeHead attribute is only included in Cobalt Starboard media builds.
Link to the original PR with most of the functional changes: #121
b/326652276