Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: media/audio/cras/cras_input.cc

Issue 551823005: [Hotword] Adding audio parameters to handle audio coming from the DSP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: actually remove test Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/audio_parameters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/cras/cras_input.cc
diff --git a/media/audio/cras/cras_input.cc b/media/audio/cras/cras_input.cc
index 0b8644603f8996e670b988c282a1b234e4062ee0..e4579971589675b746630e1837cab2f16a489979 100644
--- a/media/audio/cras/cras_input.cc
+++ b/media/audio/cras/cras_input.cc
@@ -14,6 +14,9 @@
namespace media {
+// Flag to indicate hotword stream.
+static const uint32_t kHotwordParam = 1;
dgreid 2014/12/10 00:23:35 This will be 0x03. or even better HOTWORD_STREAM f
rpetterson 2014/12/10 00:37:43 Cool. When do you think that will land?
dgreid 2014/12/10 00:54:50 hopefully soon. I need to get a build without it a
rpetterson 2014/12/13 01:04:00 I've updated the way I think you mean. Let me know
+
CrasInputStream::CrasInputStream(const AudioParameters& params,
AudioManagerCras* manager,
const std::string& device_id)
@@ -159,6 +162,10 @@ void CrasInputStream::Start(AudioInputCallback* callback) {
return;
}
+ uint32_t flags = 0;
+ if (params_.effects() & AudioParameters::PlatformEffectsMask::HOTWORD)
+ flags = kHotwordParam;
+
unsigned int frames_per_packet = params_.frames_per_buffer();
cras_stream_params* stream_params = cras_client_stream_params_create(
stream_direction_,
@@ -166,7 +173,7 @@ void CrasInputStream::Start(AudioInputCallback* callback) {
frames_per_packet, // Call back when this many ready.
frames_per_packet, // Minimum Callback level ignored for capture streams.
CRAS_STREAM_TYPE_DEFAULT,
- 0, // Unused flags.
+ flags,
this,
CrasInputStream::SamplesReady,
CrasInputStream::StreamError,
« no previous file with comments | « media/audio/audio_parameters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698