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 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"
22enum 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
34namespace OHOS {
35namespace Media {
36    std::string __attribute__((visibility("default"))) GetClientBundleName(int32_t uid, bool shouldLog = true);
37    std::string __attribute__((visibility("default"))) GetBundleResourceLabel(std::string bundleName);
38    int __attribute__((visibility("default"))) TransStatus(Status status);
39    PlayerStates __attribute__((visibility("default"))) TransStateId2PlayerState(PlayerStateId state);
40    Plugins::SeekMode __attribute__((visibility("default"))) Transform2SeekMode(PlayerSeekMode mode);
41    const std::string& __attribute__((visibility("default"))) StringnessPlayerState(PlayerStates state);
42    float __attribute__((visibility("default"))) TransformPlayRate2Float(PlaybackRateMode rateMode);
43    inline PlaybackRateMode __attribute__((visibility("default"))) TransformFloat2PlayRate(float rate);
44    double __attribute__((visibility("default"))) ChangeModeToSpeed(const PlaybackRateMode& mode);
45    bool __attribute__((visibility("default"))) IsEnableOptimizeDecode();
46    bool __attribute__((visibility("default"))) IsAppEnableRenderFirstFrame(int32_t uid);
47    bool __attribute__((visibility("default"))) GetPackageName(const char *key, std::string &value);
48    std::unordered_map<std::string, std::string> __attribute__((visibility("default"))) GetScreenCaptureSystemParam();
49}  // namespace Media
50}  // namespace OHOS
51
52#endif  // HISTREAMER_MEDIA_UTILS_H