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(const sptr<VideoSessionInfo>& sessionInfo); 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 sptr<VideoSessionInfo> sessionInfo_; 39 }; 40 41 class AddVideoSessionCommand : public SessionCommand { 42 DECLARE_CMD_CLASS(AddVideoSessionCommand) 43 public: 44 using SessionCommand::SessionCommand; 45 46 protected: 47 int32_t Executing() override; 48 }; 49 50 class DeleteVideoSessionCommand : public SessionCommand { 51 DECLARE_CMD_CLASS(DeleteVideoSessionCommand) 52 public: 53 using SessionCommand::SessionCommand; 54 55 protected: 56 int32_t Executing() override; 57 }; 58 } // namespace DeferredProcessing 59 } // namespace CameraStandard 60 } // namespace OHOS 61 #endif // OHOS_CAMERA_DPS_SESSION_COMMAND_H