| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ALSA_ALSA_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
| 6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ | 6 #define MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
| 7 | 7 |
| 8 #include <alsa/asoundlib.h> | 8 #include <alsa/asoundlib.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 std::string device_name_; | 73 std::string device_name_; |
| 74 AudioParameters params_; | 74 AudioParameters params_; |
| 75 int bytes_per_buffer_; | 75 int bytes_per_buffer_; |
| 76 AlsaWrapper* wrapper_; | 76 AlsaWrapper* wrapper_; |
| 77 base::TimeDelta buffer_duration_; // Length of each recorded buffer. | 77 base::TimeDelta buffer_duration_; // Length of each recorded buffer. |
| 78 AudioInputCallback* callback_; // Valid during a recording session. | 78 AudioInputCallback* callback_; // Valid during a recording session. |
| 79 base::TimeTicks next_read_time_; // Scheduled time for next read callback. | 79 base::TimeTicks next_read_time_; // Scheduled time for next read callback. |
| 80 snd_pcm_t* device_handle_; // Handle to the ALSA PCM recording device. | 80 snd_pcm_t* device_handle_; // Handle to the ALSA PCM recording device. |
| 81 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer. | 81 snd_mixer_t* mixer_handle_; // Handle to the ALSA microphone mixer. |
| 82 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element. | 82 snd_mixer_elem_t* mixer_element_handle_; // Handle to the capture element. |
| 83 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; | |
| 84 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data. | 83 scoped_ptr<uint8[]> audio_buffer_; // Buffer used for reading audio data. |
| 85 bool read_callback_behind_schedule_; | 84 bool read_callback_behind_schedule_; |
| 86 | 85 |
| 86 // NOTE: This must always be last so it's invalidated before other member |
| 87 // variables might be accessed. |
| 88 base::WeakPtrFactory<AlsaPcmInputStream> weak_factory_; |
| 89 |
| 87 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); | 90 DISALLOW_COPY_AND_ASSIGN(AlsaPcmInputStream); |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace media | 93 } // namespace media |
| 91 | 94 |
| 92 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ | 95 #endif // MEDIA_AUDIO_ALSA_ALSA_INPUT_H_ |
| OLD | NEW |