[Bug 751605] audio: Add proper support for non-interleaved / planar audio

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun May 6 10:18:14 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=751605

--- Comment #20 from George Kiagiadakis <gkiagia at tolabaki.gr> ---
(In reply to Sebastian Dröge (slomo) from comment #19)
> ::: gst-libs/gst/audio/audio-buffer.h
> @@ +52,3 @@
> +  gpointer    *planes;
> +
> +  GstBuffer   *gstbuffer;
> 
> Why the gst prefix?

Well, because the parent structure is also a buffer, so then you write stuff
like buffer->buffer that is not so readable, but it's not a big deal. I can
remove it.

> ::: gst-libs/gst/audio/gstaudiometa.c
> @@ +314,3 @@
> +  gst_audio_info_init (&ameta->info);
> +  ameta->samples = 0;
> +  ameta->offsets = NULL;
> 
> You need to initialize all the fields, otherwise they'll contain garbage

Which fields? I do initialze them :)

> ::: gst-libs/gst/audio/gstaudiometa.h
> @@ +156,3 @@
> + * Since: 1.16
> + */
> +struct _GstAudioMeta {
> 
> Should it maybe be get the word "planar" in here, or do you expect this to
> be also useful for interleaved audio somehow?

The intention was to be able to attach it in both interleaved and
non-interleaved buffers. Although, for interleaved I haven't thought of a use
case.

> @@ +161,3 @@
> +  GstAudioInfo   info;
> +  gsize          samples;
> +  gsize          *offsets;
> 
> Is it allowed to have multiple channels with the same offset, to cheaply
> duplicate a channel?

Sure, why not.

> @@ +180,3 @@
> +GstAudioMeta * gst_buffer_add_audio_meta (GstBuffer *buffer,
> +                                          const GstAudioInfo *info,
> +                                          gsize samples, gsize offsets[]);
> 
> This should maybe sanity-check the buffer size against the number of samples?

There is a check in the map function. But now I am thinking, what if you are
duplicating channels in the way you just said above? The check will be
inaccurate.

Maybe we can check that the highest offset + samples * bps is contained in the
buffer

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list