blob: 057ec993bdfccd84a026e669963b68f9136f977c [file] [log] [blame]
Shuzhen Wang316781a2020-08-18 18:11:01 -07001/*
2 * Copyright (C) 2020 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// #define LOG_NDEBUG 0
18#define LOG_TAG "CameraSessionStats"
Eino-Ville Talvala6f1a9c12023-09-14 17:26:28 -070019
Shuzhen Wang316781a2020-08-18 18:11:01 -070020#include <utils/Log.h>
21#include <utils/String16.h>
22
23#include <camera/CameraSessionStats.h>
Austin Borger1c1bee02023-06-01 16:51:35 -070024#include <camera/StringUtils.h>
Shuzhen Wang316781a2020-08-18 18:11:01 -070025
26#include <binder/Parcel.h>
27
28namespace android {
29namespace hardware {
30
31status_t CameraStreamStats::readFromParcel(const android::Parcel* parcel) {
32 if (parcel == NULL) {
33 ALOGE("%s: Null parcel", __FUNCTION__);
34 return BAD_VALUE;
35 }
36
37 status_t err = OK;
38
39 int width = 0;
40 if ((err = parcel->readInt32(&width)) != OK) {
41 ALOGE("%s: Failed to read width from parcel", __FUNCTION__);
42 return err;
43 }
44
45 int height = 0;
46 if ((err = parcel->readInt32(&height)) != OK) {
47 ALOGE("%s: Failed to read height from parcel", __FUNCTION__);
48 return err;
49 }
50
51 int format = 0;
52 if ((err = parcel->readInt32(&format)) != OK) {
53 ALOGE("%s: Failed to read format from parcel", __FUNCTION__);
54 return err;
55 }
56
Austin Borger4a870a32022-02-25 01:48:41 +000057 float maxPreviewFps = 0;
58 if ((err = parcel->readFloat(&maxPreviewFps)) != OK) {
59 ALOGE("%s: Failed to read maxPreviewFps from parcel", __FUNCTION__);
60 return err;
61 }
62
Shuzhen Wang316781a2020-08-18 18:11:01 -070063 int dataSpace = 0;
64 if ((err = parcel->readInt32(&dataSpace)) != OK) {
65 ALOGE("%s: Failed to read dataSpace from parcel", __FUNCTION__);
66 return err;
67 }
68
69 int64_t usage = 0;
70 if ((err = parcel->readInt64(&usage)) != OK) {
71 ALOGE("%s: Failed to read usage from parcel", __FUNCTION__);
72 return err;
73 }
74
75 int64_t requestCount = 0;
76 if ((err = parcel->readInt64(&requestCount)) != OK) {
77 ALOGE("%s: Failed to read request count from parcel", __FUNCTION__);
78 return err;
79 }
80
81 int64_t errorCount = 0;
82 if ((err = parcel->readInt64(&errorCount)) != OK) {
83 ALOGE("%s: Failed to read error count from parcel", __FUNCTION__);
84 return err;
85 }
86
87 int startLatencyMs = 0;
88 if ((err = parcel->readInt32(&startLatencyMs)) != OK) {
89 ALOGE("%s: Failed to read start latency from parcel", __FUNCTION__);
90 return err;
91 }
92
93 int maxHalBuffers = 0;
94 if ((err = parcel->readInt32(&maxHalBuffers)) != OK) {
95 ALOGE("%s: Failed to read max Hal buffers from parcel", __FUNCTION__);
96 return err;
97 }
98
99 int maxAppBuffers = 0;
100 if ((err = parcel->readInt32(&maxAppBuffers)) != OK) {
101 ALOGE("%s: Failed to read max app buffers from parcel", __FUNCTION__);
102 return err;
103 }
104
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700105 int histogramType = HISTOGRAM_TYPE_UNKNOWN;
106 if ((err = parcel->readInt32(&histogramType)) != OK) {
107 ALOGE("%s: Failed to read histogram type from parcel", __FUNCTION__);
108 return err;
109 }
110
111 std::vector<float> histogramBins;
112 if ((err = parcel->readFloatVector(&histogramBins)) != OK) {
113 ALOGE("%s: Failed to read histogram bins from parcel", __FUNCTION__);
114 return err;
115 }
116
117 std::vector<int64_t> histogramCounts;
118 if ((err = parcel->readInt64Vector(&histogramCounts)) != OK) {
119 ALOGE("%s: Failed to read histogram counts from parcel", __FUNCTION__);
120 return err;
121 }
122
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800123 int64_t dynamicRangeProfile = ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD;
124 if ((err = parcel->readInt64(&dynamicRangeProfile)) != OK) {
Emilian Peev2295df72021-11-12 18:14:10 -0800125 ALOGE("%s: Failed to read dynamic range profile type from parcel", __FUNCTION__);
126 return err;
127 }
128
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800129 int64_t streamUseCase = ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT;
130 if ((err = parcel->readInt64(&streamUseCase)) != OK) {
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800131 ALOGE("%s: Failed to read stream use case from parcel", __FUNCTION__);
132 return err;
133 }
134
Austin Borger9e2b27c2022-07-15 11:27:24 -0700135 int32_t colorSpace = ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED;
136 if ((err = parcel->readInt32(&colorSpace)) != OK) {
137 ALOGE("%s: Failed to read color space from parcel", __FUNCTION__);
138 return err;
139 }
140
Shuzhen Wang316781a2020-08-18 18:11:01 -0700141 mWidth = width;
142 mHeight = height;
143 mFormat = format;
Austin Borger4a870a32022-02-25 01:48:41 +0000144 mMaxPreviewFps = maxPreviewFps;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700145 mDataSpace = dataSpace;
146 mUsage = usage;
147 mRequestCount = requestCount;
148 mErrorCount = errorCount;
149 mStartLatencyMs = startLatencyMs;
150 mMaxHalBuffers = maxHalBuffers;
151 mMaxAppBuffers = maxAppBuffers;
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700152 mHistogramType = histogramType;
153 mHistogramBins = std::move(histogramBins);
154 mHistogramCounts = std::move(histogramCounts);
Emilian Peev2295df72021-11-12 18:14:10 -0800155 mDynamicRangeProfile = dynamicRangeProfile;
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800156 mStreamUseCase = streamUseCase;
Austin Borger9e2b27c2022-07-15 11:27:24 -0700157 mColorSpace = colorSpace;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700158
159 return OK;
160}
161
162status_t CameraStreamStats::writeToParcel(android::Parcel* parcel) const {
163 if (parcel == NULL) {
164 ALOGE("%s: Null parcel", __FUNCTION__);
165 return BAD_VALUE;
166 }
167
168 status_t err = OK;
169
170 if ((err = parcel->writeInt32(mWidth)) != OK) {
171 ALOGE("%s: Failed to write stream width!", __FUNCTION__);
172 return err;
173 }
174
175 if ((err = parcel->writeInt32(mHeight)) != OK) {
176 ALOGE("%s: Failed to write stream height!", __FUNCTION__);
177 return err;
178 }
179
180 if ((err = parcel->writeInt32(mFormat)) != OK) {
181 ALOGE("%s: Failed to write stream format!", __FUNCTION__);
182 return err;
183 }
184
Austin Borger4a870a32022-02-25 01:48:41 +0000185 if ((err = parcel->writeFloat(mMaxPreviewFps)) != OK) {
186 ALOGE("%s: Failed to write stream maxPreviewFps!", __FUNCTION__);
187 return err;
188 }
189
Shuzhen Wang316781a2020-08-18 18:11:01 -0700190 if ((err = parcel->writeInt32(mDataSpace)) != OK) {
191 ALOGE("%s: Failed to write stream dataSpace!", __FUNCTION__);
192 return err;
193 }
194
195 if ((err = parcel->writeInt64(mUsage)) != OK) {
196 ALOGE("%s: Failed to write stream usage!", __FUNCTION__);
197 return err;
198 }
199
200 if ((err = parcel->writeInt64(mRequestCount)) != OK) {
201 ALOGE("%s: Failed to write stream request count!", __FUNCTION__);
202 return err;
203 }
204
205 if ((err = parcel->writeInt64(mErrorCount)) != OK) {
206 ALOGE("%s: Failed to write stream error count!", __FUNCTION__);
207 return err;
208 }
209
210 if ((err = parcel->writeInt32(mStartLatencyMs)) != OK) {
211 ALOGE("%s: Failed to write stream start latency!", __FUNCTION__);
212 return err;
213 }
214
215 if ((err = parcel->writeInt32(mMaxHalBuffers)) != OK) {
216 ALOGE("%s: Failed to write max hal buffers", __FUNCTION__);
217 return err;
218 }
219
220 if ((err = parcel->writeInt32(mMaxAppBuffers)) != OK) {
221 ALOGE("%s: Failed to write max app buffers", __FUNCTION__);
222 return err;
223 }
224
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700225 if ((err = parcel->writeInt32(mHistogramType)) != OK) {
226 ALOGE("%s: Failed to write histogram type", __FUNCTION__);
227 return err;
228 }
229
230 if ((err = parcel->writeFloatVector(mHistogramBins)) != OK) {
231 ALOGE("%s: Failed to write histogram bins!", __FUNCTION__);
232 return err;
233 }
234
235 if ((err = parcel->writeInt64Vector(mHistogramCounts)) != OK) {
236 ALOGE("%s: Failed to write histogram counts!", __FUNCTION__);
237 return err;
238 }
239
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800240 if ((err = parcel->writeInt64(mDynamicRangeProfile)) != OK) {
Emilian Peev2295df72021-11-12 18:14:10 -0800241 ALOGE("%s: Failed to write dynamic range profile type", __FUNCTION__);
242 return err;
243 }
244
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800245 if ((err = parcel->writeInt64(mStreamUseCase)) != OK) {
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800246 ALOGE("%s: Failed to write stream use case!", __FUNCTION__);
247 return err;
248 }
249
Austin Borger9e2b27c2022-07-15 11:27:24 -0700250 if ((err = parcel->writeInt32(mColorSpace)) != OK) {
251 ALOGE("%s: Failed to write color space", __FUNCTION__);
252 return err;
253 }
254
Shuzhen Wang316781a2020-08-18 18:11:01 -0700255 return OK;
256}
257
Shuzhen Wangbac18d92020-11-19 14:50:30 -0800258const int CameraSessionStats::CAMERA_STATE_OPEN = 0;
259const int CameraSessionStats::CAMERA_STATE_ACTIVE = 1;
260const int CameraSessionStats::CAMERA_STATE_IDLE = 2;
261const int CameraSessionStats::CAMERA_STATE_CLOSED = 3;
262
263const int CameraSessionStats::CAMERA_FACING_BACK = 0;
264const int CameraSessionStats::CAMERA_FACING_FRONT = 1;
265const int CameraSessionStats::CAMERA_FACING_EXTERNAL = 2;
266
267const int CameraSessionStats::CAMERA_API_LEVEL_1 = 1;
268const int CameraSessionStats::CAMERA_API_LEVEL_2 = 2;
269
Shuzhen Wang316781a2020-08-18 18:11:01 -0700270CameraSessionStats::CameraSessionStats() :
271 mFacing(CAMERA_FACING_BACK),
272 mNewCameraState(CAMERA_STATE_CLOSED),
273 mApiLevel(0),
274 mIsNdk(false),
275 mLatencyMs(-1),
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800276 mLogId(0),
Austin Borger4a870a32022-02-25 01:48:41 +0000277 mMaxPreviewFps(0),
Shuzhen Wang316781a2020-08-18 18:11:01 -0700278 mSessionType(0),
279 mInternalReconfigure(0),
280 mRequestCount(0),
281 mResultErrorCount(0),
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700282 mDeviceError(false),
Avichal Rakesh89691e12023-05-01 19:41:02 -0700283 mVideoStabilizationMode(-1),
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700284 mSessionIndex(0),
285 mCameraExtensionSessionStats() {}
Shuzhen Wang316781a2020-08-18 18:11:01 -0700286
Austin Borger1c1bee02023-06-01 16:51:35 -0700287CameraSessionStats::CameraSessionStats(const std::string& cameraId,
288 int facing, int newCameraState, const std::string& clientName,
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800289 int apiLevel, bool isNdk, int32_t latencyMs, int64_t logId) :
Shuzhen Wang316781a2020-08-18 18:11:01 -0700290 mCameraId(cameraId),
291 mFacing(facing),
292 mNewCameraState(newCameraState),
293 mClientName(clientName),
294 mApiLevel(apiLevel),
295 mIsNdk(isNdk),
296 mLatencyMs(latencyMs),
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800297 mLogId(logId),
Austin Borger4a870a32022-02-25 01:48:41 +0000298 mMaxPreviewFps(0),
Shuzhen Wang316781a2020-08-18 18:11:01 -0700299 mSessionType(0),
300 mInternalReconfigure(0),
301 mRequestCount(0),
302 mResultErrorCount(0),
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700303 mDeviceError(0),
Avichal Rakesh89691e12023-05-01 19:41:02 -0700304 mVideoStabilizationMode(-1),
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700305 mSessionIndex(0),
306 mCameraExtensionSessionStats() {}
Shuzhen Wang316781a2020-08-18 18:11:01 -0700307
308status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) {
309 if (parcel == NULL) {
310 ALOGE("%s: Null parcel", __FUNCTION__);
311 return BAD_VALUE;
312 }
313
314 status_t err = OK;
315
316 String16 id;
317 if ((err = parcel->readString16(&id)) != OK) {
318 ALOGE("%s: Failed to read camera id!", __FUNCTION__);
319 return BAD_VALUE;
320 }
321
322 int facing = 0;
323 if ((err = parcel->readInt32(&facing)) != OK) {
324 ALOGE("%s: Failed to read camera facing from parcel", __FUNCTION__);
325 return err;
326 }
327
328 int32_t newCameraState;
329 if ((err = parcel->readInt32(&newCameraState)) != OK) {
330 ALOGE("%s: Failed to read new camera state from parcel", __FUNCTION__);
331 return err;
332 }
333
334 String16 clientName;
335 if ((err = parcel->readString16(&clientName)) != OK) {
336 ALOGE("%s: Failed to read client name!", __FUNCTION__);
337 return BAD_VALUE;
338 }
339
340 int32_t apiLevel;
341 if ((err = parcel->readInt32(&apiLevel)) != OK) {
342 ALOGE("%s: Failed to read api level from parcel", __FUNCTION__);
343 return err;
344 }
345
346 bool isNdk;
347 if ((err = parcel->readBool(&isNdk)) != OK) {
348 ALOGE("%s: Failed to read isNdk flag from parcel", __FUNCTION__);
349 return err;
350 }
351
352 int32_t latencyMs;
353 if ((err = parcel->readInt32(&latencyMs)) != OK) {
354 ALOGE("%s: Failed to read latencyMs from parcel", __FUNCTION__);
355 return err;
356 }
357
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800358 int64_t logId;
359 if ((err = parcel->readInt64(&logId)) != OK) {
360 ALOGE("%s: Failed to read log ID from parcel", __FUNCTION__);
361 return err;
362 }
363
Austin Borger4a870a32022-02-25 01:48:41 +0000364 float maxPreviewFps;
365 if ((err = parcel->readFloat(&maxPreviewFps)) != OK) {
366 ALOGE("%s: Failed to read maxPreviewFps from parcel", __FUNCTION__);
367 return err;
368 }
369
Shuzhen Wang316781a2020-08-18 18:11:01 -0700370 int32_t sessionType;
371 if ((err = parcel->readInt32(&sessionType)) != OK) {
372 ALOGE("%s: Failed to read session type from parcel", __FUNCTION__);
373 return err;
374 }
375
376 int32_t internalReconfigure;
377 if ((err = parcel->readInt32(&internalReconfigure)) != OK) {
378 ALOGE("%s: Failed to read internal reconfigure count from parcel", __FUNCTION__);
379 return err;
380 }
381
382 int64_t requestCount;
383 if ((err = parcel->readInt64(&requestCount)) != OK) {
384 ALOGE("%s: Failed to read request count from parcel", __FUNCTION__);
385 return err;
386 }
387
388 int64_t resultErrorCount;
389 if ((err = parcel->readInt64(&resultErrorCount)) != OK) {
390 ALOGE("%s: Failed to read result error count from parcel", __FUNCTION__);
391 return err;
392 }
393
394 bool deviceError;
395 if ((err = parcel->readBool(&deviceError)) != OK) {
396 ALOGE("%s: Failed to read device error flag from parcel", __FUNCTION__);
397 return err;
398 }
399
400 std::vector<CameraStreamStats> streamStats;
401 if ((err = parcel->readParcelableVector(&streamStats)) != OK) {
402 ALOGE("%s: Failed to read stream state from parcel", __FUNCTION__);
403 return err;
404 }
405
Shuzhen Wangd26b1862022-03-07 12:05:05 -0800406 String16 userTag;
407 if ((err = parcel->readString16(&userTag)) != OK) {
408 ALOGE("%s: Failed to read user tag!", __FUNCTION__);
409 return BAD_VALUE;
410 }
411
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700412 int32_t videoStabilizationMode;
413 if ((err = parcel->readInt32(&videoStabilizationMode)) != OK) {
414 ALOGE("%s: Failed to read video stabilization mode from parcel", __FUNCTION__);
415 return err;
416 }
417
Eino-Ville Talvala6f1a9c12023-09-14 17:26:28 -0700418 bool usedUltraWide = false;
419 if ((err = parcel->readBool(&usedUltraWide)) != OK) {
420 ALOGE("%s: Failed to read ultrawide usage from parcel", __FUNCTION__);
421 return err;
422 }
423
Shuzhen Wang6e08d202023-10-24 20:27:14 +0000424 bool usedZoomOverride = false;
425 if ((err = parcel->readBool(&usedZoomOverride)) != OK) {
426 ALOGE("%s: Failed to read zoom override usage from parcel", __FUNCTION__);
427 return err;
428 }
429
Avichal Rakesh89691e12023-05-01 19:41:02 -0700430 int32_t sessionIdx;
431 if ((err = parcel->readInt32(&sessionIdx)) != OK) {
432 ALOGE("%s: Failed to read session index from parcel", __FUNCTION__);
433 return err;
434 }
435
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700436 CameraExtensionSessionStats extStats{};
437 if ((err = extStats.readFromParcel(parcel)) != OK) {
438 ALOGE("%s: Failed to read extension session stats from parcel", __FUNCTION__);
439 return err;
440 }
441
Austin Borger1c1bee02023-06-01 16:51:35 -0700442 mCameraId = toStdString(id);
Shuzhen Wang316781a2020-08-18 18:11:01 -0700443 mFacing = facing;
444 mNewCameraState = newCameraState;
Austin Borger1c1bee02023-06-01 16:51:35 -0700445 mClientName = toStdString(clientName);
Shuzhen Wang316781a2020-08-18 18:11:01 -0700446 mApiLevel = apiLevel;
447 mIsNdk = isNdk;
448 mLatencyMs = latencyMs;
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800449 mLogId = logId;
Austin Borger4a870a32022-02-25 01:48:41 +0000450 mMaxPreviewFps = maxPreviewFps;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700451 mSessionType = sessionType;
452 mInternalReconfigure = internalReconfigure;
453 mRequestCount = requestCount;
454 mResultErrorCount = resultErrorCount;
455 mDeviceError = deviceError;
456 mStreamStats = std::move(streamStats);
Austin Borger1c1bee02023-06-01 16:51:35 -0700457 mUserTag = toStdString(userTag);
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700458 mVideoStabilizationMode = videoStabilizationMode;
Eino-Ville Talvala6f1a9c12023-09-14 17:26:28 -0700459 mUsedUltraWide = usedUltraWide;
Shuzhen Wang6e08d202023-10-24 20:27:14 +0000460 mUsedZoomOverride = usedZoomOverride;
Avichal Rakesh89691e12023-05-01 19:41:02 -0700461 mSessionIndex = sessionIdx;
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700462 mCameraExtensionSessionStats = extStats;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700463
464 return OK;
465}
466
467status_t CameraSessionStats::writeToParcel(android::Parcel* parcel) const {
468 if (parcel == NULL) {
469 ALOGE("%s: Null parcel", __FUNCTION__);
470 return BAD_VALUE;
471 }
472
473 status_t err = OK;
474
Austin Borger1c1bee02023-06-01 16:51:35 -0700475 if ((err = parcel->writeString16(toString16(mCameraId))) != OK) {
Shuzhen Wang316781a2020-08-18 18:11:01 -0700476 ALOGE("%s: Failed to write camera id!", __FUNCTION__);
477 return err;
478 }
479
480 if ((err = parcel->writeInt32(mFacing)) != OK) {
481 ALOGE("%s: Failed to write camera facing!", __FUNCTION__);
482 return err;
483 }
484
485 if ((err = parcel->writeInt32(mNewCameraState)) != OK) {
486 ALOGE("%s: Failed to write new camera state!", __FUNCTION__);
487 return err;
488 }
489
Austin Borger1c1bee02023-06-01 16:51:35 -0700490 if ((err = parcel->writeString16(toString16(mClientName))) != OK) {
Shuzhen Wang316781a2020-08-18 18:11:01 -0700491 ALOGE("%s: Failed to write client name!", __FUNCTION__);
492 return err;
493 }
494
495 if ((err = parcel->writeInt32(mApiLevel)) != OK) {
496 ALOGE("%s: Failed to write api level!", __FUNCTION__);
497 return err;
498 }
499
500 if ((err = parcel->writeBool(mIsNdk)) != OK) {
501 ALOGE("%s: Failed to write isNdk flag!", __FUNCTION__);
502 return err;
503 }
504
505 if ((err = parcel->writeInt32(mLatencyMs)) != OK) {
506 ALOGE("%s: Failed to write latency in Ms!", __FUNCTION__);
507 return err;
508 }
509
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800510 if ((err = parcel->writeInt64(mLogId)) != OK) {
511 ALOGE("%s: Failed to write log ID!", __FUNCTION__);
512 return err;
513 }
514
Austin Borger4a870a32022-02-25 01:48:41 +0000515 if ((err = parcel->writeFloat(mMaxPreviewFps)) != OK) {
516 ALOGE("%s: Failed to write maxPreviewFps!", __FUNCTION__);
517 return err;
518 }
519
Shuzhen Wang316781a2020-08-18 18:11:01 -0700520 if ((err = parcel->writeInt32(mSessionType)) != OK) {
521 ALOGE("%s: Failed to write session type!", __FUNCTION__);
522 return err;
523 }
524
525 if ((err = parcel->writeInt32(mInternalReconfigure)) != OK) {
526 ALOGE("%s: Failed to write internal reconfigure count!", __FUNCTION__);
527 return err;
528 }
529
530 if ((err = parcel->writeInt64(mRequestCount)) != OK) {
531 ALOGE("%s: Failed to write request count!", __FUNCTION__);
532 return err;
533 }
534
535 if ((err = parcel->writeInt64(mResultErrorCount)) != OK) {
536 ALOGE("%s: Failed to write result error count!", __FUNCTION__);
537 return err;
538 }
539
540 if ((err = parcel->writeBool(mDeviceError)) != OK) {
541 ALOGE("%s: Failed to write device error flag!", __FUNCTION__);
542 return err;
543 }
544
545 if ((err = parcel->writeParcelableVector(mStreamStats)) != OK) {
546 ALOGE("%s: Failed to write stream states!", __FUNCTION__);
547 return err;
548 }
549
Austin Borger1c1bee02023-06-01 16:51:35 -0700550 if ((err = parcel->writeString16(toString16(mUserTag))) != OK) {
Shuzhen Wangd26b1862022-03-07 12:05:05 -0800551 ALOGE("%s: Failed to write user tag!", __FUNCTION__);
552 return err;
553 }
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700554
555 if ((err = parcel->writeInt32(mVideoStabilizationMode)) != OK) {
556 ALOGE("%s: Failed to write video stabilization mode!", __FUNCTION__);
557 return err;
558 }
Shuzhen Wang6e08d202023-10-24 20:27:14 +0000559
Eino-Ville Talvala6f1a9c12023-09-14 17:26:28 -0700560 if ((err = parcel->writeBool(mUsedUltraWide)) != OK) {
561 ALOGE("%s: Failed to write ultrawide usage!", __FUNCTION__);
562 return err;
563 }
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800564
Shuzhen Wang6e08d202023-10-24 20:27:14 +0000565 if ((err = parcel->writeBool(mUsedZoomOverride)) != OK) {
566 ALOGE("%s: Failed to write zoom override usage!", __FUNCTION__);
567 return err;
568 }
569
Avichal Rakesh89691e12023-05-01 19:41:02 -0700570 if ((err = parcel->writeInt32(mSessionIndex)) != OK) {
571 ALOGE("%s: Failed to write session index!", __FUNCTION__);
572 return err;
573 }
574
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700575 if ((err = mCameraExtensionSessionStats.writeToParcel(parcel)) != OK) {
576 ALOGE("%s: Failed to write extension sessions stats!", __FUNCTION__);
577 return err;
578 }
579
Shuzhen Wang316781a2020-08-18 18:11:01 -0700580 return OK;
581}
582
583} // namespace hardware
584} // namesmpace android