1 /*
2  * Copyright (C) 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef HW_EMULATOR_GRALLOC_SENSOR_BUFFER_H
18 #define HW_EMULATOR_GRALLOC_SENSOR_BUFFER_H
19 
20 #include <log/log.h>
21 
22 #include <memory>
23 
24 #include "Base.h"
25 #include "HandleImporter.h"
26 
27 namespace android {
28 
29 using android::google_camera_hal::BufferStatus;
30 using android::google_camera_hal::ErrorCode;
31 using android::google_camera_hal::HwlPipelineResult;
32 using android::google_camera_hal::MessageType;
33 using android::google_camera_hal::NotifyMessage;
34 using android::hardware::camera::common::V1_0::helper::HandleImporter;
35 
36 class GrallocSensorBuffer : public SensorBuffer {
37  public:
GrallocSensorBuffer(std::shared_ptr<HandleImporter> handle_importer)38   GrallocSensorBuffer(std::shared_ptr<HandleImporter> handle_importer)
39       : importer_(handle_importer) {
40   }
41 
42   GrallocSensorBuffer(const GrallocSensorBuffer&) = delete;
43   GrallocSensorBuffer& operator=(const GrallocSensorBuffer&) = delete;
44 
45   virtual ~GrallocSensorBuffer() override;
46 
47  private:
48   std::shared_ptr<HandleImporter> importer_;
49 };
50 
51 }  // namespace android
52 
53 #endif
54