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