gstrtsptransport.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* GStreamer
  2. * Copyright (C) <2005,2006> Wim Taymans <[email protected]>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library 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. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  17. * Boston, MA 02110-1301, USA.
  18. */
  19. /*
  20. * Unless otherwise indicated, Source Code is licensed under MIT license.
  21. * See further explanation attached in License Statement (distributed in the file
  22. * LICENSE).
  23. *
  24. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  25. * this software and associated documentation files (the "Software"), to deal in
  26. * the Software without restriction, including without limitation the rights to
  27. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  28. * of the Software, and to permit persons to whom the Software is furnished to do
  29. * so, subject to the following conditions:
  30. *
  31. * The above copyright notice and this permission notice shall be included in all
  32. * copies or substantial portions of the Software.
  33. *
  34. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  35. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  36. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  37. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  38. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  39. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  40. * SOFTWARE.
  41. */
  42. #ifndef __GST_RTSP_TRANSPORT_H__
  43. #define __GST_RTSP_TRANSPORT_H__
  44. #include <gst/gstconfig.h>
  45. #include <gst/rtsp/gstrtspdefs.h>
  46. G_BEGIN_DECLS
  47. /**
  48. * GstRTSPTransMode:
  49. * @GST_RTSP_TRANS_UNKNOWN: invalid tansport mode
  50. * @GST_RTSP_TRANS_RTP: transfer RTP data
  51. * @GST_RTSP_TRANS_RDT: transfer RDT (RealMedia) data
  52. *
  53. * The transfer mode to use.
  54. */
  55. typedef enum {
  56. GST_RTSP_TRANS_UNKNOWN = 0,
  57. GST_RTSP_TRANS_RTP = (1 << 0),
  58. GST_RTSP_TRANS_RDT = (1 << 1)
  59. } GstRTSPTransMode;
  60. /**
  61. * GstRTSPProfile:
  62. * @GST_RTSP_PROFILE_UNKNOWN: invalid profile
  63. * @GST_RTSP_PROFILE_AVP: the Audio/Visual profile (RFC 3551)
  64. * @GST_RTSP_PROFILE_SAVP: the secure Audio/Visual profile (RFC 3711)
  65. * @GST_RTSP_PROFILE_AVPF: the Audio/Visual profile with feedback (RFC 4585)
  66. * @GST_RTSP_PROFILE_SAVPF: the secure Audio/Visual profile with feedback (RFC 5124)
  67. *
  68. * The transfer profile to use.
  69. */
  70. typedef enum {
  71. GST_RTSP_PROFILE_UNKNOWN = 0,
  72. GST_RTSP_PROFILE_AVP = (1 << 0),
  73. GST_RTSP_PROFILE_SAVP = (1 << 1),
  74. GST_RTSP_PROFILE_AVPF = (1 << 2),
  75. GST_RTSP_PROFILE_SAVPF = (1 << 3),
  76. } GstRTSPProfile;
  77. #define GST_TYPE_RTSP_PROFILE (gst_rtsp_profile_get_type())
  78. GType gst_rtsp_profile_get_type (void);
  79. /**
  80. * GstRTSPLowerTrans:
  81. * @GST_RTSP_LOWER_TRANS_UNKNOWN: invalid transport flag
  82. * @GST_RTSP_LOWER_TRANS_UDP: stream data over UDP
  83. * @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast
  84. * @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP
  85. * @GST_RTSP_LOWER_TRANS_HTTP: stream data tunneled over HTTP.
  86. * @GST_RTSP_LOWER_TRANS_TLS: encrypt TCP and HTTP with TLS
  87. *
  88. * The different transport methods.
  89. */
  90. typedef enum {
  91. GST_RTSP_LOWER_TRANS_UNKNOWN = 0,
  92. GST_RTSP_LOWER_TRANS_UDP = (1 << 0),
  93. GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
  94. GST_RTSP_LOWER_TRANS_TCP = (1 << 2),
  95. GST_RTSP_LOWER_TRANS_HTTP = (1 << 4),
  96. GST_RTSP_LOWER_TRANS_TLS = (1 << 5)
  97. } GstRTSPLowerTrans;
  98. #define GST_TYPE_RTSP_LOWER_TRANS (gst_rtsp_lower_trans_get_type())
  99. GType gst_rtsp_lower_trans_get_type (void);
  100. typedef struct _GstRTSPRange GstRTSPRange;
  101. typedef struct _GstRTSPTransport GstRTSPTransport;
  102. /**
  103. * GstRTSPRange:
  104. * @min: minimum value of the range
  105. * @max: maximum value of the range
  106. *
  107. * A type to specify a range.
  108. */
  109. struct _GstRTSPRange {
  110. gint min;
  111. gint max;
  112. };
  113. /**
  114. * GstRTSPTransport:
  115. * @trans: the transport mode
  116. * @profile: the tansport profile
  117. * @lower_transport: the lower transport
  118. * @destination: the destination ip/hostname
  119. * @source: the source ip/hostname
  120. * @layers: the number of layers
  121. * @mode_play: if play mode was selected
  122. * @mode_record: if record mode was selected
  123. * @append: is append mode was selected
  124. * @interleaved: the interleave range
  125. * @ttl: the time to live for multicast UDP
  126. * @port: the port pair for multicast sessions
  127. * @client_port: the client port pair for receiving data. For TCP
  128. * based transports, applications can use this field to store the
  129. * sender and receiver ports of the client.
  130. * @server_port: the server port pair for receiving data. For TCP
  131. * based transports, applications can use this field to store the
  132. * sender and receiver ports of the server.
  133. * @ssrc: the ssrc that the sender/receiver will use
  134. *
  135. * A structure holding the RTSP transport values.
  136. */
  137. struct _GstRTSPTransport {
  138. GstRTSPTransMode trans;
  139. GstRTSPProfile profile;
  140. GstRTSPLowerTrans lower_transport;
  141. gchar *destination;
  142. gchar *source;
  143. guint layers;
  144. gboolean mode_play;
  145. gboolean mode_record;
  146. gboolean append;
  147. GstRTSPRange interleaved;
  148. /* multicast specific */
  149. guint ttl;
  150. GstRTSPRange port;
  151. /* UDP/TCP specific */
  152. GstRTSPRange client_port;
  153. GstRTSPRange server_port;
  154. /* RTP specific */
  155. guint ssrc;
  156. /*< private >*/
  157. gpointer _gst_reserved[GST_PADDING];
  158. };
  159. GstRTSPResult gst_rtsp_transport_new (GstRTSPTransport **transport);
  160. GstRTSPResult gst_rtsp_transport_init (GstRTSPTransport *transport);
  161. GstRTSPResult gst_rtsp_transport_parse (const gchar *str, GstRTSPTransport *transport);
  162. gchar* gst_rtsp_transport_as_text (GstRTSPTransport *transport);
  163. GstRTSPResult gst_rtsp_transport_get_mime (GstRTSPTransMode trans, const gchar **mime);
  164. GstRTSPResult gst_rtsp_transport_get_manager (GstRTSPTransMode trans, const gchar **manager, guint option);
  165. GstRTSPResult gst_rtsp_transport_get_media_type (GstRTSPTransport *transport,
  166. const gchar **media_type);
  167. GstRTSPResult gst_rtsp_transport_free (GstRTSPTransport *transport);
  168. G_END_DECLS
  169. #endif /* __GST_RTSP_TRANSPORT_H__ */