Commit graph

63 commits

Author SHA1 Message Date
poljar (Damir Jelić)
97da92d894 Whitespace cleanup: Remove all multiple newlines
This patch removes all occurrences of double and triple
newlines.

Command used for this:
find .  -type d \( -name ffmpeg \) -prune -o \
        -regex '\(.*\.[hc]\|.*\.cc\)' \
        -a -not -name 'adrian-aec.*' -a -not \
        -name reserve.c -a -not -name 'rtkit.*' \
        -exec sed -i -e '/^$/{N;s/^\n$//}' {} \;

Two passes were needed to remove triple newlines.
The excluded files are mirrored files from external sources.
2013-06-24 16:56:24 +03:00
David Henningsson
d396b76934 module-device-manager: Fix description restore
e->description is a pointer, not a fixed char array. Hence it
makes no sense to use strncmp.

This fixes a compiler warning when compiling under Ubuntu.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
2013-05-22 16:07:57 +02:00
Tanu Kaskinen
061878b5a4 idxset: Use pa_free_cb_t instead of pa_free2_cb_t
There were no users for the userdata pointer.
2013-02-16 01:15:27 +02:00
Tanu Kaskinen
8872c238ba hashmap: Use pa_free_cb_t instead of pa_free2_cb_t
The previous patch removed module-gconf's dependency on the userdata
pointer of the free callback, and that was the only place where the
userdata pointer of pa_free2_cb_t was used, so now there's no need for
pa_free2_cb_t in pa_hashmap_free(). Using pa_free_cb_t instead allows
removing a significant amount of repetitive code.
2013-02-16 01:12:21 +02:00
Arti Trivedi Bora
e5954aca8e modules: Use pa_streq instead of strcmp. 2012-06-09 16:21:41 +03:00
Harsh Prateek Bora
f38c1e9bf9 modules: Use PA_IDXSET_FOREACH wherever applicable.
Signed-off-by: Harsh Prateek Bora <harsh.bora@linaro.org>
2012-05-31 14:12:33 +02:00
Tanu Kaskinen
8747930747 device-manager: Add an assertion to get rid of a warning from Coverity.
Coverity thinks that device_name can be NULL when it's
dereferenced by strcmp. Adding an assertion doesn't hurt
here (in my opinion), and that should get rid of the
warning.
2012-03-28 17:34:01 +03:00
Tanu Kaskinen
191d60688d device-manager: Fix a memory leak. 2012-03-28 17:23:05 +03:00
Maarten Bosmans
c5dca7cf2b More spelling fixes 2011-08-25 11:27:47 +01:00
Maarten Bosmans
3b76d8065f Plug some memory leaks
These were detected with valgrind.
2011-08-15 09:41:56 +01:00
Maarten Bosmans
dd9265ac78 Remove unnecessary #includes 2011-06-22 23:12:20 +01:00
Colin Guthrie
9ffa9382dd database: Support legacy format database entries.
This adds code to specifically support legacy entries.
I kept this code in a separate commit so that it can be (relatively)
easily removed at some point in the future.
2011-06-22 23:12:20 +01:00
Colin Guthrie
695d536380 database: Convert our use of database files to save in tagstruct format.
This has the advantage of allowing versioned updates in the future,
thus allowing us to be more user friendly going forward (as opposed
to just ignoring entries from old versions).

The primary motivation for this, however, is to allow variable length
storage in each entry which will be needed for upcoming work.

At present this commit will ignore any legacy entries but support
for reading and subsequently converting legacy entries will be added
shortly.
2011-06-22 22:47:55 +01:00
Colin Guthrie
5d35375aa7 capture: Add the passthrough format negotiation to capture streams.
This helps to keep the API more symmetrical and also potentially
allows support for passthrough monitor sources at some point in the future.
2011-06-22 21:55:27 +01:00
Colin Guthrie
b865999126 device-manager: Free a hook slot to prevent segv on unload 2011-06-06 21:16:28 +02:00
Arun Raghavan
0ac2cfce6d core: Add extended stream API to support compressed formats
This is the beginning of work to support compressed formats natively in
PulseAudio. This adds a pa_stream_new_extended() that takes a format
structure, sends it to the server (=> protocol extension) and has the
server negotiate with the appropropriate sink to figure out what format
it should use.

