Home | History | Annotate | Download | only in include
      1 /*
      2 // Copyright(c)2014 IntelCorporation
      3 //
      4 // LicensedundertheApacheLicense,Version2.0(the"License");
      5 // youmaynotusethisfileexceptincompliancewiththeLicense.
      6 // YoumayobtainacopyoftheLicenseat
      7 //
      8 // http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unlessrequiredbyapplicablelaworagreedtoinwriting,software
     11 // distributedundertheLicenseisdistributedonan"ASIS"BASIS,
     12 // WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
     13 // SeetheLicenseforthespecificlanguagegoverningpermissionsand
     14 // limitationsundertheLicense.
     15 */
     16 #ifndef EXTERNAL_DEVICE_H
     17 #define EXTERNAL_DEVICE_H
     18 
     19 #include <PhysicalDevice.h>
     20 #include <IHdcpControl.h>
     21 #include <SimpleThread.h>
     22 
     23 namespace android {
     24 namespace intel {
     25 
     26 
     27 class ExternalDevice : public PhysicalDevice {
     28 
     29 public:
     30     ExternalDevice(Hwcomposer& hwc, DeviceControlFactory* controlFactory);
     31     virtual ~ExternalDevice();
     32 public:
     33     virtual bool initialize();
     34     virtual void deinitialize();
     35     virtual bool setDrmMode(drmModeModeInfo& value);
     36     virtual void setRefreshRate(int hz);
     37     virtual int  getActiveConfig();
     38     virtual bool setActiveConfig(int index);
     39     int getRefreshRate();
     40 
     41 private:
     42     static void HdcpLinkStatusListener(bool success, void *userData);
     43     void HdcpLinkStatusListener(bool success);
     44     void setDrmMode();
     45 protected:
     46     IHdcpControl *mHdcpControl;
     47 
     48 private:
     49     static void hotplugEventListener(void *data);
     50     void hotplugListener();
     51 
     52 private:
     53     Condition mAbortModeSettingCond;
     54     drmModeModeInfo mPendingDrmMode;
     55     bool mHotplugEventPending;
     56     int mExpectedRefreshRate;
     57 
     58 private:
     59     DECLARE_THREAD(ModeSettingThread, ExternalDevice);
     60 };
     61 
     62 }
     63 }
     64 
     65 #endif /* EXTERNAL_DEVICE_H */
     66