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

Side by Side Diff: third_party/WebKit/Source/platform/audio/AudioDestination.h

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 virtual void start(); 76 virtual void start();
77 virtual void stop(); 77 virtual void stop();
78 bool isPlaying() { return m_isPlaying; } 78 bool isPlaying() { return m_isPlaying; }
79 79
80 float sampleRate() const { return m_sampleRate; } 80 float sampleRate() const { return m_sampleRate; }
81 81
82 // WebAudioDevice::RenderCallback 82 // WebAudioDevice::RenderCallback
83 void render(const WebVector<float*>& sourceData, 83 void render(const WebVector<float*>& sourceData,
84 const WebVector<float*>& audioData, 84 const WebVector<float*>& audioData,
85 size_t numberOfFrames) override; 85 size_t numberOfFrames,
86 double delay,
87 double delayTimestamp,
88 size_t priorFramesSkipped) override;
86 89
87 // AudioSourceProvider 90 // AudioSourceProvider
88 void provideInput(AudioBus*, size_t framesToProcess) override; 91 void provideInput(AudioBus*, size_t framesToProcess) override;
89 92
90 static float hardwareSampleRate(); 93 static float hardwareSampleRate();
91 94
92 // maxChannelCount() returns the total number of output channels of the audio 95 // maxChannelCount() returns the total number of output channels of the audio
93 // hardware. A value of 0 indicates that the number of channels cannot be 96 // hardware. A value of 0 indicates that the number of channels cannot be
94 // configured and that only stereo (2-channel) destinations can be created. 97 // configured and that only stereo (2-channel) destinations can be created.
95 // The numberOfOutputChannels parameter of AudioDestination::create() is 98 // The numberOfOutputChannels parameter of AudioDestination::create() is
96 // allowed to be a value: 1 <= numberOfOutputChannels <= maxChannelCount(), 99 // allowed to be a value: 1 <= numberOfOutputChannels <= maxChannelCount(),
97 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2. 100 // or if maxChannelCount() equals 0, then numberOfOutputChannels must be 2.
98 static unsigned long maxChannelCount(); 101 static unsigned long maxChannelCount();
99 102
100 private: 103 private:
101 AudioIOCallback& m_callback; 104 AudioIOCallback& m_callback;
102 unsigned m_numberOfOutputChannels; 105 unsigned m_numberOfOutputChannels;
103 RefPtr<AudioBus> m_inputBus; 106 RefPtr<AudioBus> m_inputBus;
104 RefPtr<AudioBus> m_renderBus; 107 RefPtr<AudioBus> m_renderBus;
105 float m_sampleRate; 108 float m_sampleRate;
106 bool m_isPlaying; 109 bool m_isPlaying;
107 std::unique_ptr<WebAudioDevice> m_audioDevice; 110 std::unique_ptr<WebAudioDevice> m_audioDevice;
108 size_t m_callbackBufferSize; 111 size_t m_callbackBufferSize;
109 112
110 std::unique_ptr<AudioFIFO> m_inputFifo; 113 std::unique_ptr<AudioFIFO> m_inputFifo;
111 std::unique_ptr<AudioPullFIFO> m_fifo; 114 std::unique_ptr<AudioPullFIFO> m_fifo;
115
116 size_t m_framesElapsed;
117 AudioIOPosition m_outputPosition;
118 base::TimeTicks m_outputPositionReceivedTimestamp;
112 }; 119 };
113 120
114 } // namespace blink 121 } // namespace blink
115 122
116 #endif // AudioDestination_h 123 #endif // AudioDestination_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698