diff options
Diffstat (limited to 'devices/EmulatedCamera/hwl/EmulatedScene.h')
-rw-r--r-- | devices/EmulatedCamera/hwl/EmulatedScene.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/devices/EmulatedCamera/hwl/EmulatedScene.h b/devices/EmulatedCamera/hwl/EmulatedScene.h index 0334a58..0672422 100644 --- a/devices/EmulatedCamera/hwl/EmulatedScene.h +++ b/devices/EmulatedCamera/hwl/EmulatedScene.h @@ -26,27 +26,17 @@ #ifndef HW_EMULATOR_CAMERA2_SCENE_H #define HW_EMULATOR_CAMERA2_SCENE_H -#include "android/frameworks/sensorservice/1.0/ISensorManager.h" -#include "android/frameworks/sensorservice/1.0/types.h" #include "utils/Timers.h" namespace android { -using ::android::frameworks::sensorservice::V1_0::IEventQueue; -using ::android::frameworks::sensorservice::V1_0::IEventQueueCallback; -using ::android::hardware::sensors::V1_0::Event; -using ::android::hardware::Return; -using ::android::hardware::Void; - -class EmulatedScene : public RefBase { +class EmulatedScene { public: EmulatedScene(int sensor_width_px, int sensor_height_px, float sensor_sensitivity, int sensor_orientation, bool is_front_facing); ~EmulatedScene(); - void InitializeSensorQueue(); - void Initialize(int sensor_width_px, int sensor_height_px, float sensor_sensitivity); @@ -65,6 +55,8 @@ class EmulatedScene : public RefBase { // Get current hour int GetHour() const; + void SetScreenRotation(uint32_t screen_rotation); + // Set the duration of exposure for determining luminous exposure. // Must be called before calculateScene void SetExposureDuration(float seconds); @@ -99,27 +91,13 @@ class EmulatedScene : public RefBase { static const int kSceneHeight = 20; private: - class SensorHandler : public IEventQueueCallback { - public: - SensorHandler(wp<EmulatedScene> scene) : scene_(scene) { - } - - // IEventQueueCallback interface - Return<void> onEvent(const Event& e) override; - - private: - wp<EmulatedScene> scene_; - }; - void InitiliazeSceneRotation(bool clock_wise); - int32_t sensor_handle_; - sp<IEventQueue> sensor_event_queue_; - std::atomic_uint32_t screen_rotation_; uint8_t scene_rot0_[kSceneWidth*kSceneHeight]; uint8_t scene_rot90_[kSceneWidth*kSceneHeight]; uint8_t scene_rot180_[kSceneWidth*kSceneHeight]; uint8_t scene_rot270_[kSceneWidth*kSceneHeight]; + uint32_t screen_rotation_; uint8_t *current_scene_; int32_t sensor_orientation_; bool is_front_facing_; |