Merge pull request #94 from DSheirer/#66_remove_loggers_and_recorders_between_channel_restarts

#66 remove loggers and recorders between channel restarts
This commit is contained in:
Denny Sheirer
2017-01-08 05:28:16 -05:00
committed by GitHub
3 changed files with 777 additions and 594 deletions

View File

@@ -207,37 +207,6 @@ public class ChannelProcessingManager implements ChannelEventListener
MessageActivityModel messageModel = new MessageActivityModel(messageFilter);
processingChain.setMessageActivityModel(messageModel);
/* Setup event logging */
List<Module> loggers = mEventLogManager.getLoggers(
channel.getEventLogConfiguration(), channel.getName());
if (!loggers.isEmpty())
{
processingChain.addModules(loggers);
}
/* Setup recorders */
List<RecorderType> recorders = channel.getRecordConfiguration().getRecorders();
if (!recorders.isEmpty())
{
/* Add baseband recorder */
if ((recorders.contains(RecorderType.BASEBAND) &&
channel.getChannelType() == ChannelType.STANDARD))
{
processingChain.addModule(mRecorderManager.getBasebandRecorder(
channel.toString()));
}
/* Add traffic channel baseband recorder */
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) &&
channel.getChannelType() == ChannelType.TRAFFIC)
{
processingChain.addModule(mRecorderManager
.getBasebandRecorder(channel.toString()));
}
}
/* Inject channel metadata that will be inserted into audio packets
* for the recorder manager and streaming */
processingChain.broadcast(
@@ -248,6 +217,32 @@ public class ChannelProcessingManager implements ChannelEventListener
new Metadata(MetadataType.CHANNEL_NAME, channel.getName()));
}
/* Setup event logging */
List<Module> loggers = mEventLogManager.getLoggers(channel.getEventLogConfiguration(), channel.getName());
if (!loggers.isEmpty())
{
processingChain.addModules(loggers);
}
/* Setup recorders */
List<RecorderType> recorders = channel.getRecordConfiguration().getRecorders();
if (!recorders.isEmpty())
{
/* Add baseband recorder */
if ((recorders.contains(RecorderType.BASEBAND) && channel.getChannelType() == ChannelType.STANDARD))
{
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
}
/* Add traffic channel baseband recorder */
if (recorders.contains(RecorderType.TRAFFIC_BASEBAND) && channel.getChannelType() == ChannelType.TRAFFIC)
{
processingChain.addModule(mRecorderManager.getBasebandRecorder(channel.toString()));
}
}
processingChain.setSource(source);
if (event instanceof TrafficChannelEvent)
@@ -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();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -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)
{