/* * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * error code definitions */ #ifndef AVUTIL_ERROR_H #define AVUTIL_ERROR_H #include <errno.h> #include <stddef.h> #include "macros.h" /** * @addtogroup lavu_error * * @{ */ /* error handling */ #if EDOM > 0 #define AVERROR(e) … #define AVUNERROR(e) … #else /* Some platforms have E* and errno already negated. */ #define AVERROR … #define AVUNERROR … #endif #define FFERRTAG(a, b, c, d) … #define AVERROR_BSF_NOT_FOUND … #define AVERROR_BUG … #define AVERROR_BUFFER_TOO_SMALL … #define AVERROR_DECODER_NOT_FOUND … #define AVERROR_DEMUXER_NOT_FOUND … #define AVERROR_ENCODER_NOT_FOUND … #define AVERROR_EOF … #define AVERROR_EXIT … #define AVERROR_EXTERNAL … #define AVERROR_FILTER_NOT_FOUND … #define AVERROR_INVALIDDATA … #define AVERROR_MUXER_NOT_FOUND … #define AVERROR_OPTION_NOT_FOUND … #define AVERROR_PATCHWELCOME … #define AVERROR_PROTOCOL_NOT_FOUND … #define AVERROR_STREAM_NOT_FOUND … /** * This is semantically identical to AVERROR_BUG * it has been introduced in Libav after our AVERROR_BUG and with a modified value. */ #define AVERROR_BUG2 … #define AVERROR_UNKNOWN … #define AVERROR_EXPERIMENTAL … #define AVERROR_INPUT_CHANGED … #define AVERROR_OUTPUT_CHANGED … /* HTTP & RTSP errors */ #define AVERROR_HTTP_BAD_REQUEST … #define AVERROR_HTTP_UNAUTHORIZED … #define AVERROR_HTTP_FORBIDDEN … #define AVERROR_HTTP_NOT_FOUND … #define AVERROR_HTTP_TOO_MANY_REQUESTS … #define AVERROR_HTTP_OTHER_4XX … #define AVERROR_HTTP_SERVER_ERROR … #define AV_ERROR_MAX_STRING_SIZE … /** * Put a description of the AVERROR code errnum in errbuf. * In case of failure the global variable errno is set to indicate the * error. Even in case of failure av_strerror() will print a generic * error message indicating the errnum provided to errbuf. * * @param errnum error code to describe * @param errbuf buffer to which description is written * @param errbuf_size the size in bytes of errbuf * @return 0 on success, a negative value if a description for errnum * cannot be found */ int av_strerror(int errnum, char *errbuf, size_t errbuf_size); /** * Fill the provided buffer with a string containing an error string * corresponding to the AVERROR code errnum. * * @param errbuf a buffer * @param errbuf_size size in bytes of errbuf * @param errnum error code to describe * @return the buffer in input, filled with the error description * @see av_strerror() */ static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum) { … } /** * Convenience macro, the return value should be used only directly in * function arguments but never stand-alone. */ #define av_err2str(errnum) … /** * @} */ #endif /* AVUTIL_ERROR_H */