1 /*
2  * Copyright (c) 2024-2024 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 DASH_TIME_UTILS_H
17 #define DASH_TIME_UTILS_H
18 
19 #include <cstdint>
20 
21 namespace OHOS {
22 namespace Media {
23 namespace Plugins {
24 namespace HttpPlugin {
25 
26 constexpr int64_t D_2_H = 24;
27 constexpr int64_t H_2_M = 60;
28 constexpr int64_t M_2_S = 60;
29 
30 constexpr int64_t S_2_MS = 1000;
31 constexpr int64_t MS_2_US = 1000;
32 constexpr int64_t US_2_NS = 1000;
33 
34 constexpr int64_t H_2_S = H_2_M * M_2_S;
35 constexpr int64_t D_2_S = D_2_H * H_2_S;
36 
37 constexpr int64_t M_2_MS = M_2_S * S_2_MS;
38 constexpr int64_t H_2_MS = H_2_M * M_2_MS;
39 constexpr int64_t D_2_MS = D_2_H * H_2_MS;
40 
41 constexpr int64_t S_2_US = S_2_MS * MS_2_US;
42 constexpr int64_t MS_2_NS = MS_2_US * US_2_NS;
43 constexpr int64_t S_2_NS = S_2_MS * MS_2_NS;
44 
45 constexpr int64_t MEDIA_PTS_UNSET = INT64_MIN + 1;
46 } // namespace HttpPluginLite
47 } // namespace Plugin
48 } // namespace Media
49 } // namespace OHOS
50 
51 #endif // DASH_TIME_UTILS_H
52