1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MEDIA_ERRORS_H_
18 
19 #define MEDIA_ERRORS_H_
20 
21 #include <utils/Errors.h>
22 
23 namespace stagefright {
24 
25 #define MEDIA_ERROR_BASE (-1000)
26 
27 #define ERROR_ALREADY_CONNECTED (MEDIA_ERROR_BASE)
28 #define ERROR_NOT_CONNECTED     (MEDIA_ERROR_BASE - 1)
29 #define ERROR_UNKNOWN_HOST      (MEDIA_ERROR_BASE - 2)
30 #define ERROR_CANNOT_CONNECT    (MEDIA_ERROR_BASE - 3)
31 #define ERROR_IO                (MEDIA_ERROR_BASE - 4)
32 #define ERROR_CONNECTION_LOST   (MEDIA_ERROR_BASE - 5)
33 #define ERROR_MALFORMED         (MEDIA_ERROR_BASE - 7)
34 #define ERROR_OUT_OF_RANGE      (MEDIA_ERROR_BASE - 8)
35 #define ERROR_BUFFER_TOO_SMALL  (MEDIA_ERROR_BASE - 9)
36 #define ERROR_UNSUPPORTED       (MEDIA_ERROR_BASE - 10)
37 #define ERROR_END_OF_STREAM     (MEDIA_ERROR_BASE - 11)
38 
39 // Not technically an error.
40 #define INFO_FORMAT_CHANGED    (MEDIA_ERROR_BASE - 12)
41 #define INFO_DISCONTINUITY     (MEDIA_ERROR_BASE - 13)
42 #define INFO_OUTPUT_BUFFERS_CHANGED (MEDIA_ERROR_BASE - 14)
43 
44 // The following constant values should be in sync with
45 // drm/drm_framework_common.h
46 #define DRM_ERROR_BASE (-2000)
47 
48 #define ERROR_DRM_UNKNOWN                       (DRM_ERROR_BASE)
49 #define ERROR_DRM_NO_LICENSE                    (DRM_ERROR_BASE - 1)
50 #define ERROR_DRM_LICENSE_EXPIRED               (DRM_ERROR_BASE - 2)
51 #define ERROR_DRM_SESSION_NOT_OPENED            (DRM_ERROR_BASE - 3)
52 #define ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED  (DRM_ERROR_BASE - 4)
53 #define ERROR_DRM_DECRYPT                       (DRM_ERROR_BASE - 5)
54 #define ERROR_DRM_CANNOT_HANDLE                 (DRM_ERROR_BASE - 6)
55 #define ERROR_DRM_TAMPER_DETECTED               (DRM_ERROR_BASE - 7)
56 #define ERROR_DRM_NOT_PROVISIONED               (DRM_ERROR_BASE - 8)
57 #define ERROR_DRM_DEVICE_REVOKED                (DRM_ERROR_BASE - 9)
58 #define ERROR_DRM_RESOURCE_BUSY                 (DRM_ERROR_BASE - 10)
59 
60 #define ERROR_DRM_VENDOR_MAX                    (DRM_ERROR_BASE - 500)
61 #define ERROR_DRM_VENDOR_MIN                    (DRM_ERROR_BASE - 999)
62 
63 // Heartbeat Error Codes
64 #define HEARTBEAT_ERROR_BASE (-3000)
65 #define ERROR_HEARTBEAT_TERMINATE_REQUESTED     (HEARTBEAT_ERROR_BASE)
66 
67 }  // namespace stagefright
68 
69 #endif  // MEDIA_ERRORS_H_
70