mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
parent
8549dd352d
commit
318ed07598
37 changed files with 237 additions and 255 deletions
|
@ -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:
|
||||
|
|
|
@ -443,7 +443,7 @@ gst_vorbis_enc_get_query_types (GstPad * pad)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
||||
gst_vorbis_enc_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
GstVorbisEnc *vorbisenc;
|
||||
|
@ -458,9 +458,9 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
GstFormat fmt, req_fmt;
|
||||
gint64 pos, val;
|
||||
|
||||
gst_query_parse_position (*query, &req_fmt, NULL);
|
||||
gst_query_parse_position (query, &req_fmt, NULL);
|
||||
if ((res = gst_pad_query_position (peerpad, &req_fmt, &val))) {
|
||||
gst_query_set_position (*query, req_fmt, val);
|
||||
gst_query_set_position (query, req_fmt, val);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -469,7 +469,7 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
break;
|
||||
|
||||
if ((res = gst_pad_query_convert (peerpad, fmt, pos, &req_fmt, &val))) {
|
||||
gst_query_set_position (*query, req_fmt, val);
|
||||
gst_query_set_position (query, req_fmt, val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -478,9 +478,9 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
GstFormat fmt, req_fmt;
|
||||
gint64 dur, val;
|
||||
|
||||
gst_query_parse_duration (*query, &req_fmt, NULL);
|
||||
gst_query_parse_duration (query, &req_fmt, NULL);
|
||||
if ((res = gst_pad_query_duration (peerpad, &req_fmt, &val))) {
|
||||
gst_query_set_duration (*query, req_fmt, val);
|
||||
gst_query_set_duration (query, req_fmt, val);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -489,7 +489,7 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
break;
|
||||
|
||||
if ((res = gst_pad_query_convert (peerpad, fmt, dur, &req_fmt, &val))) {
|
||||
gst_query_set_duration (*query, req_fmt, val);
|
||||
gst_query_set_duration (query, req_fmt, val);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -498,13 +498,12 @@ gst_vorbis_enc_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 =
|
||||
gst_vorbis_enc_convert_src (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;
|
||||
}
|
||||
case GST_QUERY_LATENCY:
|
||||
|
@ -514,7 +513,7 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
gint64 latency;
|
||||
|
||||
if ((res = gst_pad_query (peerpad, query))) {
|
||||
gst_query_parse_latency (*query, &live, &min_latency, &max_latency);
|
||||
gst_query_parse_latency (query, &live, &min_latency, &max_latency);
|
||||
|
||||
latency = gst_vorbis_enc_get_latency (vorbisenc);
|
||||
|
||||
|
@ -523,7 +522,7 @@ gst_vorbis_enc_src_query (GstPad * pad, GstQuery ** query)
|
|||
if (max_latency != -1)
|
||||
max_latency += latency;
|
||||
|
||||
gst_query_set_latency (*query, live, min_latency, max_latency);
|
||||
gst_query_set_latency (query, live, min_latency, max_latency);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -539,23 +538,22 @@ error:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vorbis_enc_sink_query (GstPad * pad, GstQuery ** query)
|
||||
gst_vorbis_enc_sink_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
||||
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 =
|
||||
gst_vorbis_enc_convert_sink (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:
|
||||
|
|
|
@ -79,7 +79,7 @@ static GstFlowReturn vorbis_parse_chain (GstPad * pad, GstBuffer * buffer);
|
|||
static GstStateChangeReturn vorbis_parse_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
static gboolean vorbis_parse_sink_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean vorbis_parse_src_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean vorbis_parse_src_query (GstPad * pad, GstQuery * query);
|
||||
static gboolean vorbis_parse_convert (GstPad * pad,
|
||||
GstFormat src_format, gint64 src_value,
|
||||
GstFormat * dest_format, gint64 * dest_value);
|
||||
|
@ -545,7 +545,7 @@ vorbis_parse_convert (GstPad * pad,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
vorbis_parse_src_query (GstPad * pad, GstQuery ** query)
|
||||
vorbis_parse_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gint64 granulepos;
|
||||
GstVorbisParse *parse;
|
||||
|
@ -553,7 +553,7 @@ vorbis_parse_src_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
parse = GST_VORBIS_PARSE (GST_PAD_PARENT (pad));
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_POSITION:
|
||||
{
|
||||
GstFormat format;
|
||||
|
@ -561,7 +561,7 @@ vorbis_parse_src_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
granulepos = parse->prev_granulepos;
|
||||
|
||||
gst_query_parse_position (*query, &format, NULL);
|
||||
gst_query_parse_position (query, &format, NULL);
|
||||
|
||||
/* and convert to the final format */
|
||||
if (!(res =
|
||||
|
@ -573,11 +573,11 @@ vorbis_parse_src_query (GstPad * pad, GstQuery ** query)
|
|||
value = (value - parse->segment_start) + parse->segment_time;
|
||||
*/
|
||||
|
||||
gst_query_set_position (*query, format, value);
|
||||
gst_query_set_position (query, format, value);
|
||||
|
||||
GST_LOG_OBJECT (parse, "query %p: peer returned granulepos: %"
|
||||
G_GUINT64_FORMAT " - we return %" G_GUINT64_FORMAT " (format %u)",
|
||||
*query, granulepos, value, format);
|
||||
query, granulepos, value, format);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -590,7 +590,7 @@ vorbis_parse_src_query (GstPad * pad, GstQuery ** query)
|
|||
parse->sinkpad);
|
||||
goto error;
|
||||
}
|
||||
if (!(res = gst_pad_peer_query (parse->sinkpad, query)))
|
||||
if (!(res = gst_pad_query (GST_PAD_PEER (parse->sinkpad), query)))
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
|
@ -599,13 +599,12 @@ vorbis_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 =
|
||||
vorbis_parse_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:
|
||||
|
|
|
@ -242,7 +242,7 @@ static gboolean gst_app_src_do_seek (GstBaseSrc * src, GstSegment * segment);
|
|||
static gboolean gst_app_src_is_seekable (GstBaseSrc * src);
|
||||
static gboolean gst_app_src_check_get_range (GstBaseSrc * src);
|
||||
static gboolean gst_app_src_do_get_size (GstBaseSrc * src, guint64 * size);
|
||||
static gboolean gst_app_src_query (GstBaseSrc * src, GstQuery ** query);
|
||||
static gboolean gst_app_src_query (GstBaseSrc * src, GstQuery * query);
|
||||
|
||||
static GstFlowReturn gst_app_src_push_buffer_action (GstAppSrc * appsrc,
|
||||
GstBuffer * buffer);
|
||||
|
@ -793,13 +793,13 @@ gst_app_src_do_get_size (GstBaseSrc * src, guint64 * size)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_app_src_query (GstBaseSrc * src, GstQuery ** query)
|
||||
gst_app_src_query (GstBaseSrc * src, GstQuery * query)
|
||||
{
|
||||
GstAppSrc *appsrc = GST_APP_SRC_CAST (src);
|
||||
GstAppSrcPrivate *priv = appsrc->priv;
|
||||
gboolean res;
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
GstClockTime min, max;
|
||||
|
@ -816,7 +816,7 @@ gst_app_src_query (GstBaseSrc * src, GstQuery ** query)
|
|||
max = priv->max_latency;
|
||||
g_mutex_unlock (priv->mutex);
|
||||
|
||||
gst_query_set_latency (*query, live, min, max);
|
||||
gst_query_set_latency (query, live, min, max);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -139,7 +139,7 @@ static GstStateChangeReturn gst_base_audio_sink_change_state (GstElement *
|
|||
element, GstStateChange transition);
|
||||
static gboolean gst_base_audio_sink_activate_pull (GstBaseSink * basesink,
|
||||
gboolean active);
|
||||
static gboolean gst_base_audio_sink_query (GstElement * element, GstQuery **
|
||||
static gboolean gst_base_audio_sink_query (GstElement * element, GstQuery *
|
||||
query);
|
||||
|
||||
static GstClock *gst_base_audio_sink_provide_clock (GstElement * elem);
|
||||
|
@ -160,7 +160,7 @@ static gboolean gst_base_audio_sink_setcaps (GstBaseSink * bsink,
|
|||
GstCaps * caps);
|
||||
static void gst_base_audio_sink_fixate (GstBaseSink * bsink, GstCaps * caps);
|
||||
|
||||
static gboolean gst_base_audio_sink_query_pad (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_base_audio_sink_query_pad (GstPad * pad, GstQuery * query);
|
||||
|
||||
|
||||
/* static guint gst_base_audio_sink_signals[LAST_SIGNAL] = { 0 }; */
|
||||
|
@ -338,14 +338,14 @@ clock_disabled:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_audio_sink_query_pad (GstPad * pad, GstQuery ** query)
|
||||
gst_base_audio_sink_query_pad (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
GstBaseAudioSink *basesink;
|
||||
|
||||
basesink = GST_BASE_AUDIO_SINK (gst_pad_get_parent (pad));
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_CONVERT:
|
||||
{
|
||||
GstFormat src_fmt, dest_fmt;
|
||||
|
@ -354,11 +354,11 @@ gst_base_audio_sink_query_pad (GstPad * pad, GstQuery ** query)
|
|||
GST_LOG_OBJECT (pad, "query convert");
|
||||
|
||||
if (basesink->ringbuffer) {
|
||||
gst_query_parse_convert (*query, &src_fmt, &src_val, &dest_fmt, NULL);
|
||||
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, NULL);
|
||||
res = gst_ring_buffer_convert (basesink->ringbuffer, src_fmt, src_val,
|
||||
dest_fmt, &dest_val);
|
||||
if (res) {
|
||||
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;
|
||||
|
@ -373,14 +373,14 @@ gst_base_audio_sink_query_pad (GstPad * pad, GstQuery ** query)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_audio_sink_query (GstElement * element, GstQuery ** query)
|
||||
gst_base_audio_sink_query (GstElement * element, GstQuery * query)
|
||||
{
|
||||
gboolean res = FALSE;
|
||||
GstBaseAudioSink *basesink;
|
||||
|
||||
basesink = GST_BASE_AUDIO_SINK (element);
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
gboolean live, us_live;
|
||||
|
@ -432,7 +432,7 @@ gst_base_audio_sink_query (GstElement * element, GstQuery ** query)
|
|||
min_latency = min_l;
|
||||
max_latency = max_l;
|
||||
}
|
||||
gst_query_set_latency (*query, live, min_latency, max_latency);
|
||||
gst_query_set_latency (query, live, min_latency, max_latency);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -444,11 +444,11 @@ gst_base_audio_sink_query (GstElement * element, GstQuery ** query)
|
|||
GST_LOG_OBJECT (basesink, "query convert");
|
||||
|
||||
if (basesink->ringbuffer) {
|
||||
gst_query_parse_convert (*query, &src_fmt, &src_val, &dest_fmt, NULL);
|
||||
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, NULL);
|
||||
res = gst_ring_buffer_convert (basesink->ringbuffer, src_fmt, src_val,
|
||||
dest_fmt, &dest_val);
|
||||
if (res) {
|
||||
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;
|
||||
|
|
|
@ -144,7 +144,7 @@ static gboolean gst_base_audio_src_event (GstBaseSrc * bsrc, GstEvent * event);
|
|||
static void gst_base_audio_src_get_times (GstBaseSrc * bsrc,
|
||||
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
|
||||
static gboolean gst_base_audio_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
|
||||
static gboolean gst_base_audio_src_query (GstBaseSrc * bsrc, GstQuery ** query);
|
||||
static gboolean gst_base_audio_src_query (GstBaseSrc * bsrc, GstQuery * query);
|
||||
static void gst_base_audio_src_fixate (GstBaseSrc * bsrc, GstCaps * caps);
|
||||
|
||||
/* static guint gst_base_audio_src_signals[LAST_SIGNAL] = { 0 }; */
|
||||
|
@ -617,12 +617,12 @@ gst_base_audio_src_get_times (GstBaseSrc * bsrc, GstBuffer * buffer,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_base_audio_src_query (GstBaseSrc * bsrc, GstQuery ** query)
|
||||
gst_base_audio_src_query (GstBaseSrc * bsrc, GstQuery * query)
|
||||
{
|
||||
GstBaseAudioSrc *src = GST_BASE_AUDIO_SRC (bsrc);
|
||||
gboolean res = FALSE;
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
GstClockTime min_latency, max_latency;
|
||||
|
@ -653,7 +653,7 @@ gst_base_audio_src_query (GstBaseSrc * bsrc, GstQuery ** query)
|
|||
|
||||
/* we are always live, the min latency is 1 segment and the max latency is
|
||||
* the complete buffer of segments. */
|
||||
gst_query_set_latency (*query, TRUE, min_latency, max_latency);
|
||||
gst_query_set_latency (query, TRUE, min_latency, max_latency);
|
||||
|
||||
res = TRUE;
|
||||
break;
|
||||
|
|
|
@ -122,7 +122,7 @@ static void gst_cdda_base_src_set_property (GObject * object, guint prop_id,
|
|||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_cdda_base_src_finalize (GObject * obj);
|
||||
static const GstQueryType *gst_cdda_base_src_get_query_types (GstPad * pad);
|
||||
static gboolean gst_cdda_base_src_query (GstBaseSrc * src, GstQuery ** query);
|
||||
static gboolean gst_cdda_base_src_query (GstBaseSrc * src, GstQuery * query);
|
||||
static gboolean gst_cdda_base_src_handle_event (GstBaseSrc * basesrc,
|
||||
GstEvent * event);
|
||||
static gboolean gst_cdda_base_src_do_seek (GstBaseSrc * basesrc,
|
||||
|
@ -585,7 +585,7 @@ not_started:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
||||
gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery * query)
|
||||
{
|
||||
GstCddaBaseSrc *src = GST_CDDA_BASE_SRC (basesrc);
|
||||
gboolean started;
|
||||
|
@ -593,15 +593,15 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
started = GST_OBJECT_FLAG_IS_SET (basesrc, GST_BASE_SRC_STARTED);
|
||||
|
||||
GST_LOG_OBJECT (src, "handling %s query",
|
||||
gst_query_type_get_name (GST_QUERY_TYPE (*query)));
|
||||
gst_query_type_get_name (GST_QUERY_TYPE (query)));
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_DURATION:{
|
||||
GstFormat dest_format;
|
||||
gint64 dest_val;
|
||||
guint sectors;
|
||||
|
||||
gst_query_parse_duration (*query, &dest_format, NULL);
|
||||
gst_query_parse_duration (query, &dest_format, NULL);
|
||||
|
||||
if (!started)
|
||||
return FALSE;
|
||||
|
@ -610,7 +610,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
|
||||
if (dest_format == track_format) {
|
||||
GST_LOG_OBJECT (src, "duration: %d tracks", src->num_tracks);
|
||||
gst_query_set_duration (*query, track_format, src->num_tracks);
|
||||
gst_query_set_duration (query, track_format, src->num_tracks);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -631,7 +631,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_query_set_duration (*query, dest_format, dest_val);
|
||||
gst_query_set_duration (query, dest_format, dest_val);
|
||||
|
||||
GST_LOG ("duration: %u sectors, %" G_GINT64_FORMAT " in format %s",
|
||||
sectors, dest_val, gst_format_get_name (dest_format));
|
||||
|
@ -642,7 +642,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
gint64 pos_sector;
|
||||
gint64 dest_val;
|
||||
|
||||
gst_query_parse_position (*query, &dest_format, NULL);
|
||||
gst_query_parse_position (query, &dest_format, NULL);
|
||||
|
||||
if (!started)
|
||||
return FALSE;
|
||||
|
@ -651,7 +651,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
|
||||
if (dest_format == track_format) {
|
||||
GST_LOG_OBJECT (src, "position: track %d", src->cur_track);
|
||||
gst_query_set_position (*query, track_format, src->cur_track);
|
||||
gst_query_set_position (query, track_format, src->cur_track);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -669,7 +669,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_query_set_position (*query, dest_format, dest_val);
|
||||
gst_query_set_position (query, dest_format, dest_val);
|
||||
|
||||
GST_LOG ("position: sector %u, %" G_GINT64_FORMAT " in format %s",
|
||||
(guint) pos_sector, dest_val, gst_format_get_name (dest_format));
|
||||
|
@ -679,7 +679,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
GstFormat src_format, dest_format;
|
||||
gint64 src_val, dest_val;
|
||||
|
||||
gst_query_parse_convert (*query, &src_format, &src_val, &dest_format,
|
||||
gst_query_parse_convert (query, &src_format, &src_val, &dest_format,
|
||||
NULL);
|
||||
|
||||
if (!gst_cdda_base_src_convert (src, src_format, src_val, dest_format,
|
||||
|
@ -687,8 +687,7 @@ gst_cdda_base_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gst_query_set_convert (*query, src_format, src_val, dest_format,
|
||||
dest_val);
|
||||
gst_query_set_convert (query, src_format, src_val, dest_format, dest_val);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
|
|
|
@ -955,7 +955,7 @@ discoverer_collect (GstDiscoverer * dc)
|
|||
}
|
||||
|
||||
if (dc->priv->seeking_query) {
|
||||
if (gst_element_query (pipeline, &dc->priv->seeking_query)) {
|
||||
if (gst_element_query (pipeline, dc->priv->seeking_query)) {
|
||||
gboolean seekable;
|
||||
|
||||
gst_query_parse_seeking (dc->priv->seeking_query, &format,
|
||||
|
|
|
@ -153,7 +153,7 @@ static gboolean gst_tag_demux_srcpad_event (GstPad * pad, GstEvent * event);
|
|||
static gboolean gst_tag_demux_sink_activate (GstPad * sinkpad);
|
||||
static GstStateChangeReturn gst_tag_demux_change_state (GstElement * element,
|
||||
GstStateChange transition);
|
||||
static gboolean gst_tag_demux_pad_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_tag_demux_pad_query (GstPad * pad, GstQuery * query);
|
||||
static const GstQueryType *gst_tag_demux_get_query_types (GstPad * pad);
|
||||
static gboolean gst_tag_demux_get_upstream_size (GstTagDemux * tagdemux);
|
||||
static void gst_tag_demux_send_pending_events (GstTagDemux * tagdemux);
|
||||
|
@ -1367,7 +1367,7 @@ gst_tag_demux_change_state (GstElement * element, GstStateChange transition)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_tag_demux_pad_query (GstPad * pad, GstQuery ** query)
|
||||
gst_tag_demux_pad_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
/* For a position or duration query, adjust the returned
|
||||
* bytes to strip off the end and start areas */
|
||||
|
@ -1387,22 +1387,22 @@ gst_tag_demux_pad_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
gst_object_unref (peer);
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_POSITION:
|
||||
{
|
||||
gst_query_parse_position (*query, &format, &result);
|
||||
gst_query_parse_position (query, &format, &result);
|
||||
if (format == GST_FORMAT_BYTES) {
|
||||
result -= demux->priv->strip_start;
|
||||
gst_query_set_position (*query, format, result);
|
||||
gst_query_set_position (query, format, result);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_DURATION:
|
||||
{
|
||||
gst_query_parse_duration (*query, &format, &result);
|
||||
gst_query_parse_duration (query, &format, &result);
|
||||
if (format == GST_FORMAT_BYTES) {
|
||||
result -= demux->priv->strip_start + demux->priv->strip_end;
|
||||
gst_query_set_duration (*query, format, result);
|
||||
gst_query_set_duration (query, format, result);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ static void gst_adder_get_property (GObject * object, guint prop_id,
|
|||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static gboolean gst_adder_setcaps (GstPad * pad, GstCaps * caps);
|
||||
static gboolean gst_adder_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_adder_query (GstPad * pad, GstQuery * query);
|
||||
static gboolean gst_adder_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_adder_sink_event (GstPad * pad, GstEvent * event);
|
||||
|
||||
|
@ -379,7 +379,7 @@ not_supported:
|
|||
* cases work at least somewhat.
|
||||
*/
|
||||
static gboolean
|
||||
gst_adder_query_duration (GstAdder * adder, GstQuery ** query)
|
||||
gst_adder_query_duration (GstAdder * adder, GstQuery * query)
|
||||
{
|
||||
gint64 max;
|
||||
gboolean res;
|
||||
|
@ -389,7 +389,7 @@ gst_adder_query_duration (GstAdder * adder, GstQuery ** query)
|
|||
GValue item = { 0, };
|
||||
|
||||
/* parse format */
|
||||
gst_query_parse_duration (*query, &format, NULL);
|
||||
gst_query_parse_duration (query, &format, NULL);
|
||||
|
||||
max = -1;
|
||||
res = TRUE;
|
||||
|
@ -443,14 +443,14 @@ gst_adder_query_duration (GstAdder * adder, GstQuery ** query)
|
|||
/* and store the max */
|
||||
GST_DEBUG_OBJECT (adder, "Total duration in format %s: %"
|
||||
GST_TIME_FORMAT, gst_format_get_name (format), GST_TIME_ARGS (max));
|
||||
gst_query_set_duration (*query, format, max);
|
||||
gst_query_set_duration (query, format, max);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_adder_query_latency (GstAdder * adder, GstQuery ** query)
|
||||
gst_adder_query_latency (GstAdder * adder, GstQuery * query)
|
||||
{
|
||||
GstClockTime min, max;
|
||||
gboolean live;
|
||||
|
@ -486,7 +486,7 @@ gst_adder_query_latency (GstAdder * adder, GstQuery ** query)
|
|||
peerquery = gst_query_new_latency ();
|
||||
|
||||
/* Ask peer for latency */
|
||||
res &= gst_pad_peer_query (pad, &peerquery);
|
||||
res &= gst_pad_peer_query (pad, peerquery);
|
||||
|
||||
/* take max from all valid return values */
|
||||
if (res) {
|
||||
|
@ -528,33 +528,33 @@ gst_adder_query_latency (GstAdder * adder, GstQuery ** query)
|
|||
GST_DEBUG_OBJECT (adder, "Calculated total latency: live %s, min %"
|
||||
GST_TIME_FORMAT ", max %" GST_TIME_FORMAT,
|
||||
(live ? "yes" : "no"), GST_TIME_ARGS (min), GST_TIME_ARGS (max));
|
||||
gst_query_set_latency (*query, live, min, max);
|
||||
gst_query_set_latency (query, live, min, max);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_adder_query (GstPad * pad, GstQuery ** query)
|
||||
gst_adder_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstAdder *adder = GST_ADDER (gst_pad_get_parent (pad));
|
||||
gboolean res = FALSE;
|
||||
|
||||
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);
|
||||
|
||||
switch (format) {
|
||||
case GST_FORMAT_TIME:
|
||||
/* FIXME, bring to stream time, might be tricky */
|
||||
gst_query_set_position (*query, format, adder->segment.position);
|
||||
gst_query_set_position (query, format, adder->segment.position);
|
||||
res = TRUE;
|
||||
break;
|
||||
case GST_FORMAT_DEFAULT:
|
||||
gst_query_set_position (*query, format, adder->offset);
|
||||
gst_query_set_position (query, format, adder->offset);
|
||||
res = TRUE;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -142,7 +142,7 @@ static gboolean gst_audio_resample_event (GstBaseTransform * base,
|
|||
GstEvent * event);
|
||||
static gboolean gst_audio_resample_start (GstBaseTransform * base);
|
||||
static gboolean gst_audio_resample_stop (GstBaseTransform * base);
|
||||
static gboolean gst_audio_resample_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_audio_resample_query (GstPad * pad, GstQuery * query);
|
||||
static const GstQueryType *gst_audio_resample_query_type (GstPad * pad);
|
||||
|
||||
#define gst_audio_resample_parent_class parent_class
|
||||
|
@ -1249,7 +1249,7 @@ gst_audio_resample_transform (GstBaseTransform * base, GstBuffer * inbuf,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_audio_resample_query (GstPad * pad, GstQuery ** query)
|
||||
gst_audio_resample_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstAudioResample *resample = GST_AUDIO_RESAMPLE (gst_pad_get_parent (pad));
|
||||
GstBaseTransform *trans;
|
||||
|
@ -1259,7 +1259,7 @@ gst_audio_resample_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
trans = GST_BASE_TRANSFORM (resample);
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
GstClockTime min, max;
|
||||
|
@ -1280,7 +1280,7 @@ gst_audio_resample_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
if ((peer = gst_pad_get_peer (GST_BASE_TRANSFORM_SINK_PAD (trans)))) {
|
||||
if ((res = gst_pad_query (peer, query))) {
|
||||
gst_query_parse_latency (*query, &live, &min, &max);
|
||||
gst_query_parse_latency (query, &live, &min, &max);
|
||||
|
||||
GST_DEBUG_OBJECT (resample, "Peer latency: min %"
|
||||
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
|
||||
|
@ -1304,7 +1304,7 @@ gst_audio_resample_query (GstPad * pad, GstQuery ** query)
|
|||
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (min), GST_TIME_ARGS (max));
|
||||
|
||||
gst_query_set_latency (*query, live, min, max);
|
||||
gst_query_set_latency (query, live, min, max);
|
||||
}
|
||||
gst_object_unref (peer);
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ static gboolean gst_audio_test_src_check_get_range (GstBaseSrc * basesrc);
|
|||
static gboolean gst_audio_test_src_do_seek (GstBaseSrc * basesrc,
|
||||
GstSegment * segment);
|
||||
static gboolean gst_audio_test_src_query (GstBaseSrc * basesrc,
|
||||
GstQuery ** query);
|
||||
GstQuery * query);
|
||||
|
||||
static void gst_audio_test_src_change_wave (GstAudioTestSrc * src);
|
||||
|
||||
|
@ -355,19 +355,18 @@ gst_audio_test_src_setcaps (GstBaseSrc * basesrc, GstCaps * caps)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
||||
gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery * query)
|
||||
{
|
||||
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (basesrc);
|
||||
gboolean res = FALSE;
|
||||
|
||||
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 (src_fmt == dest_fmt) {
|
||||
dest_val = src_val;
|
||||
goto done;
|
||||
|
@ -402,7 +401,7 @@ gst_audio_test_src_query (GstBaseSrc * basesrc, GstQuery ** query)
|
|||
goto error;
|
||||
}
|
||||
done:
|
||||
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);
|
||||
res = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ gst_stream_combiner_src_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_stream_combiner_src_query (GstPad * pad, GstQuery ** query)
|
||||
gst_stream_combiner_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstStreamCombiner *stream_combiner =
|
||||
(GstStreamCombiner *) GST_PAD_PARENT (pad);
|
||||
|
|
|
@ -353,7 +353,7 @@ gst_stream_splitter_src_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_stream_splitter_src_query (GstPad * pad, GstQuery ** query)
|
||||
gst_stream_splitter_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstStreamSplitter *stream_splitter =
|
||||
(GstStreamSplitter *) GST_PAD_PARENT (pad);
|
||||
|
|
|
@ -535,7 +535,7 @@ static GstStateChangeReturn gst_play_bin_change_state (GstElement * element,
|
|||
GstStateChange transition);
|
||||
|
||||
static void gst_play_bin_handle_message (GstBin * bin, GstMessage * message);
|
||||
static gboolean gst_play_bin_query (GstElement * element, GstQuery ** query);
|
||||
static gboolean gst_play_bin_query (GstElement * element, GstQuery * query);
|
||||
|
||||
static GstTagList *gst_play_bin_get_video_tags (GstPlayBin * playbin,
|
||||
gint stream);
|
||||
|
@ -2102,14 +2102,14 @@ gst_play_bin_update_cached_duration (GstPlayBin * playbin)
|
|||
query = gst_query_new_duration (formats[i]);
|
||||
ret =
|
||||
GST_ELEMENT_CLASS (parent_class)->query (GST_ELEMENT_CAST (playbin),
|
||||
&query);
|
||||
query);
|
||||
gst_play_bin_update_cached_duration_from_query (playbin, ret, query);
|
||||
gst_query_unref (query);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_play_bin_query (GstElement * element, GstQuery ** query)
|
||||
gst_play_bin_query (GstElement * element, GstQuery * query)
|
||||
{
|
||||
GstPlayBin *playbin = GST_PLAY_BIN (element);
|
||||
gboolean ret;
|
||||
|
@ -2125,7 +2125,7 @@ gst_play_bin_query (GstElement * element, GstQuery ** query)
|
|||
*/
|
||||
GST_PLAY_BIN_LOCK (playbin);
|
||||
|
||||
if (GST_QUERY_TYPE (*query) == GST_QUERY_DURATION) {
|
||||
if (GST_QUERY_TYPE (query) == GST_QUERY_DURATION) {
|
||||
GstSourceGroup *group = playbin->curr_group;
|
||||
gboolean pending;
|
||||
|
||||
|
@ -2142,11 +2142,11 @@ gst_play_bin_query (GstElement * element, GstQuery ** query)
|
|||
gint i;
|
||||
|
||||
ret = FALSE;
|
||||
gst_query_parse_duration (*query, &fmt, NULL);
|
||||
gst_query_parse_duration (query, &fmt, NULL);
|
||||
for (i = 0; i < G_N_ELEMENTS (playbin->duration); i++) {
|
||||
if (fmt == playbin->duration[i].format) {
|
||||
ret = playbin->duration[i].valid;
|
||||
gst_query_set_duration (*query, fmt,
|
||||
gst_query_set_duration (query, fmt,
|
||||
(ret ? playbin->duration[i].duration : -1));
|
||||
break;
|
||||
}
|
||||
|
@ -2166,8 +2166,8 @@ gst_play_bin_query (GstElement * element, GstQuery ** query)
|
|||
|
||||
ret = GST_ELEMENT_CLASS (parent_class)->query (element, query);
|
||||
|
||||
if (GST_QUERY_TYPE (*query) == GST_QUERY_DURATION)
|
||||
gst_play_bin_update_cached_duration_from_query (playbin, ret, *query);
|
||||
if (GST_QUERY_TYPE (query) == GST_QUERY_DURATION)
|
||||
gst_play_bin_update_cached_duration_from_query (playbin, ret, query);
|
||||
GST_PLAY_BIN_UNLOCK (playbin);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -134,12 +134,12 @@ gst_stream_synchronizer_iterate_internal_links (GstPad * pad)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_stream_synchronizer_query (GstPad * pad, GstQuery ** query)
|
||||
gst_stream_synchronizer_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstPad *opad;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GST_LOG_OBJECT (pad, "Handling query %s", GST_QUERY_TYPE_NAME (*query));
|
||||
GST_LOG_OBJECT (pad, "Handling query %s", GST_QUERY_TYPE_NAME (query));
|
||||
|
||||
opad = gst_stream_get_other_pad_from_pad (pad);
|
||||
if (opad) {
|
||||
|
|
|
@ -205,7 +205,7 @@ static void gst_uri_decode_bin_finalize (GObject * obj);
|
|||
static void handle_message (GstBin * bin, GstMessage * msg);
|
||||
|
||||
static gboolean gst_uri_decode_bin_query (GstElement * element,
|
||||
GstQuery ** query);
|
||||
GstQuery * query);
|
||||
static GstStateChangeReturn gst_uri_decode_bin_change_state (GstElement *
|
||||
element, GstStateChange transition);
|
||||
|
||||
|
@ -2214,7 +2214,7 @@ handle_message (GstBin * bin, GstMessage * msg)
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
GstQuery **query;
|
||||
GstQuery *query;
|
||||
gint64 min;
|
||||
gint64 max;
|
||||
gboolean seekable;
|
||||
|
@ -2246,7 +2246,7 @@ decoder_query_duration_fold (const GValue * item, GValue * ret,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -2261,9 +2261,9 @@ decoder_query_duration_done (GstURIDecodeBin * dec, QueryFold * fold)
|
|||
{
|
||||
GstFormat format;
|
||||
|
||||
gst_query_parse_duration (*fold->query, &format, NULL);
|
||||
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 ("max duration %" G_GINT64_FORMAT, fold->max);
|
||||
}
|
||||
|
@ -2279,7 +2279,7 @@ decoder_query_position_fold (const GValue * item, GValue * ret,
|
|||
|
||||
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);
|
||||
|
||||
|
@ -2295,9 +2295,9 @@ decoder_query_position_done (GstURIDecodeBin * dec, QueryFold * fold)
|
|||
{
|
||||
GstFormat format;
|
||||
|
||||
gst_query_parse_position (*fold->query, &format, NULL);
|
||||
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 (dec, "max position %" G_GINT64_FORMAT, fold->max);
|
||||
}
|
||||
|
@ -2313,7 +2313,7 @@ decoder_query_latency_fold (const GValue * item, GValue * ret, QueryFold * fold)
|
|||
|
||||
g_value_set_boolean (ret, TRUE);
|
||||
|
||||
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
|
||||
|
@ -2338,7 +2338,7 @@ static void
|
|||
decoder_query_latency_done (GstURIDecodeBin * dec, QueryFold * fold)
|
||||
{
|
||||
/* store max in query result */
|
||||
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 (dec,
|
||||
"latency min %" GST_TIME_FORMAT ", max %" GST_TIME_FORMAT
|
||||
|
@ -2356,7 +2356,7 @@ decoder_query_seeking_fold (const GValue * item, GValue * ret, QueryFold * fold)
|
|||
gboolean seekable;
|
||||
|
||||
g_value_set_boolean (ret, TRUE);
|
||||
gst_query_parse_seeking (*fold->query, NULL, &seekable, NULL, NULL);
|
||||
gst_query_parse_seeking (fold->query, NULL, &seekable, NULL, NULL);
|
||||
|
||||
GST_DEBUG_OBJECT (item, "got seekable %d", seekable);
|
||||
|
||||
|
@ -2372,8 +2372,8 @@ decoder_query_seeking_done (GstURIDecodeBin * dec, QueryFold * fold)
|
|||
{
|
||||
GstFormat format;
|
||||
|
||||
gst_query_parse_seeking (*fold->query, &format, NULL, NULL, NULL);
|
||||
gst_query_set_seeking (*fold->query, format, fold->seekable, 0, -1);
|
||||
gst_query_parse_seeking (fold->query, &format, NULL, NULL, NULL);
|
||||
gst_query_set_seeking (fold->query, format, fold->seekable, 0, -1);
|
||||
|
||||
GST_DEBUG_OBJECT (dec, "seekable %d", fold->seekable);
|
||||
}
|
||||
|
@ -2399,7 +2399,7 @@ decoder_query_generic_fold (const GValue * item, GValue * ret, QueryFold * fold)
|
|||
* have normally. We should just query all source pads.
|
||||
*/
|
||||
static gboolean
|
||||
gst_uri_decode_bin_query (GstElement * element, GstQuery ** query)
|
||||
gst_uri_decode_bin_query (GstElement * element, GstQuery * query)
|
||||
{
|
||||
GstURIDecodeBin *decoder;
|
||||
gboolean res = FALSE;
|
||||
|
@ -2412,7 +2412,7 @@ gst_uri_decode_bin_query (GstElement * element, GstQuery ** query)
|
|||
|
||||
decoder = GST_URI_DECODE_BIN (element);
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_DURATION:
|
||||
/* iterate and collect durations */
|
||||
fold_func = (GstIteratorFoldFunction) decoder_query_duration_fold;
|
||||
|
@ -2449,7 +2449,7 @@ gst_uri_decode_bin_query (GstElement * element, GstQuery ** query)
|
|||
|
||||
iter = gst_element_iterate_src_pads (element);
|
||||
GST_DEBUG_OBJECT (element, "Sending query %p (type %d) to src pads",
|
||||
*query, GST_QUERY_TYPE (*query));
|
||||
query, GST_QUERY_TYPE (query));
|
||||
|
||||
if (fold_init)
|
||||
fold_init (decoder, &fold_data);
|
||||
|
|
|
@ -81,7 +81,7 @@ static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
|
|||
|
||||
|
||||
static gboolean gst_sub_parse_src_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_sub_parse_src_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_sub_parse_src_query (GstPad * pad, GstQuery * query);
|
||||
static gboolean gst_sub_parse_sink_event (GstPad * pad, GstEvent * event);
|
||||
|
||||
static GstStateChangeReturn gst_sub_parse_change_state (GstElement * element,
|
||||
|
@ -209,24 +209,23 @@ gst_sub_parse_init (GstSubParse * subparse)
|
|||
*/
|
||||
|
||||
static gboolean
|
||||
gst_sub_parse_src_query (GstPad * pad, GstQuery ** query)
|
||||
gst_sub_parse_src_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstSubParse *self = GST_SUBPARSE (gst_pad_get_parent (pad));
|
||||
gboolean ret = FALSE;
|
||||
|
||||
GST_DEBUG ("Handling %s query", GST_QUERY_TYPE_NAME (*query));
|
||||
GST_DEBUG ("Handling %s query", GST_QUERY_TYPE_NAME (query));
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_POSITION:{
|
||||
GstFormat fmt;
|
||||
|
||||
gst_query_parse_position (*query, &fmt, NULL);
|
||||
gst_query_parse_position (query, &fmt, NULL);
|
||||
if (fmt != GST_FORMAT_TIME) {
|
||||
ret = gst_pad_peer_query (self->sinkpad, query);
|
||||
} else {
|
||||
ret = TRUE;
|
||||
gst_query_set_position (*query, GST_FORMAT_TIME,
|
||||
self->segment.position);
|
||||
gst_query_set_position (query, GST_FORMAT_TIME, self->segment.position);
|
||||
}
|
||||
}
|
||||
case GST_QUERY_SEEKING:
|
||||
|
@ -236,17 +235,17 @@ gst_sub_parse_src_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
ret = TRUE;
|
||||
|
||||
gst_query_parse_seeking (*query, &fmt, NULL, NULL, NULL);
|
||||
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
||||
if (fmt == GST_FORMAT_TIME) {
|
||||
GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES);
|
||||
|
||||
seekable = gst_pad_peer_query (self->sinkpad, &peerquery);
|
||||
seekable = gst_pad_peer_query (self->sinkpad, peerquery);
|
||||
if (seekable)
|
||||
gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL);
|
||||
gst_query_unref (peerquery);
|
||||
}
|
||||
|
||||
gst_query_set_seeking (*query, fmt, seekable, seekable ? 0 : -1, -1);
|
||||
gst_query_set_seeking (query, fmt, seekable, seekable ? 0 : -1, -1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ static GstStaticPadTemplate gst_video_rate_sink_template =
|
|||
static void gst_video_rate_swap_prev (GstVideoRate * videorate,
|
||||
GstBuffer * buffer, gint64 time);
|
||||
static gboolean gst_video_rate_event (GstPad * pad, GstEvent * event);
|
||||
static gboolean gst_video_rate_query (GstPad * pad, GstQuery ** query);
|
||||
static gboolean gst_video_rate_query (GstPad * pad, GstQuery * query);
|
||||
static GstFlowReturn gst_video_rate_chain (GstPad * pad, GstBuffer * buffer);
|
||||
|
||||
static void gst_video_rate_set_property (GObject * object,
|
||||
|
@ -740,14 +740,14 @@ format_error:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_video_rate_query (GstPad * pad, GstQuery ** query)
|
||||
gst_video_rate_query (GstPad * pad, GstQuery * query)
|
||||
{
|
||||
GstVideoRate *videorate;
|
||||
gboolean res = FALSE;
|
||||
|
||||
videorate = GST_VIDEO_RATE (gst_pad_get_parent (pad));
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
GstClockTime min, max;
|
||||
|
@ -757,7 +757,7 @@ gst_video_rate_query (GstPad * pad, GstQuery ** query)
|
|||
|
||||
if ((peer = gst_pad_get_peer (videorate->sinkpad))) {
|
||||
if ((res = gst_pad_query (peer, query))) {
|
||||
gst_query_parse_latency (*query, &live, &min, &max);
|
||||
gst_query_parse_latency (query, &live, &min, &max);
|
||||
|
||||
GST_DEBUG_OBJECT (videorate, "Peer latency: min %"
|
||||
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
|
||||
|
@ -786,7 +786,7 @@ gst_video_rate_query (GstPad * pad, GstQuery ** query)
|
|||
GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
|
||||
GST_TIME_ARGS (min), GST_TIME_ARGS (max));
|
||||
|
||||
gst_query_set_latency (*query, live, min, max);
|
||||
gst_query_set_latency (query, live, min, max);
|
||||
}
|
||||
gst_object_unref (peer);
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ static void gst_video_test_src_src_fixate (GstPad * pad, GstCaps * caps);
|
|||
static gboolean gst_video_test_src_is_seekable (GstBaseSrc * psrc);
|
||||
static gboolean gst_video_test_src_do_seek (GstBaseSrc * bsrc,
|
||||
GstSegment * segment);
|
||||
static gboolean gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery ** query);
|
||||
static gboolean gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery * query);
|
||||
|
||||
static void gst_video_test_src_get_times (GstBaseSrc * basesrc,
|
||||
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
|
||||
|
@ -697,7 +697,7 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
|
|||
/* find a pool for the negotiated caps now */
|
||||
query = gst_query_new_allocation (caps, TRUE);
|
||||
|
||||
if (gst_pad_peer_query (bsrc->srcpad, &query)) {
|
||||
if (gst_pad_peer_query (bsrc->srcpad, query)) {
|
||||
/* we got configuration from our peer, parse them */
|
||||
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
|
||||
&alignment, &pool);
|
||||
|
@ -708,7 +708,6 @@ gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
|
|||
alignment = 1;
|
||||
pool = NULL;
|
||||
}
|
||||
gst_query_unref (query);
|
||||
|
||||
if (pool == NULL) {
|
||||
GstStructure *config;
|
||||
|
@ -740,21 +739,20 @@ parse_failed:
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery ** query)
|
||||
gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery * query)
|
||||
{
|
||||
gboolean res;
|
||||
GstVideoTestSrc *src;
|
||||
|
||||
src = GST_VIDEO_TEST_SRC (bsrc);
|
||||
|
||||
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 (src_fmt == dest_fmt) {
|
||||
dest_val = src_val;
|
||||
goto done;
|
||||
|
@ -795,7 +793,7 @@ gst_video_test_src_query (GstBaseSrc * bsrc, GstQuery ** query)
|
|||
goto error;
|
||||
}
|
||||
done:
|
||||
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);
|
||||
res = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ static gboolean gst_v4lsrc_stop (GstBaseSrc * src);
|
|||
static gboolean gst_v4lsrc_set_caps (GstBaseSrc * src, GstCaps * caps);
|
||||
static GstCaps *gst_v4lsrc_get_caps (GstBaseSrc * src, GstCaps * filter);
|
||||
static GstFlowReturn gst_v4lsrc_create (GstPushSrc * src, GstBuffer ** out);
|
||||
static gboolean gst_v4lsrc_query (GstBaseSrc * bsrc, GstQuery ** query);
|
||||
static gboolean gst_v4lsrc_query (GstBaseSrc * bsrc, GstQuery * query);
|
||||
static void gst_v4lsrc_fixate (GstBaseSrc * bsrc, GstCaps * caps);
|
||||
|
||||
static void gst_v4lsrc_set_property (GObject * object,
|
||||
|
@ -639,14 +639,14 @@ gst_v4lsrc_set_caps (GstBaseSrc * src, GstCaps * caps)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_v4lsrc_query (GstBaseSrc * bsrc, GstQuery ** query)
|
||||
gst_v4lsrc_query (GstBaseSrc * bsrc, GstQuery * query)
|
||||
{
|
||||
GstV4lSrc *v4lsrc;
|
||||
gboolean res = FALSE;
|
||||
|
||||
v4lsrc = GST_V4LSRC (bsrc);
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_LATENCY:
|
||||
{
|
||||
GstClockTime min_latency, max_latency;
|
||||
|
@ -672,7 +672,7 @@ gst_v4lsrc_query (GstBaseSrc * bsrc, GstQuery ** query)
|
|||
|
||||
/* we are always live, the min latency is 1 frame and the max latency is
|
||||
* the complete buffer of frames. */
|
||||
gst_query_set_latency (*query, TRUE, min_latency, max_latency);
|
||||
gst_query_set_latency (query, TRUE, min_latency, max_latency);
|
||||
|
||||
res = TRUE;
|
||||
break;
|
||||
|
|
|
@ -1963,12 +1963,12 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery ** query)
|
||||
gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery * query)
|
||||
{
|
||||
GstXvImageSink *xvimagesink = GST_XVIMAGESINK (GST_PAD_PARENT (sinkpad));
|
||||
gboolean res = TRUE;
|
||||
|
||||
switch (GST_QUERY_TYPE (*query)) {
|
||||
switch (GST_QUERY_TYPE (query)) {
|
||||
case GST_QUERY_ALLOCATION:
|
||||
{
|
||||
GstCaps *caps;
|
||||
|
@ -1978,7 +1978,7 @@ gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery ** query)
|
|||
GstVideoFormat format;
|
||||
gint width, height;
|
||||
|
||||
gst_query_parse_allocation (*query, &caps, &need_pool);
|
||||
gst_query_parse_allocation (query, &caps, &need_pool);
|
||||
|
||||
if (caps == NULL)
|
||||
goto no_caps;
|
||||
|
@ -2000,10 +2000,10 @@ gst_xvimagesink_sink_query (GstPad * sinkpad, GstQuery ** query)
|
|||
if (!gst_buffer_pool_set_config (pool, config))
|
||||
goto config_failed;
|
||||
}
|
||||
gst_query_set_allocation_params (*query, size, 0, 0, 0, 16, pool);
|
||||
gst_query_set_allocation_params (query, size, 0, 0, 0, 16, pool);
|
||||
|
||||
/* we also support various metadata */
|
||||
gst_query_add_allocation_meta (*query, GST_META_API_VIDEO);
|
||||
gst_query_add_allocation_meta (query, GST_META_API_VIDEO);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -1192,7 +1192,7 @@ update_fill (gpointer data)
|
|||
GstQuery *query;
|
||||
|
||||
query = gst_query_new_buffering (GST_FORMAT_PERCENT);
|
||||
if (gst_element_query (element, &query)) {
|
||||
if (gst_element_query (element, query)) {
|
||||
gint64 start, stop, buffering_total;
|
||||
GstFormat format;
|
||||
gdouble fill;
|
||||
|
|
|
@ -1179,7 +1179,7 @@ update_fill (gpointer data)
|
|||
GstQuery *query;
|
||||
|
||||
query = gst_query_new_buffering (GST_FORMAT_PERCENT);
|
||||
if (gst_element_query (element, &query)) {
|
||||
if (gst_element_query (element, query)) {
|
||||
gint64 start, stop, buffering_total;
|
||||
GstFormat format;
|
||||
gdouble fill;
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
#include <gst/controller/gstinterpolationcontrolsource.h>
|
||||
|
||||
static void
|
||||
check_position (GstElement * elem, GstQuery ** pos, const gchar * info)
|
||||
check_position (GstElement * elem, GstQuery * pos, const gchar * info)
|
||||
{
|
||||
if (gst_element_query (elem, pos)) {
|
||||
gint64 play_pos;
|
||||
gst_query_parse_position (*pos, NULL, &play_pos);
|
||||
gst_query_parse_position (pos, NULL, &play_pos);
|
||||
GST_INFO ("pos : %" GST_TIME_FORMAT " %s", GST_TIME_ARGS (play_pos), info);
|
||||
} else {
|
||||
GST_WARNING ("position query failed");
|
||||
|
@ -187,21 +187,21 @@ main (gint argc, gchar ** argv)
|
|||
|
||||
if (gst_element_set_state (bin,
|
||||
GST_STATE_PLAYING) != GST_STATE_CHANGE_FAILURE) {
|
||||
check_position (bin, &pos, "start");
|
||||
check_position (bin, pos, "start");
|
||||
if ((wait_ret = gst_clock_id_wait (clock_id, NULL)) != GST_CLOCK_OK) {
|
||||
GST_WARNING ("clock_id_wait returned: %d", wait_ret);
|
||||
}
|
||||
}
|
||||
gst_clock_id_unref (clock_id);
|
||||
|
||||
check_position (bin, &pos, "before seek to new pos");
|
||||
check_position (bin, pos, "before seek to new pos");
|
||||
|
||||
/* seek to 3:00 sec (back 2 sec) */
|
||||
if (!gst_element_send_event (sink, pos_seek)) {
|
||||
GST_WARNING ("element failed to seek to new position");
|
||||
}
|
||||
|
||||
check_position (bin, &pos, "after seek to new pos");
|
||||
check_position (bin, pos, "after seek to new pos");
|
||||
|
||||
/* run for 2 seconds */
|
||||
clock_id =
|
||||
|
@ -212,14 +212,14 @@ main (gint argc, gchar ** argv)
|
|||
}
|
||||
gst_clock_id_unref (clock_id);
|
||||
|
||||
check_position (bin, &pos, "before slow down rate change");
|
||||
check_position (bin, pos, "before slow down rate change");
|
||||
|
||||
/* change playback rate to 0.5 */
|
||||
if (!gst_element_send_event (sink, rate_seek1)) {
|
||||
GST_WARNING ("element failed to change playback rate");
|
||||
}
|
||||
|
||||
check_position (bin, &pos, "after slow down rate change");
|
||||
check_position (bin, pos, "after slow down rate change");
|
||||
|
||||
/* run for 4 seconds */
|
||||
clock_id =
|
||||
|
@ -230,14 +230,14 @@ main (gint argc, gchar ** argv)
|
|||
}
|
||||
gst_clock_id_unref (clock_id);
|
||||
|
||||
check_position (bin, &pos, "before reverse rate change");
|
||||
check_position (bin, pos, "before reverse rate change");
|
||||
|
||||
/* change playback rate to -1.0 */
|
||||
if (!gst_element_send_event (sink, rate_seek2)) {
|
||||
GST_WARNING ("element failed to change playback rate");
|
||||
}
|
||||
|
||||
check_position (bin, &pos, "after reverse rate change");
|
||||
check_position (bin, pos, "after reverse rate change");
|
||||
|
||||
/* run for 7 seconds */
|
||||
clock_id =
|
||||
|
@ -248,7 +248,7 @@ main (gint argc, gchar ** argv)
|
|||
}
|
||||
gst_clock_id_unref (clock_id);
|
||||
|
||||
check_position (bin, &pos, "done");
|
||||
check_position (bin, pos, "done");
|
||||
|
||||
gst_element_set_state (bin, GST_STATE_NULL);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ dump_element_stats (GstElement * element)
|
|||
gst_caps_unref (caps);
|
||||
|
||||
query = gst_query_new_duration (GST_FORMAT_TIME);
|
||||
if (gst_pad_query (pad, &query)) {
|
||||
if (gst_pad_query (pad, query)) {
|
||||
gint64 duration;
|
||||
|
||||
gst_query_parse_duration (query, NULL, &duration);
|
||||
|
|
|
@ -147,7 +147,7 @@ main (gint argc, gchar * argv[])
|
|||
gst_caps_unref (caps);
|
||||
|
||||
query = gst_query_new_duration (GST_FORMAT_TIME);
|
||||
if (gst_pad_query (pad, &query)) {
|
||||
if (gst_pad_query (pad, query)) {
|
||||
gint64 duration;
|
||||
|
||||
gst_query_parse_duration (query, NULL, &duration);
|
||||
|
|
Loading…
Reference in a new issue