1 /* 2 * Copyright (C) 2023-2023 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 * Description: supply errors definition for interfaces. 15 * Author: zhangjingnan 16 * Create: 2023-4-11 17 */ 18 19 #ifndef CAST_ENGINE_ERRORS_H 20 #define CAST_ENGINE_ERRORS_H 21 22 #include <cinttypes> 23 #include "errors.h" 24 #include "cast_engine_common.h" 25 26 namespace OHOS { 27 namespace CastEngine { 28 constexpr int32_t EXPORT CAST_ENGINE_ERROR = -1; 29 constexpr int32_t EXPORT CAST_ENGINE_SUCCESS = 0; 30 constexpr int32_t EXPORT CAST_ENGINE_ERROR_BASE = 1000; 31 constexpr int32_t EXPORT ERR_NO_MEMORY = -(CAST_ENGINE_ERROR_BASE + 1); 32 constexpr int32_t EXPORT ERR_INVALID_PARAM = -(CAST_ENGINE_ERROR_BASE + 2); 33 constexpr int32_t EXPORT ERR_NO_PERMISSION = -(CAST_ENGINE_ERROR_BASE + 3); 34 constexpr int32_t EXPORT ERR_SESSION_NOT_EXIST = -(CAST_ENGINE_ERROR_BASE + 4); 35 constexpr int32_t EXPORT ERR_SERVICE_STATE_NOT_MATCH = -(CAST_ENGINE_ERROR_BASE + 5); 36 constexpr int32_t EXPORT ERR_SESSION_STATE_NOT_MATCH = -(CAST_ENGINE_ERROR_BASE + 6); 37 constexpr int32_t EXPORT ERR_SERVICE_IS_UNLOADING = -(CAST_ENGINE_ERROR_BASE + 7); 38 39 constexpr int32_t EXPORT ERROR_CODE_OK = 0; 40 41 // Generic error 42 constexpr int32_t EXPORT ERROR_CODE_UNSPECIFIED = 1000; 43 constexpr int32_t EXPORT ERROR_CODE_REMOTE_ERROR = 1001; 44 constexpr int32_t EXPORT ERROR_CODE_BEHIND_LIVE_WINDOW = 1002; 45 constexpr int32_t EXPORT ERROR_CODE_TIMEOUT = 1003; 46 constexpr int32_t EXPORT ERROR_CODE_FAILED_RUNTIME_CHECK = 1004; 47 48 constexpr int32_t EXPORT ERROR_CODE_PLAYER_ERROR = 1100; 49 constexpr int32_t EXPORT ERROR_CODE_SEEK_MODE_UNSUPPORTED = 1101; 50 constexpr int32_t EXPORT ERROR_CODE_ILLEGAL_SEEK_TARGET = 1102; 51 constexpr int32_t EXPORT ERROR_CODE_PLAY_MODE_UNSUPPORTED = 1103; 52 constexpr int32_t EXPORT ERROR_CODE_PLAY_SPEED_UNSUPPORTED = 1104; 53 constexpr int32_t EXPORT ERROR_CODE_DEVICE_MISSED = 1105; 54 constexpr int32_t EXPORT ERROR_CODE_INVALID_PARAM = 1106; 55 constexpr int32_t EXPORT ERROR_CODE_NO_MEMORY = 1107; 56 constexpr int32_t EXPORT ERROR_OPERATION_NOT_ALLOWED = 1108; 57 58 // Input/Output errors 59 constexpr int32_t EXPORT ERROR_CODE_IO_UNSPECIFIED = 2000; 60 constexpr int32_t EXPORT ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 2001; 61 constexpr int32_t EXPORT ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 2002; 62 constexpr int32_t EXPORT ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE = 2003; 63 constexpr int32_t EXPORT ERROR_CODE_IO_BAD_HTTP_STATUS = 2004; 64 constexpr int32_t EXPORT ERROR_CODE_IO_FILE_NOT_FOUND = 2005; 65 constexpr int32_t EXPORT ERROR_CODE_IO_NO_PERMISSION = 2006; 66 constexpr int32_t EXPORT ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007; 67 constexpr int32_t EXPORT ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 2008; 68 69 constexpr int32_t EXPORT ERROR_CODE_IO_NO_CONTENTS = 2100; 70 constexpr int32_t EXPORT ERROR_CODE_IO_READ_ERROR = 2101; 71 constexpr int32_t EXPORT ERROR_CODE_IO_CONTENT_BUSY = 2102; 72 constexpr int32_t EXPORT ERROR_CODE_IO_CONTENT_EXPIRED = 2103; 73 constexpr int32_t EXPORT ERROR_CODE_IO_CONTENT_NON_ALLOWED_USE = 2104; 74 constexpr int32_t EXPORT ERROR_CODE_IO_CONTENT_CANNOT_VERIFIED = 2105; 75 constexpr int32_t EXPORT ERROR_CODE_IO_CONTENT_EXHAUSTED_ALLOWED_USES = 2106; 76 constexpr int32_t EXPORT ERROR_CODE_IO_NETWORK_PACKET_SENDING_FAILURE = 2107; 77 78 // Content parsing errors 79 constexpr int32_t EXPORT ERROR_CODE_PARSING_UNSPECIFIED = 3000; 80 constexpr int32_t EXPORT ERROR_CODE_PARSING_CONTAINER_MALFORMED = 3001; 81 constexpr int32_t EXPORT ERROR_CODE_PARSING_MANIFEST_MALFORMED = 3002; 82 constexpr int32_t EXPORT ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED = 3003; 83 constexpr int32_t EXPORT ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED = 3004; 84 85 // Decoding errors 86 constexpr int32_t EXPORT ERROR_CODE_DECODE_UNSPECIFIED = 4000; 87 constexpr int32_t EXPORT ERROR_CODE_DECODER_INIT_FAILED = 4001; 88 constexpr int32_t EXPORT ERROR_CODE_DECODER_QUERY_FAILED = 4002; 89 constexpr int32_t EXPORT ERROR_CODE_DECODING_FAILED = 4003; 90 constexpr int32_t EXPORT ERROR_CODE_DECODING_FORMAT_EXCEEDS_CAPABILITIES = 4004; 91 constexpr int32_t EXPORT ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 4005; 92 93 // AudioTrack errors 94 constexpr int32_t EXPORT ERROR_CODE_AUDIO_TRACK_UNSPECIFIED = 5000; 95 constexpr int32_t EXPORT ERROR_CODE_AUDIO_TRACK_INIT_FAILED = 5001; 96 constexpr int32_t EXPORT ERROR_CODE_AUDIO_TRACK_WRITE_FAILED = 5002; 97 98 // DRM errors 99 constexpr int32_t EXPORT ERROR_CODE_DRM_UNSPECIFIED = 6000; 100 constexpr int32_t EXPORT ERROR_CODE_DRM_SCHEME_UNSUPPORTED = 6001; 101 constexpr int32_t EXPORT ERROR_CODE_DRM_PROVISIONING_FAILED = 6002; 102 constexpr int32_t EXPORT ERROR_CODE_DRM_CONTENT_ERROR = 6003; 103 constexpr int32_t EXPORT ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED = 6004; 104 constexpr int32_t EXPORT ERROR_CODE_DRM_DISALLOWED_OPERATION = 6005; 105 constexpr int32_t EXPORT ERROR_CODE_DRM_SYSTEM_ERROR = 6006; 106 constexpr int32_t EXPORT ERROR_CODE_DRM_DEVICE_REVOKED = 6007; 107 constexpr int32_t EXPORT ERROR_CODE_DRM_LICENSE_EXPIRED = 6008; 108 109 constexpr int32_t EXPORT ERROR_CODE_DRM_PROVIDE_KEY_RESPONSE_ERROR = 6100; 110 } // namespace CastEngine 111 } // namespace OHOS 112 113 #endif // CAST_ENGINE_ERRORS_H