gst_plugins_base/gst-libs/gst/rtsp/gstrtsptransport.h
changeset 0 0e761a78d257
child 8 4a7fac7dd34a
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /* GStreamer
       
     2  * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
       
     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., 59 Temple Place - Suite 330,
       
    17  * Boston, MA 02111-1307, 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 
       
    43 #ifndef __GST_RTSP_TRANSPORT_H__
       
    44 #define __GST_RTSP_TRANSPORT_H__
       
    45 
       
    46 #include <gst/rtsp/gstrtspdefs.h>
       
    47 
       
    48 G_BEGIN_DECLS
       
    49 
       
    50 /**
       
    51  * GstRTSPTransMode:
       
    52  * @GST_RTSP_TRANS_UNKNOWN: invalid tansport mode
       
    53  * @GST_RTSP_TRANS_RTP: transfer RTP data
       
    54  * @GST_RTSP_TRANS_RDT: transfer RDT (RealMedia) data
       
    55  *
       
    56  * The transfer mode to use.
       
    57  */
       
    58 typedef enum {
       
    59   GST_RTSP_TRANS_UNKNOWN =  0,
       
    60   GST_RTSP_TRANS_RTP     = (1 << 0),
       
    61   GST_RTSP_TRANS_RDT     = (1 << 1)
       
    62 } GstRTSPTransMode;
       
    63 
       
    64 /**
       
    65  * GstRTSPProfile:
       
    66  * @GST_RTSP_PROFILE_UNKNOWN: invalid profile
       
    67  * @GST_RTSP_PROFILE_AVP: the Audio/Visual profile
       
    68  * @GST_RTSP_PROFILE_SAVP: the secure Audio/Visual profile
       
    69  *
       
    70  * The transfer profile to use.
       
    71  */
       
    72 typedef enum {
       
    73   GST_RTSP_PROFILE_UNKNOWN =  0,
       
    74   GST_RTSP_PROFILE_AVP     = (1 << 0),
       
    75   GST_RTSP_PROFILE_SAVP    = (1 << 1)
       
    76 } GstRTSPProfile;
       
    77 
       
    78 /**
       
    79  * GstRTSPLowerTrans:
       
    80  * @GST_RTSP_LOWER_TRANS_UNKNOWN: invalid transport flag
       
    81  * @GST_RTSP_LOWER_TRANS_UDP: stream data over UDP
       
    82  * @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast
       
    83  * @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP
       
    84  *
       
    85  * The different transport methods.
       
    86  */
       
    87 typedef enum {
       
    88   GST_RTSP_LOWER_TRANS_UNKNOWN   = 0,
       
    89   GST_RTSP_LOWER_TRANS_UDP       = (1 << 0),
       
    90   GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
       
    91   GST_RTSP_LOWER_TRANS_TCP       = (1 << 2)
       
    92 } GstRTSPLowerTrans;
       
    93 
       
    94 /**
       
    95  * RTSPRange:
       
    96  * @min: minimum value of the range
       
    97  * @max: maximum value of the range
       
    98  *
       
    99  * A type to specify a range.
       
   100  */
       
   101 typedef struct
       
   102 {
       
   103   gint min;
       
   104   gint max;
       
   105 } GstRTSPRange;
       
   106 
       
   107 /**
       
   108  * GstRTSPTransport:
       
   109  *
       
   110  * A structure holding the RTSP transport values.
       
   111  */
       
   112 typedef struct _GstRTSPTransport {
       
   113   /*< private >*/
       
   114   GstRTSPTransMode  trans;
       
   115   GstRTSPProfile    profile;
       
   116   GstRTSPLowerTrans lower_transport;
       
   117 
       
   118   gchar         *destination;
       
   119   gchar         *source;
       
   120   guint          layers;
       
   121   gboolean       mode_play;
       
   122   gboolean       mode_record;
       
   123   gboolean       append;
       
   124   GstRTSPRange   interleaved;
       
   125 
       
   126   /* multicast specific */
       
   127   guint  ttl;
       
   128 
       
   129   /* UDP specific */
       
   130   GstRTSPRange   port;
       
   131   GstRTSPRange   client_port;
       
   132   GstRTSPRange   server_port;
       
   133   /* RTP specific */
       
   134   guint          ssrc;
       
   135 
       
   136 } GstRTSPTransport;
       
   137 
       
   138 GstRTSPResult      gst_rtsp_transport_new          (GstRTSPTransport **transport);
       
   139 GstRTSPResult      gst_rtsp_transport_init         (GstRTSPTransport *transport);
       
   140 
       
   141 GstRTSPResult      gst_rtsp_transport_parse        (const gchar *str, GstRTSPTransport *transport);
       
   142 gchar*             gst_rtsp_transport_as_text      (GstRTSPTransport *transport);
       
   143 
       
   144 GstRTSPResult      gst_rtsp_transport_get_mime     (GstRTSPTransMode trans, const gchar **mime);
       
   145 GstRTSPResult      gst_rtsp_transport_get_manager  (GstRTSPTransMode trans, const gchar **manager, guint option);
       
   146 
       
   147 GstRTSPResult      gst_rtsp_transport_free         (GstRTSPTransport *transport);
       
   148 
       
   149 G_END_DECLS
       
   150 
       
   151 #endif /* __GST_RTSP_TRANSPORT_H__ */