Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upInvert dependency graph for backends #209
Conversation
|
The changes for Servo to use this new model are quite short: servo/servo@master...jdm:media-invert |
|
Thanks for doing this! r=me |
| @@ -12,7 +12,7 @@ use node::{BlockInfo, ChannelInfo}; | |||
| use offline_sink::OfflineAudioSink; | |||
| use oscillator_node::OscillatorNode; | |||
| use panner_node::PannerNode; | |||
| use sink::{AudioSink, AudioSinkError, DummyAudioSink}; | |||
| use sink::{AudioSink, AudioSinkError/*, DummyAudioSink*/}; | |||
This comment has been minimized.
This comment has been minimized.
| Err((_graph, e)) => { | ||
| error!("Could not start audio render thread due to error `{:?}`", e); | ||
| assert!(false); | ||
| /*error!( |
This comment has been minimized.
This comment has been minimized.
| DummyWebRtcController | ||
| } | ||
| pub trait Backend: Send + Sync { | ||
| fn make_player(&self) -> Box<Player>; |
This comment has been minimized.
This comment has been minimized.
ferjm
Feb 25, 2019
Member
uber-nit: s/make_player/create_player/g as all the other methods are create_*.
| servo-media-audio = { path = "../../audio" } | ||
| servo-media-player = { path = "../../player" } | ||
| servo-media-streams = { path = "../../streams" } | ||
| servo-media-webrtc = { path = "../../webrtc" } |
This comment has been minimized.
This comment has been minimized.
| @@ -18,5 +18,8 @@ path = "../streams" | |||
| [dependencies.servo-media-webrtc] | |||
| path = "../webrtc" | |||
|
|
|||
| [target.'cfg(any(all(target_os = "android", target_arch = "arm"), target_arch = "x86_64"))'.dependencies.servo-media-gstreamer] | |||
| path = "../backends/gstreamer" | |||
| #[target.'cfg(any(all(target_os = "android", target_arch = "arm"), target_arch = "x86_64"))'.dependencies.servo-media-gstreamer] | |||
This comment has been minimized.
This comment has been minimized.
|
The reason we initially chose the other model was mostly that it was easier, and we didn't expect other backends. But the dummy backend is turning out to be pretty important, so it's probably good to have it supported better. I doubt the trait object costs are major here. |
|
@bors-servo r=Manishearth,ferjm |
|
|
Invert dependency graph for backends This change has several benefits: * it makes the backend selection explicit by the user of this library (which ensures that it's easy to test that the dummy backend compiles) * it moves the platform-based backend selection into its own optional crate and reduces duplication * it makes the backends depend on servo-media, rather than the reverse, which improves build times for Servo when the public media APIs are not modified The downside is there are more trait objects instead of static types. My suspicion is that the performance hit of using virtual methods here is dwarfed by the other work being done, but I have not attempted to measure this at all.
|
|
|
@bors-servo r=Manishearth,ferjm |
|
|
Invert dependency graph for backends This change has several benefits: * it makes the backend selection explicit by the user of this library (which ensures that it's easy to test that the dummy backend compiles) * it moves the platform-based backend selection into its own optional crate and reduces duplication * it makes the backends depend on servo-media, rather than the reverse, which improves build times for Servo when the public media APIs are not modified The downside is there are more trait objects instead of static types. My suspicion is that the performance hit of using virtual methods here is dwarfed by the other work being done, but I have not attempted to measure this at all. Fixes #194.
|
|
…nstantiating the media stack.
|
@bors-servo r=Manisheart,ferjm |
|
|
Invert dependency graph for backends This change has several benefits: * it makes the backend selection explicit by the user of this library (which ensures that it's easy to test that the dummy backend compiles) * it moves the platform-based backend selection into its own optional crate and reduces duplication * it makes the backends depend on servo-media, rather than the reverse, which improves build times for Servo when the public media APIs are not modified The downside is there are more trait objects instead of static types. My suspicion is that the performance hit of using virtual methods here is dwarfed by the other work being done, but I have not attempted to measure this at all. Fixes #194.
|
|
jdm commentedFeb 22, 2019
•
edited
This change has several benefits:
The downside is there are more trait objects instead of static types. My suspicion is that the performance hit of using virtual methods here is dwarfed by the other work being done, but I have not attempted to measure this at all.
Fixes #194.