1 /* 2 * Copyright (c) 2023-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 #ifndef HISTREAMER_MEDIA_UTILS_H 17 #define HISTREAMER_MEDIA_UTILS_H 18 19 #include "i_player_engine.h" 20 #include "common/status.h" 21 #include "meta/media_types.h" 22 enum class PlayerStateId { 23 IDLE = 0, 24 INIT = 1, 25 PREPARING = 2, 26 READY = 3, 27 PAUSE = 4, 28 PLAYING = 5, 29 STOPPED = 6, 30 EOS = 7, 31 ERROR = 8, 32 }; 33 34 namespace OHOS { 35 namespace Media { 36 std::string __attribute__((visibility("default"))) GetClientBundleName(int32_t uid); 37 int32_t __attribute__((visibility("default"))) GetApiInfo(int32_t uid, std::string bundleName = ""); 38 std::string __attribute__((visibility("default"))) GetBundleResourceLabel(std::string bundleName); 39 int __attribute__((visibility("default"))) TransStatus(Status status); 40 int32_t __attribute__((visibility("default"))) TransTranscoderStatus(Status status); 41 PlayerStates __attribute__((visibility("default"))) TransStateId2PlayerState(PlayerStateId state); 42 Plugins::SeekMode __attribute__((visibility("default"))) Transform2SeekMode(PlayerSeekMode mode); 43 const std::string& __attribute__((visibility("default"))) StringnessPlayerState(PlayerStates state); 44 float __attribute__((visibility("default"))) TransformPlayRate2Float(PlaybackRateMode rateMode); 45 inline PlaybackRateMode __attribute__((visibility("default"))) TransformFloat2PlayRate(float rate); 46 double __attribute__((visibility("default"))) ChangeModeToSpeed(const PlaybackRateMode& mode); 47 bool __attribute__((visibility("default"))) IsEnableOptimizeDecode(); 48 bool __attribute__((visibility("default"))) IsAppEnableRenderFirstFrame(int32_t uid); 49 bool __attribute__((visibility("default"))) GetPackageName(const char *key, std::string &value); 50 std::unordered_map<std::string, std::string>& __attribute__((visibility("default"))) GetScreenCaptureSystemParam(); 51 int32_t __attribute__((visibility("default"))) GetAPIVersion(); 52 } // namespace Media 53 } // namespace OHOS 54 55 #endif // HISTREAMER_MEDIA_UTILS_H