mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update servo-media: handle decoder errors and use safer/nicer player API
This commit is contained in:
parent
e31339245c
commit
0db628028a
3 changed files with 10 additions and 11 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -3224,7 +3224,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "servo-media"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#e700a0834c3f38d49890d846591fd699e7405a48"
|
||||
source = "git+https://github.com/servo/media#d1524d451cb0493f40000daf4f2a58f59b535ffa"
|
||||
dependencies = [
|
||||
"servo-media-audio 0.1.0 (git+https://github.com/servo/media)",
|
||||
"servo-media-gstreamer 0.1.0 (git+https://github.com/servo/media)",
|
||||
|
@ -3234,11 +3234,12 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "servo-media-audio"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#e700a0834c3f38d49890d846591fd699e7405a48"
|
||||
source = "git+https://github.com/servo/media#d1524d451cb0493f40000daf4f2a58f59b535ffa"
|
||||
dependencies = [
|
||||
"boxfnonce 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byte-slice-cast 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"euclid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3250,7 +3251,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "servo-media-gstreamer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#e700a0834c3f38d49890d846591fd699e7405a48"
|
||||
source = "git+https://github.com/servo/media#d1524d451cb0493f40000daf4f2a58f59b535ffa"
|
||||
dependencies = [
|
||||
"byte-slice-cast 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3268,7 +3269,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "servo-media-player"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#e700a0834c3f38d49890d846591fd699e7405a48"
|
||||
source = "git+https://github.com/servo/media#d1524d451cb0493f40000daf4f2a58f59b535ffa"
|
||||
dependencies = [
|
||||
"ipc-channel 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3364,7 +3365,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "servo_media_derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/servo/media#e700a0834c3f38d49890d846591fd699e7405a48"
|
||||
source = "git+https://github.com/servo/media#d1524d451cb0493f40000daf4f2a58f59b535ffa"
|
||||
dependencies = [
|
||||
"quote 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
|
@ -461,7 +461,7 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
|||
}),
|
||||
&canceller,
|
||||
);
|
||||
}).error(move || {
|
||||
}).error(move |error| {
|
||||
let _ = task_source_.queue_with_canceller(
|
||||
task!(audio_decode_eos: move || {
|
||||
let this = this_.root();
|
||||
|
@ -473,7 +473,8 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
|||
&DOMException::new(&this.global(), DOMErrorName::DataCloneError),
|
||||
ExceptionHandling::Report);
|
||||
}
|
||||
resolver.promise.reject_error(Error::Type("Audio decode error".to_owned()));
|
||||
let error = format!("Audio decode error {:?}", error);
|
||||
resolver.promise.reject_error(Error::Type(error));
|
||||
}),
|
||||
&canceller_,
|
||||
);
|
||||
|
|
|
@ -207,7 +207,7 @@ impl HTMLMediaElement {
|
|||
delaying_the_load_event_flag: Default::default(),
|
||||
pending_play_promises: Default::default(),
|
||||
in_flight_play_promises_queue: Default::default(),
|
||||
player: ServoMedia::get().unwrap().create_player().unwrap(),
|
||||
player: ServoMedia::get().unwrap().create_player(),
|
||||
frame_renderer: Arc::new(Mutex::new(MediaFrameRenderer::new(
|
||||
document.window().get_webrender_api_sender(),
|
||||
))),
|
||||
|
@ -942,9 +942,6 @@ impl HTMLMediaElement {
|
|||
self.player.register_event_handler(action_sender);
|
||||
self.player
|
||||
.register_frame_renderer(self.frame_renderer.clone());
|
||||
if self.player.setup().is_err() {
|
||||
return Err(());
|
||||
}
|
||||
|
||||
let trusted_node = Trusted::new(self);
|
||||
let window = window_from_node(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue