• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "format.h"
21 
22 namespace OHOS {
23 namespace Media {
24 /**
25  * @brief Media type
26  *
27  * @since 3.1
28  * @version 3.1
29  */
30 enum MediaType : int32_t {
31     /**
32      * track is audio.
33      */
34     MEDIA_TYPE_AUD = 0,
35     /**
36      * track is video.
37      */
38     MEDIA_TYPE_VID = 1,
39     /**
40      * track is subtitle.
41      */
42     MEDIA_TYPE_SUBTITLE = 2,
43 };
44 
45 /**
46  * @brief
47  *
48  * @since 3.1
49  * @version 3.1
50  */
51 enum VideoPixelFormat {
52     /**
53      * yuv 420 planar.
54      */
55     YUVI420 = 1,
56     /**
57      *  NV12. yuv 420 semiplanar.
58      */
59     NV12 = 2,
60     /**
61      *  NV21. yvu 420 semiplanar.
62      */
63     NV21 = 3,
64     /**
65      * format from surface.
66      */
67     SURFACE_FORMAT = 4,
68     /**
69      * RGBA.
70      */
71     RGBA = 5,
72 };
73 
74 /**
75  * @brief Enumerates the video rotation.
76  *
77  * @since 3.2
78  * @version 3.2
79  */
80 enum VideoRotation : uint32_t {
81     /**
82     * Video without rotation
83     */
84     VIDEO_ROTATION_0 = 0,
85     /**
86     * Video rotated 90 degrees
87     */
88     VIDEO_ROTATION_90 = 90,
89     /**
90     * Video rotated 180 degrees
91     */
92     VIDEO_ROTATION_180 = 180,
93     /**
94     * Video rotated 270 degrees
95     */
96     VIDEO_ROTATION_270 = 270,
97 };
98 
99 /**
100  * @brief Enumerates the state change reason.
101  *
102  * @since 3.2
103  * @version 3.2
104  */
105 enum StateChangeReason {
106     /**
107      * audio/video state change by user
108      */
109     USER = 1,
110     /**
111      * audio/video state change by system
112      */
113     BACKGROUND = 2,
114 };
115 } // namespace Media
116 } // namespace OHOS
117 #endif // AV_COMMOM_H