mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
#66 resolves issue with baseband recorders and loggers not being removed from channel processing chains when processing stops. This is now handled in the channel processing manager where baseband recorders and message/event loggers are added at processing start and removed at processing stop.
This commit is contained in:
@@ -218,8 +218,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
}
|
||||
|
||||
/* Setup event logging */
|
||||
List<Module> loggers = mEventLogManager.getLoggers(
|
||||
channel.getEventLogConfiguration(), channel.getName());
|
||||
List<Module> loggers = mEventLogManager.getLoggers(channel.getEventLogConfiguration(), channel.getName());
|
||||
|
||||
if (!loggers.isEmpty())
|
||||
{
|
||||
@@ -232,19 +231,15 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
if (!recorders.isEmpty())
|
||||
{
|
||||
/* Add baseband recorder */
|
||||
if ((recorders.contains(RecorderType.BASEBAND) &&
|
||||
channel.getChannelType() == ChannelType.STANDARD))
|
||||
if ((recorders.contains(RecorderType.BASEBAND) && channel.getChannelType() == ChannelType.STANDARD))
|
||||
{
|
||||
processingChain.addModule(mRecorderManager.getBasebandRecorder(
|
||||
channel.toString()));
|
||||
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
|
||||
}
|
||||
|
||||
/* Add traffic channel baseband recorder */
|
||||
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) &&
|
||||
channel.getChannelType() == ChannelType.TRAFFIC)
|
||||
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) && channel.getChannelType() == ChannelType.TRAFFIC)
|
||||
{
|
||||
processingChain.addModule(mRecorderManager
|
||||
.getBasebandRecorder(channel.toString()));
|
||||
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,9 +270,14 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
|
||||
if (mProcessingChains.containsKey(channel.getChannelID()))
|
||||
{
|
||||
ProcessingChain chain = mProcessingChains.get(channel.getChannelID());
|
||||
ProcessingChain processingChain = mProcessingChains.get(channel.getChannelID());
|
||||
|
||||
processingChain.stop();
|
||||
|
||||
processingChain.removeEventLoggingModules();
|
||||
|
||||
processingChain.removeRecordingModules();
|
||||
|
||||
chain.stop();
|
||||
|
||||
mChannelModel.broadcast(new ChannelEvent(channel, Event.NOTIFICATION_PROCESSING_STOP));
|
||||
|
||||
@@ -285,7 +285,7 @@ public class ChannelProcessingManager implements ChannelEventListener
|
||||
{
|
||||
mProcessingChains.remove(channel.getChannelID());
|
||||
|
||||
chain.dispose();
|
||||
processingChain.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -687,17 +687,13 @@ public class ProcessingChain implements IChannelEventListener
|
||||
{
|
||||
module.stop();
|
||||
}
|
||||
|
||||
removeEventLoggingModules();
|
||||
|
||||
removeRecordingModules();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes any logging modules that are currently registered with this processing chain
|
||||
*/
|
||||
private void removeEventLoggingModules()
|
||||
public void removeEventLoggingModules()
|
||||
{
|
||||
List<Module> eventLoggingModules = new ArrayList<>();
|
||||
|
||||
@@ -718,7 +714,7 @@ public class ProcessingChain implements IChannelEventListener
|
||||
/**
|
||||
* Removes any recording modules that are currently registered with this processing chain
|
||||
*/
|
||||
private void removeRecordingModules()
|
||||
public void removeRecordingModules()
|
||||
{
|
||||
List<Module> recordingModules = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ public class RecorderManager implements Listener<AudioPacket>
|
||||
private boolean mCanStartNewRecorders = true;
|
||||
|
||||
/**
|
||||
* Manages starting and stopping all system recorders and distributes channel audio to each of the recorders.
|
||||
* Manages all audio recording for all processing channels. Reconstructs audio streams and distributes channel
|
||||
* audio to each of the recorders, starting and stopping the recorders as needed.
|
||||
*/
|
||||
public RecorderManager(ThreadPoolManager threadPoolManager)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user