Skip to content

Media player rendering with GL textures - #23483

Merged
bors-servo merged 31 commits into
servo:masterfrom
ceyusa:player-context
Jul 5, 2019
Merged

bors-servo merged 31 commits into
servo:masterfrom
ceyusa:player-context

Conversation

@ceyusa

@ceyusa ceyusa commented May 30, 2019 •

Copy link
Copy Markdown
Contributor

These patches pass the application's OpenGL raw context and the its native display address to the media player, in order to create an internal wrapped context, thus it will generate video frames as textures.

For now only EGL from glutin-based app and android are in place, though tested only in Linux glutin app.

This PR also renders the generated frame textures by Servo/Media and renders them by using a thread that connects Webrenderer's ExternalImageHandler and each instantiated player. By now, these patches, disable the WebGL rendering. We need to provide a ExternalImageHandler demuxer.

This PR depends on servo/media#270

In order to test it you must launch servo as

./mach run -- --pref media.glvideo.enabled [...]


This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @asajeffrey: components/constellation/pipeline.rs, components/constellation/constellation.rs, components/script/dom/htmlmediaelement.rs, components/script/script_thread.rs, components/script/dom/window.rs
  • @cbrewster: components/constellation/pipeline.rs, components/constellation/constellation.rs
  • @paulrouget: components/constellation/pipeline.rs, ports/glutin/context.rs, components/compositing/Cargo.toml, ports/glutin/headless_window.rs, components/constellation/constellation.rs and 4 more
  • @KiChjang: components/script/dom/htmlmediaelement.rs, components/script/script_thread.rs, components/script/dom/window.rs, components/script_traits/Cargo.toml, components/script_traits/lib.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 30, 2019
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #23485) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added the S-needs-rebase There are merge conflict errors. label May 31, 2019
@ceyusa
ceyusa force-pushed the player-context branch 2 times, most recently from 3e97f8a to 3e803e6 Compare June 4, 2019 15:47
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #23506) made this pull request unmergeable. Please resolve the merge conflicts.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #23517) made this pull request unmergeable. Please resolve the merge conflicts.

@jdm

jdm commented Jun 5, 2019

Copy link
Copy Markdown
Member

Is this waiting for review right now?

@ceyusa

ceyusa commented Jun 7, 2019

Copy link
Copy Markdown
Contributor Author

Is this waiting for review right now?

Is still a working progress :(

It would be great a glance to check if the sketched ideas make senss.

@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #23154) made this pull request unmergeable. Please resolve the merge conflicts.

@ceyusa
ceyusa force-pushed the player-context branch 2 times, most recently from d14bc2a to 2c3017a Compare June 10, 2019 17:31
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #23468) made this pull request unmergeable. Please resolve the merge conflicts.

@ceyusa ceyusa changed the title [WIP] Pass GL application parameters down to media player Media player rendering with GL textures Jun 15, 2019
@ceyusa
ceyusa force-pushed the player-context branch 3 times, most recently from 848f777 to 72e0941 Compare June 16, 2019 15:46
@ceyusa

ceyusa commented Jun 16, 2019

Copy link
Copy Markdown
Contributor Author

Ready for review :)

@ceyusa
ceyusa force-pushed the player-context branch 2 times, most recently from 23e9746 to 4748553 Compare June 17, 2019 11:39
@ceyusa ceyusa removed the S-needs-rebase There are merge conflict errors. label Jun 17, 2019
@ceyusa
ceyusa force-pushed the player-context branch 3 times, most recently from 1726eef to a5949a9 Compare June 18, 2019 17:25
@ferjm

ferjm commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

@bors-servo try=windows

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit f09661b with merge 802efcd...

bors-servo pushed a commit that referenced this pull request Jul 4, 2019
Media player rendering with GL textures

These patches pass the application's OpenGL raw context  and the its native display address to the media player, in order to create an internal wrapped context, thus it will generate video frames as textures.

For now only EGL from glutin-based app and android are in place, though tested only in Linux glutin app.

This PR also renders the generated frame textures by Servo/Media and renders them by using a thread that connects Webrenderer's ExternalImageHandler and each instantiated player. **By now, these patches, disable the WebGL rendering**. We need to provide a ExternalImageHandler demuxer.

This PR depends on servo/media#270

- [X]  `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- This PR fixes #22300 and fixes #22920

In order to test it you must launch servo as

`./mach run -- --pref media.glvideo.enabled [...]`

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23483)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 4, 2019
@jdm

jdm commented Jul 4, 2019

Copy link
Copy Markdown
Member

You can test the simpleservo changes locally using ./mach build -d --libsimpleservo.

@ferjm

ferjm commented Jul 4, 2019

Copy link
Copy Markdown
Contributor

Yes, that worked on my laptop (OSX)

~/dev/mozilla/servo player-context*
❯ ./mach build -d --libsimpleservo
   Compiling simpleservo v0.0.1 (/Users/ferjm/dev/mozilla/servo/ports/libsimpleservo/api)
   Compiling simpleservo_capi v0.0.1 (/Users/ferjm/dev/mozilla/servo/ports/libsimpleservo/capi)
    Finished dev [unoptimized + debuginfo] target(s) in 2m 41s
Build Completed in 0:02:41

@jdm
jdm force-pushed the player-context branch from f09661b to 23e4812 Compare July 4, 2019 21:10
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 4, 2019
@jdm

jdm commented Jul 4, 2019

Copy link
Copy Markdown
Member

@bors-servo try=windows

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 23e4812 with merge 7849457...

bors-servo pushed a commit that referenced this pull request Jul 4, 2019
Media player rendering with GL textures

These patches pass the application's OpenGL raw context  and the its native display address to the media player, in order to create an internal wrapped context, thus it will generate video frames as textures.

For now only EGL from glutin-based app and android are in place, though tested only in Linux glutin app.

This PR also renders the generated frame textures by Servo/Media and renders them by using a thread that connects Webrenderer's ExternalImageHandler and each instantiated player. **By now, these patches, disable the WebGL rendering**. We need to provide a ExternalImageHandler demuxer.

This PR depends on servo/media#270

- [X]  `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- This PR fixes #22300 and fixes #22920

In order to test it you must launch servo as

`./mach run -- --pref media.glvideo.enabled [...]`

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23483)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 4, 2019
@jdm
jdm force-pushed the player-context branch from 23e4812 to d9425b3 Compare July 4, 2019 22:01
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 4, 2019
@jdm

jdm commented Jul 4, 2019

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 5d30716 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 5d30716 with merge 320ec43...

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - status-taskcluster

@CYBAI

CYBAI commented Jul 5, 2019

Copy link
Copy Markdown
Member

In magicleap build:

error[E0560]: struct `simpleservo::InitOptions` has no field named `gl_context_points`
   --> ports/libmlservo/src/lib.rs:160:9
    |
160 |         gl_context_points: Some(gl.gl_context),
    |         ^^^^^^^^^^^^^^^^^ help: a field with a similar name exists: `gl_context_pointer`

error[E0560]: struct `simpleservo::InitOptions` has no field named `display`
   --> ports/libmlservo/src/lib.rs:161:9
    |
161 |         display: Some(gl.display),
    |         ^^^^^^^ `simpleservo::InitOptions` does not have this field
    |
    = note: available fields are: `args`, `url`, `coordinates`, `density`, `vr_init` ... and 3 others

error: aborting due to 2 previous errors

@jdm

jdm commented Jul 5, 2019

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4fe1291 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4fe1291 with merge 0dc17af...

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 0dc17af to master...

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.

Use new GL-based video playback Enable hardware accelerated video playback

7 participants