Commit graph

30 commits

Author SHA1 Message Date
Quentin Wenger
22fc9eec35 Cleanup argument names in methods and events interfaces
First method argument is object, first event argument is data.

Closes !963
2022-04-15 10:11:49 +02:00
Peter Hutterer
96f8a7597e modules: switch protocol-native to the new logging system
This is more complicated than a normal module because we have two
logging topics: mod.protocol-native and conn.protocol-native for wire
messages. Because the latter use spa_debug (through spa_debug_pod) we
need to #define our way around so those too use the right topics.

Note that this removes the previous "connection" category, it is now
"conn.protocol-native" instead.
2021-09-28 09:35:39 +02:00
George Kiagiadakis
59407d2f08 includes: update all references to extensions to point to pipewire/extensions
This also brings the advantage that all tools, examples, modules, components
can also be compiled standalone out-of-tree using libpipewire from the system
2021-06-18 17:54:18 +03:00
Peter Hutterer
95a84e797a treewide: replace !strcmp() with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
7697ed0757 treewide: replace strcmp() == 0 with spa_streq()
This change is only done in source files for now, header files will be done
separately.
2021-05-18 22:10:27 +10:00
Peter Hutterer
2405f0942b spa/buffer: rename SPA_MEMBER to SPA_PTROFF
SPA_MEMBER is misleading, all we're doing here is pointer+offset and a
type-casting the result. Rename to SPA_PTROFF which is more expressive (and
has the same number of characters so we don't need to re-indent).
2021-05-06 09:39:39 +00:00
George Kiagiadakis
0ce6de8fdf src: change license (LGPL -> MIT) on left-over LGPL files
Discussed with and approved by Wim
2021-02-10 11:52:09 +00:00
Wim Taymans
387009e0d6 return ENOENT for unknown resources
Fix some other errors as well, ENOSYS for invalid interface, ENOTSUP
for unimplemented methods.
2020-11-20 12:11:37 +01:00
Emmanuel Gil Peyrot
14fdf07e8f Run codespell on the entire codebase
This tool detects and fixes common English spelling mistakes, with
generally very few mistakes.

Here is the command I used to generate this commit.  There were a few
changes that had to be done manually, and of course adding the ignore
file:
```shell
codespell -I .codespell-ignore -x .codespell-ignore -w
```

I didn’t add it to the CI, but this would be a good place for it.
2020-08-17 17:16:31 +00:00
Wim Taymans
014e48c1f1 protocol: add workaround for bad v0 clients
Fix up clients that say they have fixed properties while in fact
they are not. Assume that when there are alternatives, the property
was in fact not fixed.
2020-06-09 13:22:07 +02:00
Wim Taymans
a19bab4b16 avoid following NULL pointers 2020-05-20 15:24:25 +02:00
Wim Taymans
293932d4ec v0: improve compatibility
Implement RequestClockUpdate event and ClockUpdate message for
old clients.
2020-02-11 11:23:28 +01:00
Wim Taymans
eab6dda513 protocol-native: improve v0 compatibility 2020-02-10 18:15:24 +01:00
Wim Taymans
3aa8e301c5 protocol-native: implement v2 update_permissions
Convert the old permission update to new permission events.
2020-02-06 16:57:24 +01:00
Wim Taymans
7a395bccaf improve v2 compat mode
Always send the server types when we got the first client types and
don't rely on the message sequence number.
Add some more types in the typemap.
2020-02-06 16:56:19 +01:00
Wim Taymans
df519ee3b3 avoid including private.h
Expose some more methods to make it possible to build without
including the private.h header, especially in modules.
2020-01-02 13:48:50 +01:00
Wim Taymans
f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans
e9b62c0ce6 v0: set media class
Set the media class on the client-node after we know the number of
ports.
Add more type mappings
Fix change_mask on core_info
2019-12-17 17:34:10 +01:00
Wim Taymans
c23006fcdb pw_port_proxy -> pw_port 2019-12-11 15:59:26 +01:00
Wim Taymans
beb3c69dfe pw_node_proxy -> pw_node 2019-12-11 15:26:11 +01:00
Wim Taymans
199fa47216 pw_module_proxy -> pw_module 2019-12-11 15:16:30 +01:00
Wim Taymans
e633e205c2 pw_link_proxy -> pw_link 2019-12-11 15:11:56 +01:00
Wim Taymans
114982f3f5 pw_factory_proxy -> pw_factory 2019-12-11 15:06:00 +01:00
Wim Taymans
a8f1d756c3 pw_client_proxy -> pw_client 2019-12-11 14:53:39 +01:00
Wim Taymans
95688939bf pw_client -> pw_impl_client 2019-12-11 11:21:43 +01:00
Wim Taymans
49d736bbb7 pw_registry_proxy -> pw_registry 2019-12-11 09:44:48 +01:00
Wim Taymans
ecc6b27cd7 rename core_proxy -> core
Rename core_proxy to core and move the introspect and interface
contents to core.h

In an effort to promote the proxy API.
2019-12-11 07:46:59 +01:00
Wim Taymans
e40fbf8cc4 Add printf checks for proxy_error and resource_error
Add an error variant without checks.
2019-11-21 16:09:05 +01:00
Wim Taymans
8ddf579cc0 protocol: add flags to protocol marshal
Allows us to to select marshallers for implementation and binding.
2019-11-03 10:21:57 +01:00
Wim Taymans
082463efd0 protocol: add v0 compatibility
For flatpaks we need to be able to support older v0 protocol clients.
To handle this we have:

- the connection detects an old client when it receives the first
  message. It can do this by checking the sequence number, on old
  versions it contains the message size and is never 0, on new
  clients the sequence number is 0.

- We add a new signal at the start of the connection with the detected
  version number. This installs the right version of the core proxy.
  We also move the binding of the client until the hello message is
  received. This way we can have a new client connect (portal),
  hand over the connection to an old client, which then removes the
  client binding again in the hello request with a v0 version.
  There are some changes to the passing of fds in v0 vs v3 which need
  to investigated some more.

- bump version of our interfaces to 3. This makes it possible to
  have v0 and v3 protocol marshal functions.

- Add version number in the proxy. This is mostly automatically done
  internally based on the version numbers the library is compiled
  with. Where the version number was in the API before, it is now
  actually used to look up the right protocol marshal functions. For
  Proxies there is usually just 1 version, the current one. It is the
  server that will support different versions.

- Add v0 compat marshal functions to convert from and to v0 format.
  This has some complications. v0 has a type map it keeps in sync
  with the server. For this we have a static type map with mappings
  to our own v3 types. Pods are mostly the same except for objects
  that used to have arbitrary pods in v0 vs spa_pod_prop in v3. Also
  convert between v0 spa_pod_prop and v3 spa_pod_choice.
  Formats and commands are also slightly different so handle those
  mappings as well.
  We only have marshal functions for the server side (resource)
  v0 functions.

- Add v0 compatible client-node again. It's a bit tricky to map, v0
  client-node basically lets the server to the mixing and teeing
  and just does the processing of the internal node.
2019-10-08 23:20:18 +02:00