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 // Creates a unified stream based on the cras (ChromeOS audio server) interface. | 5 // Creates a unified stream based on the cras (ChromeOS audio server) interface. |
6 // | 6 // |
7 // CrasUnifiedStream object is *not* thread-safe and should only be used | 7 // CrasUnifiedStream object is *not* thread-safe and should only be used |
8 // from the audio thread. | 8 // from the audio thread. |
9 | 9 |
10 #ifndef MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 10 #ifndef MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Handles captured audio and fills the ouput with audio to be played. | 47 // Handles captured audio and fills the ouput with audio to be played. |
48 static int UnifiedCallback(cras_client* client, | 48 static int UnifiedCallback(cras_client* client, |
49 cras_stream_id_t stream_id, | 49 cras_stream_id_t stream_id, |
50 uint8* input_samples, | 50 uint8* input_samples, |
51 uint8* output_samples, | 51 uint8* output_samples, |
52 unsigned int frames, | 52 unsigned int frames, |
53 const timespec* input_ts, | 53 const timespec* input_ts, |
54 const timespec* output_ts, | 54 const timespec* output_ts, |
55 void* arg); | 55 void* arg); |
56 | 56 |
57 // Handles notification that there was an error with the playback stream. | 57 // Handles notificaiton that there was an error with the playback stream. |
58 static int StreamError(cras_client* client, | 58 static int StreamError(cras_client* client, |
59 cras_stream_id_t stream_id, | 59 cras_stream_id_t stream_id, |
60 int err, | 60 int err, |
61 void* arg); | 61 void* arg); |
62 | 62 |
63 // Chooses the correct audio callback based on stream direction. | 63 // Chooses the correct audio callback based on stream direction. |
64 uint32 DispatchCallback(size_t frames, | 64 uint32 DispatchCallback(size_t frames, |
65 uint8* input_samples, | 65 uint8* input_samples, |
66 uint8* output_samples, | 66 uint8* output_samples, |
67 const timespec* input_ts, | 67 const timespec* input_ts, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 // Direciton of the stream. | 111 // Direciton of the stream. |
112 CRAS_STREAM_DIRECTION stream_direction_; | 112 CRAS_STREAM_DIRECTION stream_direction_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); | 114 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStream); |
115 }; | 115 }; |
116 | 116 |
117 } // namespace media | 117 } // namespace media |
118 | 118 |
119 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ | 119 #endif // MEDIA_AUDIO_LINUX_CRAS_UNIFIED_H_ |
OLD | NEW |