• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file expected in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "hdi_common_v1_1.h"
17 #include "camera.h"
18 #include "video_key_info.h"
19 
20 namespace OHOS::Camera {
21 Test::ResultCallback Test::resultCallback_ = 0;
22 
GetCurrentLocalTimeStamp()23 uint64_t Test::GetCurrentLocalTimeStamp()
24 {
25     std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds> tp =
26         std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());
27     auto tmp = std::chrono::duration_cast<std::chrono::milliseconds>(tp.time_since_epoch());
28     return static_cast<uint64_t>(tmp.count());
29 }
30 
DumpImageFile(int streamId,std::string suffix,const void * buffer,int32_t size)31 int32_t Test::DumpImageFile(int streamId, std::string suffix, const void* buffer, int32_t size)
32 {
33     if (imageDataSaveSwitch == SWITCH_OFF) {
34         return 0;
35     }
36     if (streamId < 0) {
37         CAMERA_LOGE("ivalid stream id: %{public}d", streamId);
38         return -1;
39     }
40     char mkdirCmd[PATH_MAX] = {0};
41     char path[PATH_MAX] = {0};
42     int ret = sprintf_s(mkdirCmd, sizeof(mkdirCmd) / sizeof(mkdirCmd[0]),
43         "mkdir -p /data/stream-%d", streamId);
44     if (ret < 0) {
45         return -1;
46     }
47     system(mkdirCmd);
48     ret = sprintf_s(path, sizeof(path) / sizeof(path[0]), "data/stream-%d/%lld.%s",
49         streamId, GetCurrentLocalTimeStamp(), suffix.c_str());
50     if (ret < 0) {
51         return -1;
52     }
53 
54     int imgFd = open(path, O_RDWR | O_CREAT, 00766);
55     if (imgFd == -1) {
56         CAMERA_LOGE("open file failed, errno: %{public}s", strerror(errno));
57         return -1;
58     }
59 
60     ret = write(imgFd, buffer, size);
61     if (ret == -1) {
62         CAMERA_LOGE("write file failed, error: %{public}s", strerror(errno));
63         close(imgFd);
64         return -1;
65     }
66     close(imgFd);
67     return 0;
68 }
69 
Init()70 void Test::Init()
71 {
72     uint32_t mainVer;
73     uint32_t minVer;
74     int32_t ret;
75     if (serviceV1_1 == nullptr) {
76         serviceV1_1 = OHOS::HDI::Camera::V1_1::ICameraHost::Get("camera_service", false);
77         if (serviceV1_1 == nullptr) {
78             CAMERA_LOGE("V1_1::ICameraHost get failed");
79             return;
80         } else {
81             CAMERA_LOGI("ICameraHost get success");
82             ret = serviceV1_1->GetVersion(mainVer, minVer);
83             if (ret != 0) {
84                 CAMERA_LOGE("V1_1::ICameraHost get version failed, ret = %{public}d", ret);
85             } else {
86                 CAMERA_LOGE("V1_1::ICameraHost get version success, %{public}d, %{public}d", mainVer, minVer);
87             }
88         }
89         ASSERT_TRUE(serviceV1_1 != nullptr);
90         service = static_cast<OHOS::HDI::Camera::V1_0::ICameraHost *>(serviceV1_1.GetRefPtr());
91     }
92     hostCallback = new TestCameraHostCallback();
93     service->SetCallback(hostCallback);
94 }
95 
GetCameraMetadata(int cameraId)96 void Test::GetCameraMetadata(int cameraId)
97 {
98     rc = service->GetCameraAbility(cameraIds.front(), abilityVec);
99     if (rc != HDI::Camera::V1_0::NO_ERROR) {
100         CAMERA_LOGE("GetCameraAbility failed, rc = %{public}d", rc);
101     }
102     MetadataUtils::ConvertVecToMetadata(abilityVec, ability);
103 
104     common_metadata_header_t* data = ability->get();
105     camera_metadata_item_t entry;
106     int ret = FindCameraMetadataItem(data, OHOS_CONTROL_AE_AVAILABLE_MODES, &entry);
107     if (ret == 0) {
108         CAMERA_LOGI("get OHOS_CONTROL_AE_AVAILABLE_MODES success");
109     }
110 }
111 
Open(int cameraId)112 void Test::Open(int cameraId)
113 {
114     if (cameraDevice == nullptr) {
115         service->GetCameraIds(cameraIds);
116         if (cameraIds.size() == 0) {
117             CAMERA_LOGE("camera device list empty");
118         }
119         ASSERT_TRUE(cameraIds.size() != 0);
120         GetCameraMetadata(cameraId);
121         deviceCallback = new OHOS::Camera::Test::DemoCameraDeviceCallback();
122 
123         ASSERT_TRUE(serviceV1_1 != nullptr);
124         rc = serviceV1_1->OpenCamera_V1_1(cameraIds.front(), deviceCallback, cameraDeviceV1_1);
125         if (rc != HDI::Camera::V1_0::NO_ERROR || cameraDeviceV1_1 == nullptr) {
126             CAMERA_LOGE("openCamera V1_1 failed, rc = %{public}d", rc);
127             return;
128         }
129         ASSERT_TRUE(cameraDeviceV1_1 != nullptr);
130         cameraDevice = static_cast<OHOS::HDI::Camera::V1_0::ICameraDevice *>(cameraDeviceV1_1.GetRefPtr());
131         CAMERA_LOGI("OpenCamera V1_1 success");
132     }
133 }
134 
Close()135 void Test::Close()
136 {
137     if (cameraDevice != nullptr) {
138         cameraDevice->Close();
139         cameraDevice = nullptr;
140     }
141 }
142 
StartStream(std::vector<StreamIntent> intents)143 void Test::StartStream(std::vector<StreamIntent> intents)
144 {
145     streamOperatorCallback = new TestStreamOperatorCallback();
146     uint32_t mainVersion = 1;
147     uint32_t minVersion = 0;
148     rc = cameraDeviceV1_1->GetStreamOperator_V1_1(streamOperatorCallback, streamOperator_V1_1);
149     if (rc == HDI::Camera::V1_0::NO_ERROR) {
150         rc = streamOperator_V1_1->GetVersion(mainVersion, minVersion);
151         streamOperator = static_cast<OHOS::HDI::Camera::V1_0::IStreamOperator *>(streamOperator_V1_1.GetRefPtr());
152         if (rc != HDI::Camera::V1_0::NO_ERROR) {
153             CAMERA_LOGE("StreamOperator V1_1 get version failed, rc = %{public}d", rc);
154         } else {
155             CAMERA_LOGI("StreamOperator V1_1 get version success, %{public}u, %{public}u",
156                 mainVersion, minVersion);
157         }
158         CAMERA_LOGI("GetStreamOperator success");
159     } else {
160         CAMERA_LOGE("GetStreamOperator fail, rc = %{public}d", rc);
161     }
162     streamInfoPre = std::make_shared<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>();
163     streamInfoVideo = std::make_shared<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>();
164     streamInfoCapture = std::make_shared<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>();
165     streamInfoAnalyze = std::make_shared<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>();
166     for (auto& intent : intents) {
167         if (intent == StreamIntent::PREVIEW) {
168             streamInfoPre->v1_0.streamId_ = streamIdPreview;
169             streamInfoPre->v1_0.width_ = previewWidth;
170             streamInfoPre->v1_0.height_ = previewHeight;
171             streamInfoPre->v1_0.format_ = previewFormat;
172             streamInfoPre->v1_0.dataspace_ = UT_DATA_SIZE;
173             streamInfoPre->v1_0.intent_ = intent;
174             streamInfoPre->v1_0.tunneledMode_ = UT_TUNNEL_MODE;
175             std::shared_ptr<StreamConsumer> consumer_pre = std::make_shared<StreamConsumer>();
176             streamInfoPre->v1_0.bufferQueue_ = consumer_pre->CreateProducerSeq([this](void* addr, uint32_t size) {
177                 DumpImageFile(streamIdPreview, "yuv", addr, size);
178             });
179             streamInfoPre->v1_0.bufferQueue_->producer_->SetQueueSize(UT_DATA_SIZE);
180             consumerMap_[intent] = consumer_pre;
181             streamInfos.push_back(*streamInfoPre);
182         } else if (intent == StreamIntent::VIDEO) {
183             streamInfoVideo->v1_0.streamId_ = streamIdVideo;
184             streamInfoVideo->v1_0.width_ = videoWidth;
185             streamInfoVideo->v1_0.height_ = videoHeight;
186             streamInfoVideo->v1_0.format_ = videoFormat;
187             streamInfoVideo->v1_0.dataspace_ = UT_DATA_SIZE;
188             streamInfoVideo->v1_0.intent_ = intent;
189             streamInfoVideo->v1_0.encodeType_ = ENCODE_TYPE_H265;
190             streamInfoVideo->v1_0.tunneledMode_ = UT_TUNNEL_MODE;
191             std::shared_ptr<StreamConsumer> consumer_video = std::make_shared<StreamConsumer>();
192             streamInfoVideo->v1_0.bufferQueue_ = consumer_video->CreateProducerSeq([this](void* addr, uint32_t size) {
193                 DumpImageFile(streamIdPreview, "yuv", addr, size);
194             });
195             streamInfoVideo->v1_0.bufferQueue_->producer_->SetQueueSize(UT_DATA_SIZE);
196             consumerMap_[intent] = consumer_video;
197             streamInfos.push_back(*streamInfoVideo);
198         } else if (intent == StreamIntent::ANALYZE) {
199             streamInfoAnalyze->v1_0.streamId_ = streamIdAnalyze;
200             streamInfoAnalyze->v1_0.width_ = analyzeWidth;
201             streamInfoAnalyze->v1_0.height_ = analyzeHeight;
202             streamInfoAnalyze->v1_0.format_ = analyzeFormat;
203             streamInfoAnalyze->v1_0.dataspace_ = UT_DATA_SIZE;
204             streamInfoAnalyze->v1_0.intent_ = intent;
205             streamInfoAnalyze->v1_0.tunneledMode_ = UT_TUNNEL_MODE;
206 
207             std::shared_ptr<StreamConsumer> consumer_analyze = std::make_shared<StreamConsumer>();
208             streamInfoAnalyze->v1_0.bufferQueue_ =
209                 consumer_analyze->CreateProducerSeq([this](void* addr, uint32_t size) {
210                 common_metadata_header_t *data = static_cast<common_metadata_header_t *>(addr);
211                 camera_metadata_item_t entry = {};
212 
213                 int ret = FindCameraMetadataItem(data, OHOS_STATISTICS_FACE_IDS, &entry);
214                 if (ret == 0) {
215                     for (size_t i = 0; i < entry.count; i++) {
216                         int id = entry.data.i32[i];
217                         CAMERA_LOGI("Face ids : %{public}d", id);
218                     }
219                 }
220 
221                 ret = FindCameraMetadataItem(data, OHOS_STATISTICS_FACE_RECTANGLES, &entry);
222                 if (ret == 0) {
223                     for (size_t i = 0; i < entry.count; i++) {
224                         int id = entry.data.i32[i];
225                         CAMERA_LOGI("Face rectangles : %{public}d", id);
226                     }
227                 }
228             });
229             streamInfoAnalyze->v1_0.bufferQueue_->producer_->SetQueueSize(UT_DATA_SIZE);
230             consumerMap_[intent] = consumer_analyze;
231             streamInfos.push_back(*streamInfoAnalyze);
232         } else {
233             streamInfoCapture->v1_0.streamId_ = streamIdAnalyze;
234             streamInfoCapture->v1_0.width_ = analyzeWidth;
235             streamInfoCapture->v1_0.height_ = analyzeHeight;
236             streamInfoCapture->v1_0.format_ = analyzeFormat;
237             streamInfoCapture->v1_0.dataspace_ = UT_DATA_SIZE;
238             streamInfoCapture->v1_0.intent_ = intent;
239             streamInfoCapture->v1_0.tunneledMode_ = UT_TUNNEL_MODE;
240             std::shared_ptr<StreamConsumer> consumer_capture = std::make_shared<StreamConsumer>();
241             streamInfoCapture->v1_0.bufferQueue_ =
242                 consumer_capture->CreateProducerSeq([this](void* addr, uint32_t size) {
243                 DumpImageFile(streamIdPreview, "yuv", addr, size);
244             });
245             streamInfoCapture->v1_0.bufferQueue_->producer_->SetQueueSize(UT_DATA_SIZE);
246             consumerMap_[intent] = consumer_capture;
247             streamInfos.push_back(*streamInfoCapture);
248         }
249     }
250 
251     rc = streamOperator_V1_1->CreateStreams_V1_1(streamInfos);
252     EXPECT_EQ(false, rc != HDI::Camera::V1_0::NO_ERROR);
253     rc = streamOperator_V1_1->CommitStreams(OperationMode::NORMAL, abilityVec);
254     EXPECT_EQ(false, rc != HDI::Camera::V1_0::NO_ERROR);
255     sleep(1);
256     std::vector<OHOS::HDI::Camera::V1_1::StreamInfo_V1_1>().swap(streamInfos);
257 }
258 
StartCapture(int streamId,int captureId,bool shutterCallback,bool isStreaming)259 void Test::StartCapture(int streamId, int captureId, bool shutterCallback, bool isStreaming)
260 {
261     captureInfo = std::make_shared<CaptureInfo>();
262     captureInfo->streamIds_ = {streamId};
263     captureInfo->captureSetting_ = abilityVec;
264     captureInfo->enableShutterCallback_ = shutterCallback;
265     if (streamOperator_V1_1 != nullptr) {
266         rc = (CamRetCode)streamOperator_V1_1->Capture(captureId, *captureInfo, isStreaming);
267     } else {
268         rc = (CamRetCode)streamOperator->Capture(captureId, *captureInfo, isStreaming);
269     }
270     EXPECT_EQ(true, rc == HDI::Camera::V1_0::NO_ERROR);
271     if (rc == HDI::Camera::V1_0::NO_ERROR) {
272         CAMERA_LOGI("check Capture: Capture success, %{public}d", captureId);
273     } else {
274         std::cout << "rc = " << rc << std::endl;
275         CAMERA_LOGE("check Capture: Capture fail, rc = %{public}d", rc);
276     }
277     sleep(UT_SLEEP_TIME);
278 }
279 
StopStream(std::vector<int> & captureIds,std::vector<int> & streamIds)280 void Test::StopStream(std::vector<int>& captureIds, std::vector<int>& streamIds)
281 {
282     if (sizeof(captureIds) > 0) {
283         for (auto &captureId : captureIds) {
284             if (streamOperator_V1_1 != nullptr) {
285                 rc = streamOperator_V1_1->CancelCapture(captureId);
286             } else {
287                 rc = streamOperator->CancelCapture(captureId);
288             }
289             EXPECT_EQ(true, rc == HDI::Camera::V1_0::NO_ERROR);
290             if (rc == HDI::Camera::V1_0::NO_ERROR) {
291                 CAMERA_LOGI("check Capture: CancelCapture success, %{public}d", captureId);
292             } else {
293                 CAMERA_LOGE("check Capture: CancelCapture fail, rc = %{public}d, captureId = %{public}d",
294                     rc, captureId);
295             }
296         }
297     }
298     if (sizeof(streamIds) > 0) {
299         if (streamOperator_V1_1 != nullptr) {
300             rc = streamOperator_V1_1->ReleaseStreams(streamIds);
301         } else {
302             rc = streamOperator->ReleaseStreams(streamIds);
303         }
304         EXPECT_EQ(true, rc == HDI::Camera::V1_0::NO_ERROR);
305         if (rc == HDI::Camera::V1_0::NO_ERROR) {
306             CAMERA_LOGI("check Capture: ReleaseStream success");
307         } else {
308             CAMERA_LOGE("check Capture: ReleaseStreams fail, rc = %{public}d", rc);
309         }
310     }
311 }
312 
CalculateFps(int64_t timestamp,int32_t streamId)313 void Test::StreamConsumer::CalculateFps(int64_t timestamp, int32_t streamId)
314 {
315     if (isFirstCalculateFps_) {
316         if ((timestamp - intervalTimestamp_) >= interval_) {
317             int64_t timeInterval = timestamp - intervalTimestamp_;
318             if (timeInterval != 0) {
319                 float fps = (int64_t)(100000000000 * timestampCount_ / timeInterval) / 100.0;
320                 CAMERA_LOGI("Calculate FPS success, streamId: %{public}d, Fps:%{public}f", streamId, fps);
321                 interval_ = ONESECOND_OF_MICROSECOND_UNIT;
322             } else {
323                 CAMERA_LOGE("Calculate FPS error timeInerval is 0");
324             }
325         }
326     } else {
327         intervalTimestamp_ = timestamp;
328         isFirstCalculateFps_ = true;
329     }
330     if ((timestamp - intervalTimestamp_) >= ONESECOND_OF_MICROSECOND_UNIT * UT_SECOND_TIMES) {
331         intervalTimestamp_ = timestamp;
332         timestampCount_ = 0;
333         interval_ = ONESECOND_OF_MICROSECOND_UNIT;
334     }
335     timestampCount_++;
336 }
337 
CreateProducer(std::function<void (void *,uint32_t)> callback)338 OHOS::sptr<OHOS::IBufferProducer> Test::StreamConsumer::CreateProducer(std::function<void(void*, uint32_t)> callback)
339 {
340     consumer_ = OHOS::IConsumerSurface::Create();
341     if (consumer_ == nullptr) {
342         return nullptr;
343     }
344     sptr<IBufferConsumerListener> listener = new TestBufferConsumerListener();
345     consumer_->RegisterConsumerListener(listener);
346     auto producer = consumer_->GetProducer();
347     if (producer == nullptr) {
348         return nullptr;
349     }
350 
351     callback_ = callback;
352     consumerThread_ = new std::thread([this, listener] {
353         int32_t flushFence = 0;
354         int64_t timestamp = 0;
355         OHOS::Rect damage;
356         TestBufferConsumerListener* checker = static_cast<TestBufferConsumerListener*>(listener.GetRefPtr());
357         while (running_ == true) {
358             OHOS::sptr<OHOS::SurfaceBuffer> buffer = nullptr;
359             if (checker->checkBufferAvailable()) {
360                 consumer_->AcquireBuffer(buffer, flushFence, timestamp, damage);
361                 if (buffer != nullptr) {
362                     void* addr = buffer->GetVirAddr();
363                     uint32_t size = buffer->GetSize();
364 
365                     int32_t gotSize = 0;
366                     int32_t isKey = 0;
367                     int32_t streamId = 0;
368                     int32_t captureId = 0;
369                     buffer->GetExtraData()->ExtraGet(OHOS::Camera::dataSize, gotSize);
370                     buffer->GetExtraData()->ExtraGet(OHOS::Camera::isKeyFrame, isKey);
371                     buffer->GetExtraData()->ExtraGet(OHOS::Camera::timeStamp, timestamp);
372                     buffer->GetExtraData()->ExtraGet(OHOS::Camera::streamId, streamId);
373                     buffer->GetExtraData()->ExtraGet(OHOS::Camera::captureId, captureId);
374                     if (gotSize) {
375                         CalculateFps(timestamp, streamId);
376                         callback_(addr, gotSize);
377                     } else {
378                         callback_(addr, size);
379                     }
380 
381                     consumer_->ReleaseBuffer(buffer, -1);
382                     shotCount_--;
383                     if (shotCount_ == 0) {
384                         std::unique_lock<std::mutex> l(l_);
385                         cv_.notify_one();
386                     }
387                 }
388             }
389             if (running_ == false) {
390                 break;
391             }
392             usleep(1);
393         }
394     });
395 
396     return producer;
397 }
398 
CreateProducerSeq(std::function<void (void *,uint32_t)> callback)399 OHOS::sptr<BufferProducerSequenceable> Test::StreamConsumer::CreateProducerSeq(
400     std::function<void(void*, uint32_t)> callback)
401 {
402     OHOS::sptr<OHOS::IBufferProducer> producer = CreateProducer(callback);
403     if (producer == nullptr) {
404         return nullptr;
405     }
406 
407     return new BufferProducerSequenceable(producer);
408 }
409 
OnCaptureStarted(int32_t captureId,const std::vector<int32_t> & streamId)410 int32_t Test::TestStreamOperatorCallback::OnCaptureStarted(int32_t captureId, const std::vector<int32_t> &streamId)
411 {
412     for (auto it : streamId) {
413         CAMERA_LOGE("captureId: %{public}d, streamId: %{public}d", captureId, it);
414     }
415     return HDI::Camera::V1_0::NO_ERROR;
416 }
417 
OnCaptureEnded(int32_t captureId,const std::vector<CaptureEndedInfo> & infos)418 int32_t Test::TestStreamOperatorCallback::OnCaptureEnded(int32_t captureId, const std::vector<CaptureEndedInfo> &infos)
419 {
420     for (auto it : infos) {
421         CAMERA_LOGE("captureId: %{public}d, streamId: %{public}d, count: %{public}d", captureId, it.streamId_,
422             it.frameCount_);
423     }
424     return HDI::Camera::V1_0::NO_ERROR;
425 }
426 
OnCaptureError(int32_t captureId,const std::vector<CaptureErrorInfo> & infos)427 int32_t Test::TestStreamOperatorCallback::OnCaptureError(int32_t captureId, const std::vector<CaptureErrorInfo> &infos)
428 {
429     for (auto it : infos) {
430         CAMERA_LOGE("captureId: %{public}d, streamId: %{public}d, error: %{public}d", captureId, it.streamId_,
431             it.error_);
432     }
433     return HDI::Camera::V1_0::NO_ERROR;
434 }
435 
OnFrameShutter(int32_t captureId,const std::vector<int32_t> & streamIds,uint64_t timestamp)436 int32_t Test::TestStreamOperatorCallback::OnFrameShutter(int32_t captureId,
437     const std::vector<int32_t> &streamIds, uint64_t timestamp)
438 {
439     (void)timestamp;
440     for (auto it : streamIds) {
441         CAMERA_LOGE("captureId: %{public}d, streamId: %{public}d", captureId, it);
442     }
443     return HDI::Camera::V1_0::NO_ERROR;
444 }
445 
OnError(ErrorType type,int32_t errorMsg)446 int32_t Test::DemoCameraDeviceCallback::OnError(ErrorType type, int32_t errorMsg)
447 {
448     CAMERA_LOGE("type: %{public}d, errorMsg: %{public}d", type, errorMsg);
449     return HDI::Camera::V1_0::NO_ERROR;
450 }
451 
OnResult(uint64_t timestamp,const std::vector<uint8_t> & result)452 int32_t Test::DemoCameraDeviceCallback::OnResult(uint64_t timestamp, const std::vector<uint8_t> &result)
453 {
454     if (Test::resultCallback_) {
455         std::shared_ptr<CameraMetadata> resultMeta;
456         MetadataUtils::ConvertVecToMetadata(result, resultMeta);
457         Test::resultCallback_(timestamp, resultMeta);
458     }
459     return HDI::Camera::V1_0::NO_ERROR;
460 }
461 
OnCameraStatus(const std::string & cameraId,CameraStatus status)462 int32_t Test::TestCameraHostCallback::OnCameraStatus(const std::string& cameraId, CameraStatus status)
463 {
464     CAMERA_LOGE("cameraId: %{public}s, status: %{public}d", cameraId.c_str(), status);
465     return HDI::Camera::V1_0::NO_ERROR;
466 }
467 
OnFlashlightStatus(const std::string & cameraId,FlashlightStatus status)468 int32_t Test::TestCameraHostCallback::OnFlashlightStatus(const std::string& cameraId, FlashlightStatus status)
469 {
470     CAMERA_LOGE("cameraId: %{public}s, status: %{public}d", cameraId.c_str(), status);
471     return HDI::Camera::V1_0::NO_ERROR;
472 }
473 
OnCameraEvent(const std::string & cameraId,CameraEvent event)474 int32_t Test::TestCameraHostCallback::OnCameraEvent(const std::string& cameraId, CameraEvent event)
475 {
476     CAMERA_LOGE("cameraId: %{public}s, status: %{public}d", cameraId.c_str(), event);
477     return HDI::Camera::V1_0::NO_ERROR;
478 }
479 
480 }