Chromium Code Reviews| Index: components/copresence/public/copresence_constants.h |
| diff --git a/components/copresence/public/copresence_constants.h b/components/copresence/public/copresence_constants.h |
| index 07c38cf0bcca34fe10d168d36fdf504c9a148b7d..fa0b4390022abbc4958bbbf4e607630ce947c01a 100644 |
| --- a/components/copresence/public/copresence_constants.h |
| +++ b/components/copresence/public/copresence_constants.h |
| @@ -5,8 +5,17 @@ |
| #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_ |
| #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_ |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/callback_forward.h" |
| +#include "base/memory/ref_counted.h" |
| #include "media/base/channel_layout.h" |
| +namespace media { |
| +class AudioBusRefCounted; |
| +} |
| + |
| namespace copresence { |
| // Audio constants. Currently used from the AudioPlayer/AudioRecorder. |
| @@ -38,6 +47,31 @@ enum AudioType { |
| AUDIO_TYPE_UNKNOWN = 3, |
| }; |
| +struct AudioToken { |
| + AudioToken(const std::string& token, bool audible) |
| + : token(token), audible(audible) {} |
| + std::string token; |
| + bool audible; |
| +}; |
| + |
| +// These callbacks are used from various places in Copresence. |
| + |
| +// Generic callback to indicate a boolean success or failure. |
| +using SuccessCallback = base::Callback<void(bool)>; |
| + |
| +// Callback to pass around found tokens. |
| +// Arguments: |
| +// const std::vector<AudioToken>& tokens - List of found tokens. |
| +using TokensCallback = base::Callback<void(const std::vector<AudioToken>&)>; |
| + |
| +// Callback to receive encoded samples from Whispernet. |
| +// const std::string& token: The token that we encoded. |
|
Charlie
2014/11/06 17:28:24
These arguments are now in a different order.
rkc
2014/11/06 19:58:25
Done.
|
| +// AudioType type: Type of audio encoding - AUDIBLE or INAUDIBLE. |
| +// const scoped_refptr<media::AudioBusRefCounted>& samples - Encoded samples. |
| +using SamplesCallback = |
| + base::Callback<void(AudioType, |
| + const std::string&, |
| + const scoped_refptr<media::AudioBusRefCounted>&)>; |
| } // namespace copresence |
| #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_ |