This is work in progress, and works only with PCM streams. Actual
compressed format support in some sink needs to be implemented, and
extensive testing is required.

More details on how this is supposed to work is available at:
http://pulseaudio.org/wiki/PassthroughSupport
2011-05-02 11:54:43 +05:30
Maarten Bosmans
684b89c639 Fix up some double spaces 2011-03-18 09:20:07 +00:00
Maarten Bosmans
ecf09f2cd6 Fix up according to Coding Style
Only whitespace changes in here
2011-03-11 11:49:35 +00:00
Zhang Wanming
0c0c285e79 Fix typos 2010-12-20 11:07:30 +00:00
Colin Guthrie
b02abcb613 device-manager: Ensure that sinks/sources populate the device manager lists in order of their priority.
Currently the order of the sinks is simply that of their position in the idxset which is certainly
not what the user would want.
2010-09-29 22:08:37 +01:00
Diego Elio 'Flameeyes' Pettenò
62278b4b94 Avoid using devname as a variable name.
On FreeBSD, devname() is a system function, and was overshadowed.
2009-11-21 00:47:44 +01:00
Colin Guthrie
bec67cd75f device-manager: Fix compiler warning.
Do not use a variable called 'index' as it clashes with string.h
2009-10-19 21:50:03 +01:00
Colin Guthrie
0ff2a6b434 device-manager: Rather than flagging the device as available, just include the sink/source index with PA_INVALID_INDEX meaning unavailable 2009-10-10 15:45:49 +01:00
Colin Guthrie
9d7a27ec88 device-manager: Play nice with module-stream-restore.
If m-s-r sets the device we let it do so. Otherwise we handle the routing. We run before
module-intended-roles as the priority list will likely be configured appropriately
to do the same job, albeit with manual setup.
2009-10-02 22:44:56 +01:00
Colin Guthrie
cc31d7c35a device-manager: Make use of PA_IDXSET_FOREACH when applying entries. 2009-10-02 21:04:03 +01:00
Colin Guthrie
fdbb550063 device-manager: Keep track as to whether or not the user specifically renamed the device.
If the user has not (via our protocol extension) renamed a device, but it happens to now have
a different name (e.g. module-combine automatically updating the description for us or udev-db
getting better etc.) then make sure we update our cache with this updated version.

If the user has set a name, enforce it's use, even if the description is updated by some other
means (e.g. the user manually editing the proplist or another module doing it for them).
2009-10-02 21:01:19 +01:00
Colin Guthrie
6468dcf9d1 device-manager: No need to check the version after calling read_entry() 2009-10-02 19:12:10 +01:00
Colin Guthrie
20eedb2416 device-manager: Misc fixes to co-exist with other stream management/routing modules.
* Do not read or set the save_sink/save_source flags. This seems to be for module-stream-restore only...
 * Even if a sink is already set by an earlier module, still move it to the sink we dictate.
2009-10-01 22:12:16 +01:00
Colin Guthrie
3a20cf0b9f device-manager: Misc fixes.
* Fix a s/sink/source/ copy paste issue when dumping the database.
 * Only show priority list when routing is enabled (as the list is not updated if not)
 * Fix a memory access issue when finding the highest priority sinks/sources
 * key name->device name efficiency fix.
 * Silence noisy debug on reorder - it seems to work :)
 * Reroute after reordering.
 * Initialise preferred lists to PA_INVALID_INDEX
