summaryrefslogtreecommitdiff
path: root/codecs/sbc
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2012-09-14 15:08:17 +0200
committerEvan Huus <eapache@gmail.com>2014-02-12 01:36:02 +0000
commit10084c344c89fdadc915e47bcece84a2ac511dc5 (patch)
treecf48eed191bfd99bd2087f2d7cb3a13fa3049047 /codecs/sbc
parentab3348eeb412d45acd89ffb7d0b39189b36399ce (diff)
downloadwireshark-10084c344c89fdadc915e47bcece84a2ac511dc5.tar.gz
RTP: Add support for SBC codec in RTP Player
Add optional dependancy to libsbc to play Bluetooth SBC in A2DP payload. Also simplify RTP Player and extent codec interface. Change-Id: I52e1fce9c82e2885736354fe73c6c37168a4fda3 Reviewed-on: https://code.wireshark.org/review/19 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'codecs/sbc')
-rw-r--r--codecs/sbc/sbc.c37
-rw-r--r--codecs/sbc/sbc_private.h (renamed from codecs/sbc/sbc.h)21
2 files changed, 42 insertions, 16 deletions
diff --git a/codecs/sbc/sbc.c b/codecs/sbc/sbc.c
index b14b5bb681..786144f640 100644
--- a/codecs/sbc/sbc.c
+++ b/codecs/sbc/sbc.c
@@ -31,7 +31,7 @@
#include <glib.h>
#include <sbc/sbc.h>
-#include "sbc.h"
+#include "sbc_private.h"
#define SBC_BUFFER 8192
@@ -40,7 +40,7 @@ codec_sbc_init(void)
{
sbc_t *sbc;
- sbc = g_malloc(sizeof(sbc_t));
+ sbc = (sbc_t *) g_malloc(sizeof(sbc_t));
sbc_init(sbc, 0L);
return sbc;
@@ -98,16 +98,16 @@ int
codec_sbc_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
int *outputSizeBytes)
{
- size_t size_in = (size_t) inputSizeBytes;
- size_t size_out = SBC_BUFFER;
- size_t len;
- int framelen;
- int xframe_pos = 0;
- guint8 *data_in = (guint8 *) input;
- guint8 *data_out = (guint8 *) output;
- sbc_t *sbc = (sbc_t *) ctx;
- guint8 *i_data;
- guint8 tmp;
+ size_t size_in = (size_t) inputSizeBytes;
+ size_t size_out = SBC_BUFFER;
+ size_t len;
+ int framelen;
+ int xframe_pos = 0;
+ const guint8 *data_in = (const guint8 *) input;
+ guint8 *data_out = (guint8 *) output;
+ sbc_t *sbc = (sbc_t *) ctx;
+ guint8 *i_data;
+ guint8 tmp;
if (!output || !outputSizeBytes) {
return size_out;
@@ -136,3 +136,16 @@ codec_sbc_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
}
#endif
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */
diff --git a/codecs/sbc/sbc.h b/codecs/sbc/sbc_private.h
index 5cc8ad0927..71f643532b 100644
--- a/codecs/sbc/sbc.h
+++ b/codecs/sbc/sbc_private.h
@@ -28,10 +28,23 @@
#define __CODECS_SBC_H__
void *codec_sbc_init(void);
-void codec_sbc_release(void *ctx);
-int codec_sbc_get_channels(void *ctx);
-int codec_sbc_get_frequency(void *ctx);
-int codec_sbc_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
+void codec_sbc_release(void *ctx);
+int codec_sbc_get_channels(void *ctx);
+int codec_sbc_get_frequency(void *ctx);
+int codec_sbc_decode(void *ctx, const void *input, int inputSizeBytes, void *output,
int *outputSizeBytes);
#endif /* sbc.h */
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */