summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-09-18 23:33:44 +0000
committerBenny Prijono <bennylp@teluu.com>2006-09-18 23:33:44 +0000
commit6f0c45ca34575b68017a174e63014bcf18a99763 (patch)
tree1343b06363ead620c56f3b261b39ef90646a5390 /pjmedia/include
parent2f0bd9f3cacc40aaafc784788030c6f244588e3f (diff)
Support for reading non-canonical WAV file in WAV file player port.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@727 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/wave.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/wave.h b/pjmedia/include/pjmedia/wave.h
index 9727a9bd..0de40e29 100644
--- a/pjmedia/include/pjmedia/wave.h
+++ b/pjmedia/include/pjmedia/wave.h
@@ -96,6 +96,30 @@ struct pjmedia_wave_hdr
*/
typedef struct pjmedia_wave_hdr pjmedia_wave_hdr;
+/**
+ * This structure describes generic RIFF subchunk header.
+ */
+typedef struct pjmedia_wave_subchunk
+{
+ pj_uint32_t id; /**< Subchunk ASCII tag. */
+ pj_uint32_t len; /**< Length following this field */
+} pjmedia_wave_subchunk;
+
+
+/**
+ * Normalize subchunk header from little endian (the representation of
+ * RIFF file) into host's endian.
+ */
+#if defined(PJ_IS_BIG_ENDIAN) && PJ_IS_BIG_ENDIAN!=0
+# define PJMEDIA_WAVE_NORMALIZE_SUBCHUNK(ch) \
+ do { \
+ (ch)->id = pj_swap32((ch)->id); \
+ (ch)->len = pj_swap32((ch)->len); \
+ } while (0)
+#else
+# define PJMEDIA_WAVE_NORMALIZE_SUBCHUNK(ch)
+#endif
+
/**
* On big-endian hosts, this function swaps the byte order of the values