| 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_CRAS_CRAS_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ |
| 6 #define MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ | 6 #define MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ |
| 7 | 7 |
| 8 #include <cras_client.h> | 8 #include <cras_client.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 virtual ~CrasInputStream(); | 33 virtual ~CrasInputStream(); |
| 34 | 34 |
| 35 // Implementation of AudioInputStream. | 35 // Implementation of AudioInputStream. |
| 36 virtual bool Open() override; | 36 virtual bool Open() override; |
| 37 virtual void Start(AudioInputCallback* callback) override; | 37 virtual void Start(AudioInputCallback* callback) override; |
| 38 virtual void Stop() override; | 38 virtual void Stop() override; |
| 39 virtual void Close() override; | 39 virtual void Close() override; |
| 40 virtual double GetMaxVolume() override; | 40 virtual double GetMaxVolume() override; |
| 41 virtual void SetVolume(double volume) override; | 41 virtual void SetVolume(double volume) override; |
| 42 virtual double GetVolume() override; | 42 virtual double GetVolume() override; |
| 43 virtual bool IsMuted() override; |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 // Handles requests to get samples from the provided buffer. This will be | 46 // Handles requests to get samples from the provided buffer. This will be |
| 46 // called by the audio server when it has samples ready. | 47 // called by the audio server when it has samples ready. |
| 47 static int SamplesReady(cras_client* client, | 48 static int SamplesReady(cras_client* client, |
| 48 cras_stream_id_t stream_id, | 49 cras_stream_id_t stream_id, |
| 49 uint8* samples, | 50 uint8* samples, |
| 50 size_t frames, | 51 size_t frames, |
| 51 const timespec* sample_ts, | 52 const timespec* sample_ts, |
| 52 void* arg); | 53 void* arg); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const CRAS_STREAM_DIRECTION stream_direction_; | 100 const CRAS_STREAM_DIRECTION stream_direction_; |
| 100 | 101 |
| 101 scoped_ptr<AudioBus> audio_bus_; | 102 scoped_ptr<AudioBus> audio_bus_; |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(CrasInputStream); | 104 DISALLOW_COPY_AND_ASSIGN(CrasInputStream); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace media | 107 } // namespace media |
| 107 | 108 |
| 108 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ | 109 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ |
| OLD | NEW |