1049e185fSopenharmony_ci/* 2049e185fSopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd. 3049e185fSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4049e185fSopenharmony_ci * you may not use this file except in compliance with the License. 5049e185fSopenharmony_ci * You may obtain a copy of the License at 6049e185fSopenharmony_ci * 7049e185fSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8049e185fSopenharmony_ci * 9049e185fSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10049e185fSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11049e185fSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12049e185fSopenharmony_ci * See the License for the specific language governing permissions and 13049e185fSopenharmony_ci * limitations under the License. 14049e185fSopenharmony_ci */ 15049e185fSopenharmony_ci 16049e185fSopenharmony_ci#ifndef HISTREAMER_MEDIA_UTILS_H 17049e185fSopenharmony_ci#define HISTREAMER_MEDIA_UTILS_H 18049e185fSopenharmony_ci 19049e185fSopenharmony_ci#include "i_player_engine.h" 20049e185fSopenharmony_ci#include "common/status.h" 21049e185fSopenharmony_ci#include "meta/media_types.h" 22049e185fSopenharmony_cienum class PlayerStateId { 23049e185fSopenharmony_ci IDLE = 0, 24049e185fSopenharmony_ci INIT = 1, 25049e185fSopenharmony_ci PREPARING = 2, 26049e185fSopenharmony_ci READY = 3, 27049e185fSopenharmony_ci PAUSE = 4, 28049e185fSopenharmony_ci PLAYING = 5, 29049e185fSopenharmony_ci STOPPED = 6, 30049e185fSopenharmony_ci EOS = 7, 31049e185fSopenharmony_ci ERROR = 8, 32049e185fSopenharmony_ci}; 33049e185fSopenharmony_ci 34049e185fSopenharmony_cinamespace OHOS { 35049e185fSopenharmony_cinamespace Media { 36049e185fSopenharmony_ci std::string __attribute__((visibility("default"))) GetClientBundleName(int32_t uid, bool shouldLog = true); 37049e185fSopenharmony_ci std::string __attribute__((visibility("default"))) GetBundleResourceLabel(std::string bundleName); 38049e185fSopenharmony_ci int __attribute__((visibility("default"))) TransStatus(Status status); 39049e185fSopenharmony_ci PlayerStates __attribute__((visibility("default"))) TransStateId2PlayerState(PlayerStateId state); 40049e185fSopenharmony_ci Plugins::SeekMode __attribute__((visibility("default"))) Transform2SeekMode(PlayerSeekMode mode); 41049e185fSopenharmony_ci const std::string& __attribute__((visibility("default"))) StringnessPlayerState(PlayerStates state); 42049e185fSopenharmony_ci float __attribute__((visibility("default"))) TransformPlayRate2Float(PlaybackRateMode rateMode); 43049e185fSopenharmony_ci inline PlaybackRateMode __attribute__((visibility("default"))) TransformFloat2PlayRate(float rate); 44049e185fSopenharmony_ci double __attribute__((visibility("default"))) ChangeModeToSpeed(const PlaybackRateMode& mode); 45049e185fSopenharmony_ci bool __attribute__((visibility("default"))) IsEnableOptimizeDecode(); 46049e185fSopenharmony_ci bool __attribute__((visibility("default"))) IsAppEnableRenderFirstFrame(int32_t uid); 47049e185fSopenharmony_ci bool __attribute__((visibility("default"))) GetPackageName(const char *key, std::string &value); 48049e185fSopenharmony_ci std::unordered_map<std::string, std::string> __attribute__((visibility("default"))) GetScreenCaptureSystemParam(); 49049e185fSopenharmony_ci} // namespace Media 50049e185fSopenharmony_ci} // namespace OHOS 51049e185fSopenharmony_ci 52049e185fSopenharmony_ci#endif // HISTREAMER_MEDIA_UTILS_H