/* * Copyright (c) Hisilicon Technologies Co., Ltd. 2012-2019. All rights reserved. * Description: API of DTV client. * Author: DTV stack software group * Create: 2012-09-18 */ #ifndef DTVCLIENT_H #define DTVCLIENT_H #include #include #include #include #include "IDtvClient.h" #include "ImplDtvClient.h" #ifndef PRODUCT_FULL_TREBLE #include "IDtvService.h" #include "IDtvServiceServer.h" #endif class DTVListener : virtual public RefBase { public: DTVListener() {}; virtual ~DTVListener() {}; virtual void Notify(SVR_S32 msg, SVR_S32 ext1, SVR_S32 ext2, SVR_S32 ext3, const Parcel *parcelObj) = 0; }; class HwDTVListener; class DTVClient : public BnDTVClient { public: DTVClient(); virtual ~DTVClient(); status_t SetPlugins(const SVR_CHAR *url) const; status_t Invoke(Parcel &request, Parcel *reply); status_t SetListener(const sp &dtvListener); status_t Disconnect(); void SetSurface(SVR_VOID *spSurface, int width, int height); void Notify(SVR_S32 msg, SVR_S32 ext1, SVR_S32 ext2, SVR_S32 ext3, const Parcel *parcelObj = static_cast(SVR_NULL)); void hwNotify(SVR_S32 msg, SVR_S32 ext1, SVR_S32 ext2, SVR_S32 ext3, const Parcel *parcelObj = static_cast(SVR_NULL), Parcel *parcelReply = static_cast(SVR_NULL)); private: class DeathNotifier : public IBinder::DeathRecipient { public: ~DeathNotifier(); virtual SVR_VOID binderDied(const wp &who); }; static sp mDeathNotifier; #ifndef PRODUCT_FULL_TREBLE const sp &GetDTVServiceServer(); static sp mDTVServiceServer; sp mDTVService; #endif sp mListener; sp mHwListener; ImplDTVClient *mImplDTVClient; Mutex mLock; Mutex mNotifyLock; }; #endif // DTVCLIENT_H