Blame gst-libs/gst/rtsp/gstrtsptransport.h

Packit 971217
/* GStreamer
Packit 971217
 * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
Packit 971217
 *
Packit 971217
 * This library is free software; you can redistribute it and/or
Packit 971217
 * modify it under the terms of the GNU Library General Public
Packit 971217
 * License as published by the Free Software Foundation; either
Packit 971217
 * version 2 of the License, or (at your option) any later version.
Packit 971217
 *
Packit 971217
 * This library is distributed in the hope that it will be useful,
Packit 971217
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 971217
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 971217
 * Library General Public License for more details.
Packit 971217
 *
Packit 971217
 * You should have received a copy of the GNU Library General Public
Packit 971217
 * License along with this library; if not, write to the
Packit 971217
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Packit 971217
 * Boston, MA 02110-1301, USA.
Packit 971217
 */
Packit 971217
/*
Packit 971217
 * Unless otherwise indicated, Source Code is licensed under MIT license.
Packit 971217
 * See further explanation attached in License Statement (distributed in the file
Packit 971217
 * LICENSE).
Packit 971217
 *
Packit 971217
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
Packit 971217
 * this software and associated documentation files (the "Software"), to deal in
Packit 971217
 * the Software without restriction, including without limitation the rights to
Packit 971217
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
Packit 971217
 * of the Software, and to permit persons to whom the Software is furnished to do
Packit 971217
 * so, subject to the following conditions:
Packit 971217
 *
Packit 971217
 * The above copyright notice and this permission notice shall be included in all
Packit 971217
 * copies or substantial portions of the Software.
Packit 971217
 *
Packit 971217
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit 971217
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit 971217
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Packit 971217
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
Packit 971217
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Packit 971217
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
Packit 971217
 * SOFTWARE.
Packit 971217
 */
Packit 971217
Packit 971217
#ifndef __GST_RTSP_TRANSPORT_H__
Packit 971217
#define __GST_RTSP_TRANSPORT_H__
Packit 971217
Packit 971217
#include <gst/gstconfig.h>
Packit 971217
#include <gst/rtsp/gstrtspdefs.h>
Packit 971217
#include <gst/rtsp/gstrtsp-enumtypes.h>
Packit 971217
Packit 971217
G_BEGIN_DECLS
Packit 971217
Packit 971217
/**
Packit 971217
 * GstRTSPTransMode:
Packit 971217
 * @GST_RTSP_TRANS_UNKNOWN: invalid tansport mode
Packit 971217
 * @GST_RTSP_TRANS_RTP: transfer RTP data
Packit 971217
 * @GST_RTSP_TRANS_RDT: transfer RDT (RealMedia) data
Packit 971217
 *
Packit 971217
 * The transfer mode to use.
Packit 971217
 */
Packit 971217
typedef enum {
Packit 971217
  GST_RTSP_TRANS_UNKNOWN =  0,
Packit 971217
  GST_RTSP_TRANS_RTP     = (1 << 0),
Packit 971217
  GST_RTSP_TRANS_RDT     = (1 << 1)
Packit 971217
} GstRTSPTransMode;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstRTSPProfile:
Packit 971217
 * @GST_RTSP_PROFILE_UNKNOWN: invalid profile
Packit 971217
 * @GST_RTSP_PROFILE_AVP: the Audio/Visual profile (RFC 3551)
Packit 971217
 * @GST_RTSP_PROFILE_SAVP: the secure Audio/Visual profile (RFC 3711)
Packit 971217
 * @GST_RTSP_PROFILE_AVPF: the Audio/Visual profile with feedback (RFC 4585)
Packit 971217
 * @GST_RTSP_PROFILE_SAVPF: the secure Audio/Visual profile with feedback (RFC 5124)
Packit 971217
 *
Packit 971217
 * The transfer profile to use.
Packit 971217
 */
Packit 971217
/* FIXME 2.0: This should probably be an enum, not flags and maybe be replaced
Packit 971217
 * by GstRTPTransport */
Packit 971217
typedef enum {
Packit 971217
  GST_RTSP_PROFILE_UNKNOWN =  0,
Packit 971217
  GST_RTSP_PROFILE_AVP     = (1 << 0),
Packit 971217
  GST_RTSP_PROFILE_SAVP    = (1 << 1),
Packit 971217
  GST_RTSP_PROFILE_AVPF    = (1 << 2),
Packit 971217
  GST_RTSP_PROFILE_SAVPF   = (1 << 3),
Packit 971217
} GstRTSPProfile;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstRTSPLowerTrans:
Packit 971217
 * @GST_RTSP_LOWER_TRANS_UNKNOWN: invalid transport flag
Packit 971217
 * @GST_RTSP_LOWER_TRANS_UDP: stream data over UDP
Packit 971217
 * @GST_RTSP_LOWER_TRANS_UDP_MCAST: stream data over UDP multicast
Packit 971217
 * @GST_RTSP_LOWER_TRANS_TCP: stream data over TCP
