1 /* 2 * Copyright (C) 2025 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 17 #ifndef MEDIA_AVCODEC_SUSPEND_H 18 #define MEDIA_AVCODEC_SUSPEND_H 19 20 #include <cstdint> 21 #include <vector> 22 23 namespace OHOS { 24 namespace MediaAVCodec { 25 class AVCodecSuspend { 26 public: 27 /** 28 * @brief Get freeze status message from suspend manager. 29 * 30 * @param pidList The list of pid to be frozen. 31 * @return Returns {@link AVCS_ERR_OK} if success; returns an error code otherwise. 32 * @since 5.1 33 */ 34 static int32_t SuspendFreeze(const std::vector<pid_t> &pidList); 35 36 /** 37 * @brief Get active status message from suspend manager. 38 * 39 * @param pidList The list of pid to be active. 40 * @return Returns {@link AVCS_ERR_OK} if success; returns an error code otherwise. 41 * @since 5.1 42 */ 43 static int32_t SuspendActive(const std::vector<pid_t> &pidList); 44 45 /** 46 * @brief Reset all frozen pids into active state. 47 * 48 * @return Returns {@link AVCS_ERR_OK} if success; returns an error code otherwise. 49 * @since 5.1 50 */ 51 static int32_t SuspendActiveAll(); 52 53 private: 54 AVCodecSuspend() = default; 55 ~AVCodecSuspend() = default; 56 }; 57 } // namespace MediaAVCodec 58 } // namespace OHOS 59 #endif // MEDIA_AVCODEC_SUSPEND_H 60