}
} else {
for (i = 0; i < chain->blocks; i++) {
- gst_audio_format_fill_silence (chain->finfo, tmp[i],
+ gst_audio_format_info_fill_silence (chain->finfo, tmp[i],
num_samples * chain->inc);
}
}
}
} else {
for (i = 0; i < chain->blocks; i++)
- gst_audio_format_fill_silence (convert->in.finfo, out[i], samples);
+ gst_audio_format_info_fill_silence (convert->in.finfo, out[i], samples);
}
return TRUE;
}
convert->swap_endian (out[i], in[i], samples);
} else {
for (i = 0; i < chain->blocks; i++)
- gst_audio_format_fill_silence (convert->in.finfo, out[i], samples);
+ gst_audio_format_info_fill_silence (convert->in.finfo, out[i], samples);
}
return TRUE;
}
* @length: the length to fill
*
* Fill @length bytes in @dest with silence samples for @info.
+ *
+ * Deprecated: 1.20: Use gst_audio_format_info_fill_silence() instead.
*/
void
gst_audio_format_fill_silence (const GstAudioFormatInfo * info,
gpointer dest, gsize length)
{
+ gst_audio_format_info_fill_silence (info, dest, length);
+}
+
+/**
+ * gst_audio_format_info_fill_silence:
+ * @info: a #GstAudioFormatInfo
+ * @dest: (array length=length) (element-type guint8): a destination
+ * to fill
+ * @length: the length to fill
+ *
+ * Fill @length bytes in @dest with silence samples for @info.
+ *
+ * Since: 1.20
+ */
+void
+gst_audio_format_info_fill_silence (const GstAudioFormatInfo * info,
+ gpointer dest, gsize length)
+{
guint8 *dptr = dest;
g_return_if_fail (info != NULL);
gst_audio_format_get_info (GstAudioFormat format) G_GNUC_CONST;
GST_AUDIO_API
-void gst_audio_format_fill_silence (const GstAudioFormatInfo *info,
- gpointer dest, gsize length);
+void gst_audio_format_info_fill_silence (const GstAudioFormatInfo *info,
+ gpointer dest, gsize length);
+GST_AUDIO_API G_DEPRECATED_FOR(gst_audio_format_info_fill_silence)
+void gst_audio_format_fill_silence (const GstAudioFormatInfo *info,
+ gpointer dest, gsize length);
/**
* GST_AUDIO_RATE_RANGE:
gst_object_unref (allocator);
gst_buffer_map (outbuf, &outmap, GST_MAP_WRITE);
- gst_audio_format_fill_silence (srcpad->info.finfo, outmap.data, outmap.size);
+ gst_audio_format_info_fill_silence (srcpad->info.finfo, outmap.data,
+ outmap.size);
gst_buffer_unmap (outbuf, &outmap);
return outbuf;
buf->empty_seg = g_malloc (segsize);
if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
- gst_audio_format_fill_silence (buf->spec.info.finfo, buf->empty_seg,
+ gst_audio_format_info_fill_silence (buf->spec.info.finfo, buf->empty_seg,
segsize);
} else {
/* FIXME, non-raw formats get 0 as the empty sample */
buf->memory = g_malloc (buf->size);
if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
- gst_audio_format_fill_silence (buf->spec.info.finfo, buf->memory,
+ gst_audio_format_info_fill_silence (buf->spec.info.finfo, buf->memory,
buf->size);
} else {
/* FIXME, non-raw formats get 0 as the empty sample */
buf->size = spec->segtotal * spec->segsize;
buf->memory = g_malloc (buf->size);
if (buf->spec.type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
- gst_audio_format_fill_silence (buf->spec.info.finfo, buf->memory,
+ gst_audio_format_info_fill_silence (buf->spec.info.finfo, buf->memory,
buf->size);
} else {
/* FIXME, non-raw formats get 0 as the empty sample */
/* Means we had all pads muted, create some silence */
outbuf = gst_buffer_new_allocate (NULL, outsize, NULL);
gst_buffer_map (outbuf, &map, GST_MAP_WRITE);
- gst_audio_format_fill_silence (adder->info.finfo, map.data, outsize);
+ gst_audio_format_info_fill_silence (adder->info.finfo, map.data, outsize);
gst_buffer_unmap (outbuf, &map);
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
} else {
/* Create silence buffer */
gint i;
for (i = 0; i < dstabuf.n_planes; i++) {
- gst_audio_format_fill_silence (this->out_info.finfo, dstabuf.planes[i],
- GST_AUDIO_BUFFER_PLANE_SIZE (&dstabuf));
+ gst_audio_format_info_fill_silence (this->out_info.finfo,
+ dstabuf.planes[i], GST_AUDIO_BUFFER_PLANE_SIZE (&dstabuf));
}
}
ret = GST_FLOW_OK;
fill = gst_buffer_new_and_alloc (fillsize);
gst_buffer_map (fill, &fillmap, GST_MAP_WRITE);
- gst_audio_format_fill_silence (audiorate->info.finfo, fillmap.data,
+ gst_audio_format_info_fill_silence (audiorate->info.finfo, fillmap.data,
fillmap.size);
gst_buffer_unmap (fill, &fillmap);
for (f = GST_AUDIO_FORMAT_S8; f < GST_AUDIO_FORMAT_F64; f++) {
gst_audio_info_set_format (&info, f, 48000, 1, NULL);
- gst_audio_format_fill_silence (info.finfo, test_silence,
+ gst_audio_format_info_fill_silence (info.finfo, test_silence,
GST_AUDIO_INFO_BPF (&info) * 4);
for (i = 0; i < 4; i++)