1 /* Copyright (c) 2013, The Linux Foundataion. All rights reserved. 2 * 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions are 5 * met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above 9 * copyright notice, this list of conditions and the following 10 * disclaimer in the documentation and/or other materials provided 11 * with the distribution. 12 * * Neither the name of The Linux Foundation nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 */ 29 30 #ifndef __QCAMERA_THERMAL_ADAPTER__ 31 #define __QCAMERA_THERMAL_ADAPTER__ 32 33 namespace qcamera { 34 35 typedef enum { 36 QCAMERA_THERMAL_NO_ADJUSTMENT = 0, 37 QCAMERA_THERMAL_SLIGHT_ADJUSTMENT, 38 QCAMERA_THERMAL_BIG_ADJUSTMENT, 39 QCAMERA_THERMAL_SHUTDOWN 40 } qcamera_thermal_level_enum_t; 41 42 typedef enum { 43 QCAMERA_THERMAL_ADJUST_FPS, 44 QCAMERA_THERMAL_ADJUST_FRAMESKIP, 45 } qcamera_thermal_mode; 46 47 class QCameraThermalCallback 48 { 49 public: 50 virtual int thermalEvtHandle(qcamera_thermal_level_enum_t level, 51 void *userdata, void *data) = 0; ~QCameraThermalCallback()52 virtual ~QCameraThermalCallback() {} 53 }; 54 55 class QCameraThermalAdapter 56 { 57 public: 58 static QCameraThermalAdapter& getInstance(); 59 60 int init(QCameraThermalCallback *thermalCb); 61 void deinit(); 62 63 private: 64 static char mStrCamera[]; 65 static char mStrCamcorder[]; 66 67 static int thermalCallback(int level, void *userdata, void *data); 68 69 QCameraThermalCallback *mCallback; 70 void *mHandle; 71 int (*mRegister)(char *name, 72 int (*callback)(int, void *userdata, void *data), void *data); 73 int (*mUnregister)(int handle); 74 int mCameraHandle; 75 int mCamcorderHandle; 76 77 QCameraThermalAdapter(); 78 QCameraThermalAdapter(QCameraThermalAdapter const& copy); // not implemented 79 QCameraThermalAdapter& operator=(QCameraThermalAdapter const& copy); // not implemented 80 81 }; 82 83 }; // namespace qcamera 84 85 #endif /* __QCAMERA_THERMAL_ADAPTER__ */ 86