1 /*
2  * Copyright (c) 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 MONITOR_ERRORS_H
17 #define MONITOR_ERRORS_H
18 
19 #include <cstdint>
20 
21 namespace OHOS {
22 namespace Media {
23 namespace MediaMonitor {
24 
25 enum MediaMonitorErr : int32_t {
26     /** Success */
27     SUCCESS = 0,
28     /** Fail */
29     ERROR = -1,
30     /** Status error */
31     ERR_ILLEGAL_STATE = -2,
32     /** Invalid parameter */
33     ERR_INVALID_PARAM = -3,
34     /** Early media preparation */
35     ERR_EARLY_PREPARE = -4,
36     /** Invalid operation */
37     ERR_INVALID_OPERATION = -5,
38     /** error operation failed */
39     ERR_OPERATION_FAILED = -6,
40     /** Buffer reading failed */
41     ERR_READ_BUFFER = -7,
42     /** Buffer writing failed */
43     ERR_WRITE_BUFFER = -8,
44     /**  Device not started */
45     ERR_NOT_STARTED = -9,
46     /**  Invalid Device handle */
47     ERR_INVALID_HANDLE = -10,
48     /**  unsupported operation */
49     ERR_NOT_SUPPORTED = -11,
50     /**  unsupported device */
51     ERR_DEVICE_NOT_SUPPORTED = -12,
52     /**  write operation failed */
53     ERR_WRITE_FAILED = -13,
54     /**  read operation failed */
55     ERR_READ_FAILED = -14,
56     /**  device init failed */
57     ERR_DEVICE_INIT = -15,
58     /** Invalid data size that has been read */
59     ERR_INVALID_READ = -16,
60     /** Invalid data size that has been written */
61     ERR_INVALID_WRITE = -17,
62     /** set invalid index < 0 */
63     ERR_INVALID_INDEX = -18,
64     /** focus request denied */
65     ERR_FOCUS_DENIED = -19,
66     /** incorrect render/capture mode */
67     ERR_INCORRECT_MODE = -20,
68     /** permission denied */
69     ERR_PERMISSION_DENIED = -21,
70     /** Memory alloc failed */
71     ERR_MEMORY_ALLOC_FAILED = -22,
72     /** microphone is disabled by EDM */
73     ERR_MICROPHONE_DISABLED_BY_EDM = -23,
74     /** system permission denied */
75     ERR_SYSTEM_PERMISSION_DENIED = -24,
76     /** Unknown error */
77     BASE_MONITOR_ERR_OFFSET = -200,
78 };
79 
80 } // namespace MediaMonitor
81 } // namespace Media
82 } // namespace OHOS
83 #endif  // MONITOR_ERRORS_H
84