Repository navigation
Camera portal (feat. PipeWire) - #9771
Merged
GeorgesStavracas merged 14 commits intoJan 11, 2024
Merged
GeorgesStavracas merged 14 commits into
GeorgesStavracas merged 14 commits into
Conversation
GeorgesStavracas
force-pushed
the
gbsneto/pipewire-camera
branch
from
October 28, 2023 19:13
d35f997 to
21739fb
Compare
tytan652
reviewed
Oct 28, 2023
tytan652
suggested changes
Oct 28, 2023
tytan652
reviewed
Oct 28, 2023
6 tasks done
6 tasks done
GeorgesStavracas
force-pushed
the
gbsneto/pipewire-camera
branch
4 times, most recently
from
December 14, 2023 15:41
066374f to
b9ac1ae
Compare
GeorgesStavracas
marked this pull request as ready for review
December 14, 2023 16:11
tytan652
reviewed
Dec 16, 2023
tytan652
left a comment
Collaborator
There was a problem hiding this comment.
Made a quick pass.
Don't forget my previous reviews about blog() usage.
There is various switches not enforcing the enum spa_media_subtype type which can lead to unwanted omission.
GeorgesStavracas
force-pushed
the
gbsneto/pipewire-camera
branch
from
December 16, 2023 23:42
b9ac1ae to
ca33df5
Compare
Member
Author
|
After looking at how MJPEG and h264 streams aren't really working, I have decided to split it into a separate, follow-up pull request, so that we can review it separately from the this one. This PR still supports YUY2 cameras so many of them are covered for the time being. |
tytan652
approved these changes
Jan 11, 2024
tytan652
left a comment
Collaborator
There was a problem hiding this comment.
LGTM (not an PipeWire expert), beside some issue issue with my camera that are likely issue in the young new stack introduce by this portal (libcamera - PipeWire - xdg-desktop-portal).
This will allow consumers of obs_pipewire to handle the device registry themselves. This is not useful for the screencast code since there's always only one node in the registry, but it will be used by the camera and audio code to list hardware devices.
Generalize the async server roundtrip wait so that future consumers can, for example, wait for all devices to be listed before acting on the registry.
Make it a bit more semantic, and matching of PipeWire API.
This plugin adds a camera source for capture devices available via PipeWire using the Camera portal.
List it in addition to YUV formats. Co-authored-by: Georges Basile Stavracas Neto <[email protected]>
This will help share these formats with the upcoming Camera portal code.
Wait with starting the camera until we find the device in the registry. Avoids cases where the camera stays unlinked.
Collect the controls on the node. Enumerate the controls as properties. Co-authored-by: Georges Basile Stavracas Neto <[email protected]>
Trigger a renegotiation of the camera stream when either the resolution or the framerate change.
g_strerror only works for errno values, SPA errors are negative errno values.
Rebuild the camera list when a camera was added or removed.
This allows the stream negotiation to set the camera values right from the start.
GeorgesStavracas
force-pushed
the
gbsneto/pipewire-camera
branch
from
January 11, 2024 12:24
ca33df5 to
ac8cbd9
Compare
Closed
5 of 6 tasks
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is not ready for prime time, but it's close enough to at least raise some awareness of it.
This patchset includes patches from columbarius, wim, and myself. I've absorbed Wim's patches into this patchset as well.
TODO:
Description
Adjust the PipeWire stream code to be able to be able to receive external registry vtables. That enables fetching devices that the PipeWire connection has, into a separate owner / object.
Then, add code to request permission to access cameras using the Camera portal; and to create and use a PipeWire stream from the portal as well.
Motivation and Context
The Camera portal + PipeWire combo is the future of cameras on the Linux desktop, but sadly the lack of real consumers of these APIs is blocking more progress. This gets us closer to this future 🙂
How Has This Been Tested?
Types of changes
Checklist: