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_SERVICE_DIED_COMMAND_H 17 #define OHOS_CAMERA_DPS_SERVICE_DIED_COMMAND_H 18 19 #include "command.h" 20 #include "scheduler_manager.h" 21 22 namespace OHOS { 23 namespace CameraStandard { 24 namespace DeferredProcessing { 25 class ServiceDiedCommand : public Command { 26 DECLARE_CMD_CLASS(ServiceDiedCommand); 27 public: 28 ServiceDiedCommand(const int32_t userId); 29 ~ServiceDiedCommand() override = default; 30 31 protected: 32 int32_t Initialize(); 33 34 const int32_t userId_; 35 std::atomic<bool> initialized_ {false}; 36 std::shared_ptr<SchedulerManager> schedulerManager_ {nullptr}; 37 }; 38 39 class PhotoDiedCommand : public ServiceDiedCommand { 40 DECLARE_CMD_CLASS(PhotoDiedCommand); 41 public: 42 using ServiceDiedCommand::ServiceDiedCommand; 43 44 protected: 45 int32_t Executing() override; 46 }; 47 48 class VideoDiedCommand : public ServiceDiedCommand { 49 DECLARE_CMD_CLASS(VideoDiedCommand); 50 public: 51 using ServiceDiedCommand::ServiceDiedCommand; 52 53 protected: 54 int32_t Executing() override; 55 }; 56 } // namespace DeferredProcessing 57 } // namespace CameraStandard 58 } // namespace OHOS 59 #endif // OHOS_CAMERA_DPS_SERVICE_DIED_COMMAND_H