OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 private: | 218 private: |
219 AlsaSoundSystem *alsa_; | 219 AlsaSoundSystem *alsa_; |
220 snd_pcm_t *handle_; | 220 snd_pcm_t *handle_; |
221 size_t frame_size_; | 221 size_t frame_size_; |
222 int wait_timeout_ms_; | 222 int wait_timeout_ms_; |
223 int flags_; | 223 int flags_; |
224 int freq_; | 224 int freq_; |
225 | 225 |
226 DISALLOW_COPY_AND_ASSIGN(AlsaStream); | 226 RTC_DISALLOW_COPY_AND_ASSIGN(AlsaStream); |
227 }; | 227 }; |
228 | 228 |
229 // Implementation of an input stream. See soundinputstreaminterface.h regarding | 229 // Implementation of an input stream. See soundinputstreaminterface.h regarding |
230 // thread-safety. | 230 // thread-safety. |
231 class AlsaInputStream : | 231 class AlsaInputStream : |
232 public SoundInputStreamInterface, | 232 public SoundInputStreamInterface, |
233 private rtc::Worker { | 233 private rtc::Worker { |
234 public: | 234 public: |
235 AlsaInputStream(AlsaSoundSystem *alsa, | 235 AlsaInputStream(AlsaSoundSystem *alsa, |
236 snd_pcm_t *handle, | 236 snd_pcm_t *handle, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 | 323 |
324 const char *GetError(int err) { | 324 const char *GetError(int err) { |
325 return stream_.GetError(err); | 325 return stream_.GetError(err); |
326 } | 326 } |
327 | 327 |
328 AlsaStream stream_; | 328 AlsaStream stream_; |
329 rtc::scoped_ptr<char[]> buffer_; | 329 rtc::scoped_ptr<char[]> buffer_; |
330 size_t buffer_size_; | 330 size_t buffer_size_; |
331 | 331 |
332 DISALLOW_COPY_AND_ASSIGN(AlsaInputStream); | 332 RTC_DISALLOW_COPY_AND_ASSIGN(AlsaInputStream); |
333 }; | 333 }; |
334 | 334 |
335 // Implementation of an output stream. See soundoutputstreaminterface.h | 335 // Implementation of an output stream. See soundoutputstreaminterface.h |
336 // regarding thread-safety. | 336 // regarding thread-safety. |
337 class AlsaOutputStream : | 337 class AlsaOutputStream : |
338 public SoundOutputStreamInterface, | 338 public SoundOutputStreamInterface, |
339 private rtc::Worker { | 339 private rtc::Worker { |
340 public: | 340 public: |
341 AlsaOutputStream(AlsaSoundSystem *alsa, | 341 AlsaOutputStream(AlsaSoundSystem *alsa, |
342 snd_pcm_t *handle, | 342 snd_pcm_t *handle, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 virtual void OnStop() { | 427 virtual void OnStop() { |
428 // Nothing to do. | 428 // Nothing to do. |
429 } | 429 } |
430 | 430 |
431 const char *GetError(int err) { | 431 const char *GetError(int err) { |
432 return stream_.GetError(err); | 432 return stream_.GetError(err); |
433 } | 433 } |
434 | 434 |
435 AlsaStream stream_; | 435 AlsaStream stream_; |
436 | 436 |
437 DISALLOW_COPY_AND_ASSIGN(AlsaOutputStream); | 437 RTC_DISALLOW_COPY_AND_ASSIGN(AlsaOutputStream); |
438 }; | 438 }; |
439 | 439 |
440 AlsaSoundSystem::AlsaSoundSystem() : initialized_(false) {} | 440 AlsaSoundSystem::AlsaSoundSystem() : initialized_(false) {} |
441 | 441 |
442 AlsaSoundSystem::~AlsaSoundSystem() { | 442 AlsaSoundSystem::~AlsaSoundSystem() { |
443 // Not really necessary, because Terminate() doesn't really do anything. | 443 // Not really necessary, because Terminate() doesn't really do anything. |
444 Terminate(); | 444 Terminate(); |
445 } | 445 } |
446 | 446 |
447 bool AlsaSoundSystem::Init() { | 447 bool AlsaSoundSystem::Init() { |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 } | 736 } |
737 return new AlsaInputStream( | 737 return new AlsaInputStream( |
738 this, handle, frame_size, wait_timeout_ms, flags, freq); | 738 this, handle, frame_size, wait_timeout_ms, flags, freq); |
739 } | 739 } |
740 | 740 |
741 inline const char *AlsaSoundSystem::GetError(int err) { | 741 inline const char *AlsaSoundSystem::GetError(int err) { |
742 return symbol_table_.snd_strerror()(err); | 742 return symbol_table_.snd_strerror()(err); |
743 } | 743 } |
744 | 744 |
745 } // namespace rtc | 745 } // namespace rtc |
OLD | NEW |