source-output: Add a preprocessor structure in pa_source_output_new_data 90/290790/7 accepted/tizen/unified/20230620.022503
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 3 Apr 2023 08:06:01 +0000 (17:06 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Thu, 13 Apr 2023 03:09:44 +0000 (12:09 +0900)
A preprocessor structure was added to source_output_new_data.
It will be used in tizenaudio-preprocessor module when source_output_new
callback is called. Moreover, processor was renamed preprocessor.

[Version] 15.0-18
[Issue Type] Update

Change-Id: Ifad73c1658c094b251049ac0c689bb2c94770f44
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio.spec
src/pulse/proplist.h
src/pulsecore/source-output.c
src/pulsecore/source-output.h

index 0ac8096..1f53ee4 100644 (file)
@@ -4,7 +4,7 @@
 Name:             pulseaudio
 Summary:          Improved Linux sound server
 Version:          15.0
-Release:          17
+Release:          18
 Group:            Multimedia/Audio
 License:          LGPL-2.1
 URL:              http://pulseaudio.org
index 69f0133..f9d1f92 100644 (file)
@@ -57,12 +57,9 @@ PA_C_DECL_BEGIN
 #define PA_PROP_MEDIA_REMOTE_DESCRIPTION       "media.remote.description"
 #define PA_PROP_MEDIA_REMOTE_ACCESS            "media.remote.access"
 
-/* Echo-cancellation */
-#define PA_PROP_MEDIA_ECHO_CANCEL_METHOD              "media.echo_cancel.method"
+#define PA_PROP_MEDIA_PREPROCESSOR_METHOD             "media.preprocessor.method" /* media.preprocessor.method="webrtc,rnnoise,agc" */
 #define PA_PROP_MEDIA_ECHO_CANCEL_REFERENCE_DEVICE    "media.echo_cancel.reference_device_id"
 #define PA_PROP_MEDIA_ECHO_CANCEL_REFERENCE_SINK      "media.echo_cancel.reference_device_sink"
-
-#define PA_PROP_MEDIA_NOISE_SUPPRESSION_ENABLE        "media.noise_suppression.enable"
 #endif
 
 /** For streams: localized media name, formatted as UTF-8. E.g. "Guns'N'Roses: Civil War".*/
index b587d29..82cacd0 100644 (file)
@@ -568,6 +568,9 @@ int pa_source_output_new(
     o->thread_info.muted = o->muted;
     o->thread_info.requested_source_latency = (pa_usec_t) -1;
     o->thread_info.direct_on_input = o->direct_on_input;
+#ifdef __TIZEN__
+    o->thread_info.processor_holder = data->processor_holder;
+#endif
 
     o->thread_info.delay_memblockq = pa_memblockq_new(
             "source output delay_memblockq",
@@ -936,7 +939,7 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
 
         if (!o->thread_info.resampler) {
 #ifdef TIZEN_AEC
-            if (o->post_process && !o->post_process(o, &qchunk, &ochunk))
+            if (o->preprocess && !o->preprocess(o, &qchunk, &ochunk))
                 o->push(o, &ochunk);
             else
                 o->push(o, &qchunk);
@@ -956,7 +959,7 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
 
             if (rchunk.length > 0) {
 #ifdef TIZEN_AEC
-                if (o->post_process && !o->post_process(o, &rchunk, &ochunk))
+                if (o->preprocess && !o->preprocess(o, &rchunk, &ochunk))
                     o->push(o, &ochunk);
                 else
                     o->push(o, &rchunk);
index 812ecbe..b10abc1 100644 (file)
@@ -58,8 +58,7 @@ typedef enum pa_source_output_flags {
     PA_SOURCE_OUTPUT_KILL_ON_SUSPEND = 1024,
     PA_SOURCE_OUTPUT_PASSTHROUGH = 2048,
 #ifdef __TIZEN__
-    PA_SOURCE_OUTPUT_NOISE_SUPPRESSION = 4096,
-    PA_SOURCE_OUTPUT_ECHO_CANCEL = 8192
+    PA_SOURCE_OUTPUT_PREPROCESSOR = 4096,
 #endif
 } pa_source_output_flags_t;
 
@@ -209,7 +208,7 @@ struct pa_source_output {
     void (*mute_changed)(pa_source_output *o); /* may be NULL */
 
 #ifdef __TIZEN__
-    int (*post_process)(pa_source_output *o, pa_memchunk *chunk, pa_memchunk *ochunk);
+    int (*preprocess)(pa_source_output *o, pa_memchunk *chunk, pa_memchunk *ochunk);
 #endif
 
     struct {
@@ -234,7 +233,7 @@ struct pa_source_output {
         pa_sink_input *direct_on_input;       /* may be NULL */
 
 #ifdef __TIZEN__
-        void *processor;
+        void *processor_holder;
 #endif
     } thread_info;
 #ifdef __TIZEN__
@@ -291,6 +290,7 @@ typedef struct pa_source_output_new_data {
     pa_cvolume volume, volume_factor, volume_factor_source;
 #ifdef __TIZEN__
     double individual_volume_ratio;
+    void *processor_holder;
 #endif
     bool muted:1;