mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
Updates buffer overflow handling to occur coincident to other channel
states rather than being a channel state itself. This was preventing traffic channels that overflow from being torn down correctly.
This commit is contained in:
@@ -346,8 +346,7 @@ public class ChannelState extends Module implements ICallEventProvider, IDecoder
|
||||
break;
|
||||
}
|
||||
|
||||
mMutableMetadata.receive(new AttributeChangeRequest<State>(Attribute.CHANNEL_STATE,
|
||||
mSourceOverflow ? State.OVERFLOW : mState));
|
||||
mMutableMetadata.receive(new AttributeChangeRequest<State>(Attribute.CHANNEL_STATE, mState));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,8 +369,19 @@ public class ChannelState extends Module implements ICallEventProvider, IDecoder
|
||||
{
|
||||
mSourceOverflow = overflow;
|
||||
|
||||
mMutableMetadata.receive(new AttributeChangeRequest<State>(Attribute.CHANNEL_STATE,
|
||||
mSourceOverflow ? State.OVERFLOW : mState));
|
||||
mMutableMetadata.receive(new AttributeChangeRequest<Boolean>(Attribute.BUFFER_OVERFLOW, mSourceOverflow));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this channel's sample buffer is in overflow state, meaning that the inbound sample
|
||||
* stream is not being processed fast enough and samples are being thrown away until the processing can
|
||||
* catch up.
|
||||
*
|
||||
* @return true if the channel is in overflow state.
|
||||
*/
|
||||
public boolean isOverflow()
|
||||
{
|
||||
return mSourceOverflow;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ public enum State
|
||||
@Override
|
||||
public boolean canChangeTo(State state)
|
||||
{
|
||||
return state == CALL |
|
||||
return state == CALL ||
|
||||
state == CONTROL ||
|
||||
state == DATA ||
|
||||
state == ENCRYPTED ||
|
||||
@@ -108,8 +108,7 @@ public enum State
|
||||
public boolean canChangeTo(State state)
|
||||
{
|
||||
return state != FADE &&
|
||||
state != RESET &&
|
||||
state != OVERFLOW;
|
||||
state != RESET;
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -121,25 +120,10 @@ public enum State
|
||||
public boolean canChangeTo(State state)
|
||||
{
|
||||
return state != TEARDOWN &&
|
||||
state != RESET &&
|
||||
state != OVERFLOW;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Indicates that the channel's sample buffer has overflowed and new buffer samples are no longer being
|
||||
* delivered to the channel. This state persists until the processing catches up and reduces the number
|
||||
* of samples in the input buffer below a threshold value. Transition to and from this state is exclusively
|
||||
* managed by the Channel State and no other channel states can be processed from the channel decoders
|
||||
* until the channel state is taken out of overflow.
|
||||
*/
|
||||
OVERFLOW("OVERFLOW")
|
||||
{
|
||||
@Override
|
||||
public boolean canChangeTo(State state)
|
||||
{
|
||||
return false;
|
||||
state != RESET;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Indicates that the channel has been reset and is ready to use for a new decoding session.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user