You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
4.7KB

  1. /*
  2. * This file is part of Libav.
  3. *
  4. * Libav is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * Libav 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 GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with Libav; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include "config.h"
  19. #include "url.h"
  20. extern const URLProtocol ff_concat_protocol;
  21. extern const URLProtocol ff_crypto_protocol;
  22. extern const URLProtocol ff_ffrtmpcrypt_protocol;
  23. extern const URLProtocol ff_ffrtmphttp_protocol;
  24. extern const URLProtocol ff_file_protocol;
  25. extern const URLProtocol ff_gopher_protocol;
  26. extern const URLProtocol ff_hls_protocol;
  27. extern const URLProtocol ff_http_protocol;
  28. extern const URLProtocol ff_httpproxy_protocol;
  29. extern const URLProtocol ff_https_protocol;
  30. extern const URLProtocol ff_icecast_protocol;
  31. extern const URLProtocol ff_mmsh_protocol;
  32. extern const URLProtocol ff_mmst_protocol;
  33. extern const URLProtocol ff_md5_protocol;
  34. extern const URLProtocol ff_pipe_protocol;
  35. extern const URLProtocol ff_rtmp_protocol;
  36. extern const URLProtocol ff_rtmpe_protocol;
  37. extern const URLProtocol ff_rtmps_protocol;
  38. extern const URLProtocol ff_rtmpt_protocol;
  39. extern const URLProtocol ff_rtmpte_protocol;
  40. extern const URLProtocol ff_rtmpts_protocol;
  41. extern const URLProtocol ff_rtp_protocol;
  42. extern const URLProtocol ff_sctp_protocol;
  43. extern const URLProtocol ff_srtp_protocol;
  44. extern const URLProtocol ff_tcp_protocol;
  45. extern const URLProtocol ff_tls_gnutls_protocol;
  46. extern const URLProtocol ff_tls_openssl_protocol;
  47. extern const URLProtocol ff_udp_protocol;
  48. extern const URLProtocol ff_unix_protocol;
  49. extern const URLProtocol ff_librtmp_protocol;
  50. extern const URLProtocol ff_librtmpe_protocol;
  51. extern const URLProtocol ff_librtmps_protocol;
  52. extern const URLProtocol ff_librtmpt_protocol;
  53. extern const URLProtocol ff_librtmpte_protocol;
  54. const URLProtocol *ff_url_protocols[] = {
  55. #if CONFIG_CONCAT_PROTOCOL
  56. &ff_concat_protocol,
  57. #endif
  58. #if CONFIG_CRYPTO_PROTOCOL
  59. &ff_crypto_protocol,
  60. #endif
  61. #if CONFIG_FFRTMPCRYPT_PROTOCOL
  62. &ff_ffrtmpcrypt_protocol,
  63. #endif
  64. #if CONFIG_FFRTMPHTTP_PROTOCOL
  65. &ff_ffrtmphttp_protocol,
  66. #endif
  67. #if CONFIG_FILE_PROTOCOL
  68. &ff_file_protocol,
  69. #endif
  70. #if CONFIG_GOPHER_PROTOCOL
  71. &ff_gopher_protocol,
  72. #endif
  73. #if CONFIG_HLS_PROTOCOL
  74. &ff_hls_protocol,
  75. #endif
  76. #if CONFIG_HTTP_PROTOCOL
  77. &ff_http_protocol,
  78. #endif
  79. #if CONFIG_HTTPPROXY_PROTOCOL
  80. &ff_httpproxy_protocol,
  81. #endif
  82. #if CONFIG_HTTPS_PROTOCOL
  83. &ff_https_protocol,
  84. #endif
  85. #if CONFIG_ICECAST_PROTOCOL
  86. &ff_icecast_protocol,
  87. #endif
  88. #if CONFIG_MMSH_PROTOCOL
  89. &ff_mmsh_protocol,
  90. #endif
  91. #if CONFIG_MMST_PROTOCOL
  92. &ff_mmst_protocol,
  93. #endif
  94. #if CONFIG_MD5_PROTOCOL
  95. &ff_md5_protocol,
  96. #endif
  97. #if CONFIG_PIPE_PROTOCOL
  98. &ff_pipe_protocol,
  99. #endif
  100. #if CONFIG_RTMP_PROTOCOL
  101. &ff_rtmp_protocol,
  102. #endif
  103. #if CONFIG_RTMPE_PROTOCOL
  104. &ff_rtmpe_protocol,
  105. #endif
  106. #if CONFIG_RTMPS_PROTOCOL
  107. &ff_rtmps_protocol,
  108. #endif
  109. #if CONFIG_RTMPT_PROTOCOL
  110. &ff_rtmpt_protocol,
  111. #endif
  112. #if CONFIG_RTMPTE_PROTOCOL
  113. &ff_rtmpte_protocol,
  114. #endif
  115. #if CONFIG_RTMPTS_PROTOCOL
  116. &ff_rtmpts_protocol,
  117. #endif
  118. #if CONFIG_RTP_PROTOCOL
  119. &ff_rtp_protocol,
  120. #endif
  121. #if CONFIG_SCTP_PROTOCOL
  122. &ff_sctp_protocol,
  123. #endif
  124. #if CONFIG_SRTP_PROTOCOL
  125. &ff_srtp_protocol,
  126. #endif
  127. #if CONFIG_TCP_PROTOCOL
  128. &ff_tcp_protocol,
  129. #endif
  130. #if CONFIG_TLS_GNUTLS_PROTOCOL
  131. &ff_tls_gnutls_protocol,
  132. #endif
  133. #if CONFIG_TLS_OPENSSL_PROTOCOL
  134. &ff_tls_openssl_protocol,
  135. #endif
  136. #if CONFIG_UDP_PROTOCOL
  137. &ff_udp_protocol,
  138. #endif
  139. #if CONFIG_UNIX_PROTOCOL
  140. &ff_unix_protocol,
  141. #endif
  142. /* external libraries */
  143. #if CONFIG_LIBRTMP_PROTOCOL
  144. &ff_librtmp_protocol,
  145. #endif
  146. #if CONFIG_LIBRTMPE_PROTOCOL
  147. &ff_librtmpe_protocol,
  148. #endif
  149. #if CONFIG_LIBRTMPS_PROTOCOL
  150. &ff_librtmps_protocol,
  151. #endif
  152. #if CONFIG_LIBRTMPT_PROTOCOL
  153. &ff_librtmpt_protocol,
  154. #endif
  155. #if CONFIG_LIBRTMPTE_PROTOCOL
  156. &ff_librtmpte_protocol,
  157. #endif
  158. NULL,
  159. };
  160. const char *avio_enum_protocols(void **opaque, int output)
  161. {
  162. const URLProtocol **p = *opaque;
  163. p = p ? p + 1 : ff_url_protocols;
  164. *opaque = p;
  165. if (!*p) {
  166. *opaque = NULL;
  167. return NULL;
  168. }
  169. if ((output && (*p)->url_write) || (!output && (*p)->url_read))
  170. return (*p)->name;
  171. return avio_enum_protocols(opaque, output);
  172. }