OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "media/audio/audio_output_ipc.h" | 13 #include "media/audio/audio_output_ipc.h" |
13 #include "media/base/audio_parameters.h" | 14 #include "media/base/audio_parameters.h" |
14 #include "media/base/output_device_info.h" | 15 #include "media/base/output_device_info.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class OneShotTimer; | 18 class OneShotTimer; |
18 class SingleThreadTaskRunner; | 19 class SingleThreadTaskRunner; |
19 } | 20 } |
20 | 21 |
21 namespace { | |
22 #if defined(OS_WIN) || defined(OS_MACOSX) | |
23 const int64_t kMaxAuthorizationTimeoutMs = 4000; | |
24 #else | |
25 const int64_t kMaxAuthorizationTimeoutMs = 0; // No timeout. | |
26 #endif | |
27 } | |
28 | |
29 namespace content { | 22 namespace content { |
30 class PepperAudioOutputHost; | 23 class PepperAudioOutputHost; |
31 | 24 |
32 // This class is used to support new PPAPI |PPB_AudioOutput_Dev|, while | 25 // This class is used to support new PPAPI |PPB_AudioOutput_Dev|, while |
33 // |PepperPlatformAudioOutput| is to support old PPAPI |PPB_Audio|. | 26 // |PepperPlatformAudioOutput| is to support old PPAPI |PPB_Audio|. |
34 class PepperPlatformAudioOutputDev | 27 class PepperPlatformAudioOutputDev |
35 : public media::AudioOutputIPCDelegate, | 28 : public media::AudioOutputIPCDelegate, |
36 public base::RefCountedThreadSafe<PepperPlatformAudioOutputDev> { | 29 public base::RefCountedThreadSafe<PepperPlatformAudioOutputDev> { |
37 public: | 30 public: |
38 // Factory function, returns NULL on failure. StreamCreated() will be called | 31 // Factory function, returns NULL on failure. StreamCreated() will be called |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 146 |
154 const base::TimeDelta auth_timeout_; | 147 const base::TimeDelta auth_timeout_; |
155 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; | 148 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; |
156 | 149 |
157 DISALLOW_COPY_AND_ASSIGN(PepperPlatformAudioOutputDev); | 150 DISALLOW_COPY_AND_ASSIGN(PepperPlatformAudioOutputDev); |
158 }; | 151 }; |
159 | 152 |
160 } // namespace content | 153 } // namespace content |
161 | 154 |
162 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ | 155 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_DEV_H_ |
OLD | NEW |