mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
libservo: Move GL acclerated media setup out of RenderingContext
and simplify it (#35553)
This moves the GL accelerated media setup out of `RenderingContext` which prevents making libservo dependo on the Wayland and X11 versions of surfman explicitly. This support is experimental and (honestly) a bit broken. I've confirmed that this works as well as it did before the change. The main thing here is that the configuration, which currently needs surfman types, moves to servoshell. In addition: 1. Instead of passing the information to the Constellation, the setup is stored statically. This is necessary to avoid introducing a dependency on `media` in `webrender_traits`. It's quite likely that `media` types should move to the internal embedding API to avoid this. This is preserved for a followup change. 2. The whole system of wrapping the media channels in an abstract type is removed. They could be either mpsc channels or IPC channels. This was never going to work because mpsc channels cannot be serialized and deserialized with serde. Instead this just uses IPC channels. We also have other ways of doing this kind of abstraction in Servo so we do not need another. The `mpsc` version was hard-coded to be disabled. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
9887ad369d
commit
5465bfc2af
15 changed files with 226 additions and 469 deletions
|
@ -6,11 +6,11 @@ use std::sync::{Arc, Mutex};
|
|||
use std::thread;
|
||||
|
||||
use fnv::FnvHashMap;
|
||||
use ipc_channel::ipc::{channel, IpcSender};
|
||||
use log::{trace, warn};
|
||||
use webrender_api::ExternalImageId;
|
||||
use webrender_traits::{WebrenderExternalImageRegistry, WebrenderImageHandlerType};
|
||||
|
||||
use crate::media_channel::{glplayer_channel, GLPlayerSender};
|
||||
/// GL player threading API entry point that lives in the
|
||||
/// constellation.
|
||||
use crate::{GLPlayerMsg, GLPlayerMsgForward};
|
||||
|
@ -19,7 +19,7 @@ use crate::{GLPlayerMsg, GLPlayerMsgForward};
|
|||
/// a set of video players with GL render.
|
||||
pub struct GLPlayerThread {
|
||||
/// Map of live players.
|
||||
players: FnvHashMap<u64, GLPlayerSender<GLPlayerMsgForward>>,
|
||||
players: FnvHashMap<u64, IpcSender<GLPlayerMsgForward>>,
|
||||
/// List of registered webrender external images.
|
||||
/// We use it to get an unique ID for new players.
|
||||
external_images: Arc<Mutex<WebrenderExternalImageRegistry>>,
|
||||
|
@ -35,8 +35,8 @@ impl GLPlayerThread {
|
|||
|
||||
pub fn start(
|
||||
external_images: Arc<Mutex<WebrenderExternalImageRegistry>>,
|
||||
) -> GLPlayerSender<GLPlayerMsg> {
|
||||
let (sender, receiver) = glplayer_channel::<GLPlayerMsg>().unwrap();
|
||||
) -> IpcSender<GLPlayerMsg> {
|
||||
let (sender, receiver) = channel().unwrap();
|
||||
thread::Builder::new()
|
||||
.name("GLPlayer".to_owned())
|
||||
.spawn(move || {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue