summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-05-02 18:27:01 +0000
committerMohamed Tarek <mt@rockbox.org>2010-05-02 18:27:01 +0000
commit7aaae54afcda1f4ea5224d3d9d0ac3ffd69defaf (patch)
tree8aa54989bf4104440070e926a4a70706a0202793 /apps
parent2ab15d959cc56bf6037616a359fd0ec7a9ecef60 (diff)
downloadrockbox-7aaae54afcda1f4ea5224d3d9d0ac3ffd69defaf.tar.gz
rockbox-7aaae54afcda1f4ea5224d3d9d0ac3ffd69defaf.tar.bz2
rockbox-7aaae54afcda1f4ea5224d3d9d0ac3ffd69defaf.zip
- Modify metadata/asf.c to use libasf.
- Modify the files in libwma to use libasf. - Remove apps/codecs/libwma/asf.h since it's not used now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25783 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libasf/asf.h8
-rw-r--r--apps/codecs/libwma/asf.h24
-rw-r--r--apps/codecs/libwma/wmadec.h2
-rw-r--r--apps/codecs/libwma/wmadeci.c2
-rw-r--r--apps/metadata/asf.c16
5 files changed, 9 insertions, 43 deletions
diff --git a/apps/codecs/libasf/asf.h b/apps/codecs/libasf/asf.h
index 03af2b0de1..2007e08e86 100644
--- a/apps/codecs/libasf/asf.h
+++ b/apps/codecs/libasf/asf.h
@@ -17,7 +17,8 @@ enum asf_error_e {
ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */
ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */
ASF_ERROR_SEEKABLE = -9, /* file not seekable */
- ASF_ERROR_SEEK = -10 /* file is seekable but seeking failed */
+ ASF_ERROR_SEEK = -10, /* file is seekable but seeking failed */
+ ASF_ERROR_ENCRYPTED = -11 /* file is encrypted */
};
struct asf_waveformatex_s {
@@ -34,9 +35,12 @@ struct asf_waveformatex_s {
};
typedef struct asf_waveformatex_s asf_waveformatex_t;
+/* Define the packet-specific functions only for codecs not for metadata parsers */
+#ifdef __CODECLIB_H__
int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
asf_waveformatex_t* wfx, struct codec_api* ci);
int asf_get_timestamp(int *duration, struct codec_api* ci);
-
#endif
+
+#endif /* _ASF_H */
diff --git a/apps/codecs/libwma/asf.h b/apps/codecs/libwma/asf.h
deleted file mode 100644
index 550e44ddb6..0000000000
--- a/apps/codecs/libwma/asf.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _ASF_H
-#define _ASF_H
-
-#include <inttypes.h>
-
-/* ASF codec IDs */
-#define ASF_CODEC_ID_WMAV1 0x160
-#define ASF_CODEC_ID_WMAV2 0x161
-
-struct asf_waveformatex_s {
- uint32_t packet_size;
- int audiostream;
- uint16_t codec_id;
- uint16_t channels;
- uint32_t rate;
- uint32_t bitrate;
- uint16_t blockalign;
- uint16_t bitspersample;
- uint16_t datalen;
- uint8_t data[6];
-};
-typedef struct asf_waveformatex_s asf_waveformatex_t;
-
-#endif
diff --git a/apps/codecs/libwma/wmadec.h b/apps/codecs/libwma/wmadec.h
index 8af76ae180..5672bfe063 100644
--- a/apps/codecs/libwma/wmadec.h
+++ b/apps/codecs/libwma/wmadec.h
@@ -20,7 +20,7 @@
#ifndef _WMADEC_H
#define _WMADEC_H
-#include "asf.h"
+#include <codecs/libasf/asf.h>
#include "bitstream.h" /* For GetBitContext */
#include "types.h"
diff --git a/apps/codecs/libwma/wmadeci.c b/apps/codecs/libwma/wmadeci.c
index 6ff6a176ee..6837456af1 100644
--- a/apps/codecs/libwma/wmadeci.c
+++ b/apps/codecs/libwma/wmadeci.c
@@ -24,7 +24,7 @@
#include <codecs.h>
#include <codecs/lib/codeclib.h>
-#include "asf.h"
+#include <codecs/libasf/asf.h>
#include "wmadec.h"
#include "wmafixed.h"
#include "wmadata.h"
diff --git a/apps/metadata/asf.c b/apps/metadata/asf.c
index 9362485eb7..fac4092256 100644
--- a/apps/metadata/asf.c
+++ b/apps/metadata/asf.c
@@ -32,7 +32,7 @@
#include "metadata_common.h"
#include "metadata_parsers.h"
#include "system.h"
-#include <codecs/libwma/asf.h>
+#include <codecs/libasf/asf.h>
/* TODO: Just read the GUIDs into a 16-byte array, and use memcmp to compare */
struct guid_s {
@@ -50,20 +50,6 @@ struct asf_object_s {
};
typedef struct asf_object_s asf_object_t;
-enum asf_error_e {
- ASF_ERROR_INTERNAL = -1, /* incorrect input to API calls */
- ASF_ERROR_OUTOFMEM = -2, /* some malloc inside program failed */
- ASF_ERROR_EOF = -3, /* unexpected end of file */
- ASF_ERROR_IO = -4, /* error reading or writing to file */
- ASF_ERROR_INVALID_LENGTH = -5, /* length value conflict in input data */
- ASF_ERROR_INVALID_VALUE = -6, /* other value conflict in input data */
- ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */
- ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */
- ASF_ERROR_SEEKABLE = -9, /* file not seekable */
- ASF_ERROR_SEEK = -10, /* file is seekable but seeking failed */
- ASF_ERROR_ENCRYPTED = -11 /* file is encrypted */
-};
-
static const guid_t asf_guid_null =
{0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};