diff --git a/gst-libs/gst/audio/audio-converter.c b/gst-libs/gst/audio/audio-converter.c index 5138610ba4..c6d151f314 100644 --- a/gst-libs/gst/audio/audio-converter.c +++ b/gst-libs/gst/audio/audio-converter.c @@ -478,7 +478,7 @@ do_unpack (AudioChain * chain, gpointer user_data) } } 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); } } @@ -1102,7 +1102,7 @@ converter_passthrough (GstAudioConverter * convert, } } 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; } @@ -1248,7 +1248,7 @@ converter_endian (GstAudioConverter * convert, 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; } diff --git a/gst-libs/gst/audio/audio-format.c b/gst-libs/gst/audio/audio-format.c index cc5345e5da..90551eaff7 100644 --- a/gst-libs/gst/audio/audio-format.c +++ b/gst-libs/gst/audio/audio-format.c @@ -459,10 +459,30 @@ gst_audio_format_get_info (GstAudioFormat format) * @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; diff --git a/gst-libs/gst/audio/audio-format.h b/gst-libs/gst/audio/audio-format.h index aaab644e19..15e970fd44 100644 --- a/gst-libs/gst/audio/audio-format.h +++ b/gst-libs/gst/audio/audio-format.h @@ -286,8 +286,11 @@ const GstAudioFormatInfo * 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: diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c index ac8ee8c6c1..dd6e7dd749 100644 --- a/gst-libs/gst/audio/gstaudioaggregator.c +++ b/gst-libs/gst/audio/gstaudioaggregator.c @@ -1870,7 +1870,8 @@ gst_audio_aggregator_create_output_buffer (GstAudioAggregator * aagg, 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; diff --git a/gst-libs/gst/audio/gstaudioringbuffer.c b/gst-libs/gst/audio/gstaudioringbuffer.c index 16d7739434..439a2a043f 100644 --- a/gst-libs/gst/audio/gstaudioringbuffer.c +++ b/gst-libs/gst/audio/gstaudioringbuffer.c @@ -656,7 +656,7 @@ gst_audio_ring_buffer_acquire (GstAudioRingBuffer * buf, 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 */ diff --git a/gst-libs/gst/audio/gstaudiosink.c b/gst-libs/gst/audio/gstaudiosink.c index 5103f2d00f..bda51fe080 100644 --- a/gst-libs/gst/audio/gstaudiosink.c +++ b/gst-libs/gst/audio/gstaudiosink.c @@ -414,7 +414,7 @@ gst_audio_sink_ring_buffer_acquire (GstAudioRingBuffer * buf, 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 */ diff --git a/gst-libs/gst/audio/gstaudiosrc.c b/gst-libs/gst/audio/gstaudiosrc.c index fccdeac29b..a676155cd2 100644 --- a/gst-libs/gst/audio/gstaudiosrc.c +++ b/gst-libs/gst/audio/gstaudiosrc.c @@ -384,7 +384,7 @@ gst_audio_src_ring_buffer_acquire (GstAudioRingBuffer * buf, 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 */ diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 25ff7984fc..466341750e 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -1424,7 +1424,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data) /* 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 { diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 01231e0ed3..96855cff81 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -849,8 +849,8 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf, /* 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; diff --git a/gst/audiorate/gstaudiorate.c b/gst/audiorate/gstaudiorate.c index 30a5d6ffd2..3d9dc04584 100644 --- a/gst/audiorate/gstaudiorate.c +++ b/gst/audiorate/gstaudiorate.c @@ -559,7 +559,7 @@ gst_audio_rate_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) 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); diff --git a/tests/check/libs/audio.c b/tests/check/libs/audio.c index 400dbc89cf..3221450428 100644 --- a/tests/check/libs/audio.c +++ b/tests/check/libs/audio.c @@ -926,7 +926,7 @@ GST_START_TEST (test_fill_silence) 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++)