summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-13 23:55:56 +0000
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2011-11-13 23:55:56 +0000
commit357d7bdfed98d7ee7f8e63a94b2359a8bf517e13 (patch)
treebe8240279a2f1e09b92281c3c5e82de824245f75 /ext
parent7b80e0773fb6759e8d71a535bb3c6c14106c8e66 (diff)
downloadgstreamer-plugins-bad-357d7bdfed98d7ee7f8e63a94b2359a8bf517e13.tar.gz
Update for GstURIHandler get_protocols() changes
Diffstat (limited to 'ext')
-rw-r--r--ext/libmms/gstmms.c21
-rw-r--r--ext/neon/gstneonhttpsrc.c5
-rw-r--r--ext/resindvd/resindvdbin.c4
-rw-r--r--ext/rtmp/gstrtmpsink.c26
-rw-r--r--ext/rtmp/gstrtmpsrc.c26
5 files changed, 50 insertions, 32 deletions
diff --git a/ext/libmms/gstmms.c b/ext/libmms/gstmms.c
index 0e6c68a08..42831e7bc 100644
--- a/ext/libmms/gstmms.c
+++ b/ext/libmms/gstmms.c
@@ -68,7 +68,7 @@ static gboolean gst_mms_do_seek (GstBaseSrc * src, GstSegment * segment);
static GstFlowReturn gst_mms_create (GstPushSrc * psrc, GstBuffer ** buf);
static gboolean gst_mms_uri_set_uri (GstURIHandler * handler,
- const gchar * uri);
+ const gchar * uri, GError ** error);
#define gst_mms_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstMMS, gst_mms, GST_TYPE_PUSH_SRC,
@@ -476,7 +476,7 @@ gst_mms_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:
gst_mms_uri_set_uri (GST_URI_HANDLER (mmssrc),
- g_value_get_string (value));
+ g_value_get_string (value), NULL);
break;
case PROP_CONNECTION_SPEED:
GST_OBJECT_LOCK (mmssrc);
@@ -528,20 +528,21 @@ gst_mms_uri_get_type (GType type)
return GST_URI_SRC;
}
-static gchar **
+static const gchar *const *
gst_mms_uri_get_protocols (GType type)
{
static const gchar *protocols[] = { "mms", "mmsh", "mmst", "mmsu", NULL };
- return (gchar **) protocols;
+ return protocols;
}
-static const gchar *
+static gchar *
gst_mms_uri_get_uri (GstURIHandler * handler)
{
GstMMS *src = GST_MMS (handler);
- return src->uri_name;
+ /* FIXME: make thread-safe */
+ return g_strdup (src->uri_name);
}
static gchar *
@@ -593,14 +594,18 @@ gst_mms_src_make_valid_uri (const gchar * uri)
}
static gboolean
-gst_mms_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_mms_uri_set_uri (GstURIHandler * handler, const gchar * uri,
+ GError ** error)
{
GstMMS *src = GST_MMS (handler);
gchar *fixed_uri;
fixed_uri = gst_mms_src_make_valid_uri (uri);
- if (!fixed_uri && uri)
+ if (!fixed_uri && uri) {
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
+ "Invalid MMS URI");
return FALSE;
+ }
GST_OBJECT_LOCK (src);
if (src->uri_name)
diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c
index b295f0837..ea0905795 100644
--- a/ext/neon/gstneonhttpsrc.c
+++ b/ext/neon/gstneonhttpsrc.c
@@ -1136,11 +1136,12 @@ gst_neonhttp_src_uri_get_type (void)
return GST_URI_SRC;
}
-static gchar **
+static const gchar *const *
gst_neonhttp_src_uri_get_protocols (void)
{
static const gchar *protocols[] = { "http", "https", NULL };
- return (gchar **) protocols;
+
+ return protocols;
}
static const gchar *
diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c
index 537adadeb..5885b238a 100644
--- a/ext/resindvd/resindvdbin.c
+++ b/ext/resindvd/resindvdbin.c
@@ -170,10 +170,10 @@ rsn_dvdbin_uri_get_type (void)
return GST_URI_SRC;
}
-static gchar **
+static const gchar *const *
rsn_dvdbin_uri_get_protocols (void)
{
- static gchar *protocols[] = { (char *) "dvd", NULL };
+ static const gchar *protocols[] = { "dvd", NULL };
return protocols;
}
diff --git a/ext/rtmp/gstrtmpsink.c b/ext/rtmp/gstrtmpsink.c
index 6137ee5ac..ce29ecf17 100644
--- a/ext/rtmp/gstrtmpsink.c
+++ b/ext/rtmp/gstrtmpsink.c
@@ -251,31 +251,35 @@ gst_rtmp_sink_uri_get_type (GType type)
return GST_URI_SINK;
}
-static gchar **
+static const gchar *const *
gst_rtmp_sink_uri_get_protocols (GType type)
{
- static gchar *protocols[] =
- { (char *) "rtmp", (char *) "rtmpt", (char *) "rtmps", (char *) "rtmpe",
- (char *) "rtmfp", (char *) "rtmpte", (char *) "rtmpts", NULL
- };
+ static const gchar *protocols[] =
+ { "rtmp", "rtmpt", "rtmps", "rtmpe", "rtmfp", "rtmpte", "rtmpts", NULL };
+
return protocols;
}
-static const gchar *
+static gchar *
gst_rtmp_sink_uri_get_uri (GstURIHandler * handler)
{
GstRTMPSink *sink = GST_RTMP_SINK (handler);
- return sink->uri;
+ /* FIXME: make thread-safe */
+ return g_strdup (sink->uri);
}
static gboolean
-gst_rtmp_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_rtmp_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri,
+ GError ** error)
{
GstRTMPSink *sink = GST_RTMP_SINK (handler);
- if (GST_STATE (sink) >= GST_STATE_PAUSED)
+ if (GST_STATE (sink) >= GST_STATE_PAUSED) {
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_STATE,
+ "Changing the URI on rtmpsrc when it is running is not supported");
return FALSE;
+ }
g_free (sink->uri);
sink->uri = NULL;
@@ -290,6 +294,8 @@ gst_rtmp_sink_uri_set_uri (GstURIHandler * handler, const gchar * uri)
!host.av_len || !playpath.av_len) {
GST_ELEMENT_ERROR (sink, RESOURCE, OPEN_WRITE,
("Failed to parse URI %s", uri), (NULL));
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
+ "Could not parse RTMP URI");
return FALSE;
}
sink->uri = g_strdup (uri);
@@ -320,7 +326,7 @@ gst_rtmp_sink_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:
gst_rtmp_sink_uri_set_uri (GST_URI_HANDLER (sink),
- g_value_get_string (value));
+ g_value_get_string (value), NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/ext/rtmp/gstrtmpsrc.c b/ext/rtmp/gstrtmpsrc.c
index 36e74882b..9a30b28c0 100644
--- a/ext/rtmp/gstrtmpsrc.c
+++ b/ext/rtmp/gstrtmpsrc.c
@@ -166,31 +166,35 @@ gst_rtmp_src_uri_get_type (GType type)
return GST_URI_SRC;
}
-static gchar **
+static const gchar *const *
gst_rtmp_src_uri_get_protocols (GType type)
{
- static gchar *protocols[] =
- { (char *) "rtmp", (char *) "rtmpt", (char *) "rtmps", (char *) "rtmpe",
- (char *) "rtmfp", (char *) "rtmpte", (char *) "rtmpts", NULL
- };
+ static const gchar *protocols[] =
+ { "rtmp", "rtmpt", "rtmps", "rtmpe", "rtmfp", "rtmpte", "rtmpts", NULL };
+
return protocols;
}
-static const gchar *
+static gchar *
gst_rtmp_src_uri_get_uri (GstURIHandler * handler)
{
GstRTMPSrc *src = GST_RTMP_SRC (handler);
- return src->uri;
+ /* FIXME: make thread-safe */
+ return g_strdup (src->uri);
}
static gboolean
-gst_rtmp_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
+gst_rtmp_src_uri_set_uri (GstURIHandler * handler, const gchar * uri,
+ GError ** error)
{
GstRTMPSrc *src = GST_RTMP_SRC (handler);
- if (GST_STATE (src) >= GST_STATE_PAUSED)
+ if (GST_STATE (src) >= GST_STATE_PAUSED) {
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_STATE,
+ "Changing the URI on rtmpsrc when it is running is not supported");
return FALSE;
+ }
g_free (src->uri);
src->uri = NULL;
@@ -204,6 +208,8 @@ gst_rtmp_src_uri_set_uri (GstURIHandler * handler, const gchar * uri)
if (!RTMP_ParseURL (uri, &protocol, &host, &port, &playpath, &app) ||
!host.av_len || !playpath.av_len) {
GST_ERROR_OBJECT (src, "Failed to parse URI %s", uri);
+ g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_URI,
+ "Could not parse RTMP URI");
return FALSE;
}
src->uri = g_strdup (uri);
@@ -236,7 +242,7 @@ gst_rtmp_src_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_LOCATION:{
gst_rtmp_src_uri_set_uri (GST_URI_HANDLER (src),
- g_value_get_string (value));
+ g_value_get_string (value), NULL);
break;
}
default: