# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
-AC_INIT([gst-rtsp-server-wfd],[0.0.1])
+AC_INIT([gst-rtsp-server-wfd],[0.2.0])
AC_CONFIG_SRCDIR([src/rtsp-client.c])
AC_CONFIG_HEADER([config.h])
-AM_INIT_AUTOMAKE([1.11 -Wall -Wno-extra-portability foreign])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# Checks for programs.
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
AC_PROG_LIBTOOL
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
-PKG_CHECK_MODULES(GST, gstreamer-0.10 >= 0.10)
+PKG_CHECK_MODULES(GST, gstreamer-1.0 >= 1.2.0)
AC_SUBST(GST_CFLAGS)
AC_SUBST(GST_LIBS)
-PKG_CHECK_MODULES(GST_PLUGIN_BASE, gstreamer-plugins-base-0.10 >= 0.10)
+PKG_CHECK_MODULES(GST_PLUGIN_BASE, gstreamer-plugins-base-1.0 >= 1.2.0)
AC_SUBST(GST_PLUGIN_BASE_CFLAGS)
AC_SUBST(GST_PLUGIN_BASE_LIBS)
-PKG_CHECK_MODULES(GST_INTERFACE, gstreamer-interfaces-0.10 >= 0.10)
-AC_SUBST(GST_INTERFACE_CFLAGS)
-AC_SUBST(GST_LIBS)
-
-PKG_CHECK_MODULES(GST_APP, gstreamer-app-0.10 >= 0.10)
+PKG_CHECK_MODULES(GST_APP, gstreamer-app-1.0 >= 1.2.0)
AC_SUBST(GST_APP_CFLAGS)
AC_SUBST(GST_APP_LIBS)
Name: gst-rtsp-server-wfd
Summary: Multimedia Framework Wifi-Display Library
Version: 0.1.0
-Release: 12
+Release: 13
Group: System/Libraries
License: LGPLv2+
Source0: %{name}-%{version}.tar.gz
Requires(postun): /sbin/ldconfig
BuildRequires: pkgconfig(mm-ta)
BuildRequires: pkgconfig(mm-common)
-BuildRequires: pkgconfig(gstreamer-0.10)
-BuildRequires: pkgconfig(gstreamer-plugins-base-0.10)
-BuildRequires: pkgconfig(elementary)
+BuildRequires: pkgconfig(gstreamer-1.0)
+BuildRequires: pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires: pkgconfig(mm-session)
BuildRequires: pkgconfig(iniparser)
BuildRequires: pkgconfig(xau)
BuildRequires: pkgconfig(dri2proto)
BuildRequires: pkgconfig(libdri2)
BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(libdrm_exynos)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%defattr(-,root,root,-)
%{_libdir}/*.so
%{_includedir}/mmf/wfdconfigmessage.h
+%{_includedir}/mmf/rtsp-*.h
%{_libdir}/pkgconfig/*
includelibmmfwfdconfigdir = $(includedir)/mmf
-includelibmmfwfdconfig_HEADERS = include/wfdconfigmessage.h
+includelibmmfwfdconfig_HEADERS = include/wfdconfigmessage.h \
+ include/rtsp-auth.h \
+ include/rtsp-client.h \
+ include/rtsp-media.h \
+ include/rtsp-media-factory.h \
+ include/rtsp-media-factory-uri.h \
+ include/rtsp-media-mapping.h \
+ include/rtsp-server.h \
+ include/rtsp-session.h \
+ include/rtsp-session-pool.h
libmmfwfdconfig_la_SOURCES = wfdconfigmessage.c
$(GST_LIBS) \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
- -lgstrtp-0.10 -lgstrtsp-0.10 -lgstsdp-0.10 -lgstapp-0.10 \
+ -lgstrtp-1.0 -lgstrtsp-1.0 -lgstsdp-1.0 -lgstapp-1.0 \
$(GST_INTERFACE_LIBS) \
$(GST_APP_LIBS) \
$(MMCOMMON_LIBS)
$(UTILX_CFLAGS)
noinst_HEADERS = include/rtsp-funnel.h \
- include/rtsp-auth.h \
- include/rtsp-params.h \
- include/rtsp-sdp.h \
- include/rtsp-media.h \
- include/rtsp-media-factory.h \
- include/rtsp-media-factory-uri.h \
- include/rtsp-media-mapping.h \
- include/rtsp-session.h \
- include/rtsp-session-pool.h \
- include/rtsp-client.h
+ include/rtsp-params.h \
+ include/rtsp-sdp.h
#libmmfwfd_rtsp_server_la_DEPENDENCIES = $(top_builddir)/src/libmmfwfdconfig.la
libmmfwfd_rtsp_server_la_LIBADD = $(GLIB_LIBS) \
$(GST_LIBS) \
$(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) \
- -lgstrtp-0.10 -lgstrtsp-0.10 -lgstsdp-0.10 -lgstapp-0.10 -lmmfwfdconfig \
+ -lgstrtp-1.0 -lgstrtsp-1.0 -lgstsdp-1.0 -lgstapp-1.0 -lmmfwfdconfig \
$(GST_INTERFACE_LIBS) \
$(GST_APP_LIBS) \
$(INIPARSER_LIBS)\
#ifdef STANDBY_RESUME_CAPABILITY
gboolean standby_resume_capability_support;
#endif
- guint cseq;
gboolean keep_alive_flag;
GMutex *keep_alive_lock;
#include <X11/Xmd.h>
#include <dri2.h>
#include <utilX.h>
+#include <xf86drm.h>
#define DEFAULT_RTSP_TIMEOUT 60
#define DRM_EXYNOS_VIDI_ON 1
static gboolean
gst_rtsp_client_parse_methods (GstRTSPClient * client, GstRTSPMessage * response);
gboolean
-keep_alive_condition(gpointer *userdata);
+keep_alive_condition(gpointer userdata);
gboolean
gst_rtsp_client_sending_m16_message (GstRTSPClient * client);
client->state_lock = g_mutex_new ();
client->keep_alive_lock = g_mutex_new();
client->keep_alive_flag = TRUE;
- client->cseq = 0;
client->state_wait = g_cond_new ();
client->client_state = CLIENT_STATE_UNKNOWN;
client->videosrc_type = WFD_INI_VSRC_XVIMAGESRC;
GstRTSPAuth *auth;
GST_INFO_OBJECT (client, "client->uri = %s & state->uri = %s",
- client->uri, state->uri);
+ client->uri->abspath, state->uri->abspath);
if (!compare_uri (client->uri, state->uri)) {
/* remove any previously cached values before we try to construct a new
do_send_data (GstBuffer * buffer, guint8 channel, GstRTSPClient * client)
{
GstRTSPMessage message = { 0 };
+ GstMapInfo mapinfo;
guint8 *data;
guint size;
gst_rtsp_message_init_data (&message, channel);
- data = GST_BUFFER_DATA (buffer);
- size = GST_BUFFER_SIZE (buffer);
+ gst_buffer_map(buffer, &mapinfo, GST_MAP_READ);
+ data = mapinfo.data;
+ size = mapinfo.size;
gst_rtsp_message_take_body (&message, data, size);
/* FIXME, client->watch could have been finalized here, we need to keep an
gst_rtsp_message_steal_body (&message, &data, &size);
gst_rtsp_message_unset (&message);
+ gst_buffer_unmap(buffer, &mapinfo);
+
return TRUE;
}
do_send_data_list (GstBufferList * blist, guint8 channel,
GstRTSPClient * client)
{
- GstBufferListIterator *it;
-
- it = gst_buffer_list_iterate (blist);
- while (gst_buffer_list_iterator_next_group (it)) {
- GstBuffer *group = gst_buffer_list_iterator_merge_group (it);
-
- if (group == NULL)
- continue;
-
- do_send_data (group, channel, client);
- }
- gst_buffer_list_iterator_free (it);
+ GstBuffer *buffer;
+ guint length = gst_buffer_list_length(blist);
+ guint i = 0;
+ for(; i < length; ++i)
+ {
+ buffer = gst_buffer_list_get(blist, i);
+ if(buffer)
+ do_send_data (buffer, channel, client);
+ }
return TRUE;
}
gst_rtsp_message_steal_body (message, &data, &size);
buffer = gst_buffer_new ();
- GST_BUFFER_DATA (buffer) = data;
- GST_BUFFER_MALLOCDATA (buffer) = data;
- GST_BUFFER_SIZE (buffer) = size;
+ gst_buffer_insert_memory(buffer, -1, gst_memory_new_wrapped(0, data, size, 0, size, data, g_free));
handled = FALSE;
for (walk = client->streams; walk; walk = g_list_next (walk)) {
struct sockaddr_storage addr;
socklen_t addrlen;
gchar ip[INET6_ADDRSTRLEN];
+ GSocket *socket, *readsocket;
GST_ERROR_OBJECT (client, "Enter accept client...");
/* a new client connected. */
sock = g_io_channel_unix_get_fd (channel);
+ socket = g_socket_new_from_fd(sock, NULL);
GST_INFO_OBJECT (client, "sock fd = %d", sock);
- GST_RTSP_CHECK (gst_rtsp_connection_accept (sock, &conn), accept_failed);
-
- fd = gst_rtsp_connection_get_readfd (conn);
+ GST_RTSP_CHECK (gst_rtsp_connection_accept (socket, &conn, NULL), accept_failed);
+ g_object_unref(socket);
+ readsocket = gst_rtsp_connection_get_read_socket (conn);
+ fd = g_socket_get_fd(readsocket);
if (fd == -1) {
res = GST_RTSP_EINVAL;
goto accept_failed;
return res;
}
- client->cseq++;
- cseqstr = g_string_new ("");
- g_string_append_printf (cseqstr,"%d",client->cseq);
- GST_DEBUG ("CSeq value has been incremented to %d", client->cseq);
- res = gst_rtsp_message_add_header (request, GST_RTSP_HDR_CSEQ, g_string_free (cseqstr, FALSE));
- if (res < 0) {
- GST_ERROR ("Failed to add header");
- return res;
- }
-
switch (method) {
/* Prepare OPTIONS request to send */
}
lines = g_string_new ("");
g_string_append_printf (lines,"rtsp://");
- g_string_append_printf (lines, client->server_ip);
+ g_string_append_printf (lines, "%s", client->server_ip);
g_string_append_printf (lines,"/wfd1.0/streamid=0");
wfd_res = wfdconfig_set_presentation_url(msg4, g_string_free (lines, FALSE), NULL);
if (wfd_res != WFD_OK) {
g_print (" =========== >>>>>>>>>> Received VIDEO pad...\n");
- spad = gst_element_get_pad(GST_ELEMENT(client->srcbin->vparse), "sink");
+ spad = gst_element_get_request_pad(GST_ELEMENT(client->srcbin->vparse), "sink");
if (gst_pad_link(pad, spad) != GST_PAD_LINK_OK) {
GST_ERROR ("Failed to link video demuxer pad & video parser sink pad...\n");
return;
#endif
g_print (" =========== >>>>>>>>>> Received AUDIO pad...\n");
- spad = gst_element_get_pad(GST_ELEMENT(client->srcbin->aqueue), "sink");
+ spad = gst_element_get_request_pad(GST_ELEMENT(client->srcbin->aqueue), "sink");
if (gst_pad_link(pad, spad) != GST_PAD_LINK_OK) {
GST_ERROR ("Failed to link audio demuxer pad & audio parse pad...\n");
return;
GST_INFO_OBJECT (client, "picked xvimagesrc as video source");
g_object_set (G_OBJECT (vcaps), "caps",
- gst_caps_new_simple ("video/x-raw-yuv",
+ gst_caps_new_simple ("video/x-raw",
"width", G_TYPE_INT, client->cMaxWidth,
"height", G_TYPE_INT, client->cMaxHeight,
- "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('S','N','1','2'),
+ "format", G_TYPE_STRING, "SN12",
"framerate", GST_TYPE_FRACTION, 30, 1, NULL), NULL);
if(client->cvCodec == WFD_VIDEO_H264)
srcbin = g_slice_new0 (GstRTSPClientSrcBin);
/* create source bin */
- srcbin->srcbin = gst_bin_new ("srcbin");
+ srcbin->srcbin = GST_BIN_CAST(gst_bin_new ("srcbin"));
if (!srcbin->srcbin) {
GST_ERROR_OBJECT (client, "failed to create source bin...");
goto create_error;
}
#endif
-static void
-keep_alive_response_check (gpointer *userdata)
+static gboolean
+keep_alive_response_check (gpointer userdata)
{
GstRTSPClient *client = (GstRTSPClient *)userdata;
if (!client) {
- return;
+ return TRUE;
}
if (client->keep_alive_flag) {
- return;
+ return FALSE;
}
else {
GST_INFO ("%p: source error notification", client);
g_signal_emit (client, gst_rtsp_client_signals[SIGNAL_ERROR], 0, NULL);
}
+ return TRUE;
}
/*CHecking whether source has got response of any request.
* If yes, keep alive message is sent otherwise error message
* will be displayed.*/
gboolean
-keep_alive_condition(gpointer *userdata)
+keep_alive_condition(gpointer userdata)
{
GstRTSPClient *client;
gboolean res;
GST_DEBUG_CATEGORY_STATIC (rtsp_funnel_debug);
#define GST_CAT_DEFAULT rtsp_funnel_debug
-static const GstElementDetails rtsp_funnel_details =
-GST_ELEMENT_DETAILS ("Farsight Funnel pipe fitting",
- "Generic",
- "N-to-1 pipe fitting",
- "Olivier Crete <olivier.crete@collabora.co.uk>");
-
static GstStaticPadTemplate funnel_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_PAD_SINK,
static void
-_do_init (GType type)
+_do_init (void)
{
- GST_DEBUG_CATEGORY_INIT (rtsp_funnel_debug, "rtspfunnel", 0,
- "rtsp funnel element");
+ GST_DEBUG_CATEGORY_INIT (rtsp_funnel_debug, "rtspfunnel", 0, "rtsp funnel element");
}
-GST_BOILERPLATE_FULL (RTSPFunnel, rtsp_funnel, GstElement, GST_TYPE_ELEMENT,
- _do_init);
-
+G_DEFINE_TYPE_EXTENDED(RTSPFunnel, rtsp_funnel, GST_TYPE_ELEMENT, 0, _do_init());
static GstStateChangeReturn rtsp_funnel_change_state (GstElement * element,
GstStateChange transition);
static GstPad *rtsp_funnel_request_new_pad (GstElement * element,
- GstPadTemplate * templ, const gchar * name);
+ GstPadTemplate * templ, const gchar * name, const GstCaps *caps);
static void rtsp_funnel_release_pad (GstElement * element, GstPad * pad);
-static GstFlowReturn rtsp_funnel_chain (GstPad * pad, GstBuffer * buffer);
-static gboolean rtsp_funnel_event (GstPad * pad, GstEvent * event);
-static gboolean rtsp_funnel_src_event (GstPad * pad, GstEvent * event);
-static GstCaps *rtsp_funnel_getcaps (GstPad * pad);
+static GstFlowReturn rtsp_funnel_chain (GstPad * pad, GstObject *parent, GstBuffer * buffer);
+static gboolean rtsp_funnel_event (GstPad * pad, GstObject *parent, GstEvent * event);
+static gboolean rtsp_funnel_src_event (GstPad * pad, GstObject *parent, GstEvent * event);
+static gboolean rtsp_funnel_query_caps (GstPad * pad, GstObject *parent, GstQuery *query);
typedef struct
static void
rtsp_funnel_base_init (gpointer g_class)
{
- GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
-
- gst_element_class_set_details (gstelement_class, &rtsp_funnel_details);
-
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&funnel_sink_template));
- gst_element_class_add_pad_template (gstelement_class,
- gst_static_pad_template_get (&funnel_src_template));
}
}
}
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ G_OBJECT_CLASS (rtsp_funnel_parent_class)->dispose (object);
}
static void
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
+ gst_element_class_set_static_metadata(gstelement_class, "Farsight Funnel pipe fitting", "Generic", "N-to-1 pipe fitting", "Olivier Crete <olivier.crete@collabora.co.uk>");
+
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&funnel_sink_template));
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&funnel_src_template));
+
gobject_class->dispose = GST_DEBUG_FUNCPTR (rtsp_funnel_dispose);
gstelement_class->request_new_pad =
}
static void
-rtsp_funnel_init (RTSPFunnel * funnel, RTSPFunnelClass * g_class)
+rtsp_funnel_init (RTSPFunnel * funnel)
{
funnel->srcpad = gst_pad_new_from_static_template (&funnel_src_template,
"src");
gst_element_add_pad (GST_ELEMENT (funnel), funnel->srcpad);
}
-
static GstPad *
rtsp_funnel_request_new_pad (GstElement * element, GstPadTemplate * templ,
- const gchar * name)
+ const gchar * name, const GstCaps *caps)
{
GstPad *sinkpad;
RTSPFunnelPadPrivate *priv = g_slice_alloc0 (sizeof (RTSPFunnelPadPrivate));
gst_pad_set_chain_function (sinkpad, GST_DEBUG_FUNCPTR (rtsp_funnel_chain));
gst_pad_set_event_function (sinkpad, GST_DEBUG_FUNCPTR (rtsp_funnel_event));
- gst_pad_set_getcaps_function (sinkpad,
- GST_DEBUG_FUNCPTR (rtsp_funnel_getcaps));
gst_segment_init (&priv->segment, GST_FORMAT_UNDEFINED);
gst_pad_set_element_private (sinkpad, priv);
gst_element_remove_pad (GST_ELEMENT_CAST (funnel), pad);
}
-static GstCaps *
-rtsp_funnel_getcaps (GstPad * pad)
-{
- RTSPFunnel *funnel = RTSP_FUNNEL (gst_pad_get_parent (pad));
- GstCaps *caps;
-
- caps = gst_pad_peer_get_caps (funnel->srcpad);
- if (caps == NULL)
- caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
-
- gst_object_unref (funnel);
-
- return caps;
-}
-
static GstFlowReturn
-rtsp_funnel_chain (GstPad * pad, GstBuffer * buffer)
+rtsp_funnel_chain (GstPad * pad, GstObject *parent, GstBuffer * buffer)
{
GstFlowReturn res;
RTSPFunnel *funnel = RTSP_FUNNEL (gst_pad_get_parent (pad));
if (priv->segment.format == GST_FORMAT_UNDEFINED) {
GST_WARNING_OBJECT (funnel, "Got buffer without segment,"
" setting segment [0,inf[");
- gst_segment_set_newsegment_full (&priv->segment, FALSE, 1.0, 1.0,
- GST_FORMAT_TIME, 0, -1, 0);
+ priv->segment.rate = 1.0;
+ priv->segment.applied_rate = 1.0;
+ priv->segment.format = GST_FORMAT_TIME;
+ priv->segment.start = 0;
+ priv->segment.stop = -1;
+ priv->segment.time = 0;
}
if (GST_CLOCK_TIME_IS_VALID (GST_BUFFER_TIMESTAMP (buffer)))
- gst_segment_set_last_stop (&priv->segment, priv->segment.format,
- GST_BUFFER_TIMESTAMP (buffer));
+ priv->segment.position = GST_BUFFER_TIMESTAMP (buffer);
newts = gst_segment_to_running_time (&priv->segment,
priv->segment.format, GST_BUFFER_TIMESTAMP (buffer));
if (newts != GST_BUFFER_TIMESTAMP (buffer)) {
- buffer = gst_buffer_make_metadata_writable (buffer);
+ buffer = gst_buffer_make_writable (buffer);
GST_BUFFER_TIMESTAMP (buffer) = newts;
}
if (!funnel->has_segment) {
- event = gst_event_new_new_segment_full (FALSE, 1.0, 1.0, GST_FORMAT_TIME,
- 0, -1, 0);
+ GstSegment *segment = gst_segment_new();
+ gst_segment_init(segment, GST_FORMAT_TIME);
+ segment->rate = 1.0;
+ segment->applied_rate = 1.0;
+ segment->start = 0;
+ segment->stop = -1;
+ segment->time = 0;
+ gst_event_new_segment(segment);
funnel->has_segment = TRUE;
}
GST_OBJECT_UNLOCK (funnel);
GST_OBJECT_LOCK (pad);
- padcaps = GST_PAD_CAPS (funnel->srcpad);
+ padcaps = gst_pad_get_current_caps(funnel->srcpad);
GST_OBJECT_UNLOCK (pad);
- if (GST_BUFFER_CAPS (buffer) && GST_BUFFER_CAPS (buffer) != padcaps) {
- if (!gst_pad_set_caps (funnel->srcpad, GST_BUFFER_CAPS (buffer))) {
- res = GST_FLOW_NOT_NEGOTIATED;
- goto out;
- }
- }
-
res = gst_pad_push (funnel->srcpad, buffer);
GST_LOG_OBJECT (funnel, "handled buffer %s", gst_flow_get_name (res));
}
static gboolean
-rtsp_funnel_event (GstPad * pad, GstEvent * event)
+rtsp_funnel_event (GstPad * pad, GstObject *parent, GstEvent * event)
{
RTSPFunnel *funnel = RTSP_FUNNEL (gst_pad_get_parent (pad));
RTSPFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
gboolean res = TRUE;
switch (GST_EVENT_TYPE (event)) {
- case GST_EVENT_NEWSEGMENT:
+ case GST_EVENT_SEGMENT:
{
- gboolean update;
- gdouble rate, arate;
- GstFormat format;
- gint64 start;
- gint64 stop;
- gint64 time;
-
- gst_event_parse_new_segment_full (event, &update, &rate, &arate,
- &format, &start, &stop, &time);
-
-
+ GstSegment *segment = gst_segment_new();
+ gst_segment_init(segment, GST_FORMAT_UNDEFINED);
+ gst_event_parse_segment(event, &segment);
GST_OBJECT_LOCK (funnel);
- gst_segment_set_newsegment_full (&priv->segment, update, rate, arate,
- format, start, stop, time);
+ gst_segment_copy_into(segment, &priv->segment);
GST_OBJECT_UNLOCK (funnel);
+ gst_segment_free(segment);
forward = FALSE;
gst_event_unref (event);
}
static gboolean
-rtsp_funnel_src_event (GstPad * pad, GstEvent * event)
+rtsp_funnel_src_event (GstPad * pad, GstObject *parent, GstEvent * event)
{
GstElement *funnel;
GstIterator *iter;
}
static void
-reset_pad (gpointer data, gpointer user_data)
+reset_pad (const GValue * item, gpointer user_data)
{
- GstPad *pad = data;
+ GstPad *pad = GST_PAD(item);
RTSPFunnelPadPrivate *priv = gst_pad_get_element_private (pad);
GST_OBJECT_LOCK (pad);
break;
}
- ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+ ret = GST_ELEMENT_CLASS (rtsp_funnel_parent_class)->change_state (element, transition);
return ret;
}
};
-#define RAW_VIDEO_CAPS \
- "video/x-raw-yuv; " \
- "video/x-raw-rgb; " \
- "video/x-raw-gray"
+#define RAW_VIDEO_CAPS "video/x-raw"
-#define RAW_AUDIO_CAPS \
- "audio/x-raw-int; " \
- "audio/x-raw-float"
+#define RAW_AUDIO_CAPS "audio/x-raw"
static GstStaticCaps raw_video_caps = GST_STATIC_CAPS (RAW_VIDEO_CAPS);
static GstStaticCaps raw_audio_caps = GST_STATIC_CAPS (RAW_AUDIO_CAPS);
static gboolean
payloader_filter (GstPluginFeature * feature, FilterData * data)
{
- gboolean res;
const gchar *klass;
GstElementFactory *fact;
GList **list = NULL;
list = &data->payload;
if (list) {
- GST_DEBUG ("adding %s", GST_PLUGIN_FEATURE_NAME (fact));
+ GST_DEBUG ("adding %s", GST_OBJECT_NAME (fact));
*list = g_list_prepend (*list, fact);
}
factory->use_gstpay = DEFAULT_USE_GSTPAY;
/* get the feature list using the filter */
- gst_default_registry_feature_filter ((GstPluginFeatureFilter)
+ gst_registry_feature_filter (gst_registry_get(), (GstPluginFeatureFilter)
payloader_filter, FALSE, &data);
/* sort */
factory->demuxers =
padname = gst_pad_get_name (pad);
/* get pad caps first, then call get_caps, then fail */
- if ((caps = GST_PAD_CAPS (pad)))
+ if ((caps = gst_pad_get_current_caps(pad)))
gst_caps_ref (caps);
- else if ((caps = gst_pad_get_caps (pad)) == NULL)
+ else if ((caps = gst_pad_query_caps (pad, NULL)) == NULL)
goto no_caps;
/* check for raw caps */
if (gst_caps_can_intersect (caps, urifact->raw_vcaps)) {
/* we have raw video caps, insert converter */
- convert = gst_element_factory_make ("ffmpegcolorspace", NULL);
+ convert = gst_element_factory_make ("videoconvert", NULL);
} else if (gst_caps_can_intersect (caps, urifact->raw_acaps)) {
/* we have raw audio caps, insert converter */
convert = gst_element_factory_make ("audioconvert", NULL);
/* continue with new pad and caps */
pad = gst_element_get_static_pad (convert, "src");
- if ((caps = GST_PAD_CAPS (pad)))
+ if ((caps = gst_pad_get_current_caps(pad)))
gst_caps_ref (caps);
- else if ((caps = gst_pad_get_caps (pad)) == NULL)
+ else if ((caps = gst_pad_query_caps (pad, NULL)) == NULL)
goto no_caps;
}
} else {
/* get the position */
format = GST_FORMAT_TIME;
- if (!gst_element_query_position (media->pipeline, &format, &position)) {
+ if (!gst_element_query_position (media->pipeline, format, &position)) {
GST_INFO ("position query failed");
position = 0;
}
/* get the duration */
format = GST_FORMAT_TIME;
- if (!gst_element_query_duration (media->pipeline, &format, &duration)) {
+ if (!gst_element_query_duration (media->pipeline, format, &duration)) {
GST_INFO ("duration query failed");
duration = -1;
}
/* try to allocate 2 UDP ports, the RTP port should be an even
* number and the RTCP port should be the next (uneven) port */
again:
- udpsrc0 = gst_element_make_from_uri (GST_URI_SRC, host, NULL);
+ udpsrc0 = gst_element_make_from_uri (GST_URI_SRC, host, NULL, NULL);
if (udpsrc0 == NULL)
goto no_udp_protocol;
g_object_set (G_OBJECT (udpsrc0), "port", tmp_rtp, NULL);
}
#endif
/* allocate port+1 for RTCP now */
- udpsrc1 = gst_element_make_from_uri (GST_URI_SRC, host, NULL);
+ udpsrc1 = gst_element_make_from_uri (GST_URI_SRC, host, NULL, NULL);
if (udpsrc1 == NULL)
goto no_udp_rtcp_protocol;
gchar *capsstr;
GstCaps *newcaps, *oldcaps;
- if ((newcaps = GST_PAD_CAPS (pad)))
+ if ((newcaps = gst_pad_get_current_caps (pad)))
gst_caps_ref (newcaps);
oldcaps = stream->caps;
}
static GstFlowReturn
-handle_new_buffer (GstAppSink * sink, gpointer user_data)
+handle_new_sample (GstAppSink * sink, gpointer user_data)
{
GList *walk;
+ GstSample *sample;
GstBuffer *buffer;
GstRTSPMediaStream *stream;
- buffer = gst_app_sink_pull_buffer (sink);
- if (!buffer)
+ sample = gst_app_sink_pull_sample(sink);
+ if (!sample)
return GST_FLOW_OK;
+ buffer = gst_sample_get_buffer(sample);
+ if(!buffer)
+ {
+ gst_sample_unref(sample);
+ return GST_FLOW_OK;
+ }
+
stream = (GstRTSPMediaStream *) user_data;
for (walk = stream->transports; walk; walk = g_list_next (walk)) {
}
}
gst_buffer_unref (buffer);
-
- return GST_FLOW_OK;
-}
-
-static GstFlowReturn
-handle_new_buffer_list (GstAppSink * sink, gpointer user_data)
-{
- GList *walk;
- GstBufferList *blist;
- GstRTSPMediaStream *stream;
-
- blist = gst_app_sink_pull_buffer_list (sink);
- if (!blist)
- return GST_FLOW_OK;
-
- stream = (GstRTSPMediaStream *) user_data;
-
- for (walk = stream->transports; walk; walk = g_list_next (walk)) {
- GstRTSPMediaTrans *tr = (GstRTSPMediaTrans *) walk->data;
-
- if (GST_ELEMENT_CAST (sink) == stream->appsink[0]) {
- if (tr->send_rtp_list)
- tr->send_rtp_list (blist, tr->transport->port.min,
- tr->user_data);
- } else {
- if (tr->send_rtcp_list)
- tr->send_rtcp_list (blist, tr->transport->port.max,
- tr->user_data);
- }
- }
- gst_buffer_list_unref (blist);
+ gst_sample_unref (sample);
return GST_FLOW_OK;
}
static GstAppSinkCallbacks sink_cb = {
NULL, /* not interested in EOS */
NULL, /* not interested in preroll buffers */
- handle_new_buffer,
- handle_new_buffer_list
+ handle_new_sample,
};
/* prepare the pipeline objects to handle @stream in @media */
stream->appsink[i] = gst_element_factory_make ("appsink", NULL);
g_object_set (stream->appsink[i], "async", FALSE, "sync", FALSE, NULL);
g_object_set (stream->appsink[i], "emit-signals", FALSE, NULL);
- g_object_set (stream->appsink[i], "preroll-queue-len", 1, NULL);
gst_bin_add (GST_BIN_CAST (media->pipeline), stream->appsink[i]);
gst_bin_add (GST_BIN_CAST (media->pipeline), stream->appsrc[i]);
gst_app_sink_set_callbacks (GST_APP_SINK_CAST (stream->appsink[i]),
//g_print ("\n\n\n\n\n++++++++++++++++Generating dot file ++++++++++++++\n\n\n\n");
- GST_DEBUG_BIN_TO_DOT_FILE(media->pipeline, GST_DEBUG_GRAPH_SHOW_ALL, "wfd-error");
+ GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN_CAST(media->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "wfd-error");
gst_message_parse_error (message, &gerror, &debug);
gint timeout;
GTimeVal now;
- g_source_get_current_time ((GSource *) psrc, &now);
+ gint64 time = g_source_get_time((GSource *) psrc);
+ GST_TIME_TO_TIMEVAL(time, now);
timeout = gst_rtsp_session_next_timeout (sess, &now);
GST_INFO ("%p: next timeout: %d", sess, timeout);