2017-03-25 09:21:39 +00:00
|
|
|
/**
|
|
|
|
* The MIT License (MIT)
|
|
|
|
*
|
2018-01-07 02:58:53 +00:00
|
|
|
* Copyright (c) 2013-2018 Winlin
|
2017-03-25 09:21:39 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
* this software and associated documentation files (the "Software"), to deal in
|
|
|
|
* the Software without restriction, including without limitation the rights to
|
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
* subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
2013-11-23 03:36:07 +00:00
|
|
|
|
2014-03-01 02:30:16 +00:00
|
|
|
#ifndef SRS_KERNEL_ERROR_HPP
|
|
|
|
#define SRS_KERNEL_ERROR_HPP
|
2013-11-23 03:36:07 +00:00
|
|
|
|
|
|
|
#include <srs_core.hpp>
|
|
|
|
|
2017-06-09 03:50:35 +00:00
|
|
|
#include <string>
|
|
|
|
|
2015-11-11 02:37:50 +00:00
|
|
|
// for srs-librtmp, @see https://github.com/ossrs/srs/issues/213
|
2014-11-27 07:22:39 +00:00
|
|
|
#ifndef _WIN32
|
2014-03-21 07:45:34 +00:00
|
|
|
#define ERROR_SUCCESS 0
|
2014-11-27 06:46:05 +00:00
|
|
|
#endif
|
2014-03-21 07:45:34 +00:00
|
|
|
|
2014-07-20 09:32:34 +00:00
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
// system error.
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
#define ERROR_SOCKET_CREATE 1000
|
|
|
|
#define ERROR_SOCKET_SETREUSE 1001
|
|
|
|
#define ERROR_SOCKET_BIND 1002
|
|
|
|
#define ERROR_SOCKET_LISTEN 1003
|
|
|
|
#define ERROR_SOCKET_CLOSED 1004
|
|
|
|
#define ERROR_SOCKET_GET_PEER_NAME 1005
|
|
|
|
#define ERROR_SOCKET_GET_PEER_IP 1006
|
|
|
|
#define ERROR_SOCKET_READ 1007
|
|
|
|
#define ERROR_SOCKET_READ_FULLY 1008
|
|
|
|
#define ERROR_SOCKET_WRITE 1009
|
|
|
|
#define ERROR_SOCKET_WAIT 1010
|
|
|
|
#define ERROR_SOCKET_TIMEOUT 1011
|
|
|
|
#define ERROR_SOCKET_CONNECT 1012
|
|
|
|
#define ERROR_ST_SET_EPOLL 1013
|
|
|
|
#define ERROR_ST_INITIALIZE 1014
|
|
|
|
#define ERROR_ST_OPEN_SOCKET 1015
|
|
|
|
#define ERROR_ST_CREATE_LISTEN_THREAD 1016
|
|
|
|
#define ERROR_ST_CREATE_CYCLE_THREAD 1017
|
|
|
|
#define ERROR_ST_CONNECT 1018
|
|
|
|
#define ERROR_SYSTEM_PACKET_INVALID 1019
|
|
|
|
#define ERROR_SYSTEM_CLIENT_INVALID 1020
|
|
|
|
#define ERROR_SYSTEM_ASSERT_FAILED 1021
|
2014-12-04 14:10:05 +00:00
|
|
|
#define ERROR_READER_BUFFER_OVERFLOW 1022
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_SYSTEM_CONFIG_INVALID 1023
|
|
|
|
#define ERROR_SYSTEM_CONFIG_DIRECTIVE 1024
|
|
|
|
#define ERROR_SYSTEM_CONFIG_BLOCK_START 1025
|
|
|
|
#define ERROR_SYSTEM_CONFIG_BLOCK_END 1026
|
|
|
|
#define ERROR_SYSTEM_CONFIG_EOF 1027
|
|
|
|
#define ERROR_SYSTEM_STREAM_BUSY 1028
|
|
|
|
#define ERROR_SYSTEM_IP_INVALID 1029
|
|
|
|
#define ERROR_SYSTEM_FORWARD_LOOP 1030
|
|
|
|
#define ERROR_SYSTEM_WAITPID 1031
|
|
|
|
#define ERROR_SYSTEM_BANDWIDTH_KEY 1032
|
|
|
|
#define ERROR_SYSTEM_BANDWIDTH_DENIED 1033
|
|
|
|
#define ERROR_SYSTEM_PID_ACQUIRE 1034
|
|
|
|
#define ERROR_SYSTEM_PID_ALREADY_RUNNING 1035
|
|
|
|
#define ERROR_SYSTEM_PID_LOCK 1036
|
|
|
|
#define ERROR_SYSTEM_PID_TRUNCATE_FILE 1037
|
|
|
|
#define ERROR_SYSTEM_PID_WRITE_FILE 1038
|
|
|
|
#define ERROR_SYSTEM_PID_GET_FILE_INFO 1039
|
|
|
|
#define ERROR_SYSTEM_PID_SET_FILE_INFO 1040
|
|
|
|
#define ERROR_SYSTEM_FILE_ALREADY_OPENED 1041
|
|
|
|
#define ERROR_SYSTEM_FILE_OPENE 1042
|
|
|
|
#define ERROR_SYSTEM_FILE_CLOSE 1043
|
|
|
|
#define ERROR_SYSTEM_FILE_READ 1044
|
|
|
|
#define ERROR_SYSTEM_FILE_WRITE 1045
|
|
|
|
#define ERROR_SYSTEM_FILE_EOF 1046
|
|
|
|
#define ERROR_SYSTEM_FILE_RENAME 1047
|
|
|
|
#define ERROR_SYSTEM_CREATE_PIPE 1048
|
|
|
|
#define ERROR_SYSTEM_FILE_SEEK 1049
|
|
|
|
#define ERROR_SYSTEM_IO_INVALID 1050
|
2014-08-27 05:31:39 +00:00
|
|
|
#define ERROR_ST_EXCEED_THREADS 1051
|
2015-01-02 08:02:13 +00:00
|
|
|
#define ERROR_SYSTEM_SECURITY 1052
|
|
|
|
#define ERROR_SYSTEM_SECURITY_DENY 1053
|
|
|
|
#define ERROR_SYSTEM_SECURITY_ALLOW 1054
|
2015-01-03 04:54:54 +00:00
|
|
|
#define ERROR_SYSTEM_TIME 1055
|
|
|
|
#define ERROR_SYSTEM_DIR_EXISTS 1056
|
|
|
|
#define ERROR_SYSTEM_CREATE_DIR 1057
|
2015-05-30 01:32:03 +00:00
|
|
|
#define ERROR_SYSTEM_KILL 1058
|
2015-08-26 13:49:05 +00:00
|
|
|
#define ERROR_SYSTEM_CONFIG_PERSISTENCE 1059
|
2015-08-27 10:11:50 +00:00
|
|
|
#define ERROR_SYSTEM_CONFIG_RAW 1060
|
|
|
|
#define ERROR_SYSTEM_CONFIG_RAW_DISABLED 1061
|
2015-09-01 04:27:53 +00:00
|
|
|
#define ERROR_SYSTEM_CONFIG_RAW_NOT_ALLOWED 1062
|
|
|
|
#define ERROR_SYSTEM_CONFIG_RAW_PARAMS 1063
|
2015-12-29 10:33:02 +00:00
|
|
|
#define ERROR_SYSTEM_FILE_NOT_EXISTS 1064
|
2016-01-08 05:58:19 +00:00
|
|
|
#define ERROR_SYSTEM_HOURGLASS_RESOLUTION 1065
|
2017-01-18 08:05:33 +00:00
|
|
|
#define ERROR_SYSTEM_DNS_RESOLVE 1066
|
2017-03-18 13:29:08 +00:00
|
|
|
#define ERROR_SYSTEM_FRAGMENT_UNLINK 1067
|
|
|
|
#define ERROR_SYSTEM_FRAGMENT_RENAME 1068
|
2017-05-29 09:19:06 +00:00
|
|
|
#define ERROR_THREAD_DISPOSED 1069
|
|
|
|
#define ERROR_THREAD_INTERRUPED 1070
|
|
|
|
#define ERROR_THREAD_TERMINATED 1071
|
2017-06-04 11:13:56 +00:00
|
|
|
#define ERROR_THREAD_DUMMY 1072
|
2017-06-10 07:20:48 +00:00
|
|
|
#define ERROR_ASPROCESS_PPID 1073
|
2017-07-18 12:24:07 +00:00
|
|
|
#define ERROR_EXCEED_CONNECTIONS 1074
|
2018-01-07 09:23:36 +00:00
|
|
|
#define ERROR_SOCKET_SETKEEPALIVE 1075
|
2018-08-05 12:30:04 +00:00
|
|
|
#define ERROR_SOCKET_NO_NODELAY 1076
|
|
|
|
#define ERROR_SOCKET_SNDBUF 1077
|
2014-07-20 09:32:34 +00:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
// RTMP protocol error.
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
#define ERROR_RTMP_PLAIN_REQUIRED 2000
|
|
|
|
#define ERROR_RTMP_CHUNK_START 2001
|
2015-10-20 02:17:48 +00:00
|
|
|
#define ERROR_RTMP_MSG_INVALID_SIZE 2002
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_RTMP_AMF0_DECODE 2003
|
|
|
|
#define ERROR_RTMP_AMF0_INVALID 2004
|
|
|
|
#define ERROR_RTMP_REQ_CONNECT 2005
|
|
|
|
#define ERROR_RTMP_REQ_TCURL 2006
|
|
|
|
#define ERROR_RTMP_MESSAGE_DECODE 2007
|
|
|
|
#define ERROR_RTMP_MESSAGE_ENCODE 2008
|
|
|
|
#define ERROR_RTMP_AMF0_ENCODE 2009
|
|
|
|
#define ERROR_RTMP_CHUNK_SIZE 2010
|
|
|
|
#define ERROR_RTMP_TRY_SIMPLE_HS 2011
|
|
|
|
#define ERROR_RTMP_CH_SCHEMA 2012
|
|
|
|
#define ERROR_RTMP_PACKET_SIZE 2013
|
|
|
|
#define ERROR_RTMP_VHOST_NOT_FOUND 2014
|
|
|
|
#define ERROR_RTMP_ACCESS_DENIED 2015
|
|
|
|
#define ERROR_RTMP_HANDSHAKE 2016
|
|
|
|
#define ERROR_RTMP_NO_REQUEST 2017
|
|
|
|
#define ERROR_RTMP_HS_SSL_REQUIRE 2018
|
|
|
|
#define ERROR_RTMP_DURATION_EXCEED 2019
|
|
|
|
#define ERROR_RTMP_EDGE_PLAY_STATE 2020
|
|
|
|
#define ERROR_RTMP_EDGE_PUBLISH_STATE 2021
|
|
|
|
#define ERROR_RTMP_EDGE_PROXY_PULL 2022
|
|
|
|
#define ERROR_RTMP_EDGE_RELOAD 2023
|
|
|
|
#define ERROR_RTMP_AGGREGATE 2024
|
|
|
|
#define ERROR_RTMP_BWTC_DATA 2025
|
|
|
|
#define ERROR_OpenSslCreateDH 2026
|
|
|
|
#define ERROR_OpenSslCreateP 2027
|
|
|
|
#define ERROR_OpenSslCreateG 2028
|
|
|
|
#define ERROR_OpenSslParseP1024 2029
|
|
|
|
#define ERROR_OpenSslSetG 2030
|
|
|
|
#define ERROR_OpenSslGenerateDHKeys 2031
|
2014-08-08 01:54:33 +00:00
|
|
|
#define ERROR_OpenSslCopyKey 2032
|
|
|
|
#define ERROR_OpenSslSha256Update 2033
|
|
|
|
#define ERROR_OpenSslSha256Init 2034
|
|
|
|
#define ERROR_OpenSslSha256Final 2035
|
|
|
|
#define ERROR_OpenSslSha256EvpDigest 2036
|
|
|
|
#define ERROR_OpenSslSha256DigestSize 2037
|
2014-08-08 03:34:17 +00:00
|
|
|
#define ERROR_OpenSslGetPeerPublicKey 2038
|
|
|
|
#define ERROR_OpenSslComputeSharedKey 2039
|
2014-12-06 12:10:05 +00:00
|
|
|
#define ERROR_RTMP_MIC_CHUNKSIZE_CHANGED 2040
|
2014-12-06 14:50:51 +00:00
|
|
|
#define ERROR_RTMP_MIC_CACHE_OVERFLOW 2041
|
2015-02-16 14:15:59 +00:00
|
|
|
#define ERROR_RTSP_TOKEN_NOT_NORMAL 2042
|
|
|
|
#define ERROR_RTSP_REQUEST_HEADER_EOF 2043
|
2015-02-18 03:49:42 +00:00
|
|
|
#define ERROR_RTP_HEADER_CORRUPT 2044
|
2015-02-18 05:37:08 +00:00
|
|
|
#define ERROR_RTP_TYPE96_CORRUPT 2045
|
|
|
|
#define ERROR_RTP_TYPE97_CORRUPT 2046
|
2015-02-18 14:28:39 +00:00
|
|
|
#define ERROR_RTSP_AUDIO_CONFIG 2047
|
2015-08-11 07:23:46 +00:00
|
|
|
#define ERROR_RTMP_STREAM_NOT_FOUND 2048
|
2015-08-28 10:00:24 +00:00
|
|
|
#define ERROR_RTMP_CLIENT_NOT_FOUND 2049
|
2017-02-25 04:06:39 +00:00
|
|
|
#define ERROR_OpenSslCreateHMAC 2050
|
2017-04-09 10:52:21 +00:00
|
|
|
#define ERROR_RTMP_STREAM_NAME_EMPTY 2051
|
2017-07-29 13:39:57 +00:00
|
|
|
#define ERROR_HTTP_HIJACK 2052
|
2014-07-20 09:32:34 +00:00
|
|
|
//
|
2017-03-25 09:21:39 +00:00
|
|
|
// system control message,
|
2014-01-11 11:55:55 +00:00
|
|
|
// not an error, but special control logic.
|
2016-01-08 10:17:37 +00:00
|
|
|
//
|
|
|
|
// connection is redirect to another server.
|
|
|
|
#define ERROR_CONTROL_REDIRECT 2997
|
2014-01-11 11:55:55 +00:00
|
|
|
// sys ctl: rtmp close stream, support replay.
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_CONTROL_RTMP_CLOSE 2998
|
2014-03-05 02:21:31 +00:00
|
|
|
// FMLE stop publish and republish.
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_CONTROL_REPUBLISH 2999
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
// application level
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
#define ERROR_HLS_METADATA 3000
|
|
|
|
#define ERROR_HLS_DECODE_ERROR 3001
|
2015-01-03 04:54:54 +00:00
|
|
|
//#define ERROR_HLS_CREATE_DIR 3002
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_HLS_OPEN_FAILED 3003
|
|
|
|
#define ERROR_HLS_WRITE_FAILED 3004
|
|
|
|
#define ERROR_HLS_AAC_FRAME_LENGTH 3005
|
|
|
|
#define ERROR_HLS_AVC_SAMPLE_SIZE 3006
|
|
|
|
#define ERROR_HTTP_PARSE_URI 3007
|
2015-10-20 02:17:48 +00:00
|
|
|
#define ERROR_HTTP_DATA_INVALID 3008
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_HTTP_PARSE_HEADER 3009
|
|
|
|
#define ERROR_HTTP_HANDLER_MATCH_URL 3010
|
|
|
|
#define ERROR_HTTP_HANDLER_INVALID 3011
|
|
|
|
#define ERROR_HTTP_API_LOGS 3012
|
2015-01-22 01:34:33 +00:00
|
|
|
#define ERROR_HTTP_REMUX_SEQUENCE_HEADER 3013
|
|
|
|
#define ERROR_HTTP_REMUX_OFFSET_OVERFLOW 3014
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_ENCODER_VCODEC 3015
|
|
|
|
#define ERROR_ENCODER_OUTPUT 3016
|
|
|
|
#define ERROR_ENCODER_ACHANNELS 3017
|
|
|
|
#define ERROR_ENCODER_ASAMPLE_RATE 3018
|
|
|
|
#define ERROR_ENCODER_ABITRATE 3019
|
|
|
|
#define ERROR_ENCODER_ACODEC 3020
|
|
|
|
#define ERROR_ENCODER_VPRESET 3021
|
|
|
|
#define ERROR_ENCODER_VPROFILE 3022
|
|
|
|
#define ERROR_ENCODER_VTHREADS 3023
|
|
|
|
#define ERROR_ENCODER_VHEIGHT 3024
|
|
|
|
#define ERROR_ENCODER_VWIDTH 3025
|
|
|
|
#define ERROR_ENCODER_VFPS 3026
|
|
|
|
#define ERROR_ENCODER_VBITRATE 3027
|
|
|
|
#define ERROR_ENCODER_FORK 3028
|
|
|
|
#define ERROR_ENCODER_LOOP 3029
|
2016-01-20 06:05:48 +00:00
|
|
|
#define ERROR_FORK_OPEN_LOG 3030
|
|
|
|
#define ERROR_FORK_DUP2_LOG 3031
|
2014-07-20 09:32:34 +00:00
|
|
|
#define ERROR_ENCODER_PARSE 3032
|
|
|
|
#define ERROR_ENCODER_NO_INPUT 3033
|
|
|
|
#define ERROR_ENCODER_NO_OUTPUT 3034
|
|
|
|
#define ERROR_ENCODER_INPUT_TYPE 3035
|
|
|
|
#define ERROR_KERNEL_FLV_HEADER 3036
|
|
|
|
#define ERROR_KERNEL_FLV_STREAM_CLOSED 3037
|
|
|
|
#define ERROR_KERNEL_STREAM_INIT 3038
|
2014-08-03 13:50:48 +00:00
|
|
|
#define ERROR_EDGE_VHOST_REMOVED 3039
|
2014-10-19 11:42:27 +00:00
|
|
|
#define ERROR_HLS_AVC_TRY_OTHERS 3040
|
2014-11-08 02:44:00 +00:00
|
|
|
#define ERROR_H264_API_NO_PREFIXED 3041
|
2014-11-15 05:20:58 +00:00
|
|
|
#define ERROR_FLV_INVALID_VIDEO_TAG 3042
|
2014-11-15 08:30:37 +00:00
|
|
|
#define ERROR_H264_DROP_BEFORE_SPS_PPS 3043
|
2014-11-15 08:53:24 +00:00
|
|
|
#define ERROR_H264_DUPLICATED_SPS 3044
|
|
|
|
#define ERROR_H264_DUPLICATED_PPS 3045
|
2014-11-24 08:28:52 +00:00
|
|
|
#define ERROR_AAC_REQUIRED_ADTS 3046
|
|
|
|
#define ERROR_AAC_ADTS_HEADER 3047
|
|
|
|
#define ERROR_AAC_DATA_INVALID 3048
|
2015-01-25 08:42:22 +00:00
|
|
|
#define ERROR_HLS_TRY_MP3 3049
|
2015-02-21 13:17:59 +00:00
|
|
|
#define ERROR_HTTP_DVR_DISABLED 3050
|
|
|
|
#define ERROR_HTTP_DVR_REQUEST 3051
|
2015-02-21 15:09:21 +00:00
|
|
|
#define ERROR_HTTP_JSON_REQUIRED 3052
|
|
|
|
#define ERROR_HTTP_DVR_CREATE_REQUEST 3053
|
2015-02-25 01:20:11 +00:00
|
|
|
#define ERROR_HTTP_DVR_NO_TAEGET 3054
|
2015-03-08 09:33:52 +00:00
|
|
|
#define ERROR_ADTS_ID_NOT_AAC 3055
|
2015-03-11 06:18:09 +00:00
|
|
|
#define ERROR_HDS_OPEN_F4M_FAILED 3056
|
|
|
|
#define ERROR_HDS_WRITE_F4M_FAILED 3057
|
|
|
|
#define ERROR_HDS_OPEN_BOOTSTRAP_FAILED 3058
|
|
|
|
#define ERROR_HDS_WRITE_BOOTSTRAP_FAILED 3059
|
|
|
|
#define ERROR_HDS_OPEN_FRAGMENT_FAILED 3060
|
|
|
|
#define ERROR_HDS_WRITE_FRAGMENT_FAILED 3061
|
2015-05-29 13:43:17 +00:00
|
|
|
#define ERROR_HLS_NO_STREAM 3062
|
2015-06-08 09:28:39 +00:00
|
|
|
#define ERROR_JSON_LOADS 3063
|
|
|
|
#define ERROR_RESPONSE_CODE 3064
|
2015-08-11 07:23:46 +00:00
|
|
|
#define ERROR_RESPONSE_DATA 3065
|
|
|
|
#define ERROR_REQUEST_DATA 3066
|
2015-12-29 10:33:02 +00:00
|
|
|
#define ERROR_EDGE_PORT_INVALID 3067
|
2017-01-30 12:12:36 +00:00
|
|
|
#define ERROR_EXPECT_FILE_IO 3068
|
2017-02-01 13:57:32 +00:00
|
|
|
#define ERROR_MP4_BOX_OVERFLOW 3069
|
|
|
|
#define ERROR_MP4_BOX_REQUIRE_SPACE 3070
|
|
|
|
#define ERROR_MP4_BOX_ILLEGAL_TYPE 3071
|
|
|
|
#define ERROR_MP4_BOX_ILLEGAL_SCHEMA 3072
|
|
|
|
#define ERROR_MP4_BOX_STRING 3073
|
2017-02-02 07:10:11 +00:00
|
|
|
#define ERROR_MP4_BOX_ILLEGAL_BRAND 3074
|
2017-02-03 14:49:19 +00:00
|
|
|
#define ERROR_MP4_ESDS_SL_Config 3075
|
|
|
|
#define ERROR_MP4_ILLEGAL_MOOV 3076
|
2017-02-04 06:57:07 +00:00
|
|
|
#define ERROR_MP4_ILLEGAL_HANDLER 3077
|
2017-02-04 14:25:03 +00:00
|
|
|
#define ERROR_MP4_ILLEGAL_TRACK 3078
|
|
|
|
#define ERROR_MP4_MOOV_OVERFLOW 3079
|
|
|
|
#define ERROR_MP4_ILLEGAL_SAMPLES 3080
|
|
|
|
#define ERROR_MP4_ILLEGAL_TIMESTAMP 3081
|
2017-02-06 10:33:26 +00:00
|
|
|
#define ERROR_DVR_CANNOT_APPEND 3082
|
|
|
|
#define ERROR_DVR_ILLEGAL_PLAN 3083
|
2017-02-07 13:56:20 +00:00
|
|
|
#define ERROR_FLV_REQUIRE_SPACE 3084
|
|
|
|
#define ERROR_MP4_AVCC_CHANGE 3085
|
|
|
|
#define ERROR_MP4_ASC_CHANGE 3086
|
2017-02-26 13:45:08 +00:00
|
|
|
#define ERROR_DASH_WRITE_FAILED 3087
|
2017-04-09 10:52:21 +00:00
|
|
|
#define ERROR_TS_CONTEXT_NOT_READY 3088
|
2017-06-04 07:10:35 +00:00
|
|
|
#define ERROR_MP4_ILLEGAL_MOOF 3089
|
2018-02-16 08:39:07 +00:00
|
|
|
#define ERROR_OCLUSTER_DISCOVER 3090
|
|
|
|
#define ERROR_OCLUSTER_REDIRECT 3091
|
2014-01-11 11:55:55 +00:00
|
|
|
|
2015-01-17 13:58:23 +00:00
|
|
|
///////////////////////////////////////////////////////
|
2015-10-16 09:18:16 +00:00
|
|
|
// HTTP/StreamCaster/KAFKA protocol error.
|
2015-01-17 13:58:23 +00:00
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
#define ERROR_HTTP_PATTERN_EMPTY 4000
|
|
|
|
#define ERROR_HTTP_PATTERN_DUPLICATED 4001
|
|
|
|
#define ERROR_HTTP_URL_NOT_CLEAN 4002
|
|
|
|
#define ERROR_HTTP_CONTENT_LENGTH 4003
|
2015-01-18 14:51:07 +00:00
|
|
|
#define ERROR_HTTP_LIVE_STREAM_EXT 4004
|
2015-10-20 02:17:48 +00:00
|
|
|
#define ERROR_HTTP_STATUS_INVALID 4005
|
2015-01-19 01:25:07 +00:00
|
|
|
#define ERROR_KERNEL_AAC_STREAM_CLOSED 4006
|
|
|
|
#define ERROR_AAC_DECODE_ERROR 4007
|
|
|
|
#define ERROR_KERNEL_MP3_STREAM_CLOSED 4008
|
|
|
|
#define ERROR_MP3_DECODE_ERROR 4009
|
2015-01-24 06:52:52 +00:00
|
|
|
#define ERROR_STREAM_CASTER_ENGINE 4010
|
|
|
|
#define ERROR_STREAM_CASTER_PORT 4011
|
2015-01-27 06:28:59 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_HEADER 4012
|
|
|
|
#define ERROR_STREAM_CASTER_TS_SYNC_BYTE 4013
|
|
|
|
#define ERROR_STREAM_CASTER_TS_AF 4014
|
2015-01-27 09:04:30 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_CRC32 4015
|
2015-01-27 10:35:43 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_PSI 4016
|
|
|
|
#define ERROR_STREAM_CASTER_TS_PAT 4017
|
|
|
|
#define ERROR_STREAM_CASTER_TS_PMT 4018
|
2015-01-29 14:58:02 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_PSE 4019
|
2015-01-31 04:21:04 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_ES 4020
|
2015-01-31 11:46:55 +00:00
|
|
|
#define ERROR_STREAM_CASTER_TS_CODEC 4021
|
|
|
|
#define ERROR_STREAM_CASTER_AVC_SPS 4022
|
|
|
|
#define ERROR_STREAM_CASTER_AVC_PPS 4023
|
|
|
|
#define ERROR_STREAM_CASTER_FLV_TAG 4024
|
2015-03-06 03:36:26 +00:00
|
|
|
#define ERROR_HTTP_RESPONSE_EOF 4025
|
|
|
|
#define ERROR_HTTP_INVALID_CHUNK_HEADER 4026
|
2015-04-03 15:17:50 +00:00
|
|
|
#define ERROR_AVC_NALU_UEV 4027
|
2015-04-21 04:53:45 +00:00
|
|
|
#define ERROR_AAC_BYTES_INVALID 4028
|
2015-05-22 03:20:25 +00:00
|
|
|
#define ERROR_HTTP_REQUEST_EOF 4029
|
2015-10-16 09:18:16 +00:00
|
|
|
#define ERROR_KAFKA_CODEC_STRING 4030
|
|
|
|
#define ERROR_KAFKA_CODEC_BYTES 4031
|
|
|
|
#define ERROR_KAFKA_CODEC_REQUEST 4032
|
|
|
|
#define ERROR_KAFKA_CODEC_RESPONSE 4033
|
2015-10-19 05:55:53 +00:00
|
|
|
#define ERROR_KAFKA_CODEC_ARRAY 4034
|
2015-10-22 03:47:38 +00:00
|
|
|
#define ERROR_KAFKA_CODEC_METADATA 4035
|
2015-10-23 01:55:29 +00:00
|
|
|
#define ERROR_KAFKA_CODEC_MESSAGE 4036
|
|
|
|
#define ERROR_KAFKA_CODEC_PRODUCER 4037
|
2015-12-29 10:33:02 +00:00
|
|
|
#define ERROR_HTTP_302_INVALID 4038
|
2018-07-22 09:56:38 +00:00
|
|
|
#define ERROR_BASE64_DECODE 4039
|
2015-01-17 13:58:23 +00:00
|
|
|
|
2015-08-22 05:36:15 +00:00
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
// HTTP API error.
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
//#define ERROR_API_METHOD_NOT_ALLOWD
|
|
|
|
|
2015-03-10 10:07:43 +00:00
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
// user-define error.
|
|
|
|
///////////////////////////////////////////////////////
|
|
|
|
#define ERROR_USER_START 9000
|
2017-09-23 14:12:33 +00:00
|
|
|
//#define ERROR_USER_DISCONNECT 9001
|
2015-06-08 09:28:39 +00:00
|
|
|
#define ERROR_SOURCE_NOT_FOUND 9002
|
2015-03-10 10:07:43 +00:00
|
|
|
#define ERROR_USER_END 9999
|
2015-01-17 13:58:23 +00:00
|
|
|
|
2014-01-11 11:55:55 +00:00
|
|
|
/**
|
2017-03-25 09:21:39 +00:00
|
|
|
* whether the error code is an system control error.
|
|
|
|
*/
|
2017-06-11 10:44:20 +00:00
|
|
|
// TODO: FIXME: Remove it from underlayer for confused with error and logger.
|
2014-01-11 11:55:55 +00:00
|
|
|
extern bool srs_is_system_control_error(int error_code);
|
2017-09-23 14:12:33 +00:00
|
|
|
extern bool srs_is_system_control_error(srs_error_t err);
|
2014-03-18 03:28:22 +00:00
|
|
|
extern bool srs_is_client_gracefully_close(int error_code);
|
2017-09-23 14:12:33 +00:00
|
|
|
extern bool srs_is_client_gracefully_close(srs_error_t err);
|
2014-01-11 11:55:55 +00:00
|
|
|
|
2017-06-09 03:50:35 +00:00
|
|
|
// Use complex errors, @read https://github.com/ossrs/srs/issues/913
|
2017-07-29 04:45:17 +00:00
|
|
|
class SrsCplxError
|
2017-06-09 03:50:35 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
int code;
|
2017-07-29 04:45:17 +00:00
|
|
|
SrsCplxError* wrapped;
|
2017-06-09 03:50:35 +00:00
|
|
|
std::string msg;
|
|
|
|
|
|
|
|
std::string func;
|
|
|
|
std::string file;
|
|
|
|
int line;
|
|
|
|
|
|
|
|
int cid;
|
|
|
|
int rerrno;
|
|
|
|
|
|
|
|
std::string desc;
|
|
|
|
private:
|
2017-07-29 04:45:17 +00:00
|
|
|
SrsCplxError();
|
2017-06-09 03:50:35 +00:00
|
|
|
public:
|
2017-07-29 04:45:17 +00:00
|
|
|
virtual ~SrsCplxError();
|
2017-06-09 03:50:35 +00:00
|
|
|
private:
|
|
|
|
virtual std::string description();
|
|
|
|
public:
|
2017-07-29 04:45:17 +00:00
|
|
|
static SrsCplxError* create(const char* func, const char* file, int line, int code, const char* fmt, ...);
|
|
|
|
static SrsCplxError* wrap(const char* func, const char* file, int line, SrsCplxError* err, const char* fmt, ...);
|
|
|
|
static SrsCplxError* success();
|
|
|
|
static SrsCplxError* copy(SrsCplxError* from);
|
|
|
|
static std::string description(SrsCplxError* err);
|
|
|
|
static int error_code(SrsCplxError* err);
|
2017-06-09 03:50:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Error helpers, should use these functions to new or wrap an error.
|
2017-07-29 04:45:17 +00:00
|
|
|
#define srs_success SrsCplxError::success()
|
|
|
|
#define srs_error_new(ret, fmt, ...) SrsCplxError::create(__FUNCTION__, __FILE__, __LINE__, ret, fmt, ##__VA_ARGS__)
|
|
|
|
#define srs_error_wrap(err, fmt, ...) SrsCplxError::wrap(__FUNCTION__, __FILE__, __LINE__, err, fmt, ##__VA_ARGS__)
|
|
|
|
#define srs_error_copy(err) SrsCplxError::copy(err)
|
|
|
|
#define srs_error_desc(err) SrsCplxError::description(err)
|
|
|
|
#define srs_error_code(err) SrsCplxError::error_code(err)
|
2017-09-23 14:12:33 +00:00
|
|
|
#define srs_error_reset(err) srs_freep(err); err = srs_success
|
2014-07-20 09:32:34 +00:00
|
|
|
|
2014-01-11 11:55:55 +00:00
|
|
|
#endif
|
2014-08-02 14:18:39 +00:00
|
|
|
|