Commit 318ed075 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

Revert "-base_port to new query API"

This reverts commit c9f4e067.
parent 8549dd35
......@@ -45,7 +45,7 @@ static gboolean gst_gio_base_sink_event (GstBaseSink * base_sink,
GstEvent * event);
static GstFlowReturn gst_gio_base_sink_render (GstBaseSink * base_sink,
GstBuffer * buffer);
static gboolean gst_gio_base_sink_query (GstPad * pad, GstQuery ** query);
static gboolean gst_gio_base_sink_query (GstPad * pad, GstQuery * query);
static void
gst_gio_base_sink_class_init (GstGioBaseSinkClass * klass)
......@@ -312,31 +312,31 @@ gst_gio_base_sink_render (GstBaseSink * base_sink, GstBuffer * buffer)
}
static gboolean
gst_gio_base_sink_query (GstPad * pad, GstQuery ** query)
gst_gio_base_sink_query (GstPad * pad, GstQuery * query)
{
GstGioBaseSink *sink = GST_GIO_BASE_SINK (GST_PAD_PARENT (pad));
GstFormat format;
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_BYTES:
case GST_FORMAT_DEFAULT:
gst_query_set_position (*query, GST_FORMAT_BYTES, sink->position);
gst_query_set_position (query, GST_FORMAT_BYTES, sink->position);
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:
if (GST_IS_URI_HANDLER (sink)) {
const gchar *uri;
uri = gst_uri_handler_get_uri (GST_URI_HANDLER (sink));
gst_query_set_uri (*query, uri);
gst_query_set_uri (query, uri);
return TRUE;
}
return FALSE;
......
......@@ -51,7 +51,7 @@ static gboolean gst_gio_base_src_check_get_range (GstBaseSrc * base_src);
static GstFlowReturn gst_gio_base_src_create (GstBaseSrc * base_src,
guint64 offset, guint size, GstBuffer ** buf);
static gboolean gst_gio_base_src_query (GstBaseSrc * base_src,
GstQuery ** query);
GstQuery * query);
static void
gst_gio_base_src_class_init (GstGioBaseSrcClass * klass)
......@@ -418,16 +418,16 @@ gst_gio_base_src_create (GstBaseSrc * base_src, guint64 offset, guint size,
}
static gboolean
gst_gio_base_src_query (GstBaseSrc * base_src, GstQuery ** query)
gst_gio_base_src_query (GstBaseSrc * base_src, GstQuery * query)
{
gboolean ret = FALSE;
GstGioBaseSrc *src = GST_GIO_BASE_SRC (base_src);
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_URI:
if (GST_IS_URI_HANDLER (src)) {
const gchar *uri = gst_uri_handler_get_uri (GST_URI_HANDLER (src));
gst_query_set_uri (*query, uri);
gst_query_set_uri (query, uri);
ret = TRUE;
}
break;
......
......@@ -96,7 +96,7 @@ static GstFlowReturn gst_gnome_vfs_sink_render (GstBaseSink * basesink,
GstBuffer * buffer);
static gboolean gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink,
GstEvent * event);
static gboolean gst_gnome_vfs_sink_query (GstPad * pad, GstQuery ** query);
static gboolean gst_gnome_vfs_sink_query (GstPad * pad, GstQuery * query);
static guint gst_gnome_vfs_sink_signals[LAST_SIGNAL]; /* all 0 */
......@@ -481,31 +481,31 @@ gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink, GstEvent * event)
}
static gboolean
gst_gnome_vfs_sink_query (GstPad * pad, GstQuery ** query)
gst_gnome_vfs_sink_query (GstPad * pad, GstQuery * query)
{
GstGnomeVFSSink *sink;
GstFormat format;
sink = GST_GNOME_VFS_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, sink->current_pos);
gst_query_set_position (query, GST_FORMAT_BYTES, sink->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, sink->uri_name);
gst_query_set_uri (query, sink->uri_name);
return TRUE;
default:
......
......@@ -132,7 +132,7 @@ static gboolean gst_gnome_vfs_src_check_get_range (GstBaseSrc * src);
static gboolean gst_gnome_vfs_src_get_size (GstBaseSrc * src, guint64 * size);
static GstFlowReturn gst_gnome_vfs_src_create (GstBaseSrc * basesrc,
guint64 offset, guint size, GstBuffer ** buffer);
static gboolean gst_gnome_vfs_src_query (GstBaseSrc * src, GstQuery ** query);
static gboolean gst_gnome_vfs_src_query (GstBaseSrc * src, GstQuery * query);
#define gst_gnome_vfs_src_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstGnomeVFSSrc, gst_gnome_vfs_src, GST_TYPE_BASE_SRC,
......@@ -657,14 +657,14 @@ eos:
}
static gboolean
gst_gnome_vfs_src_query (GstBaseSrc * basesrc, GstQuery ** query)
gst_gnome_vfs_src_query (GstBaseSrc * basesrc, GstQuery * query)
{
gboolean ret = FALSE;
GstGnomeVFSSrc *src = GST_GNOME_VFS_SRC (basesrc);
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_URI:
gst_query_set_uri (*query, src->uri_name);
gst_query_set_uri (query, src->uri_name);
ret = TRUE;
break;
default:
......
......@@ -137,7 +137,7 @@ static GstFlowReturn gst_visual_chain (GstPad * pad, GstBuffer * buffer);
static gboolean gst_visual_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_visual_src_event (GstPad * pad, GstEvent * event);
static gboolean gst_visual_src_query (GstPad * pad, GstQuery ** query);
static gboolean gst_visual_src_query (GstPad * pad, GstQuery * query);
static gboolean gst_visual_sink_setcaps (GstPad * pad, GstCaps * caps);
static gboolean gst_visual_src_setcaps (GstPad * pad, GstCaps * caps);
......@@ -441,7 +441,7 @@ gst_vis_src_negotiate (GstVisual * visual)
/* find a pool for the negotiated caps now */
query = gst_query_new_allocation (target, TRUE);
if (gst_pad_peer_query (visual->srcpad, &query)) {
if (gst_pad_peer_query (visual->srcpad, query)) {
/* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
&alignment, &pool);
......@@ -451,7 +451,6 @@ gst_vis_src_negotiate (GstVisual * visual)
prefix = 0;
alignment = 1;
}
gst_query_unref (query);
if (pool == NULL) {
GstStructure *config;
......@@ -571,14 +570,14 @@ gst_visual_src_event (GstPad * pad, GstEvent * event)
}
static gboolean
gst_visual_src_query (GstPad * pad, GstQuery ** query)
gst_visual_src_query (GstPad * pad, GstQuery * query)
{
gboolean res;
GstVisual *visual;
visual = GST_VISUAL (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_LATENCY:
{
/* We need to send the query upstream and add the returned latency to our
......@@ -589,7 +588,7 @@ gst_visual_src_query (GstPad * pad, GstQuery ** query)
guint max_samples;
if ((res = gst_pad_peer_query (visual->sinkpad, query))) {
gst_query_parse_latency (*query, &us_live, &min_latency, &max_latency);
gst_query_parse_latency (query, &us_live, &min_latency, &max_latency);
GST_DEBUG_OBJECT (visual, "Peer latency: min %"
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
......@@ -613,7 +612,7 @@ gst_visual_src_query (GstPad * pad, GstQuery ** query)
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
GST_TIME_ARGS (min_latency), GST_TIME_ARGS (max_latency));
gst_query_set_latency (*query, TRUE, min_latency, max_latency);
gst_query_set_latency (query, TRUE, min_latency, max_latency);
}
break;
}
......
......@@ -112,7 +112,7 @@ static void gst_ogg_pad_dispose (GObject * object);
static void gst_ogg_pad_finalize (GObject * object);
static const GstQueryType *gst_ogg_pad_query_types (GstPad * pad);
static gboolean gst_ogg_pad_src_query (GstPad * pad, GstQuery ** query);
static gboolean gst_ogg_pad_src_query (GstPad * pad, GstQuery * query);
static gboolean gst_ogg_pad_event (GstPad * pad, GstEvent * event);
static GstOggPad *gst_ogg_chain_get_stream (GstOggChain * chain,
glong serialno);
......@@ -225,20 +225,20 @@ gst_ogg_pad_query_types (GstPad * pad)
}
static gboolean
gst_ogg_pad_src_query (GstPad * pad, GstQuery ** query)
gst_ogg_pad_src_query (GstPad * pad, GstQuery * query)
{
gboolean res = TRUE;
GstOggDemux *ogg;
ogg = GST_OGG_DEMUX (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
{
GstFormat format;
gint64 total_time = -1;
gst_query_parse_duration (*query, &format, NULL);
gst_query_parse_duration (query, &format, NULL);
/* can only get position in time */
if (format != GST_FORMAT_TIME)
goto wrong_format;
......@@ -255,7 +255,7 @@ gst_ogg_pad_src_query (GstPad * pad, GstQuery ** query)
/* ask upstream for total length in bytes */
uquery = gst_query_new_duration (GST_FORMAT_BYTES);
if (gst_pad_peer_query (ogg->sinkpad, &uquery)) {
if (gst_pad_peer_query (ogg->sinkpad, uquery)) {
gint64 length;
gst_query_parse_duration (uquery, NULL, &length);
......@@ -272,14 +272,14 @@ gst_ogg_pad_src_query (GstPad * pad, GstQuery ** query)
}
}
gst_query_set_duration (*query, GST_FORMAT_TIME, total_time);
gst_query_set_duration (query, GST_FORMAT_TIME, total_time);
break;
}
case GST_QUERY_SEEKING:
{
GstFormat format;
gst_query_parse_seeking (*query, &format, NULL, NULL, NULL);
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
if (format == GST_FORMAT_TIME) {
gboolean seekable = FALSE;
gint64 stop = -1;
......@@ -313,7 +313,7 @@ gst_ogg_pad_src_query (GstPad * pad, GstQuery ** query)
}
}
gst_query_set_seeking (*query, GST_FORMAT_TIME, seekable, 0, stop);
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable, 0, stop);
} else {
res = FALSE;
}
......
......@@ -153,7 +153,7 @@ static void gst_ogm_text_parse_init (GstOgmParse * ogm);
static const GstQueryType *gst_ogm_parse_get_sink_querytypes (GstPad * pad);
static gboolean gst_ogm_parse_sink_event (GstPad * pad, GstEvent * event);
static gboolean gst_ogm_parse_sink_query (GstPad * pad, GstQuery ** query);
static gboolean gst_ogm_parse_sink_query (GstPad * pad, GstQuery * query);
static gboolean gst_ogm_parse_sink_convert (GstPad * pad, GstFormat src_format,
gint64 src_value, GstFormat * dest_format, gint64 * dest_value);
......@@ -465,18 +465,18 @@ gst_ogm_parse_sink_convert (GstPad * pad,
}
static gboolean
gst_ogm_parse_sink_query (GstPad * pad, GstQuery ** query)
gst_ogm_parse_sink_query (GstPad * pad, GstQuery * query)
{
GstOgmParse *ogm = GST_OGM_PARSE (gst_pad_get_parent (pad));
GstFormat format;
gboolean res = FALSE;
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 val;
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
if (format != GST_FORMAT_DEFAULT && format != GST_FORMAT_TIME)
break;
......@@ -484,7 +484,7 @@ gst_ogm_parse_sink_query (GstPad * pad, GstQuery ** query)
if ((res = gst_ogm_parse_sink_convert (pad,
GST_FORMAT_DEFAULT, ogm->next_granulepos, &format, &val))) {
/* don't know the total length here.. */
gst_query_set_position (*query, format, val);
gst_query_set_position (query, format, val);
}
break;
}
......@@ -494,12 +494,10 @@ gst_ogm_parse_sink_query (GstPad * pad, GstQuery ** query)
gint64 src_val, dest_val;
/* peel off input */
gst_query_parse_convert (*query, &src_fmt, &src_val, &dest_fmt,
&dest_val);
if ((res =
gst_ogm_parse_sink_convert (pad, src_fmt, src_val, &dest_fmt,
&dest_val))) {
gst_query_set_convert (*query, src_fmt, src_val, dest_fmt, dest_val);
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
if ((res = gst_ogm_parse_sink_convert (pad, src_fmt, src_val,
&dest_fmt, &dest_val))) {
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
}
break;
}
......
......@@ -325,7 +325,7 @@ static gboolean gst_base_text_overlay_setcaps_txt (GstPad * pad,
static gboolean gst_base_text_overlay_src_event (GstPad * pad,
GstEvent * event);
static gboolean gst_base_text_overlay_src_query (GstPad * pad,
GstQuery ** query);
GstQuery * query);
static gboolean gst_base_text_overlay_video_event (GstPad * pad,
GstEvent * event);
......@@ -1004,7 +1004,7 @@ gst_base_text_overlay_get_property (GObject * object, guint prop_id,
}
static gboolean
gst_base_text_overlay_src_query (GstPad * pad, GstQuery ** query)
gst_base_text_overlay_src_query (GstPad * pad, GstQuery * query)
{
gboolean ret = FALSE;
GstBaseTextOverlay *overlay = NULL;
......
......@@ -95,7 +95,7 @@ static GstFlowReturn theora_dec_chain (GstPad * pad, GstBuffer * buffer);
static GstStateChangeReturn theora_dec_change_state (GstElement * element,
GstStateChange transition);
static gboolean theora_dec_src_event (GstPad * pad, GstEvent * event);
static gboolean theora_dec_src_query (GstPad * pad, GstQuery ** query);
static gboolean theora_dec_src_query (GstPad * pad, GstQuery * query);
static gboolean theora_dec_src_convert (GstPad * pad,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
......@@ -447,7 +447,7 @@ no_header:
#endif
static gboolean
theora_dec_src_query (GstPad * pad, GstQuery ** query)
theora_dec_src_query (GstPad * pad, GstQuery * query)
{
GstTheoraDec *dec;
......@@ -455,7 +455,7 @@ theora_dec_src_query (GstPad * pad, GstQuery ** query)
dec = GST_THEORA_DEC (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 value;
......@@ -463,24 +463,23 @@ theora_dec_src_query (GstPad * pad, GstQuery ** query)
gint64 time;
/* parse format */
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
time = dec->last_timestamp;
time = gst_segment_to_stream_time (&dec->segment, GST_FORMAT_TIME, time);
GST_LOG_OBJECT (dec,
"query %p: our time: %" GST_TIME_FORMAT, *query,
GST_TIME_ARGS (time));
"query %p: our time: %" GST_TIME_FORMAT, query, GST_TIME_ARGS (time));
if (!(res =
theora_dec_src_convert (pad, GST_FORMAT_TIME, time, &format,
&value)))
goto error;
gst_query_set_position (*query, format, value);
gst_query_set_position (query, format, value);
GST_LOG_OBJECT (dec,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", *query, value,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", query, value,
format);
break;
}
......@@ -498,14 +497,13 @@ theora_dec_src_query (GstPad * pad, GstQuery ** query)
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);
if (!(res =
theora_dec_src_convert (pad, src_fmt, src_val, &dest_fmt,
&dest_val)))
goto error;
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;
}
default:
......@@ -798,7 +796,7 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps)
/* find a pool for the negotiated caps now */
query = gst_query_new_allocation (caps, TRUE);
if (gst_pad_peer_query (dec->srcpad, &query)) {
if (gst_pad_peer_query (dec->srcpad, query)) {
GST_DEBUG_OBJECT (dec, "got downstream ALLOCATION hints");
/* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
......@@ -810,7 +808,6 @@ theora_negotiate_pool (GstTheoraDec * dec, GstCaps * caps)
prefix = 0;
alignment = 1;
}
gst_query_unref (query);
if (pool == NULL) {
GstStructure *config;
......
......@@ -98,7 +98,7 @@ static GstFlowReturn theora_parse_chain (GstPad * pad, GstBuffer * buffer);
static GstStateChangeReturn theora_parse_change_state (GstElement * element,
GstStateChange transition);
static gboolean theora_parse_sink_event (GstPad * pad, GstEvent * event);
static gboolean theora_parse_src_query (GstPad * pad, GstQuery ** query);
static gboolean theora_parse_src_query (GstPad * pad, GstQuery * query);
static void
gst_theora_parse_class_init (GstTheoraParseClass * klass)
......@@ -801,7 +801,7 @@ no_header:
}
static gboolean
theora_parse_src_query (GstPad * pad, GstQuery ** query)
theora_parse_src_query (GstPad * pad, GstQuery * query)
{
GstTheoraParse *parse;
......@@ -809,7 +809,7 @@ theora_parse_src_query (GstPad * pad, GstQuery ** query)
parse = GST_THEORA_PARSE (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 frame, value;
......@@ -819,10 +819,10 @@ theora_parse_src_query (GstPad * pad, GstQuery ** query)
frame = parse->prev_frame;
GST_LOG_OBJECT (parse,
"query %p: we have current frame: %" G_GINT64_FORMAT, *query, frame);
"query %p: we have current frame: %" G_GINT64_FORMAT, query, frame);
/* parse format */
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
/* and convert to the final format in two steps with time as the
* intermediate step */
......@@ -838,16 +838,16 @@ theora_parse_src_query (GstPad * pad, GstQuery ** query)
GST_LOG_OBJECT (parse,
"query %p: our time: %" GST_TIME_FORMAT " (conv to %s)",
*query, GST_TIME_ARGS (time), gst_format_get_name (format));
query, GST_TIME_ARGS (time), gst_format_get_name (format));
if (!(res =
theora_parse_src_convert (pad, my_format, time, &format, &value)))
goto error;
gst_query_set_position (*query, format, value);
gst_query_set_position (query, format, value);
GST_LOG_OBJECT (parse,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", *query, value,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", query, value,
format);
break;
......@@ -862,14 +862,13 @@ theora_parse_src_query (GstPad * pad, GstQuery ** query)
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);
if (!(res =
theora_parse_src_convert (pad, src_fmt, src_val, &dest_fmt,
&dest_val)))
goto error;
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;
}
default:
......
......@@ -78,12 +78,12 @@ static GstStateChangeReturn vorbis_dec_change_state (GstElement * element,
GstStateChange transition);
static gboolean vorbis_dec_src_event (GstPad * pad, GstEvent * event);
static gboolean vorbis_dec_src_query (GstPad * pad, GstQuery ** query);
static gboolean vorbis_dec_src_query (GstPad * pad, GstQuery * query);
static gboolean vorbis_dec_convert (GstPad * pad,
GstFormat src_format, gint64 src_value,
GstFormat * dest_format, gint64 * dest_value);
static gboolean vorbis_dec_sink_query (GstPad * pad, GstQuery ** query);
static gboolean vorbis_dec_sink_query (GstPad * pad, GstQuery * query);
static void
gst_vorbis_dec_class_init (GstVorbisDecClass * klass)
......@@ -284,7 +284,7 @@ no_format:
}
static gboolean
vorbis_dec_src_query (GstPad * pad, GstQuery ** query)
vorbis_dec_src_query (GstPad * pad, GstQuery * query)
{
GstVorbisDec *dec;
gboolean res = FALSE;
......@@ -293,14 +293,14 @@ vorbis_dec_src_query (GstPad * pad, GstQuery ** query)
if (G_UNLIKELY (dec == NULL))
return FALSE;
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
{
gint64 value;
GstFormat format;
gint64 time;
gst_query_parse_position (*query, &format, NULL);
gst_query_parse_position (query, &format, NULL);
/* we start from the last seen time */
time = dec->last_timestamp;
......@@ -308,18 +308,17 @@ vorbis_dec_src_query (GstPad * pad, GstQuery ** query)
time = gst_segment_to_stream_time (&dec->segment, GST_FORMAT_TIME, time);
GST_LOG_OBJECT (dec,
"query %p: our time: %" GST_TIME_FORMAT, *query,
GST_TIME_ARGS (time));
"query %p: our time: %" GST_TIME_FORMAT, query, GST_TIME_ARGS (time));
/* and convert to the final format */
if (!(res =
vorbis_dec_convert (pad, GST_FORMAT_TIME, time, &format, &value)))
goto error;
gst_query_set_position (*query, format, value);
gst_query_set_position (query, format, value);
GST_LOG_OBJECT (dec,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", *query, value,
"query %p: we return %" G_GINT64_FORMAT " (format %u)", query, value,
format);
break;
......@@ -337,12 +336,11 @@ vorbis_dec_src_query (GstPad * pad, GstQuery ** query)
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);
if (!(res =
vorbis_dec_convert (pad, src_fmt, src_val, &dest_fmt, &dest_val)))
goto error;
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;
}
default:
......@@ -363,25 +361,24 @@ error:
}
static gboolean
vorbis_dec_sink_query (GstPad * pad, GstQuery ** query)
vorbis_dec_sink_query (GstPad * pad, GstQuery * query)
{
GstVorbisDec *dec;
gboolean res;
dec = GST_VORBIS_DEC (gst_pad_get_parent (pad));
switch (GST_QUERY_TYPE (*query)) {
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_CONVERT:
{
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);
if (!(res =
vorbis_dec_convert (pad, src_fmt, src_val, &dest_fmt, &dest_val)))
goto error;
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;
}
default:
......