#39 WIP - rolls back embedding source events in buffers. The channel

calculator must be updated immediately any time the tuner's center
frequency changes so that a channel can be allocated immediately.  So,
I changed source event handling to two parts where the channel calculator
is immediately updated and the channelizer configuration is deferred so
that it can happen on the buffer processor execution thread and we can
avoid any sync() locking on the channelizer or polyphase channel
sources.
This commit is contained in:
Denny
2018-01-13 11:43:26 -05:00
parent 05fa5c25fd
commit d4761be00a
9 changed files with 80 additions and 320 deletions

View File

@@ -16,21 +16,12 @@
package io.github.dsheirer.sample.complex;
import io.github.dsheirer.sample.Buffer;
import io.github.dsheirer.source.SourceEvent;
public class ComplexBuffer extends Buffer
{
//Default timestamp - we use a static variable here so that there is only ever 1 instance in memory
private static final long DEFAULT_TIMESTAMP = 0;
/**
* Wrapper around float array containing interleaved I/Q samples and an optional source event that should be
* processed prior to processing the sample data.
*/
public ComplexBuffer(float[] samples, SourceEvent sourceEvent)
{
super(samples, sourceEvent);
}
/**
* Wrapper around float array containing interleaved I/Q samples
*/

View File

@@ -15,26 +15,10 @@
******************************************************************************/
package io.github.dsheirer.sample.complex;
import io.github.dsheirer.source.SourceEvent;
public class TimestampedComplexBuffer extends ComplexBuffer
{
private long mTimestamp;
/**
* Constructs a timestamped complex buffer using the specified time in milliseconds. Also includes a source event
* that should be processed prior to processing the sample data.
*
* @param samples of data
* @param sourceEvent - optional source event to embed with this buffer
* @param timestamp relative to the first sample in the sample array
*/
public TimestampedComplexBuffer(float[] samples, SourceEvent sourceEvent, long timestamp)
{
super(samples, sourceEvent);
mTimestamp = timestamp;
}
/**
* Constructs a timestamped complex buffer using the specified time in milliseconds.
*
@@ -42,18 +26,9 @@ public class TimestampedComplexBuffer extends ComplexBuffer
*/
public TimestampedComplexBuffer(float[] samples, long timestamp)
{
this(samples, null, timestamp);
}
super(samples);
/**
* Constructs a timestamped complex buffer using the current system time in milliseconds. Also includes a source
* event that should be processed prior to processing the sample data.
*
* @param samples of data
*/
public TimestampedComplexBuffer(float[] samples, SourceEvent sourceEvent)
{
this(samples, sourceEvent, System.currentTimeMillis());
mTimestamp = timestamp;
}
/**
@@ -63,7 +38,7 @@ public class TimestampedComplexBuffer extends ComplexBuffer
*/
public TimestampedComplexBuffer(float[] samples)
{
this(samples, null, System.currentTimeMillis());
this(samples, System.currentTimeMillis());
}
/**