mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Move media backend initialization to process startup.
This commit is contained in:
parent
17204544d9
commit
eebd831ea5
8 changed files with 12 additions and 11 deletions
|
@ -51,7 +51,6 @@ use servo_media::audio::context::{OfflineAudioContextOptions, RealTimeAudioConte
|
|||
use servo_media::audio::decoder::AudioDecoderCallbacks;
|
||||
use servo_media::audio::graph::NodeId;
|
||||
use servo_media::ServoMedia;
|
||||
use servo_media_auto::Backend;
|
||||
use std::cell::Cell;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::mem;
|
||||
|
@ -109,8 +108,6 @@ impl BaseAudioContext {
|
|||
},
|
||||
};
|
||||
|
||||
ServoMedia::init::<Backend>();
|
||||
|
||||
let context = BaseAudioContext {
|
||||
eventtarget: EventTarget::new_inherited(),
|
||||
audio_context_impl: ServoMedia::get()
|
||||
|
|
|
@ -72,7 +72,6 @@ use servo_config::pref;
|
|||
use servo_media::player::frame::{Frame, FrameRenderer};
|
||||
use servo_media::player::{PlaybackState, Player, PlayerError, PlayerEvent, StreamType};
|
||||
use servo_media::ServoMedia;
|
||||
use servo_media_auto::Backend;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
use std::collections::VecDeque;
|
||||
|
@ -276,7 +275,6 @@ pub enum ReadyState {
|
|||
|
||||
impl HTMLMediaElement {
|
||||
pub fn new_inherited(tag_name: LocalName, prefix: Option<Prefix>, document: &Document) -> Self {
|
||||
ServoMedia::init::<Backend>();
|
||||
Self {
|
||||
htmlelement: HTMLElement::new_inherited(tag_name, prefix, document),
|
||||
network_state: Cell::new(NetworkState::Empty),
|
||||
|
|
|
@ -17,7 +17,6 @@ use crate::dom::promise::Promise;
|
|||
use dom_struct::dom_struct;
|
||||
use servo_media::streams::capture::{Constrain, ConstrainRange, MediaTrackConstraintSet};
|
||||
use servo_media::ServoMedia;
|
||||
use servo_media_auto::Backend;
|
||||
use std::rc::Rc;
|
||||
|
||||
#[dom_struct]
|
||||
|
@ -27,7 +26,6 @@ pub struct MediaDevices {
|
|||
|
||||
impl MediaDevices {
|
||||
pub fn new_inherited() -> MediaDevices {
|
||||
ServoMedia::init::<Backend>();
|
||||
MediaDevices {
|
||||
eventtarget: EventTarget::new_inherited(),
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ use servo_media::webrtc::{
|
|||
SignalingState, WebRtcController, WebRtcSignaller,
|
||||
};
|
||||
use servo_media::ServoMedia;
|
||||
use servo_media_auto::Backend;
|
||||
|
||||
use std::cell::Cell;
|
||||
use std::rc::Rc;
|
||||
|
@ -159,7 +158,6 @@ impl RTCPeerConnection {
|
|||
RTCPeerConnectionBinding::Wrap,
|
||||
);
|
||||
let signaller = this.make_signaller();
|
||||
ServoMedia::init::<Backend>();
|
||||
*this.controller.borrow_mut() = Some(ServoMedia::get().unwrap().create_webrtc(signaller));
|
||||
if let Some(ref servers) = config.iceServers {
|
||||
if let Some(ref server) = servers.get(0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue