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);
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);
/* generic struct passed to all query fold methods */
typedef struct
{
- GstQuery **query;
+ GstQuery *query;
gint64 min;
gint64 max;
gboolean live;
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);
{
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);
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);
{
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);
}
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
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
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 */
}
static gboolean
-gst_bin_query (GstElement * element, GstQuery ** query)
+gst_bin_query (GstElement * element, GstQuery * query)
{
GstBin *bin = GST_BIN_CAST (element);
GstIterator *iter;
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);
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;
}
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 *
}
static gboolean
-gst_element_default_query (GstElement * element, GstQuery ** query)
+gst_element_default_query (GstElement * element, GstQuery * query)
{
gboolean result = FALSE;
GstPad *pad;
* 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);
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];
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);
* 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;
* 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;
* 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);
* 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:
/**
* 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 */
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,
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);
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);
}
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);
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);
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);
}
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);
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);
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;
}
}
static gboolean
-gst_base_parse_query (GstPad * pad, GstQuery ** query)
+gst_base_parse_query (GstPad * pad, GstQuery * query)
{
GstBaseParse *parse;
gboolean res = FALSE;
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) {
}
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 */
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);
/* 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;
}
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);
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:
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;
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);
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);
}
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));
/* 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);
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);
}
}
}
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);
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;
}
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;
}
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 {
break;
}
GST_DEBUG_OBJECT (basesink, "query %s returns %d",
- GST_QUERY_TYPE_NAME (*query), res);
+ GST_QUERY_TYPE_NAME (query), res);
return res;
}
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);
}
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));
} else
percent = -1;
- gst_query_set_position (*query, GST_FORMAT_PERCENT, percent);
+ gst_query_set_position (query, GST_FORMAT_PERCENT, percent);
res = TRUE;
break;
}
} else
res = TRUE;
- gst_query_set_position (*query, format, position);
+ gst_query_set_position (query, format, position);
break;
}
}
{
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;
* 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);
break;
}
}
seg_format = src->segment.format;
GST_OBJECT_UNLOCK (src);
- gst_query_parse_seeking (*query, &format, NULL, NULL, NULL);
+ gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
if (format == seg_format) {
- gst_query_set_seeking (*query, seg_format,
+ gst_query_set_seeking (query, seg_format,
gst_base_src_seekable (src), 0, duration);
res = TRUE;
} else {
stop -= src->segment.time;
}
- gst_query_set_segment (*query, src->segment.rate, src->segment.format,
+ gst_query_set_segment (query, src->segment.rate, src->segment.format,
start, stop);
GST_OBJECT_UNLOCK (src);
res = TRUE;
case GST_QUERY_FORMATS:
{
- gst_query_set_formats (*query, 3, GST_FORMAT_DEFAULT,
+ gst_query_set_formats (query, 3, GST_FORMAT_DEFAULT,
GST_FORMAT_BYTES, GST_FORMAT_PERCENT);
res = TRUE;
break;
GstFormat src_fmt, dest_fmt;
gint64 src_val, dest_val;
- gst_query_parse_convert (*query, &src_fmt, &src_val, &dest_fmt,
- &dest_val);
+ gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
/* we can only convert between equal formats... */
if (src_fmt == dest_fmt) {
} else
res = FALSE;
- gst_query_set_convert (*query, src_fmt, src_val, dest_fmt, dest_val);
+ gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break;
}
case GST_QUERY_LATENCY:
", max %" GST_TIME_FORMAT, live, GST_TIME_ARGS (min),
GST_TIME_ARGS (max));
- gst_query_set_latency (*query, live, min, max);
+ gst_query_set_latency (query, live, min, max);
break;
}
case GST_QUERY_JITTER:
GstFormat format, seg_format;
gint64 start, stop, estimated;
- gst_query_parse_buffering_range (*query, &format, NULL, NULL, NULL);
+ gst_query_parse_buffering_range (query, &format, NULL, NULL, NULL);
GST_DEBUG_OBJECT (src, "buffering query in format %s",
gst_format_get_name (format));
res = gst_pad_query_convert (src->srcpad, seg_format,
start, &format, &start);
- gst_query_set_buffering_range (*query, format, start, stop, estimated);
+ gst_query_set_buffering_range (query, format, start, stop, estimated);
break;
}
default:
res = FALSE;
break;
}
- GST_DEBUG_OBJECT (src, "query %s returns %d", GST_QUERY_TYPE_NAME (*query),
+ GST_DEBUG_OBJECT (src, "query %s returns %d", GST_QUERY_TYPE_NAME (query),
res);
return res;
}
static gboolean
-gst_base_src_query (GstPad * pad, GstQuery ** query)
+gst_base_src_query (GstPad * pad, GstQuery * query)
{
GstBaseSrc *src;
GstBaseSrcClass *bclass;
gboolean (*unlock_stop) (GstBaseSrc *src);
/* notify subclasses of a query */
- gboolean (*query) (GstBaseSrc *src, GstQuery ** query);
+ gboolean (*query) (GstBaseSrc *src, GstQuery *query);
/* notify subclasses of an event */
gboolean (*event) (GstBaseSrc *src, GstEvent *event);
GstPadDirection direction, GstCaps * caps);
static gboolean gst_base_transform_setcaps (GstBaseTransform * trans,
GstPad * pad, GstCaps * caps);
-static gboolean gst_base_transform_query (GstPad * pad, GstQuery ** query);
+static gboolean gst_base_transform_query (GstPad * pad, GstQuery * query);
static const GstQueryType *gst_base_transform_query_type (GstPad * pad);
/* static guint gst_base_transform_signals[LAST_SIGNAL] = { 0 }; */
}
static gboolean
-gst_base_transform_query (GstPad * pad, GstQuery ** query)
+gst_base_transform_query (GstPad * pad, GstQuery * query)
{
gboolean ret = FALSE;
GstBaseTransform *trans;
return FALSE;
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
- 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);
if (format == GST_FORMAT_TIME && trans->segment.format == GST_FORMAT_TIME) {
gint64 pos;
ret = TRUE;
pos = gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME,
trans->priv->position_out);
}
- gst_query_set_position (*query, format, pos);
+ gst_query_set_position (query, format, pos);
} else {
ret = gst_pad_peer_query (otherpad, query);
}
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);
}
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:
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);
}
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:
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);
}
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:
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);
}
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:
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);
/* 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;
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;
/* 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
}
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
}
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;
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);
}
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;
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) {
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:
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
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:
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);
}
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;
}
static gboolean
-gst_queue2_handle_src_query (GstPad * pad, GstQuery ** query)
+gst_queue2_handle_src_query (GstPad * pad, GstQuery * query)
{
GstQueue2 *queue;
if (G_UNLIKELY (queue == NULL))
return FALSE;
- switch (GST_QUERY_TYPE (*query)) {
+ switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 peer_pos;
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) {
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:
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:
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;
}
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);
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);
}
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;
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 */
break;
}
GST_OBJECT_UNLOCK (typefind);
- gst_query_set_position (*query, format, peer_pos);
+ gst_query_set_position (query, format, peer_pos);
break;
}
default:
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);
/* Test that fdsrc is non-seekable with a pipe */
fail_unless ((seeking_query = gst_query_new_seeking (GST_FORMAT_BYTES))
!= NULL);
- fail_unless (gst_element_query (src, &seeking_query) == TRUE);
+ fail_unless (gst_element_query (src, seeking_query) == TRUE);
gst_query_parse_seeking (seeking_query, NULL, &seekable, NULL, NULL);
fail_unless (seekable == FALSE);
gst_query_unref (seeking_query);
/* Test that fdsrc is seekable with a file fd */
fail_unless ((seeking_query = gst_query_new_seeking (GST_FORMAT_BYTES))
!= NULL);
- fail_unless (gst_element_query (src, &seeking_query) == TRUE);
+ fail_unless (gst_element_query (src, seeking_query) == TRUE);
gst_query_parse_seeking (seeking_query, NULL, &seekable, NULL, NULL);
fail_unless (seekable == TRUE);
gst_query_unref (seeking_query);
/* Test that filesrc is seekable with a file fd */
fail_unless ((seeking_query = gst_query_new_seeking (GST_FORMAT_BYTES))
!= NULL);
- fail_unless (gst_element_query (src, &seeking_query) == TRUE);
+ fail_unless (gst_element_query (src, seeking_query) == TRUE);
gst_query_parse_seeking (seeking_query, NULL, &seekable, NULL, NULL);
fail_unless (seekable == TRUE);
gst_query_unref (seeking_query);
/* Test that filesrc is seekable with a file fd */
fail_unless ((seeking_query = gst_query_new_seeking (GST_FORMAT_BYTES))
!= NULL);
- fail_unless (gst_element_query (src, &seeking_query) == TRUE);
+ fail_unless (gst_element_query (src, seeking_query) == TRUE);
/* get the seeking capabilities */
gst_query_parse_seeking (seeking_query, NULL, &seekable, &start, &stop);
g_object_set (e, "location", location, NULL);
query = gst_query_new_uri ();
- fail_unless (gst_element_query (e, &query));
+ fail_unless (gst_element_query (e, query));
gst_query_parse_uri (query, &query_uri);
gst_query_unref (query);
gst_element_get_state (GST_ELEMENT (bin), NULL, NULL, GST_CLOCK_TIME_NONE);
/* Query the bin */
- fail_unless (gst_element_query (GST_ELEMENT (bin), &pos),
+ fail_unless (gst_element_query (GST_ELEMENT (bin), pos),
"Could not query pipeline position");
- fail_unless (gst_element_query (GST_ELEMENT (bin), &dur),
+ fail_unless (gst_element_query (GST_ELEMENT (bin), dur),
"Could not query pipeline duration");
/* Query elements */
- fail_unless (gst_element_query (GST_ELEMENT (src), &pos),
+ fail_unless (gst_element_query (GST_ELEMENT (src), pos),
"Could not query position of fakesrc");
- fail_unless (gst_element_query (GST_ELEMENT (src), &pos),
+ fail_unless (gst_element_query (GST_ELEMENT (src), pos),
"Could not query duration of fakesrc");
- fail_unless (gst_element_query (GST_ELEMENT (sink), &pos),
+ fail_unless (gst_element_query (GST_ELEMENT (sink), pos),
"Could not query position of fakesink");
- fail_unless (gst_element_query (GST_ELEMENT (sink), &pos),
+ fail_unless (gst_element_query (GST_ELEMENT (sink), pos),
"Could not query duration of fakesink");
/* Query pads */
fail_unless ((pad = gst_element_get_static_pad (src, "src")) != NULL,
"Could not get source pad of fakesrc");
- fail_unless (gst_pad_query (pad, &pos),
+ fail_unless (gst_pad_query (pad, pos),
"Could not query position of fakesrc src pad");
- fail_unless (gst_pad_query (pad, &dur),
+ fail_unless (gst_pad_query (pad, dur),
"Could not query duration of fakesrc src pad");
gst_object_unref (pad);