From 4ed38158b4baae55739e1753c59073eccd4d17ec Mon Sep 17 00:00:00 2001 From: Octasic Inc Date: Fri, 7 Aug 2009 00:17:30 +0300 Subject: importing OCT612x-01.02.04 --- .../oct6100api/oct6100_api/oct6100_channel.c | 56 +++++++++++++++++++--- 1 file changed, 50 insertions(+), 6 deletions(-) (limited to 'software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c') diff --git a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c index a229190..329c318 100644 --- a/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c +++ b/software/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.c @@ -23,9 +23,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.02.01 $ +$Octasic_Release: OCT612xAPI-01.02.04 $ -$Octasic_Revision: 506 $ +$Octasic_Revision: 510 $ \*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ @@ -2497,7 +2497,18 @@ UINT32 Oct6100ApiUpdateChannelEntry( /* Obtain a pointer to the new buffer's list entry. */ mOCT6100_GET_CHANNEL_ENTRY_PNT( f_pApiInstance->pSharedInfo, pChanEntry, f_pChanIndexConf->usEchoChanIndex ) + + /*=======================================================================*/ + /* Update num active channel stats. */ + if ( f_pChannelOpen->ulEchoOperationMode != cOCT6100_ECHO_OP_MODE_POWER_DOWN ) + { + f_pApiInstance->pSharedInfo->MiscVars.fActiveChannelsChange = TRUE; + f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels++; + } + /*=======================================================================*/ + + /*=======================================================================*/ /* Copy the channel's configuration and allocated resources. */ pChanEntry->ulUserChanId = f_pChannelOpen->ulUserChanId; @@ -2726,6 +2737,7 @@ UINT32 Oct6100ApiUpdateChannelEntry( /*=======================================================================*/ + return cOCT6100_ERR_OK; } @@ -3272,6 +3284,15 @@ UINT32 Oct6100ApiReleaseChannelResources( mOCT6100_GET_CHANNEL_ENTRY_PNT( pSharedInfo, pChanEntry, f_usChannelIndex ); + /*=======================================================================*/ + /* Update num active channel stats. */ + if ( pChanEntry->byEchoOperationMode != cOCT6100_ECHO_OP_MODE_POWER_DOWN ) + { + f_pApiInstance->pSharedInfo->MiscVars.fActiveChannelsChange = TRUE; + f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels--; + } + /*=======================================================================*/ + /* Obtain local pointer to the TDM configurationof the channel */ pTdmConfig = &pChanEntry->TdmConfig; @@ -3334,7 +3355,7 @@ UINT32 Oct6100ApiReleaseChannelResources( return cOCT6100_ERR_FATAL_6; } - /*=======================================================================*/ + /*=======================================================================*/ /* Release all the TSSTs associated to the ROUT port of this channel. */ if ( pTdmConfig->usRoutTimeslot != cOCT6100_UNASSIGNED) { @@ -3375,10 +3396,10 @@ UINT32 Oct6100ApiReleaseChannelResources( pTsstEntry->usNextEntry = cOCT6100_INVALID_INDEX; } - /*=======================================================================*/ + /*=======================================================================*/ - /*=======================================================================*/ + /*=======================================================================*/ /* Release all the TSSTs associated to the SOUT port of this channel. */ if ( pTdmConfig->usSoutTimeslot != cOCT6100_UNASSIGNED) { @@ -5785,6 +5806,29 @@ UINT32 Oct6100ApiModifyChannelEntry( pApiTdmConf = &pChanEntry->TdmConfig; pApiVqeConf = &pChanEntry->VqeConfig; + /*=======================================================================*/ + /* Update num active channel stats. */ + { + UINT8 byOpenEchoMode; + + byOpenEchoMode = (UINT8)( f_pChannelOpen->ulEchoOperationMode & 0xFF ); + + if ( pChanEntry->byEchoOperationMode != byOpenEchoMode ) + { + if ( pChanEntry->byEchoOperationMode == cOCT6100_ECHO_OP_MODE_POWER_DOWN ) + { + f_pApiInstance->pSharedInfo->MiscVars.fActiveChannelsChange = TRUE; + f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels++; + } + else if ( byOpenEchoMode == cOCT6100_ECHO_OP_MODE_POWER_DOWN ) + { + f_pApiInstance->pSharedInfo->MiscVars.fActiveChannelsChange = TRUE; + f_pApiInstance->pSharedInfo->MiscVars.ulNumActiveChannels--; + } + } + } + /*=======================================================================*/ + /*=======================================================================*/ /* Copy the channel's general configuration. */ @@ -8050,7 +8094,7 @@ UINT32 Oct6100ApiCheckVqeConfig( if ( f_pVqeConfig->fEnablePlayout == FALSE && pImageInfo->fPerChannelPlayoutControl == FALSE ) return cOCT6100_ERR_NOT_SUPPORTED_DISABLE_PLAYOUT; - if ( f_pVqeConfig->fEnablePlayout == TRUE && f_pVqeConfig->fRoutNoiseReduction == TRUE ) + if ( f_pVqeConfig->fEnablePlayout == TRUE && f_pVqeConfig->fRoutNoiseReduction == TRUE && pImageInfo->fPerChannelPlayoutControl == TRUE) return cOCT6100_ERR_NOT_SUPPORTED_ENABLE_PLAYOUT_AND_ROUT_NOISE_REDUCTION; /*Check if noise reduction level gain is supported*/ -- cgit v1.2.3