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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 private: | 44 private: |
45 // Handles requests to get samples from the provided buffer. This will be | 45 // Handles requests to get samples from the provided buffer. This will be |
46 // called by the audio server when it has samples ready. | 46 // called by the audio server when it has samples ready. |
47 static int SamplesReady(cras_client* client, | 47 static int SamplesReady(cras_client* client, |
48 cras_stream_id_t stream_id, | 48 cras_stream_id_t stream_id, |
49 uint8* samples, | 49 uint8* samples, |
50 size_t frames, | 50 size_t frames, |
51 const timespec* sample_ts, | 51 const timespec* sample_ts, |
52 void* arg); | 52 void* arg); |
53 | 53 |
54 // Handles notification that there was an error with the playback stream. | 54 // Handles notificaiton that there was an error with the playback stream. |
55 static int StreamError(cras_client* client, | 55 static int StreamError(cras_client* client, |
56 cras_stream_id_t stream_id, | 56 cras_stream_id_t stream_id, |
57 int err, | 57 int err, |
58 void* arg); | 58 void* arg); |
59 | 59 |
60 // Reads one or more buffers of audio from the device, passes on to the | 60 // Reads one or more buffers of audio from the device, passes on to the |
61 // registered callback. Called from SamplesReady(). | 61 // registered callback. Called from SamplesReady(). |
62 void ReadAudio(size_t frames, uint8* buffer, const timespec* sample_ts); | 62 void ReadAudio(size_t frames, uint8* buffer, const timespec* sample_ts); |
63 | 63 |
64 // Deals with an error that occured in the stream. Called from StreamError(). | 64 // Deals with an error that occured in the stream. Called from StreamError(). |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Direction of the stream. | 98 // Direction of the stream. |
99 const CRAS_STREAM_DIRECTION stream_direction_; | 99 const CRAS_STREAM_DIRECTION stream_direction_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(CrasInputStream); | 101 DISALLOW_COPY_AND_ASSIGN(CrasInputStream); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace media | 104 } // namespace media |
105 | 105 |
106 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ | 106 #endif // MEDIA_AUDIO_CRAS_CRAS_INPUT_H_ |
OLD | NEW |