Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Android example #101

Merged
merged 1 commit into from Jul 31, 2018
Merged

Fix Android example #101

merged 1 commit into from Jul 31, 2018

Conversation

@ferjm
Copy link
Member

ferjm commented Jul 31, 2018

Fixes #92

r? @Manishearth

@ferjm ferjm requested a review from Manishearth Jul 31, 2018
@ferjm ferjm force-pushed the ferjm:android.example.fix branch from 2d99256 to cdf3491 Jul 31, 2018
@ferjm
Copy link
Member Author

ferjm commented Jul 31, 2018

In case that you want to test this patch, you need to remove the code to switch backends based on the platform:

diff --git a/servo-media/Cargo.toml b/servo-media/Cargo.toml
index ab8ab27..cade577 100644
--- a/servo-media/Cargo.toml
+++ b/servo-media/Cargo.toml
@@ -12,5 +12,5 @@ path = "../audio"
 [dependencies.servo-media-player]
 path = "../player"

-[target.'cfg(all(not(target_os = "android"), target_arch = "x86"))'.dependencies.servo-media-gstreamer]
+[dependencies.servo-media-gstreamer]
 path = "../backends/gstreamer"
diff --git a/servo-media/src/lib.rs b/servo-media/src/lib.rs
index 91a1da6..65dddec 100644
--- a/servo-media/src/lib.rs
+++ b/servo-media/src/lib.rs
@@ -1,5 +1,4 @@
 pub extern crate servo_media_audio as audio;
-#[cfg(all(not(target_os = "android"), target_arch = "x86"))]
 extern crate servo_media_gstreamer;
 pub extern crate servo_media_player as player;
 use std::sync::{self, Arc, Mutex, Once};
@@ -37,10 +36,10 @@ impl PlayerBackend for DummyBackend {
     }
 }

-#[cfg(all(not(target_os = "android"), target_arch = "x86"))]
+//#[cfg(all(not(target_os = "android"), target_arch = "x86"))]
 pub type Backend = servo_media_gstreamer::GStreamerBackend;
-#[cfg(not(all(not(target_os = "android"), target_arch = "x86")))]
-pub type Backend = DummyBackend;
+//#[cfg(not(all(not(target_os = "android"), target_arch = "x86")))]
+//pub type Backend = DummyBackend;

 impl ServoMedia {
     pub fn new() -> Self
@Manishearth Manishearth merged commit 997a6e9 into servo:master Jul 31, 2018
@ferjm ferjm deleted the ferjm:android.example.fix branch Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.