Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / audio_processing / include / audio_processing.h
index 6ed23f4..c34baac 100644 (file)
@@ -15,7 +15,6 @@
 #include <stdio.h>  // FILE
 
 #include "webrtc/common.h"
-#include "webrtc/modules/interface/module.h"
 #include "webrtc/typedefs.h"
 
 struct AecCore;
@@ -50,8 +49,15 @@ class VoiceDetection;
 //   except when really necessary.
 struct DelayCorrection {
   DelayCorrection() : enabled(false) {}
-  DelayCorrection(bool enabled) : enabled(enabled) {}
+  explicit DelayCorrection(bool enabled) : enabled(enabled) {}
+  bool enabled;
+};
 
+// Must be provided through AudioProcessing::Create(Confg&). It will have no
+// impact if used with AudioProcessing::SetExtraOptions().
+struct ExperimentalAgc {
+  ExperimentalAgc() : enabled(true) {}
+  explicit ExperimentalAgc(bool enabled) : enabled(enabled) {}
   bool enabled;
 };
 
@@ -127,13 +133,17 @@ struct DelayCorrection {
 // // Close the application...
 // delete apm;
 //
-class AudioProcessing : public Module {
+class AudioProcessing {
  public:
-  // Creates a APM instance, with identifier |id|. Use one instance for every
-  // primary audio stream requiring processing. On the client-side, this would
-  // typically be one instance for the near-end stream, and additional instances
-  // for each far-end stream which requires processing. On the server-side,
-  // this would typically be one instance for every incoming stream.
+  // Creates an APM instance. Use one instance for every primary audio stream
+  // requiring processing. On the client-side, this would typically be one
+  // instance for the near-end stream, and additional instances for each far-end
+  // stream which requires processing. On the server-side, this would typically
+  // be one instance for every incoming stream.
+  static AudioProcessing* Create();
+  // Allows passing in an optional configuration at create-time.
+  static AudioProcessing* Create(const Config& config);
+  // TODO(ajm): Deprecated; remove all calls to it.
   static AudioProcessing* Create(int id);
   virtual ~AudioProcessing() {}
 
@@ -175,6 +185,13 @@ class AudioProcessing : public Module {
   virtual int set_num_reverse_channels(int channels) = 0;
   virtual int num_reverse_channels() const = 0;
 
+  // Set to true when the output of AudioProcessing will be muted or in some
+  // other way not used. Ideally, the captured audio would still be processed,
+  // but some components may change behavior based on this information.
+  // Default false.
+  virtual void set_output_will_be_muted(bool muted) = 0;
+  virtual bool output_will_be_muted() const = 0;
+
   // Processes a 10 ms |frame| of the primary audio stream. On the client-side,
   // this is the near-end (or captured) audio.
   //
@@ -220,6 +237,11 @@ class AudioProcessing : public Module {
   virtual int set_stream_delay_ms(int delay) = 0;
   virtual int stream_delay_ms() const = 0;
 
+  // Call to signal that a key press occurred (true) or did not occur (false)
+  // with this chunk of audio.
+  virtual void set_stream_key_pressed(bool key_pressed) = 0;
+  virtual bool stream_key_pressed() const = 0;
+
   // Sets a delay |offset| in ms to add to the values passed in through
   // set_stream_delay_ms(). May be positive or negative.
   //
@@ -282,10 +304,6 @@ class AudioProcessing : public Module {
     // will continue, but the parameter may have been truncated.
     kBadStreamParameterWarning = -13
   };
-
-  // Inherited from Module.
-  virtual int32_t TimeUntilNextProcess() OVERRIDE;
-  virtual int32_t Process() OVERRIDE;
 };
 
 // The acoustic echo cancellation (AEC) component provides better performance