135 WIP - updates to resolve issue with all audio being recorded, even when user has not elected to record the audio.

This commit is contained in:
Denny
2017-01-24 21:14:16 -05:00
parent ea0e1b152f
commit e2e00a98d5
4 changed files with 21 additions and 19 deletions

View File

@@ -55,7 +55,8 @@ public class Metadata
//Lazily constructed member variables. //Lazily constructed member variables.
private Integer mAudioPriority; private Integer mAudioPriority;
protected Boolean mRecordable; protected Boolean mRecordable = false;
protected Boolean mDoNotRecord;
private List<BroadcastChannel> mBroadcastChannels; private List<BroadcastChannel> mBroadcastChannels;
@@ -141,12 +142,12 @@ public class Metadata
*/ */
public boolean isRecordable() public boolean isRecordable()
{ {
if(mRecordable == null) if(mDoNotRecord == null)
{ {
determineRecordable(); determineRecordable();
} }
return mRecordable; return mRecordable & !mDoNotRecord;
} }
/** /**
@@ -545,29 +546,29 @@ public class Metadata
*/ */
private void determineRecordable() private void determineRecordable()
{ {
mRecordable = true; mDoNotRecord = false;
if(mPrimaryAddressTo.hasAlias() && !mPrimaryAddressTo.getAlias().isRecordable()) if(mPrimaryAddressTo.hasAlias() && !mPrimaryAddressTo.getAlias().isRecordable())
{ {
mRecordable = false; mDoNotRecord = true;
return; return;
} }
if(mPrimaryAddressFrom.hasAlias() && !mPrimaryAddressFrom.getAlias().isRecordable()) if(mPrimaryAddressFrom.hasAlias() && !mPrimaryAddressFrom.getAlias().isRecordable())
{ {
mRecordable = false; mDoNotRecord = true;
return; return;
} }
if(mSecondaryAddressTo.hasAlias() && !mSecondaryAddressTo.getAlias().isRecordable()) if(mSecondaryAddressTo.hasAlias() && !mSecondaryAddressTo.getAlias().isRecordable())
{ {
mRecordable = false; mDoNotRecord = true;
return; return;
} }
if(mSecondaryAddressFrom.hasAlias() && !mSecondaryAddressFrom.getAlias().isRecordable()) if(mSecondaryAddressFrom.hasAlias() && !mSecondaryAddressFrom.getAlias().isRecordable())
{ {
mRecordable = false; mDoNotRecord = true;
return; return;
} }
} }

View File

@@ -163,6 +163,8 @@ public class MutableMetadata extends Metadata implements Listener<AttributeChang
*/ */
public void resetTemporalAttributes() public void resetTemporalAttributes()
{ {
mDoNotRecord = null;
if(hasMessage()) if(hasMessage())
{ {
mMessage = null; mMessage = null;

View File

@@ -217,15 +217,11 @@ public class ChannelProcessingManager implements ChannelEventListener
MessageActivityModel messageModel = new MessageActivityModel(messageFilter); MessageActivityModel messageModel = new MessageActivityModel(messageFilter);
processingChain.setMessageActivityModel(messageModel); processingChain.setMessageActivityModel(messageModel);
//Set the recordable flag to false in metadata if we don't have a record configuration, or if the user //Set the recordable flag to true if the user has requested recording. The metadata class can still
//has not specified audio recording. Note: the metadata class sets recordable to true by default if no //override recordability if any of the aliased values has 'Do Not Record' alias identifier.
//setting has been specified. This flag is subsequently turned off if any of the primary or secondary processingChain.getChannelState().getMutableMetadata()
//identifiers are designated as non-recordable. .setRecordable(channel.getRecordConfiguration() != null &&
if(channel.getRecordConfiguration() == null || channel.getRecordConfiguration().getRecorders().contains(RecorderType.AUDIO));
!channel.getRecordConfiguration().getRecorders().contains(RecorderType.AUDIO))
{
processingChain.getChannelState().getMutableMetadata().setRecordable(false);
}
//Inject channel metadata that will be inserted into audio packets for recorder manager and streaming //Inject channel metadata that will be inserted into audio packets for recorder manager and streaming
processingChain.getChannelState().getMutableMetadata().receive( processingChain.getChannelState().getMutableMetadata().receive(

View File

@@ -72,8 +72,11 @@ public class DemodulatedAudioFilterModule extends Module implements IUnFilteredR
mBandPassFilter.dispose(); mBandPassFilter.dispose();
mBandPassFilter = null; mBandPassFilter = null;
mDCFilter.dispose(); if(mDCFilter != null)
mDCFilter = null; {
mDCFilter.dispose();
mDCFilter = null;
}
} }
@Override @Override