errno.h 4.1 KB

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