App to App Media Sharing #1141
Replies: 4 comments 7 replies
-
From a UX point of view. For case 1, I think there could be two possible experiences:
There may be an option to share or not share audio from a stream. For case 2, either we display a dialog asking to add the camera (confirming its creation) and it is directly available for other apps in a selector, or it can be the same as in the second experience of case 1 but for a virtual camera. |
Beta Was this translation helpful? Give feedback.
-
Could you describe case 3 further? Is it, for example, an app that applies voice effects and then shares the resulting audio stream? |
Beta Was this translation helpful? Give feedback.
-
This will used as a sort of changelog if I happen to update my illustrations. Changes to Pseudo-Sequence Diagram for App to App ScreenCast between v1 and v2:
|
Beta Was this translation helpful? Give feedback.
-
PR for case n°1: #1554 |
Beta Was this translation helpful? Give feedback.
-
Related to Goal: Peer-to-peer media sharing
Usecases
Case n°1
Applications like Inochi 2D want to be able to share a stream (maybe even various) to other applications (e.g. OBS Studio) alike to what Spout2 and Syphon allows to do on respectively Windows and macOS with almost zero-latency, so mostly "PipeWire + DMA-BUF" for Linux.
We can also point out Gamescope that is a Wayland compositor that want to enable sharing in nested scenarios where a xdp implementation is not a solution (obsproject/obs-studio#9607).
Case n°2
Others applications want to be able to provide a virtual camera (e.g. OBS Studio) to be used as a camera in other applications.
Some of them already does by using v4l2-loopback which require kernel space API to be used.
As an example, OBS Studio plans to move features to PipeWire (obsproject/obs-studio#7998), but the actual proposed implementation requires an access to the host PipeWire.
Case n°3
Also some applications might want to act as virtual microphone (device to send their own audio stream) alike to one of Easy Effects features but without requiring direct access to the host PipeWire.
Idea of a solution
Note for the following:
For case n°1
For this use-case, we need to enable applications to provide screen cast sources (
virtual) to the ScreenCast portal of the xdp implementation.So the xdp stack will have to connect to the application point to point D-Bus to make it a screen cast sources provider.
Note: Name in italic are just temporary name
It is also imaginable to simplify the per-application implementation by providing a library that provide most of the basic of the implementation.
Thought about audio on those Screencast
Also related to Goal: Window screencast with audio.
Since the application provide its own video stream, the application could also provide a audio one paired with the latter.
This could improve the Gamescope sub-usecase, and maybe also allow to some power users of OBS Studio to "stream" an OBS session to another locally without having to rely to solution like NDI or DeckLink if implemented in OBS. Yes, chained OBS Studio setup like that do exist.
For case n°2
I didn't give enough thought about it, and like I said earlier I need to dive a little more on how PipeWire works with Portals.
For this one, we need to enable applications to give a video stream to xdp to make it a camera available through the Camera portal.
There is no expectation that the virtual camera can do more than an actual camera, so format-wise it should be like a real camera.
Reminder: Name in italic are just temporary name
![Pseudo-Sequence Diagram for App Virtual Camera CC-0](https://private-user-images.githubusercontent.com/17492366/273374965-6e6ab9dc-53d6-4f83-82a6-cad041de4c7f.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NjY1NTUsIm5iZiI6MTczODg2NjI1NSwicGF0aCI6Ii8xNzQ5MjM2Ni8yNzMzNzQ5NjUtNmU2YWI5ZGMtNTNkNi00ZjgzLTgyYTYtY2FkMDQxZGU0YzdmLnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDE4MjQxNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2Y2E4OTMwOWFmNDRhYjA5ZDJhODY4MTEwYTRhMGFmODQzMGE1Njk3YjZlMTFlOWIwMWEyYzQwNWM1MWNmNjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.OvwD1CTQ6EGZM4ttnBANV4LLcM9cYKinyPDGIGHOnsw)
For case n°3
This cases is alike to the case n°2 but relies on Goal: Audio portal/#1142.
But unlike case n°2, the naming "virtual microphone" is just used as a figure of speech.
Beta Was this translation helpful? Give feedback.
All reactions