| 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_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| 6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 FRIEND_TEST_ALL_PREFIXES(AudioDirectiveHandlerTest, Basic); | 84 FRIEND_TEST_ALL_PREFIXES(AudioDirectiveHandlerTest, Basic); |
| 85 | 85 |
| 86 typedef TimedMap<std::string, scoped_refptr<media::AudioBusRefCounted> > | 86 typedef TimedMap<std::string, scoped_refptr<media::AudioBusRefCounted> > |
| 87 SamplesMap; | 87 SamplesMap; |
| 88 | 88 |
| 89 // Processes the next active transmit instruction. | 89 // Processes the next active transmit instruction. |
| 90 void ProcessNextTransmit(); | 90 void ProcessNextTransmit(); |
| 91 // Processes the next active receive instruction. | 91 // Processes the next active receive instruction. |
| 92 void ProcessNextReceive(); | 92 void ProcessNextReceive(); |
| 93 | 93 |
| 94 void HandleToken(const std::string token, bool audible); | 94 void PlayToken(const std::string token, bool audible); |
| 95 | 95 |
| 96 // This is the method that the whispernet client needs to call to return | 96 // This is the method that the whispernet client needs to call to return |
| 97 // samples to us. | 97 // samples to us. |
| 98 void OnTokenEncoded(const std::string& token, | 98 void PlayEncodedToken( |
| 99 bool audible, | 99 const std::string& token, |
| 100 const scoped_refptr<media::AudioBusRefCounted>& samples); | 100 bool audible, |
| 101 const scoped_refptr<media::AudioBusRefCounted>& samples); |
| 101 | 102 |
| 102 AudioDirectiveList transmits_list_audible_; | 103 AudioDirectiveList transmits_list_audible_; |
| 103 AudioDirectiveList transmits_list_inaudible_; | 104 AudioDirectiveList transmits_list_inaudible_; |
| 104 AudioDirectiveList receives_list_; | 105 AudioDirectiveList receives_list_; |
| 105 | 106 |
| 106 // Currently playing tokens. | 107 // Currently playing tokens. |
| 107 std::string current_token_audible_; | 108 std::string current_token_audible_; |
| 108 std::string current_token_inaudible_; | 109 std::string current_token_inaudible_; |
| 109 | 110 |
| 110 // AudioPlayer and AudioRecorder objects are self-deleting. When we call | 111 // AudioPlayer and AudioRecorder objects are self-deleting. When we call |
| (...skipping 13 matching lines...) Expand all Loading... |
| 124 // expires the oldest samples first. | 125 // expires the oldest samples first. |
| 125 SamplesMap samples_cache_audible_; | 126 SamplesMap samples_cache_audible_; |
| 126 SamplesMap samples_cache_inaudible_; | 127 SamplesMap samples_cache_inaudible_; |
| 127 | 128 |
| 128 DISALLOW_COPY_AND_ASSIGN(AudioDirectiveHandler); | 129 DISALLOW_COPY_AND_ASSIGN(AudioDirectiveHandler); |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 } // namespace copresence | 132 } // namespace copresence |
| 132 | 133 |
| 133 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ | 134 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_AUDIO_DIRECTIVE_HANDLER_H_ |
| OLD | NEW |