diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-04-27 03:08:23 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-04-27 03:08:23 +0000 |
commit | c537d5958e8b421ac4f9bef6c8b9e7425a6cf167 (patch) | |
tree | 7ed36518fb6524da7bbd913ba7619b85b5d15d23 /apps/buffering.h | |
parent | dcf0f8de4a37ff1d2ea510aef75fa67977a8bdcc (diff) | |
download | rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.tar.gz rockbox-c537d5958e8b421ac4f9bef6c8b9e7425a6cf167.zip |
Commit FS#12069 - Playback rework - first stages. Gives as thorough as possible a treatment of codec management, track change and metadata logic as possible while maintaining fairly narrow focus and not rewriting everything all at once. Please see the rockbox-dev mail archive on 2011-04-25 (Playback engine rework) for a more thorough manifest of what was addressed. Plugins and codecs become incompatible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29785 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.h')
-rw-r--r-- | apps/buffering.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/apps/buffering.h b/apps/buffering.h index 34d6d641c7..2e4cfd3968 100644 --- a/apps/buffering.h +++ b/apps/buffering.h | |||
@@ -28,14 +28,13 @@ | |||
28 | 28 | ||
29 | 29 | ||
30 | enum data_type { | 30 | enum data_type { |
31 | TYPE_UNKNOWN = 0, /* invalid type indicator */ | ||
32 | TYPE_ID3, | ||
31 | TYPE_CODEC, | 33 | TYPE_CODEC, |
32 | TYPE_PACKET_AUDIO, | 34 | TYPE_PACKET_AUDIO, |
33 | TYPE_ATOMIC_AUDIO, | 35 | TYPE_ATOMIC_AUDIO, |
34 | TYPE_ID3, | ||
35 | TYPE_CUESHEET, | 36 | TYPE_CUESHEET, |
36 | TYPE_BITMAP, | 37 | TYPE_BITMAP, |
37 | TYPE_BUFFER, | ||
38 | TYPE_UNKNOWN, | ||
39 | }; | 38 | }; |
40 | 39 | ||
41 | /* Error return values */ | 40 | /* Error return values */ |
@@ -63,6 +62,7 @@ bool buffering_reset(char *buf, size_t buflen); | |||
63 | * bufclose : Close an open handle | 62 | * bufclose : Close an open handle |
64 | * bufseek : Set handle reading index, relatively to the start of the file | 63 | * bufseek : Set handle reading index, relatively to the start of the file |
65 | * bufadvance: Move handle reading index, relatively to current position | 64 | * bufadvance: Move handle reading index, relatively to current position |
65 | * bufftell : Return the handle's file read position | ||
66 | * bufread : Copy data from a handle to a buffer | 66 | * bufread : Copy data from a handle to a buffer |
67 | * bufgetdata: Obtain a pointer for linear access to a "size" amount of data | 67 | * bufgetdata: Obtain a pointer for linear access to a "size" amount of data |
68 | * bufgettail: Out-of-band get the last size bytes of a handle. | 68 | * bufgettail: Out-of-band get the last size bytes of a handle. |
@@ -81,28 +81,40 @@ int bufalloc(const void *src, size_t size, enum data_type type); | |||
81 | bool bufclose(int handle_id); | 81 | bool bufclose(int handle_id); |
82 | int bufseek(int handle_id, size_t newpos); | 82 | int bufseek(int handle_id, size_t newpos); |
83 | int bufadvance(int handle_id, off_t offset); | 83 | int bufadvance(int handle_id, off_t offset); |
84 | off_t bufftell(int handle_id); | ||
84 | ssize_t bufread(int handle_id, size_t size, void *dest); | 85 | ssize_t bufread(int handle_id, size_t size, void *dest); |
85 | ssize_t bufgetdata(int handle_id, size_t size, void **data); | 86 | ssize_t bufgetdata(int handle_id, size_t size, void **data); |
86 | ssize_t bufgettail(int handle_id, size_t size, void **data); | 87 | ssize_t bufgettail(int handle_id, size_t size, void **data); |
87 | ssize_t bufcuttail(int handle_id, size_t size); | 88 | ssize_t bufcuttail(int handle_id, size_t size); |
88 | 89 | ||
89 | |||
90 | /*************************************************************************** | 90 | /*************************************************************************** |
91 | * SECONDARY FUNCTIONS | 91 | * SECONDARY FUNCTIONS |
92 | * =================== | 92 | * =================== |
93 | * | 93 | * |
94 | * buf_handle_data_type: return the handle's data type | ||
95 | * buf_is_handle: is the handle valid? | ||
96 | * buf_pin_handle: Disallow/allow handle movement. Handle may still be removed. | ||
94 | * buf_handle_offset: Get the offset of the first buffered byte from the file | 97 | * buf_handle_offset: Get the offset of the first buffered byte from the file |
95 | * buf_request_buffer_handle: Request buffering of a handle | 98 | * buf_request_buffer_handle: Request buffering of a handle |
96 | * buf_set_base_handle: Tell the buffering thread which handle is currently read | 99 | * buf_set_base_handle: Tell the buffering thread which handle is currently read |
100 | * buf_length: Total size of ringbuffer | ||
97 | * buf_used: Total amount of buffer space used (including allocated space) | 101 | * buf_used: Total amount of buffer space used (including allocated space) |
102 | * buf_back_off_storage: tell buffering thread to take it easy | ||
98 | ****************************************************************************/ | 103 | ****************************************************************************/ |
99 | 104 | ||
105 | enum data_type buf_handle_data_type(int handle_id); | ||
106 | ssize_t buf_handle_remaining(int handle_id); | ||
107 | bool buf_is_handle(int handle_id); | ||
100 | ssize_t buf_handle_offset(int handle_id); | 108 | ssize_t buf_handle_offset(int handle_id); |
101 | void buf_request_buffer_handle(int handle_id); | 109 | void buf_request_buffer_handle(int handle_id); |
102 | void buf_set_base_handle(int handle_id); | 110 | void buf_set_base_handle(int handle_id); |
111 | size_t buf_length(void); | ||
103 | size_t buf_used(void); | 112 | size_t buf_used(void); |
104 | 113 | bool buf_pin_handle(int handle_id, bool pin); | |
105 | 114 | bool buf_signal_handle(int handle_id, bool signal); | |
115 | #ifdef HAVE_IO_PRIORITY | ||
116 | void buf_back_off_storage(bool back_off); | ||
117 | #endif | ||
106 | 118 | ||
107 | /* Settings */ | 119 | /* Settings */ |
108 | enum { | 120 | enum { |
@@ -110,6 +122,7 @@ enum { | |||
110 | BUFFERING_SET_CHUNKSIZE, | 122 | BUFFERING_SET_CHUNKSIZE, |
111 | }; | 123 | }; |
112 | void buf_set_watermark(size_t bytes); | 124 | void buf_set_watermark(size_t bytes); |
125 | size_t buf_get_watermark(void); | ||
113 | 126 | ||
114 | /* Debugging */ | 127 | /* Debugging */ |
115 | struct buffering_debug { | 128 | struct buffering_debug { |