| 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 | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 106 |             const std::string& clientPackageName, | 
 | 107 |             const std::optional<std::string>& clientFeatureId, | 
 | 108 |             const std::string& cameraDeviceId, | 
| Yin-Chia Yeh | c3e9d6f | 2018-02-06 10:56:32 -0800 | [diff] [blame] | 109 |             int api1CameraId, | 
| Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 110 |             int cameraFacing, | 
| Emilian Peev | 8b64f28 | 2021-03-25 16:49:57 -0700 | [diff] [blame] | 111 |             int sensorOrientation, | 
| Igor Murashkin | ecf17e8 | 2012-10-02 16:05:11 -0700 | [diff] [blame] | 112 |             int clientPid, | 
| Eino-Ville Talvala | ceb388d | 2013-02-19 10:40:14 -0800 | [diff] [blame] | 113 |             uid_t clientUid, | 
| Shuzhen Wang | d4abdf7 | 2021-05-28 11:22:50 -0700 | [diff] [blame] | 114 |             int servicePid, | 
| Austin Borger | 18b30a7 | 2022-10-27 12:20:29 -0700 | [diff] [blame] | 115 |             bool overrideForPerfClass, | 
| Chengfei Tao | be683db | 2023-01-31 18:52:49 +0000 | [diff] [blame] | 116 |             bool overrideToPortrait, | 
 | 117 |             bool forceSlowJpegMode); | 
| Eino-Ville Talvala | b99c5b8 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 118 |  | 
| Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 119 |     virtual ~Camera2Client(); | 
| Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 120 |  | 
| Emilian Peev | bd8c503 | 2018-02-14 23:05:40 +0000 | [diff] [blame] | 121 |     virtual status_t initialize(sp<CameraProviderManager> manager, | 
| Austin Borger | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 122 |             const std::string& monitorTags) override; | 
| Eino-Ville Talvala | f69c70d | 2012-05-20 15:59:14 -0700 | [diff] [blame] | 123 |  | 
| Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 124 |     virtual status_t dump(int fd, const Vector<String16>& args); | 
 | 125 |  | 
| Eino-Ville Talvala | c400396 | 2016-01-13 10:07:04 -0800 | [diff] [blame] | 126 |     virtual status_t dumpClient(int fd, const Vector<String16>& args); | 
 | 127 |  | 
| Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 128 |     /** | 
| Eino-Ville Talvala | b99c5b8 | 2013-02-06 17:20:07 -0800 | [diff] [blame] | 129 |      * Interface used by CameraDeviceBase | 
| Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 130 |      */ | 
| Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 131 |  | 
| Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 132 |     virtual void notifyAutoFocus(uint8_t newState, int triggerId); | 
 | 133 |     virtual void notifyAutoExposure(uint8_t newState, int triggerId); | 
| Yin-Chia Yeh | 216db74 | 2015-05-18 15:03:35 -0700 | [diff] [blame] | 134 |     virtual void notifyShutter(const CaptureResultExtras& resultExtras, | 
 | 135 |                                nsecs_t timestamp); | 
| Eino-Ville Talvala | 160d4af | 2012-08-03 09:40:16 -0700 | [diff] [blame] | 136 |  | 
| Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 137 |     /** | 
 | 138 |      * Interface used by independent components of Camera2Client. | 
 | 139 |      */ | 
| Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 140 |  | 
| Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 141 |     camera2::SharedParameters& getParameters(); | 
 | 142 |  | 
| Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 143 |     void notifyRequestId(int32_t requestId); | 
 | 144 |  | 
| Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 145 |     int getPreviewStreamId() const; | 
 | 146 |     int getCaptureStreamId() const; | 
 | 147 |     int getCallbackStreamId() const; | 
 | 148 |     int getRecordingStreamId() const; | 
 | 149 |     int getZslStreamId() const; | 
 | 150 |  | 
| Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 151 |     status_t registerFrameListener(int32_t minId, int32_t maxId, | 
| Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 152 |             const wp<camera2::FrameProcessor::FilteredListener>& listener, | 
| Zhijun He | 25a0aef | 2014-06-25 11:40:02 -0700 | [diff] [blame] | 153 |             bool sendPartials = true); | 
| Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 154 |     status_t removeFrameListener(int32_t minId, int32_t maxId, | 
| Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 155 |             const wp<camera2::FrameProcessor::FilteredListener>& listener); | 
| Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 156 |  | 
 | 157 |     status_t stopStream(); | 
| Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 158 |  | 
| Yin-Chia Yeh | 355d9c6 | 2015-02-24 15:51:43 -0800 | [diff] [blame] | 159 |     // For the slowJpegMode to create jpeg stream when precapture sequence is done | 
 | 160 |     status_t createJpegStreamL(camera2::Parameters ¶ms); | 
 | 161 |  | 
| Eino-Ville Talvala | ea0d51b | 2012-08-28 01:25:43 -0700 | [diff] [blame] | 162 |     static size_t calculateBufferSize(int width, int height, | 
 | 163 |             int format, int stride); | 
 | 164 |  | 
| Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 165 |     static const int32_t kPreviewRequestIdStart = 10000000; | 
 | 166 |     static const int32_t kPreviewRequestIdEnd   = 20000000; | 
 | 167 |  | 
 | 168 |     static const int32_t kRecordingRequestIdStart  = 20000000; | 
 | 169 |     static const int32_t kRecordingRequestIdEnd    = 30000000; | 
 | 170 |  | 
 | 171 |     static const int32_t kCaptureRequestIdStart = 30000000; | 
 | 172 |     static const int32_t kCaptureRequestIdEnd   = 40000000; | 
| Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 173 |  | 
| Eino-Ville Talvala | 2b07e02 | 2013-10-10 15:13:09 -0700 | [diff] [blame] | 174 |     // Constant strings for ATRACE logging | 
 | 175 |     static const char* kAutofocusLabel; | 
 | 176 |     static const char* kTakepictureLabel; | 
 | 177 |  | 
| Yin-Chia Yeh | 355d9c6 | 2015-02-24 15:51:43 -0800 | [diff] [blame] | 178 |     // Used with stream IDs | 
 | 179 |     static const int NO_STREAM = -1; | 
 | 180 |  | 
| Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 181 | private: | 
| Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 182 |     /** ICamera interface-related private members */ | 
| Eino-Ville Talvala | 2e19c3c | 2012-08-26 09:29:28 -0700 | [diff] [blame] | 183 |     typedef camera2::Parameters Parameters; | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 184 |  | 
| Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 185 |     status_t setPreviewWindowL(const sp<IBinder>& binder, | 
| Chih-Hung Hsieh | 8b0b971 | 2016-08-09 14:25:53 -0700 | [diff] [blame] | 186 |             const sp<Surface>& window); | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 187 |     status_t startPreviewL(Parameters ¶ms, bool restart); | 
 | 188 |     void     stopPreviewL(); | 
 | 189 |     status_t startRecordingL(Parameters ¶ms, bool restart); | 
 | 190 |     bool     recordingEnabledL(); | 
| James Dong | 8da4cd7 | 2012-08-04 19:58:07 -0700 | [diff] [blame] | 191 |  | 
| Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 192 |     // Individual commands for sendCommand() | 
 | 193 |     status_t commandStartSmoothZoomL(); | 
 | 194 |     status_t commandStopSmoothZoomL(); | 
 | 195 |     status_t commandSetDisplayOrientationL(int degrees); | 
 | 196 |     status_t commandEnableShutterSoundL(bool enable); | 
 | 197 |     status_t commandPlayRecordingSoundL(); | 
 | 198 |     status_t commandStartFaceDetectionL(int type); | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 199 |     status_t commandStopFaceDetectionL(Parameters ¶ms); | 
