Pass more parameters to player's constructor#266
Conversation
|
@ferjm r? |
ferjm
left a comment
There was a problem hiding this comment.
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 |
6cd30e8 to
1e411dc
Compare
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.
1e411dc to
b67121b
Compare
ferjm
left a comment
There was a problem hiding this comment.
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! :)
|
@bors-servo r+ |
|
📌 Commit b67121b has been approved by |
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.
|
☀️ Test successful - checks-travis |
Ok! Thanks :) |
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.