rtspsrc: factor out the connections

Keep a global connection for aggregate control but also keep stream connections
for non-aggregate control.
Add some helper methods to connect/close/flush the connections.
This commit is contained in:
Wim Taymans 2010-06-18 15:08:21 +02:00
parent ddc214d322
commit 966ced2208
2 changed files with 398 additions and 215 deletions

File diff suppressed because it is too large Load diff

View file

@ -83,6 +83,16 @@ typedef struct _GstRTSPSrcClass GstRTSPSrcClass;
#define GST_RTSP_CONN_LOCK(rtsp) (g_static_rec_mutex_lock (GST_RTSP_CONN_GET_LOCK(rtsp))) #define GST_RTSP_CONN_LOCK(rtsp) (g_static_rec_mutex_lock (GST_RTSP_CONN_GET_LOCK(rtsp)))
#define GST_RTSP_CONN_UNLOCK(rtsp) (g_static_rec_mutex_unlock (GST_RTSP_CONN_GET_LOCK(rtsp))) #define GST_RTSP_CONN_UNLOCK(rtsp) (g_static_rec_mutex_unlock (GST_RTSP_CONN_GET_LOCK(rtsp)))
typedef struct _GstRTSPConnInfo GstRTSPConnInfo;
struct _GstRTSPConnInfo {
gchar *location;
GstRTSPUrl *url;
gchar *url_str;
GstRTSPConnection *connection;
gboolean connected;
};
typedef struct _GstRTSPStream GstRTSPStream; typedef struct _GstRTSPStream GstRTSPStream;
struct _GstRTSPStream { struct _GstRTSPStream {
@ -121,12 +131,13 @@ struct _GstRTSPStream {
gboolean container; gboolean container;
/* original control url */ /* original control url */
gchar *control_url; gchar *control_url;
/* fully qualified control url */
gchar *setup_url;
guint32 ssrc; guint32 ssrc;
guint32 seqbase; guint32 seqbase;
guint64 timebase; guint64 timebase;
/* per stream connection */
GstRTSPConnInfo conninfo;
/* bandwidth */ /* bandwidth */
guint as_bandwidth; guint as_bandwidth;
guint rs_bandwidth; guint rs_bandwidth;
@ -176,15 +187,13 @@ struct _GstRTSPSrc {
/* mutex for protecting the connection */ /* mutex for protecting the connection */
GStaticRecMutex *conn_rec_lock; GStaticRecMutex *conn_rec_lock;
GstSDPMessage *sdp;
gint numstreams; gint numstreams;
GList *streams; GList *streams;
GstStructure *props; GstStructure *props;
gboolean need_activate; gboolean need_activate;
/* properties */ /* properties */
gchar *location;
gchar *req_location; /* Sanitised URL to use in network requests */
GstRTSPUrl *url;
GstRTSPLowerTrans protocols; GstRTSPLowerTrans protocols;
gboolean debug; gboolean debug;
guint retry; guint retry;
@ -222,8 +231,7 @@ struct _GstRTSPSrc {
gulong session_sig_id; gulong session_sig_id;
gulong session_ptmap_id; gulong session_ptmap_id;
GstRTSPConnection *connection; GstRTSPConnInfo conninfo;
gboolean connected;
/* a list of RTSP extensions as GstElement */ /* a list of RTSP extensions as GstElement */
GstRTSPExtensionList *extensions; GstRTSPExtensionList *extensions;