当前位置: 首页>>代码示例>>C++>>正文


C++ IDispatch::invoke方法代码示例

本文整理汇总了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;
    }

}
开发者ID:Andproject,项目名称:platform_external_opencore,代码行数:55,代码来源:PVPlayerExtHandler.cpp


注:本文中的IDispatch::invoke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。