0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

18 Commits

Author SHA1 Message Date
tytan652
dfef65c30f linux-pipewire: Unify ScreenCast sources as Screen Capture
Allow to select both main type of ScreenCast (monitor, window)
with only one source type rather than adding a source type per
ScreenCast type.

This change is made as a new Screen Capture source type which
obsoletes the use of the previous Screen Capture (monitor-only)
and Window Capture.
2024-05-09 14:55:18 -03:00
Georges Basile Stavracas Neto
261cb91c62 linux-pipewire: Rename a function
Make it a bit more semantic, and matching of PipeWire API.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto
6499d01bec linux-pipewire: Allow passing registry events on creation
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.
2024-01-11 09:57:08 -03:00
Georges Basile Stavracas Neto
67c1202849 linux-pipewire: Add screencast cursor_visible prop
This commit adds the screencast-specific 'cursor_visible' field
in an anonymous struct within the constructor struct.

This slightly improves the connection code by properly treating
construction-time information in a constructor struct. It allows
removing the extra function call that sets cursor visibility from
the Screencast portal code.

Admittedly that's not much, but again, this will be an important
distinction when introducing the Camera portal code, since some
camera properties will need to trigger renegotiation.
2023-12-14 10:20:55 -03:00
Georges Basile Stavracas Neto
a1db8e5bde linux-pipewire: Factor out connection props in a struct
So that we can expand the number of construct-time connection
properties without changing the function signature every time.
This is mostly an ergonomic change for now, but it'll be very
useful when introducing the Camera portal code.
2023-12-14 10:20:55 -03:00
Georges Basile Stavracas Neto
549c0f5850 linux-pipewire: Move portal signal subcription to portal.c
The D-Bus signal subscription is a very boring aspect of the
portals infrastructure that shouldn't really matter when reading
the code of pipewire.c.

Move it out to its natural place, portal.c.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
c7e355e89c linux-pipewire: Store source when creating streams
We'll need to peek information about the source to determine how
to process frames, so store it for later usage.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
330d54fada linux-pipewire: Separate PipeWire core and streams
Sorry, this is a painful commit to review :(

Until now, the only consumer of the PipeWire code is the screen
cast portal code. This portal code only ever has one PipeWire
connection, and one PipeWire stream, every time a monitor or a
window is selected. This is reflected on obs_pipewire, which only
handles a single stream for any given connection.

For cameras and audio, however, a single PipeWire connection can
and most likely always will provide multiple streams. For example,
computers with multiple webcams will have one PipeWire connection
reporting multiple PipeWire nodes, one node for each camera.

This commit breaks this one-stream-per-connection assumption, and
makes obs_pipewire_connect_stream() return an independent object
(obs_pipewire_stream) that represents a single stream.

The screencast portal code continues to only ever have one connection
and one stream.
2023-07-15 20:46:51 -03:00
Georges Basile Stavracas Neto
f8a7b13cd3 linux-pipewire: Rename obs_pipewire_data to obs_pipewire
Next commits will introduce new obs_pipewire_* types, so this
renaming will make it slightly easier to read the code with
different types.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto
b7daa89f85 linux-pipewire: Split initialization of core and streams
This commit introduces an important distinction in the initialization
process that is essential to future camera and audio work: it splits
creating and connecting to the PipeWire socket, from connecting to
specific PipeWire nodes.

Right now, for the only consumer in existence - the ScreenCast portal
code - this distinction is irrelevant, but from an API perspective it
just makes sense to model it this way.
2023-02-13 12:28:09 -03:00
columbarius
86be35ae99 linux-pipewire: Move stream properties to constructors
And let each portal pass the stream properties relevant to them.
This makes the pipewire.c more independent of the actual portal
by providing a wrapper to create a stream. This will be relevant
later, when linux-pipewire introduces more portals like the Camera
one.
2023-02-13 12:28:09 -03:00
Georges Basile Stavracas Neto
874c30cb88 linux-pipewire: Cleanup D-Bus proxy on unload
When the linux-pipewire plugin is unloaded, make sure to cleanup
the D-Bus proxy for the ScreenCast portal too. This effectively
doesn't change anything, but it's always good to keep up with the
code hygiene.
2023-02-13 12:28:09 -03:00
Aleix Pol
6fb83abaeb linux-pipewire: Close sessions as we are done with them
This way the stream can be cleaned up. Otherwise, we closed them all
when OBS closes which works but is not entirely correct.
2022-09-27 11:50:49 -03:00
Norihiro Kamae
7e3656ab33 plugins: Cleanup unused-parameters
- Remove unnecessary UNUSED_PARAMETER
- Add OBS_UNUSED attribute to unused parameters
- Also removes unused variables
2022-07-19 11:01:00 -04:00
Georges Basile Stavracas Neto
f740033c93 linux-pipewire: Shuffle screencast D-Bus proxy around
Move the screencast D-Bus proxy, and related functions, to where
they fit in now: screencast-portal.c.
2022-06-24 10:29:10 -03:00
Georges Basile Stavracas Neto
0e9c208fc5 linux-pipewire: Move all portal code to screencast-portal.c
Sorry this is such a massive commit. The entangled nature of the
code in pipewire.c makes it impossible to reasonably split this
in smaller commits.

Move all D-Bus / portals code from pipewire.c into the recently
introduced screencast-portal.c.
2022-06-24 10:28:45 -03:00
Georges Basile Stavracas Neto
45afcf1997 linux-pipewire: Introduce proxy struct for screencast portal
Right now it's completely useless, but this commit lays out the
foundational steps to populate this struct.
2022-06-24 10:27:56 -03:00
Georges Basile Stavracas Neto
8a46b9e455 linux-pipewire: Rename pipewire-capture to screencast-portal
As we slowly split portal code from PipeWire code, what is currently
called pipewire-capture will become the screencast portal specific
code.

Preemptively rename the corresponding files and functions. Next commits
will continue the excision of portal code from pipewire.c.
2022-06-24 10:26:33 -03:00