Packit 971217
 * @GST_RTSP_LOWER_TRANS_HTTP: stream data tunneled over HTTP.
Packit 971217
 * @GST_RTSP_LOWER_TRANS_TLS: encrypt TCP and HTTP with TLS
Packit 971217
 *
Packit 971217
 * The different transport methods.
Packit 971217
 */
Packit 971217
typedef enum {
Packit 971217
  GST_RTSP_LOWER_TRANS_UNKNOWN   = 0,
Packit 971217
  GST_RTSP_LOWER_TRANS_UDP       = (1 << 0),
Packit 971217
  GST_RTSP_LOWER_TRANS_UDP_MCAST = (1 << 1),
Packit 971217
  GST_RTSP_LOWER_TRANS_TCP       = (1 << 2),
Packit 971217
  GST_RTSP_LOWER_TRANS_HTTP      = (1 << 4),
Packit 971217
  GST_RTSP_LOWER_TRANS_TLS       = (1 << 5)
Packit 971217
} GstRTSPLowerTrans;
Packit 971217
Packit 971217
typedef struct _GstRTSPRange GstRTSPRange;
Packit 971217
typedef struct _GstRTSPTransport GstRTSPTransport;
Packit 971217
Packit 971217
/**
Packit 971217
 * GstRTSPRange:
Packit 971217
 * @min: minimum value of the range
Packit 971217
 * @max: maximum value of the range
Packit 971217
 *
Packit 971217
 * A type to specify a range.
Packit 971217
 */
Packit 971217
Packit 971217
struct _GstRTSPRange {
Packit 971217
  gint min;
Packit 971217
  gint max;
Packit 971217
};
Packit 971217
Packit 971217
/**
Packit 971217
 * GstRTSPTransport:
Packit 971217
 * @trans: the transport mode
Packit 971217
 * @profile: the tansport profile
Packit 971217
 * @lower_transport: the lower transport
Packit 971217
 * @destination: the destination ip/hostname
Packit 971217
 * @source: the source ip/hostname
Packit 971217
 * @layers: the number of layers
Packit 971217
 * @mode_play: if play mode was selected
Packit 971217
 * @mode_record: if record mode was selected
Packit 971217
 * @append: is append mode was selected
Packit 971217
 * @interleaved: the interleave range
Packit 971217
 * @ttl: the time to live for multicast UDP
Packit 971217
 * @port: the port pair for multicast sessions
Packit 971217
 * @client_port: the client port pair for receiving data. For TCP
Packit 971217
 *   based transports, applications can use this field to store the
Packit 971217
 *   sender and receiver ports of the client.
Packit 971217
 * @server_port: the server port pair for receiving data. For TCP
Packit 971217
 *   based transports, applications can use this field to store the
Packit 971217
 *   sender and receiver ports of the server.
Packit 971217
 * @ssrc: the ssrc that the sender/receiver will use
Packit 971217
 *
Packit 971217
 * A structure holding the RTSP transport values.
Packit 971217
 */
Packit 971217
Packit 971217
struct _GstRTSPTransport {
Packit 971217
  GstRTSPTransMode  trans;
Packit 971217
  GstRTSPProfile    profile;
Packit 971217
  GstRTSPLowerTrans lower_transport;
Packit 971217
Packit 971217
  gchar         *destination;
Packit 971217
  gchar         *source;
Packit 971217
  guint          layers;
Packit 971217
  gboolean       mode_play;
Packit 971217
  gboolean       mode_record;
Packit 971217
  gboolean       append;
Packit 971217
  GstRTSPRange   interleaved;
Packit 971217
Packit 971217
  /* multicast specific */
Packit 971217
  guint  ttl;
Packit 971217
  GstRTSPRange   port;
Packit 971217
Packit 971217
  /* UDP/TCP specific */
Packit 971217
  GstRTSPRange   client_port;
Packit 971217
  GstRTSPRange   server_port;
Packit 971217
  /* RTP specific */
Packit 971217
  guint          ssrc;
Packit 971217
Packit 971217
  /*< private >*/
Packit 971217
  gpointer _gst_reserved[GST_PADDING];
Packit 971217
};
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_new          (GstRTSPTransport **transport);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_init         (GstRTSPTransport *transport);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_parse        (const gchar *str, GstRTSPTransport *transport);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
gchar*             gst_rtsp_transport_as_text      (GstRTSPTransport *transport);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_get_mime     (GstRTSPTransMode trans, const gchar **mime);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_get_manager  (GstRTSPTransMode trans, const gchar **manager, guint option);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_get_media_type (GstRTSPTransport *transport,
Packit 971217
                                                      const gchar **media_type);
Packit 971217
Packit 971217
GST_RTSP_API
Packit 971217
GstRTSPResult      gst_rtsp_transport_free         (GstRTSPTransport *transport);
Packit 971217
Packit 971217
G_END_DECLS
Packit 971217
Packit 971217
#endif /* __GST_RTSP_TRANSPORT_H__ */