diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libmusepack/reader.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libmusepack/reader.h')
-rw-r--r-- | lib/rbcodec/codecs/libmusepack/reader.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libmusepack/reader.h b/lib/rbcodec/codecs/libmusepack/reader.h new file mode 100644 index 0000000000..c46844cd59 --- /dev/null +++ b/lib/rbcodec/codecs/libmusepack/reader.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | Copyright (c) 2005-2009, The Musepack Development Team | ||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are | ||
7 | met: | ||
8 | |||
9 | * Redistributions of source code must retain the above copyright | ||
10 | notice, this list of conditions and the following disclaimer. | ||
11 | |||
12 | * Redistributions in binary form must reproduce the above | ||
13 | copyright notice, this list of conditions and the following | ||
14 | disclaimer in the documentation and/or other materials provided | ||
15 | with the distribution. | ||
16 | |||
17 | * Neither the name of the The Musepack Development Team nor the | ||
18 | names of its contributors may be used to endorse or promote | ||
19 | products derived from this software without specific prior | ||
20 | written permission. | ||
21 | |||
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
26 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | /// \file reader.h | ||
35 | #ifndef _MPCDEC_READER_H_ | ||
36 | #define _MPCDEC_READER_H_ | ||
37 | #ifdef WIN32 | ||
38 | #pragma once | ||
39 | #endif | ||
40 | |||
41 | #include "mpc_types.h" | ||
42 | #include <stdio.h> | ||
43 | |||
44 | #ifdef __cplusplus | ||
45 | extern "C" { | ||
46 | #endif | ||
47 | |||
48 | |||
49 | /// \brief Stream reader interface structure. | ||
50 | /// | ||
51 | /// This is the structure you must supply to the musepack decoding library | ||
52 | /// to feed it with raw data. Implement the five member functions to provide | ||
53 | /// a functional reader. | ||
54 | typedef struct mpc_reader_t mpc_reader; | ||
55 | struct mpc_reader_t { | ||
56 | /// Reads size bytes of data into buffer at ptr. | ||
57 | mpc_int32_t (*read)(mpc_reader *p_reader, void *ptr, mpc_int32_t size); | ||
58 | |||
59 | /// Seeks to byte position offset. | ||
60 | mpc_bool_t (*seek)(mpc_reader *p_reader, mpc_int32_t offset); | ||
61 | |||
62 | /// Returns the current byte offset in the stream. | ||
63 | mpc_int32_t (*tell)(mpc_reader *p_reader); | ||
64 | |||
65 | /// Returns the total length of the source stream, in bytes. | ||
66 | mpc_int32_t (*get_size)(mpc_reader *p_reader); | ||
67 | |||
68 | /* rockbox: not used | ||
69 | /// True if the stream is a seekable stream. | ||
70 | mpc_bool_t (*canseek)(mpc_reader *p_reader); | ||
71 | |||
72 | /// Field that can be used to identify a particular instance of | ||
73 | /// reader or carry along data associated with that reader. | ||
74 | void *data; | ||
75 | */ | ||
76 | }; | ||
77 | /* rockbox: not used | ||
78 | /// Initializes reader with default stdio file reader implementation. Use | ||
79 | /// this if you're just reading from a plain file. | ||
80 | /// | ||
81 | /// \param r p_reader handle to initialize | ||
82 | /// \param filename input filename to attach to the reader | ||
83 | MPC_API mpc_status mpc_reader_init_stdio(mpc_reader *p_reader, const char *filename); | ||
84 | |||
85 | /// Initializes reader with default stdio file reader implementation. Use | ||
86 | /// this if you prefer to open the file yourself. | ||
87 | /// | ||
88 | /// \param r p_reader handle to initialize | ||
89 | /// \param p_file input file handle (already open) | ||
90 | MPC_API mpc_status mpc_reader_init_stdio_stream(mpc_reader * p_reader, FILE * p_file); | ||
91 | |||
92 | /// Release reader with default stdio file reader implementation. | ||
93 | /// | ||
94 | /// \param r reader handle to release | ||
95 | MPC_API void mpc_reader_exit_stdio(mpc_reader *p_reader); | ||
96 | */ | ||
97 | #ifdef __cplusplus | ||
98 | } | ||
99 | #endif | ||
100 | #endif | ||