diff options
Diffstat (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c')
-rw-r--r-- | software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c | 113 |
1 files changed, 83 insertions, 30 deletions
diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c index 4a30671..63c458a 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.c @@ -25,9 +25,9 @@ You should have received a copy of the GNU General Public License along with the OCT6100 GPL API; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -$Octasic_Release: OCT612xAPI-01.00-PR48 $ +$Octasic_Release: OCT612xAPI-01.00-PR49 $ -$Octasic_Revision: 145 $ +$Octasic_Revision: 146 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -2100,33 +2100,6 @@ UINT32 Oct6100ApiBridgeEventAdd( } mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pEchoChanEntry, f_usChanIndex ); - /* Configure the SIN copy mixer entry and memory - if using the SOUT port. */ - if ( ( f_ulInputPort == cOCT6100_CHANNEL_PORT_SOUT ) && ( f_fTap == FALSE ) ) - { - if ( pEchoChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) - { - ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, - pEchoChanEntry->usSinTsstIndex, - pEchoChanEntry->usExtraSinTsiMemIndex, - pEchoChanEntry->TdmConfig.bySinPcmLaw ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; - } - - /* If the silence TSI is loaded on this port, update with the extra sin TSI. */ - if ( pEchoChanEntry->usSinSilenceEventIndex != cOCT6100_INVALID_INDEX ) - { - WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( pEchoChanEntry->usSinSilenceEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE ); - - WriteParams.ulWriteAddress += 2; - WriteParams.usWriteData = pEchoChanEntry->usExtraSinTsiMemIndex; - - mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); - if ( ulResult != cOCT6100_ERR_OK ) - return ulResult; - } - } - if ( f_fFlexibleConfBridge == TRUE ) { tPOCT6100_API_FLEX_CONF_PARTICIPANT pNewParticipant; @@ -2242,9 +2215,36 @@ UINT32 Oct6100ApiBridgeEventAdd( } else /* if ( f_fFlexibleConfBridge == FALSE ) */ { + /* Configure the SIN copy mixer entry and memory - if using the SOUT port. */ + if ( ( f_ulInputPort == cOCT6100_CHANNEL_PORT_SOUT ) && ( f_fTap == FALSE ) ) + { + if ( pEchoChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) + { + ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, + pEchoChanEntry->usSinTsstIndex, + pEchoChanEntry->usExtraSinTsiMemIndex, + pEchoChanEntry->TdmConfig.bySinPcmLaw ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + + /* If the silence TSI is loaded on this port, update with the extra sin TSI. */ + if ( pEchoChanEntry->usSinSilenceEventIndex != cOCT6100_INVALID_INDEX ) + { + WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( pEchoChanEntry->usSinSilenceEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE ); + + WriteParams.ulWriteAddress += 2; + WriteParams.usWriteData = pEchoChanEntry->usExtraSinTsiMemIndex; + + mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + } + mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pLoadEventEntry, f_usLoadEventIndex ); mOCT6100_GET_MIXER_EVENT_ENTRY_PNT( pSharedInfo, pSubStoreEventEntry, f_usSubStoreEventIndex ); - + /*=======================================================================*/ /* Program the Load event.*/ WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( f_usLoadEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE ); @@ -2927,6 +2927,39 @@ UINT32 Oct6100ApiBridgeAddParticipantToChannel( if ( pDestinationParticipant->fFlexibleMixerCreated == FALSE ) { /*=======================================================================*/ + /* Before creating the participant's flexible mixer, make sure the extra Sin */ + /* mixer event is programmed correctly for sending the voice stream to the right place. */ + + /* Configure the SIN copy mixer entry and memory - if using the SOUT port. */ + if ( f_ulDestinationInputPort == cOCT6100_CHANNEL_PORT_SOUT ) + { + if ( pDestinationChanEntry->usSinTsstIndex != cOCT6100_INVALID_INDEX ) + { + ulResult = Oct6100ApiWriteInputTsstControlMemory( f_pApiInstance, + pDestinationChanEntry->usSinTsstIndex, + pDestinationChanEntry->usExtraSinTsiMemIndex, + pDestinationChanEntry->TdmConfig.bySinPcmLaw ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + + /* If the silence TSI is loaded on this port, update with the extra sin TSI. */ + if ( pDestinationChanEntry->usSinSilenceEventIndex != cOCT6100_INVALID_INDEX ) + { + WriteParams.ulWriteAddress = cOCT6100_MIXER_CONTROL_MEM_BASE + ( pDestinationChanEntry->usSinSilenceEventIndex * cOCT6100_MIXER_CONTROL_MEM_ENTRY_SIZE ); + + WriteParams.ulWriteAddress += 2; + WriteParams.usWriteData = pDestinationChanEntry->usExtraSinTsiMemIndex; + + mOCT6100_DRIVER_WRITE_API( WriteParams, ulResult ); + if ( ulResult != cOCT6100_ERR_OK ) + return ulResult; + } + } + /*=======================================================================*/ + + + /*=======================================================================*/ /* Program the load event. This is the first event for this new destination channel. */ /* First set the TSI buffer where the resulting stream should be written to. */ @@ -4031,6 +4064,11 @@ UINT32 Oct6100ApiBridgeEventRemove ( pEchoChanEntry->usExtraSinTsiDependencyCnt--; pEchoChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; } + else + { + /* Decrement the dependency count, but do not clear the mem index. */ + pEchoChanEntry->usExtraSinTsiDependencyCnt--; + } /* Indicate that the extra RIN TSI is not needed anymore by the mixer. */ if ( pEchoChanEntry->usExtraRinTsiDependencyCnt == 1 ) @@ -4197,6 +4235,11 @@ UINT32 Oct6100ApiBridgeEventRemove ( pEchoChanEntry->usExtraSinTsiDependencyCnt--; pEchoChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; } + else + { + /* Decrement the dependency count, but do not clear the mem index. */ + pEchoChanEntry->usExtraSinTsiDependencyCnt--; + } /* Indicate that the Extra RIN TSI is not needed anymore by the mixer. */ if ( pEchoChanEntry->usExtraRinTsiDependencyCnt == 1 ) @@ -4690,6 +4733,11 @@ UINT32 Oct6100ApiBridgeEventRemove ( pEchoChanEntry->usExtraSinTsiDependencyCnt--; pEchoChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; } + else + { + /* Decrement the dependency count, but do not clear the mem index. */ + pEchoChanEntry->usExtraSinTsiDependencyCnt--; + } /* Update the chip stats structure. */ pSharedInfo->ChipStats.usNumEcChanUsingMixer--; @@ -4868,6 +4916,11 @@ UINT32 Oct6100ApiBridgeEventRemove ( pEchoChanEntry->usExtraSinTsiDependencyCnt--; pEchoChanEntry->usExtraSinTsiMemIndex = cOCT6100_INVALID_INDEX; } + else + { + /* Decrement the dependency count, but do not clear the mem index. */ + pEchoChanEntry->usExtraSinTsiDependencyCnt--; + } /* Invalidate the channel entry. */ pEchoChanEntry->usLoadEventIndex = cOCT6100_INVALID_INDEX; |