blob: 36bf24c8162fcdb47015f36f8ca22ac234225a12 [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"
19#include <utils/Log.h>
20#include <utils/String16.h>
21
22#include <camera/CameraSessionStats.h>
Austin Borger1c1bee02023-06-01 16:51:35 -070023#include <camera/StringUtils.h>
Shuzhen Wang316781a2020-08-18 18:11:01 -070024
25#include <binder/Parcel.h>
26
27namespace android {
28namespace hardware {
29
30status_t CameraStreamStats::readFromParcel(const android::Parcel* parcel) {
31 if (parcel == NULL) {
32 ALOGE("%s: Null parcel", __FUNCTION__);
33 return BAD_VALUE;
34 }
35
36 status_t err = OK;
37
38 int width = 0;
39 if ((err = parcel->readInt32(&width)) != OK) {
40 ALOGE("%s: Failed to read width from parcel", __FUNCTION__);
41 return err;
42 }
43
44 int height = 0;
45 if ((err = parcel->readInt32(&height)) != OK) {
46 ALOGE("%s: Failed to read height from parcel", __FUNCTION__);
47 return err;
48 }
49
50 int format = 0;
51 if ((err = parcel->readInt32(&format)) != OK) {
52 ALOGE("%s: Failed to read format from parcel", __FUNCTION__);
53 return err;
54 }
55
Austin Borger4a870a32022-02-25 01:48:41 +000056 float maxPreviewFps = 0;
57 if ((err = parcel->readFloat(&maxPreviewFps)) != OK) {
58 ALOGE("%s: Failed to read maxPreviewFps from parcel", __FUNCTION__);
59 return err;
60 }
61
Shuzhen Wang316781a2020-08-18 18:11:01 -070062 int dataSpace = 0;
63 if ((err = parcel->readInt32(&dataSpace)) != OK) {
64 ALOGE("%s: Failed to read dataSpace from parcel", __FUNCTION__);
65 return err;
66 }
67
68 int64_t usage = 0;
69 if ((err = parcel->readInt64(&usage)) != OK) {
70 ALOGE("%s: Failed to read usage from parcel", __FUNCTION__);
71 return err;
72 }
73
74 int64_t requestCount = 0;
75 if ((err = parcel->readInt64(&requestCount)) != OK) {
76 ALOGE("%s: Failed to read request count from parcel", __FUNCTION__);
77 return err;
78 }
79
80 int64_t errorCount = 0;
81 if ((err = parcel->readInt64(&errorCount)) != OK) {
82 ALOGE("%s: Failed to read error count from parcel", __FUNCTION__);
83 return err;
84 }
85
86 int startLatencyMs = 0;
87 if ((err = parcel->readInt32(&startLatencyMs)) != OK) {
88 ALOGE("%s: Failed to read start latency from parcel", __FUNCTION__);
89 return err;
90 }
91
92 int maxHalBuffers = 0;
93 if ((err = parcel->readInt32(&maxHalBuffers)) != OK) {
94 ALOGE("%s: Failed to read max Hal buffers from parcel", __FUNCTION__);
95 return err;
96 }
97
98 int maxAppBuffers = 0;
99 if ((err = parcel->readInt32(&maxAppBuffers)) != OK) {
100 ALOGE("%s: Failed to read max app buffers from parcel", __FUNCTION__);
101 return err;
102 }
103
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700104 int histogramType = HISTOGRAM_TYPE_UNKNOWN;
105 if ((err = parcel->readInt32(&histogramType)) != OK) {
106 ALOGE("%s: Failed to read histogram type from parcel", __FUNCTION__);
107 return err;
108 }
109
110 std::vector<float> histogramBins;
111 if ((err = parcel->readFloatVector(&histogramBins)) != OK) {
112 ALOGE("%s: Failed to read histogram bins from parcel", __FUNCTION__);
113 return err;
114 }
115
116 std::vector<int64_t> histogramCounts;
117 if ((err = parcel->readInt64Vector(&histogramCounts)) != OK) {
118 ALOGE("%s: Failed to read histogram counts from parcel", __FUNCTION__);
119 return err;
120 }
121
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800122 int64_t dynamicRangeProfile = ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD;
123 if ((err = parcel->readInt64(&dynamicRangeProfile)) != OK) {
Emilian Peev2295df72021-11-12 18:14:10 -0800124 ALOGE("%s: Failed to read dynamic range profile type from parcel", __FUNCTION__);
125 return err;
126 }
127
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800128 int64_t streamUseCase = ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT;
129 if ((err = parcel->readInt64(&streamUseCase)) != OK) {
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800130 ALOGE("%s: Failed to read stream use case from parcel", __FUNCTION__);
131 return err;
132 }
133
Austin Borger9e2b27c2022-07-15 11:27:24 -0700134 int32_t colorSpace = ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP_UNSPECIFIED;
135 if ((err = parcel->readInt32(&colorSpace)) != OK) {
136 ALOGE("%s: Failed to read color space from parcel", __FUNCTION__);
137 return err;
138 }
139
Shuzhen Wang316781a2020-08-18 18:11:01 -0700140 mWidth = width;
141 mHeight = height;
142 mFormat = format;
Austin Borger4a870a32022-02-25 01:48:41 +0000143 mMaxPreviewFps = maxPreviewFps;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700144 mDataSpace = dataSpace;
145 mUsage = usage;
146 mRequestCount = requestCount;
147 mErrorCount = errorCount;
148 mStartLatencyMs = startLatencyMs;
149 mMaxHalBuffers = maxHalBuffers;
150 mMaxAppBuffers = maxAppBuffers;
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700151 mHistogramType = histogramType;
152 mHistogramBins = std::move(histogramBins);
153 mHistogramCounts = std::move(histogramCounts);
Emilian Peev2295df72021-11-12 18:14:10 -0800154 mDynamicRangeProfile = dynamicRangeProfile;
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800155 mStreamUseCase = streamUseCase;
Austin Borger9e2b27c2022-07-15 11:27:24 -0700156 mColorSpace = colorSpace;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700157
158 return OK;
159}
160
161status_t CameraStreamStats::writeToParcel(android::Parcel* parcel) const {
162 if (parcel == NULL) {
163 ALOGE("%s: Null parcel", __FUNCTION__);
164 return BAD_VALUE;
165 }
166
167 status_t err = OK;
168
169 if ((err = parcel->writeInt32(mWidth)) != OK) {
170 ALOGE("%s: Failed to write stream width!", __FUNCTION__);
171 return err;
172 }
173
174 if ((err = parcel->writeInt32(mHeight)) != OK) {
175 ALOGE("%s: Failed to write stream height!", __FUNCTION__);
176 return err;
177 }
178
179 if ((err = parcel->writeInt32(mFormat)) != OK) {
180 ALOGE("%s: Failed to write stream format!", __FUNCTION__);
181 return err;
182 }
183
Austin Borger4a870a32022-02-25 01:48:41 +0000184 if ((err = parcel->writeFloat(mMaxPreviewFps)) != OK) {
185 ALOGE("%s: Failed to write stream maxPreviewFps!", __FUNCTION__);
186 return err;
187 }
188
Shuzhen Wang316781a2020-08-18 18:11:01 -0700189 if ((err = parcel->writeInt32(mDataSpace)) != OK) {
190 ALOGE("%s: Failed to write stream dataSpace!", __FUNCTION__);
191 return err;
192 }
193
194 if ((err = parcel->writeInt64(mUsage)) != OK) {
195 ALOGE("%s: Failed to write stream usage!", __FUNCTION__);
196 return err;
197 }
198
199 if ((err = parcel->writeInt64(mRequestCount)) != OK) {
200 ALOGE("%s: Failed to write stream request count!", __FUNCTION__);
201 return err;
202 }
203
204 if ((err = parcel->writeInt64(mErrorCount)) != OK) {
205 ALOGE("%s: Failed to write stream error count!", __FUNCTION__);
206 return err;
207 }
208
209 if ((err = parcel->writeInt32(mStartLatencyMs)) != OK) {
210 ALOGE("%s: Failed to write stream start latency!", __FUNCTION__);
211 return err;
212 }
213
214 if ((err = parcel->writeInt32(mMaxHalBuffers)) != OK) {
215 ALOGE("%s: Failed to write max hal buffers", __FUNCTION__);
216 return err;
217 }
218
219 if ((err = parcel->writeInt32(mMaxAppBuffers)) != OK) {
220 ALOGE("%s: Failed to write max app buffers", __FUNCTION__);
221 return err;
222 }
223
Shuzhen Wangdb8f2782020-10-30 08:43:37 -0700224 if ((err = parcel->writeInt32(mHistogramType)) != OK) {
225 ALOGE("%s: Failed to write histogram type", __FUNCTION__);
226 return err;
227 }
228
229 if ((err = parcel->writeFloatVector(mHistogramBins)) != OK) {
230 ALOGE("%s: Failed to write histogram bins!", __FUNCTION__);
231 return err;
232 }
233
234 if ((err = parcel->writeInt64Vector(mHistogramCounts)) != OK) {
235 ALOGE("%s: Failed to write histogram counts!", __FUNCTION__);
236 return err;
237 }
238
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800239 if ((err = parcel->writeInt64(mDynamicRangeProfile)) != OK) {
Emilian Peev2295df72021-11-12 18:14:10 -0800240 ALOGE("%s: Failed to write dynamic range profile type", __FUNCTION__);
241 return err;
242 }
243
Shuzhen Wang8ed1e872022-03-08 16:34:33 -0800244 if ((err = parcel->writeInt64(mStreamUseCase)) != OK) {
Shuzhen Wangc8ab4522021-12-14 20:12:42 -0800245 ALOGE("%s: Failed to write stream use case!", __FUNCTION__);
246 return err;
247 }
248
Austin Borger9e2b27c2022-07-15 11:27:24 -0700249 if ((err = parcel->writeInt32(mColorSpace)) != OK) {
250 ALOGE("%s: Failed to write color space", __FUNCTION__);
251 return err;
252 }
253
Shuzhen Wang316781a2020-08-18 18:11:01 -0700254 return OK;
255}
256
Shuzhen Wangbac18d92020-11-19 14:50:30 -0800257const int CameraSessionStats::CAMERA_STATE_OPEN = 0;
258const int CameraSessionStats::CAMERA_STATE_ACTIVE = 1;
259const int CameraSessionStats::CAMERA_STATE_IDLE = 2;
260const int CameraSessionStats::CAMERA_STATE_CLOSED = 3;
261
262const int CameraSessionStats::CAMERA_FACING_BACK = 0;
263const int CameraSessionStats::CAMERA_FACING_FRONT = 1;
264const int CameraSessionStats::CAMERA_FACING_EXTERNAL = 2;
265
266const int CameraSessionStats::CAMERA_API_LEVEL_1 = 1;
267const int CameraSessionStats::CAMERA_API_LEVEL_2 = 2;
268
Shuzhen Wang316781a2020-08-18 18:11:01 -0700269CameraSessionStats::CameraSessionStats() :
270 mFacing(CAMERA_FACING_BACK),
271 mNewCameraState(CAMERA_STATE_CLOSED),
272 mApiLevel(0),
273 mIsNdk(false),
274 mLatencyMs(-1),
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800275 mLogId(0),
Austin Borger4a870a32022-02-25 01:48:41 +0000276 mMaxPreviewFps(0),
Shuzhen Wang316781a2020-08-18 18:11:01 -0700277 mSessionType(0),
278 mInternalReconfigure(0),
279 mRequestCount(0),
280 mResultErrorCount(0),
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700281 mDeviceError(false),
Avichal Rakesh89691e12023-05-01 19:41:02 -0700282 mVideoStabilizationMode(-1),
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700283 mSessionIndex(0),
284 mCameraExtensionSessionStats() {}
Shuzhen Wang316781a2020-08-18 18:11:01 -0700285
Austin Borger1c1bee02023-06-01 16:51:35 -0700286CameraSessionStats::CameraSessionStats(const std::string& cameraId,
287 int facing, int newCameraState, const std::string& clientName,
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800288 int apiLevel, bool isNdk, int32_t latencyMs, int64_t logId) :
Shuzhen Wang316781a2020-08-18 18:11:01 -0700289 mCameraId(cameraId),
290 mFacing(facing),
291 mNewCameraState(newCameraState),
292 mClientName(clientName),
293 mApiLevel(apiLevel),
294 mIsNdk(isNdk),
295 mLatencyMs(latencyMs),
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800296 mLogId(logId),
Austin Borger4a870a32022-02-25 01:48:41 +0000297 mMaxPreviewFps(0),
Shuzhen Wang316781a2020-08-18 18:11:01 -0700298 mSessionType(0),
299 mInternalReconfigure(0),
300 mRequestCount(0),
301 mResultErrorCount(0),
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700302 mDeviceError(0),
Avichal Rakesh89691e12023-05-01 19:41:02 -0700303 mVideoStabilizationMode(-1),
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700304 mSessionIndex(0),
305 mCameraExtensionSessionStats() {}
Shuzhen Wang316781a2020-08-18 18:11:01 -0700306
307status_t CameraSessionStats::readFromParcel(const android::Parcel* parcel) {
308 if (parcel == NULL) {
309 ALOGE("%s: Null parcel", __FUNCTION__);
310 return BAD_VALUE;
311 }
312
313 status_t err = OK;
314
315 String16 id;
316 if ((err = parcel->readString16(&id)) != OK) {
317 ALOGE("%s: Failed to read camera id!", __FUNCTION__);
318 return BAD_VALUE;
319 }
320
321 int facing = 0;
322 if ((err = parcel->readInt32(&facing)) != OK) {
323 ALOGE("%s: Failed to read camera facing from parcel", __FUNCTION__);
324 return err;
325 }
326
327 int32_t newCameraState;
328 if ((err = parcel->readInt32(&newCameraState)) != OK) {
329 ALOGE("%s: Failed to read new camera state from parcel", __FUNCTION__);
330 return err;
331 }
332
333 String16 clientName;
334 if ((err = parcel->readString16(&clientName)) != OK) {
335 ALOGE("%s: Failed to read client name!", __FUNCTION__);
336 return BAD_VALUE;
337 }
338
339 int32_t apiLevel;
340 if ((err = parcel->readInt32(&apiLevel)) != OK) {
341 ALOGE("%s: Failed to read api level from parcel", __FUNCTION__);
342 return err;
343 }
344
345 bool isNdk;
346 if ((err = parcel->readBool(&isNdk)) != OK) {
347 ALOGE("%s: Failed to read isNdk flag from parcel", __FUNCTION__);
348 return err;
349 }
350
351 int32_t latencyMs;
352 if ((err = parcel->readInt32(&latencyMs)) != OK) {
353 ALOGE("%s: Failed to read latencyMs from parcel", __FUNCTION__);
354 return err;
355 }
356
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800357 int64_t logId;
358 if ((err = parcel->readInt64(&logId)) != OK) {
359 ALOGE("%s: Failed to read log ID from parcel", __FUNCTION__);
360 return err;
361 }
362
Austin Borger4a870a32022-02-25 01:48:41 +0000363 float maxPreviewFps;
364 if ((err = parcel->readFloat(&maxPreviewFps)) != OK) {
365 ALOGE("%s: Failed to read maxPreviewFps from parcel", __FUNCTION__);
366 return err;
367 }
368
Shuzhen Wang316781a2020-08-18 18:11:01 -0700369 int32_t sessionType;
370 if ((err = parcel->readInt32(&sessionType)) != OK) {
371 ALOGE("%s: Failed to read session type from parcel", __FUNCTION__);
372 return err;
373 }
374
375 int32_t internalReconfigure;
376 if ((err = parcel->readInt32(&internalReconfigure)) != OK) {
377 ALOGE("%s: Failed to read internal reconfigure count from parcel", __FUNCTION__);
378 return err;
379 }
380
381 int64_t requestCount;
382 if ((err = parcel->readInt64(&requestCount)) != OK) {
383 ALOGE("%s: Failed to read request count from parcel", __FUNCTION__);
384 return err;
385 }
386
387 int64_t resultErrorCount;
388 if ((err = parcel->readInt64(&resultErrorCount)) != OK) {
389 ALOGE("%s: Failed to read result error count from parcel", __FUNCTION__);
390 return err;
391 }
392
393 bool deviceError;
394 if ((err = parcel->readBool(&deviceError)) != OK) {
395 ALOGE("%s: Failed to read device error flag from parcel", __FUNCTION__);
396 return err;
397 }
398
399 std::vector<CameraStreamStats> streamStats;
400 if ((err = parcel->readParcelableVector(&streamStats)) != OK) {
401 ALOGE("%s: Failed to read stream state from parcel", __FUNCTION__);
402 return err;
403 }
404
Shuzhen Wangd26b1862022-03-07 12:05:05 -0800405 String16 userTag;
406 if ((err = parcel->readString16(&userTag)) != OK) {
407 ALOGE("%s: Failed to read user tag!", __FUNCTION__);
408 return BAD_VALUE;
409 }
410
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700411 int32_t videoStabilizationMode;
412 if ((err = parcel->readInt32(&videoStabilizationMode)) != OK) {
413 ALOGE("%s: Failed to read video stabilization mode from parcel", __FUNCTION__);
414 return err;
415 }
416
Avichal Rakesh89691e12023-05-01 19:41:02 -0700417 int32_t sessionIdx;
418 if ((err = parcel->readInt32(&sessionIdx)) != OK) {
419 ALOGE("%s: Failed to read session index from parcel", __FUNCTION__);
420 return err;
421 }
422
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700423 CameraExtensionSessionStats extStats{};
424 if ((err = extStats.readFromParcel(parcel)) != OK) {
425 ALOGE("%s: Failed to read extension session stats from parcel", __FUNCTION__);
426 return err;
427 }
428
Austin Borger1c1bee02023-06-01 16:51:35 -0700429 mCameraId = toStdString(id);
Shuzhen Wang316781a2020-08-18 18:11:01 -0700430 mFacing = facing;
431 mNewCameraState = newCameraState;
Austin Borger1c1bee02023-06-01 16:51:35 -0700432 mClientName = toStdString(clientName);
Shuzhen Wang316781a2020-08-18 18:11:01 -0700433 mApiLevel = apiLevel;
434 mIsNdk = isNdk;
435 mLatencyMs = latencyMs;
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800436 mLogId = logId;
Austin Borger4a870a32022-02-25 01:48:41 +0000437 mMaxPreviewFps = maxPreviewFps;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700438 mSessionType = sessionType;
439 mInternalReconfigure = internalReconfigure;
440 mRequestCount = requestCount;
441 mResultErrorCount = resultErrorCount;
442 mDeviceError = deviceError;
443 mStreamStats = std::move(streamStats);
Austin Borger1c1bee02023-06-01 16:51:35 -0700444 mUserTag = toStdString(userTag);
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700445 mVideoStabilizationMode = videoStabilizationMode;
Avichal Rakesh89691e12023-05-01 19:41:02 -0700446 mSessionIndex = sessionIdx;
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700447 mCameraExtensionSessionStats = extStats;
Shuzhen Wang316781a2020-08-18 18:11:01 -0700448
449 return OK;
450}
451
452status_t CameraSessionStats::writeToParcel(android::Parcel* parcel) const {
453 if (parcel == NULL) {
454 ALOGE("%s: Null parcel", __FUNCTION__);
455 return BAD_VALUE;
456 }
457
458 status_t err = OK;
459
Austin Borger1c1bee02023-06-01 16:51:35 -0700460 if ((err = parcel->writeString16(toString16(mCameraId))) != OK) {
Shuzhen Wang316781a2020-08-18 18:11:01 -0700461 ALOGE("%s: Failed to write camera id!", __FUNCTION__);
462 return err;
463 }
464
465 if ((err = parcel->writeInt32(mFacing)) != OK) {
466 ALOGE("%s: Failed to write camera facing!", __FUNCTION__);
467 return err;
468 }
469
470 if ((err = parcel->writeInt32(mNewCameraState)) != OK) {
471 ALOGE("%s: Failed to write new camera state!", __FUNCTION__);
472 return err;
473 }
474
Austin Borger1c1bee02023-06-01 16:51:35 -0700475 if ((err = parcel->writeString16(toString16(mClientName))) != OK) {
Shuzhen Wang316781a2020-08-18 18:11:01 -0700476 ALOGE("%s: Failed to write client name!", __FUNCTION__);
477 return err;
478 }
479
480 if ((err = parcel->writeInt32(mApiLevel)) != OK) {
481 ALOGE("%s: Failed to write api level!", __FUNCTION__);
482 return err;
483 }
484
485 if ((err = parcel->writeBool(mIsNdk)) != OK) {
486 ALOGE("%s: Failed to write isNdk flag!", __FUNCTION__);
487 return err;
488 }
489
490 if ((err = parcel->writeInt32(mLatencyMs)) != OK) {
491 ALOGE("%s: Failed to write latency in Ms!", __FUNCTION__);
492 return err;
493 }
494
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800495 if ((err = parcel->writeInt64(mLogId)) != OK) {
496 ALOGE("%s: Failed to write log ID!", __FUNCTION__);
497 return err;
498 }
499
Austin Borger4a870a32022-02-25 01:48:41 +0000500 if ((err = parcel->writeFloat(mMaxPreviewFps)) != OK) {
501 ALOGE("%s: Failed to write maxPreviewFps!", __FUNCTION__);
502 return err;
503 }
504
Shuzhen Wang316781a2020-08-18 18:11:01 -0700505 if ((err = parcel->writeInt32(mSessionType)) != OK) {
506 ALOGE("%s: Failed to write session type!", __FUNCTION__);
507 return err;
508 }
509
510 if ((err = parcel->writeInt32(mInternalReconfigure)) != OK) {
511 ALOGE("%s: Failed to write internal reconfigure count!", __FUNCTION__);
512 return err;
513 }
514
515 if ((err = parcel->writeInt64(mRequestCount)) != OK) {
516 ALOGE("%s: Failed to write request count!", __FUNCTION__);
517 return err;
518 }
519
520 if ((err = parcel->writeInt64(mResultErrorCount)) != OK) {
521 ALOGE("%s: Failed to write result error count!", __FUNCTION__);
522 return err;
523 }
524
525 if ((err = parcel->writeBool(mDeviceError)) != OK) {
526 ALOGE("%s: Failed to write device error flag!", __FUNCTION__);
527 return err;
528 }
529
530 if ((err = parcel->writeParcelableVector(mStreamStats)) != OK) {
531 ALOGE("%s: Failed to write stream states!", __FUNCTION__);
532 return err;
533 }
534
Austin Borger1c1bee02023-06-01 16:51:35 -0700535 if ((err = parcel->writeString16(toString16(mUserTag))) != OK) {
Shuzhen Wangd26b1862022-03-07 12:05:05 -0800536 ALOGE("%s: Failed to write user tag!", __FUNCTION__);
537 return err;
538 }
Shuzhen Wang9372b0b2022-05-11 18:55:19 -0700539
540 if ((err = parcel->writeInt32(mVideoStabilizationMode)) != OK) {
541 ALOGE("%s: Failed to write video stabilization mode!", __FUNCTION__);
542 return err;
543 }
Avichal Rakesh88fc5222023-03-03 15:00:59 -0800544
Avichal Rakesh89691e12023-05-01 19:41:02 -0700545 if ((err = parcel->writeInt32(mSessionIndex)) != OK) {
546 ALOGE("%s: Failed to write session index!", __FUNCTION__);
547 return err;
548 }
549
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700550 if ((err = mCameraExtensionSessionStats.writeToParcel(parcel)) != OK) {
551 ALOGE("%s: Failed to write extension sessions stats!", __FUNCTION__);
552 return err;
553 }
554
Shuzhen Wang316781a2020-08-18 18:11:01 -0700555 return OK;
556}
557
558} // namespace hardware
559} // namesmpace android