_query_peer_*() -> _peer_query_*()

This commit is contained in:
Wim Taymans 2011-11-15 18:01:16 +01:00
parent 04579335c4
commit e7918a5aba
10 changed files with 22 additions and 22 deletions

View file

@ -719,18 +719,18 @@ gst_flac_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter)
}
static guint64
gst_flac_enc_query_peer_total_samples (GstFlacEnc * flacenc, GstPad * pad)
gst_flac_enc_peer_query_total_samples (GstFlacEnc * flacenc, GstPad * pad)
{
gint64 duration;
GST_DEBUG_OBJECT (flacenc, "querying peer for DEFAULT format duration");
if (gst_pad_query_peer_duration (pad, GST_FORMAT_DEFAULT, &duration)
if (gst_pad_peer_query_duration (pad, GST_FORMAT_DEFAULT, &duration)
&& duration != GST_CLOCK_TIME_NONE)
goto done;
GST_DEBUG_OBJECT (flacenc, "querying peer for TIME format duration");
if (gst_pad_query_peer_duration (pad, GST_FORMAT_TIME, &duration)
if (gst_pad_peer_query_duration (pad, GST_FORMAT_TIME, &duration)
&& duration != GST_CLOCK_TIME_NONE) {
GST_DEBUG_OBJECT (flacenc, "peer reported duration %" GST_TIME_FORMAT,
GST_TIME_ARGS (duration));
@ -778,7 +778,7 @@ gst_flac_enc_set_format (GstAudioEncoder * enc, GstAudioInfo * info)
gst_caps_unref (caps);
total_samples = gst_flac_enc_query_peer_total_samples (flacenc,
total_samples = gst_flac_enc_peer_query_total_samples (flacenc,
GST_AUDIO_ENCODER_SINK_PAD (enc));
FLAC__stream_encoder_set_bits_per_sample (flacenc->encoder, flacenc->depth);

View file

@ -1212,7 +1212,7 @@ gst_flac_parse_generate_headers (GstFlacParse * flacparse)
{
gint64 duration;
if (gst_pad_query_peer_duration (GST_BASE_PARSE_SINK_PAD (flacparse),
if (gst_pad_peer_query_duration (GST_BASE_PARSE_SINK_PAD (flacparse),
GST_FORMAT_TIME, &duration)) {
duration = GST_CLOCK_TIME_TO_FRAMES (duration, flacparse->samplerate);

View file

@ -623,7 +623,7 @@ gst_mpeg_audio_parse_handle_first_frame (GstMpegAudioParse * mp3parse,
}
/* obtain real upstream total bytes */
if (!gst_pad_query_peer_duration (GST_BASE_PARSE_SINK_PAD (mp3parse),
if (!gst_pad_peer_query_duration (GST_BASE_PARSE_SINK_PAD (mp3parse),
GST_FORMAT_BYTES, &upstream_total_bytes))
upstream_total_bytes = 0;

View file

@ -554,7 +554,7 @@ gst_au_parse_src_query (GstPad * pad, GstQuery * query)
gint64 len, val;
gst_query_parse_duration (query, &format, NULL);
if (!gst_pad_query_peer_duration (auparse->sinkpad, GST_FORMAT_BYTES,
if (!gst_pad_peer_query_duration (auparse->sinkpad, GST_FORMAT_BYTES,
&len)) {
GST_DEBUG_OBJECT (auparse, "failed to query upstream length");
break;
@ -577,7 +577,7 @@ gst_au_parse_src_query (GstPad * pad, GstQuery * query)
gint64 pos, val;
gst_query_parse_position (query, &format, NULL);
if (!gst_pad_query_peer_position (auparse->sinkpad, GST_FORMAT_BYTES,
if (!gst_pad_peer_query_position (auparse->sinkpad, GST_FORMAT_BYTES,
&pos)) {
GST_DEBUG_OBJECT (auparse, "failed to query upstream position");
break;

View file

@ -2926,7 +2926,7 @@ gst_avi_demux_stream_scan (GstAviDemux * avi)
GST_DEBUG_OBJECT (avi, "Creating index");
/* get the size of the file */
if (!gst_pad_query_peer_duration (avi->sinkpad, GST_FORMAT_BYTES, &tmplength))
if (!gst_pad_peer_query_duration (avi->sinkpad, GST_FORMAT_BYTES, &tmplength))
return FALSE;
length = tmplength;
@ -3089,7 +3089,7 @@ gst_avi_demux_check_seekability (GstAviDemux * avi)
/* try harder to query upstream size if we didn't get it the first time */
if (seekable && stop == -1) {
GST_DEBUG_OBJECT (avi, "doing duration query to fix up unset stop");
gst_pad_query_peer_duration (avi->sinkpad, GST_FORMAT_BYTES, &stop);
gst_pad_peer_query_duration (avi->sinkpad, GST_FORMAT_BYTES, &stop);
}
/* if upstream doesn't know the size, it's likely that it's not seekable in

View file

@ -240,8 +240,8 @@ gst_progress_report_do_query (GstProgressReport * filter, GstFormat format,
if (filter->do_query || !buf) {
GST_LOG_OBJECT (filter, "using upstream query");
if (!gst_pad_query_peer_position (sink_pad, format, &cur) ||
!gst_pad_query_peer_duration (sink_pad, format, &total)) {
if (!gst_pad_peer_query_position (sink_pad, format, &cur) ||
!gst_pad_peer_query_duration (sink_pad, format, &total)) {
return FALSE;
}
} else {

View file

@ -205,7 +205,7 @@ gst_flv_demux_check_seekability (GstFlvDemux * demux)
/* try harder to query upstream size if we didn't get it the first time */
if (demux->upstream_seekable && stop == -1) {
GST_DEBUG_OBJECT (demux, "doing duration query to fix up unset stop");
gst_pad_query_peer_duration (demux->sinkpad, GST_FORMAT_BYTES, &stop);
gst_pad_peer_query_duration (demux->sinkpad, GST_FORMAT_BYTES, &stop);
}
/* if upstream doesn't know the size, it's likely that it's not seekable in
@ -2213,7 +2213,7 @@ gst_flv_demux_create_index (GstFlvDemux * demux, gint64 pos, GstClockTime ts)
GstClockTime tag_time;
GstFlowReturn ret = GST_FLOW_OK;
if (!gst_pad_query_peer_duration (demux->sinkpad, GST_FORMAT_BYTES, &size))
if (!gst_pad_peer_query_duration (demux->sinkpad, GST_FORMAT_BYTES, &size))
return GST_FLOW_OK;
GST_DEBUG_OBJECT (demux, "building index at %" G_GINT64_FORMAT
@ -2255,7 +2255,7 @@ gst_flv_demux_get_metadata (GstFlvDemux * demux)
GstBuffer *buffer = NULL;
guint8 *data;
if (!gst_pad_query_peer_duration (demux->sinkpad, GST_FORMAT_BYTES, &offset))
if (!gst_pad_peer_query_duration (demux->sinkpad, GST_FORMAT_BYTES, &offset))
goto exit;
ret = offset;
@ -2612,7 +2612,7 @@ gst_flv_demux_handle_seek_push (GstFlvDemux * demux, GstEvent * event)
if (!building_index) {
demux->building_index = TRUE;
if (!demux->file_size
&& !gst_pad_query_peer_duration (demux->sinkpad, GST_FORMAT_BYTES,
&& !gst_pad_peer_query_duration (demux->sinkpad, GST_FORMAT_BYTES,
&demux->file_size)) {
GST_WARNING_OBJECT (demux, "Failed to query upstream file size");
GST_OBJECT_UNLOCK (demux);

View file

@ -782,7 +782,7 @@ gst_flv_mux_create_metadata (GstFlvMux * mux)
for (l = mux->collect->data; l; l = l->next) {
GstCollectData *cdata = l->data;
if (gst_pad_query_peer_duration (cdata->pad, GST_FORMAT_TIME,
if (gst_pad_peer_query_duration (cdata->pad, GST_FORMAT_TIME,
(gint64 *) & dur) && dur != GST_CLOCK_TIME_NONE) {
if (mux->duration == GST_CLOCK_TIME_NONE)
mux->duration = dur;

View file

@ -2576,7 +2576,7 @@ qtdemux_parse_mfro (GstQTDemux * qtdemux, guint64 * mfra_offset,
gint64 len;
GstFormat fmt = GST_FORMAT_BYTES;
if (!gst_pad_query_peer_duration (qtdemux->sinkpad, &fmt, &len)) {
if (!gst_pad_peer_query_duration (qtdemux->sinkpad, &fmt, &len)) {
GST_DEBUG_OBJECT (qtdemux, "upstream size not available; "
"can not locate mfro");
goto exit;
@ -3993,7 +3993,7 @@ gst_qtdemux_check_seekability (GstQTDemux * demux)
/* try harder to query upstream size if we didn't get it the first time */
if (seekable && stop == -1) {
GST_DEBUG_OBJECT (demux, "doing duration query to fix up unset stop");
gst_pad_query_peer_duration (demux->sinkpad, GST_FORMAT_BYTES, &stop);
gst_pad_peer_query_duration (demux->sinkpad, GST_FORMAT_BYTES, &stop);
}
/* if upstream doesn't know the size, it's likely that it's not seekable in
@ -7521,7 +7521,7 @@ gst_qtdemux_guess_bitrate (GstQTDemux * qtdemux)
GST_DEBUG_OBJECT (qtdemux, "Looking for streams with unknown bitrate");
if (!gst_pad_query_peer_duration (qtdemux->sinkpad, GST_FORMAT_BYTES, &size)) {
if (!gst_pad_peer_query_duration (qtdemux->sinkpad, GST_FORMAT_BYTES, &size)) {
GST_DEBUG_OBJECT (qtdemux,
"Size in bytes of the stream not known - bailing");
return;

View file

@ -918,7 +918,7 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
/* make sure filesize is not exceeded due to rounding errors or so,
* same precaution as in _stream_headers */
bformat = GST_FORMAT_BYTES;
if (gst_pad_query_peer_duration (wav->sinkpad, bformat, &upstream_size))
if (gst_pad_peer_query_duration (wav->sinkpad, bformat, &upstream_size))
wav->end_offset = MIN (wav->end_offset, upstream_size);
/* this is the range of bytes we will use for playback */
@ -1274,7 +1274,7 @@ gst_wavparse_stream_headers (GstWavParse * wav)
}
gst_pad_query_peer_duration (wav->sinkpad, GST_FORMAT_BYTES, &upstream_size);
gst_pad_peer_query_duration (wav->sinkpad, GST_FORMAT_BYTES, &upstream_size);
GST_DEBUG_OBJECT (wav, "upstream size %" G_GUINT64_FORMAT, upstream_size);
/* loop headers until we get data */