[gst-devel] alignment issues

Ronald Bultje rbultje at ronald.bitfreak.net
Sat Apr 3 10:31:18 CEST 2004


Hi,

On Fri, 2 Apr 2004, Daniel Gazard wrote:
> I'm currently playing with gstreamer on an ARM9 based system and it
> had exhibit several alignment issues in a few plugins. Here is the
> typical peace of code which may cause problem (from
> gst-plugins-0.8.0/gst/mpegstream/gstmpegpacketize.c:find_start_code):
> code = GUINT32_FROM_BE (*((guint32 *) (buf)));
[..]
> May be there are other similar problems elsewhere. If someone is
> interested, I can send my patches (I have to clean up the code
> before).

Please do. I sort-of dislike memcpy() though... Can you think of a quick
macro to do this? E.g.:

#define GST_READ_UINT32_BE(data) (data[0] << 24 | \
				  data[1] << 16 | \
				  data[2] <<  8 | \
				  data[3]         )

(etc.)

Same for uint64, 16, all also LE and maybe even several write macros. Such
code should go somewhere in GStreamer core, I guess, since those are used
virtually everywhere.

Thanks for noticing,

Ronald





More information about the gstreamer-devel mailing list