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

Update Player instantiator API #23294

Merged
merged 1 commit into from May 2, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Update Player instantiator API

Now servo/media player requires a new parameter for its creator, which
is a trait object that provides the GL parameters needed for setup the
generation of frames as GL textures.

This patch provides a dummy GL context trait object where the code
path will go to the default of raw frames.

Webaudio test expectation also were changed, adding two new failing
tests.
  • Loading branch information
ceyusa committed May 2, 2019
commit f9bee36b71651069bcbda02d563d9b9ec488db21

Some generated files are not rendered by default. Learn more.

@@ -70,6 +70,7 @@ use net_traits::{CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseLis
use net_traits::{NetworkError, ResourceFetchTiming, ResourceTimingType};
use script_layout_interface::HTMLMediaData;
use servo_config::pref;
use servo_media::player::context::{GlContext, NativeDisplay, PlayerGLContext};
use servo_media::player::frame::{Frame, FrameRenderer};
use servo_media::player::{PlaybackState, Player, PlayerError, PlayerEvent, StreamType};
use servo_media::ServoMedia;
@@ -160,6 +161,16 @@ impl FrameRenderer for MediaFrameRenderer {
}
}

struct PlayerContextDummy();
impl PlayerGLContext for PlayerContextDummy {
fn get_gl_context(&self) -> GlContext {
return GlContext::Unknown;
}
fn get_native_display(&self) -> NativeDisplay {
return NativeDisplay::Unknown;
}
}

#[must_root]
#[derive(JSTraceable, MallocSizeOf)]
enum SrcObject {
@@ -1201,7 +1212,9 @@ impl HTMLMediaElement {
_ => StreamType::Seekable,
};

let player = ServoMedia::get().unwrap().create_player(stream_type);
let player = ServoMedia::get()
.unwrap()
.create_player(stream_type, Box::new(PlayerContextDummy()));

let (action_sender, action_receiver) = ipc::channel().unwrap();
player.register_event_handler(action_sender);
@@ -11,3 +11,9 @@
[X SNR (-0.5698 dB) is not greater than or equal to 37.17. Got -0.5697716379745515.]
expected: FAIL

[X Interpolated sine wave does not equal [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0...\] with an element-wise tolerance of {"absoluteThreshold":0.090348,"relativeThreshold":0}.\n\tIndex\tActual\t\t\tExpected\t\tAbsError\t\tRelError\t\tTest threshold\n\t[1\]\t3.3873793482780457e-1\t0.0000000000000000e+0\t3.3873793482780457e-1\tInfinity\t9.0347999999999998e-2\n\t[2\]\t6.3742399215698242e-1\t0.0000000000000000e+0\t6.3742399215698242e-1\tInfinity\t9.0347999999999998e-2\n\t[3\]\t8.6074203252792358e-1\t0.0000000000000000e+0\t8.6074203252792358e-1\tInfinity\t9.0347999999999998e-2\n\t[4\]\t9.8228722810745239e-1\t0.0000000000000000e+0\t9.8228722810745239e-1\tInfinity\t9.0347999999999998e-2\n\t[5\]\t9.8768836259841919e-1\t0.0000000000000000e+0\t9.8768836259841919e-1\tInfinity\t9.0347999999999998e-2\n\t...and 81 more errors.\n\tMax AbsError of 1.0000000000000000e+0 at index of 200.\n\t[200\]\t-1.0000000000000000e+0\t0.0000000000000000e+0\t1.0000000000000000e+0\tInfinity\t9.0347999999999998e-2\n\tMax RelError of Infinity at index of 1.\n]
expected: FAIL

[X SNR (-Infinity dB) is not greater than or equal to 37.17. Got -Infinity.]
expected: FAIL

@@ -26,3 +26,9 @@
[# AUDIT TASK RUNNER FINISHED: 1 out of 3 tasks were failed.]
expected: FAIL

[< [invalid-operation\] 1 out of 4 assertions were failed.]
expected: FAIL

[X The gain value of the second gain node is not equal to 0.5. Got 1.]
expected: FAIL

@@ -17,3 +17,9 @@
[X Osc(freq: 44100.00390625) output: Expected 0 for all values but found 5511 unexpected values: \n\tIndex\tActual\n\t[1\]\t5.565462970480439e-7\n\t[2\]\t0.0000011130925940960879\n\t[3\]\t0.0000016696390048309695\n\t[4\]\t0.0000022261851881921757\n\t...and 5507 more errors.]
expected: FAIL

[# AUDIT TASK RUNNER FINISHED: 1 out of 2 tasks were failed.]
expected: FAIL

[X osc[0:4\] should have contain at least one value different from 0.]
expected: FAIL

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.