1 /* 2 * Copyright (c) 2023-2023 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 OHOS_CAMERA_DPS_SESSION_COMMAND_H 17 #define OHOS_CAMERA_DPS_SESSION_COMMAND_H 18 19 #include "command.h" 20 #include "scheduler_manager.h" 21 #include "session_manager.h" 22 #include "video_session_info.h" 23 24 namespace OHOS { 25 namespace CameraStandard { 26 namespace DeferredProcessing { 27 28 class SessionCommand : public Command { 29 public: 30 SessionCommand(); 31 ~SessionCommand() override; 32 33 protected: 34 int32_t Initialize(); 35 36 std::atomic<bool> initialized_ {false}; 37 std::shared_ptr<SessionManager> sessionManager_ {nullptr}; 38 std::shared_ptr<SchedulerManager> schedulerManager_ {nullptr}; 39 }; 40 41 class AddPhotoSessionCommand : public SessionCommand { 42 DECLARE_CMD_CLASS(AddPhotoSessionCommand) 43 public: 44 AddPhotoSessionCommand(const sptr<PhotoSessionInfo>& info); 45 46 protected: 47 int32_t Executing() override; 48 49 sptr<PhotoSessionInfo> photoInfo_; 50 }; 51 52 class DeletePhotoSessionCommand : public SessionCommand { 53 DECLARE_CMD_CLASS(DeletePhotoSessionCommand) 54 public: 55 DeletePhotoSessionCommand(const sptr<PhotoSessionInfo>& info); 56 57 protected: 58 int32_t Executing() override; 59 60 sptr<PhotoSessionInfo> photoInfo_; 61 }; 62 63 class AddVideoSessionCommand : public SessionCommand { 64 DECLARE_CMD_CLASS(AddVideoSessionCommand) 65 public: 66 AddVideoSessionCommand(const sptr<VideoSessionInfo>& info); 67 68 protected: 69 int32_t Executing() override; 70 71 sptr<VideoSessionInfo> videoInfo_; 72 }; 73 74 class DeleteVideoSessionCommand : public SessionCommand { 75 DECLARE_CMD_CLASS(DeleteVideoSessionCommand) 76 public: 77 DeleteVideoSessionCommand(const sptr<VideoSessionInfo>& info); 78 79 protected: 80 int32_t Executing() override; 81 82 sptr<VideoSessionInfo> videoInfo_; 83 }; 84 } // namespace DeferredProcessing 85 } // namespace CameraStandard 86 } // namespace OHOS 87 #endif // OHOS_CAMERA_DPS_SESSION_COMMAND_H