comparison audio/AudioCallbackPlaySource.h @ 553:2a1e9e017484 bqresample

Fixes to sample rate and latency handling
author Chris Cannam
date Fri, 09 Dec 2016 14:40:49 +0000
parents 8c11ca1ebc39
children 206d65e2b69a
comparison
equal deleted inserted replaced
552:8c11ca1ebc39 553:2a1e9e017484
143 */ 143 */
144 int getTargetBlockSize() const; 144 int getTargetBlockSize() const;
145 145
146 /** 146 /**
147 * Set the playback latency of the target audio device, in frames 147 * Set the playback latency of the target audio device, in frames
148 * at the target sample rate. This is the difference between the 148 * at the device sample rate. This is the difference between the
149 * frame currently "leaving the speakers" and the last frame (or 149 * frame currently "leaving the speakers" and the last frame (or
150 * highest last frame across all channels) requested via 150 * highest last frame across all channels) requested via
151 * getSamples(). The default is zero. 151 * getSamples(). The default is zero.
152 */ 152 */
153 void setSystemPlaybackLatency(int); 153 void setSystemPlaybackLatency(int);
168 168
169 /** 169 /**
170 * Return the sample rate set by the target audio device (or the 170 * Return the sample rate set by the target audio device (or the
171 * source sample rate if the target hasn't set one). 171 * source sample rate if the target hasn't set one).
172 */ 172 */
173 virtual sv_samplerate_t getTargetSampleRate() const; 173 sv_samplerate_t getDeviceSampleRate() const;
174 174
175 /** 175 /**
176 * Indicate how many channels the target audio device was opened 176 * Indicate how many channels the target audio device was opened
177 * with. Note that the target device does channel mixing in the 177 * with. Note that the target device does channel mixing in the
178 * case where our requested channel count does not match its. 178 * case where our requested channel count does not match its.
333 sv_frame_t m_writeBufferFill; 333 sv_frame_t m_writeBufferFill;
334 Scavenger<RingBufferVector> m_bufferScavenger; 334 Scavenger<RingBufferVector> m_bufferScavenger;
335 int m_sourceChannelCount; 335 int m_sourceChannelCount;
336 sv_frame_t m_blockSize; 336 sv_frame_t m_blockSize;
337 sv_samplerate_t m_sourceSampleRate; 337 sv_samplerate_t m_sourceSampleRate;
338 sv_samplerate_t m_targetSampleRate; 338 sv_samplerate_t m_deviceSampleRate;
339 sv_frame_t m_playLatency; 339 sv_frame_t m_playLatency;
340 breakfastquay::SystemPlaybackTarget *m_target; 340 breakfastquay::SystemPlaybackTarget *m_target;
341 double m_lastRetrievalTimestamp; 341 double m_lastRetrievalTimestamp;
342 sv_frame_t m_lastRetrievedBlockSize; 342 sv_frame_t m_lastRetrievedBlockSize;
343 bool m_trustworthyTimestamps; 343 bool m_trustworthyTimestamps;