summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
Diffstat (limited to 'gst')
-rw-r--r--gst/cdxaparse/gstcdxaparse.c2
-rw-r--r--gst/mpeg1sys/buffer.c4
-rw-r--r--gst/mpeg1videoparse/gstmp1videoparse.c8
-rw-r--r--gst/mpeg2sub/gstmpeg2subt.c4
-rw-r--r--gst/mpegaudioparse/gstmpegaudioparse.c4
-rw-r--r--gst/qtdemux/qtdemux.c27
6 files changed, 25 insertions, 24 deletions
diff --git a/gst/cdxaparse/gstcdxaparse.c b/gst/cdxaparse/gstcdxaparse.c
index 595191b7..36ebc335 100644
--- a/gst/cdxaparse/gstcdxaparse.c
+++ b/gst/cdxaparse/gstcdxaparse.c
@@ -250,7 +250,7 @@ gst_cdxa_parse_loop (GstElement * element)
gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8 **) & buf, 4);
if (got_bytes < 4)
return;
- cdxa_parse->data_size = GUINT32_FROM_LE (*((guint32 *) buf));
+ cdxa_parse->data_size = GST_READ_UINT32_LE (buf);
/* flush the data size */
if (!gst_bytestream_flush (cdxa_parse->bs, 4))
diff --git a/gst/mpeg1sys/buffer.c b/gst/mpeg1sys/buffer.c
index 6bfcbc06..6c326940 100644
--- a/gst/mpeg1sys/buffer.c
+++ b/gst/mpeg1sys/buffer.c
@@ -401,7 +401,7 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb)
GST_DEBUG ("mpeg1mux::update_audio_info %lu %lu", mb->base, mb->scan_pos);
if (mb->base == 0 && mb->scan_pos == 0) {
- id = GUINT32_FROM_BE (*((guint32 *) (data)));
+ id = GST_READ_UINT32_BE (data);
printf ("MPEG audio id = %08x\n", (unsigned int) id);
if ((id & 0xfff00000) == AUDIO_SYNCWORD << 20) {
@@ -486,7 +486,7 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb)
}
}
while (offset < mb->length - 4) {
- id = GUINT32_FROM_BE (*((guint32 *) (data + offset)));
+ id = GST_READ_UINT32_BE (data + offset);
/* mpegver = (header >> 19) & 0x3; don't need this for bpf */
layer_index = (id >> 17) & 0x3;
diff --git a/gst/mpeg1videoparse/gstmp1videoparse.c b/gst/mpeg1videoparse/gstmp1videoparse.c
index 8d055817..4962a1fa 100644
--- a/gst/mpeg1videoparse/gstmp1videoparse.c
+++ b/gst/mpeg1videoparse/gstmp1videoparse.c
@@ -175,7 +175,7 @@ mp1videoparse_parse_seq (Mp1VideoParse * mp1videoparse, GstBuffer * buf)
30. / 1.001, 30.,
50., 60. / 1.001, 60.
};
- guint32 n = GUINT32_FROM_BE (*(guint32 *) GST_BUFFER_DATA (buf));
+ guint32 n = GST_READ_UINT32_BE (GST_BUFFER_DATA (buf));
width = (n & 0xfff00000) >> 20;
height = (n & 0x000fff00) >> 8;
@@ -277,7 +277,7 @@ mp1videoparse_find_next_gop (Mp1VideoParse * mp1videoparse, GstBuffer * buf)
static guint64
gst_mp1videoparse_time_code (guchar * gop, gfloat fps)
{
- guint32 data = GUINT32_FROM_BE (*(guint32 *) gop);
+ guint32 data = GST_READ_UINT32_BE (gop);
return ((((data & 0xfc000000) >> 26) * 3600 * GST_SECOND) + /* hours */
(((data & 0x03f00000) >> 20) * 60 * GST_SECOND) + /* minutes */
@@ -381,7 +381,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf,
data = GST_BUFFER_DATA (mp1videoparse->partialbuf);
size = GST_BUFFER_SIZE (mp1videoparse->partialbuf);
- head = GUINT32_FROM_BE (*((guint32 *) data));
+ head = GST_READ_UINT32_BE (data);
GST_DEBUG ("mp1videoparse: head is %08x", (unsigned int) head);
@@ -406,7 +406,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf,
offset = 0;
}
- head = GUINT32_FROM_BE (*((guint32 *) data));
+ head = GST_READ_UINT32_BE (data);
/* re-call this function so that if we hadn't already, we can
* now read the sequence header and parse video properties,
* set caps, stream data, be happy, bla, bla, bla... */
diff --git a/gst/mpeg2sub/gstmpeg2subt.c b/gst/mpeg2sub/gstmpeg2subt.c
index d54669db..cea5939b 100644
--- a/gst/mpeg2sub/gstmpeg2subt.c
+++ b/gst/mpeg2sub/gstmpeg2subt.c
@@ -807,13 +807,13 @@ gst_mpeg2subt_handle_subtitle (GstMpeg2Subt * mpeg2subt, GstData * _data)
size = GST_BUFFER_SIZE (mpeg2subt->partialbuf);
if (size > 4) {
- mpeg2subt->packet_size = GUINT16_FROM_BE (*(guint16 *) data);
+ mpeg2subt->packet_size = GST_READ_UINT16_BE (data);
if (mpeg2subt->packet_size == size) {
GST_LOG ("Subtitle packet size %d, current size %ld",
mpeg2subt->packet_size, size);
- mpeg2subt->data_size = GUINT16_FROM_BE (*(guint16 *) (data + 2));
+ mpeg2subt->data_size = GST_READ_UINT16_BE (data + 2);
mpeg2subt->have_title = TRUE;
gst_mpeg2subt_parse_header (mpeg2subt);
diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c
index a4152dea..7c3df7ba 100644
--- a/gst/mpegaudioparse/gstmpegaudioparse.c
+++ b/gst/mpegaudioparse/gstmpegaudioparse.c
@@ -336,7 +336,7 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data)
GST_DEBUG ("mp3parse: **** now at %ld skipped %d bytes", offset, skipped);
}
/* construct the header word */
- header = GUINT32_FROM_BE (*((guint32 *) (data + offset)));
+ header = GST_READ_UINT32_BE (data + offset);
/* if it's a valid header, go ahead and send off the frame */
if (head_check (header)) {
/* calculate the bpf of the frame */
@@ -362,7 +362,7 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data)
break;
}
/* wait until we have the the entire current frame as well as the next frame header */
- header2 = GUINT32_FROM_BE (*((guint32 *) (data + offset + bpf)));
+ header2 = GST_READ_UINT32_BE (data + offset + bpf);
GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d",
(unsigned int) header, (unsigned int) header2, bpf);
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index a25fdb18..3b32ef67 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -23,18 +23,19 @@
#endif
#include "qtdemux.h"
+#include <stdlib.h>
#include <string.h>
#include <zlib.h>
GST_DEBUG_CATEGORY_EXTERN (qtdemux_debug);
#define GST_CAT_DEFAULT qtdemux_debug
-#define QTDEMUX_GUINT32_GET(a) GUINT32_FROM_BE(*(guint32 *)(a))
-#define QTDEMUX_GUINT16_GET(a) GUINT16_FROM_BE(*(guint16 *)(a))
+#define QTDEMUX_GUINT32_GET(a) (GST_READ_UINT32_BE(a))
+#define QTDEMUX_GUINT16_GET(a) (GST_READ_UINT16_BE(a))
#define QTDEMUX_GUINT8_GET(a) (*(guint8 *)(a))
-#define QTDEMUX_FP32_GET(a) (GUINT32_FROM_BE(*(guint16 *)(a))/65536.0)
-#define QTDEMUX_FP16_GET(a) (GUINT16_FROM_BE(*(guint16 *)(a))/256.0)
-#define QTDEMUX_FOURCC_GET(a) GUINT32_FROM_LE(*(guint32 *)(a))
+#define QTDEMUX_FP32_GET(a) ((GST_READ_UINT32_BE(a))/65536.0)
+#define QTDEMUX_FP16_GET(a) ((GST_READ_UINT16_BE(a))/256.0)
+#define QTDEMUX_FOURCC_GET(a) (GST_READ_UINT32_LE(a))
#define QTDEMUX_GUINT64_GET(a) ((((guint64)QTDEMUX_GUINT32_GET(a))<<32)|QTDEMUX_GUINT32_GET(((void *)a)+4))
@@ -522,9 +523,9 @@ gst_qtdemux_loop_header (GstElement * element)
}
} while (1);
- length = GUINT32_FROM_BE (*(guint32 *) data);
+ length = GST_READ_UINT32_BE (data);
GST_DEBUG ("length %08x", length);
- fourcc = GUINT32_FROM_LE (*(guint32 *) (data + 4));
+ fourcc = GST_READ_UINT32_LE (data + 4);
GST_DEBUG ("fourcc " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
if (length == 0) {
@@ -533,9 +534,9 @@ gst_qtdemux_loop_header (GstElement * element)
if (length == 1) {
guint32 length1, length2;
- length1 = GUINT32_FROM_BE (*(guint32 *) (data + 8));
+ length1 = GST_READ_UINT32_BE (data + 8);
GST_DEBUG ("length1 %08x", length1);
- length2 = GUINT32_FROM_BE (*(guint32 *) (data + 12));
+ length2 = GST_READ_UINT32_BE (data + 12);
GST_DEBUG ("length2 %08x", length2);
length = length2;
@@ -1125,8 +1126,8 @@ qtdemux_node_dump_foreach (GNode * node, gpointer data)
QtNodeType *type;
int depth;
- node_length = GUINT32_FROM_BE (*(guint32 *) buffer);
- fourcc = GUINT32_FROM_LE (*(guint32 *) (buffer + 4));
+ node_length = GST_READ_UINT32_BE (buffer);
+ fourcc = GST_READ_UINT32_LE (buffer + 4);
type = qtdemux_type_get (fourcc);
@@ -1518,7 +1519,7 @@ qtdemux_tree_get_child_by_type (GNode * node, guint32 fourcc)
child = g_node_next_sibling (child)) {
buffer = child->data;
- child_fourcc = GUINT32_FROM_LE (*(guint32 *) (buffer + 4));
+ child_fourcc = GST_READ_UINT32_LE (buffer + 4);
if (child_fourcc == fourcc) {
return child;
@@ -1538,7 +1539,7 @@ qtdemux_tree_get_sibling_by_type (GNode * node, guint32 fourcc)
child = g_node_next_sibling (child)) {
buffer = child->data;
- child_fourcc = GUINT32_FROM_LE (*(guint32 *) (buffer + 4));
+ child_fourcc = GST_READ_UINT32_LE (buffer + 4);
if (child_fourcc == fourcc) {
return child;