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