OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 an output stream based on the ALSA PCM interface. | 5 // Creates an output stream based on the ALSA PCM interface. |
6 // | 6 // |
7 // On device write failure, the stream will move itself to an invalid state. | 7 // On device write failure, the stream will move itself to an invalid state. |
8 // No more data will be pulled from the data source, or written to the device. | 8 // No more data will be pulled from the data source, or written to the device. |
9 // All calls to public API functions will either no-op themselves, or return an | 9 // All calls to public API functions will either no-op themselves, or return an |
10 // error if possible. Specifically, If the stream is in an error state, Open() | 10 // error if possible. Specifically, If the stream is in an error state, Open() |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 AlsaWrapper* wrapper, | 75 AlsaWrapper* wrapper, |
76 AudioManagerLinux* manager, | 76 AudioManagerLinux* manager, |
77 MessageLoop* message_loop); | 77 MessageLoop* message_loop); |
78 virtual ~AlsaPcmOutputStream(); | 78 virtual ~AlsaPcmOutputStream(); |
79 | 79 |
80 // Implementation of AudioOutputStream. | 80 // Implementation of AudioOutputStream. |
81 virtual bool Open(size_t packet_size); | 81 virtual bool Open(size_t packet_size); |
82 virtual void Close(); | 82 virtual void Close(); |
83 virtual void Start(AudioSourceCallback* callback); | 83 virtual void Start(AudioSourceCallback* callback); |
84 virtual void Stop(); | 84 virtual void Stop(); |
85 virtual void SetVolume(double left_level, double right_level); | 85 virtual void SetVolume(double volume); |
86 virtual void GetVolume(double* left_level, double* right_level); | 86 virtual void GetVolume(double* volume); |
87 | 87 |
88 private: | 88 private: |
89 friend class AlsaPcmOutputStreamTest; | 89 friend class AlsaPcmOutputStreamTest; |
90 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_DeviceSelect); | 90 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_DeviceSelect); |
91 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_FallbackDevices); | 91 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_FallbackDevices); |
92 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_HintFail); | 92 FRIEND_TEST(AlsaPcmOutputStreamTest, AutoSelectDevice_HintFail); |
93 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket); | 93 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket); |
94 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket_StopStream); | 94 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket_StopStream); |
95 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket_UnfinishedPacket); | 95 FRIEND_TEST(AlsaPcmOutputStreamTest, BufferPacket_UnfinishedPacket); |
96 FRIEND_TEST(AlsaPcmOutputStreamTest, ConstructedState); | 96 FRIEND_TEST(AlsaPcmOutputStreamTest, ConstructedState); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 MessageLoop* client_thread_loop_; | 250 MessageLoop* client_thread_loop_; |
251 | 251 |
252 // The message loop responsible for querying the data source, and writing to | 252 // The message loop responsible for querying the data source, and writing to |
253 // the output device. | 253 // the output device. |
254 MessageLoop* message_loop_; | 254 MessageLoop* message_loop_; |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); | 256 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); |
257 }; | 257 }; |
258 | 258 |
259 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ | 259 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ |
OLD | NEW |