Commit graph

14 commits

Author SHA1 Message Date
Sangchul Lee
a56c8a14d6 stream-interaction: Remove useless condition
Signed-off-by: Sangchul Lee
2019-03-26 14:54:15 +00:00
Sangchul Lee
65cc86f609 role-ducking, role-cork: Add use_source_trigger argument
This is added to keep backward compatibility. The default value of
this new argument is false. Therefore, triggering by source-output
will be activated only if it is set to true explicitly.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
Sangchul Lee
5540f728e5 stream-interaction: Use PA_IDXSET_FOREACH macro to iterate idxset
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
Sangchul Lee
0f4f109a3c stream-interaction: Support for triggering ducking/cork by source-output
Previously, media.role property of only sink-input is used to
determine to trigger and apply ducking or cork to sink-inputs.

On the other hand, some use cases require that source-output
also need to trigger the effect to sink-inputs. Therefore this
patch adds logic to retrieve source-ouputs to find trigger role
by checking media.role property and apply ducking/cork to sink-
inputs that meet conditions.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2019-03-26 14:54:15 +00:00
Tanu Kaskinen
b4a36453da sink-input, source-output: remove the state getters
pa_sink_input_get_state() and pa_source_output_get_state() just return
the state variable. We can as well access the state variable directly.

There are no behaviour changes, except that some filter sources accessed
the main thread's state variable from their push() callbacks. I fixed
them so that they use the thread_info.state variable instead.
2018-07-02 18:54:03 +03:00
Arun Raghavan
74c9549a42 stream-interaction: Fix a memory leak
CID: 1352053
2016-08-10 22:23:02 +05:30
Sangchul Lee
b5e5475d96 stream-interaction: Fix crash in case of invalid argument for volume
In case of invalid argument for volume, the crash occurs in pa_stream_interaction_done().
pa_xnew() is replaced with pa_xnew0() to fix it.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2016-04-20 16:37:18 +03:00
Sangchul Lee
b08f38385d role-ducking: Add support for ducking group
Now, trigger_roles, ducking_roles and volume can be divided into several groups by slash.
That means each group can be affected by its own volume policy.

If we need to apply ducking volume level differently that is triggered from
each trigger role(s), this feature would be useful for this purpose.

For example, let's assume that tts should take music and video's volume down to 40%
whereas voice_recognition should take those and tts's volume down to 20%.
In this case, the configuration can be written as below.
  trigger_roles=tts/voice_recognition ducking_roles=music,video/music,video,tts volume=40%/20%

If one of ducking role is affected by more than two trigger roles simultaneously,
volume of the ducking role will be applied by method of multiplication.
And it works in the same way as before without any slash.

Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
2016-04-20 16:31:31 +03:00
Georg Chini
d9c91f852e stream-interaction: interact if a stream starts corked
This patch deals with the case that applications start new streams corked.
In case of module-role-cork it will only mute the stream because corking is
removed later by the application.
2016-03-21 20:26:57 +02:00
Georg Chini
2ed0f1cb24 stream-interaction: add ducking functionality 2016-03-21 14:29:02 +02:00
Georg Chini
4731690a21 stream-interaction: Bugfix for improper uncorking behavior with global=1
This patch is based on a recent patch for module-role-ducking from Sangchul Lee
which fixes incorrect behavior when global is set to 1. Original commit can be found
here:
https://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=d049c2941e6aef5ff33bcd0b4adece12289302b7
2016-03-18 10:14:31 +02:00
Georg Chini
bc10d26621 role-cork: more cosmetic changes, changed debug output
Change names of shall_interact() and is_trigger_stream() because the names look
like the functions return a boolean. Simpler debugging output.
2016-03-16 13:29:04 +02:00
Georg Chini
c03cf89b33 role-cork: prepare merge with role-ducking: replace "cork" with "interact" where appropriate
Again, interact includes cork and duck.
2016-03-15 13:02:04 +02:00
Georg Chini
f12102857a role-cork: prepare merge with role-ducking: move most code to stream-interaction.c
Filename suggested by Tanu, as it includes both, cork and duck.
2016-03-14 10:46:57 +02:00