2 * Copyright (C) 2008 Wim Taymans <wim.taymans at gmail.com>
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.
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.
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.
21 #include <gst/rtsp/gstrtsprange.h>
22 #include <gst/rtsp/gstrtspurl.h>
23 #include <gst/net/gstnet.h>
25 #ifndef __GST_RTSP_MEDIA_EXT_H__
26 #define __GST_RTSP_MEDIA_EXT_H__
30 /* types for the media */
31 #define GST_TYPE_RTSP_MEDIA_EXT (gst_rtsp_media_ext_get_type ())
32 #define GST_IS_RTSP_MEDIA_EXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_RTSP_MEDIA_EXT))
33 #define GST_IS_RTSP_MEDIA_EXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_RTSP_MEDIA_EXT))
34 #define GST_RTSP_MEDIA_EXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_RTSP_MEDIA_EXT, GstRTSPMediaExtClass))
35 #define GST_RTSP_MEDIA_EXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_RTSP_MEDIA_EXT, GstRTSPMediaExt))
36 #define GST_RTSP_MEDIA_EXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_RTSP_MEDIA_EXT, GstRTSPMediaExtClass))
37 #define GST_RTSP_MEDIA_EXT_CAST(obj) ((GstRTSPMediaExt*)(obj))
38 #define GST_RTSP_MEDIA_EXT_CLASS_CAST(klass) ((GstRTSPMediaExtClass*)(klass))
40 typedef struct _GstRTSPMediaExt GstRTSPMediaExt;
41 typedef struct _GstRTSPMediaExtClass GstRTSPMediaExtClass;
42 typedef struct _GstRTSPMediaExtPrivate GstRTSPMediaExtPrivate;
44 #include "rtsp-stream.h"
47 MEDIA_EXT_MODE_NONE = (0 << 0),
48 MEDIA_EXT_MODE_RESEND = (1 << 0),
49 MEDIA_EXT_MODE_FEC = (1 << 1)
50 } GstRTSPMediaExtMode;
53 MEDIA_EXT_LATENCY_NONE,
54 MEDIA_EXT_LATENCY_LOW,
55 MEDIA_EXT_LATENCY_MID,
56 MEDIA_EXT_LATENCY_HIGH
57 } GstRTSPMediaExtLatency;
62 * A class that contains the GStreamer element along with a list of
63 * #GstRTSPStream objects that can produce data.
65 * This object is usually created from a #GstRTSPMediaFactory.
67 struct _GstRTSPMediaExt {
71 GstRTSPMediaExtPrivate *priv;
72 gpointer _gst_reserved[GST_PADDING];
77 * @handle_message: handle a message
78 * @prepare: the default implementation adds all elements and sets the
79 * pipeline's state to GST_STATE_PAUSED (or GST_STATE_PLAYING
80 * in case of NO_PREROLL elements).
81 * @unprepare: the default implementation sets the pipeline's state
82 * to GST_STATE_NULL and removes all elements.
83 * @suspend: the default implementation sets the pipeline's state to
84 * GST_STATE_NULL GST_STATE_PAUSED depending on the selected
86 * @unsuspend: the default implementation reverts the suspend operation.
87 * The pipeline will be prerolled again if it's state was
88 * set to GST_STATE_NULL in suspend.
89 * @convert_range: convert a range to the given unit
90 * @query_position: query the current position in the pipeline
91 * @query_stop: query when playback will stop
93 * The RTSP media class
95 struct _GstRTSPMediaExtClass {
96 GstRTSPMediaClass parent_class;
99 gpointer _gst_reserved[GST_PADDING_LARGE];
102 GType gst_rtsp_media_ext_get_type (void);
104 /* creating the media */
105 GstRTSPMediaExt * gst_rtsp_media_ext_new (GstElement *element);
106 guint gst_rtsp_media_ext_get_resent_packets (GstRTSPMediaExt *media);
107 void gst_rtsp_media_ext_set_extended_mode (GstRTSPMediaExt *media, GstRTSPMediaExtMode mode);
108 void gst_rtsp_media_ext_set_retrans_port (GstRTSPMediaExt *media, guint port);
109 void gst_rtsp_media_ext_set_fec_value (GstRTSPMediaExt *media, guint max_k, guint max_p);
110 void gst_rtsp_media_ext_set_latency_mode (GstRTSPMediaExt *media, GstRTSPMediaExtLatency latency);
111 void gst_rtsp_media_ext_set_next_param (GstRTSPMediaExt *media, gint32 next_k, gint32 next_p);
115 #endif /* __GST_RTSP_MEDIA_EXT_H__ */