summaryrefslogtreecommitdiff
path: root/chromium/media/renderers/audio_renderer_impl.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/media/renderers/audio_renderer_impl.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/renderers/audio_renderer_impl.h')
-rw-r--r--chromium/media/renderers/audio_renderer_impl.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/chromium/media/renderers/audio_renderer_impl.h b/chromium/media/renderers/audio_renderer_impl.h
index 33ef7e22a69..7755d20ce15 100644
--- a/chromium/media/renderers/audio_renderer_impl.h
+++ b/chromium/media/renderers/audio_renderer_impl.h
@@ -49,6 +49,7 @@ namespace media {
class AudioBufferConverter;
class AudioBus;
class AudioClock;
+class SpeechRecognitionClient;
class MEDIA_EXPORT AudioRendererImpl
: public AudioRenderer,
@@ -62,6 +63,9 @@ class MEDIA_EXPORT AudioRendererImpl
using TranscribeAudioCallback =
base::RepeatingCallback<void(scoped_refptr<media::AudioBuffer>)>;
+ using EnableSpeechRecognitionCallback =
+ base::OnceCallback<void(TranscribeAudioCallback)>;
+
// |task_runner| is the thread on which AudioRendererImpl will execute.
//
// |sink| is used as the destination for the rendered audio.
@@ -72,7 +76,7 @@ class MEDIA_EXPORT AudioRendererImpl
AudioRendererSink* sink,
const CreateAudioDecodersCB& create_audio_decoders_cb,
MediaLog* media_log,
- const TranscribeAudioCallback& transcribe_audio_callback);
+ SpeechRecognitionClient* speech_recognition_client = nullptr);
~AudioRendererImpl() override;
// TimeSource implementation.
@@ -95,6 +99,7 @@ class MEDIA_EXPORT AudioRendererImpl
void StartPlaying() override;
void SetVolume(float volume) override;
void SetLatencyHint(base::Optional<base::TimeDelta> latency_hint) override;
+ void SetPreservesPitch(bool preserves_pitch) override;
// base::PowerObserver implementation.
void OnSuspend() override;
@@ -224,6 +229,9 @@ class MEDIA_EXPORT AudioRendererImpl
// changes. Expect the layout in |last_decoded_channel_layout_|.
void ConfigureChannelMask();
+ void EnableSpeechRecognition();
+ void TranscribeAudio(scoped_refptr<media::AudioBuffer> buffer);
+
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
std::unique_ptr<AudioBufferConverter> buffer_converter_;
@@ -293,6 +301,10 @@ class MEDIA_EXPORT AudioRendererImpl
// during Initialize().
base::Optional<base::TimeDelta> latency_hint_;
+ // Passed to |algorithm_|. Indicates whether |algorithm_| should or should not
+ // make pitch adjustments at playbacks other than 1.0.
+ bool preserves_pitch_ = true;
+
// Simple state tracking variable.
State state_;
@@ -350,7 +362,10 @@ class MEDIA_EXPORT AudioRendererImpl
// End variables which must be accessed under |lock_|. ----------------------
+#if !defined(OS_ANDROID)
+ SpeechRecognitionClient* speech_recognition_client_;
TranscribeAudioCallback transcribe_audio_callback_;
+#endif
// NOTE: Weak pointers must be invalidated before all other member variables.
base::WeakPtrFactory<AudioRendererImpl> weak_factory_{this};