| Eino-Ville Talvala | 36cdfb1 | 2012-08-02 17:34:15 -0700 | [diff] [blame] | 200 |     status_t commandEnableFocusMoveMsgL(bool enable); | 
 | 201 |     status_t commandPingL(); | 
 | 202 |     status_t commandSetVideoBufferCountL(size_t count); | 
| Eino-Ville Talvala | d46a6b9 | 2015-05-14 17:26:24 -0700 | [diff] [blame] | 203 |     status_t commandSetVideoFormatL(int format, android_dataspace dataSpace); | 
| Eino-Ville Talvala | d4bcfde | 2012-06-07 17:12:38 -0700 | [diff] [blame] | 204 |  | 
| Eino-Ville Talvala | 2e19c3c | 2012-08-26 09:29:28 -0700 | [diff] [blame] | 205 |     // Current camera device configuration | 
 | 206 |     camera2::SharedParameters mParameters; | 
| Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 207 |  | 
| Eino-Ville Talvala | 3cca136 | 2012-06-07 10:07:18 -0700 | [diff] [blame] | 208 |     /** Camera device-related private members */ | 
 | 209 |  | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 210 |     void     setPreviewCallbackFlagL(Parameters ¶ms, int flag); | 
| Eino-Ville Talvala | 5a4f93e | 2012-08-29 18:06:32 -0700 | [diff] [blame] | 211 |     status_t updateRequests(Parameters ¶ms); | 
| Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 212 |  | 
| Igor Murashkin | dca254a | 2013-05-13 14:53:44 -0700 | [diff] [blame] | 213 |     template <typename ProcessorT> | 
 | 214 |     status_t updateProcessorStream(sp<ProcessorT> processor, Parameters params); | 
| Igor Murashkin | 82db9e6 | 2013-05-21 11:38:49 -0700 | [diff] [blame] | 215 |     template <typename ProcessorT, | 
 | 216 |               status_t (ProcessorT::*updateStreamF)(const Parameters &)> | 
 | 217 |     status_t updateProcessorStream(sp<ProcessorT> processor, Parameters params); | 
| Igor Murashkin | dca254a | 2013-05-13 14:53:44 -0700 | [diff] [blame] | 218 |  | 
| Eino-Ville Talvala | a16733e | 2012-08-27 23:41:56 -0700 | [diff] [blame] | 219 |     sp<camera2::FrameProcessor> mFrameProcessor; | 
| Eino-Ville Talvala | 8ce89d9 | 2012-08-10 08:40:26 -0700 | [diff] [blame] | 220 |  | 
| Eino-Ville Talvala | 73bbd1f | 2012-09-26 10:45:47 -0700 | [diff] [blame] | 221 |     /* Preview/Recording related members */ | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 222 |  | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 223 |     sp<IBinder> mPreviewSurface; | 
| Chien-Yu Chen | 8cca075 | 2015-11-13 15:28:48 -0800 | [diff] [blame] | 224 |     sp<IBinder> mVideoSurface; | 
| Eino-Ville Talvala | 73bbd1f | 2012-09-26 10:45:47 -0700 | [diff] [blame] | 225 |     sp<camera2::StreamingProcessor> mStreamingProcessor; | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 226 |  | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 227 |     /** Preview callback related members */ | 
 | 228 |  | 
| Eino-Ville Talvala | d86a688 | 2012-08-28 11:34:14 -0700 | [diff] [blame] | 229 |     sp<camera2::CallbackProcessor> mCallbackProcessor; | 
| Eino-Ville Talvala | 228a538 | 2012-08-13 12:16:06 -0700 | [diff] [blame] | 230 |  | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 231 |     /* Still image capture related members */ | 
 | 232 |  | 
| Eino-Ville Talvala | da6665c | 2012-08-29 17:37:16 -0700 | [diff] [blame] | 233 |     sp<camera2::CaptureSequencer> mCaptureSequencer; | 
 | 234 |     sp<camera2::JpegProcessor> mJpegProcessor; | 
