Commit 79feb7f6 authored by Philippe Normand's avatar Philippe Normand Committed by Olivier Crête

gst: Remove GStreamer 0.10 support

The meson build already required 1.x so this has been dead code for a while now.
parent ff725d92
...@@ -55,17 +55,10 @@ plugin_init (GstPlugin *plugin) ...@@ -55,17 +55,10 @@ plugin_init (GstPlugin *plugin)
return TRUE; return TRUE;
} }
#if GST_CHECK_VERSION (1,0,0)
#define PLUGIN_NAME nice
#else
#define PLUGIN_NAME "nice"
#endif
GST_PLUGIN_DEFINE ( GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR, GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
PLUGIN_NAME, nice,
"Interactive UDP connectivity establishment", "Interactive UDP connectivity establishment",
plugin_init, VERSION, "LGPL", PACKAGE_NAME, plugin_init, VERSION, "LGPL", PACKAGE_NAME,
"https://nice.freedesktop.org/"); "https://nice.freedesktop.org/");
...@@ -49,12 +49,10 @@ static GstFlowReturn ...@@ -49,12 +49,10 @@ static GstFlowReturn
gst_nice_sink_render ( gst_nice_sink_render (
GstBaseSink *basesink, GstBaseSink *basesink,
GstBuffer *buffer); GstBuffer *buffer);
#if GST_CHECK_VERSION (1,0,0)
static GstFlowReturn static GstFlowReturn
gst_nice_sink_render_list ( gst_nice_sink_render_list (
GstBaseSink *basesink, GstBaseSink *basesink,
GstBufferList *buffer_list); GstBufferList *buffer_list);
#endif
static gboolean static gboolean
gst_nice_sink_unlock (GstBaseSink *basesink); gst_nice_sink_unlock (GstBaseSink *basesink);
...@@ -85,10 +83,8 @@ gst_nice_sink_get_property ( ...@@ -85,10 +83,8 @@ gst_nice_sink_get_property (
static void static void
gst_nice_sink_dispose (GObject *object); gst_nice_sink_dispose (GObject *object);
#if GST_CHECK_VERSION (1,0,0)
static void static void
gst_nice_sink_finalize (GObject *object); gst_nice_sink_finalize (GObject *object);
#endif
static GstStateChangeReturn static GstStateChangeReturn
gst_nice_sink_change_state ( gst_nice_sink_change_state (
...@@ -123,9 +119,7 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass) ...@@ -123,9 +119,7 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
gstbasesink_class = (GstBaseSinkClass *) klass; gstbasesink_class = (GstBaseSinkClass *) klass;
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_nice_sink_render); 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); 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 = GST_DEBUG_FUNCPTR (gst_nice_sink_unlock);
gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_nice_sink_unlock_stop); gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_nice_sink_unlock_stop);
...@@ -133,20 +127,14 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass) ...@@ -133,20 +127,14 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
gobject_class->set_property = gst_nice_sink_set_property; gobject_class->set_property = gst_nice_sink_set_property;
gobject_class->get_property = gst_nice_sink_get_property; gobject_class->get_property = gst_nice_sink_get_property;
gobject_class->dispose = gst_nice_sink_dispose; gobject_class->dispose = gst_nice_sink_dispose;
#if GST_CHECK_VERSION (1,0,0)
gobject_class->finalize = gst_nice_sink_finalize; gobject_class->finalize = gst_nice_sink_finalize;
#endif
gstelement_class = (GstElementClass *) klass; gstelement_class = (GstElementClass *) klass;
gstelement_class->change_state = gst_nice_sink_change_state; gstelement_class->change_state = gst_nice_sink_change_state;
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_nice_sink_sink_template)); gst_static_pad_template_get (&gst_nice_sink_sink_template));
#if GST_CHECK_VERSION (1,0,0)
gst_element_class_set_metadata (gstelement_class, gst_element_class_set_metadata (gstelement_class,
#else
gst_element_class_set_details_simple (gstelement_class,
#endif
"ICE sink", "ICE sink",
"Sink", "Sink",
"Interactive UDP connectivity establishment", "Interactive UDP connectivity establishment",
...@@ -185,13 +173,10 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass) ...@@ -185,13 +173,10 @@ gst_nice_sink_class_init (GstNiceSinkClass *klass)
static void static void
gst_nice_sink_init (GstNiceSink *sink) gst_nice_sink_init (GstNiceSink *sink)
{ {
#if GST_CHECK_VERSION (1,0,0)
guint max_mem; guint max_mem;
#endif
g_cond_init (&sink->writable_cond); g_cond_init (&sink->writable_cond);
#if GST_CHECK_VERSION (1,0,0)
/* pre-allocate OutputVector, MapInfo and OutputMessage arrays /* pre-allocate OutputVector, MapInfo and OutputMessage arrays
* for use in the render and render_list functions */ * for use in the render and render_list functions */
max_mem = gst_buffer_get_max_memory (); max_mem = gst_buffer_get_max_memory ();
...@@ -204,7 +189,6 @@ gst_nice_sink_init (GstNiceSink *sink) ...@@ -204,7 +189,6 @@ gst_nice_sink_init (GstNiceSink *sink)
sink->n_messages = 1; sink->n_messages = 1;
sink->messages = g_new (NiceOutputMessage, sink->n_messages); sink->messages = g_new (NiceOutputMessage, sink->n_messages);
#endif
#if GST_CHECK_VERSION (1,12,0) #if GST_CHECK_VERSION (1,12,0)
gst_base_sink_set_drop_out_of_segment (GST_BASE_SINK (sink), FALSE); 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, ...@@ -222,7 +206,6 @@ _reliable_transport_writable (NiceAgent *agent, guint stream_id,
GST_OBJECT_UNLOCK (sink); GST_OBJECT_UNLOCK (sink);
} }
#if GST_CHECK_VERSION (1,0,0)
static gsize static gsize
fill_vectors (GOutputVector * vecs, GstMapInfo * maps, guint n, GstBuffer * buf) fill_vectors (GOutputVector * vecs, GstMapInfo * maps, guint n, GstBuffer * buf)
{ {
...@@ -319,14 +302,12 @@ gst_nice_sink_render_buffers (GstNiceSink * sink, GstBuffer ** buffers, ...@@ -319,14 +302,12 @@ gst_nice_sink_render_buffers (GstNiceSink * sink, GstBuffer ** buffers,
return flow_ret; return flow_ret;
} }
#endif
static GstFlowReturn static GstFlowReturn
gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer) gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
{ {
GstNiceSink *nicesink = GST_NICE_SINK (basesink); GstNiceSink *nicesink = GST_NICE_SINK (basesink);
GstFlowReturn flow_ret = GST_FLOW_OK; GstFlowReturn flow_ret = GST_FLOW_OK;
#if GST_CHECK_VERSION (1,0,0)
guint8 n_mem; guint8 n_mem;
n_mem = gst_buffer_n_memory (buffer); n_mem = gst_buffer_n_memory (buffer);
...@@ -336,36 +317,9 @@ gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer) ...@@ -336,36 +317,9 @@ gst_nice_sink_render (GstBaseSink *basesink, GstBuffer *buffer)
n_mem); 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; return flow_ret;
} }
#if GST_CHECK_VERSION (1,0,0)
static GstFlowReturn static GstFlowReturn
gst_nice_sink_render_list (GstBaseSink *basesink, GstBufferList *buffer_list) gst_nice_sink_render_list (GstBaseSink *basesink, GstBufferList *buffer_list)
{ {
...@@ -401,7 +355,6 @@ no_data: ...@@ -401,7 +355,6 @@ no_data:
return flow_ret; return flow_ret;
} }
#endif
static gboolean gst_nice_sink_unlock (GstBaseSink *basesink) static gboolean gst_nice_sink_unlock (GstBaseSink *basesink)
{ {
...@@ -441,7 +394,6 @@ gst_nice_sink_dispose (GObject *object) ...@@ -441,7 +394,6 @@ gst_nice_sink_dispose (GObject *object)
G_OBJECT_CLASS (gst_nice_sink_parent_class)->dispose (object); G_OBJECT_CLASS (gst_nice_sink_parent_class)->dispose (object);
} }
#if GST_CHECK_VERSION (1,0,0)
static void static void
gst_nice_sink_finalize (GObject *object) gst_nice_sink_finalize (GObject *object)
{ {
...@@ -459,7 +411,6 @@ 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); G_OBJECT_CLASS (gst_nice_sink_parent_class)->finalize (object);
} }
#endif
static void static void
gst_nice_sink_set_property ( gst_nice_sink_set_property (
......
...@@ -70,7 +70,6 @@ struct _GstNiceSink ...@@ -70,7 +70,6 @@ struct _GstNiceSink
gulong writable_id; gulong writable_id;
gboolean flushing; gboolean flushing;
#if GST_CHECK_VERSION (1,0,0)
/* pre-allocated scrap space for render function */ /* pre-allocated scrap space for render function */
GOutputVector *vecs; GOutputVector *vecs;
guint n_vecs; guint n_vecs;
...@@ -78,7 +77,6 @@ struct _GstNiceSink ...@@ -78,7 +77,6 @@ struct _GstNiceSink
guint n_maps; guint n_maps;
NiceOutputMessage *messages; NiceOutputMessage *messages;
guint n_messages; guint n_messages;
#endif
}; };
typedef struct _GstNiceSinkClass GstNiceSinkClass; typedef struct _GstNiceSinkClass GstNiceSinkClass;
......
...@@ -129,11 +129,7 @@ gst_nice_src_class_init (GstNiceSrcClass *klass) ...@@ -129,11 +129,7 @@ gst_nice_src_class_init (GstNiceSrcClass *klass)
gst_element_class_add_pad_template (gstelement_class, gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_nice_src_src_template)); gst_static_pad_template_get (&gst_nice_src_src_template));
#if GST_CHECK_VERSION (1,0,0)
gst_element_class_set_metadata (gstelement_class, gst_element_class_set_metadata (gstelement_class,
#else
gst_element_class_set_details_simple (gstelement_class,
#endif
"ICE source", "ICE source",
"Source", "Source",
"Interactive UDP connectivity establishment", "Interactive UDP connectivity establishment",
...@@ -198,13 +194,8 @@ gst_nice_src_read_callback (NiceAgent *agent, ...@@ -198,13 +194,8 @@ gst_nice_src_read_callback (NiceAgent *agent,
GST_LOG_OBJECT (agent, "Got buffer, getting out of the main loop"); 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); buffer = gst_buffer_new_allocate (NULL, len, NULL);
gst_buffer_fill (buffer, 0, buf, len); 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); GST_OBJECT_LOCK (nicesrc);
g_queue_push_tail (nicesrc->outbufs, buffer); g_queue_push_tail (nicesrc->outbufs, buffer);
g_main_loop_quit (nicesrc->mainloop); g_main_loop_quit (nicesrc->mainloop);
...@@ -280,11 +271,7 @@ gst_nice_src_create ( ...@@ -280,11 +271,7 @@ gst_nice_src_create (
GST_OBJECT_LOCK (basesrc); GST_OBJECT_LOCK (basesrc);
if (nicesrc->unlocked) { if (nicesrc->unlocked) {
GST_OBJECT_UNLOCK (basesrc); GST_OBJECT_UNLOCK (basesrc);
#if GST_CHECK_VERSION (1,0,0)
return GST_FLOW_FLUSHING; return GST_FLOW_FLUSHING;
#else
return GST_FLOW_WRONG_STATE;
#endif
} }
if (g_queue_is_empty (nicesrc->outbufs)) { if (g_queue_is_empty (nicesrc->outbufs)) {
GST_OBJECT_UNLOCK (basesrc); GST_OBJECT_UNLOCK (basesrc);
...@@ -300,11 +287,7 @@ gst_nice_src_create ( ...@@ -300,11 +287,7 @@ gst_nice_src_create (
return GST_FLOW_OK; return GST_FLOW_OK;
} else { } else {
GST_LOG_OBJECT (nicesrc, "Got interrupting, returning wrong-state"); GST_LOG_OBJECT (nicesrc, "Got interrupting, returning wrong-state");
#if GST_CHECK_VERSION (1,0,0)
return GST_FLOW_FLUSHING; return GST_FLOW_FLUSHING;
#else
return GST_FLOW_WRONG_STATE;
#endif
} }
} }
...@@ -466,5 +449,3 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition) ...@@ -466,5 +449,3 @@ gst_nice_src_change_state (GstElement * element, GstStateChange transition)
return ret; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment