summaryrefslogtreecommitdiff
path: root/gst-libs/gst/audio/gstaudiodecoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/audio/gstaudiodecoder.c')
-rw-r--r--gst-libs/gst/audio/gstaudiodecoder.c73
1 files changed, 1 insertions, 72 deletions
diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c
index 5cd265567..d672663e3 100644
--- a/gst-libs/gst/audio/gstaudiodecoder.c
+++ b/gst-libs/gst/audio/gstaudiodecoder.c
@@ -2526,77 +2526,6 @@ gst_audio_decoder_propose_allocation_default (GstAudioDecoder * dec,
return TRUE;
}
-/*
- * gst_audio_encoded_audio_convert:
- * @fmt: audio format of the encoded audio
- * @bytes: number of encoded bytes
- * @samples: number of encoded samples
- * @src_format: source format
- * @src_value: source value
- * @dest_format: destination format
- * @dest_value: destination format
- *
- * Helper function to convert @src_value in @src_format to @dest_value in
- * @dest_format for encoded audio data. Conversion is possible between
- * BYTE and TIME format by using estimated bitrate based on
- * @samples and @bytes (and @fmt).
- */
-/* FIXME: make gst_audio_encoded_audio_convert() public? */
-static gboolean
-gst_audio_encoded_audio_convert (GstAudioInfo * fmt,
- gint64 bytes, gint64 samples, GstFormat src_format,
- gint64 src_value, GstFormat * dest_format, gint64 * dest_value)
-{
- gboolean res = FALSE;
-
- g_return_val_if_fail (dest_format != NULL, FALSE);
- g_return_val_if_fail (dest_value != NULL, FALSE);
-
- if (G_UNLIKELY (src_format == *dest_format || src_value == 0 ||
- src_value == -1)) {
- if (dest_value)
- *dest_value = src_value;
- return TRUE;
- }
-
- if (samples == 0 || bytes == 0 || fmt->rate == 0) {
- GST_DEBUG ("not enough metadata yet to convert");
- goto exit;
- }
-
- bytes *= fmt->rate;
-
- switch (src_format) {
- case GST_FORMAT_BYTES:
- switch (*dest_format) {
- case GST_FORMAT_TIME:
- *dest_value = gst_util_uint64_scale (src_value,
- GST_SECOND * samples, bytes);
- res = TRUE;
- break;
- default:
- res = FALSE;
- }
- break;
- case GST_FORMAT_TIME:
- switch (*dest_format) {
- case GST_FORMAT_BYTES:
- *dest_value = gst_util_uint64_scale (src_value, bytes,
- samples * GST_SECOND);
- res = TRUE;
- break;
- default:
- res = FALSE;
- }
- break;
- default:
- res = FALSE;
- }
-
-exit:
- return res;
-}
-
/**
* gst_audio_decoder_proxy_getcaps:
* @decoder: a #GstAudioDecoder
@@ -2659,7 +2588,7 @@ gst_audio_decoder_sink_query_default (GstAudioDecoder * dec, GstQuery * query)
gint64 src_val, dest_val;
gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val);
- if (!(res = gst_audio_encoded_audio_convert (&dec->priv->ctx.info,
+ if (!(res = __gst_audio_encoded_audio_convert (&dec->priv->ctx.info,
dec->priv->bytes_in, dec->priv->samples_out,
src_fmt, src_val, &dest_fmt, &dest_val)))
goto error;