| Eino-Ville Talvala | d309fb9 | 2015-11-25 12:12:45 -0800 | [diff] [blame] | 235 |     sp<camera2::ZslProcessor> mZslProcessor; | 
| Eino-Ville Talvala | 174181e | 2012-08-03 13:53:39 -0700 | [diff] [blame] | 236 |  | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 237 |     /** Utility members */ | 
| Igor Murashkin | a858ea0 | 2014-08-19 14:53:08 -0700 | [diff] [blame] | 238 |     bool mLegacyMode; | 
| Eino-Ville Talvala | 9cca4c6 | 2012-06-15 15:41:44 -0700 | [diff] [blame] | 239 |  | 
| Eino-Ville Talvala | 4865c52 | 2012-10-02 13:30:28 -0700 | [diff] [blame] | 240 |     // Wait until the camera device has received the latest control settings | 
 | 241 |     status_t syncWithDevice(); | 
| Yin-Chia Yeh | a53021f | 2014-09-12 14:50:27 -0700 | [diff] [blame] | 242 |  | 
 | 243 |     // Video snapshot jpeg size overriding helper function | 
 | 244 |     status_t overrideVideoSnapshotSize(Parameters ¶ms); | 
| Yin-Chia Yeh | dce65c8 | 2017-01-06 15:03:53 -0800 | [diff] [blame] | 245 |  | 
 | 246 |     template<typename TProviderPtr> | 
| Austin Borger | ed99f64 | 2023-06-01 16:51:35 -0700 | [diff] [blame] | 247 |     status_t initializeImpl(TProviderPtr providerPtr, const std::string& monitorTags); | 
| Chien-Yu Chen | fa52c0f | 2017-08-22 17:50:54 -0700 | [diff] [blame] | 248 |  | 
 | 249 |     bool isZslEnabledInStillTemplate(); | 
| Emilian Peev | 13f35ad | 2022-04-27 11:28:48 -0700 | [diff] [blame] | 250 |     // The current rotate & crop mode passed by camera service | 
 | 251 |     uint8_t mRotateAndCropMode; | 
| Emilian Peev | 58aa9c1 | 2022-05-24 18:23:10 -0700 | [diff] [blame] | 252 |     // Synchronize access to 'mRotateAndCropMode' | 
 | 253 |     mutable Mutex mRotateAndCropLock; | 
| Emilian Peev | 13f35ad | 2022-04-27 11:28:48 -0700 | [diff] [blame] | 254 |     // Contains the preview stream transformation that would normally be applied | 
 | 255 |     // when the display rotation is 0 | 
 | 256 |     int mRotateAndCropPreviewTransform; | 
 | 257 |     // Flag indicating camera device support for the rotate & crop interface | 
 | 258 |     bool mRotateAndCropIsSupported; | 
| Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 259 |  | 
 | 260 |     mutable Mutex mLatestRequestMutex; | 
 | 261 |     Condition mLatestRequestSignal; | 
| Kwangkyu Park | 9dd5eda | 2023-06-20 21:12:06 +0900 | [diff] [blame] | 262 |     static constexpr size_t kMaxRequestIds = BufferQueueDefs::NUM_BUFFER_SLOTS; | 
 | 263 |     RingBuffer<int32_t> mLatestRequestIds, mLatestFailedRequestIds; | 
| Emilian Peev | 2a8e283 | 2019-08-23 13:00:31 -0700 | [diff] [blame] | 264 |     status_t waitUntilRequestIdApplied(int32_t requestId, nsecs_t timeout); | 
 | 265 |     status_t waitUntilCurrentRequestIdLocked(); | 
| Eino-Ville Talvala | 61ab9f9 | 2012-05-17 10:30:54 -0700 | [diff] [blame] | 266 | }; | 
 | 267 |  | 
 | 268 | }; // namespace android | 
 | 269 |  | 
 | 270 | #endif |