Commit graph

855 commits

Author SHA1 Message Date
Arnaud Rebillout
35ed95df0d meson: Add libpulse simple
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 11:44:00 +02:00
Arnaud Rebillout
9a10eccea3 meson: Add a dependency object for libpulse_mainloop_glib
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-06-08 10:32:14 +02:00
Arun Raghavan
363b1ae69c thread-mainloop: Add API for running a callback unlocked
This adds API to allow clients to schedule a callback in the mainloop
thread without the mainloop lock being held. This is meant for a case
where the client might be dealing with locking its own objects in
addition to the mainloop thread itself. In this case, it might need ton
control the locking order of the two, to match the order in other
threads, as it might not always be able to allow for its objects to be
locked after the mainloop thread lock.
2019-03-31 09:18:37 +00:00
Arnaud Rebillout
12f0e9232f meson: Process and install files: default.pa, system.pa, daemon.conf, client.conf
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2018-12-27 17:25:56 +05:30
Arnaud Rebillout
4325393499 meson: Add optional libpulse-mainloop-glib
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2018-12-27 17:25:56 +05:30
Arnaud Rebillout
065a79ff8c meson: Add optional GLib support
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2018-12-27 17:25:56 +05:30
Joseph Herlant
223b409c9c
Fix typo: substract -> subtract 2018-09-17 10:03:55 -07:00
Arnaud Rebillout
012dfc4631 build-sys: meson: Generate version.h
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2018-09-15 22:11:35 +07:00
Arun Raghavan
6d7a266e0e format: Expose pa_format_info convenience getters in API
We move over helper functions to get rate, channels, channel map and
sample format (if PCM) in the public API, so users of the extended API
are more easily able to pull out these values from pa_format_info.
2018-07-23 19:29:19 +05:30
Lyndon Brown
2d9790f566 operation: avoid state change from final state
The internal operation_set_state function already returns early if the
new state is the same as the existing state. The attached patch extends
this to return early if already in a finalised (done/cancelled) state,
i.e. blocks attempts to re-finalise into a different state.

This helps avoid unlinking more than once (or crashing on ref count
assertion).

I was not certain whether an assertion would be a better alternative -
with such a crash helping highlight usage problems...

The situation that lead to this was the thought of someone stupidly
trying to pa_operation_cancel() a callback within the callback
execution itself, while designing a solution for a memory leak related
to cancellation within my Rust binding. While no-one should do such a
thing, if they did, they'd either trip up a ref count assertion, or the
operation would be unlinked twice, which would be bad. It's a simple
thing to catch and mitigate, and could prove to be a useful
bulletproofing measure for this function in general.
2018-07-16 12:47:00 +03:00
Lyndon Brown
7cb2e4ad3d mainloop: constify is_our_api api ref 2018-06-29 15:09:32 +03:00
Lyndon Brown
4e3a080d76 context: pa_context_get_tile_size: constify 2018-06-26 11:51:18 +03:00
Lyndon Brown
351731c697 context: pa_context_get_index: constify 2018-06-26 11:47:32 +03:00
Lyndon Brown
b88a219f32 context: pa_context_get_server_protocol_version: constify 2018-06-26 11:45:07 +03:00
Lyndon Brown
b4b37a0e66 context: pa_context_get_server: constify 2018-06-26 11:42:00 +03:00
Lyndon Brown
792c2f0d7b context: pa_context_is_local: constify 2018-06-26 11:39:34 +03:00
Lyndon Brown
3b1ecb720d context: pa_context_is_pending: constify 2018-06-26 11:37:19 +03:00
Tanu Kaskinen
e7c88ee169 context: constify pa_context_set_error()
This allows constifying public API functions that report their errors
via the context error but don't modify the context in any other way.
Philosophical arguments could be made why this is wrong, but I believe
in practice this is a net positive change.
2018-06-26 11:32:51 +03:00
Lyndon Brown
d251665f22 context: pa_context_rttime_restart: constify context pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
31da2a7d3f context: pa_context_rttime_new: constify context pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
ccf3d29264 context: pa_context_errno: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
f727cd9ac0 context: hide error attr behind pointer
Paves the way towards more of the API using const pointers.

Some pa_context_* functions return their errors by setting the context
error, even when there's no other change in the context state. This
prevented constifying the pa_context arguments of such functions. This
patch puts the error in its own struct behind a pointer, so that setting
the error doesn't any more count as modifying the pa_context object.
2018-06-21 06:30:25 +05:30
Lyndon Brown
9472bebcb0 stream: constify internal functions 2018-06-21 06:30:25 +05:30
Lyndon Brown
e6226b07c0 stream: pa_stream_get_monitor_stream: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
6f2a70191d stream: pa_stream_get_format_info: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
c16b842ac0 stream: pa_stream_get_underflow_index: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
883421df03 stream: pa_stream_[writable|readable]_size: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
d1f708ecfc stream: pa_stream_is_[suspended|corked]: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
22f2a445a2 stream: pa_stream_get_device_[index|name]: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
274cb7b6d0 stream: pa_stream_get_index: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
31eb433d7b stream: pa_stream_get_context: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
6ab533c7aa stream: pa_stream_get_state: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
a24be6cc13 operation: pa_operation_get_state: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
9b5077c468 mainloop: constify get_retval functions 2018-06-21 06:30:25 +05:30
Lyndon Brown
277c3735df context: pa_context_get_state: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
326b749a78 context: pa_context_get_protocol_version: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
c0a70e8db8 context: pa_context_new_with_proplist: constify proplist param 2018-06-21 06:30:25 +05:30
Lyndon Brown
d851021cf5 volume: pa_cvolume_get_position: constify 2018-06-21 06:30:25 +05:30
Lyndon Brown
5c2d28f6df scache: pa_context_play_sample_with_proplist: constify proplist param
If the given proplist is NULL, the function creates a new (empty)
proplist. That caused a compiler warning after the constification, which
is why the new proplist is now created using a separate variable.
2018-06-21 06:30:25 +05:30
Lyndon Brown
f17bcb0ad5 scache: pa_context_play_sample_with_proplist: clarify proplist param
Existing documentation was unclear about which property list would be the
one changed (merged into), making it seem (along with the non-const
proplist pointer param, which needs changing seperately), that the proplist
object for which a pointer is given will be the one merged into, instead of
the internal cached entry's proplist.
2018-06-21 06:30:25 +05:30
Lyndon Brown
4af27c25d2 proplist: pa_proplist_equal: constify proplist pointers 2018-06-21 06:30:25 +05:30
Lyndon Brown
2562446c4a proplist: pa_proplist_[size|isempty]: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
5a146049df proplist: pa_proplist_contains: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
25b55284db proplist: pa_proplist_to_string[_sep]: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
6161e106c0 context: pa_context_proplist_update: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
58c3f9b671 proplist: pa_proplist_gets: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
cc063264e6 proplist: pa_proplist_get: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
5d101fd2e2 proplist: pa_proplist_iterate: constify proplist pointer 2018-06-21 06:30:25 +05:30
Lyndon Brown
e82506f08d proplist: add and use const version of MAKE_HASHMAP macro 2018-06-21 06:30:25 +05:30
Arun Raghavan
878ef44079 core: Expose API to elevate a thread to realtime priority
This should make it easier for clients to elevate their audio threads to
real time priority without having to dig through much through specific
system internals.
2018-06-21 06:29:32 +05:30