Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 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 ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H |
| 18 | #define ANDROID_SERVERS_CAMERA_CAMERA2CLIENT_H |
| 19 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 20 | #include "CameraService.h" |
Eino-Ville Talvala | 7b82efe | 2013-07-25 17:12:35 -0700 | [diff] [blame] | 21 | #include "common/CameraDeviceBase.h" |
| 22 | #include "common/Camera2ClientBase.h" |
| 23 | #include "api1/client2/Parameters.h" |
| 24 | #include "api1/client2/FrameProcessor.h" |
Kwangkyu Park | 9dd5eda | 2023-06-20 21:12:06 +0900 | [diff] [blame] | 25 | #include <media/RingBuffer.h> |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 26 | |
| 27 | namespace android { |
| 28 | |
Eino-Ville Talvala | 7b82efe | 2013-07-25 17:12:35 -0700 | [diff] [blame] | 29 | namespace camera2 { |
| 30 | |
| 31 | class StreamingProcessor; |
| 32 | class JpegProcessor; |
Eino-Ville Talvala | d309fb9 | 2015-11-25 12:12:45 -0800 | [diff] [blame] | 33 | class ZslProcessor; |
Eino-Ville Talvala | 7b82efe | 2013-07-25 17:12:35 -0700 | [diff] [blame] | 34 | class CaptureSequencer; |
| 35 | class CallbackProcessor; |
| 36 | |
| 37 | } |
| 38 | |
Eino-Ville Talvala | 73bbd1f | 2012-09-26 10:45:47 -0700 | [diff] [blame] | 39 | class IMemory; |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 40 | /** |
Eino-Ville Talvala | b99c5b8 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 41 | * Interface between android.hardware.Camera API and Camera HAL device for versions |
Eino-Ville Talvala | d309fb9 | 2015-11-25 12:12:45 -0800 | [diff] [blame] | 42 | * CAMERA_DEVICE_API_VERSION_3_0 and above. |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 43 | */ |
Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 44 | class Camera2Client : |
Igor Murashkin | 44cfcf0 | 2013-03-01 16:22:28 -0800 | [diff] [blame] | 45 | public Camera2ClientBase<CameraService::Client> |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 46 | { |
| 47 | public: |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 48 | /** |
| 49 | * ICamera interface (see ICamera for details) |
| 50 | */ |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 51 | |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 52 | virtual binder::Status disconnect(); |
| 53 | virtual status_t connect(const sp<hardware::ICameraClient>& client); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 54 | virtual status_t lock(); |
| 55 | virtual status_t unlock(); |
Eino-Ville Talvala | 1ce7c34 | 2013-08-21 13:57:21 -0700 | [diff] [blame] | 56 | virtual status_t setPreviewTarget( |
Andy McFadden | 8ba0102 | 2012-12-18 09:46:54 -0800 | [diff] [blame] | 57 | const sp<IGraphicBufferProducer>& bufferProducer); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 58 | virtual void setPreviewCallbackFlag(int flag); |
Eino-Ville Talvala | 3ee3550 | 2013-04-02 15:45:11 -0700 | [diff] [blame] | 59 | virtual status_t setPreviewCallbackTarget( |
| 60 | const sp<IGraphicBufferProducer>& callbackProducer); |
| 61 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 62 | virtual status_t startPreview(); |
| 63 | virtual void stopPreview(); |
| 64 | virtual bool previewEnabled(); |
Chien-Yu Chen | 8cca075 | 2015-11-13 15:28:48 -0800 | [diff] [blame] | 65 | virtual status_t setVideoBufferMode(int32_t videoBufferMode); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 66 | virtual status_t startRecording(); |
| 67 | virtual void stopRecording(); |
| 68 | virtual bool recordingEnabled(); |
| 69 | virtual void releaseRecordingFrame(const sp<IMemory>& mem); |
Chien-Yu Chen | 2d13b1d | 2016-04-28 12:11:20 -0700 | [diff] [blame] | 70 | virtual void releaseRecordingFrameHandle(native_handle_t *handle); |
Yin-Chia Yeh | b5df547 | 2017-03-20 19:32:19 -0700 | [diff] [blame] | 71 | virtual void releaseRecordingFrameHandleBatch( |
| 72 | const std::vector<native_handle_t*>& handles); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 73 | virtual status_t autoFocus(); |
| 74 | virtual status_t cancelAutoFocus(); |
| 75 | virtual status_t takePicture(int msgType); |
| 76 | virtual status_t setParameters(const String8& params); |
| 77 | virtual String8 getParameters() const; |
| 78 | virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2); |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 79 | virtual void notifyError(int32_t errorCode, |
Ruben Brunk | a485dfe | 2015-04-14 13:43:47 -0700 | [diff] [blame] | 80 | const CaptureResultExtras& resultExtras); |
Chien-Yu Chen | 8cca075 | 2015-11-13 15:28:48 -0800 | [diff] [blame] | 81 | virtual status_t setVideoTarget(const sp<IGraphicBufferProducer>& bufferProducer); |
Yin-Chia Yeh | cfab4e1 | 2019-09-09 13:08:28 -0700 | [diff] [blame] | 82 | virtual status_t setAudioRestriction(int mode); |
| 83 | virtual int32_t getGlobalAudioRestriction(); |
Jayant Chowdhary | 44d5f62 | 2023-09-20 03:11:41 +0000 | [diff] [blame] | 84 | virtual status_t setRotateAndCropOverride(uint8_t rotateAndCrop, bool fromHal = false); |
Bharatt Kukreja | 7146ced | 2022-10-25 15:45:29 +0000 | [diff] [blame] | 85 | virtual status_t setAutoframingOverride(uint8_t autoframingMode); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 86 | |
Eino-Ville Talvala | 305cec6 | 2020-11-12 14:18:17 -0800 | [diff] [blame] | 87 | virtual bool supportsCameraMute(); |
| 88 | virtual status_t setCameraMute(bool enabled); |
| 89 | |
Ravneet | aeb20dc | 2022-03-30 05:33:03 +0000 | [diff] [blame] | 90 | virtual status_t setCameraServiceWatchdog(bool enabled); |
| 91 | |
Shuzhen Wang | 16610a6 | 2022-12-15 22:38:07 -0800 | [diff] [blame] | 92 | virtual void setStreamUseCaseOverrides( |
| 93 | const std::vector<int64_t>& useCaseOverrides); |
| 94 | virtual void clearStreamUseCaseOverrides(); |
| 95 | |
Shuzhen Wang | af22e91 | 2023-04-11 16:03:17 -0700 | [diff] [blame] | 96 | virtual bool supportsZoomOverride(); |
| 97 | virtual status_t setZoomOverride(int32_t zoomOverride); |
| 98 | |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 99 | /** |
| 100 | * Interface used by CameraService |
| 101 | */ |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 102 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 103 | Camera2Client(const sp<CameraService>& cameraService, |
Eino-Ville Talvala | d56db1d | 2015-12-17 16:50:35 -0800 | [diff] [blame] | 104 | const sp<hardware::ICameraClient>& cameraClient, |
Austin Borger | 74fca04 | 2022-05-23 12:41:21 -0700 | [diff] [blame] | 105 | std::shared_ptr<CameraServiceProxyWrapper> cameraServiceProxyWrapper, |
Austin Borger | 249e659 | 2024-03-10 22:28:11 -0700 | [diff] [blame] | 106 | std::shared_ptr<AttributionAndPermissionUtils> attributionAndPermissionUtils, |
Austin Borger | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 107 | const std::string& clientPackageName, |
| 108 | const std::optional<std::string>& clientFeatureId, |
| 109 | const std::string& cameraDeviceId, |
Yin-Chia Yeh | c3e9d6f | 2018-02-06 10:56:32 -0800 | [diff] [blame] | 110 | int api1CameraId, |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 111 | int cameraFacing, |
Emilian Peev | 8b64f28 | 2021-03-25 16:49:57 -0700 | [diff] [blame] | 112 | int sensorOrientation, |
Igor Murashkin | ecf17e8 | 2012-10-02 16:05:11 -0700 | [diff] [blame] | 113 | int clientPid, |
Eino-Ville Talvala | ceb388d | 2013-02-19 10:40:14 -0800 | [diff] [blame] | 114 | uid_t clientUid, |
Shuzhen Wang | d4abdf7 | 2021-05-28 11:22:50 -0700 | [diff] [blame] | 115 | int servicePid, |
Austin Borger | 18b30a7 | 2022-10-27 12:20:29 -0700 | [diff] [blame] | 116 | bool overrideForPerfClass, |
Jayant Chowdhary | 81d81b0 | 2024-02-15 19:13:39 +0000 | [diff] [blame^] | 117 | int rotationOverride, |
Chengfei Tao | be683db | 2023-01-31 18:52:49 +0000 | [diff] [blame] | 118 | bool forceSlowJpegMode); |
Eino-Ville Talvala | b99c5b8 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 119 | |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 120 | virtual ~Camera2Client(); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 121 | |
Emilian Peev | bd8c503 | 2018-02-14 23:05:40 +0000 | [diff] [blame] | 122 | virtual status_t initialize(sp<CameraProviderManager> manager, |
Austin Borger | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 123 | const std::string& monitorTags) override; |
Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 124 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 125 | virtual status_t dump(int fd, const Vector<String16>& args); |
| 126 | |
Eino-Ville Talvala | c400396 | 2016-01-13 10:07:04 -0800 | [diff] [blame] | 127 | virtual status_t dumpClient(int fd, const Vector<String16>& args); |
| 128 | |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 129 | /** |
Eino-Ville Talvala | b99c5b8 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 130 | * Interface used by CameraDeviceBase |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 131 | */ |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 132 | |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 133 | virtual void notifyAutoFocus(uint8_t newState, int triggerId); |
| 134 | virtual void notifyAutoExposure(uint8_t newState, int triggerId); |
Yin-Chia Yeh | 216db74 | 2015-05-18 15:03:35 -0700 | [diff] [blame] | 135 | virtual void notifyShutter(const CaptureResultExtras& resultExtras, |
| 136 | nsecs_t timestamp); |
Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 137 | |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 138 | /** |
| 139 | * Interface used by independent components of Camera2Client. |
| 140 | */ |
Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 141 | |
Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 142 | camera2::SharedParameters& getParameters(); |
| 143 | |
Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 144 | void notifyRequestId(int32_t requestId); |
| 145 | |
Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 146 | int getPreviewStreamId() const; |
| 147 | int getCaptureStreamId() const; |
| 148 | int getCallbackStreamId() const; |
| 149 | int getRecordingStreamId() const; |
| 150 | int getZslStreamId() const; |
| 151 | |
Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 152 | status_t registerFrameListener(int32_t minId, int32_t maxId, |
Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 153 | const wp<camera2::FrameProcessor::FilteredListener>& listener, |
Zhijun He | 25a0aef | 2014-06-25 11:40:02 -0700 | [diff] [blame] | 154 | bool sendPartials = true); |
Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 155 | status_t removeFrameListener(int32_t minId, int32_t maxId, |
Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 156 | const wp<camera2::FrameProcessor::FilteredListener>& listener); |
Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 157 | |
| 158 | status_t stopStream(); |
Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 159 | |
Yin-Chia Yeh | 355d9c6 | 2015-02-24 15:51:43 -0800 | [diff] [blame] | 160 | // For the slowJpegMode to create jpeg stream when precapture sequence is done |
| 161 | status_t createJpegStreamL(camera2::Parameters ¶ms); |
| 162 | |
Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 163 | static size_t calculateBufferSize(int width, int height, |
| 164 | int format, int stride); |
| 165 | |
Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 166 | static const int32_t kPreviewRequestIdStart = 10000000; |
| 167 | static const int32_t kPreviewRequestIdEnd = 20000000; |
| 168 | |
| 169 | static const int32_t kRecordingRequestIdStart = 20000000; |
| 170 | static const int32_t kRecordingRequestIdEnd = 30000000; |
| 171 | |
| 172 | static const int32_t kCaptureRequestIdStart = 30000000; |
| 173 | static const int32_t kCaptureRequestIdEnd = 40000000; |
Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 174 | |
Eino-Ville Talvala | 2b07e02 | 2013-10-10 15:13:09 -0700 | [diff] [blame] | 175 | // Constant strings for ATRACE logging |
| 176 | static const char* kAutofocusLabel; |
| 177 | static const char* kTakepictureLabel; |
| 178 | |
Yin-Chia Yeh | 355d9c6 | 2015-02-24 15:51:43 -0800 | [diff] [blame] | 179 | // Used with stream IDs |
| 180 | static const int NO_STREAM = -1; |
| 181 | |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 182 | private: |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 183 | /** ICamera interface-related private members */ |
Eino-Ville Talvala | 2e19c3c | 2012-08-26 09:29:28 -0700 | [diff] [blame] | 184 | typedef camera2::Parameters Parameters; |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 185 | |
Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 186 | status_t setPreviewWindowL(const sp<IBinder>& binder, |
Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 187 | const sp<Surface>& window); |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 188 | status_t startPreviewL(Parameters ¶ms, bool restart); |
| 189 | void stopPreviewL(); |
| 190 | status_t startRecordingL(Parameters ¶ms, bool restart); |
| 191 | bool recordingEnabledL(); |
James Dong | 8da4cd7 | 2012-08-04 19:58:07 -0700 | [diff] [blame] | 192 | |
Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 193 | // Individual commands for sendCommand() |
| 194 | status_t commandStartSmoothZoomL(); |
| 195 | status_t commandStopSmoothZoomL(); |
| 196 | status_t commandSetDisplayOrientationL(int degrees); |
| 197 | status_t commandEnableShutterSoundL(bool enable); |
| 198 | status_t commandPlayRecordingSoundL(); |
| 199 | status_t commandStartFaceDetectionL(int type); |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 200 | status_t commandStopFaceDetectionL(Parameters ¶ms); |
Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 201 | status_t commandEnableFocusMoveMsgL(bool enable); |
| 202 | status_t commandPingL(); |
| 203 | status_t commandSetVideoBufferCountL(size_t count); |
Eino-Ville Talvala | d46a6b9 | 2015-05-14 17:26:24 -0700 | [diff] [blame] | 204 | status_t commandSetVideoFormatL(int format, android_dataspace dataSpace); |
Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 205 | |
Eino-Ville Talvala | 2e19c3c | 2012-08-26 09:29:28 -0700 | [diff] [blame] | 206 | // Current camera device configuration |
| 207 | camera2::SharedParameters mParameters; |
Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 208 | |
Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 209 | /** Camera device-related private members */ |
| 210 | |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 211 | void setPreviewCallbackFlagL(Parameters ¶ms, int flag); |
Eino-Ville Talvala | 5a4f93e | 2012-08-29 18:06:32 -0700 | [diff] [blame] | 212 | status_t updateRequests(Parameters ¶ms); |
Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 213 | |
Igor Murashkin | dca254a | 2013-05-13 14:53:44 -0700 | [diff] [blame] | 214 | template <typename ProcessorT> |
| 215 | status_t updateProcessorStream(sp<ProcessorT> processor, Parameters params); |
Igor Murashkin | 82db9e6 | 2013-05-21 11:38:49 -0700 | [diff] [blame] | 216 | template <typename ProcessorT, |
| 217 | status_t (ProcessorT::*updateStreamF)(const Parameters &)> |
| 218 | status_t updateProcessorStream(sp<ProcessorT> processor, Parameters params); |
Igor Murashkin | dca254a | 2013-05-13 14:53:44 -0700 | [diff] [blame] | 219 | |
Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 220 | sp<camera2::FrameProcessor> mFrameProcessor; |
Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 221 | |
Eino-Ville Talvala | 73bbd1f | 2012-09-26 10:45:47 -0700 | [diff] [blame] | 222 | /* Preview/Recording related members */ |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 223 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 224 | sp<IBinder> mPreviewSurface; |
Chien-Yu Chen | 8cca075 | 2015-11-13 15:28:48 -0800 | [diff] [blame] | 225 | sp<IBinder> mVideoSurface; |
Eino-Ville Talvala | 73bbd1f | 2012-09-26 10:45:47 -0700 | [diff] [blame] | 226 | sp<camera2::StreamingProcessor> mStreamingProcessor; |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 227 | |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 228 | /** Preview callback related members */ |
| 229 | |
Eino-Ville Talvala | d86a688 | 2012-08-28 11:34:14 -0700 | [diff] [blame] | 230 | sp<camera2::CallbackProcessor> mCallbackProcessor; |
Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 231 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 232 | /* Still image capture related members */ |
| 233 | |
Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 234 | sp<camera2::CaptureSequencer> mCaptureSequencer; |
| 235 | sp<camera2::JpegProcessor> mJpegProcessor; |
Eino-Ville Talvala | d309fb9 | 2015-11-25 12:12:45 -0800 | [diff] [blame] | 236 | sp<camera2::ZslProcessor> mZslProcessor; |
Eino-Ville Talvala | 174181e | 2012-08-03 13:53:39 -0700 | [diff] [blame] | 237 | |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 238 | /** Utility members */ |
Igor Murashkin | a858ea0 | 2014-08-19 14:53:08 -0700 | [diff] [blame] | 239 | bool mLegacyMode; |
Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 240 | |
Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 241 | // Wait until the camera device has received the latest control settings |
| 242 | status_t syncWithDevice(); |
Yin-Chia Yeh | a53021f | 2014-09-12 14:50:27 -0700 | [diff] [blame] | 243 | |
| 244 | // Video snapshot jpeg size overriding helper function |
| 245 | status_t overrideVideoSnapshotSize(Parameters ¶ms); |
Yin-Chia Yeh | dce65c8 | 2017-01-06 15:03:53 -0800 | [diff] [blame] | 246 | |
| 247 | template<typename TProviderPtr> |
Austin Borger | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 248 | status_t initializeImpl(TProviderPtr providerPtr, const std::string& monitorTags); |
Chien-Yu Chen | fa52c0f | 2017-08-22 17:50:54 -0700 | [diff] [blame] | 249 | |
| 250 | bool isZslEnabledInStillTemplate(); |
Emilian Peev | 13f35ad | 2022-04-27 11:28:48 -0700 | [diff] [blame] | 251 | // The current rotate & crop mode passed by camera service |
| 252 | uint8_t mRotateAndCropMode; |
Emilian Peev | 58aa9c1 | 2022-05-24 18:23:10 -0700 | [diff] [blame] | 253 | // Synchronize access to 'mRotateAndCropMode' |
| 254 | mutable Mutex mRotateAndCropLock; |
Emilian Peev | 13f35ad | 2022-04-27 11:28:48 -0700 | [diff] [blame] | 255 | // Contains the preview stream transformation that would normally be applied |
| 256 | // when the display rotation is 0 |
| 257 | int mRotateAndCropPreviewTransform; |
| 258 | // Flag indicating camera device support for the rotate & crop interface |
| 259 | bool mRotateAndCropIsSupported; |
Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 260 | |
| 261 | mutable Mutex mLatestRequestMutex; |
| 262 | Condition mLatestRequestSignal; |
Kwangkyu Park | 9dd5eda | 2023-06-20 21:12:06 +0900 | [diff] [blame] | 263 | static constexpr size_t kMaxRequestIds = BufferQueueDefs::NUM_BUFFER_SLOTS; |
| 264 | RingBuffer<int32_t> mLatestRequestIds, mLatestFailedRequestIds; |
Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 265 | status_t waitUntilRequestIdApplied(int32_t requestId, nsecs_t timeout); |
| 266 | status_t waitUntilCurrentRequestIdLocked(); |
Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 267 | }; |
| 268 | |
| 269 | }; // namespace android |
| 270 | |
| 271 | #endif |