本文整理汇总了C++中IDispatch::invoke方法的典型用法代码示例。如果您正苦于以下问题:C++ IDispatch::invoke方法的具体用法?C++ IDispatch::invoke怎么用?C++ IDispatch::invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDispatch
的用法示例。
在下文中一共展示了IDispatch::invoke方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callPlayerExtension
status_t PVPlayerExtensionHandler::callPlayerExtension(PlayerExtensionCommand* cmd, const Parcel& request, Parcel& reply)
{
status_t status;
int32_t opcode = -1;
status = request.readInt32(&opcode);
switch(opcode) {
case EXTN_HANDLER_CMD_QUERY_EXTN_IFACE: {
LOGV("callPlayerExtension EXTN_HANDLER_CMD_QUERY_EXTN_IFACE ");
status = queryExtnIface(request , reply);
if (NO_ERROR != status) {
getPlayerDriver().commandFailed((PlayerCommand*)cmd);
} else {
FinishSyncCommand((PlayerCommand*)cmd);
}
return status;
}
case EXTN_HANDLER_CMD_EXTN_API_CALL: {
LOGV("callPlayerExtension EXTN_HANDLER_CMD_EXTN_API_CALL");
//Extract the handle
IDispatch* extIface = (IDispatch*)request.readInt32();
if (extIface){
LOGV("callPlayerExtension extIface=%d",(int)extIface);
//invoke the requested API
return extIface->invoke(request,reply,cmd);
}else{
status = reply.writeInt32(INVALID_OPERATION);
getPlayerDriver().commandFailed((PlayerCommand*)cmd);
return status;
}
}
case EXTN_HANDLER_CMD_RELEASE_EXTN_IFACE: {
LOGV("callPlayerExtension EXTN_HANDLER_CMD_RELEASE_EXTN_IFACE");
//Extract the handle
IDispatch* extIface = (IDispatch*)request.readInt32();
if (extIface && (1 == iExtensionInstancesList.remove_element(extIface))) {
LOGV("callPlayerExtension Release extIface=%d",(int)extIface);
//Release Extension
delete extIface;
status = reply.writeInt32(NO_ERROR);
FinishSyncCommand((PlayerCommand*)cmd);
return status;
} else {
status = reply.writeInt32(INVALID_OPERATION);
getPlayerDriver().commandFailed((PlayerCommand*)cmd);
return status;
}
}
default:
LOGE("Unknown opcode %d", opcode);
status = reply.writeInt32(INVALID_OPERATION);
getPlayerDriver().commandFailed((PlayerCommand*)cmd);
return status;
}
}