本文整理汇总了C++中PLT_ActionReference::VerifyArgumentValue方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_ActionReference::VerifyArgumentValue方法的具体用法?C++ PLT_ActionReference::VerifyArgumentValue怎么用?C++ PLT_ActionReference::VerifyArgumentValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_ActionReference
的用法示例。
在下文中一共展示了PLT_ActionReference::VerifyArgumentValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnGetCurrentConnectionInfo
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnGetCurrentConnectionInfo(PLT_ActionReference& action)
{
if (NPT_FAILED(action->VerifyArgumentValue("ConnectionID", "0"))) {
action->SetError(706,"No Such Connection.");
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("RcsID", "0"))){
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("AVTransportID", "0"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("ProtocolInfo", "http-get:*:*:*"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("PeerConnectionManager", "/"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("PeerConnectionID", "-1"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("Direction", "Input"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("Status", "Unknown"))) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
示例2:
/*----------------------------------------------------------------------
| PLT_MediaServer::OnGetCurrentConnectionInfo
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaServer::OnGetCurrentConnectionInfo(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
if (NPT_FAILED(action->VerifyArgumentValue("ConnectionID", "0"))) {
action->SetError(706,"No Such Connection.");
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("RcsID", "-1"))){
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("AVTransportID", "-1"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("ProtocolInfo", "http-get:*:*:*"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("PeerConnectionManager", "/"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("PeerConnectionID", "-1"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("Direction", "Output"))) {
return NPT_FAILURE;
}
if (NPT_FAILED(action->SetArgumentValue("Status", "Unknown"))) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
示例3: OnGetCurrentConnectionInfo
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnAction
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnAction(PLT_ActionReference& action, NPT_SocketInfo* info /* = NULL */)
{
NPT_COMPILER_UNUSED(info);
/* parse the action name */
NPT_String name = action->GetActionDesc()->GetName();
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetProtocolInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
/* Is it a AVTransport Service Action ? */
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc()->GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(802,"Not valid InstanceID.");
return NPT_FAILURE;
}
}
if (name.Compare("GetCurrentTransportActions", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetDeviceCapabilities", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetMediaInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetPositionInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportSettings", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("Next", true) == 0) {
return OnNext(action);
}
if (name.Compare("Pause", true) == 0) {
return OnPause(action);
}
if (name.Compare("Play", true) == 0) {
return OnPlay(action);
}
if (name.Compare("Previous", true) == 0) {
return OnPrevious(action);
}
if (name.Compare("Seek", true) == 0) {
return OnSeek(action);
}
if (name.Compare("Stop", true) == 0) {
return OnStop(action);
}
if (name.Compare("SetAVTransportURI", true) == 0) {
return OnSetAVTransportURI(action);
}
if (name.Compare("SetPlayMode", true) == 0) {
return OnSetPlayMode(action);
}
//.........这里部分代码省略.........
示例4: OnGetCurrentConnectionInfo
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnAction
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnAction(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
/* parse the action name */
NPT_String name = action->GetActionDesc().GetName();
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(718, "Not valid InstanceID");
return NPT_FAILURE;
}
}
serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:RenderingControl:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(702, "Not valid InstanceID");
return NPT_FAILURE;
}
}
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
/* Is it a AVTransport Service Action ? */
if (name.Compare("Next", true) == 0) {
return OnNext(action);
}
if (name.Compare("Pause", true) == 0) {
return OnPause(action);
}
if (name.Compare("Play", true) == 0) {
return OnPlay(action);
}
if (name.Compare("Previous", true) == 0) {
return OnPrevious(action);
}
if (name.Compare("Seek", true) == 0) {
return OnSeek(action);
}
if (name.Compare("Stop", true) == 0) {
return OnStop(action);
}
if (name.Compare("SetAVTransportURI", true) == 0) {
return OnSetAVTransportURI(action);
}
if (name.Compare("SetNextAVTransportURI", true) == 0) {
return OnSetNextAVTransportURI(action);
}
if (name.Compare("SetPlayMode", true) == 0) {
return OnSetPlayMode(action);
}
/* Is it a RendererControl Service Action ? */
if (name.Compare("SetVolume", true) == 0) {
return OnSetVolume(action);
}
if (name.Compare("SetVolumeDB", true) == 0) {
return OnSetVolumeDB(action);
}
if (name.Compare("GetVolumeDBRange", true) == 0) {
return OnGetVolumeDBRange(action);
}
if (name.Compare("SetMute", true) == 0) {
return OnSetMute(action);
}
// other actions rely on state variables
NPT_CHECK_LABEL_WARNING(action->SetArgumentsOutFromStateVariable(), failure);
return NPT_SUCCESS;
failure:
action->SetError(401,"No Such Action.");
return NPT_FAILURE;
}
示例5: OnGetCurrentConnectionInfo
NPT_Result
GPAC_MediaRenderer::OnAction(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
/* parse the action name */
NPT_String name = action->GetActionDesc().GetName();
m_ip_src = context.GetRemoteAddress().GetIpAddress().ToString();
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetProtocolInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
if (name.Compare("StopForMigration", true) == 0) {
NPT_String res = m_pUPnP->OnMigrate();
m_pMigrationService->SetStateVariable("MigrationStatus", "OK");
m_pMigrationService->SetStateVariable("MigrationMetaData", res);
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
/* Is it a AVTransport Service Action ? */
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(802,"Not valid InstanceID.");
return NPT_FAILURE;
}
}
if (name.Compare("GetCurrentTransportActions", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetDeviceCapabilities", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetMediaInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetPositionInfo", true) == 0) {
if (m_pUPnP->m_pTerm->root_scene) {
char szVal[100];
m_pAVService->SetStateVariable("CurrentTrack", "0");
format_time_string(szVal, m_Duration);
m_pAVService->SetStateVariable("CurrentTrackDuration", szVal);
m_pAVService->SetStateVariable("CurrentTrackMetadata", "");
m_pAVService->SetStateVariable("CurrentTrackURI", "");
format_time_string(szVal, m_Time);
m_pAVService->SetStateVariable("RelativeTimePosition", szVal);
m_pAVService->SetStateVariable("AbsoluteTimePosition", szVal);
m_pAVService->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
m_pAVService->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
} else {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportSettings", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
//.........这里部分代码省略.........