diff options
author | Jeffrey Goode <jeffg7@gmail.com> | 2009-11-16 22:02:06 +0000 |
---|---|---|
committer | Jeffrey Goode <jeffg7@gmail.com> | 2009-11-16 22:02:06 +0000 |
commit | a052102cfb861aae6c8e683ae01bbace9620235c (patch) | |
tree | cb54d8bf97099cc7ec1275ef8a27664a089dc831 | |
parent | db82be4390d294c8d460f50c06add41ffa6686f5 (diff) | |
download | rockbox-a052102cfb861aae6c8e683ae01bbace9620235c.tar.gz rockbox-a052102cfb861aae6c8e683ae01bbace9620235c.zip |
mpeg.h/c cleanup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23652 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs.c | 1 | ||||
-rw-r--r-- | apps/misc.c | 1 | ||||
-rw-r--r-- | apps/mpeg.c | 21 | ||||
-rw-r--r-- | apps/mpeg.h | 42 | ||||
-rw-r--r-- | apps/playback.h | 8 | ||||
-rw-r--r-- | apps/recorder/radio.c | 1 | ||||
-rw-r--r-- | apps/recorder/recording.c | 1 | ||||
-rw-r--r-- | apps/settings.c | 1 | ||||
-rw-r--r-- | apps/settings_list.c | 1 | ||||
-rw-r--r-- | firmware/export/audio.h | 7 |
10 files changed, 30 insertions, 54 deletions
diff --git a/apps/codecs.c b/apps/codecs.c index 45b0fa7790..8976871abd 100644 --- a/apps/codecs.c +++ b/apps/codecs.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include "codecs.h" | 38 | #include "codecs.h" |
39 | #include "lang.h" | 39 | #include "lang.h" |
40 | #include "keyboard.h" | 40 | #include "keyboard.h" |
41 | #include "mpeg.h" | ||
42 | #include "buffering.h" | 41 | #include "buffering.h" |
43 | #include "mp3_playback.h" | 42 | #include "mp3_playback.h" |
44 | #include "backlight.h" | 43 | #include "backlight.h" |
diff --git a/apps/misc.c b/apps/misc.c index f1c38f376c..6677c5f9b9 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include "screens.h" | 39 | #include "screens.h" |
40 | #include "usb_screen.h" | 40 | #include "usb_screen.h" |
41 | #include "talk.h" | 41 | #include "talk.h" |
42 | #include "mpeg.h" | ||
43 | #include "audio.h" | 42 | #include "audio.h" |
44 | #include "mp3_playback.h" | 43 | #include "mp3_playback.h" |
45 | #include "settings.h" | 44 | #include "settings.h" |
diff --git a/apps/mpeg.c b/apps/mpeg.c index 079faac13c..514379c16c 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c | |||
@@ -54,6 +54,27 @@ | |||
54 | #include "lcd.h" | 54 | #include "lcd.h" |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | #define MPEG_SWAP_CHUNKSIZE 0x2000 | ||
58 | #define MPEG_HIGH_WATER 2 /* We leave 2 bytes empty because otherwise we | ||
59 | wouldn't be able to see the difference between | ||
60 | an empty buffer and a full one. */ | ||
61 | #define MPEG_LOW_WATER 0x60000 | ||
62 | #define MPEG_RECORDING_LOW_WATER 0x80000 | ||
63 | #define MPEG_LOW_WATER_CHUNKSIZE 0x40000 | ||
64 | #define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000 | ||
65 | #if (CONFIG_STORAGE & STORAGE_MMC) | ||
66 | #define MPEG_PLAY_PENDING_THRESHOLD 0x20000 | ||
67 | #define MPEG_PLAY_PENDING_SWAPSIZE 0x20000 | ||
68 | #else | ||
69 | #define MPEG_PLAY_PENDING_THRESHOLD 0x10000 | ||
70 | #define MPEG_PLAY_PENDING_SWAPSIZE 0x10000 | ||
71 | #endif | ||
72 | |||
73 | #define MPEG_MAX_PRERECORD_SECONDS 30 | ||
74 | |||
75 | /* For ID3 info and VBR header */ | ||
76 | #define MPEG_RESERVED_HEADER_SPACE (4096 + 576) | ||
77 | |||
57 | #ifndef SIMULATOR | 78 | #ifndef SIMULATOR |
58 | extern unsigned long mas_version_code; | 79 | extern unsigned long mas_version_code; |
59 | #endif | 80 | #endif |
diff --git a/apps/mpeg.h b/apps/mpeg.h index 3aaa990881..106933dba3 100644 --- a/apps/mpeg.h +++ b/apps/mpeg.h | |||
@@ -21,46 +21,8 @@ | |||
21 | #ifndef _MPEG_H_ | 21 | #ifndef _MPEG_H_ |
22 | #define _MPEG_H_ | 22 | #define _MPEG_H_ |
23 | 23 | ||
24 | #include <stdbool.h> | 24 | #if CONFIG_CODEC != SWCODEC |
25 | #include "metadata.h" | ||
26 | |||
27 | #define MPEG_SWAP_CHUNKSIZE 0x2000 | ||
28 | #define MPEG_HIGH_WATER 2 /* We leave 2 bytes empty because otherwise we | ||
29 | wouldn't be able to see the difference between | ||
30 | an empty buffer and a full one. */ | ||
31 | #define MPEG_LOW_WATER 0x60000 | ||
32 | #define MPEG_RECORDING_LOW_WATER 0x80000 | ||
33 | #define MPEG_LOW_WATER_CHUNKSIZE 0x40000 | ||
34 | #define MPEG_LOW_WATER_SWAP_CHUNKSIZE 0x10000 | ||
35 | #if (CONFIG_STORAGE & STORAGE_MMC) | ||
36 | #define MPEG_PLAY_PENDING_THRESHOLD 0x20000 | ||
37 | #define MPEG_PLAY_PENDING_SWAPSIZE 0x20000 | ||
38 | #else | ||
39 | #define MPEG_PLAY_PENDING_THRESHOLD 0x10000 | ||
40 | #define MPEG_PLAY_PENDING_SWAPSIZE 0x10000 | ||
41 | #endif | ||
42 | |||
43 | #define MPEG_MAX_PRERECORD_SECONDS 30 | ||
44 | |||
45 | /* For ID3 info and VBR header */ | ||
46 | #define MPEG_RESERVED_HEADER_SPACE (4096 + 576) | ||
47 | |||
48 | #if (CONFIG_CODEC == MAS3587F) || defined(SIMULATOR) | ||
49 | |||
50 | #if CONFIG_TUNER & S1A0903X01 | ||
51 | int mpeg_get_mas_pllfreq(void); | ||
52 | #endif | ||
53 | |||
54 | #endif | ||
55 | unsigned long mpeg_get_last_header(void); | 25 | unsigned long mpeg_get_last_header(void); |
56 | 26 | ||
57 | /* in order to keep the recording here, I have to expose this */ | 27 | #endif |
58 | void rec_tick(void); | ||
59 | void playback_tick(void); /* FixMe: get rid of this, use mp3_get_playtime() */ | ||
60 | |||
61 | void audio_set_track_changed_event(void (*handler)(struct mp3entry *id3)); | ||
62 | void audio_set_track_buffer_event(void (*handler)(struct mp3entry *id3)); | ||
63 | void audio_set_track_unbuffer_event(void (*handler)(struct mp3entry *id3)); | ||
64 | void audio_set_cuesheet_callback(bool (*handler)(const char *filename)); | ||
65 | |||
66 | #endif | 28 | #endif |
diff --git a/apps/playback.h b/apps/playback.h index 760408a02f..27e27ff240 100644 --- a/apps/playback.h +++ b/apps/playback.h | |||
@@ -112,12 +112,4 @@ enum { | |||
112 | Q_CODEC_DO_CALLBACK, | 112 | Q_CODEC_DO_CALLBACK, |
113 | }; | 113 | }; |
114 | 114 | ||
115 | #if CONFIG_CODEC == SWCODEC | ||
116 | void audio_next_dir(void); | ||
117 | void audio_prev_dir(void); | ||
118 | #else | ||
119 | #define audio_next_dir() ({ }) | ||
120 | #define audio_prev_dir() ({ }) | ||
121 | #endif | ||
122 | |||
123 | #endif | 115 | #endif |
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 1cc28a85a5..b70c682922 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include "button.h" | 29 | #include "button.h" |
30 | #include "status.h" | 30 | #include "status.h" |
31 | #include "thread.h" | 31 | #include "thread.h" |
32 | #include "mpeg.h" | ||
33 | #include "audio.h" | 32 | #include "audio.h" |
34 | #include "mp3_playback.h" | 33 | #include "mp3_playback.h" |
35 | #include "ctype.h" | 34 | #include "ctype.h" |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fa747b7c61..17c10f7328 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include "powermgmt.h" | 30 | #include "powermgmt.h" |
31 | #include "lcd.h" | 31 | #include "lcd.h" |
32 | #include "led.h" | 32 | #include "led.h" |
33 | #include "mpeg.h" | ||
34 | #include "audio.h" | 33 | #include "audio.h" |
35 | #if CONFIG_CODEC == SWCODEC | 34 | #if CONFIG_CODEC == SWCODEC |
36 | #include "thread.h" | 35 | #include "thread.h" |
diff --git a/apps/settings.c b/apps/settings.c index 068613abcf..9492448ade 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include "usb.h" | 32 | #include "usb.h" |
33 | #include "backlight.h" | 33 | #include "backlight.h" |
34 | #include "audio.h" | 34 | #include "audio.h" |
35 | #include "mpeg.h" | ||
36 | #include "talk.h" | 35 | #include "talk.h" |
37 | #include "string.h" | 36 | #include "string.h" |
38 | #include "rtc.h" | 37 | #include "rtc.h" |
diff --git a/apps/settings_list.c b/apps/settings_list.c index 9c6c85fa61..b37a164f9f 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include "usb.h" | 34 | #include "usb.h" |
35 | #include "sound.h" | 35 | #include "sound.h" |
36 | #include "dsp.h" | 36 | #include "dsp.h" |
37 | #include "mpeg.h" | ||
38 | #include "audio.h" | 37 | #include "audio.h" |
39 | #include "power.h" | 38 | #include "power.h" |
40 | #include "powermgmt.h" | 39 | #include "powermgmt.h" |
diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 1ce023a5e5..f6613dfe8b 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h | |||
@@ -77,6 +77,9 @@ void audio_beep(int duration); | |||
77 | unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size); | 77 | unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size); |
78 | /* only implemented in playback.c, but called from firmware */ | 78 | /* only implemented in playback.c, but called from firmware */ |
79 | 79 | ||
80 | void audio_next_dir(void); | ||
81 | void audio_prev_dir(void); | ||
82 | |||
80 | #else /* hwcodec only */ | 83 | #else /* hwcodec only */ |
81 | struct audio_debug | 84 | struct audio_debug |
82 | { | 85 | { |
@@ -105,6 +108,10 @@ struct audio_debug | |||
105 | void audio_get_debugdata(struct audio_debug *dbgdata); | 108 | void audio_get_debugdata(struct audio_debug *dbgdata); |
106 | /* unsigned int audio_error(void); - unused function */ | 109 | /* unsigned int audio_error(void); - unused function */ |
107 | void audio_init_playback(void); | 110 | void audio_init_playback(void); |
111 | |||
112 | #define audio_next_dir() ({ }) | ||
113 | #define audio_prev_dir() ({ }) | ||
114 | |||
108 | #endif | 115 | #endif |
109 | 116 | ||
110 | /* channel modes */ | 117 | /* channel modes */ |