📄 userinput.c
字号:
/*
***********************************************************************************
NOTICE:
This document contains information that is proprietary to RADVISION LTD..
No part of this publication may be reproduced in any form whatsoever without
written prior approval by RADVISION LTD..
RADVISION LTD. reserves the right to revise this publication and make changes
without obligation to notify any person of such revisions or changes.
***********************************************************************************
*/
#include "rvinternal.h"
#include "rvh323timer.h"
#include "pvaltree.h"
#include "cm.h"
#include "cmdebprn.h"
#include "cmControl.h"
#include "cmintr.h"
#include "h245.h"
#include "userinput.h"
#ifdef __cplusplus
extern "C" {
#endif
int userInput(H245Control* ctrl, int message)
{
HAPP hApp=(HAPP)emaGetInstance((EMAElement)cmiGetByControl((HCONTROL)ctrl));
int nesting;
cmiCBEnter(hApp, "cmEvCallUserInput: haCall=0x%p, hsCall=0x%p, id=%d", (HAPPCALL)emaGetApplicationHandle((EMAElement)cmiGetByControl((HCONTROL)ctrl)), (HCALL)cmiGetByControl((HCONTROL)ctrl), message);
nesting=emaPrepareForCallback((EMAElement)cmiGetByControl((HCONTROL)ctrl));
ifE(((cmElem*)hApp)->cmMySessionEvent.cmEvCallUserInput) ((HAPPCALL)emaGetApplicationHandle((EMAElement)cmiGetByControl((HCONTROL)ctrl)), (HCALL)cmiGetByControl((HCONTROL)ctrl), message);
emaReturnFromCallback((EMAElement)cmiGetByControl((HCONTROL)ctrl),nesting);
cmiCBExit(hApp, "cmEvCallUserInput.");
return RV_TRUE;
}
RVAPI int RVCALLCONV /* userInput message node id or negative value on failure */
cmUserInputSupportIndicationBuild(
/* Build userUser message with alphanumeric data */
IN HAPP hApp,
IN cmUserInputSupportIndication userInputSupport,
OUT int * nodeId /* nodeId of nonstandart UserInputSupportIndication */
)
{
HPVT hVal;
int rootId,supId,ret=0;
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmUserInputSupportIndicationBuild: hApp=0x%p, userInputSupport=%d", hApp, userInputSupport);
hVal = ((cmElem *)hApp)->hVal;
if (nodeId)
*nodeId=0;
if ((rootId=pvtAddRootByPath(hVal, ((cmElem*)hApp)->synProtH245, (char*)"indication.userInput", 0, NULL)) <0)
{
cmiAPIExit(hApp, "cmUserInputBuildAlphanumeric: [%d]", rootId);
return rootId;
}
supId = pvtAdd(hVal, rootId, __h245(userInputSupportIndication), 0, NULL, NULL);
switch(userInputSupport)
{
case cmSupportNonStandard:
*nodeId=pvtAdd(hVal, supId, __h245(nonStandard), 0, NULL, NULL);
ret=*nodeId;
break;
case cmSupportBasicString:
ret=pvtAdd(hVal, supId, __h245(basicString), 0, NULL, NULL);
break;
case cmSupportIA5String:
ret=pvtAdd(hVal, supId, __h245(iA5String), 0, NULL, NULL);
break;
case cmSupportGeneralString:
ret=pvtAdd(hVal, supId, __h245(generalString), 0, NULL, NULL);
break;
}
if (ret >= 0)
ret = rootId;
cmiAPIExit(hApp, "cmUserInputBuildAlphanumeric: [%d]", ret);
return ret;
}
RVAPI int RVCALLCONV /* userInput message node id or negative value on failure */
cmUserInputSignalBuild(
/* Build userUser message with alphanumeric data */
IN HAPP hApp,
cmUserInputSignalStruct *userInputSignalStruct
)
{
HPVT hVal;
int signalId,rtpId,rootId,ret=1;
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmUserInputSignalBuild: hApp=0x%p", hApp);
hVal = ((cmElem *)hApp)->hVal;
if ((rootId=pvtAddRootByPath(hVal, ((cmElem*)hApp)->synProtH245, (char*)"indication.userInput", 0, NULL)) <0)
{
cmiAPIExit(hApp, "cmUserInputSignalBuild: [%d]", rootId);
return rootId;
}
signalId = pvtAdd(hVal, rootId, __h245(signal), 0, NULL, NULL);
ret=pvtAdd(hVal, signalId, __h245(signalType),1 ,(char *)&userInputSignalStruct->signalType, NULL);
if (userInputSignalStruct->duration)
ret=pvtAdd(hVal, signalId, __h245(duration),userInputSignalStruct->duration ,NULL, NULL);
if (userInputSignalStruct->cmUserInputSignalRtp.logicalChannelNumber)
{
rtpId = pvtAdd(hVal, signalId, __h245(rtp),0 ,NULL, NULL);
ret=pvtAdd(hVal, rtpId, __h245(logicalChannelNumber),userInputSignalStruct->cmUserInputSignalRtp.logicalChannelNumber ,NULL, NULL);
if (userInputSignalStruct->cmUserInputSignalRtp.expirationTime)
ret=pvtAdd(hVal, rtpId, __h245(expirationTime),userInputSignalStruct->cmUserInputSignalRtp.expirationTime ,NULL, NULL);
if (userInputSignalStruct->cmUserInputSignalRtp.timestamp)
ret=pvtAdd(hVal, rtpId, __h245(timestamp),userInputSignalStruct->cmUserInputSignalRtp.timestamp ,NULL, NULL);
}
if (ret >= 0)
ret = rootId;
cmiAPIExit(hApp, "cmUserInputSignalBuild: [%d]", ret);
return ret;
}
RVAPI int RVCALLCONV /* userInput message node id or negative value on failure */
cmUserInputSignalUpdateBuild(
/* Build userUser message with alphanumeric data */
IN HAPP hApp,
cmUserInputSignalStruct *userInputSignalStruct
)
{
HPVT hVal;
int rootId,ret;
int signalId,rtpId;
if (!hApp) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmUserInputSignalUpdateBuild: hApp=0x%p", hApp);
hVal = ((cmElem *)hApp)->hVal;
if ((rootId=pvtAddRootByPath(hVal, ((cmElem*)hApp)->synProtH245, (char*)"indication.userInput", 0, NULL)) <0)
{
cmiAPIExit(hApp, "cmUserInputSignalUpdateBuild: [%d]", rootId);
return rootId;
}
signalId = pvtAdd(hVal, rootId, __h245(signalUpdate), 0, NULL, NULL);
ret=pvtAdd(hVal, signalId, __h245(duration),userInputSignalStruct->duration ,NULL, NULL);
if (userInputSignalStruct->cmUserInputSignalRtp.logicalChannelNumber)
{
rtpId = pvtAdd(hVal, signalId, __h245(rtp),0 ,NULL, NULL);
ret=pvtAdd(hVal, rtpId, __h245(logicalChannelNumber),userInputSignalStruct->cmUserInputSignalRtp.logicalChannelNumber ,NULL, NULL);
}
if (ret >= 0)
ret = rootId;
cmiAPIExit(hApp, "cmUserInputSignalUpdateBuild: [%d]", ret);
return ret;
}
RVAPI int RVCALLCONV /* RV_TRUE or negative value on failure */
cmUserInputGetDetail(
IN HAPP hApp,
IN RvInt32 userInputId,
OUT cmUserInputIndication* userInputIndication
)
{
HPVT hVal;
int nsId;
if (!hApp ) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmUserInputGetDetail: hApp=0x%p, UI id=%d", hApp, userInputId);
hVal = ((cmElem *)hApp)->hVal;
if ( (nsId = pvtGetChild(hVal, userInputId, __h245(nonStandard), NULL)) >=0)
{
*userInputIndication = cmUserInputNonStandard;
cmiAPIExit(hApp, "cmUserInputGetDetail: [1] (nonStandard)");
return nsId;
}
if ( (nsId = pvtGetChild(hVal, userInputId, __h245(alphanumeric), NULL)) >=0)
{
*userInputIndication = cmUserInputAlphanumeric;
cmiAPIExit(hApp, "cmUserInputGetDetail: [1] (alphanumeric)");
return nsId;
}
if ( (nsId = pvtGetChild(hVal, userInputId, __h245(userInputSupportIndication), NULL)) >=0)
{
*userInputIndication = cmUserInputSupport;
cmiAPIExit(hApp, "cmUserInputGetDetail: [1] (userInputSupportIndication)");
return nsId;
}
if ( (nsId = pvtGetChild(hVal, userInputId, __h245(signal), NULL)) >=0)
{
*userInputIndication = cmUserInputSignal;
cmiAPIExit(hApp, "cmUserInputGetDetail: [1] (signal)");
return nsId;
}
if ( (nsId = pvtGetChild(hVal, userInputId, __h245(signalUpdate), NULL)) >=0)
{
*userInputIndication = cmUserInputSignalUpdate;
cmiAPIExit(hApp, "cmUserInputGetDetail: [1] (signalUpdate)");
return nsId;
}
cmiAPIExit(hApp, "cmUserInputGetDetail: [-1]");
return RV_ERROR_UNKNOWN;
}
RVAPI int RVCALLCONV
cmUserInputGetSignal(
IN HAPP hApp,
IN RvInt32 signalUserInputId,
OUT cmUserInputSignalStruct * userInputSignalStruct
)
{
HPVT hVal;
int nodeId,optId;
RvInt32 length;
if (!hApp ) return RV_ERROR_UNKNOWN;
cmiAPIEnter(hApp, "cmUserInputGetSignal: hApp=0x%p, UI id=%d", hApp, signalUserInputId);
hVal = ((cmElem *)hApp)->hVal;
nodeId=pvtGetChildByFieldId(hVal, signalUserInputId, __h245(signalType), &length, NULL);
pvtGetString(hVal, nodeId, 1, (char *)&userInputSignalStruct->signalType);
nodeId=pvtGetChild(hVal,signalUserInputId,__h245(duration), NULL);
if(nodeId>=0)
pvtGet(hVal,nodeId,NULL,NULL,&userInputSignalStruct->duration,NULL);
else
userInputSignalStruct->duration=0;
nodeId = pvtGetChild(hVal,signalUserInputId,__h245(rtp),NULL);
if (nodeId<0)
userInputSignalStruct->cmUserInputSignalRtp.logicalChannelNumber=0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -