Commit 3d2127f8 authored by Sebastian Dröge's avatar Sebastian Dröge

Revert "query: allow _make_writable on query handlers"

This reverts commit cf4fbc00.

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.
parent d0f34fe6
......@@ -245,7 +245,7 @@ static void gst_bin_handle_message_func (GstBin * bin, GstMessage * message);
static gboolean gst_bin_send_event (GstElement * element, GstEvent * event);
static GstBusSyncReply bin_bus_handler (GstBus * bus,
GstMessage * message, GstBin * bin);
static gboolean gst_bin_query (GstElement * element, GstQuery ** query);
static gboolean gst_bin_query (GstElement * element, GstQuery * query);
static gboolean gst_bin_do_latency_func (GstBin * bin);
......@@ -2359,7 +2359,7 @@ gst_bin_do_latency_func (GstBin * bin)
GST_DEBUG_OBJECT (element, "querying latency");
query = gst_query_new_latency ();
if ((res = gst_element_query (element, &query))) {
if ((res = gst_element_query (element, query))) {
gboolean live;
gst_query_parse_latency (query, &live, &min_latency, &max_latency);
......@@ -3426,7 +3426,7 @@ forward:
/* generic struct passed to all query fold methods */
typedef struct
{
GstQuery **query;
GstQuery *query;
gint64 min;
gint64 max;
gboolean live;
......@@ -3455,7 +3455,7 @@ bin_query_duration_fold (const GValue * vitem, GValue * ret, QueryFold * fold)
g_value_set_boolean (ret, TRUE);
gst_query_parse_duration (*fold->query, NULL, &duration);
gst_query_parse_duration (fold->query, NULL, &duration);
GST_DEBUG_OBJECT (item, "got duration %" G_GINT64_FORMAT, duration);
......@@ -3471,10 +3471,9 @@ bin_query_duration_done (GstBin * bin, QueryFold * fold)
{
GstFormat format;
gst_query_parse_duration (*fold->query, &format, NULL);
*fold->query = gst_query_make_writable (*fold->query);
gst_query_parse_duration (fold->query, &format, NULL);
/* store max in query result */
gst_query_set_duration (*fold->query, format, fold->max);
gst_query_set_duration (fold->query, format, fold->max);
GST_DEBUG_OBJECT (bin, "max duration %" G_GINT64_FORMAT, fold->max);
......@@ -3495,7 +3494,7 @@ bin_query_position_fold (const GValue * vitem, GValue * ret, QueryFold * fold)
g_value_set_boolean (ret, TRUE);
gst_query_parse_position (*fold->query, NULL, &position);
gst_query_parse_position (fold->query, NULL, &position);
GST_DEBUG_OBJECT (item, "got position %" G_GINT64_FORMAT, position);
......@@ -3511,10 +3510,9 @@ bin_query_position_done (GstBin * bin, QueryFold * fold)
{
GstFormat format;
gst_query_parse_position (*fold->query, &format, NULL);
*fold->query = gst_query_make_writable (*fold->query);
gst_query_parse_position (fold->query, &format, NULL);
/* store max in query result */
gst_query_set_position (*fold->query, format, fold->max);
gst_query_set_position (fold->query, format, fold->max);
GST_DEBUG_OBJECT (bin, "max position %" G_GINT64_FORMAT, fold->max);
}
......@@ -3528,7 +3526,7 @@ bin_query_latency_fold (const GValue * vitem, GValue * ret, QueryFold * fold)
GstClockTime min, max;
gboolean live;
gst_query_parse_latency (*fold->query, &live, &min, &max);
gst_query_parse_latency (fold->query, &live, &min, &max);
GST_DEBUG_OBJECT (item,
"got latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT
......@@ -3558,8 +3556,7 @@ static void
bin_query_latency_done (GstBin * bin, QueryFold * fold)
{
/* store max in query result */
*fold->query = gst_query_make_writable (*fold->query);
gst_query_set_latency (*fold->query, fold->live, fold->min, fold->max);
gst_query_set_latency (fold->query, fold->live, fold->min, fold->max);
GST_DEBUG_OBJECT (bin,
"latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT
......@@ -3576,7 +3573,7 @@ bin_query_generic_fold (const GValue * vitem, GValue * ret, QueryFold * fold)
if ((res = gst_element_query (item, fold->query))) {
g_value_set_boolean (ret, TRUE);
GST_DEBUG_OBJECT (item, "answered query %" GST_PTR_FORMAT, *fold->query);
GST_DEBUG_OBJECT (item, "answered query %p", fold->query);
}
/* and stop as soon as we have a valid result */
......@@ -3584,7 +3581,7 @@ bin_query_generic_fold (const GValue * vitem, GValue * ret, QueryFold * fold)
}
static gboolean
gst_bin_query (GstElement * element, GstQuery ** query)
gst_bin_query (GstElement * element, GstQuery * query)
{
GstBin *bin = GST_BIN_CAST (element);
GstIterator *iter;
......@@ -3595,13 +3592,13 @@ gst_bin_query (GstElement * element, GstQuery ** query)
QueryFold fold_data;
GValue ret = { 0 };
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
{
GList *cached;
GstFormat qformat;
gst_query_parse_duration (*query, &qformat, NULL);
gst_query_parse_duration (query, &qformat, NULL);
/* find cached duration query */
GST_OBJECT_LOCK (bin);
......@@ -3621,8 +3618,7 @@ gst_bin_query (GstElement * element, GstQuery ** query)
duration);
GST_OBJECT_UNLOCK (bin);
*query = gst_query_make_writable (*query);
gst_query_set_duration (*query, qformat, duration);
gst_query_set_duration (query, qformat, duration);
res = TRUE;
goto exit;
}
......
......@@ -128,7 +128,7 @@ static void gst_element_set_bus_func (GstElement * element, GstBus * bus);
static gboolean gst_element_default_send_event (GstElement * element,
GstEvent * event);
static gboolean gst_element_default_query (GstElement * element,
GstQuery ** query);
GstQuery * query);
static GstPadTemplate
* gst_element_class_get_request_pad_template (GstElementClass *
......@@ -1628,7 +1628,7 @@ gst_element_get_query_types (GstElement * element)
}
static gboolean
gst_element_default_query (GstElement * element, GstQuery ** query)
gst_element_default_query (GstElement * element, GstQuery * query)
{
gboolean result = FALSE;
GstPad *pad;
......@@ -1672,14 +1672,13 @@ gst_element_default_query (GstElement * element, GstQuery ** query)
* MT safe.
*/
gboolean
gst_element_query (GstElement * element, GstQuery ** query)
gst_element_query (GstElement * element, GstQuery * query)
{
GstElementClass *oclass;
gboolean result = FALSE;
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (query != NULL, FALSE);
g_return_val_if_fail (GST_IS_QUERY (*query), FALSE);
oclass = GST_ELEMENT_GET_CLASS (element);
......
......@@ -655,7 +655,7 @@ struct _GstElementClass
gboolean (*send_event) (GstElement *element, GstEvent *event);
const GstQueryType* (*get_query_types) (GstElement *element);
gboolean (*query) (GstElement *element, GstQuery **query);
gboolean (*query) (GstElement *element, GstQuery *query);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
......@@ -766,7 +766,7 @@ gboolean gst_element_seek (GstElement *element, gd
GstSeekType stop_type, gint64 stop);
G_CONST_RETURN GstQueryType*
gst_element_get_query_types (GstElement *element);
gboolean gst_element_query (GstElement *element, GstQuery **query);
gboolean gst_element_query (GstElement *element, GstQuery *query);
/* messages */
gboolean gst_element_post_message (GstElement * element, GstMessage * message);
......
......@@ -151,7 +151,7 @@ gst_proxy_pad_event_default (GstPad * pad, GstEvent * event)
* Since: 0.10.35
*/
gboolean
gst_proxy_pad_query_default (GstPad * pad, GstQuery ** query)
gst_proxy_pad_query_default (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
GstPad *target;
......
......@@ -3297,15 +3297,14 @@ no_iter:
* Returns: TRUE if the query could be performed.
*/
gboolean
gst_pad_query (GstPad * pad, GstQuery ** query)
gst_pad_query (GstPad * pad, GstQuery * query)
{
GstPadQueryFunction func;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (query != NULL, FALSE);
g_return_val_if_fail (GST_IS_QUERY (*query), FALSE);
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
GST_DEBUG_OBJECT (pad, "sending query %p", *query);
GST_DEBUG_OBJECT (pad, "sending query %p", query);
if ((func = GST_PAD_QUERYFUNC (pad)) == NULL)
goto no_func;
......@@ -3335,14 +3334,13 @@ no_func:
* Since: 0.10.15
*/
gboolean
gst_pad_peer_query (GstPad * pad, GstQuery ** query)
gst_pad_peer_query (GstPad * pad, GstQuery * query)
{
GstPad *peerpad;
gboolean result;
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (query != NULL, FALSE);
g_return_val_if_fail (GST_IS_QUERY (*query), FALSE);
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
GST_OBJECT_LOCK (pad);
......@@ -3384,7 +3382,7 @@ no_peer:
* Returns: TRUE if the query was performed succesfully.
*/
gboolean
gst_pad_query_default (GstPad * pad, GstQuery ** query)
gst_pad_query_default (GstPad * pad, GstQuery * query)
{
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
......
......@@ -386,14 +386,13 @@ typedef const GstQueryType* (*GstPadQueryTypeFunction) (GstPad *pad);
/**
* GstPadQueryFunction:
* @pad: the #GstPad to query.
* @query: a pointer to a #GstQuery object to execute
* @query: the #GstQuery object to execute
*
* The signature of the query function. This function takes ownership of the
* query pointed to by @query and might change @query.
* The signature of the query function.
*
* Returns: TRUE if the query could be performed.
*/
typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery **query);
typedef gboolean (*GstPadQueryFunction) (GstPad *pad, GstQuery *query);
/* linking */
......@@ -900,10 +899,10 @@ G_CONST_RETURN GstQueryType*
G_CONST_RETURN GstQueryType*
gst_pad_get_query_types_default (GstPad *pad);
gboolean gst_pad_query (GstPad *pad, GstQuery **query);
gboolean gst_pad_peer_query (GstPad *pad, GstQuery **query);
gboolean gst_pad_query (GstPad *pad, GstQuery *query);
gboolean gst_pad_peer_query (GstPad *pad, GstQuery *query);
void gst_pad_set_query_function (GstPad *pad, GstPadQueryFunction query);
gboolean gst_pad_query_default (GstPad *pad, GstQuery **query);
gboolean gst_pad_query_default (GstPad *pad, GstQuery *query);
/* misc helper functions */
gboolean gst_pad_dispatcher (GstPad *pad, GstPadDispatcherFunction dispatch,
......
......@@ -2252,7 +2252,7 @@ gst_element_query_position (GstElement * element, GstFormat * format,
g_return_val_if_fail (format != NULL, FALSE);
query = gst_query_new_position (*format);
ret = gst_element_query (element, &query);
ret = gst_element_query (element, query);
if (ret)
gst_query_parse_position (query, format, cur);
......@@ -2284,7 +2284,7 @@ gst_element_query_duration (GstElement * element, GstFormat * format,
g_return_val_if_fail (format != NULL, FALSE);
query = gst_query_new_duration (*format);
ret = gst_element_query (element, &query);
ret = gst_element_query (element, query);
if (ret)
gst_query_parse_duration (query, format, duration);
......@@ -2323,7 +2323,7 @@ gst_element_query_convert (GstElement * element, GstFormat src_format,
}
query = gst_query_new_convert (src_format, src_val, *dest_format);
ret = gst_element_query (element, &query);
ret = gst_element_query (element, query);
if (ret)
gst_query_parse_convert (query, NULL, NULL, dest_format, dest_val);
......@@ -2938,7 +2938,7 @@ gst_pad_query_position (GstPad * pad, GstFormat * format, gint64 * cur)
g_return_val_if_fail (format != NULL, FALSE);
query = gst_query_new_position (*format);
ret = gst_pad_query (pad, &query);
ret = gst_pad_query (pad, query);
if (ret)
gst_query_parse_position (query, format, cur);
......@@ -3002,7 +3002,7 @@ gst_pad_query_duration (GstPad * pad, GstFormat * format, gint64 * duration)
g_return_val_if_fail (format != NULL, FALSE);
query = gst_query_new_duration (*format);
ret = gst_pad_query (pad, &query);
ret = gst_pad_query (pad, query);
if (ret)
gst_query_parse_duration (query, format, duration);
......@@ -3074,7 +3074,7 @@ gst_pad_query_convert (GstPad * pad, GstFormat src_format, gint64 src_val,
}
query = gst_query_new_convert (src_format, src_val, *dest_format);
ret = gst_pad_query (pad, &query);
ret = gst_pad_query (pad, query);
if (ret)
gst_query_parse_convert (query, NULL, NULL, dest_format, dest_val);
......
......@@ -368,7 +368,7 @@ static void gst_base_parse_handle_tag (GstBaseParse * parse, GstEvent * event);
static gboolean gst_base_parse_src_event (GstPad * pad, GstEvent * event);
static gboolean gst_base_parse_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_base_parse_query (GstPad * pad, GstQuery ** query);
static gboolean gst_base_parse_query (GstPad * pad, GstQuery * query);
static gboolean gst_base_parse_sink_setcaps (GstPad * pad, GstCaps * caps);
static const GstQueryType *gst_base_parse_get_querytypes (GstPad * pad);
......@@ -1475,7 +1475,7 @@ gst_base_parse_check_seekability (GstBaseParse * parse)
guint idx_interval = 0;
query = gst_query_new_seeking (GST_FORMAT_BYTES);
if (!gst_pad_peer_query (parse->sinkpad, &query)) {
if (!gst_pad_peer_query (parse->sinkpad, query)) {
GST_DEBUG_OBJECT (parse, "seeking query failed");
goto done;
}
......@@ -3059,7 +3059,7 @@ gst_base_parse_get_querytypes (GstPad * pad)
}
static gboolean
gst_base_parse_query (GstPad * pad, GstQuery ** query)
gst_base_parse_query (GstPad * pad, GstQuery * query)
{
GstBaseParse *parse;
gboolean res = FALSE;
......@@ -3068,14 +3068,14 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
GST_LOG_OBJECT (parse, "handling query: %" GST_PTR_FORMAT, query);
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 dest_value;
GstFormat format;
GST_DEBUG_OBJECT (parse, "position query");
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
GST_OBJECT_LOCK (parse);
if (format == GST_FORMAT_BYTES) {
......@@ -3088,10 +3088,9 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
}
GST_OBJECT_UNLOCK (parse);
if (res) {
*query = gst_query_make_writable (*query);
gst_query_set_position (*query, format, dest_value);
} else {
if (res)
gst_query_set_position (query, format, dest_value);
else {
res = gst_pad_query_default (pad, query);
if (!res) {
/* no precise result, upstream no idea either, then best estimate */
......@@ -3108,7 +3107,7 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
GstClockTime duration;
GST_DEBUG_OBJECT (parse, "duration query");
gst_query_parse_duration (*query, &format, NULL);
gst_query_parse_duration (query, &format, NULL);
/* consult upstream */
res = gst_pad_query_default (pad, query);
......@@ -3116,10 +3115,8 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
/* otherwise best estimate from us */
if (!res) {
res = gst_base_parse_get_duration (parse, format, &duration);
if (res) {
*query = gst_query_make_writable (*query);
gst_query_set_duration (*query, format, duration);
}
if (res)
gst_query_set_duration (query, format, duration);
}
break;
}
......@@ -3130,14 +3127,14 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
gboolean seekable = FALSE;
GST_DEBUG_OBJECT (parse, "seeking query");
gst_query_parse_seeking (*query, &fmt, NULL, NULL, NULL);
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
/* consult upstream */
res = gst_pad_query_default (pad, query);
/* we may be able to help if in TIME */
if (fmt == GST_FORMAT_TIME && gst_base_parse_is_seekable (parse)) {
gst_query_parse_seeking (*query, &fmt, &seekable, NULL, NULL);
gst_query_parse_seeking (query, &fmt, &seekable, NULL, NULL);
/* already OK if upstream takes care */
GST_LOG_OBJECT (parse, "upstream handled %d, seekable %d",
res, seekable);
......@@ -3152,17 +3149,14 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
GST_LOG_OBJECT (parse, "already determine upstream seekabled: %d",
seekable);
}
*query = gst_query_make_writable (*query);
gst_query_set_seeking (*query, GST_FORMAT_TIME, seekable, 0,
duration);
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, duration);
res = TRUE;
}
}
break;
}
case GST_QUERY_FORMATS:
*query = gst_query_make_writable (*query);
gst_query_set_formatsv (*query, 3, fmtlist);
gst_query_set_formatsv (query, 3, fmtlist);
res = TRUE;
break;
case GST_QUERY_CONVERT:
......@@ -3170,14 +3164,13 @@ gst_base_parse_query (GstPad * pad, GstQuery ** query)
GstFormat src_format, dest_format;
gint64 src_value, dest_value;
gst_query_parse_convert (*query, &src_format, &src_value,
gst_query_parse_convert (query, &src_format, &src_value,
&dest_format, &dest_value);
res = gst_base_parse_convert (parse, src_format, src_value,
dest_format, &dest_value);
if (res) {
*query = gst_query_make_writable (*query);
gst_query_set_convert (*query, src_format, src_value,
gst_query_set_convert (query, src_format, src_value,
dest_format, dest_value);
}
break;
......
......@@ -360,7 +360,7 @@ static void gst_base_sink_get_property (GObject * object, guint prop_id,
static gboolean gst_base_sink_send_event (GstElement * element,
GstEvent * event);
static gboolean gst_base_sink_query (GstElement * element, GstQuery ** query);
static gboolean gst_base_sink_query (GstElement * element, GstQuery * query);
static const GstQueryType *gst_base_sink_get_query_types (GstElement * element);
static GstCaps *gst_base_sink_get_caps (GstBaseSink * sink, GstCaps * caps);
......@@ -1099,7 +1099,7 @@ gst_base_sink_query_latency (GstBaseSink * sink, gboolean * live,
query = gst_query_new_latency ();
/* ask the peer for the latency */
if ((res = gst_pad_peer_query (sink->sinkpad, &query))) {
if ((res = gst_pad_peer_query (sink->sinkpad, query))) {
/* get upstream min and max latency */
gst_query_parse_latency (query, &us_live, &us_min, &us_max);
......@@ -4672,20 +4672,20 @@ gst_base_sink_get_query_types (GstElement * element)
}
static gboolean
gst_base_sink_query (GstElement * element, GstQuery ** query)
gst_base_sink_query (GstElement * element, GstQuery * query)
{
gboolean res = FALSE;
GstBaseSink *basesink = GST_BASE_SINK (element);
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 cur = 0;
GstFormat format;
gboolean upstream = FALSE;
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
GST_DEBUG_OBJECT (basesink, "position query in format %s",
gst_format_get_name (format));
......@@ -4693,8 +4693,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
/* first try to get the position based on the clock */
if ((res =
gst_base_sink_get_position (basesink, format, &cur, &upstream))) {
*query = gst_query_make_writable (*query);
gst_query_set_position (*query, format, cur);
gst_query_set_position (query, format, cur);
} else if (upstream) {
/* fallback to peer query */
res = gst_pad_peer_query (basesink->sinkpad, query);
......@@ -4724,8 +4723,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
pos = gst_util_uint64_scale (100 * GST_FORMAT_PERCENT_SCALE, cur,
dur);
*query = gst_query_make_writable (*query);
gst_query_set_position (*query, GST_FORMAT_PERCENT, pos);
gst_query_set_position (query, GST_FORMAT_PERCENT, pos);
}
}
}
......@@ -4737,15 +4735,14 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
GstFormat format;
gboolean upstream = FALSE;
gst_query_parse_duration (*query, &format, NULL);
gst_query_parse_duration (query, &format, NULL);
GST_DEBUG_OBJECT (basesink, "duration query in format %s",
gst_format_get_name (format));
if ((res =
gst_base_sink_get_duration (basesink, format, &dur, &upstream))) {
*query = gst_query_make_writable (*query);
gst_query_set_duration (*query, format, dur);
gst_query_set_duration (query, format, dur);
} else if (upstream) {
/* fallback to peer query */
res = gst_pad_peer_query (basesink->sinkpad, query);
......@@ -4753,8 +4750,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
if (!res) {
/* we can handle a few things if upstream failed */
if (format == GST_FORMAT_PERCENT) {
*query = gst_query_make_writable (*query);
gst_query_set_duration (*query, GST_FORMAT_PERCENT,
gst_query_set_duration (query, GST_FORMAT_PERCENT,
GST_FORMAT_PERCENT_MAX);
res = TRUE;
}
......@@ -4768,8 +4764,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
if ((res = gst_base_sink_query_latency (basesink, &live, &us_live, &min,
&max))) {
*query = gst_query_make_writable (*query);
gst_query_set_latency (*query, live, min, max);
gst_query_set_latency (query, live, min, max);
}
break;
}
......@@ -4782,8 +4777,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
case GST_QUERY_SEGMENT:
{
if (basesink->pad_mode == GST_ACTIVATE_PULL) {
*query = gst_query_make_writable (*query);
gst_query_set_segment (*query, basesink->segment.rate,
gst_query_set_segment (query, basesink->segment.rate,
GST_FORMAT_TIME, basesink->segment.start, basesink->segment.stop);
res = TRUE;
} else {
......@@ -4799,7 +4793,7 @@ gst_base_sink_query (GstElement * element, GstQuery ** query)
break;
}
GST_DEBUG_OBJECT (basesink, "query %s returns %d",
GST_QUERY_TYPE_NAME (*query), res);
GST_QUERY_TYPE_NAME (query), res);
return res;
}
......
......@@ -295,13 +295,12 @@ static gboolean gst_base_src_send_event (GstElement * elem, GstEvent * event);
static gboolean gst_base_src_default_event (GstBaseSrc * src, GstEvent * event);
static const GstQueryType *gst_base_src_get_query_types (GstElement * element);
static gboolean gst_base_src_query (GstPad * pad, GstQuery ** query);
static gboolean gst_base_src_query (GstPad * pad, GstQuery * query);
static gboolean gst_base_src_default_negotiate (GstBaseSrc * basesrc);
static gboolean gst_base_src_default_do_seek (GstBaseSrc * src,
GstSegment * segment);
static gboolean gst_base_src_default_query (GstBaseSrc * src,
GstQuery ** query);
static gboolean gst_base_src_default_query (GstBaseSrc * src, GstQuery * query);
static gboolean gst_base_src_default_prepare_seek_segment (GstBaseSrc * src,
GstEvent * event, GstSegment * segment);
......@@ -834,16 +833,16 @@ gst_base_src_fixate (GstPad * pad, GstCaps * caps)
}
static gboolean
gst_base_src_default_query (GstBaseSrc * src, GstQuery ** query)
gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
{
gboolean res;
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
GstFormat format;
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
GST_DEBUG_OBJECT (src, "position query in format %s",
gst_format_get_name (format));
......@@ -869,7 +868,7 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery ** query)
} else
percent = -1;
gst_query_set_position (*query, GST_FORMAT_PERCENT, percent);
gst_query_set_position (query, GST_FORMAT_PERCENT, percent);
res = TRUE;
break;
}
......@@ -893,7 +892,7 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery ** query)
} else
res = TRUE;
gst_query_set_position (*query, format, position);
gst_query_set_position (query, format, position);
break;
}
}
......@@ -903,14 +902,14 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery ** query)
{
GstFormat format;
gst_query_parse_duration (*query, &format, NULL);
gst_query_parse_duration (query, &format, NULL);
GST_DEBUG_OBJECT (src, "duration query in format %s",
gst_format_get_name (format));
switch (format) {
case GST_FORMAT_PERCENT:
gst_query_set_duration (*query, GST_FORMAT_PERCENT,
gst_query_set_duration (query, GST_FORMAT_PERCENT,
GST_FORMAT_PERCENT_MAX);
res = TRUE;
break;
......@@ -941,7 +940,7 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery ** query)
* means that we cannot report the duration at all. */
res = TRUE;
}
gst_query_set_duration (*query, format, duration);
gst_query_set_duration (query, format, duration);