OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const; | 58 int32_t MicrophoneVolumeStepSize(uint16_t& stepSize) const; |
59 int32_t SetPulseAudioObjects(pa_threaded_mainloop* mainloop, | 59 int32_t SetPulseAudioObjects(pa_threaded_mainloop* mainloop, |
60 pa_context* context); | 60 pa_context* context); |
61 int32_t Close(); | 61 int32_t Close(); |
62 int32_t CloseSpeaker(); | 62 int32_t CloseSpeaker(); |
63 int32_t CloseMicrophone(); | 63 int32_t CloseMicrophone(); |
64 bool SpeakerIsInitialized() const; | 64 bool SpeakerIsInitialized() const; |
65 bool MicrophoneIsInitialized() const; | 65 bool MicrophoneIsInitialized() const; |
66 | 66 |
67 public: | 67 public: |
68 AudioMixerManagerLinuxPulse(const int32_t id); | 68 AudioMixerManagerLinuxPulse(); |
69 ~AudioMixerManagerLinuxPulse(); | 69 ~AudioMixerManagerLinuxPulse(); |
70 | 70 |
71 private: | 71 private: |
72 static void PaSinkInfoCallback(pa_context *c, const pa_sink_info *i, | 72 static void PaSinkInfoCallback(pa_context *c, const pa_sink_info *i, |
73 int eol, void *pThis); | 73 int eol, void *pThis); |
74 static void PaSinkInputInfoCallback(pa_context *c, | 74 static void PaSinkInputInfoCallback(pa_context *c, |
75 const pa_sink_input_info *i, int eol, | 75 const pa_sink_input_info *i, int eol, |
76 void *pThis); | 76 void *pThis); |
77 static void PaSourceInfoCallback(pa_context *c, const pa_source_info *i, | 77 static void PaSourceInfoCallback(pa_context *c, const pa_source_info *i, |
78 int eol, void *pThis); | 78 int eol, void *pThis); |
79 static void | 79 static void |
80 PaSetVolumeCallback(pa_context* /*c*/, int success, void* /*pThis*/); | 80 PaSetVolumeCallback(pa_context* /*c*/, int success, void* /*pThis*/); |
81 void PaSinkInfoCallbackHandler(const pa_sink_info *i, int eol); | 81 void PaSinkInfoCallbackHandler(const pa_sink_info *i, int eol); |
82 void PaSinkInputInfoCallbackHandler(const pa_sink_input_info *i, int eol); | 82 void PaSinkInputInfoCallbackHandler(const pa_sink_input_info *i, int eol); |
83 void PaSourceInfoCallbackHandler(const pa_source_info *i, int eol); | 83 void PaSourceInfoCallbackHandler(const pa_source_info *i, int eol); |
84 | 84 |
85 void WaitForOperationCompletion(pa_operation* paOperation) const; | 85 void WaitForOperationCompletion(pa_operation* paOperation) const; |
86 | 86 |
87 bool GetSinkInputInfo() const; | 87 bool GetSinkInputInfo() const; |
88 bool GetSinkInfoByIndex(int device_index)const ; | 88 bool GetSinkInfoByIndex(int device_index)const ; |
89 bool GetSourceInfoByIndex(int device_index) const; | 89 bool GetSourceInfoByIndex(int device_index) const; |
90 | 90 |
91 private: | 91 private: |
92 int32_t _id; | |
93 int16_t _paOutputDeviceIndex; | 92 int16_t _paOutputDeviceIndex; |
94 int16_t _paInputDeviceIndex; | 93 int16_t _paInputDeviceIndex; |
95 | 94 |
96 pa_stream* _paPlayStream; | 95 pa_stream* _paPlayStream; |
97 pa_stream* _paRecStream; | 96 pa_stream* _paRecStream; |
98 | 97 |
99 pa_threaded_mainloop* _paMainloop; | 98 pa_threaded_mainloop* _paMainloop; |
100 pa_context* _paContext; | 99 pa_context* _paContext; |
101 | 100 |
102 mutable uint32_t _paVolume; | 101 mutable uint32_t _paVolume; |
103 mutable uint32_t _paMute; | 102 mutable uint32_t _paMute; |
104 mutable uint32_t _paVolSteps; | 103 mutable uint32_t _paVolSteps; |
105 bool _paSpeakerMute; | 104 bool _paSpeakerMute; |
106 mutable uint32_t _paSpeakerVolume; | 105 mutable uint32_t _paSpeakerVolume; |
107 mutable uint8_t _paChannels; | 106 mutable uint8_t _paChannels; |
108 bool _paObjectsSet; | 107 bool _paObjectsSet; |
109 | 108 |
110 // Stores thread ID in constructor. | 109 // Stores thread ID in constructor. |
111 // We can then use ThreadChecker::CalledOnValidThread() to ensure that | 110 // We can then use ThreadChecker::CalledOnValidThread() to ensure that |
112 // other methods are called from the same thread. | 111 // other methods are called from the same thread. |
113 // Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()). | 112 // Currently only does RTC_DCHECK(thread_checker_.CalledOnValidThread()). |
114 rtc::ThreadChecker thread_checker_; | 113 rtc::ThreadChecker thread_checker_; |
115 }; | 114 }; |
116 | 115 |
117 } | 116 } |
118 | 117 |
119 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_LINUX_AUDIO_MIXER_MANAGER_PULSE_LINU
X_H_ | 118 #endif // MODULES_AUDIO_DEVICE_MAIN_SOURCE_LINUX_AUDIO_MIXER_MANAGER_PULSE_LINU
X_H_ |
OLD | NEW |