diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2011-05-17 11:20:05 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2011-05-17 11:21:41 +0200 |
commit | 3d2127f865039f53fdff22f49d3cb1bfdec48858 (patch) | |
tree | a91c5daf5acbf39962390e41c5327d7f4c6d3075 /plugins | |
parent | d0f34fe6b2b97af9d63d60115d8c5e9fe02d9dba (diff) |
Revert "query: allow _make_writable on query handlers"
This reverts commit cf4fbc005c5c530c2a509a943a05b91d6c9af3fb.
This change did not improve the situation for bindings because
queries are usually created, then directly passed to a function
and not stored elsewhere, and the writability problem with
miniobjects usually happens with buffers or caps instead.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/elements/gstfdsink.c | 15 | ||||
-rw-r--r-- | plugins/elements/gstfdsrc.c | 8 | ||||
-rw-r--r-- | plugins/elements/gstfilesink.c | 14 | ||||
-rw-r--r-- | plugins/elements/gstfilesrc.c | 8 | ||||
-rw-r--r-- | plugins/elements/gstinputselector.c | 10 | ||||
-rw-r--r-- | plugins/elements/gstmultiqueue.c | 2 | ||||
-rw-r--r-- | plugins/elements/gstqueue.c | 14 | ||||
-rw-r--r-- | plugins/elements/gstqueue2.c | 26 | ||||
-rw-r--r-- | plugins/elements/gsttypefindelement.c | 13 |
9 files changed, 54 insertions, 56 deletions
diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index 22a326934..f5d3584fa 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -106,7 +106,7 @@ static void gst_fd_sink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_fd_sink_dispose (GObject * obj); -static gboolean gst_fd_sink_query (GstPad * pad, GstQuery ** query); +static gboolean gst_fd_sink_query (GstPad * pad, GstQuery * query); static GstFlowReturn gst_fd_sink_render (GstBaseSink * sink, GstBuffer * buffer); static gboolean gst_fd_sink_start (GstBaseSink * basesink); @@ -179,32 +179,31 @@ gst_fd_sink_dispose (GObject * obj) } static gboolean -gst_fd_sink_query (GstPad * pad, GstQuery ** query) +gst_fd_sink_query (GstPad * pad, GstQuery * query) { GstFdSink *fdsink; GstFormat format; fdsink = GST_FD_SINK (GST_PAD_PARENT (pad)); - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: - gst_query_parse_position (*query, &format, NULL); + gst_query_parse_position (query, &format, NULL); switch (format) { case GST_FORMAT_DEFAULT: case GST_FORMAT_BYTES: - gst_query_set_position (*query, GST_FORMAT_BYTES, - fdsink->current_pos); + gst_query_set_position (query, GST_FORMAT_BYTES, fdsink->current_pos); return TRUE; default: return FALSE; } case GST_QUERY_FORMATS: - gst_query_set_formats (*query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES); + gst_query_set_formats (query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES); return TRUE; case GST_QUERY_URI: - gst_query_set_uri (*query, fdsink->uri); + gst_query_set_uri (query, fdsink->uri); return TRUE; default: diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 8496b10d1..9f297ff66 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -132,7 +132,7 @@ static gboolean gst_fd_src_unlock_stop (GstBaseSrc * bsrc); static gboolean gst_fd_src_is_seekable (GstBaseSrc * bsrc); static gboolean gst_fd_src_get_size (GstBaseSrc * src, guint64 * size); static gboolean gst_fd_src_do_seek (GstBaseSrc * src, GstSegment * segment); -static gboolean gst_fd_src_query (GstBaseSrc * src, GstQuery ** query); +static gboolean gst_fd_src_query (GstBaseSrc * src, GstQuery * query); static GstFlowReturn gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf); @@ -507,14 +507,14 @@ read_error: } static gboolean -gst_fd_src_query (GstBaseSrc * basesrc, GstQuery ** query) +gst_fd_src_query (GstBaseSrc * basesrc, GstQuery * query) { gboolean ret = FALSE; GstFdSrc *src = GST_FD_SRC (basesrc); - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_URI: - gst_query_set_uri (*query, src->uri); + gst_query_set_uri (query, src->uri); ret = TRUE; break; default: diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 4773ac3a7..af31b2556 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -168,7 +168,7 @@ static gboolean gst_file_sink_do_seek (GstFileSink * filesink, static gboolean gst_file_sink_get_current_offset (GstFileSink * filesink, guint64 * p_pos); -static gboolean gst_file_sink_query (GstPad * pad, GstQuery ** query); +static gboolean gst_file_sink_query (GstPad * pad, GstQuery * query); static void gst_file_sink_uri_handler_init (gpointer g_iface, gpointer iface_data); @@ -449,31 +449,31 @@ close_failed: } static gboolean -gst_file_sink_query (GstPad * pad, GstQuery ** query) +gst_file_sink_query (GstPad * pad, GstQuery * query) { GstFileSink *self; GstFormat format; self = GST_FILE_SINK (GST_PAD_PARENT (pad)); - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: - gst_query_parse_position (*query, &format, NULL); + gst_query_parse_position (query, &format, NULL); switch (format) { case GST_FORMAT_DEFAULT: case GST_FORMAT_BYTES: - gst_query_set_position (*query, GST_FORMAT_BYTES, self->current_pos); + gst_query_set_position (query, GST_FORMAT_BYTES, self->current_pos); return TRUE; default: return FALSE; } case GST_QUERY_FORMATS: - gst_query_set_formats (*query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES); + gst_query_set_formats (query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES); return TRUE; case GST_QUERY_URI: - gst_query_set_uri (*query, self->uri); + gst_query_set_uri (query, self->uri); return TRUE; default: diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index c10307f02..1a65a14be 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -200,7 +200,7 @@ static gboolean gst_file_src_is_seekable (GstBaseSrc * src); static gboolean gst_file_src_get_size (GstBaseSrc * src, guint64 * size); static GstFlowReturn gst_file_src_create (GstBaseSrc * src, guint64 offset, guint length, GstBuffer ** buffer); -static gboolean gst_file_src_query (GstBaseSrc * src, GstQuery ** query); +static gboolean gst_file_src_query (GstBaseSrc * src, GstQuery * query); static void gst_file_src_uri_handler_init (gpointer g_iface, gpointer iface_data); @@ -893,14 +893,14 @@ gst_file_src_create (GstBaseSrc * basesrc, guint64 offset, guint length, } static gboolean -gst_file_src_query (GstBaseSrc * basesrc, GstQuery ** query) +gst_file_src_query (GstBaseSrc * basesrc, GstQuery * query) { gboolean ret = FALSE; GstFileSrc *src = GST_FILE_SRC (basesrc); - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_URI: - gst_query_set_uri (*query, src->uri); + gst_query_set_uri (query, src->uri); ret = TRUE; break; default: diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index 9a3d6ec9e..4ab10453d 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -779,7 +779,7 @@ static GstStateChangeReturn gst_input_selector_change_state (GstElement * static GstCaps *gst_input_selector_getcaps (GstPad * pad, GstCaps * filter); static gboolean gst_input_selector_event (GstPad * pad, GstEvent * event); -static gboolean gst_input_selector_query (GstPad * pad, GstQuery ** query); +static gboolean gst_input_selector_query (GstPad * pad, GstQuery * query); static gint64 gst_input_selector_block (GstInputSelector * self); static void gst_input_selector_switch (GstInputSelector * self, GstPad * pad, gint64 stop_time, gint64 start_time); @@ -1229,7 +1229,7 @@ gst_input_selector_event (GstPad * pad, GstEvent * event) /* query on the srcpad. We override this function because by default it will * only forward the query to one random sinkpad */ static gboolean -gst_input_selector_query (GstPad * pad, GstQuery ** query) +gst_input_selector_query (GstPad * pad, GstQuery * query) { gboolean res = TRUE; GstInputSelector *sel; @@ -1241,7 +1241,7 @@ gst_input_selector_query (GstPad * pad, GstQuery ** query) otherpad = gst_input_selector_get_linked_pad (sel, pad, TRUE); - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_LATENCY: { GList *walk; @@ -1269,7 +1269,7 @@ gst_input_selector_query (GstPad * pad, GstQuery ** query) /* one query succeeded, we succeed too */ res = TRUE; - gst_query_parse_latency (*query, &live, &min, &max); + gst_query_parse_latency (query, &live, &min, &max); GST_DEBUG_OBJECT (sinkpad, "peer latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT @@ -1289,7 +1289,7 @@ gst_input_selector_query (GstPad * pad, GstQuery ** query) } GST_INPUT_SELECTOR_UNLOCK (sel); if (res) { - gst_query_set_latency (*query, reslive, resmin, resmax); + gst_query_set_latency (query, reslive, resmin, resmax); GST_DEBUG_OBJECT (sel, "total latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 233225db9..fae88c9ac 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1582,7 +1582,7 @@ gst_multi_queue_src_event (GstPad * pad, GstEvent * event) } static gboolean -gst_multi_queue_src_query (GstPad * pad, GstQuery ** query) +gst_multi_queue_src_query (GstPad * pad, GstQuery * query) { GstSingleQueue *sq = gst_pad_get_element_private (pad); GstPad *peerpad; diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 6cd0024dd..7dc81395b 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -199,7 +199,7 @@ static void gst_queue_loop (GstPad * pad); static gboolean gst_queue_handle_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_queue_handle_src_event (GstPad * pad, GstEvent * event); -static gboolean gst_queue_handle_src_query (GstPad * pad, GstQuery ** query); +static gboolean gst_queue_handle_src_query (GstPad * pad, GstQuery * query); static gboolean gst_queue_acceptcaps (GstPad * pad, GstCaps * caps); static GstCaps *gst_queue_getcaps (GstPad * pad, GstCaps * filter); @@ -1270,7 +1270,7 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event) } static gboolean -gst_queue_handle_src_query (GstPad * pad, GstQuery ** query) +gst_queue_handle_src_query (GstPad * pad, GstQuery * query) { GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad)); GstPad *peer; @@ -1291,14 +1291,14 @@ gst_queue_handle_src_query (GstPad * pad, GstQuery ** query) return FALSE; } - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: { gint64 peer_pos; GstFormat format; /* get peer position */ - gst_query_parse_position (*query, &format, &peer_pos); + gst_query_parse_position (query, &format, &peer_pos); /* FIXME: this code assumes that there's no discont in the queue */ switch (format) { @@ -1314,7 +1314,7 @@ gst_queue_handle_src_query (GstPad * pad, GstQuery ** query) return TRUE; } /* set updated position */ - gst_query_set_position (*query, format, peer_pos); + gst_query_set_position (query, format, peer_pos); break; } case GST_QUERY_LATENCY: @@ -1322,7 +1322,7 @@ gst_queue_handle_src_query (GstPad * pad, GstQuery ** query) gboolean live; GstClockTime min, max; - gst_query_parse_latency (*query, &live, &min, &max); + gst_query_parse_latency (query, &live, &min, &max); /* we can delay up to the limit of the queue in time. If we have no time * limit, the best thing we can do is to return an infinite delay. In @@ -1337,7 +1337,7 @@ gst_queue_handle_src_query (GstPad * pad, GstQuery ** query) if (queue->min_threshold.time > 0 && min != -1) min += queue->min_threshold.time; - gst_query_set_latency (*query, live, min, max); + gst_query_set_latency (query, live, min, max); break; } default: diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 7704aecce..9ff1719e3 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -230,9 +230,9 @@ static void gst_queue2_loop (GstPad * pad); static gboolean gst_queue2_handle_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_queue2_handle_src_event (GstPad * pad, GstEvent * event); -static gboolean gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query); +static gboolean gst_queue2_handle_src_query (GstPad * pad, GstQuery * query); static gboolean gst_queue2_handle_query (GstElement * element, - GstQuery ** query); + GstQuery * query); static GstCaps *gst_queue2_getcaps (GstPad * pad, GstCaps * filter); static gboolean gst_queue2_acceptcaps (GstPad * pad, GstCaps * caps); @@ -2415,7 +2415,7 @@ gst_queue2_handle_src_event (GstPad * pad, GstEvent * event) } static gboolean -gst_queue2_peer_query (GstQueue2 * queue, GstPad * pad, GstQuery ** query) +gst_queue2_peer_query (GstQueue2 * queue, GstPad * pad, GstQuery * query) { gboolean ret = FALSE; GstPad *peer; @@ -2428,7 +2428,7 @@ gst_queue2_peer_query (GstQueue2 * queue, GstPad * pad, GstQuery ** query) } static gboolean -gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) +gst_queue2_handle_src_query (GstPad * pad, GstQuery * query) { GstQueue2 *queue; @@ -2436,7 +2436,7 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) if (G_UNLIKELY (queue == NULL)) return FALSE; - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: { gint64 peer_pos; @@ -2446,7 +2446,7 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) goto peer_failed; /* get peer position */ - gst_query_parse_position (*query, &format, &peer_pos); + gst_query_parse_position (query, &format, &peer_pos); /* FIXME: this code assumes that there's no discont in the queue */ switch (format) { @@ -2462,7 +2462,7 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) return FALSE; } /* set updated position */ - gst_query_set_position (*query, format, peer_pos); + gst_query_set_position (query, format, peer_pos); break; } case GST_QUERY_DURATION: @@ -2531,7 +2531,7 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) GST_DEBUG_OBJECT (queue, "estimated %" G_GINT64_FORMAT ", left %" G_GINT64_FORMAT, estimated_total, buffering_left); - gst_query_parse_buffering_range (*query, &format, NULL, NULL, NULL); + gst_query_parse_buffering_range (query, &format, NULL, NULL, NULL); switch (format) { case GST_FORMAT_PERCENT: @@ -2587,13 +2587,13 @@ gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query) GST_DEBUG_OBJECT (queue, "range starting at %" G_GINT64_FORMAT " and finishing at %" G_GINT64_FORMAT, range_start, range_stop); - gst_query_add_buffering_range (*query, range_start, range_stop); + gst_query_add_buffering_range (query, range_start, range_stop); } - gst_query_set_buffering_percent (*query, is_buffering, percent); - gst_query_set_buffering_range (*query, format, start, stop, + gst_query_set_buffering_percent (query, is_buffering, percent); + gst_query_set_buffering_range (query, format, start, stop, estimated_total); - gst_query_set_buffering_stats (*query, GST_BUFFERING_DOWNLOAD, + gst_query_set_buffering_stats (query, GST_BUFFERING_DOWNLOAD, byte_in_rate, byte_out_rate, buffering_left); } break; @@ -2618,7 +2618,7 @@ peer_failed: } static gboolean -gst_queue2_handle_query (GstElement * element, GstQuery ** query) +gst_queue2_handle_query (GstElement * element, GstQuery * query) { /* simply forward to the srcpad query function */ return gst_queue2_handle_src_query (GST_QUEUE2_CAST (element)->srcpad, query); diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index 182324e6e..b34c3bd5b 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -142,8 +142,7 @@ static const GstEventMask *gst_type_find_element_src_event_mask (GstPad * pad); static gboolean gst_type_find_element_src_event (GstPad * pad, GstEvent * event); -static gboolean gst_type_find_handle_src_query (GstPad * pad, - GstQuery ** query); +static gboolean gst_type_find_handle_src_query (GstPad * pad, GstQuery * query); static gboolean gst_type_find_element_handle_event (GstPad * pad, GstEvent * event); @@ -371,7 +370,7 @@ gst_type_find_element_get_property (GObject * object, guint prop_id, } static gboolean -gst_type_find_handle_src_query (GstPad * pad, GstQuery ** query) +gst_type_find_handle_src_query (GstPad * pad, GstQuery * query) { GstTypeFindElement *typefind; gboolean res = FALSE; @@ -387,13 +386,13 @@ gst_type_find_handle_src_query (GstPad * pad, GstQuery ** query) if (!res) goto out; - switch (GST_QUERY_TYPE (*query)) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: { gint64 peer_pos; GstFormat format; - gst_query_parse_position (*query, &format, &peer_pos); + gst_query_parse_position (query, &format, &peer_pos); GST_OBJECT_LOCK (typefind); /* FIXME: this code assumes that there's no discont in the queue */ @@ -406,7 +405,7 @@ gst_type_find_handle_src_query (GstPad * pad, GstQuery ** query) break; } GST_OBJECT_UNLOCK (typefind); - gst_query_set_position (*query, format, peer_pos); + gst_query_set_position (query, format, peer_pos); break; } default: @@ -653,7 +652,7 @@ gst_type_find_get_extension (GstTypeFindElement * typefind, GstPad * pad) query = gst_query_new_uri (); /* try getting the caps with an uri query and from the extension */ - if (!gst_pad_peer_query (pad, &query)) + if (!gst_pad_peer_query (pad, query)) goto peer_query_failed; gst_query_parse_uri (query, &uri); |