mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
Fix plugins for new query API
Original commit message from CVS: Fix plugins for new query API
This commit is contained in:
parent
88b88e114e
commit
4d36ba7e87
13 changed files with 85 additions and 93 deletions
|
@ -175,7 +175,7 @@ print_progress (GstPad *pad)
|
||||||
status[0] = '|';
|
status[0] = '|';
|
||||||
|
|
||||||
format = GST_FORMAT_PERCENT;
|
format = GST_FORMAT_PERCENT;
|
||||||
res = gst_pad_query (pad, GST_PAD_QUERY_POSITION, &format, &value);
|
res = gst_pad_query (pad, GST_QUERY_POSITION, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
percent = value / (2 * GST_FORMAT_PERCENT_SCALE);
|
percent = value / (2 * GST_FORMAT_PERCENT_SCALE);
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,6 @@ main (gint argc, gchar *argv[])
|
||||||
|
|
||||||
/* create index that elements can fill */
|
/* create index that elements can fill */
|
||||||
index = gst_index_factory_make ("memindex");
|
index = gst_index_factory_make ("memindex");
|
||||||
index = NULL;
|
|
||||||
if (verbose && index)
|
if (verbose && index)
|
||||||
g_signal_connect (G_OBJECT (index), "entry_added", G_CALLBACK (entry_added), NULL);
|
g_signal_connect (G_OBJECT (index), "entry_added", G_CALLBACK (entry_added), NULL);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ get_position_info (GstElement *cdparanoia)
|
||||||
definition = gst_format_get_details (*formats);
|
definition = gst_format_get_details (*formats);
|
||||||
|
|
||||||
format = *formats;
|
format = *formats;
|
||||||
res = gst_pad_query (pad, GST_PAD_QUERY_POSITION,
|
res = gst_pad_query (pad, GST_QUERY_POSITION,
|
||||||
&format, &position);
|
&format, &position);
|
||||||
|
|
||||||
if (format == GST_FORMAT_TIME) {
|
if (format == GST_FORMAT_TIME) {
|
||||||
|
@ -70,7 +70,7 @@ get_track_info (GstElement *cdparanoia)
|
||||||
definition = gst_format_get_details (*formats);
|
definition = gst_format_get_details (*formats);
|
||||||
|
|
||||||
format = *formats;
|
format = *formats;
|
||||||
res = gst_pad_query (pad, GST_PAD_QUERY_TOTAL,
|
res = gst_pad_query (pad, GST_QUERY_TOTAL,
|
||||||
&format, &total);
|
&format, &total);
|
||||||
if (res) {
|
if (res) {
|
||||||
if (format == GST_FORMAT_TIME) {
|
if (format == GST_FORMAT_TIME) {
|
||||||
|
|
|
@ -13,31 +13,19 @@ static guint64 duration;
|
||||||
|
|
||||||
static guint update_id;
|
static guint update_id;
|
||||||
|
|
||||||
//#define SOURCE "gnomevfssrc"
|
|
||||||
#define SOURCE "filesrc"
|
|
||||||
|
|
||||||
#define UPDATE_INTERVAL 500
|
#define UPDATE_INTERVAL 500
|
||||||
|
|
||||||
static GstElement*
|
static GstElement*
|
||||||
make_cdaudio_pipeline (gboolean thread)
|
make_cdaudio_pipeline (void)
|
||||||
{
|
{
|
||||||
GstElement *pipeline;
|
|
||||||
GstElement *cdaudio;
|
GstElement *cdaudio;
|
||||||
|
|
||||||
if (thread) {
|
|
||||||
pipeline = gst_thread_new ("app");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pipeline = gst_pipeline_new ("app");
|
|
||||||
}
|
|
||||||
|
|
||||||
cdaudio = gst_element_factory_make ("cdaudio", "cdaudio");
|
cdaudio = gst_element_factory_make ("cdaudio", "cdaudio");
|
||||||
|
g_assert (cdaudio != NULL);
|
||||||
gst_bin_add (GST_BIN (pipeline), cdaudio);
|
|
||||||
|
|
||||||
seekable_elements = g_list_prepend (seekable_elements, cdaudio);
|
seekable_elements = g_list_prepend (seekable_elements, cdaudio);
|
||||||
|
|
||||||
return pipeline;
|
return cdaudio;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gchar*
|
static gchar*
|
||||||
|
@ -91,7 +79,7 @@ query_durations ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_element_query (element, GST_PAD_QUERY_TOTAL, &format, &value);
|
res = gst_element_query (element, GST_QUERY_TOTAL, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +109,7 @@ query_positions ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_element_query (element, GST_PAD_QUERY_POSITION, &format, &value);
|
res = gst_element_query (element, GST_QUERY_POSITION, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +127,7 @@ static gboolean
|
||||||
update_scale (gpointer data)
|
update_scale (gpointer data)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
guint64 position;
|
guint64 position = 0;
|
||||||
GstFormat format = GST_FORMAT_TIME;
|
GstFormat format = GST_FORMAT_TIME;
|
||||||
|
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
@ -147,12 +135,14 @@ update_scale (gpointer data)
|
||||||
|
|
||||||
if (seekable_elements) {
|
if (seekable_elements) {
|
||||||
GstElement *element = GST_ELEMENT (seekable_elements->data);
|
GstElement *element = GST_ELEMENT (seekable_elements->data);
|
||||||
gst_element_query (element, GST_PAD_QUERY_TOTAL, &format, &duration);
|
gst_element_query (element, GST_QUERY_TOTAL, &format, &duration);
|
||||||
}
|
}
|
||||||
position = gst_clock_get_time (clock);
|
if (clock)
|
||||||
|
position = gst_clock_get_time (clock);
|
||||||
|
|
||||||
if (stats) {
|
if (stats) {
|
||||||
g_print ("clock: %13llu (%s)\n", position, gst_object_get_name (GST_OBJECT (clock)));
|
if (clock)
|
||||||
|
g_print ("clock: %13llu (%s)\n", position, gst_object_get_name (GST_OBJECT (clock)));
|
||||||
query_durations ();
|
query_durations ();
|
||||||
query_positions ();
|
query_positions ();
|
||||||
}
|
}
|
||||||
|
@ -168,6 +158,7 @@ iterate (gpointer data)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
|
||||||
|
g_print ("iterate\n");
|
||||||
res = gst_bin_iterate (GST_BIN (data));
|
res = gst_bin_iterate (GST_BIN (data));
|
||||||
if (!res) {
|
if (!res) {
|
||||||
gtk_timeout_remove (update_id);
|
gtk_timeout_remove (update_id);
|
||||||
|
@ -249,10 +240,7 @@ main (int argc, char **argv)
|
||||||
GtkWidget *window, *hbox, *vbox,
|
GtkWidget *window, *hbox, *vbox,
|
||||||
*play_button, *pause_button, *stop_button,
|
*play_button, *pause_button, *stop_button,
|
||||||
*hscale;
|
*hscale;
|
||||||
gboolean threaded = FALSE;
|
|
||||||
struct poptOption options[] = {
|
struct poptOption options[] = {
|
||||||
{"threaded", 't', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &threaded, 0,
|
|
||||||
"Run the pipeline in a toplevel thread", NULL},
|
|
||||||
{"stats", 's', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &stats, 0,
|
{"stats", 's', POPT_ARG_NONE|POPT_ARGFLAG_STRIP, &stats, 0,
|
||||||
"Show element stats", NULL},
|
"Show element stats", NULL},
|
||||||
POPT_TABLEEND
|
POPT_TABLEEND
|
||||||
|
@ -261,7 +249,10 @@ main (int argc, char **argv)
|
||||||
gst_init_with_popt_table (&argc, &argv, options);
|
gst_init_with_popt_table (&argc, &argv, options);
|
||||||
gtk_init (&argc, &argv);
|
gtk_init (&argc, &argv);
|
||||||
|
|
||||||
pipeline = make_cdaudio_pipeline (threaded);
|
pipeline = make_cdaudio_pipeline ();
|
||||||
|
|
||||||
|
g_signal_connect (pipeline, "deep_notify", G_CALLBACK (gst_element_default_deep_notify), NULL);
|
||||||
|
g_signal_connect (pipeline, "error", G_CALLBACK (gst_element_default_error), NULL);
|
||||||
|
|
||||||
/* initialize gui elements ... */
|
/* initialize gui elements ... */
|
||||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
|
@ -303,6 +294,8 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
|
|
||||||
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
||||||
gst_buffer_print_stats();
|
gst_buffer_print_stats();
|
||||||
gst_event_print_stats();
|
gst_event_print_stats();
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,7 @@ make_mpeg_pipeline (const gchar *location)
|
||||||
g_object_set (G_OBJECT (src), "location", location, NULL);
|
g_object_set (G_OBJECT (src), "location", location, NULL);
|
||||||
|
|
||||||
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
|
demux = gst_element_factory_make_or_warn ("mpegdemux", "demux");
|
||||||
//g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
|
g_object_set (G_OBJECT (demux), "sync", TRUE, NULL);
|
||||||
|
|
||||||
seekable_elements = g_list_prepend (seekable_elements, demux);
|
seekable_elements = g_list_prepend (seekable_elements, demux);
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ query_durations ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_pad_query (pad, GST_PAD_QUERY_TOTAL, &format, &value);
|
res = gst_pad_query (pad, GST_QUERY_TOTAL, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -635,7 +635,7 @@ query_positions ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_pad_query (pad, GST_PAD_QUERY_POSITION, &format, &value);
|
res = gst_pad_query (pad, GST_QUERY_POSITION, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -662,7 +662,7 @@ update_scale (gpointer data)
|
||||||
|
|
||||||
if (seekable_pads) {
|
if (seekable_pads) {
|
||||||
GstPad *pad = GST_PAD (seekable_pads->data);
|
GstPad *pad = GST_PAD (seekable_pads->data);
|
||||||
gst_pad_query (pad, GST_PAD_QUERY_TOTAL, &format, &duration);
|
gst_pad_query (pad, GST_QUERY_TOTAL, &format, &duration);
|
||||||
}
|
}
|
||||||
position = gst_clock_get_time (clock);
|
position = gst_clock_get_time (clock);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ query_durations ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_element_query (element, GST_PAD_QUERY_TOTAL, &format, &value);
|
res = gst_element_query (element, GST_QUERY_TOTAL, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ query_positions ()
|
||||||
GstFormat format;
|
GstFormat format;
|
||||||
|
|
||||||
format = seek_formats[i].format;
|
format = seek_formats[i].format;
|
||||||
res = gst_element_query (element, GST_PAD_QUERY_POSITION, &format, &value);
|
res = gst_element_query (element, GST_QUERY_POSITION, &format, &value);
|
||||||
if (res) {
|
if (res) {
|
||||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ update_scale (gpointer data)
|
||||||
|
|
||||||
if (seekable_elements) {
|
if (seekable_elements) {
|
||||||
GstElement *element = GST_ELEMENT (seekable_elements->data);
|
GstElement *element = GST_ELEMENT (seekable_elements->data);
|
||||||
gst_element_query (element, GST_PAD_QUERY_TOTAL, &format, &duration);
|
gst_element_query (element, GST_QUERY_TOTAL, &format, &duration);
|
||||||
}
|
}
|
||||||
position = gst_clock_get_time (clock);
|
position = gst_clock_get_time (clock);
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ collect_stream_properties (struct probe_context *context)
|
||||||
format = *formats;
|
format = *formats;
|
||||||
formats++;
|
formats++;
|
||||||
|
|
||||||
res = gst_pad_query (context->pad, GST_PAD_QUERY_TOTAL,
|
res = gst_pad_query (context->pad, GST_QUERY_TOTAL,
|
||||||
&format, &value);
|
&format, &value);
|
||||||
|
|
||||||
definition = gst_format_get_details (format);
|
definition = gst_format_get_details (format);
|
||||||
|
|
|
@ -71,11 +71,11 @@ main (gint argc, gchar *argv[])
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
format = GST_FORMAT_TIME;
|
||||||
/* get the position */
|
/* get the position */
|
||||||
gst_pad_query (enc_src, GST_PAD_QUERY_POSITION,
|
gst_pad_query (enc_src, GST_QUERY_POSITION,
|
||||||
&format, &position);
|
&format, &position);
|
||||||
|
|
||||||
/* get the total duration */
|
/* get the total duration */
|
||||||
gst_pad_query (enc_src, GST_PAD_QUERY_TOTAL,
|
gst_pad_query (enc_src, GST_QUERY_TOTAL,
|
||||||
&format, &duration);
|
&format, &duration);
|
||||||
|
|
||||||
format = GST_FORMAT_BYTES;
|
format = GST_FORMAT_BYTES;
|
||||||
|
|
|
@ -189,9 +189,9 @@ gst_dvdec_quality_get_type (void)
|
||||||
static void gst_dvdec_class_init (GstDVDecClass *klass);
|
static void gst_dvdec_class_init (GstDVDecClass *klass);
|
||||||
static void gst_dvdec_init (GstDVDec *dvdec);
|
static void gst_dvdec_init (GstDVDec *dvdec);
|
||||||
|
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_dvdec_get_src_query_types (GstPad *pad);
|
gst_dvdec_get_src_query_types (GstPad *pad);
|
||||||
static gboolean gst_dvdec_src_query (GstPad *pad, GstPadQueryType type,
|
static gboolean gst_dvdec_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
static const GstFormat* gst_dvdec_get_formats (GstPad *pad);
|
static const GstFormat* gst_dvdec_get_formats (GstPad *pad);
|
||||||
static gboolean gst_dvdec_sink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
static gboolean gst_dvdec_sink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
|
@ -458,19 +458,19 @@ gst_dvdec_sink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_dvdec_get_src_query_types (GstPad *pad)
|
gst_dvdec_get_src_query_types (GstPad *pad)
|
||||||
{
|
{
|
||||||
static const GstPadQueryType src_query_types[] = {
|
static const GstQueryType src_query_types[] = {
|
||||||
GST_PAD_QUERY_TOTAL,
|
GST_QUERY_TOTAL,
|
||||||
GST_PAD_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
return src_query_types;
|
return src_query_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_dvdec_src_query (GstPad *pad, GstPadQueryType type,
|
gst_dvdec_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value)
|
GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
@ -479,7 +479,7 @@ gst_dvdec_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_PAD_QUERY_TOTAL:
|
case GST_QUERY_TOTAL:
|
||||||
switch (*format) {
|
switch (*format) {
|
||||||
case GST_FORMAT_DEFAULT:
|
case GST_FORMAT_DEFAULT:
|
||||||
*format = GST_FORMAT_TIME;
|
*format = GST_FORMAT_TIME;
|
||||||
|
@ -504,7 +504,7 @@ gst_dvdec_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_PAD_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
switch (*format) {
|
switch (*format) {
|
||||||
case GST_FORMAT_DEFAULT:
|
case GST_FORMAT_DEFAULT:
|
||||||
*format = GST_FORMAT_TIME;
|
*format = GST_FORMAT_TIME;
|
||||||
|
@ -777,7 +777,7 @@ gst_dvdec_loop (GstElement *element)
|
||||||
}
|
}
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
format = GST_FORMAT_TIME;
|
||||||
gst_pad_query (dvdec->videosrcpad, GST_PAD_QUERY_POSITION, &format, &ts);
|
gst_pad_query (dvdec->videosrcpad, GST_QUERY_POSITION, &format, &ts);
|
||||||
|
|
||||||
/* FIXME this is inaccurate for NTSC */
|
/* FIXME this is inaccurate for NTSC */
|
||||||
dvdec->next_ts += GST_SECOND / dvdec->framerate;
|
dvdec->next_ts += GST_SECOND / dvdec->framerate;
|
||||||
|
|
|
@ -57,9 +57,9 @@ static GstElementStateReturn
|
||||||
static const GstFormat* gst_flacdec_get_src_formats (GstPad *pad);
|
static const GstFormat* gst_flacdec_get_src_formats (GstPad *pad);
|
||||||
static gboolean gst_flacdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
static gboolean gst_flacdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
GstFormat *dest_format, gint64 *dest_value);
|
GstFormat *dest_format, gint64 *dest_value);
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_flacdec_get_src_query_types (GstPad *pad);
|
gst_flacdec_get_src_query_types (GstPad *pad);
|
||||||
static gboolean gst_flacdec_src_query (GstPad *pad, GstPadQueryType type,
|
static gboolean gst_flacdec_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
static const GstEventMask*
|
static const GstEventMask*
|
||||||
gst_flacdec_get_src_event_masks (GstPad *pad);
|
gst_flacdec_get_src_event_masks (GstPad *pad);
|
||||||
|
@ -476,7 +476,7 @@ gst_flacdec_loop (GstElement *element)
|
||||||
GST_DEBUG (GST_CAT_PLUGIN_INFO, "flacdec: _loop end");
|
GST_DEBUG (GST_CAT_PLUGIN_INFO, "flacdec: _loop end");
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_FORMATS_FUNCTION (gst_flacdec_get_src_formats,
|
GST_PAD_FORMATS_FUNCTION (gst_flacdec_get_src_formats,
|
||||||
GST_FORMAT_UNITS,
|
GST_FORMAT_UNITS,
|
||||||
GST_FORMAT_BYTES,
|
GST_FORMAT_BYTES,
|
||||||
GST_FORMAT_TIME
|
GST_FORMAT_TIME
|
||||||
|
@ -552,19 +552,19 @@ gst_flacdec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_PAD_QUERY_TYPE_FUNCTION (gst_flacdec_get_src_query_types,
|
GST_PAD_QUERY_TYPE_FUNCTION (gst_flacdec_get_src_query_types,
|
||||||
GST_PAD_QUERY_TOTAL,
|
GST_QUERY_TOTAL,
|
||||||
GST_PAD_QUERY_POSITION
|
GST_QUERY_POSITION
|
||||||
)
|
)
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_flacdec_src_query (GstPad *pad, GstPadQueryType type,
|
gst_flacdec_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value)
|
GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
FlacDec *flacdec = GST_FLACDEC (gst_pad_get_parent (pad));
|
FlacDec *flacdec = GST_FLACDEC (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_PAD_QUERY_TOTAL:
|
case GST_QUERY_TOTAL:
|
||||||
{
|
{
|
||||||
guint64 samples;
|
guint64 samples;
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ gst_flacdec_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
format, value);
|
format, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_PAD_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
gst_pad_convert (flacdec->srcpad,
|
gst_pad_convert (flacdec->srcpad,
|
||||||
GST_FORMAT_UNITS,
|
GST_FORMAT_UNITS,
|
||||||
flacdec->total_samples,
|
flacdec->total_samples,
|
||||||
|
@ -593,7 +593,7 @@ gst_flacdec_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_EVENT_MASK_FUNCTION (gst_flacdec_get_src_event_masks,
|
GST_PAD_EVENT_MASK_FUNCTION (gst_flacdec_get_src_event_masks,
|
||||||
{ GST_EVENT_SEEK, GST_SEEK_FLAG_ACCURATE }
|
{ GST_EVENT_SEEK, GST_SEEK_FLAG_ACCURATE }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -169,9 +169,9 @@ static const GstEventMask*
|
||||||
gst_avi_demux_get_event_mask (GstPad *pad);
|
gst_avi_demux_get_event_mask (GstPad *pad);
|
||||||
static gboolean gst_avi_demux_handle_src_event (GstPad *pad, GstEvent *event);
|
static gboolean gst_avi_demux_handle_src_event (GstPad *pad, GstEvent *event);
|
||||||
static const GstFormat* gst_avi_demux_get_src_formats (GstPad *pad);
|
static const GstFormat* gst_avi_demux_get_src_formats (GstPad *pad);
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_avi_demux_get_src_query_types (GstPad *pad);
|
gst_avi_demux_get_src_query_types (GstPad *pad);
|
||||||
static gboolean gst_avi_demux_handle_src_query (GstPad *pad, GstPadQueryType type,
|
static gboolean gst_avi_demux_handle_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
static gboolean gst_avi_demux_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
static gboolean gst_avi_demux_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
GstFormat *dest_format, gint64 *dest_value);
|
GstFormat *dest_format, gint64 *dest_value);
|
||||||
|
@ -872,12 +872,12 @@ gst_avi_demux_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_avi_demux_get_src_query_types (GstPad *pad)
|
gst_avi_demux_get_src_query_types (GstPad *pad)
|
||||||
{
|
{
|
||||||
static const GstPadQueryType src_types[] = {
|
static const GstQueryType src_types[] = {
|
||||||
GST_PAD_QUERY_TOTAL,
|
GST_QUERY_TOTAL,
|
||||||
GST_PAD_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -885,7 +885,7 @@ gst_avi_demux_get_src_query_types (GstPad *pad)
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_avi_demux_handle_src_query (GstPad *pad, GstPadQueryType type,
|
gst_avi_demux_handle_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value)
|
GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
@ -893,7 +893,7 @@ gst_avi_demux_handle_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
avi_stream_context *stream = gst_pad_get_element_private (pad);
|
avi_stream_context *stream = gst_pad_get_element_private (pad);
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_PAD_QUERY_TOTAL:
|
case GST_QUERY_TOTAL:
|
||||||
switch (*format) {
|
switch (*format) {
|
||||||
case GST_FORMAT_DEFAULT:
|
case GST_FORMAT_DEFAULT:
|
||||||
*format = GST_FORMAT_TIME;
|
*format = GST_FORMAT_TIME;
|
||||||
|
@ -921,7 +921,7 @@ gst_avi_demux_handle_src_query (GstPad *pad, GstPadQueryType type,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_PAD_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
switch (*format) {
|
switch (*format) {
|
||||||
case GST_FORMAT_DEFAULT:
|
case GST_FORMAT_DEFAULT:
|
||||||
*format = GST_FORMAT_TIME;
|
*format = GST_FORMAT_TIME;
|
||||||
|
@ -1341,7 +1341,7 @@ gst_avi_demux_process_chunk (GstAviDemux *avi_demux, guint64 *filepos,
|
||||||
chunkid, *chunksize, stream_id);
|
chunkid, *chunksize, stream_id);
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
format = GST_FORMAT_TIME;
|
||||||
gst_pad_query (stream->pad, GST_PAD_QUERY_POSITION, &format, &next_ts);
|
gst_pad_query (stream->pad, GST_QUERY_POSITION, &format, &next_ts);
|
||||||
|
|
||||||
if (stream->strh.init_frames == stream->current_frame && stream->delay==0)
|
if (stream->strh.init_frames == stream->current_frame && stream->delay==0)
|
||||||
stream->delay = next_ts;
|
stream->delay = next_ts;
|
||||||
|
|
|
@ -28,10 +28,10 @@ static void gst_wavparse_init (GstWavParse *wavparse);
|
||||||
static GstCaps* wav_type_find (GstBuffer *buf, gpointer private);
|
static GstCaps* wav_type_find (GstBuffer *buf, gpointer private);
|
||||||
|
|
||||||
static const GstFormat* gst_wavparse_get_formats (GstPad *pad);
|
static const GstFormat* gst_wavparse_get_formats (GstPad *pad);
|
||||||
static const GstPadQueryType *
|
static const GstQueryType *
|
||||||
gst_wavparse_get_query_types (GstPad *pad);
|
gst_wavparse_get_query_types (GstPad *pad);
|
||||||
static gboolean gst_wavparse_pad_query (GstPad *pad,
|
static gboolean gst_wavparse_pad_query (GstPad *pad,
|
||||||
GstPadQueryType type,
|
GstQueryType type,
|
||||||
GstFormat *format,
|
GstFormat *format,
|
||||||
gint64 *value);
|
gint64 *value);
|
||||||
static gboolean gst_wavparse_pad_convert (GstPad *pad,
|
static gboolean gst_wavparse_pad_convert (GstPad *pad,
|
||||||
|
@ -455,19 +455,19 @@ gst_wavparse_pad_convert (GstPad *pad,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstPadQueryType *
|
static const GstQueryType *
|
||||||
gst_wavparse_get_query_types (GstPad *pad)
|
gst_wavparse_get_query_types (GstPad *pad)
|
||||||
{
|
{
|
||||||
static const GstPadQueryType types[] = {
|
static const GstQueryType types[] = {
|
||||||
GST_PAD_QUERY_TOTAL,
|
GST_QUERY_TOTAL,
|
||||||
GST_PAD_QUERY_POSITION
|
GST_QUERY_POSITION
|
||||||
};
|
};
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handle queries for location and length in requested format */
|
/* handle queries for location and length in requested format */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_wavparse_pad_query (GstPad *pad, GstPadQueryType type,
|
gst_wavparse_pad_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value)
|
GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
GstFormat peer_format = GST_FORMAT_BYTES;
|
GstFormat peer_format = GST_FORMAT_BYTES;
|
||||||
|
|
|
@ -49,10 +49,10 @@ static GstClockTime gst_osssink_get_time (GstClock *clock, gpointer data);
|
||||||
static const GstFormat* gst_osssink_get_formats (GstPad *pad);
|
static const GstFormat* gst_osssink_get_formats (GstPad *pad);
|
||||||
static gboolean gst_osssink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
static gboolean gst_osssink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
GstFormat *dest_format, gint64 *dest_value);
|
GstFormat *dest_format, gint64 *dest_value);
|
||||||
static const GstPadQueryType* gst_osssink_get_query_types (GstPad *pad);
|
static const GstQueryType* gst_osssink_get_query_types (GstPad *pad);
|
||||||
static gboolean gst_osssink_query (GstElement *element, GstPadQueryType type,
|
static gboolean gst_osssink_query (GstElement *element, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
static gboolean gst_osssink_sink_query (GstPad *pad, GstPadQueryType type,
|
static gboolean gst_osssink_sink_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
|
|
||||||
static GstPadConnectReturn gst_osssink_sinkconnect (GstPad *pad, GstCaps *caps);
|
static GstPadConnectReturn gst_osssink_sinkconnect (GstPad *pad, GstCaps *caps);
|
||||||
|
@ -432,19 +432,19 @@ gst_osssink_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||||
dest_format, dest_value);
|
dest_format, dest_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_osssink_get_query_types (GstPad *pad)
|
gst_osssink_get_query_types (GstPad *pad)
|
||||||
{
|
{
|
||||||
static const GstPadQueryType query_types[] = {
|
static const GstQueryType query_types[] = {
|
||||||
GST_PAD_QUERY_LATENCY,
|
GST_QUERY_LATENCY,
|
||||||
GST_PAD_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
return query_types;
|
return query_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_osssink_sink_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gint64 *value)
|
gst_osssink_sink_query (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
GstOssSink *osssink;
|
GstOssSink *osssink;
|
||||||
|
@ -452,7 +452,7 @@ gst_osssink_sink_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gi
|
||||||
osssink = GST_OSSSINK (gst_pad_get_parent (pad));
|
osssink = GST_OSSSINK (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_PAD_QUERY_LATENCY:
|
case GST_QUERY_LATENCY:
|
||||||
if (!gst_osssink_convert (pad,
|
if (!gst_osssink_convert (pad,
|
||||||
GST_FORMAT_BYTES, gst_osssink_get_delay (osssink),
|
GST_FORMAT_BYTES, gst_osssink_get_delay (osssink),
|
||||||
format, value))
|
format, value))
|
||||||
|
@ -460,7 +460,7 @@ gst_osssink_sink_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gi
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_PAD_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
if (!gst_osssink_convert (pad,
|
if (!gst_osssink_convert (pad,
|
||||||
GST_FORMAT_TIME, gst_clock_get_time (osssink->provided_clock),
|
GST_FORMAT_TIME, gst_clock_get_time (osssink->provided_clock),
|
||||||
format, value))
|
format, value))
|
||||||
|
@ -477,7 +477,7 @@ gst_osssink_sink_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gi
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_osssink_query (GstElement *element, GstPadQueryType type, GstFormat *format, gint64 *value)
|
gst_osssink_query (GstElement *element, GstQueryType type, GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
GstOssSink *osssink = GST_OSSSINK (element);
|
GstOssSink *osssink = GST_OSSSINK (element);
|
||||||
|
|
||||||
|
|
|
@ -100,8 +100,8 @@ static GstElementStateReturn gst_osssrc_change_state (GstElement *element);
|
||||||
static const GstEventMask* gst_osssrc_get_event_masks (GstPad *pad);
|
static const GstEventMask* gst_osssrc_get_event_masks (GstPad *pad);
|
||||||
static gboolean gst_osssrc_src_event (GstPad *pad, GstEvent *event);
|
static gboolean gst_osssrc_src_event (GstPad *pad, GstEvent *event);
|
||||||
static gboolean gst_osssrc_send_event (GstElement *element, GstEvent *event);
|
static gboolean gst_osssrc_send_event (GstElement *element, GstEvent *event);
|
||||||
static const GstPadQueryType* gst_osssrc_get_query_types (GstPad *pad);
|
static const GstQueryType* gst_osssrc_get_query_types (GstPad *pad);
|
||||||
static gboolean gst_osssrc_src_query (GstPad *pad, GstPadQueryType type,
|
static gboolean gst_osssrc_src_query (GstPad *pad, GstQueryType type,
|
||||||
GstFormat *format, gint64 *value);
|
GstFormat *format, gint64 *value);
|
||||||
|
|
||||||
static GstBuffer * gst_osssrc_get (GstPad *pad);
|
static GstBuffer * gst_osssrc_get (GstPad *pad);
|
||||||
|
@ -459,18 +459,18 @@ gst_osssrc_send_event (GstElement *element,
|
||||||
return gst_osssrc_src_event (osssrc->srcpad, event);
|
return gst_osssrc_src_event (osssrc->srcpad, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstPadQueryType*
|
static const GstQueryType*
|
||||||
gst_osssrc_get_query_types (GstPad *pad)
|
gst_osssrc_get_query_types (GstPad *pad)
|
||||||
{
|
{
|
||||||
static const GstPadQueryType query_types[] = {
|
static const GstQueryType query_types[] = {
|
||||||
GST_PAD_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
0,
|
0,
|
||||||
};
|
};
|
||||||
return query_types;
|
return query_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_osssrc_src_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gint64 *value)
|
gst_osssrc_src_query (GstPad *pad, GstQueryType type, GstFormat *format, gint64 *value)
|
||||||
{
|
{
|
||||||
gboolean res = FALSE;
|
gboolean res = FALSE;
|
||||||
GstOssSrc *osssrc;
|
GstOssSrc *osssrc;
|
||||||
|
@ -478,7 +478,7 @@ gst_osssrc_src_query (GstPad *pad, GstPadQueryType type, GstFormat *format, gint
|
||||||
osssrc = GST_OSSSRC (gst_pad_get_parent (pad));
|
osssrc = GST_OSSSRC (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GST_PAD_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
res = gst_osscommon_convert (&osssrc->common,
|
res = gst_osscommon_convert (&osssrc->common,
|
||||||
GST_FORMAT_BYTES, osssrc->curoffset,
|
GST_FORMAT_BYTES, osssrc->curoffset,
|
||||||
format, value);
|
format, value);
|
||||||
|
|
Loading…
Reference in a new issue