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 can_play_type for ServoMedia #232

Merged
merged 1 commit into from Apr 16, 2019
Merged

Implement can_play_type for ServoMedia #232

merged 1 commit into from Apr 16, 2019

Conversation

@georgeroman
Copy link
Contributor

@georgeroman georgeroman commented Apr 2, 2019

This is related to servo/servo#22299. I tried to follow WebKit's implementation of a similar function, as suggested by @ferjm in the issue's comments.

backends/gstreamer/src/lib.rs Outdated Show resolved Hide resolved
@ceyusa
Copy link
Contributor

@ceyusa ceyusa commented Apr 2, 2019

I would like rather to have a fixed list of mime-types that are possible to play in the web and check if the current gstreamer setup has support for them. Thus the backend won't traverse the whole gstreamer's registry per-call but rather a hash map to look up, just as in

https://github.com/WebKit/webkit/blob/0d960a0797d44e001af795b3d227be6b763fbbc0/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp#L2199

The return of the function perhaps should be an enum with Probably and Maybe

@ferjm
Copy link
Member

@ferjm ferjm commented Apr 3, 2019

Thanks for the PR, @georgeroman

I agree with @ceyusa, we should keep a list of mime-types that are supported on the web (we can get it from the WebKit's implementation that @ceyusa shared), lazily intersect that list with what's available in the GStreamer registry and cache the result of that intersection so subsequent calls to this function do not require traversing the entire registry again.

@philn
Copy link
Collaborator

@philn philn commented Apr 3, 2019

Please not the WebKit code linked here is obsolete, I implemented a new GstreamerRegistryScanner for media-capabilities support, it's used for canPlayType and the media-capabilities spec platform support.

@georgeroman
Copy link
Contributor Author

@georgeroman georgeroman commented Apr 5, 2019

I added some of the requested changes. I would really appreciate some feedback to see whether I'm heading in the right direction with this!

Copy link
Member

@ferjm ferjm left a comment

Great work! LGTM. I would like @ceyusa to take a second look though. Thanks!

backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
ferjm
ferjm approved these changes Apr 11, 2019
Copy link
Member

@ferjm ferjm left a comment

Thanks!

backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
ferjm
ferjm approved these changes Apr 12, 2019
Copy link
Member

@ferjm ferjm left a comment

Nice! Just a couple of small changes more and this should be ready to merge. Thanks!

backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
backends/gstreamer/lib.rs Outdated Show resolved Hide resolved
@ferjm
Copy link
Member

@ferjm ferjm commented Apr 16, 2019

Looks great! Thanks @georgeroman

@bors-servo r+

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 16, 2019

📌 Commit caebc22 has been approved by ferjm

@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 16, 2019

Testing commit caebc22 with merge 5462b05...

bors-servo added a commit that referenced this issue Apr 16, 2019
Implement can_play_type for ServoMedia

This is related to servo/servo#22299. I tried to follow WebKit's [implementation](https://github.com/WebKit/webkit/blob/ae5a8bdded113530fe844e01ad9c0e72ce85dbe2/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp#L304) of a similar function, as suggested by @ferjm in the issue's comments.
@bors-servo
Copy link
Contributor

@bors-servo bors-servo commented Apr 16, 2019

☀️ Test successful - checks-travis
Approved by: ferjm
Pushing 5462b05 to master...

@bors-servo bors-servo merged commit caebc22 into servo:master Apr 16, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants