Added SDP demuxer element. Fixes #426657.

Original commit message from CVS:
* configure.ac:
* gst/sdp/gstsdpdemux.c: (_do_init), (gst_sdp_demux_base_init),
(gst_sdp_demux_class_init), (gst_sdp_demux_init),
(gst_sdp_demux_finalize), (gst_sdp_demux_set_property),
(gst_sdp_demux_get_property), (find_stream_by_id),
(find_stream_by_pt), (find_stream_by_udpsrc), (find_stream),
(gst_sdp_demux_stream_free), (gst_sdp_demux_create_stream),
(gst_sdp_demux_cleanup), (get_default_rate_for_pt),
(gst_sdp_demux_parse_rtpmap), (gst_sdp_demux_media_to_caps),
(new_session_pad), (request_pt_map), (gst_sdp_demux_do_stream_eos),
(on_bye_ssrc), (on_timeout), (gst_sdp_demux_configure_manager),
(gst_sdp_demux_stream_configure_udp),
(gst_sdp_demux_stream_configure_udp_sink),
(gst_sdp_demux_combine_flows), (gst_sdp_demux_stream_push_event),
(gst_sdp_demux_handle_message), (gst_sdp_demux_start),
(gst_sdp_demux_sink_event), (gst_sdp_demux_sink_chain),
(gst_sdp_demux_change_state):
* gst/sdp/gstsdpdemux.h:
* gst/sdp/gstsdpelem.c: (plugin_init):
Added SDP demuxer element. Fixes #426657.
This commit is contained in:
Wim Taymans 2007-10-01 11:43:09 +00:00
parent 0813fdac80
commit a2a6ea8645
5 changed files with 1557 additions and 0 deletions

View file

@ -1,3 +1,26 @@
2007-10-01 Wim Taymans <wim.taymans@gmail.com>
* configure.ac:
* gst/sdp/gstsdpdemux.c: (_do_init), (gst_sdp_demux_base_init),
(gst_sdp_demux_class_init), (gst_sdp_demux_init),
(gst_sdp_demux_finalize), (gst_sdp_demux_set_property),
(gst_sdp_demux_get_property), (find_stream_by_id),
(find_stream_by_pt), (find_stream_by_udpsrc), (find_stream),
(gst_sdp_demux_stream_free), (gst_sdp_demux_create_stream),
(gst_sdp_demux_cleanup), (get_default_rate_for_pt),
(gst_sdp_demux_parse_rtpmap), (gst_sdp_demux_media_to_caps),
(new_session_pad), (request_pt_map), (gst_sdp_demux_do_stream_eos),
(on_bye_ssrc), (on_timeout), (gst_sdp_demux_configure_manager),
(gst_sdp_demux_stream_configure_udp),
(gst_sdp_demux_stream_configure_udp_sink),
(gst_sdp_demux_combine_flows), (gst_sdp_demux_stream_push_event),
(gst_sdp_demux_handle_message), (gst_sdp_demux_start),
(gst_sdp_demux_sink_event), (gst_sdp_demux_sink_chain),
(gst_sdp_demux_change_state):
* gst/sdp/gstsdpdemux.h:
* gst/sdp/gstsdpelem.c: (plugin_init):
Added SDP demuxer element. Fixes #426657.
2007-10-01 Sebastian Dröge <slomo@circular-chaos.org>
Patch by: mutex at runbox dot com

View file

@ -102,6 +102,7 @@ GST_PLUGINS_ALL="\
real \
replaygain \
rtpmanager \
sdp \
spectrum \
speed \
stereo \
@ -1007,6 +1008,7 @@ gst/nsf/Makefile
gst/nuvdemux/Makefile
gst/replaygain/Makefile
gst/rtpmanager/Makefile
gst/sdp/Makefile
gst/spectrum/Makefile
gst/speed/Makefile
gst/stereo/Makefile

1378
gst/sdp/gstsdpdemux.c Normal file

File diff suppressed because it is too large Load diff

114
gst/sdp/gstsdpdemux.h Normal file
View file

@ -0,0 +1,114 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_SDP_DEMUX_H__
#define __GST_SDP_DEMUX_H__
#include <gst/gst.h>
#include <gst/base/gstadapter.h>
G_BEGIN_DECLS
#define GST_TYPE_SDP_DEMUX \
(gst_sdp_demux_get_type())
#define GST_SDP_DEMUX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SDP_DEMUX,GstSDPDemux))
#define GST_SDP_DEMUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SDP_DEMUX,GstSDPDemuxClass))
#define GST_IS_SDP_DEMUX(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SDP_DEMUX))
#define GST_IS_SDP_DEMUX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SDP_DEMUX))
#define GST_SDP_DEMUX_CAST(obj) \
((GstSDPDemux *)(obj))
typedef struct _GstSDPDemux GstSDPDemux;
typedef struct _GstSDPDemuxClass GstSDPDemuxClass;
#define GST_SDP_STREAM_GET_LOCK(sdp) (GST_SDP_DEMUX_CAST(sdp)->stream_rec_lock)
#define GST_SDP_STREAM_LOCK(sdp) (g_static_rec_mutex_lock (GST_SDP_STREAM_GET_LOCK(sdp)))
#define GST_SDP_STREAM_UNLOCK(sdp) (g_static_rec_mutex_unlock (GST_SDP_STREAM_GET_LOCK(sdp)))
typedef struct _GstSDPStream GstSDPStream;
struct _GstSDPStream {
gint id;
GstSDPDemux *parent; /* parent, no extra ref to parent is taken */
/* pad we expose or NULL when it does not have an actual pad */
GstPad *srcpad;
GstFlowReturn last_ret;
gboolean added;
gboolean disabled;
GstCaps *caps;
gboolean eos;
/* our udp sources */
GstElement *udpsrc[2];
GstPad *channelpad[2];
guint rtp_port;
guint rtcp_port;
gchar *destination;
guint ttl;
/* our udp sink back to the server */
GstElement *udpsink;
GstPad *rtcppad;
/* state */
guint8 pt;
gboolean container;
};
struct _GstSDPDemux {
GstBin parent;
GstPad *sinkpad;
GstAdapter *adapter;
GstState target;
/* task for UDP loop */
gboolean ignore_timeout;
gint numstreams;
GStaticRecMutex *stream_rec_lock;
GList *streams;
/* properties */
gboolean debug;
guint64 udp_timeout;
guint latency;
/* session management */
GstElement *session;
gulong session_sig_id;
gulong session_ptmap_id;
};
struct _GstSDPDemuxClass {
GstBinClass parent_class;
};
GType gst_sdp_demux_get_type(void);
G_END_DECLS
#endif /* __GST_SDP_DEMUX_H__ */

40
gst/sdp/gstsdpelem.c Normal file
View file

@ -0,0 +1,40 @@
/* GStreamer
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstsdpdemux.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "sdpdemux", GST_RANK_SECONDARY,
GST_TYPE_SDP_DEMUX))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"sdp",
"configure streaming sessions using SDP",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)