mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +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
2dec437285
commit
b5bee92a53
16 changed files with 90 additions and 96 deletions
|
@ -175,7 +175,7 @@ print_progress (GstPad *pad)
|
|||
status[0] = '|';
|
||||
|
||||
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) {
|
||||
percent = value / (2 * GST_FORMAT_PERCENT_SCALE);
|
||||
}
|
||||
|
@ -222,7 +222,6 @@ main (gint argc, gchar *argv[])
|
|||
|
||||
/* create index that elements can fill */
|
||||
index = gst_index_factory_make ("memindex");
|
||||
index = NULL;
|
||||
if (verbose && index)
|
||||
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);
|
||||
|
||||
format = *formats;
|
||||
res = gst_pad_query (pad, GST_PAD_QUERY_POSITION,
|
||||
res = gst_pad_query (pad, GST_QUERY_POSITION,
|
||||
&format, &position);
|
||||
|
||||
if (format == GST_FORMAT_TIME) {
|
||||
|
@ -70,7 +70,7 @@ get_track_info (GstElement *cdparanoia)
|
|||
definition = gst_format_get_details (*formats);
|
||||
|
||||
format = *formats;
|
||||
res = gst_pad_query (pad, GST_PAD_QUERY_TOTAL,
|
||||
res = gst_pad_query (pad, GST_QUERY_TOTAL,
|
||||
&format, &total);
|
||||
if (res) {
|
||||
if (format == GST_FORMAT_TIME) {
|
||||
|
|
|
@ -13,31 +13,19 @@ static guint64 duration;
|
|||
|
||||
static guint update_id;
|
||||
|
||||
//#define SOURCE "gnomevfssrc"
|
||||
#define SOURCE "filesrc"
|
||||
|
||||
#define UPDATE_INTERVAL 500
|
||||
|
||||
static GstElement*
|
||||
make_cdaudio_pipeline (gboolean thread)
|
||||
make_cdaudio_pipeline (void)
|
||||
{
|
||||
GstElement *pipeline;
|
||||
GstElement *cdaudio;
|
||||
|
||||
if (thread) {
|
||||
pipeline = gst_thread_new ("app");
|
||||
}
|
||||
else {
|
||||
pipeline = gst_pipeline_new ("app");
|
||||
}
|
||||
|
||||
cdaudio = gst_element_factory_make ("cdaudio", "cdaudio");
|
||||
|
||||
gst_bin_add (GST_BIN (pipeline), cdaudio);
|
||||
g_assert (cdaudio != NULL);
|
||||
|
||||
seekable_elements = g_list_prepend (seekable_elements, cdaudio);
|
||||
|
||||
return pipeline;
|
||||
return cdaudio;
|
||||
}
|
||||
|
||||
static gchar*
|
||||
|
@ -91,7 +79,7 @@ query_durations ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -121,7 +109,7 @@ query_positions ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -139,7 +127,7 @@ static gboolean
|
|||
update_scale (gpointer data)
|
||||
{
|
||||
GstClock *clock;
|
||||
guint64 position;
|
||||
guint64 position = 0;
|
||||
GstFormat format = GST_FORMAT_TIME;
|
||||
|
||||
duration = 0;
|
||||
|
@ -147,12 +135,14 @@ update_scale (gpointer data)
|
|||
|
||||
if (seekable_elements) {
|
||||
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) {
|
||||
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_positions ();
|
||||
}
|
||||
|
@ -168,6 +158,7 @@ iterate (gpointer data)
|
|||
{
|
||||
gboolean res = TRUE;
|
||||
|
||||
g_print ("iterate\n");
|
||||
res = gst_bin_iterate (GST_BIN (data));
|
||||
if (!res) {
|
||||
gtk_timeout_remove (update_id);
|
||||
|
@ -249,10 +240,7 @@ main (int argc, char **argv)
|
|||
GtkWidget *window, *hbox, *vbox,
|
||||
*play_button, *pause_button, *stop_button,
|
||||
*hscale;
|
||||
gboolean threaded = FALSE;
|
||||
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,
|
||||
"Show element stats", NULL},
|
||||
POPT_TABLEEND
|
||||
|
@ -261,7 +249,10 @@ main (int argc, char **argv)
|
|||
gst_init_with_popt_table (&argc, &argv, options);
|
||||
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 ... */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
@ -303,6 +294,8 @@ main (int argc, char **argv)
|
|||
|
||||
gtk_main ();
|
||||
|
||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||
|
||||
gst_buffer_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);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -604,7 +604,7 @@ query_durations ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -635,7 +635,7 @@ query_positions ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ update_scale (gpointer data)
|
|||
|
||||
if (seekable_pads) {
|
||||
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);
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ query_durations ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ query_positions ()
|
|||
GstFormat 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) {
|
||||
g_print ("%s %13lld | ", seek_formats[i].name, value);
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ update_scale (gpointer data)
|
|||
|
||||
if (seekable_elements) {
|
||||
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);
|
||||
|
||||
|
|
|
@ -230,7 +230,7 @@ collect_stream_properties (struct probe_context *context)
|
|||
format = *formats;
|
||||
formats++;
|
||||
|
||||
res = gst_pad_query (context->pad, GST_PAD_QUERY_TOTAL,
|
||||
res = gst_pad_query (context->pad, GST_QUERY_TOTAL,
|
||||
&format, &value);
|
||||
|
||||
definition = gst_format_get_details (format);
|
||||
|
|
|
@ -71,11 +71,11 @@ main (gint argc, gchar *argv[])
|
|||
|
||||
format = GST_FORMAT_TIME;
|
||||
/* get the position */
|
||||
gst_pad_query (enc_src, GST_PAD_QUERY_POSITION,
|
||||
gst_pad_query (enc_src, GST_QUERY_POSITION,
|
||||
&format, &position);
|
||||
|
||||
/* get the total duration */
|
||||
gst_pad_query (enc_src, GST_PAD_QUERY_TOTAL,
|
||||
gst_pad_query (enc_src, GST_QUERY_TOTAL,
|
||||
&format, &duration);
|
||||
|
||||
format = GST_FORMAT_BYTES;
|
||||
|
|
|
@ -149,10 +149,10 @@ static gboolean gst_mad_src_event (GstPad *pad, GstEvent *event);
|
|||
static const GstFormat* gst_mad_get_formats (GstPad *pad);
|
||||
static const GstEventMask*
|
||||
gst_mad_get_event_masks (GstPad *pad);
|
||||
static const GstPadQueryType*
|
||||
static const GstQueryType*
|
||||
gst_mad_get_query_types (GstPad *pad);
|
||||
|
||||
static gboolean gst_mad_src_query (GstPad *pad, GstPadQueryType type,
|
||||
static gboolean gst_mad_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
static gboolean gst_mad_convert_sink (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||
GstFormat *dest_format, gint64 *dest_value);
|
||||
|
@ -473,19 +473,19 @@ gst_mad_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
return res;
|
||||
}
|
||||
|
||||
static const GstPadQueryType*
|
||||
static const GstQueryType*
|
||||
gst_mad_get_query_types (GstPad *pad)
|
||||
{
|
||||
static const GstPadQueryType gst_mad_src_query_types[] = {
|
||||
GST_PAD_QUERY_TOTAL,
|
||||
GST_PAD_QUERY_POSITION,
|
||||
static const GstQueryType gst_mad_src_query_types[] = {
|
||||
GST_QUERY_TOTAL,
|
||||
GST_QUERY_POSITION,
|
||||
0
|
||||
};
|
||||
return gst_mad_src_query_types;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_mad_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gst_mad_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -494,7 +494,7 @@ gst_mad_src_query (GstPad *pad, GstPadQueryType type,
|
|||
mad = GST_MAD (gst_pad_get_parent (pad));
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_TOTAL:
|
||||
case GST_QUERY_TOTAL:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
@ -516,7 +516,7 @@ gst_mad_src_query (GstPad *pad, GstPadQueryType type,
|
|||
GstFormat peer_format = *peer_formats;
|
||||
|
||||
/* do the probe */
|
||||
if (gst_pad_query (GST_PAD_PEER (mad->sinkpad), GST_PAD_QUERY_TOTAL,
|
||||
if (gst_pad_query (GST_PAD_PEER (mad->sinkpad), GST_QUERY_TOTAL,
|
||||
&peer_format, &peer_value))
|
||||
{
|
||||
GstFormat conv_format;
|
||||
|
@ -540,7 +540,7 @@ gst_mad_src_query (GstPad *pad, GstPadQueryType type,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
*format = GST_FORMAT_TIME;
|
||||
|
@ -946,8 +946,10 @@ gst_mad_handle_event (GstPad *pad, GstBuffer *buffer)
|
|||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (gst_pad_handles_format (pad,
|
||||
GST_EVENT_DISCONT_OFFSET(event, i).format))
|
||||
const GstFormat *formats;
|
||||
formats = gst_pad_get_formats (pad);
|
||||
|
||||
if (gst_formats_contains (formats, GST_EVENT_DISCONT_OFFSET(event, i).format))
|
||||
{
|
||||
gint64 value = GST_EVENT_DISCONT_OFFSET (event, i).value;
|
||||
gint64 time;
|
||||
|
@ -1144,7 +1146,7 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer)
|
|||
mad->rate = rate;
|
||||
}
|
||||
|
||||
if (GST_PAD_IS_CONNECTED (mad->srcpad)) {
|
||||
if (GST_PAD_IS_USABLE (mad->srcpad)) {
|
||||
GstBuffer *outbuffer;
|
||||
gint16 *outdata;
|
||||
mad_fixed_t const *left_ch, *right_ch;
|
||||
|
|
|
@ -104,7 +104,7 @@ static void gst_mpeg2dec_get_property (GObject *object, guint prop_id,
|
|||
GValue *value, GParamSpec *pspec);
|
||||
|
||||
static gboolean gst_mpeg2dec_src_event (GstPad *pad, GstEvent *event);
|
||||
static gboolean gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
static gboolean gst_mpeg2dec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
|
||||
static gboolean gst_mpeg2dec_convert_sink (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||
|
@ -623,7 +623,7 @@ gst_mpeg2dec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gst_mpeg2dec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -635,7 +635,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
mpeg2dec = GST_MPEG2DEC (gst_pad_get_parent (pad));
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_TOTAL:
|
||||
case GST_QUERY_TOTAL:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
@ -654,7 +654,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
peer_format = formats[i];
|
||||
|
||||
/* do the probe */
|
||||
if (gst_pad_query (GST_PAD_PEER (mpeg2dec->sinkpad), GST_PAD_QUERY_TOTAL,
|
||||
if (gst_pad_query (GST_PAD_PEER (mpeg2dec->sinkpad), GST_QUERY_TOTAL,
|
||||
&peer_format, &peer_value))
|
||||
{
|
||||
GstFormat conv_format;
|
||||
|
@ -678,7 +678,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
|
|
@ -110,9 +110,9 @@ static const GstFormat*
|
|||
static const GstEventMask*
|
||||
gst_mpeg2dec_get_src_event_masks (GstPad *pad);
|
||||
static gboolean gst_mpeg2dec_src_event (GstPad *pad, GstEvent *event);
|
||||
static const GstPadQueryType*
|
||||
static const GstQueryType*
|
||||
gst_mpeg2dec_get_src_query_types (GstPad *pad);
|
||||
static gboolean gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
static gboolean gst_mpeg2dec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
|
||||
static const GstFormat*
|
||||
|
@ -777,19 +777,19 @@ gst_mpeg2dec_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
return res;
|
||||
}
|
||||
|
||||
static const GstPadQueryType*
|
||||
static const GstQueryType*
|
||||
gst_mpeg2dec_get_src_query_types (GstPad *pad)
|
||||
{
|
||||
static const GstPadQueryType types[] = {
|
||||
GST_PAD_QUERY_TOTAL,
|
||||
GST_PAD_QUERY_POSITION,
|
||||
static const GstQueryType types[] = {
|
||||
GST_QUERY_TOTAL,
|
||||
GST_QUERY_POSITION,
|
||||
0
|
||||
};
|
||||
return types;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gst_mpeg2dec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -799,7 +799,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
mpeg2dec = GST_MPEG2DEC (gst_pad_get_parent (pad));
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_TOTAL:
|
||||
case GST_QUERY_TOTAL:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
@ -822,7 +822,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
peer_format = *formats;
|
||||
|
||||
/* do the probe */
|
||||
if (gst_pad_query (GST_PAD_PEER (mpeg2dec->sinkpad), GST_PAD_QUERY_TOTAL,
|
||||
if (gst_pad_query (GST_PAD_PEER (mpeg2dec->sinkpad), GST_QUERY_TOTAL,
|
||||
&peer_format, &peer_value))
|
||||
{
|
||||
GstFormat conv_format;
|
||||
|
@ -847,7 +847,7 @@ gst_mpeg2dec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
|
|
@ -147,7 +147,7 @@ static void gst_siddec_loop (GstElement *element);
|
|||
|
||||
static gboolean gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
||||
GstFormat *dest_format, gint64 *dest_value);
|
||||
static gboolean gst_siddec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
static gboolean gst_siddec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
|
||||
static void gst_siddec_get_property (GObject *object, guint prop_id,
|
||||
|
@ -451,7 +451,7 @@ gst_siddec_loop (GstElement *element)
|
|||
GST_BUFFER_DATA (out), GST_BUFFER_SIZE (out));
|
||||
|
||||
format = GST_FORMAT_TIME;
|
||||
gst_siddec_src_query (siddec->srcpad, GST_PAD_QUERY_POSITION, &format, &value);
|
||||
gst_siddec_src_query (siddec->srcpad, GST_QUERY_POSITION, &format, &value);
|
||||
GST_BUFFER_TIMESTAMP (out) = value;
|
||||
|
||||
siddec->total_bytes += 4096;
|
||||
|
@ -534,7 +534,7 @@ gst_siddec_src_convert (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_siddec_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gst_siddec_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -543,7 +543,7 @@ gst_siddec_src_query (GstPad *pad, GstPadQueryType type,
|
|||
siddec = GST_SIDDEC (gst_pad_get_parent (pad));
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
/* we only know about our bytes, convert to requested format */
|
||||
res &= gst_pad_convert (pad,
|
||||
GST_FORMAT_BYTES, siddec->total_bytes,
|
||||
|
|
|
@ -519,7 +519,7 @@ gst_media_info_get_stream (GstMediaInfo *info, GstMediaInfoStream *stream)
|
|||
format = *formats;
|
||||
|
||||
g_assert (GST_IS_PAD (priv->decoder_pad));
|
||||
res = gst_pad_query (priv->decoder_pad, GST_PAD_QUERY_TOTAL,
|
||||
res = gst_pad_query (priv->decoder_pad, GST_QUERY_TOTAL,
|
||||
&format, &value);
|
||||
|
||||
definition = gst_format_get_details (*formats);
|
||||
|
@ -554,7 +554,7 @@ gst_media_info_get_stream (GstMediaInfo *info, GstMediaInfoStream *stream)
|
|||
/* now get number of bytes from the sink pad to get the bitrate */
|
||||
format = GST_FORMAT_BYTES;
|
||||
g_assert (GST_IS_PAD (priv->source_pad));
|
||||
res = gst_pad_query (priv->source_pad, GST_PAD_QUERY_TOTAL,
|
||||
res = gst_pad_query (priv->source_pad, GST_QUERY_TOTAL,
|
||||
&format, &value);
|
||||
if (!res) g_warning ("Failed to query on sink pad !");
|
||||
bytes = value;
|
||||
|
@ -622,7 +622,7 @@ gst_media_info_find_streaminfo (GstMediaInfo *info)
|
|||
gint64 value_start, value_end;
|
||||
gboolean res;
|
||||
|
||||
res = gst_pad_query (priv->decoder_pad, GST_PAD_QUERY_POSITION,
|
||||
res = gst_pad_query (priv->decoder_pad, GST_QUERY_POSITION,
|
||||
&track_format, &value_start);
|
||||
if (res)
|
||||
{
|
||||
|
|
|
@ -548,12 +548,12 @@ gst_play_get_length_callback (GstPlay *play)
|
|||
g_print("trying to get length\n");
|
||||
if (play->audio_sink_element != NULL){
|
||||
g_mutex_lock(play->audio_bin_mutex);
|
||||
query_worked = gst_element_query (play->audio_sink_element, GST_PAD_QUERY_TOTAL, &format, &value);
|
||||
query_worked = gst_element_query (play->audio_sink_element, GST_QUERY_TOTAL, &format, &value);
|
||||
g_mutex_unlock(play->audio_bin_mutex);
|
||||
}
|
||||
else if (play->video_sink_element != NULL){
|
||||
g_mutex_lock(play->video_bin_mutex);
|
||||
query_worked = gst_element_query (play->video_sink_element, GST_PAD_QUERY_TOTAL, &format, &value);
|
||||
query_worked = gst_element_query (play->video_sink_element, GST_QUERY_TOTAL, &format, &value);
|
||||
g_mutex_unlock(play->video_bin_mutex);
|
||||
}
|
||||
if (query_worked){
|
||||
|
|
|
@ -432,9 +432,9 @@ static const GstEventMask* gst_asf_demux_get_src_event_mask (GstPad *pad);
|
|||
static gboolean gst_asf_demux_handle_src_event (GstPad *pad,
|
||||
GstEvent *event);
|
||||
static const GstFormat* gst_asf_demux_get_src_formats (GstPad *pad);
|
||||
static const GstPadQueryType* gst_asf_demux_get_src_query_types (GstPad *pad);
|
||||
static const GstQueryType* gst_asf_demux_get_src_query_types (GstPad *pad);
|
||||
static gboolean gst_asf_demux_handle_src_query (GstPad *pad,
|
||||
GstPadQueryType type,
|
||||
GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
|
||||
static GstElementStateReturn
|
||||
|
@ -1136,7 +1136,7 @@ static gboolean gst_asf_demux_process_chunk (GstASFDemux *asf_demux,
|
|||
}
|
||||
|
||||
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 (GST_PAD_IS_CONNECTED (stream->pad)) {
|
||||
GstBuffer *buf;
|
||||
|
@ -1182,11 +1182,11 @@ gst_asf_demux_get_src_formats (GstPad *pad) {
|
|||
return formats;
|
||||
}
|
||||
|
||||
static const GstPadQueryType*
|
||||
static const GstQueryType*
|
||||
gst_asf_demux_get_src_query_types (GstPad *pad) {
|
||||
static const GstPadQueryType types[] = {
|
||||
GST_PAD_QUERY_TOTAL,
|
||||
GST_PAD_QUERY_POSITION,
|
||||
static const GstQueryType types[] = {
|
||||
GST_QUERY_TOTAL,
|
||||
GST_QUERY_POSITION,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ gst_asf_demux_get_src_query_types (GstPad *pad) {
|
|||
|
||||
static gboolean
|
||||
gst_asf_demux_handle_src_query (GstPad *pad,
|
||||
GstPadQueryType type,
|
||||
GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
GstASFDemux *asf_demux;
|
||||
|
@ -1204,7 +1204,7 @@ gst_asf_demux_handle_src_query (GstPad *pad,
|
|||
asf_demux = GST_ASF_DEMUX (gst_pad_get_parent (pad));
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_TOTAL:
|
||||
case GST_QUERY_TOTAL:
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
*format = GST_FORMAT_TIME;
|
||||
|
@ -1216,7 +1216,7 @@ gst_asf_demux_handle_src_query (GstPad *pad,
|
|||
res = FALSE;
|
||||
}
|
||||
break;
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
*format = GST_FORMAT_TIME;
|
||||
|
|
|
@ -564,19 +564,19 @@ gst_mpeg_parse_convert_src (GstPad *pad, GstFormat src_format, gint64 src_value,
|
|||
return res;
|
||||
}
|
||||
|
||||
const GstPadQueryType*
|
||||
const GstQueryType*
|
||||
gst_mpeg_parse_get_src_query_types (GstPad *pad)
|
||||
{
|
||||
static const GstPadQueryType types[] = {
|
||||
GST_PAD_QUERY_TOTAL,
|
||||
GST_PAD_QUERY_POSITION,
|
||||
static const GstQueryType types[] = {
|
||||
GST_QUERY_TOTAL,
|
||||
GST_QUERY_POSITION,
|
||||
0
|
||||
};
|
||||
return types;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gst_mpeg_parse_handle_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gst_mpeg_parse_handle_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
@ -585,7 +585,7 @@ gst_mpeg_parse_handle_src_query (GstPad *pad, GstPadQueryType type,
|
|||
gint64 src_value;
|
||||
|
||||
switch (type) {
|
||||
case GST_PAD_QUERY_TOTAL:
|
||||
case GST_QUERY_TOTAL:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
@ -594,7 +594,7 @@ gst_mpeg_parse_handle_src_query (GstPad *pad, GstPadQueryType type,
|
|||
default:
|
||||
src_format = GST_FORMAT_BYTES;
|
||||
if (!gst_pad_query (GST_PAD_PEER (mpeg_parse->sinkpad),
|
||||
GST_PAD_QUERY_TOTAL, &src_format, &src_value))
|
||||
GST_QUERY_TOTAL, &src_format, &src_value))
|
||||
{
|
||||
res = FALSE;
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ gst_mpeg_parse_handle_src_query (GstPad *pad, GstPadQueryType type,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case GST_PAD_QUERY_POSITION:
|
||||
case GST_QUERY_POSITION:
|
||||
{
|
||||
switch (*format) {
|
||||
case GST_FORMAT_DEFAULT:
|
||||
|
|
|
@ -104,9 +104,9 @@ const GstEventMask*
|
|||
gst_mpeg_parse_get_src_event_masks (GstPad *pad);
|
||||
gboolean gst_mpeg_parse_handle_src_event (GstPad *pad, GstEvent *event);
|
||||
|
||||
const GstPadQueryType*
|
||||
const GstQueryType*
|
||||
gst_mpeg_parse_get_src_query_types (GstPad *pad);
|
||||
gboolean gst_mpeg_parse_handle_src_query (GstPad *pad, GstPadQueryType type,
|
||||
gboolean gst_mpeg_parse_handle_src_query (GstPad *pad, GstQueryType type,
|
||||
GstFormat *format, gint64 *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in a new issue