You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.3 KiB

/*
* Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved.
* Description: interface for the IPlugin class.
* Author: DTV stack software group
* Create: 2012-09-18
*/
#ifndef IPLUGIN_H
#define IPLUGIN_H
#include <binder/Parcel.h>
#include "IPluginCallback.h"
#define PLUGIN_NOT_IMPLIMENT (-2)
#define DTV_PLUGIN_PATH_LENGTH 256
class IPlugin : public android::RefBase {
public:
virtual SVR_S32 invoke(const android::Parcel &request, android::Parcel *reply) const = 0;
virtual SVR_U32 getStartCmd() const = 0;
virtual SVR_U32 getEndCmd() const = 0;
virtual SVR_S32 regMsgHandler(IPluginCallback *callback) = 0;
virtual SVR_S32 unRegMsgHandler(IPluginCallback *callback) = 0;
virtual ~IPlugin(){};
};
typedef IPlugin *(*PFN_CREATE_PLUGIN)();
typedef SVR_S32 (*PFN_DESTROY_PLUGIN)(IPlugin *plugin);
typedef struct {
IPlugin *pInstance; /* Q: do we need multi-instance ? */
PFN_CREATE_PLUGIN fnCreateInstance; /* constructor */
PFN_DESTROY_PLUGIN fnDestroyInstance; /* destructor */
SVR_VOID *pHandle; /* save dlopen handle */
SVR_CHAR acLibName[DTV_PLUGIN_PATH_LENGTH]; /* save plugin name, can not init twice */
} DOL_DTV_PLUGIN_S;
extern "C" {
IPlugin *createInstance();
SVR_S32 destroyInstance(IPlugin *plugin);
}
#endif // __PLUGIN_H__