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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/DefaultAudioDestinationNode.h

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23 * DAMAGE. 23 * DAMAGE.
24 */ 24 */
25 25
26 #ifndef DefaultAudioDestinationNode_h 26 #ifndef DefaultAudioDestinationNode_h
27 #define DefaultAudioDestinationNode_h 27 #define DefaultAudioDestinationNode_h
28 28
29 #include "modules/webaudio/AudioDestinationNode.h" 29 #include "modules/webaudio/AudioDestinationNode.h"
30 #include "platform/audio/AudioDestination.h" 30 #include "platform/audio/AudioDestination.h"
31 #include "public/platform/WebAudioLatencyHint.h"
31 #include <memory> 32 #include <memory>
32 33
33 namespace blink { 34 namespace blink {
34 35
35 class BaseAudioContext; 36 class BaseAudioContext;
36 class ExceptionState; 37 class ExceptionState;
38 class WebAudioLatencyHint;
37 39
38 class DefaultAudioDestinationHandler final : public AudioDestinationHandler { 40 class DefaultAudioDestinationHandler final : public AudioDestinationHandler {
39 public: 41 public:
40 static PassRefPtr<DefaultAudioDestinationHandler> create(AudioNode&); 42 static PassRefPtr<DefaultAudioDestinationHandler> create(
43 AudioNode&,
44 const WebAudioLatencyHint&);
41 ~DefaultAudioDestinationHandler() override; 45 ~DefaultAudioDestinationHandler() override;
42 46
43 // AudioHandler 47 // AudioHandler
44 void dispose() override; 48 void dispose() override;
45 void initialize() override; 49 void initialize() override;
46 void uninitialize() override; 50 void uninitialize() override;
47 void setChannelCount(unsigned long, ExceptionState&) override; 51 void setChannelCount(unsigned long, ExceptionState&) override;
48 52
49 // AudioDestinationHandler 53 // AudioDestinationHandler
50 void startRendering() override; 54 void startRendering() override;
51 void stopRendering() override; 55 void stopRendering() override;
52 unsigned long maxChannelCount() const override; 56 unsigned long maxChannelCount() const override;
53 57
54 private: 58 private:
55 explicit DefaultAudioDestinationHandler(AudioNode&); 59 explicit DefaultAudioDestinationHandler(AudioNode&,
60 const WebAudioLatencyHint&);
56 void createDestination(); 61 void createDestination();
57 62
58 std::unique_ptr<AudioDestination> m_destination; 63 std::unique_ptr<AudioDestination> m_destination;
59 String m_inputDeviceId; 64 String m_inputDeviceId;
60 unsigned m_numberOfInputChannels; 65 unsigned m_numberOfInputChannels;
66 const WebAudioLatencyHint m_latencyHint;
61 }; 67 };
62 68
63 class DefaultAudioDestinationNode final : public AudioDestinationNode { 69 class DefaultAudioDestinationNode final : public AudioDestinationNode {
64 public: 70 public:
65 static DefaultAudioDestinationNode* create(BaseAudioContext*); 71 static DefaultAudioDestinationNode* create(BaseAudioContext*,
72 const WebAudioLatencyHint&);
66 73
67 private: 74 private:
68 explicit DefaultAudioDestinationNode(BaseAudioContext&); 75 explicit DefaultAudioDestinationNode(BaseAudioContext&,
76 const WebAudioLatencyHint&);
69 }; 77 };
70 78
71 } // namespace blink 79 } // namespace blink
72 80
73 #endif // DefaultAudioDestinationNode_h 81 #endif // DefaultAudioDestinationNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698