2009-10-01 21:30:24 +01:00
Colin Guthrie
b8a6436d4b device-manager: Fix the writing of the database when priority doesn't change. 2009-10-01 20:13:38 +01:00
Colin Guthrie
7633bb8a29 device-manager: Add extra debug messages 2009-10-01 09:08:33 +01:00
Colin Guthrie
f9b2d6500b device-manager: Change the prefer/defer options to a single 'reorder' command.
We put in the devices from the wire into a hashmap and then add all like type device in the database
and then order them based on priority (with the ones specified on the wire always being in that order at
the top of the list.
2009-10-01 09:08:32 +01:00
Colin Guthrie
8977abdc84 device-manager: Don't notify clients on every subscription (it happens all the time).
Also compare the entries fully before saving.
2009-10-01 09:08:32 +01:00
Colin Guthrie
bbf67019df device-manager: Save icon and report current availability over protocol.
This also ensures we let clients know whenver a sink changes in some capacity.
Also correct some debug code.
2009-10-01 09:08:32 +01:00
Colin Guthrie
8b2cc4def3 device-manager: Expose the priority lists in the protocol extension.
Also leave space for 'icon' and 'available' details too, althought currently this info is dummy.
2009-10-01 09:08:32 +01:00
Colin Guthrie
4dedba73a6 device-manager: Add a function to dump the database which we do whenever we save it (and on startup) 2009-10-01 09:08:32 +01:00
Colin Guthrie
1d43230006 device-manager: Reroute streams when they change allowing the media.role to be updated mid-stream.
We do not handle the _EVENT_NEW subscription here as the PA_CORE_HOOK_SINK_INPUT_NEW/PA_CORE_HOOK_SOURCE_OUTPUT_NEW
hook should handle the initial routing.
2009-10-01 09:08:32 +01:00
Colin Guthrie
d3460e3498 device-manager: Refactor the routing method to allow the routing of a single stream 2009-10-01 09:08:32 +01:00
Colin Guthrie
8d0787c1d5 device-manager: More sensible names for internal functions 2009-10-01 09:08:32 +01:00
Colin Guthrie
25f75342d4 device-manager: Reroute the streams on startup and update our cache on enable. 2009-10-01 09:08:31 +01:00
Colin Guthrie
0016b5e265 device-manager: Keep a cache of the highest priority devices for each role.
Rather than querying our database on every new stream, we keep a cache and only update it when a sink/source is added/removed.
2009-10-01 09:08:31 +01:00
Colin Guthrie
ce0b2bdc07 device-manager: Fix the database write mode 2009-10-01 09:08:31 +01:00
Colin Guthrie
9e447978eb device-manager: Some efficiency and safety tweaks 2009-10-01 09:08:31 +01:00
Colin Guthrie
e47f385b09 device-manager: Allow the routing component to be turned on via a module argument as well as via protocol extn. 2009-10-01 09:08:31 +01:00
Colin Guthrie
4fb9dafaf8 device-manager: Remove unused variables 2009-10-01 09:08:31 +01:00
Colin Guthrie
1d04c353ea device-manager: Set the most appropriate sink/source when new streams are created 2009-10-01 09:08:30 +01:00
Colin Guthrie
74c1c27eaa device-manager: Add routing functions that are triggered when sinks/soruces are added/removed. 2009-10-01 09:08:30 +01:00
Colin Guthrie
678d8e963d device-manager: Add a function to get a list of the highest priority device indexes for each role. 2009-10-01 09:08:30 +01:00
Colin Guthrie
ca68105c8f device-manager: Remove unneeded logic for checking for and (un)loading module-stream-restore. We can co-exist 2009-10-01 09:08:30 +01:00
Colin Guthrie
ed8af7c8fd device-manager: Rough framework (slots etc.) for handling routing.
This is incomplete, it just adds the slots in question and assigns noops to them.
Some minor cleanup of types.

Due to the priority of the hooks, it seems we can actually coexist with module-stream restore so
the code to detect and unload it will be removed shortly.
2009-10-01 09:08:30 +01:00