Skip to content

Comments

Pass more parameters to player's constructor#266

Merged
bors-servo merged 5 commits intoservo:masterfrom
ceyusa:player-constructor
May 28, 2019
Merged

Pass more parameters to player's constructor#266
bors-servo merged 5 commits intoservo:masterfrom
ceyusa:player-constructor

Conversation

@ceyusa
Copy link
Contributor

@ceyusa ceyusa commented May 17, 2019

This pull request is mainly about passing more parameters to player's constructor.

Also it includes a patch to make PlayerGLContext's enums as seriable in order to share them through IPC.

Finally, a cosmetic change which removes currently unused external crates.

@ceyusa
Copy link
Contributor Author

ceyusa commented May 17, 2019

@ferjm r?

Copy link
Contributor

@ferjm ferjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned on IRC, given that Servo is currently using a single FrameRenderer and a single PlayerEvent observer, I would prefer to keep it simple and remove the list of renderers and observers. We can extend the API in the future if we find any use case where we'd like to have multiple renderers and/or observers.

player/lib.rs Outdated
}

pub trait Player: Send {
/// Register an IpcSender that will push PlayerEvents generated by the playerq
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: playerq

@ceyusa ceyusa force-pushed the player-constructor branch 2 times, most recently from 6cd30e8 to 1e411dc Compare May 17, 2019 18:03
ceyusa added 5 commits May 27, 2019 14:12
Marked its enums as clone, debug, deserialize and serialize.

This is required to send the trait trough threads (Servo's
constellation, fo example).
Player cannot work correctly without an event handler, so intead of
registering after the player is instantianted, it is passed as a
constructor parameter.

In the case of the frame renderer, if it non rendered is set, the
video track in the player should be disabled. This patch pass the
frame renderer decorated with an Option, so if it is none, the video
track is disabled, thus removing disable_video() method.

Fixes: servo#258
Now the player holds a single event handler and a single frame
renderer, simplifying the code.
Copy link
Contributor

@ferjm ferjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay! I missed that you force pushed. In order to avoid future delays, ask for review again after you force push, please. Thanks! :)

@ferjm
Copy link
Contributor

ferjm commented May 28, 2019

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit b67121b has been approved by ferjm

@bors-servo
Copy link
Contributor

⌛ Testing commit b67121b with merge 082496e...

bors-servo pushed a commit that referenced this pull request May 28, 2019
Pass more parameters to player's constructor

This pull request is mainly about passing more parameters to player's constructor.

Also it includes a patch to make PlayerGLContext's enums as seriable in order to share them through IPC.

Finally, a cosmetic change which removes currently unused external crates.
@bors-servo
Copy link
Contributor

☀️ Test successful - checks-travis
Approved by: ferjm
Pushing 082496e to master...

@ceyusa
Copy link
Contributor Author

ceyusa commented May 28, 2019

In order to avoid future delays, ask for review again after you force push, please.

Ok! Thanks :)

@ceyusa ceyusa deleted the player-constructor branch May 28, 2019 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants