summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Normand <philn@igalia.com>2022-11-08 13:21:58 +0000
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2023-01-06 18:05:41 +0000
commit79feb7f60b282b479bafc1a4ff4d92793d6ef11e (patch)
treecede31d6b4052caea134fda9fe55b8d557a02ffb
parentff725d928c0f357ab015ed3756fd4a6508ea356c (diff)
downloadlibnice-79feb7f60b282b479bafc1a4ff4d92793d6ef11e.tar.gz
gst: Remove GStreamer 0.10 support
The meson build already required 1.x so this has been dead code for a while now.
-rw-r--r--gst/gstnice.c9
-rw-r--r--gst/gstnicesink.c49
-rw-r--r--gst/gstnicesink.h2
-rw-r--r--gst/gstnicesrc.c19
4 files changed, 1 insertions, 78 deletions
diff --git a/gst/gstnice.c b/gst/gstnice.c
index 6fdb0e9..b6f958f 100644
--- a/gst/gstnice.c
+++ b/gst/gstnice.c
@@ -55,17 +55,10 @@ plugin_init (GstPlugin *plugin)
return TRUE;
}
-#if GST_CHECK_VERSION (1,0,0)
-#define PLUGIN_NAME nice
-#else
-#define PLUGIN_NAME "nice"
-#endif
-
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
- PLUGIN_NAME,
+ nice,
"Interactive UDP connectivity establishment",
plugin_init, VERSION, "LGPL", PACKAGE_NAME,
"https://nice.freedesktop.org/");
-
diff --git a/gst/gstnicesink.c b/gst/gstnicesink.c
index ab71358..53bf5d1 100644
--- a/gst/gstnicesink.c
+++ b/gst/gstnicesink.c
@@ -49,12 +49,10 @@ static GstFlowReturn
gst_nice_sink_render (
GstBaseSink *basesink,
GstBuffer *buffer);
-#if GST_CHECK_VERSION (1,0,0)
static GstFlowReturn
gst_nice_sink_render_list (
GstBaseSink *basesink,
GstBufferList *buffer_list);
-#endif
static gboolean
gst_nice_sink_unlock (GstBaseSink *basesink);
@@ -85,10 +83,8 @@ gst_nice_sink_get_property (
static void
gst_nice_sink_dispose (GObject *object);
-#if GST_CHECK_VERSION (1,0,0)
static void
gst_nice_sink_finalize (GObject *object);
-#endif
static GstStateChangeReturn
gst_nice_sink_change_state (
@@ -123,9 +119,7 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
gstbasesink_class = (GstBaseSinkClass *) klass;
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_nice_sink_render);
-#if GST_CHECK_VERSION (1,0,0)
gstbasesink_class->render_list = GST_DEBUG_FUNCPTR (gst_nice_sink_render_list);
-#endif
gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_nice_sink_unlock);
gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_nice_sink_unlock_stop);
@@ -133,20 +127,14 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
gobject_class->set_property = gst_nice_sink_set_property;
gobject_class->get_property = gst_nice_sink_get_property;
gobject_class->dispose = gst_nice_sink_dispose;
-#if GST_CHECK_VERSION (1,0,0)
gobject_class->finalize = gst_nice_sink_finalize;
-#endif
gstelement_class = (GstElementClass *) klass;
gstelement_class->change_state = gst_nice_sink_change_state;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_nice_sink_sink_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 sink",
"Sink",
"Interactive UDP connectivity establishment",
@@ -185,13 +173,10 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
static void
gst_nice_sink_init (GstNiceSink *sink)
{
-#if GST_CHECK_VERSION (1,0,0)
guint max_mem;
-#endif
g_cond_init (&sink->writable_cond);
-#if GST_CHECK_VERSION (1,0,0)
/* pre-allocate OutputVector, MapInfo and OutputMessage arrays
* for use in the render and render_list functions */
max_mem = gst_buffer_get_max_memory ();
@@ -204,7 +189,6 @@ gst_nice_sink_init (GstNiceSink *sink)
sink->n_messages = 1;
sink->messages = g_new (NiceOutputMessage, sink->n_messages);
-#endif
#if GST_CHECK_VERSION (1,12,0)
gst_base_sink_set_drop_out_of_segment (GST_BASE_SINK (sink), FALSE);
@@ -222,7 +206,6 @@ _reliable_transport_writable (NiceAgent *agent, guint stream_id,
GST_OBJECT_UNLOCK (sink);
}
-#if GST_CHECK_VERSION (1,0,0)
static gsize
fill_vectors (GOutputVector * vecs, GstMapInfo * maps, guint n, GstBuffer * buf)
{
@@ -319,14 +302,12 @@ gst_nice_sink_render_buffers (GstNiceSink * sink, GstBuffer ** buffers,
return flow_ret;
}
-#endif
static GstFlowReturn
gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
{
GstNiceSink *nicesink = GST_NICE_SINK (basesink);
GstFlowReturn flow_ret = GST_FLOW_OK;
-#if GST_CHECK_VERSION (1,0,0)
guint8 n_mem;
n_mem = gst_buffer_n_memory (buffer);
@@ -336,36 +317,9 @@ gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
n_mem);
}
-#else
- guint written = 0;
- gint ret;
- gchar *data = NULL;
- guint size = 0;
-
- data = (gchar *) GST_BUFFER_DATA (buffer);
- size = GST_BUFFER_SIZE (buffer);
-
- GST_OBJECT_LOCK (nicesink);
- do {
- ret = nice_agent_send (nicesink->agent, nicesink->stream_id,
- nicesink->component_id, size - written, data + written);
- if (ret > 0)
- written += ret;
-
- if (nicesink->reliable && written < size)
- g_cond_wait (&nicesink->writable_cond, GST_OBJECT_GET_LOCK (nicesink));
- if (nicesink->flushing) {
- flow_ret = GST_FLOW_WRONG_STATE;
- break;
- }
- } while (nicesink->reliable && written < size);
- GST_OBJECT_UNLOCK (nicesink);
-
-#endif
return flow_ret;
}
-#if GST_CHECK_VERSION (1,0,0)
static GstFlowReturn
gst_nice_sink_render_list (GstBaseSink *basesink, GstBufferList *buffer_list)
{
@@ -401,7 +355,6 @@ no_data:
return flow_ret;
}
-#endif
static gboolean gst_nice_sink_unlock (GstBaseSink *basesink)
{
@@ -441,7 +394,6 @@ gst_nice_sink_dispose (GObject *object)
G_OBJECT_CLASS (gst_nice_sink_parent_class)->dispose (object);
}
-#if GST_CHECK_VERSION (1,0,0)
static void
gst_nice_sink_finalize (GObject *object)
{
@@ -459,7 +411,6 @@ gst_nice_sink_finalize (GObject *object)
G_OBJECT_CLASS (gst_nice_sink_parent_class)->finalize (object);
}
-#endif
static void
gst_nice_sink_set_property (
diff --git a/gst/gstnicesink.h b/gst/gstnicesink.h
index 3c8edbb..05a0e1f 100644
--- a/gst/gstnicesink.h
+++ b/gst/gstnicesink.h
@@ -70,7 +70,6 @@ struct _GstNiceSink
gulong writable_id;
gboolean flushing;
-#if GST_CHECK_VERSION (1,0,0)
/* pre-allocated scrap space for render function */
GOutputVector *vecs;
guint n_vecs;
@@ -78,7 +77,6 @@ struct _GstNiceSink
guint n_maps;
NiceOutputMessage *messages;
guint n_messages;
-#endif
};
typedef struct _GstNiceSinkClass GstNiceSinkClass;
diff --git a/gst/gstnicesrc.c b/gst/gstnicesrc.c
index 424f449..9aa3298 100644
--- a/gst/gstnicesrc.c
+++ b/gst/gstnicesrc.c
@@ -129,11 +129,7 @@ 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",
@@ -198,13 +194,8 @@ 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
GST_OBJECT_LOCK (nicesrc);
g_queue_push_tail (nicesrc->outbufs, buffer);
g_main_loop_quit (nicesrc->mainloop);
@@ -280,11 +271,7 @@ 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
}
if (g_queue_is_empty (nicesrc->outbufs)) {
GST_OBJECT_UNLOCK (basesrc);
@@ -300,11 +287,7 @@ 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
}
}
@@ -466,5 +449,3 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition)
return ret;
}
-
-