mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
Correctly implements the buffer overflow listener registration so that
decoding channels can be notified when the internal buffer goes into and out of overflow state.
This commit is contained in:
@@ -19,6 +19,7 @@ import io.github.dsheirer.dsp.filter.cic.ComplexPrimeCICDecimate;
|
||||
import io.github.dsheirer.dsp.filter.design.FilterDesignException;
|
||||
import io.github.dsheirer.dsp.mixer.IOscillator;
|
||||
import io.github.dsheirer.dsp.mixer.LowPhaseNoiseOscillator;
|
||||
import io.github.dsheirer.sample.IOverflowListener;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.buffer.OverflowableReusableBufferTransferQueue;
|
||||
import io.github.dsheirer.sample.buffer.ReusableComplexBuffer;
|
||||
@@ -74,6 +75,7 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
|
||||
channelSpecification.getStopFrequency());
|
||||
|
||||
mBuffer = new OverflowableReusableBufferTransferQueue<>(BUFFER_MAX_CAPACITY, BUFFER_OVERFLOW_RESET_THRESHOLD);
|
||||
|
||||
//Setup the frequency mixer to the current source frequency
|
||||
mChannelSampleRate = sampleRate / (double)decimation;
|
||||
mTunerFrequency = tunerChannel.getFrequency();
|
||||
@@ -82,6 +84,18 @@ public class CICTunerChannelSource extends TunerChannelSource implements Listene
|
||||
mFrequencyCorrectionMixer = new LowPhaseNoiseOscillator(frequencyOffset, sampleRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an overflow listener to be notified in the internal buffer is in an
|
||||
* overflow state.
|
||||
*
|
||||
* @param listener to receiver updates to the source overflow state
|
||||
*/
|
||||
@Override
|
||||
public void setOverflowListener(IOverflowListener listener)
|
||||
{
|
||||
mBuffer.setOverflowListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user