Skip to content
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

Merged
merged 11 commits into from
Jan 8, 2025

Conversation

osagie98
Copy link
Contributor

@osagie98 osagie98 commented Dec 11, 2024

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

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
@osagie98
Copy link
Contributor Author

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

@osagie98 osagie98 requested a review from borongc December 11, 2024 22:56
Copy link
Contributor

@sideb0ard sideb0ard left a 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

Copy link
Contributor

@andrewsavage1 andrewsavage1 left a comment

Choose a reason for hiding this comment

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

@osagie98 osagie98 requested a review from andrewsavage1 January 7, 2025 21:58
@osagie98 osagie98 requested a review from xiaomings January 7, 2025 22:11
@osagie98 osagie98 enabled auto-merge (squash) January 8, 2025 00:01
@osagie98 osagie98 merged commit 7a689b6 into youtube:main Jan 8, 2025
60 of 61 checks passed
Copy link
Contributor

@yell0wd0g yell0wd0g left a 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());
Copy link
Contributor

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?

Copy link
Contributor Author

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants