Tristan Matthews | 0a329cc | 2013-07-17 13:20:14 -0400 | [diff] [blame] | 1 | /* $Id$ */ |
| 2 | /* |
| 3 | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | */ |
| 19 | #ifndef __PJMEDIA_VIDEODEV_VIDEODEV_ERRNO_H__ |
| 20 | #define __PJMEDIA_VIDEODEV_VIDEODEV_ERRNO_H__ |
| 21 | |
| 22 | /** |
| 23 | * @file errno.h Error Codes |
| 24 | * @brief Videodev specific error codes. |
| 25 | */ |
| 26 | |
| 27 | #include <pjmedia-videodev/config.h> |
| 28 | #include <pj/errno.h> |
| 29 | |
| 30 | /** |
| 31 | * @defgroup error_codes Error Codes |
| 32 | * @ingroup video_device_api |
| 33 | * @brief Video device library specific error codes. |
| 34 | * @{ |
| 35 | */ |
| 36 | |
| 37 | |
| 38 | PJ_BEGIN_DECL |
| 39 | |
| 40 | |
| 41 | /** |
| 42 | * Start of error code relative to PJ_ERRNO_START_USER. |
| 43 | * This value is 520000. |
| 44 | */ |
| 45 | #define PJMEDIA_VIDEODEV_ERRNO_START \ |
| 46 | (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*7) |
| 47 | #define PJMEDIA_VIDEODEV_ERRNO_END \ |
| 48 | (PJMEDIA_VIDEODEV_ERRNO_START + PJ_ERRNO_SPACE_SIZE - 1) |
| 49 | |
| 50 | |
| 51 | /************************************************************ |
| 52 | * Video Device API error codes |
| 53 | ***********************************************************/ |
| 54 | /** |
| 55 | * @hideinitializer |
| 56 | * General/unknown error. |
| 57 | */ |
| 58 | #define PJMEDIA_EVID_ERR (PJMEDIA_VIDEODEV_ERRNO_START+1) /* 520001 */ |
| 59 | |
| 60 | /** |
| 61 | * @hideinitializer |
| 62 | * Unknown error from video driver |
| 63 | */ |
| 64 | #define PJMEDIA_EVID_SYSERR (PJMEDIA_VIDEODEV_ERRNO_START+2) /* 520002 */ |
| 65 | |
| 66 | /** |
| 67 | * @hideinitializer |
| 68 | * Video subsystem not initialized |
| 69 | */ |
| 70 | #define PJMEDIA_EVID_INIT (PJMEDIA_VIDEODEV_ERRNO_START+3) /* 520003 */ |
| 71 | |
| 72 | /** |
| 73 | * @hideinitializer |
| 74 | * Invalid video device |
| 75 | */ |
| 76 | #define PJMEDIA_EVID_INVDEV (PJMEDIA_VIDEODEV_ERRNO_START+4) /* 520004 */ |
| 77 | |
| 78 | /** |
| 79 | * @hideinitializer |
| 80 | * Found no devices |
| 81 | */ |
| 82 | #define PJMEDIA_EVID_NODEV (PJMEDIA_VIDEODEV_ERRNO_START+5) /* 520005 */ |
| 83 | |
| 84 | /** |
| 85 | * @hideinitializer |
| 86 | * Unable to find default device |
| 87 | */ |
| 88 | #define PJMEDIA_EVID_NODEFDEV (PJMEDIA_VIDEODEV_ERRNO_START+6) /* 520006 */ |
| 89 | |
| 90 | /** |
| 91 | * @hideinitializer |
| 92 | * Device not ready |
| 93 | */ |
| 94 | #define PJMEDIA_EVID_NOTREADY (PJMEDIA_VIDEODEV_ERRNO_START+7) /* 520007 */ |
| 95 | |
| 96 | /** |
| 97 | * @hideinitializer |
| 98 | * The video capability is invalid or not supported |
| 99 | */ |
| 100 | #define PJMEDIA_EVID_INVCAP (PJMEDIA_VIDEODEV_ERRNO_START+8) /* 520008 */ |
| 101 | |
| 102 | /** |
| 103 | * @hideinitializer |
| 104 | * The operation is invalid or not supported |
| 105 | */ |
| 106 | #define PJMEDIA_EVID_INVOP (PJMEDIA_VIDEODEV_ERRNO_START+9) /* 520009 */ |
| 107 | |
| 108 | /** |
| 109 | * @hideinitializer |
| 110 | * Bad or invalid video device format |
| 111 | */ |
| 112 | #define PJMEDIA_EVID_BADFORMAT (PJMEDIA_VIDEODEV_ERRNO_START+10) /* 520010 */ |
| 113 | |
| 114 | /** |
| 115 | * @hideinitializer |
| 116 | * Invalid video device sample format |
| 117 | */ |
| 118 | #define PJMEDIA_EVID_SAMPFORMAT (PJMEDIA_VIDEODEV_ERRNO_START+11) /* 520011 */ |
| 119 | |
| 120 | /** |
| 121 | * @hideinitializer |
| 122 | * Bad latency setting |
| 123 | */ |
| 124 | #define PJMEDIA_EVID_BADLATENCY (PJMEDIA_VIDEODEV_ERRNO_START+12) /* 520012 */ |
| 125 | |
| 126 | /** |
| 127 | * @hideinitializer |
| 128 | * Bad/unsupported video size |
| 129 | */ |
| 130 | #define PJMEDIA_EVID_BADSIZE (PJMEDIA_VIDEODEV_ERRNO_START+13) /* 520013 */ |
| 131 | |
| 132 | |
| 133 | /** |
| 134 | * Get error message for the specified error code. Note that this |
| 135 | * function is only able to decode PJMEDIA Videodev specific error code. |
| 136 | * Application should use pj_strerror(), which should be able to |
| 137 | * decode all error codes belonging to all subsystems (e.g. pjlib, |
| 138 | * pjmedia, pjsip, etc). |
| 139 | * |
| 140 | * @param status The error code. |
| 141 | * @param buffer The buffer where to put the error message. |
| 142 | * @param bufsize Size of the buffer. |
| 143 | * |
| 144 | * @return The error message as NULL terminated string, |
| 145 | * wrapped with pj_str_t. |
| 146 | */ |
| 147 | PJ_DECL(pj_str_t) pjmedia_videodev_strerror(pj_status_t status, char *buffer, |
| 148 | pj_size_t bufsize); |
| 149 | |
| 150 | |
| 151 | PJ_END_DECL |
| 152 | |
| 153 | /** |
| 154 | * @} |
| 155 | */ |
| 156 | |
| 157 | |
| 158 | #endif /* __PJMEDIA_VIDEODEV_VIDEODEV_ERRNO_H__ */ |
| 159 | |