Problems with AAC and qtdemux

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Mar 20 04:39:58 PDT 2012


On Tue, 2012-03-20 at 11:05 +0000, Neil Jones wrote:

> the codec_data buffer provided in the caps looks promising ( i just
> assumed this was the address of the first buffer ).
> 
> This appears to be just an address, can I just dereference this ? are
> there any buffer ownership issues I need to be aware of ?
> 
>
> >> caps = audio/mpeg, mpegversion=(int)4, framed=(boolean)true,
> >> stream-format=(string)raw, codec_data=(buffer)139056e5a0,
> >> rate=(int)44100, channels=(int)2
> >> ....

It's not an address. Those are actually 5 bytes in hex notation.

You can get to the buffer via:

GstStructure *s;
const GValue *value;

s = gst_caps_get_structure (caps, 0);
value = gst_structure_get_value (structure, "codec_data");
if (value != NULL) {
  GstBuffer *codec_data;
  const guint8 *data;
  guint data_size;

  codec_data = gst_value_get_buffer (value);
  data = GST_BUFFER_DATA (codec_data);
  data_size = GST_BUFFER_SIZE (codec_data);

  gst_util_dump_mem (data, data_size);
}

Cheers
 -Tim



More information about the gstreamer-devel mailing list