aboutsummaryrefslogtreecommitdiffstats
path: root/epan/pint.h
diff options
context:
space:
mode:
authorTomas Kukosa <tomas.kukosa@siemens.com>2007-12-28 13:01:55 +0000
committerTomas Kukosa <tomas.kukosa@siemens.com>2007-12-28 13:01:55 +0000
commit487792b348faebb252f1a8be8bc0e274086d4da9 (patch)
treec883f5f46893e36400f0405857f83d0f51938261 /epan/pint.h
parent3963febfa14f0acd2d7a6826e129579ab42239c3 (diff)
save RTP in 16-bit linear PCM instead of 8-bit G.711 u-Law
(preparation for more codecs support via codec plugins) svn path=/trunk/; revision=23961
Diffstat (limited to 'epan/pint.h')
-rw-r--r--epan/pint.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/epan/pint.h b/epan/pint.h
index f5335caeff..f889a80eef 100644
--- a/epan/pint.h
+++ b/epan/pint.h
@@ -77,6 +77,23 @@
(guint64)*((const guint8 *)(p)+1)<<8| \
(guint64)*((const guint8 *)(p)+0)<<0)
+/* Pointer routines to put items out in a particular byte order.
+ * These will work regardless of the byte alignment of the pointer.
+ */
+
+#define phtons(p, v) \
+ { \
+ ((guint8*)(p))[0] = (guint8)((v) >> 8); \
+ ((guint8*)(p))[1] = (guint8)((v) >> 0); \
+ }
+
+#define phtonl(p, v) \
+ { \
+ ((guint8*)(p))[0] = (guint8)((v) >> 24); \
+ ((guint8*)(p))[1] = (guint8)((v) >> 16); \
+ ((guint8*)(p))[2] = (guint8)((v) >> 8); \
+ ((guint8*)(p))[3] = (guint8)((v) >> 0); \
+ }
/* Macros to byte-swap 32-bit and 16-bit quantities. */