summaryrefslogtreecommitdiff
path: root/gst/gstnicesrc.c
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2012-09-13 21:26:29 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2012-09-14 12:47:13 -0400
commit0e9dcfae9440b7e5795f7526eebc3f39e5407d48 (patch)
treef3d70445ec9af107fe48bdde68927b8700b5f551 /gst/gstnicesrc.c
parent322e89addacb8b635f815e79047711c11d3ccc9e (diff)
downloadlibnice-0e9dcfae9440b7e5795f7526eebc3f39e5407d48.tar.gz
Compile the plugin for both GStreamer 0.10 and 1.0
Revert this patch to drop GStreamer 0.10 support
Diffstat (limited to 'gst/gstnicesrc.c')
-rw-r--r--gst/gstnicesrc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c
index f264d28..ac47e91 100644
--- a/gst/gstnicesrc.c
+++ b/gst/gstnicesrc.c
@@ -129,7 +129,11 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_nice_src_src_template));
+#if GST_CHECK_VERSION (1,0,0)
gst_element_class_set_metadata (gstelement_class,
+#else
+ gst_element_class_set_details_simple (gstelement_class,
+#endif
"ICE source",
"Source",
"Interactive UDP connectivity establishment",
@@ -194,8 +198,13 @@ gst_nice_src_read_callback (NiceAgent *agent,
GST_LOG_OBJECT (agent, "Got buffer, getting out of the main loop");
+#if GST_CHECK_VERSION (1,0,0)
buffer = gst_buffer_new_allocate (NULL, len, NULL);
gst_buffer_fill (buffer, 0, buf, len);
+#else
+ buffer = gst_buffer_new_and_alloc (len);
+ memcpy (GST_BUFFER_DATA (buffer), buf, len);
+#endif
g_queue_push_tail (nicesrc->outbufs, buffer);
g_main_loop_quit (nicesrc->mainloop);
@@ -270,7 +279,11 @@ gst_nice_src_create (
GST_OBJECT_LOCK (basesrc);
if (nicesrc->unlocked) {
GST_OBJECT_UNLOCK (basesrc);
+#if GST_CHECK_VERSION (1,0,0)
return GST_FLOW_FLUSHING;
+#else
+ return GST_FLOW_WRONG_STATE;
+#endif
}
GST_OBJECT_UNLOCK (basesrc);
@@ -283,7 +296,11 @@ gst_nice_src_create (
return GST_FLOW_OK;
} else {
GST_LOG_OBJECT (nicesrc, "Got interrupting, returning wrong-state");
+#if GST_CHECK_VERSION (1,0,0)
return GST_FLOW_FLUSHING;
+#else
+ return GST_FLOW_WRONG_STATE;
+#endif
}
}