Commit graph

119 commits

Author SHA1 Message Date
Stefan Kost c46642523c pulsesrc: reflow to truncate caps just once
We get writable cpas from the intersection (unless it failed). As we truncate
those anyway, we don't need to manyaly copy the first structure.
2010-05-06 15:43:53 +03:00
Sebastian Dröge 4a492f2c8a pulsesrc: Allocate/free PA mainloop during state changes
...also destroy the stream and context during state changes.
2010-05-06 14:03:11 +02:00
Sebastian Dröge e69ba0f94f pulsesink: Allocate and free the custom clock in NULL<->READY 2010-05-06 13:57:01 +02:00
Sebastian Dröge 5332287e2d pulsesink: Create and free the PA mainloop in NULL->READY/READY->NULL
This fixes a race condition, when stopping the mainloop during finalization
is done from a mainloop callback.

Fixes bugs #614765 and #590662.
2010-05-06 13:51:59 +02:00
Sebastian Dröge ef8d113a73 pulse: Don't compare values of two different enum types 2010-04-30 22:22:25 +02:00
Stefan Kost 7cf9967e0b pulsesink: fix racy shutdown
Keep a ref of pulsesink for deferred mainloop invocation. Fixes #614765
2010-04-06 17:22:03 +02:00
Stefan Kost f1a75adcbc i18n: build fixes: #if -> #ifdef for ENABLE_NLS 2010-03-22 17:26:37 +02:00
Tim-Philipp Müller 073201b329 build: Makefile.am cleanups
Mostly add $(GST_BASE_CFLAGS) where it was missing, but also fix up
order of flags and libs if needed (see docs/random/moving-plugins).
2010-03-18 21:34:24 +00:00
Mark Nauwelaerts 5a082af3aa pulse: use #ifdef rather than #if conditionals 2010-03-18 12:44:53 +01:00
Philippe Normand 3ab666762f pulsesink: gst_pulsesink_get_mute: set result earlier.
In the cases where no buffer was process yet or the index is not
available, get_pulsesink_get_mute() would unconditionally return
FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=610337
2010-02-22 20:49:03 +01:00
Tim-Philipp Müller 3f2a803c48 pulsesink: add comment for translators for 'x by y' message
Fixes #609724.
2010-02-15 00:45:51 +00:00
Wim Taymans 55b5e2e3f3 pulsesink: avoid segfault when shutting down
when we are shutting down, we might still receive state updates from pulseaudio
but since we are unparented we should not do anything with the NULL parent
anymore.
2010-02-12 13:53:57 +01:00
Wim Taymans 0694be2a82 pulsesink: use acquired flag when checking valid state
Use the acquired field of the ringbuffer in get_time to know when we are in an
invalid state. We don't clear the rate flag when releasing the ringbuffer so
this values is not usable.

Avoids some error messages being posted because the pulseaudio connection is
down.
2009-11-18 17:27:19 +01:00
Wim Taymans f85cf3e200 pulsesink: implement some more callbacks
Implement some more callbacks for debugging purposes.
2009-11-18 12:01:52 +01:00
Tim-Philipp Müller 2270d3359a pulsesink: printf format fix 2009-11-05 23:46:58 +00:00
Sebastian Dröge 3f541452c4 pulsesink: Only set the volume on stream connection if pulse >= 0.9.20 is available
In older versions the volume set during stream connection had
no defined sematic and usually it was a relative volume. What
was needed for our use case is an absolute volume though, otherwise
the volume will be always decreased on stream connection if it's
less than 100%.
Since pulse 0.9.20 that volume is always an absolute volume if
flat volumes are used and relative otherwise, which is the same
as for pa_context_set_sink_input_volume().

Relevant pulse changesets:
http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=f27a50691c8fe45bac7dd6b21fac91a359def3a1
http://git.0pointer.de/?p=pulseaudio.git;a=commit;h=2501687579e359d5032a4d165b2ffc8f5b1b8ba6
2009-10-30 09:27:59 +01:00
Bastien Nocera a1ac55c7a5 Fix the StreamVolume interface not being advertised
gst_pulsesink_interface_supported() was missing a check for it.

https://bugzilla.gnome.org/show_bug.cgi?id=598933
2009-10-19 15:36:20 +01:00
Lennart Poettering e4d6a2aa2c pulse: never apply volume more than once
Generally decisions on the volume of the stream should be done inside of
PA, not inside of Gst. Only PA knows how volumes translate between
devices and s on.

This patch makes sure that all volumes set via the volume property are
only applied *once* to the underlying stream. After applying them the
client side will not store them anymore. This should make sure that
really only user-triggered volume changes are forwarded to server, but
the client never tries to save/restore the volume internally.

Fixes bug #595231.
2009-10-18 10:15:59 +02:00
Sebastian Dröge 92fd59024b pulsesink: Initialize gettext for the translated strings in plugin_init() 2009-10-17 09:00:00 +02:00
Lennart Poettering 89b0c2fc4f pulse: use 'performer' as a fallback for 'artist' tag 2009-10-17 08:48:23 +02:00
Lennart Poettering 76c8ca4b00 pulse: when constructing a stream title from tag data make sure it is translatable 2009-10-17 08:48:23 +02:00
Lennart Poettering fd75286dd1 pulse: loop while connecting to server
pthread does not guarantee that there are no spurious condition variable
wakeups, neither does pa_threaded_mainloop_xxx() which is a wrapper
around it. So we need to loop around the _wait() function to make sure
we get the right wakeup.

Also, unify the order of the wait loops across the file.
2009-10-17 08:48:23 +02:00
Lennart Poettering 48c3bd303f pulse: mainloop creation can fail too, so handle that 2009-10-17 08:48:23 +02:00
Lennart Poettering 3188f5699b pulse: adjust CHECK_DEAD_GOTO macro to glib style 2009-10-17 08:48:23 +02:00
Lennart Poettering d64200f46b pulse: make a few things smaller by making them bitfields 2009-10-17 08:48:21 +02:00
René Stadler f9274226e8 pulsesink: set desired minreq value to segsize/latency-time
If we let the daemon decide freely by passing -1, we end up always getting 20ms.
We want to set this value because in some cases we want to select a higher
latency-time in order to save power.

Fixes #597601
2009-10-14 12:05:14 +02:00
René Stadler 15c6175044 pulsesrc: guard fragment size with a lower limit based on latency-time
In case that the pulse daemon runs the source device at a relatively low fixed
fragment size compared to the requested latency-time, configure the ring buffer
segsize to the largest integer multiple of the fragment size that is still
smaller than or equal to the requested latency-time.

Fixes bug #597463.
2009-10-06 20:54:20 +03:00
René Stadler ccddf0643d pulse: rename pa_buffer_attr variables
Makes it much easier to see what is going on and is a lot less error prone.
2009-10-02 23:21:02 +03:00
Sebastian Dröge 317d6e18a2 pulsesrc: Don't dereference NULL pointers
pa_stream_get_timing_info() can return NULL.

Fixes bug #595220.
2009-09-15 10:05:51 +02:00
David Henningsson bb787f1030 pulsesink: Don't dereference NULL pointers
pa_stream_get_timing_info() can return NULL.

Fixes bug #595220.
2009-09-15 10:05:51 +02:00
Wim Taymans ccda761562 pulsesink: handle stream events
Handle stream events and request a PAUSE/PLAY state change from the application
when we receive a CORK/UNCORK event.
2009-09-14 16:05:30 +02:00
Sebastian Dröge 0c50816aaa pulsesink: Implement GstStreamVolume interface 2009-09-11 16:38:03 +02:00
Sebastian Dröge 7fb6ad6d4c pulsesink: Implement mute property 2009-09-11 16:38:03 +02:00
Wim Taymans 42ee5e22a2 pulsesink: remove ringbuffer reset compensation
Remove the code to deal with a ringbuffer reset as this code is now in the base
class.
Bump the -base requirement as we need the new baseaudiosink code to function
properly.
2009-09-09 16:25:06 +02:00
Wim Taymans 75a48e238a pulsesink: whitespace fixes 2009-09-09 16:24:49 +02:00
Wim Taymans ca7bec0d65 pulse: small cleanups
Add some debug info
Fix the state changes
2009-09-08 19:34:09 +02:00
Stefan Kost e82e16480d pulsesink: also guard reseting subscribe callback with ifdefs
It is conditionaly set, so do the same when unsetting.
2009-09-02 23:14:20 +03:00
Wim Taymans abee4f1d64 pulsesink: don't use relative seeks
Don't use relative seeks, it's too hard to track where we are after a flush
etc.

fixes #593015
2009-08-25 17:33:04 +02:00
Wim Taymans 08808f7f32 pulsesrc: don't discard the result of _set_caps()
Use the result of gst_pad_set_caps() instead of assuming success.

See #590678
2009-08-24 16:22:47 +02:00
Wim Taymans b32ef1d51e pulsesrc: set the default slave method to skew
Set the default slave method to the much better skew algorithm. This is the
default in the new base class but we override this here as well for the
upcomming release.
2009-08-06 13:03:13 +02:00
Tim-Philipp Müller 1425c46e20 pulsesrc: fix compilation with --disable-gst-debug 2009-08-06 10:21:38 +01:00
Jonathan Tellier dbf4d8a910 pulsesrc: initialize the probe with the server
When creating a new probe, pass the server instead of the device string.

fixes #590401
2009-08-03 13:32:12 +02:00
Tim-Philipp Müller a3c393248a pulsesink: don't do logic within g_assert() statements
Otherwise that code will just be expanded to nothing when compiled
-DG_DISABLE_ASSERT (PS: why is mainloop_start() called in the init
function and not when changing state to READY?)
2009-08-02 11:49:17 +01:00
Wim Taymans 9c341347ba pulse: conditionally compile newer stuff
configured_sink/source_usec in the timing_info is only since 0.9.11 so
conditionally compile this information.

fixes #590038
2009-07-29 12:13:20 +02:00
Wim Taymans 2d88251d9d pulsesrc: cleanups
Keep track of the paused state of the source and leave the read function when
paused.
don't wait for a latency update when the delay is not yet known but simply
return 0 instead of blocking.
Keep track of the corked state of the stream.
Fix the state changes.
2009-07-28 18:34:15 +02:00
Wim Taymans 19233e9671 pulsesrc: set maxlength always to -1 2009-07-28 18:34:15 +02:00
Wim Taymans 1a89388f97 pulsesrc; cleanups, report real latency
Add some more debug info
Avoid some type casts
Report the real latency to the application.
2009-07-28 18:34:15 +02:00
Wim Taymans 2308999849 pulsesink: avoid using ivalid stream indexes
when we get an invalid stream index from pulse because we were just starting,
avoid using it for getting and setting the volume.

Fixes #589365
2009-07-27 11:51:39 +02:00
Colin Guthrie 4efca7b68e pulsesink: Fix a couple error messages that mentioned incorrect function names.
Fixes #589459.
2009-07-23 10:54:45 +01:00
Wim Taymans b3c55f5ce5 pulsesink: set some values to their defaults
Set the minreq and maxlength buffer attributes to -1 to let puleseaudio select a
sensible value.
2009-07-20 19:09:19 +02:00