| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // DoResetNoDataTimer (posted on creating tread) | 48 // DoResetNoDataTimer (posted on creating tread) |
| 49 // .-------------------------> OnCreated() | 49 // .-------------------------> OnCreated() |
| 50 // kCreated | 50 // kCreated |
| 51 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 51 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 52 // Record() ==> DoRecord() | 52 // Record() ==> DoRecord() |
| 53 // AudioInputStream::Start() | 53 // AudioInputStream::Start() |
| 54 // .-------------------------> OnRecording() | 54 // .-------------------------> OnRecording() |
| 55 // kRecording | 55 // kRecording |
| 56 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 56 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 57 // Close() ==> DoClose() | 57 // Close() ==> DoClose() |
| 58 // state_ = kClosed |
| 58 // AudioInputStream::Stop() | 59 // AudioInputStream::Stop() |
| 59 // AudioInputStream::Close() | 60 // AudioInputStream::Close() |
| 60 // SyncWriter::Close() | 61 // SyncWriter::Close() |
| 61 // Closure::Run() | 62 // Closure::Run() <--------------. |
| 62 // (closure-task) <----------------. | 63 // (closure-task) |
| 63 // kClosed | |
| 64 // | 64 // |
| 65 // The audio thread itself is owned by the AudioManager that the | 65 // The audio thread itself is owned by the AudioManager that the |
| 66 // AudioInputController holds a reference to. When performing tasks on the | 66 // AudioInputController holds a reference to. When performing tasks on the |
| 67 // audio thread, the controller must not add or release references to the | 67 // audio thread, the controller must not add or release references to the |
| 68 // AudioManager or itself (since it in turn holds a reference to the manager). | 68 // AudioManager or itself (since it in turn holds a reference to the manager). |
| 69 // | 69 // |
| 70 namespace media { | 70 namespace media { |
| 71 | 71 |
| 72 class MEDIA_EXPORT AudioInputController | 72 class MEDIA_EXPORT AudioInputController |
| 73 : public base::RefCountedThreadSafe<AudioInputController>, | 73 : public base::RefCountedThreadSafe<AudioInputController>, |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 SyncWriter* sync_writer_; | 228 SyncWriter* sync_writer_; |
| 229 | 229 |
| 230 static Factory* factory_; | 230 static Factory* factory_; |
| 231 | 231 |
| 232 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 232 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 } // namespace media | 235 } // namespace media |
| 236 | 236 |
| 237 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 237 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
| OLD | NEW |