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 upPass more parameters to player's constructor #266
Conversation
|
@ferjm r? |
|
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. |
| @@ -69,7 +69,9 @@ pub enum StreamType { | |||
| } | |||
|
|
|||
| pub trait Player: Send { | |||
| /// Register an IpcSender that will push PlayerEvents generated by the playerq | |||
This comment has been minimized.
This comment has been minimized.
6cd30e8
to
1e411dc
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: #258
Now the player holds a single event handler and a single frame renderer, simplifying the code.
|
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+ |
|
|
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.
|
|
Ok! Thanks :) |
ceyusa commentedMay 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.