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

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

Issue 2092033003: Add OfflineAudioDestinationNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // AudioDestinationHandler 54 // AudioDestinationHandler
55 void startRendering() override; 55 void startRendering() override;
56 void stopRendering() override; 56 void stopRendering() override;
57 unsigned long maxChannelCount() const override; 57 unsigned long maxChannelCount() const override;
58 58
59 float sampleRate() const override { return m_renderTarget->sampleRate(); } 59 float sampleRate() const override { return m_renderTarget->sampleRate(); }
60 60
61 size_t renderQuantumFrames() const { return renderQuantumSize; } 61 size_t renderQuantumFrames() const { return renderQuantumSize; }
62 62
63 void setChannelCount(unsigned long, ExceptionState&) final;
64 void setChannelCountMode(const String&, ExceptionState&) final;
65
63 WebThread* offlineRenderThread(); 66 WebThread* offlineRenderThread();
64 67
65 private: 68 private:
66 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); 69 OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget);
67 70
68 static const size_t renderQuantumSize; 71 static const size_t renderQuantumSize;
69 72
70 // Set up the rendering and start. After setting the context up, it will 73 // Set up the rendering and start. After setting the context up, it will
71 // eventually call |doOfflineRendering|. 74 // eventually call |doOfflineRendering|.
72 void startOfflineRendering(); 75 void startOfflineRendering();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // This flag is necessary to distinguish the state of the context between 112 // This flag is necessary to distinguish the state of the context between
110 // 'created' and 'suspended'. If this flag is false and the current state 113 // 'created' and 'suspended'. If this flag is false and the current state
111 // is 'suspended', it means the context is created and have not started yet. 114 // is 'suspended', it means the context is created and have not started yet.
112 bool m_isRenderingStarted; 115 bool m_isRenderingStarted;
113 116
114 // This flag indicates whether the rendering should be suspended or not. 117 // This flag indicates whether the rendering should be suspended or not.
115 bool m_shouldSuspend; 118 bool m_shouldSuspend;
116 }; 119 };
117 120
118 class OfflineAudioDestinationNode final : public AudioDestinationNode { 121 class OfflineAudioDestinationNode final : public AudioDestinationNode {
122 DEFINE_WRAPPERTYPEINFO();
119 public: 123 public:
120 static OfflineAudioDestinationNode* create(BaseAudioContext*, AudioBuffer* r enderTarget); 124 static OfflineAudioDestinationNode* create(BaseAudioContext*, AudioBuffer* r enderTarget);
121 125
122 private: 126 private:
123 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget); 127 OfflineAudioDestinationNode(BaseAudioContext&, AudioBuffer* renderTarget);
124 }; 128 };
125 129
126 } // namespace blink 130 } // namespace blink
127 131
128 #endif // OfflineAudioDestinationNode_h 132 #endif // OfflineAudioDestinationNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698