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

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

Issue 2501863003: Support for AudioContextOptions latencyHint. (Closed)
Patch Set: Updates based on reviewer comments. Created 4 years 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"
hongchan 2016/12/02 17:40:12 Do we need the actual inclusion here? I think the
Andrew MacPherson 2016/12/05 14:12:53 I believe it's required due to the m_latencyHint m
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;
57 double sampleRate() const override;
58 int framesPerBuffer() const override;
53 59
54 private: 60 private:
55 explicit DefaultAudioDestinationHandler(AudioNode&); 61 explicit DefaultAudioDestinationHandler(AudioNode&,
62 const WebAudioLatencyHint&);
56 void createDestination(); 63 void createDestination();
57 64
58 std::unique_ptr<AudioDestination> m_destination; 65 std::unique_ptr<AudioDestination> m_destination;
59 String m_inputDeviceId; 66 String m_inputDeviceId;
60 unsigned m_numberOfInputChannels; 67 unsigned m_numberOfInputChannels;
68 const WebAudioLatencyHint m_latencyHint;
61 }; 69 };
62 70
63 class DefaultAudioDestinationNode final : public AudioDestinationNode { 71 class DefaultAudioDestinationNode final : public AudioDestinationNode {
64 public: 72 public:
65 static DefaultAudioDestinationNode* create(BaseAudioContext*); 73 static DefaultAudioDestinationNode* create(BaseAudioContext*,
74 const WebAudioLatencyHint&);
66 75
67 private: 76 private:
68 explicit DefaultAudioDestinationNode(BaseAudioContext&); 77 explicit DefaultAudioDestinationNode(BaseAudioContext&,
78 const WebAudioLatencyHint&);
69 }; 79 };
70 80
71 } // namespace blink 81 } // namespace blink
72 82
73 #endif // DefaultAudioDestinationNode_h 83 #endif // DefaultAudioDestinationNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698