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

Support multiple media per layer #5

Open
pinballpower opened this issue May 22, 2022 · 5 comments
Open

Support multiple media per layer #5

pinballpower opened this issue May 22, 2022 · 5 comments

Comments

@pinballpower
Copy link
Contributor

It would be good to have some kind of "playlist" for media. This could be easily(?) implemented by using an array of objects for each layer.
When the first object of the array finishes playback, the next object is started automatically.

@egnor
Copy link
Owner

egnor commented May 22, 2022

You can of course have multiple "layers", each of which is active for the appropriate window of time. (Inactive layers shouldn't actually take any display planes or anything.) Of course you need to know the media length to do that.

In design, I'd been resisting adding "convenience" features to the script format in the service of simplicity, but I've heard other people wanting "once this video is done, do that other thing" (where "do that other thing" is often playing a different video). Of course you can query the info on the video length and set that all up in code... but that's work.

So maybe giving in a little bit and allowing the media to be a list (internally expanding to the separate layers with time windows, probably) would be a worthwhile concession. That does mean querying the media at script load time, but that does get cached, and script re-submission should be quick.

@pinballpower
Copy link
Contributor Author

Are these layer hardware planes in terms of KMS? In this case, using multiple layers could be problematic as the number of planes is limited.
Alternatively a bi-directional interface for external programs might be another way to do this, e.g. informing the external process that a video is about to finish.

@egnor
Copy link
Owner

egnor commented May 22, 2022

A DRM/KMS plane will only get used when any given layer is active (they're dynamically assigned as each frame is "built") so the various extra layers are no problem as long as only one is active at a time. (Or two at a time, if you want to overlap them a bit to create crossfade effects or something...)

@pinballpower
Copy link
Contributor Author

Understood. Does this also mean if 2 videos don't overlap, they might be rendered on the same DRM/KMS plane? That's would be pretty cool.

@egnor
Copy link
Owner

egnor commented May 22, 2022

Correct. Every frame, pivid assigns DRM/KMS planes from the start for whatever layers are active that frame, in layer order. (Skipping planes that are in use by some other display, if multiple displays are active, since multiple displays flip at different times.)

So even if two videos briefly overlap, once they're done, it will go back to using only the first plane... there's no sticky association of video to plane, it's all assigned frame by frame.

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

No branches or pull requests

2 participants