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 DOUBLE_PREVIEW_H
17#define DOUBLE_PREVIEW_H
18
19#include "test_camera_base.h"
20#define PREVIEW_WIDTH 640
21#define PREVIEW_HEIGHT 480
22
23enum {
24    STREAMID_PREVIEW_DOUBLE = 1004, // double preview streamID
25    CAPTUREID_PREVIEW_DOUBLE = 2004, // double preview captureId
26};
27
28class DoublePreviewTest : public testing::Test {
29public:
30    static void SetUpTestCase(void);
31    static void TearDownTestCase(void);
32    void SetUp(void);
33    void TearDown(void);
34    void CreateStream(int streamId, StreamIntent intent);
35    void CommitStream();
36    void SetStreamInfo(StreamInfo &streamInfo,
37        const std::shared_ptr<StreamCustomer> &streamCustomer,
38        const int streamId, const StreamIntent intent);
39    void StartCapture(int streamId, int captureId, bool shutterCallback, bool isStreaming);
40    void StopStream(std::vector<int> &captureIds, std::vector<int> &streamIds);
41
42    CamRetCode result_;
43    std::shared_ptr<TestCameraBase> cameraBase_ = nullptr;
44    std::shared_ptr<StreamCustomer> streamCustomerPreview_ = nullptr;
45    std::shared_ptr<StreamCustomer> streamCustomerPreviewDouble_ = nullptr;
46    std::vector<StreamInfo> streamInfos_;
47    CaptureInfo captureInfo_ = {};
48};
49#endif /* DOUBLE_PREVIEW_H */
50