1 /*
2  * Copyright (C) 2021 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 #ifndef AV_COMMOM_H
16 #define AV_COMMOM_H
17 
18 #include <vector>
19 #include <string>
20 #include "meta/format.h"
21 #include "media_core.h"
22 
23 namespace OHOS {
24 namespace Media {
25 /**
26  * @brief
27  *
28  * @since 3.1
29  * @version 3.1
30  */
31 enum VideoPixelFormat {
32     /**
33      * yuv 420 planar.
34      */
35     YUVI420 = 1,
36     /**
37      *  NV12. yuv 420 semiplanar.
38      */
39     NV12 = 2,
40     /**
41      *  NV21. yvu 420 semiplanar.
42      */
43     NV21 = 3,
44     /**
45      * format from surface.
46      */
47     SURFACE_FORMAT = 4,
48     /**
49      * RGBA.
50      */
51     RGBA = 5,
52 };
53 
54 /**
55  * @brief Enumerates the video rotation.
56  *
57  * @since 3.2
58  * @version 3.2
59  */
60 enum VideoRotation : uint32_t {
61     /**
62     * Video without rotation
63     */
64     VIDEO_ROTATION_0 = 0,
65     /**
66     * Video rotated 90 degrees
67     */
68     VIDEO_ROTATION_90 = 90,
69     /**
70     * Video rotated 180 degrees
71     */
72     VIDEO_ROTATION_180 = 180,
73     /**
74     * Video rotated 270 degrees
75     */
76     VIDEO_ROTATION_270 = 270,
77 };
78 
79 class AVMimeType {
80 public:
81     static constexpr std::string_view APPLICATION_M3U8 = "application/m3u8";
82 };
83 } // namespace Media
84 } // namespace OHOS
85 #endif // AV_COMMOM_H