1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except 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 #ifndef META_DATA_H
17 #define META_DATA_H
18 
19 #include "test_camera_base.h"
20 #define PREVIEW_WIDTH  640
21 #define PREVIEW_HEIGHT 480
22 
23 class MetaDataTest : public testing::Test {
24 public:
25     static void SetUpTestCase(void);
26     static void TearDownTestCase(void);
27     void SetUp(void);
28     void TearDown(void);
29     void CreateStream(int streamId, StreamIntent intent);
30     void CommitStream();
31     void SetStreamInfo(StreamInfo &streamInfo, const std::shared_ptr<StreamCustomer> &streamCustomer,
32         const int streamId, const StreamIntent intent);
33     void StartCapture(
34         int streamId, int captureId, bool shutterCallback, bool isStreaming, const CaptureInfo captureInfo);
35     void StopStream(std::vector<int> &captureIds, std::vector<int> &streamIds);
36     void StartCustomCapture();
37     void StartPreviewVideoStream();
38     void StartPreviewCaptureStream();
39     void StopPreviewVideoStream();
40     void StopPreviewCaptureStream();
41     void SetFps(std::shared_ptr<CameraSetting> &metaData, int32_t fps, bool isUpdate);
42     void Prepare(ResultCallbackMode mode, std::vector<MetaType> &results);
43     void UpdateSettings(std::shared_ptr<CameraSetting> &metaData);
44     void StartPreviewVideoCapture();
45 
46 public:
47     CamRetCode result_;
48     std::shared_ptr<TestCameraBase> cameraBase_ = nullptr;
49     std::shared_ptr<StreamCustomer> streamCustomerPreview_ = nullptr;
50     std::shared_ptr<StreamCustomer> streamCustomerSnapshot_ = nullptr;
51     std::shared_ptr<StreamCustomer> streamCustomerVideo_ = nullptr;
52     std::vector<StreamInfo> streamInfos_;
53     CaptureInfo captureInfo_ = {};
54 };
55 #endif /* META_DATA_H */
56