summaryrefslogtreecommitdiffstats
path: root/audio/a2dp.h
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-31 15:01:12 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-08-31 15:01:12 +0000
commite00800b81712635aade50201cfc3e6eca8b53ae0 (patch)
tree29a74e0a72b568a90b4fe51e36c905ba5dec60ff /audio/a2dp.h
parent1778b4d041e6251d7411467a1db978730f8fdce0 (diff)
Fix endianess problem.
Diffstat (limited to 'audio/a2dp.h')
-rw-r--r--audio/a2dp.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/audio/a2dp.h b/audio/a2dp.h
index 6a966302..e0d1c2f6 100644
--- a/audio/a2dp.h
+++ b/audio/a2dp.h
@@ -47,6 +47,8 @@
#define A2DP_ALLOCATION_SNR (1 << 1)
#define A2DP_ALLOCATION_LOUDNESS 1
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+
struct sbc_codec_cap {
struct avdtp_media_codec_capability cap;
uint8_t channel_mode:4;
@@ -58,6 +60,23 @@ struct sbc_codec_cap {
uint8_t max_bitpool;
} __attribute__ ((packed));
+#elif __BYTE_ORDER == __BIG_ENDIAN
+
+struct sbc_codec_cap {
+ struct avdtp_media_codec_capability cap;
+ uint8_t frequency:4;
+ uint8_t channel_mode:4;
+ uint8_t block_length:4;
+ uint8_t subbands:2;
+ uint8_t allocation_method:2;
+ uint8_t min_bitpool;
+ uint8_t max_bitpool;
+} __attribute__ ((packed));
+
+#else
+#error "Unknown byte order"
+#endif
+
struct a2dp_sep;
typedef void (*a2dp_stream_cb_t) (struct avdtp *session, struct a2dp_sep *sep,