| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ | 5 #ifndef COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ |
| 6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ | 6 #define COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ |
| 7 | 7 |
| 8 #include <google/protobuf/repeated_field.h> |
| 9 |
| 8 #include <string> | 10 #include <string> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "components/copresence/tokens.h" | 15 #include "components/copresence/tokens.h" |
| 14 #include "media/base/channel_layout.h" | 16 #include "media/base/channel_layout.h" |
| 15 | 17 |
| 16 namespace media { | 18 namespace media { |
| 17 class AudioBusRefCounted; | 19 class AudioBusRefCounted; |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace copresence { | 22 namespace copresence { |
| 21 | 23 |
| 22 class Directive; | 24 class Directive; |
| 25 class SubscribedMessage; |
| 23 | 26 |
| 24 // Audio constants. Currently used from the AudioPlayer/AudioRecorder. | 27 // Audio constants. Currently used from the AudioPlayer/AudioRecorder. |
| 25 // TODO(rkc): Make these values configurable then remove them from here. | 28 // TODO(rkc): Make these values configurable then remove them from here. |
| 26 // Number of repetitions of the audio token in one sequence of samples. | 29 // Number of repetitions of the audio token in one sequence of samples. |
| 27 extern const int kDefaultRepetitions; | 30 extern const int kDefaultRepetitions; |
| 28 | 31 |
| 29 // The default sample rate. We need to ensure that both the recorder and the | 32 // The default sample rate. We need to ensure that both the recorder and the |
| 30 // player on _all platforms use the same rate. | 33 // player on _all platforms use the same rate. |
| 31 extern const float kDefaultSampleRate; | 34 extern const float kDefaultSampleRate; |
| 32 extern const int kDefaultBitsPerSample; | 35 extern const int kDefaultBitsPerSample; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 // const std::string& token: The token that we encoded. | 68 // const std::string& token: The token that we encoded. |
| 66 // const scoped_refptr<media::AudioBusRefCounted>& samples - Encoded samples. | 69 // const scoped_refptr<media::AudioBusRefCounted>& samples - Encoded samples. |
| 67 using SamplesCallback = | 70 using SamplesCallback = |
| 68 base::Callback<void(AudioType, | 71 base::Callback<void(AudioType, |
| 69 const std::string&, | 72 const std::string&, |
| 70 const scoped_refptr<media::AudioBusRefCounted>&)>; | 73 const scoped_refptr<media::AudioBusRefCounted>&)>; |
| 71 | 74 |
| 72 // Callback to pass a list of directives back to CopresenceState. | 75 // Callback to pass a list of directives back to CopresenceState. |
| 73 using DirectivesCallback = base::Callback<void(const std::vector<Directive>&)>; | 76 using DirectivesCallback = base::Callback<void(const std::vector<Directive>&)>; |
| 74 | 77 |
| 78 // Callback to pass around a list of SubscribedMessages. |
| 79 using MessagesCallback = base::Callback<void( |
| 80 const google::protobuf::RepeatedPtrField<SubscribedMessage>&)>; |
| 81 |
| 75 } // namespace copresence | 82 } // namespace copresence |
| 76 | 83 |
| 77 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ | 84 #endif // COMPONENTS_COPRESENCE_PUBLIC_COPRESENCE_CONSTANTS_H_ |
| OLD | NEW |