Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Side by Side Diff: media/audio/alsa/audio_manager_alsa.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/alsa/audio_manager_alsa.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_ 5 #ifndef MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_
6 #define MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_ 6 #define MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "media/audio/audio_manager_base.h" 15 #include "media/audio/audio_manager_base.h"
16 16
17 namespace media { 17 namespace media {
18 18
19 class AlsaWrapper; 19 class AlsaWrapper;
20 20
21 class MEDIA_EXPORT AudioManagerAlsa : public AudioManagerBase { 21 class MEDIA_EXPORT AudioManagerAlsa : public AudioManagerBase {
22 public: 22 public:
23 AudioManagerAlsa( 23 AudioManagerAlsa(std::unique_ptr<AudioThread> audio_thread,
24 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 24 AudioLogFactory* audio_log_factory);
25 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 25 ~AudioManagerAlsa() override;
26 AudioLogFactory* audio_log_factory);
27 26
28 static void ShowLinuxAudioInputSettings(); 27 static void ShowLinuxAudioInputSettings();
29 28
30 // Implementation of AudioManager. 29 // Implementation of AudioManager.
31 bool HasAudioOutputDevices() override; 30 bool HasAudioOutputDevices() override;
32 bool HasAudioInputDevices() override; 31 bool HasAudioInputDevices() override;
33 void ShowAudioInputSettings() override; 32 void ShowAudioInputSettings() override;
34 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; 33 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
35 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; 34 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override;
36 AudioParameters GetInputStreamParameters( 35 AudioParameters GetInputStreamParameters(
(...skipping 11 matching lines...) Expand all
48 AudioInputStream* MakeLinearInputStream( 47 AudioInputStream* MakeLinearInputStream(
49 const AudioParameters& params, 48 const AudioParameters& params,
50 const std::string& device_id, 49 const std::string& device_id,
51 const LogCallback& log_callback) override; 50 const LogCallback& log_callback) override;
52 AudioInputStream* MakeLowLatencyInputStream( 51 AudioInputStream* MakeLowLatencyInputStream(
53 const AudioParameters& params, 52 const AudioParameters& params,
54 const std::string& device_id, 53 const std::string& device_id,
55 const LogCallback& log_callback) override; 54 const LogCallback& log_callback) override;
56 55
57 protected: 56 protected:
58 ~AudioManagerAlsa() override;
59
60 AudioParameters GetPreferredOutputStreamParameters( 57 AudioParameters GetPreferredOutputStreamParameters(
61 const std::string& output_device_id, 58 const std::string& output_device_id,
62 const AudioParameters& input_params) override; 59 const AudioParameters& input_params) override;
63 60
64 private: 61 private:
65 enum StreamType { 62 enum StreamType {
66 kStreamPlayback = 0, 63 kStreamPlayback = 0,
67 kStreamCapture, 64 kStreamCapture,
68 }; 65 };
69 66
(...skipping 24 matching lines...) Expand all
94 const std::string& device_id); 91 const std::string& device_id);
95 92
96 std::unique_ptr<AlsaWrapper> wrapper_; 93 std::unique_ptr<AlsaWrapper> wrapper_;
97 94
98 DISALLOW_COPY_AND_ASSIGN(AudioManagerAlsa); 95 DISALLOW_COPY_AND_ASSIGN(AudioManagerAlsa);
99 }; 96 };
100 97
101 } // namespace media 98 } // namespace media
102 99
103 #endif // MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_ 100 #endif // MEDIA_AUDIO_ALSA_AUDIO_MANAGER_ALSA_H_
OLDNEW
« no previous file with comments | « media/audio/alsa/alsa_output_unittest.cc ('k') | media/audio/alsa/audio_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698