external/mpg123-1.25.13.patch
author Ozkan Sezer
Tue, 17 Dec 2019 21:56:50 +0300
changeset 1091 8a09f3c0c340
parent 964 eb913c955fe5
permissions -rw-r--r--
add patch note for Mix_MusicDuration addition
sezeroz@964
     1
diff -u /dev/null mpg123-1.25.13/android/config.h
sezeroz@964
     2
--- /dev/null
sezeroz@964
     3
+++ mpg123-1.25.13/android/config.h
sezeroz@964
     4
@@ -0,0 +1,478 @@
sezeroz@964
     5
+/* src/config.h.  Generated from config.h.in by configure.  */
sezeroz@964
     6
+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
sezeroz@964
     7
+
sezeroz@964
     8
+/* Define if your architecture wants/needs/can use attribute_align_arg and
sezeroz@964
     9
+   alignment checks. It is for 32bit x86... */
sezeroz@964
    10
+/* #undef ABI_ALIGN_FUN */
sezeroz@964
    11
+
sezeroz@964
    12
+/* Define to use proper rounding. */
sezeroz@964
    13
+/* #undef ACCURATE_ROUNDING */
sezeroz@964
    14
+
sezeroz@964
    15
+/* Define if building universal (internal helper macro) */
sezeroz@964
    16
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
sezeroz@964
    17
+
sezeroz@964
    18
+/* Define if .balign is present. */
sezeroz@964
    19
+#define ASMALIGN_BALIGN 1
sezeroz@964
    20
+
sezeroz@964
    21
+/* Define if .align just takes byte count. */
sezeroz@964
    22
+/* #undef ASMALIGN_BYTE */
sezeroz@964
    23
+
sezeroz@964
    24
+/* Define if .align takes 3 for alignment of 2^3=8 bytes instead of 8. */
sezeroz@964
    25
+/* #undef ASMALIGN_EXP */
sezeroz@964
    26
+
sezeroz@964
    27
+/* Define if __attribute__((aligned(16))) shall be used */
sezeroz@964
    28
+#define CCALIGN 1
sezeroz@964
    29
+
sezeroz@964
    30
+/* Define if debugging is enabled. */
sezeroz@964
    31
+/* #undef DEBUG */
sezeroz@964
    32
+
sezeroz@964
    33
+/* The default audio output module(s) to use */
sezeroz@964
    34
+#define DEFAULT_OUTPUT_MODULE "oss,esd,pulse"
sezeroz@964
    35
+
sezeroz@964
    36
+/* Define if building with dynamcally linked libmpg123 */
sezeroz@964
    37
+#define DYNAMIC_BUILD 1
sezeroz@964
    38
+
sezeroz@964
    39
+/* Use EFBIG as substitude for EOVERFLOW, mingw.org may lack the latter */
sezeroz@964
    40
+/* #undef EOVERFLOW */
sezeroz@964
    41
+
sezeroz@964
    42
+/* Define if FIFO support is enabled. */
sezeroz@964
    43
+/* #undef FIFO */
sezeroz@964
    44
+
sezeroz@964
    45
+/* Define if frame index should be used. */
sezeroz@964
    46
+#define FRAME_INDEX 1
sezeroz@964
    47
+
sezeroz@964
    48
+/* Define if gapless is enabled. */
sezeroz@964
    49
+#define GAPLESS 1
sezeroz@964
    50
+
sezeroz@964
    51
+/* Define to 1 if you have the <alc.h> header file. */
sezeroz@964
    52
+/* #undef HAVE_ALC_H */
sezeroz@964
    53
+
sezeroz@964
    54
+/* Define to 1 if you have the <Alib.h> header file. */
sezeroz@964
    55
+/* #undef HAVE_ALIB_H */
sezeroz@964
    56
+
sezeroz@964
    57
+/* Define to 1 if you have the <AL/alc.h> header file. */
sezeroz@964
    58
+/* #undef HAVE_AL_ALC_H */
sezeroz@964
    59
+
sezeroz@964
    60
+/* Define to 1 if you have the <AL/al.h> header file. */
sezeroz@964
    61
+/* #undef HAVE_AL_AL_H */
sezeroz@964
    62
+
sezeroz@964
    63
+/* Define to 1 if you have the <al.h> header file. */
sezeroz@964
    64
+/* #undef HAVE_AL_H */
sezeroz@964
    65
+
sezeroz@964
    66
+/* Define to 1 if you have the <arpa/inet.h> header file. */
sezeroz@964
    67
+#define HAVE_ARPA_INET_H 1
sezeroz@964
    68
+
sezeroz@964
    69
+/* Define to 1 if you have the <asm/audioio.h> header file. */
sezeroz@964
    70
+/* #undef HAVE_ASM_AUDIOIO_H */
sezeroz@964
    71
+
sezeroz@964
    72
+/* Define to 1 if you have the `atoll' function. */
sezeroz@964
    73
+#define HAVE_ATOLL 1
sezeroz@964
    74
+
sezeroz@964
    75
+/* Define to 1 if you have the <audios.h> header file. */
sezeroz@964
    76
+/* #undef HAVE_AUDIOS_H */
sezeroz@964
    77
+
sezeroz@964
    78
+/* Define to 1 if you have the <AudioToolbox/AudioToolbox.h> header file. */
sezeroz@964
    79
+/* #undef HAVE_AUDIOTOOLBOX_AUDIOTOOLBOX_H */
sezeroz@964
    80
+
sezeroz@964
    81
+/* Define to 1 if you have the <AudioUnit/AudioUnit.h> header file. */
sezeroz@964
    82
+/* #undef HAVE_AUDIOUNIT_AUDIOUNIT_H */
sezeroz@964
    83
+
sezeroz@964
    84
+/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */
sezeroz@964
    85
+/* #undef HAVE_CORESERVICES_CORESERVICES_H */
sezeroz@964
    86
+
sezeroz@964
    87
+/* Define to 1 if you have the <CUlib.h> header file. */
sezeroz@964
    88
+/* #undef HAVE_CULIB_H */
sezeroz@964
    89
+
sezeroz@964
    90
+/* Define to 1 if you have the <dirent.h> header file. */
sezeroz@964
    91
+#define HAVE_DIRENT_H 1
sezeroz@964
    92
+
sezeroz@964
    93
+/* Define to 1 if you have the `dlclose' function. */
sezeroz@964
    94
+#define HAVE_DLCLOSE 1
sezeroz@964
    95
+
sezeroz@964
    96
+/* Define to 1 if you have the <dlfcn.h> header file. */
sezeroz@964
    97
+#define HAVE_DLFCN_H 1
sezeroz@964
    98
+
sezeroz@964
    99
+/* Define to 1 if you have the `dlopen' function. */
sezeroz@964
   100
+#define HAVE_DLOPEN 1
sezeroz@964
   101
+
sezeroz@964
   102
+/* Define to 1 if you have the `dlsym' function. */
sezeroz@964
   103
+#define HAVE_DLSYM 1
sezeroz@964
   104
+
sezeroz@964
   105
+/* Define if getaddrinfo accepts the AI_ADDRCONFIG flag */
sezeroz@964
   106
+/* #undef HAVE_GAI_ADDRCONFIG */
sezeroz@964
   107
+
sezeroz@964
   108
+/* Define to 1 if you have the `getaddrinfo' function. */
sezeroz@964
   109
+#define HAVE_GETADDRINFO 1
sezeroz@964
   110
+
sezeroz@964
   111
+/* Define to 1 if you have the `getpagesize' function. */
sezeroz@964
   112
+/* #undef HAVE_GETPAGESIZE */
sezeroz@964
   113
+
sezeroz@964
   114
+/* Define to 1 if you have the `getuid' function. */
sezeroz@964
   115
+#define HAVE_GETUID 1
sezeroz@964
   116
+
sezeroz@964
   117
+/* Define to 1 if you have the <inttypes.h> header file. */
sezeroz@964
   118
+#define HAVE_INTTYPES_H 1
sezeroz@964
   119
+
sezeroz@964
   120
+/* Define to 1 if you have the <langinfo.h> header file. */
sezeroz@964
   121
+/* #undef HAVE_LANGINFO_H */
sezeroz@964
   122
+
sezeroz@964
   123
+/* Define to 1 if you have the `m' library (-lm). */
sezeroz@964
   124
+#define HAVE_LIBM 1
sezeroz@964
   125
+
sezeroz@964
   126
+/* Define to 1 if you have the `mx' library (-lmx). */
sezeroz@964
   127
+/* #undef HAVE_LIBMX */
sezeroz@964
   128
+
sezeroz@964
   129
+/* Define to 1 if you have the <limits.h> header file. */
sezeroz@964
   130
+#define HAVE_LIMITS_H 1
sezeroz@964
   131
+
sezeroz@964
   132
+/* Define to 1 if you have the <linux/soundcard.h> header file. */
sezeroz@964
   133
+#define HAVE_LINUX_SOUNDCARD_H 1
sezeroz@964
   134
+
sezeroz@964
   135
+/* Define to 1 if you have the <locale.h> header file. */
sezeroz@964
   136
+#define HAVE_LOCALE_H 1
sezeroz@964
   137
+
sezeroz@964
   138
+/* Define to 1 if you have the <machine/soundcard.h> header file. */
sezeroz@964
   139
+/* #undef HAVE_MACHINE_SOUNDCARD_H */
sezeroz@964
   140
+
sezeroz@964
   141
+/* Define to 1 if you have the <memory.h> header file. */
sezeroz@964
   142
+#define HAVE_MEMORY_H 1
sezeroz@964
   143
+
sezeroz@964
   144
+/* Define to 1 if you have the `mkfifo' function. */
sezeroz@964
   145
+/* #undef HAVE_MKFIFO */
sezeroz@964
   146
+
sezeroz@964
   147
+/* Define to 1 if you have a working `mmap' system call. */
sezeroz@964
   148
+/* #undef HAVE_MMAP */
sezeroz@964
   149
+
sezeroz@964
   150
+/* Define to 1 if you have the <netdb.h> header file. */
sezeroz@964
   151
+#define HAVE_NETDB_H 1
sezeroz@964
   152
+
sezeroz@964
   153
+/* Define to 1 if you have the <netinet/in.h> header file. */
sezeroz@964
   154
+#define HAVE_NETINET_IN_H 1
sezeroz@964
   155
+
sezeroz@964
   156
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
sezeroz@964
   157
+/* #undef HAVE_NETINET_TCP_H */
sezeroz@964
   158
+
sezeroz@964
   159
+/* Define to 1 if you have the `nl_langinfo' function. */
sezeroz@964
   160
+/* #undef HAVE_NL_LANGINFO */
sezeroz@964
   161
+
sezeroz@964
   162
+/* Define to 1 if you have the <OpenAL/alc.h> header file. */
sezeroz@964
   163
+/* #undef HAVE_OPENAL_ALC_H */
sezeroz@964
   164
+
sezeroz@964
   165
+/* Define to 1 if you have the <OpenAL/al.h> header file. */
sezeroz@964
   166
+/* #undef HAVE_OPENAL_AL_H */
sezeroz@964
   167
+
sezeroz@964
   168
+/* Define to 1 if you have the <os2me.h> header file. */
sezeroz@964
   169
+/* #undef HAVE_OS2ME_H */
sezeroz@964
   170
+
sezeroz@964
   171
+/* Define to 1 if you have the <os2.h> header file. */
sezeroz@964
   172
+/* #undef HAVE_OS2_H */
sezeroz@964
   173
+
sezeroz@964
   174
+/* Define to 1 if you have the `random' function. */
sezeroz@964
   175
+/* #undef HAVE_RANDOM */
sezeroz@964
   176
+
sezeroz@964
   177
+/* Define to 1 if you have the <sched.h> header file. */
sezeroz@964
   178
+#define HAVE_SCHED_H 1
sezeroz@964
   179
+
sezeroz@964
   180
+/* Define to 1 if you have the `sched_setscheduler' function. */
sezeroz@964
   181
+#define HAVE_SCHED_SETSCHEDULER 1
sezeroz@964
   182
+
sezeroz@964
   183
+/* Define to 1 if you have the `setlocale' function. */
sezeroz@964
   184
+#define HAVE_SETLOCALE 1
sezeroz@964
   185
+
sezeroz@964
   186
+/* Define to 1 if you have the `setpriority' function. */
sezeroz@964
   187
+#define HAVE_SETPRIORITY 1
sezeroz@964
   188
+
sezeroz@964
   189
+/* Define to 1 if you have the `setuid' function. */
sezeroz@964
   190
+#define HAVE_SETUID 1
sezeroz@964
   191
+
sezeroz@964
   192
+/* Define to 1 if you have the <signal.h> header file. */
sezeroz@964
   193
+#define HAVE_SIGNAL_H 1
sezeroz@964
   194
+
sezeroz@964
   195
+/* Define to 1 if you have the <sndio.h> header file. */
sezeroz@964
   196
+/* #undef HAVE_SNDIO_H */
sezeroz@964
   197
+
sezeroz@964
   198
+/* Define to 1 if you have the <stdint.h> header file. */
sezeroz@964
   199
+#define HAVE_STDINT_H 1
sezeroz@964
   200
+
sezeroz@964
   201
+/* Define to 1 if you have the <stdio.h> header file. */
sezeroz@964
   202
+#define HAVE_STDIO_H 1
sezeroz@964
   203
+
sezeroz@964
   204
+/* Define to 1 if you have the <stdlib.h> header file. */
sezeroz@964
   205
+#define HAVE_STDLIB_H 1
sezeroz@964
   206
+
sezeroz@964
   207
+/* Define to 1 if you have the `strerror' function. */
sezeroz@964
   208
+#define HAVE_STRERROR 1
sezeroz@964
   209
+
sezeroz@964
   210
+/* Define to 1 if you have the <strings.h> header file. */
sezeroz@964
   211
+#define HAVE_STRINGS_H 1
sezeroz@964
   212
+
sezeroz@964
   213
+/* Define to 1 if you have the <string.h> header file. */
sezeroz@964
   214
+#define HAVE_STRING_H 1
sezeroz@964
   215
+
sezeroz@964
   216
+/* Define to 1 if you have the <sun/audioio.h> header file. */
sezeroz@964
   217
+/* #undef HAVE_SUN_AUDIOIO_H */
sezeroz@964
   218
+
sezeroz@964
   219
+/* Define to 1 if you have the <sys/audioio.h> header file. */
sezeroz@964
   220
+/* #undef HAVE_SYS_AUDIOIO_H */
sezeroz@964
   221
+
sezeroz@964
   222
+/* Define to 1 if you have the <sys/audio.h> header file. */
sezeroz@964
   223
+/* #undef HAVE_SYS_AUDIO_H */
sezeroz@964
   224
+
sezeroz@964
   225
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
sezeroz@964
   226
+#define HAVE_SYS_IOCTL_H 1
sezeroz@964
   227
+
sezeroz@964
   228
+/* Define to 1 if you have the <sys/param.h> header file. */
sezeroz@964
   229
+#define HAVE_SYS_PARAM_H 1
sezeroz@964
   230
+
sezeroz@964
   231
+/* Define to 1 if you have the <sys/resource.h> header file. */
sezeroz@964
   232
+#define HAVE_SYS_RESOURCE_H 1
sezeroz@964
   233
+
sezeroz@964
   234
+/* Define to 1 if you have the <sys/select.h> header file. */
sezeroz@964
   235
+#define HAVE_SYS_SELECT_H 1
sezeroz@964
   236
+
sezeroz@964
   237
+/* Define to 1 if you have the <sys/signal.h> header file. */
sezeroz@964
   238
+/* #undef HAVE_SYS_SIGNAL_H */
sezeroz@964
   239
+
sezeroz@964
   240
+/* Define to 1 if you have the <sys/socket.h> header file. */
sezeroz@964
   241
+#define HAVE_SYS_SOCKET_H 1
sezeroz@964
   242
+
sezeroz@964
   243
+/* Define to 1 if you have the <sys/soundcard.h> header file. */
sezeroz@964
   244
+/* #undef HAVE_SYS_SOUNDCARD_H */
sezeroz@964
   245
+
sezeroz@964
   246
+/* Define to 1 if you have the <sys/stat.h> header file. */
sezeroz@964
   247
+#define HAVE_SYS_STAT_H 1
sezeroz@964
   248
+
sezeroz@964
   249
+/* Define to 1 if you have the <sys/time.h> header file. */
sezeroz@964
   250
+#define HAVE_SYS_TIME_H 1
sezeroz@964
   251
+
sezeroz@964
   252
+/* Define to 1 if you have the <sys/types.h> header file. */
sezeroz@964
   253
+#define HAVE_SYS_TYPES_H 1
sezeroz@964
   254
+
sezeroz@964
   255
+/* Define to 1 if you have the <sys/wait.h> header file. */
sezeroz@964
   256
+#define HAVE_SYS_WAIT_H 1
sezeroz@964
   257
+
sezeroz@964
   258
+/* Define this if you have the POSIX termios library */
sezeroz@964
   259
+#define HAVE_TERMIOS 1
sezeroz@964
   260
+
sezeroz@964
   261
+/* Define to 1 if you have the <unistd.h> header file. */
sezeroz@964
   262
+#define HAVE_UNISTD_H 1
sezeroz@964
   263
+
sezeroz@964
   264
+/* Define to 1 if you have the <windows.h> header file. */
sezeroz@964
   265
+/* #undef HAVE_WINDOWS_H */
sezeroz@964
   266
+
sezeroz@964
   267
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
sezeroz@964
   268
+/* #undef HAVE_WS2TCPIP_H */
sezeroz@964
   269
+
sezeroz@964
   270
+/* Define to indicate that float storage follows IEEE754. */
sezeroz@964
   271
+#define IEEE_FLOAT 1
sezeroz@964
   272
+
sezeroz@964
   273
+/* size of the frame index seek table */
sezeroz@964
   274
+#define INDEX_SIZE 1000
sezeroz@964
   275
+
sezeroz@964
   276
+/* Define if IPV6 support is enabled. */
sezeroz@964
   277
+#define IPV6 1
sezeroz@964
   278
+
sezeroz@964
   279
+/* Define this to the size of native offset type in bits, used for LFS alias
sezeroz@964
   280
+   functions. */
sezeroz@964
   281
+#define LFS_ALIAS_BITS 32
sezeroz@964
   282
+
sezeroz@964
   283
+/* Define to the extension used for runtime loadable modules, say, ".so". */
sezeroz@964
   284
+#define LT_MODULE_EXT ".so"
sezeroz@964
   285
+
sezeroz@964
   286
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
sezeroz@964
   287
+#define LT_OBJDIR ".libs/"
sezeroz@964
   288
+
sezeroz@964
   289
+/* Define to the shared library suffix, say, ".dylib". */
sezeroz@964
   290
+/* #undef LT_SHARED_EXT */
sezeroz@964
   291
+
sezeroz@964
   292
+/* Define to the shared archive member specification, say "(shr.o)". */
sezeroz@964
   293
+/* #undef LT_SHARED_LIB_MEMBER */
sezeroz@964
   294
+
sezeroz@964
   295
+/* Define if network support is enabled. */
sezeroz@964
   296
+#define NETWORK 1
sezeroz@964
   297
+
sezeroz@964
   298
+/* Define to disable 16 bit integer output. */
sezeroz@964
   299
+/* #undef NO_16BIT */
sezeroz@964
   300
+
sezeroz@964
   301
+/* Define to disable 32 bit and 24 bit integer output. */
sezeroz@964
   302
+/* #undef NO_32BIT */
sezeroz@964
   303
+
sezeroz@964
   304
+/* Define to disable 8 bit integer output. */
sezeroz@964
   305
+/* #undef NO_8BIT */
sezeroz@964
   306
+
sezeroz@964
   307
+/* Define to disable downsampled decoding. */
sezeroz@964
   308
+/* #undef NO_DOWNSAMPLE */
sezeroz@964
   309
+
sezeroz@964
   310
+/* Define to disable equalizer. */
sezeroz@964
   311
+/* #undef NO_EQUALIZER */
sezeroz@964
   312
+
sezeroz@964
   313
+/* Define to disable error messages in combination with a return value (the
sezeroz@964
   314
+   return is left intact). */
sezeroz@964
   315
+/* #undef NO_ERETURN */
sezeroz@964
   316
+
sezeroz@964
   317
+/* Define to disable error messages. */
sezeroz@964
   318
+/* #undef NO_ERRORMSG */
sezeroz@964
   319
+
sezeroz@964
   320
+/* Define to disable feeder and buffered readers. */
sezeroz@964
   321
+/* #undef NO_FEEDER */
sezeroz@964
   322
+
sezeroz@964
   323
+/* Define to disable ICY handling. */
sezeroz@964
   324
+/* #undef NO_ICY */
sezeroz@964
   325
+
sezeroz@964
   326
+/* Define to disable ID3v2 parsing. */
sezeroz@964
   327
+/* #undef NO_ID3V2 */
sezeroz@964
   328
+
sezeroz@964
   329
+/* Define to disable layer I. */
sezeroz@964
   330
+/* #undef NO_LAYER1 */
sezeroz@964
   331
+
sezeroz@964
   332
+/* Define to disable layer II. */
sezeroz@964
   333
+/* #undef NO_LAYER2 */
sezeroz@964
   334
+
sezeroz@964
   335
+/* Define to disable layer III. */
sezeroz@964
   336
+/* #undef NO_LAYER3 */
sezeroz@964
   337
+
sezeroz@964
   338
+/* Define to disable ntom resampling. */
sezeroz@964
   339
+/* #undef NO_NTOM */
sezeroz@964
   340
+
sezeroz@964
   341
+/* Define to disable real output. */
sezeroz@964
   342
+/* #undef NO_REAL */
sezeroz@964
   343
+
sezeroz@964
   344
+/* Define to disable string functions. */
sezeroz@964
   345
+/* #undef NO_STRING */
sezeroz@964
   346
+
sezeroz@964
   347
+/* Define for post-processed 32 bit formats. */
sezeroz@964
   348
+/* #undef NO_SYNTH32 */
sezeroz@964
   349
+
sezeroz@964
   350
+/* Define to disable warning messages. */
sezeroz@964
   351
+/* #undef NO_WARNING */
sezeroz@964
   352
+
sezeroz@964
   353
+/* Name of package */
sezeroz@964
   354
+#define PACKAGE "mpg123"
sezeroz@964
   355
+
sezeroz@964
   356
+/* Define to the address where bug reports for this package should be sent. */
sezeroz@964
   357
+#define PACKAGE_BUGREPORT "maintainer@mpg123.org"
sezeroz@964
   358
+
sezeroz@964
   359
+/* Define to the full name of this package. */
sezeroz@964
   360
+#define PACKAGE_NAME "mpg123"
sezeroz@964
   361
+
sezeroz@964
   362
+/* Define to the full name and version of this package. */
sezeroz@964
   363
+#define PACKAGE_STRING "mpg123 1.25.13"
sezeroz@964
   364
+
sezeroz@964
   365
+/* Define to the one symbol short name of this package. */
sezeroz@964
   366
+#define PACKAGE_TARNAME "mpg123"
sezeroz@964
   367
+
sezeroz@964
   368
+/* Define to the home page for this package. */
sezeroz@964
   369
+#define PACKAGE_URL ""
sezeroz@964
   370
+
sezeroz@964
   371
+/* Define to the version of this package. */
sezeroz@964
   372
+#define PACKAGE_VERSION "1.25.13"
sezeroz@964
   373
+
sezeroz@964
   374
+/* Define if portaudio v18 API is wanted. */
sezeroz@964
   375
+/* #undef PORTAUDIO18 */
sezeroz@964
   376
+
sezeroz@964
   377
+/* The size of `int32_t', as computed by sizeof. */
sezeroz@964
   378
+#define SIZEOF_INT32_T 4
sezeroz@964
   379
+
sezeroz@964
   380
+/* The size of `long', as computed by sizeof. */
sezeroz@964
   381
+#define SIZEOF_LONG 4
sezeroz@964
   382
+
sezeroz@964
   383
+/* The size of `off_t', as computed by sizeof. */
sezeroz@964
   384
+#define SIZEOF_OFF_T 4
sezeroz@964
   385
+
sezeroz@964
   386
+/* The size of `size_t', as computed by sizeof. */
sezeroz@964
   387
+#define SIZEOF_SIZE_T 4
sezeroz@964
   388
+
sezeroz@964
   389
+/* The size of `ssize_t', as computed by sizeof. */
sezeroz@964
   390
+#define SIZEOF_SSIZE_T 4
sezeroz@964
   391
+
sezeroz@964
   392
+/* Define to 1 if you have the ANSI C header files. */
sezeroz@964
   393
+#define STDC_HEADERS 1
sezeroz@964
   394
+
sezeroz@964
   395
+/* Define if modules are enabled */
sezeroz@964
   396
+#define USE_MODULES 1
sezeroz@964
   397
+
sezeroz@964
   398
+/* Define for new Huffman decoding scheme. */
sezeroz@964
   399
+#define USE_NEW_HUFFTABLE 1
sezeroz@964
   400
+
sezeroz@964
   401
+/* Define to use yasm for assemble AVX sources. */
sezeroz@964
   402
+/* #undef USE_YASM_FOR_AVX */
sezeroz@964
   403
+
sezeroz@964
   404
+/* Version number of package */
sezeroz@964
   405
+#define VERSION "1.25.13"
sezeroz@964
   406
+
sezeroz@964
   407
+/* Define to use Win32 named pipes */
sezeroz@964
   408
+/* #undef WANT_WIN32_FIFO */
sezeroz@964
   409
+
sezeroz@964
   410
+/* Define to use Win32 sockets */
sezeroz@964
   411
+/* #undef WANT_WIN32_SOCKETS */
sezeroz@964
   412
+
sezeroz@964
   413
+/* Define to use Unicode for Windows */
sezeroz@964
   414
+/* #undef WANT_WIN32_UNICODE */
sezeroz@964
   415
+
sezeroz@964
   416
+/* WinXP and above for ipv6 */
sezeroz@964
   417
+/* #undef WINVER */
sezeroz@964
   418
+
sezeroz@964
   419
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
sezeroz@964
   420
+   significant byte first (like Motorola and SPARC, unlike Intel). */
sezeroz@964
   421
+#if defined AC_APPLE_UNIVERSAL_BUILD
sezeroz@964
   422
+# if defined __BIG_ENDIAN__
sezeroz@964
   423
+#  define WORDS_BIGENDIAN 1
sezeroz@964
   424
+# endif
sezeroz@964
   425
+#else
sezeroz@964
   426
+# ifndef WORDS_BIGENDIAN
sezeroz@964
   427
+/* #  undef WORDS_BIGENDIAN */
sezeroz@964
   428
+# endif
sezeroz@964
   429
+#endif
sezeroz@964
   430
+
sezeroz@964
   431
+/* Enable large inode numbers on Mac OS X 10.5.  */
sezeroz@964
   432
+#ifndef _DARWIN_USE_64_BIT_INODE
sezeroz@964
   433
+# define _DARWIN_USE_64_BIT_INODE 1
sezeroz@964
   434
+#endif
sezeroz@964
   435
+
sezeroz@964
   436
+/* Number of bits in a file offset, on hosts where this is settable. */
sezeroz@964
   437
+/* #undef _FILE_OFFSET_BITS */
sezeroz@964
   438
+
sezeroz@964
   439
+/* Define for large files, on AIX-style hosts. */
sezeroz@964
   440
+/* #undef _LARGE_FILES */
sezeroz@964
   441
+
sezeroz@964
   442
+/* WinXP and above for ipv6 */
sezeroz@964
   443
+/* #undef _WIN32_WINNT */
sezeroz@964
   444
+
sezeroz@964
   445
+/* Define to empty if `const' does not conform to ANSI C. */
sezeroz@964
   446
+/* #undef const */
sezeroz@964
   447
+
sezeroz@964
   448
+/* Define to `__inline__' or `__inline' if that's what the C compiler
sezeroz@964
   449
+   calls it, or to nothing if 'inline' is not supported under any name.  */
sezeroz@964
   450
+#ifndef __cplusplus
sezeroz@964
   451
+/* #undef inline */
sezeroz@964
   452
+#endif
sezeroz@964
   453
+
sezeroz@964
   454
+/* Define to `short' if <sys/types.h> does not define. */
sezeroz@964
   455
+/* #undef int16_t */
sezeroz@964
   456
+
sezeroz@964
   457
+/* Define to `int' if <sys/types.h> does not define. */
sezeroz@964
   458
+/* #undef int32_t */
sezeroz@964
   459
+
sezeroz@964
   460
+/* Define to `long long' if <sys/types.h> does not define. */
sezeroz@964
   461
+/* #undef int64_t */
sezeroz@964
   462
+
sezeroz@964
   463
+/* Define to the native offset type (long or actually off_t). */
sezeroz@964
   464
+#define lfs_alias_t off_t
sezeroz@964
   465
+
sezeroz@964
   466
+/* Define to `long int' if <sys/types.h> does not define. */
sezeroz@964
   467
+/* #undef off_t */
sezeroz@964
   468
+
sezeroz@964
   469
+/* Define to `unsigned long' if <sys/types.h> does not define. */
sezeroz@964
   470
+/* #undef size_t */
sezeroz@964
   471
+
sezeroz@964
   472
+/* Define to `long' if <sys/types.h> does not define. */
sezeroz@964
   473
+/* #undef ssize_t */
sezeroz@964
   474
+
sezeroz@964
   475
+/* Define to `unsigned short' if <sys/types.h> does not define. */
sezeroz@964
   476
+/* #undef uint16_t */
sezeroz@964
   477
+
sezeroz@964
   478
+/* Define to `unsigned int' if <sys/types.h> does not define. */
sezeroz@964
   479
+/* #undef uint32_t */
sezeroz@964
   480
+
sezeroz@964
   481
+/* Define to `unsigned long' if <sys/types.h> does not define. */
sezeroz@964
   482
+/* #undef uintptr_t */
sezeroz@964
   483
diff -u /dev/null mpg123-1.25.13/android/mpg123.h
sezeroz@964
   484
--- /dev/null
sezeroz@964
   485
+++ mpg123-1.25.13/android/mpg123.h
sezeroz@964
   486
@@ -0,0 +1,1441 @@
sezeroz@964
   487
+/*
sezeroz@964
   488
+	libmpg123: MPEG Audio Decoder library (version 1.25.13)
sezeroz@964
   489
+
sezeroz@964
   490
+	copyright 1995-2015 by the mpg123 project
sezeroz@964
   491
+	free software under the terms of the LGPL 2.1
sezeroz@964
   492
+	see COPYING and AUTHORS files in distribution or http://mpg123.org
sezeroz@964
   493
+*/
sezeroz@964
   494
+
sezeroz@964
   495
+#ifndef MPG123_LIB_H
sezeroz@964
   496
+#define MPG123_LIB_H
sezeroz@964
   497
+
sezeroz@964
   498
+#include <fmt123.h>
sezeroz@964
   499
+
sezeroz@964
   500
+/** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */
sezeroz@964
   501
+
sezeroz@964
   502
+/** A macro to check at compile time which set of API functions to expect.
sezeroz@964
   503
+ * This should be incremented at least each time a new symbol is added
sezeroz@964
   504
+ * to the header.
sezeroz@964
   505
+ */
sezeroz@964
   506
+#define MPG123_API_VERSION 44
sezeroz@964
   507
+
sezeroz@964
   508
+#ifndef MPG123_EXPORT
sezeroz@964
   509
+/** Defines needed for MS Visual Studio(tm) DLL builds.
sezeroz@964
   510
+ * Every public function must be prefixed with MPG123_EXPORT. When building 
sezeroz@964
   511
+ * the DLL ensure to define BUILD_MPG123_DLL. This makes the function accessible
sezeroz@964
   512
+ * for clients and includes it in the import library which is created together
sezeroz@964
   513
+ * with the DLL. When consuming the DLL ensure to define LINK_MPG123_DLL which
sezeroz@964
   514
+ * imports the functions from the DLL. 
sezeroz@964
   515
+ */
sezeroz@964
   516
+#ifdef BUILD_MPG123_DLL
sezeroz@964
   517
+/* The dll exports. */
sezeroz@964
   518
+#define MPG123_EXPORT __declspec(dllexport)
sezeroz@964
   519
+#else
sezeroz@964
   520
+#ifdef LINK_MPG123_DLL
sezeroz@964
   521
+/* The exe imports. */
sezeroz@964
   522
+#define MPG123_EXPORT __declspec(dllimport)
sezeroz@964
   523
+#else
sezeroz@964
   524
+/* Nothing on normal/UNIX builds */
sezeroz@964
   525
+#define MPG123_EXPORT
sezeroz@964
   526
+#endif
sezeroz@964
   527
+#endif
sezeroz@964
   528
+#endif
sezeroz@964
   529
+
sezeroz@964
   530
+/* This is for Visual Studio, so this header works as distributed in the binary downloads */
sezeroz@964
   531
+#if defined(_MSC_VER) && !defined(MPG123_DEF_SSIZE_T)
sezeroz@964
   532
+#define MPG123_DEF_SSIZE_T
sezeroz@964
   533
+#include <stddef.h>
sezeroz@964
   534
+typedef ptrdiff_t ssize_t;
sezeroz@964
   535
+#endif
sezeroz@964
   536
+
sezeroz@964
   537
+#ifndef MPG123_NO_CONFIGURE /* Enable use of this file without configure. */
sezeroz@964
   538
+#include <stdlib.h>
sezeroz@964
   539
+#include <sys/types.h>
sezeroz@964
   540
+
sezeroz@964
   541
+/* Simplified large file handling.
sezeroz@964
   542
+	I used to have a check here that prevents building for a library with conflicting large file setup
sezeroz@964
   543
+	(application that uses 32 bit offsets with library that uses 64 bits).
sezeroz@964
   544
+	While that was perfectly fine in an environment where there is one incarnation of the library,
sezeroz@964
   545
+	it hurt GNU/Linux and Solaris systems with multilib where the distribution fails to provide the
sezeroz@964
   546
+	correct header matching the 32 bit library (where large files need explicit support) or
sezeroz@964
   547
+	the 64 bit library (where there is no distinction).
sezeroz@964
   548
+
sezeroz@964
   549
+	New approach: When the app defines _FILE_OFFSET_BITS, it wants non-default large file support,
sezeroz@964
   550
+	and thus functions with added suffix (mpg123_open_64).
sezeroz@964
   551
+	Any mismatch will be caught at link time because of the _FILE_OFFSET_BITS setting used when
sezeroz@964
   552
+	building libmpg123. Plus, there's dual mode large file support in mpg123 since 1.12 now.
sezeroz@964
   553
+	Link failure is not the expected outcome of any half-sane usage anymore.
sezeroz@964
   554
+
sezeroz@964
   555
+	More complication: What about client code defining _LARGEFILE64_SOURCE? It might want direct access to the _64 functions, along with the ones without suffix. Well, that's possible now via defining MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling or enforcing the suffix names.
sezeroz@964
   556
+*/
sezeroz@964
   557
+
sezeroz@964
   558
+/*
sezeroz@964
   559
+	Now, the renaming of large file aware functions.
sezeroz@964
   560
+	By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME.
sezeroz@964
   561
+*/
sezeroz@964
   562
+#if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX))
sezeroz@964
   563
+
sezeroz@964
   564
+/* Need some trickery to concatenate the value(s) of the given macro(s). */
sezeroz@964
   565
+#define MPG123_MACROCAT_REALLY(a, b) a ## b
sezeroz@964
   566
+#define MPG123_MACROCAT(a, b) MPG123_MACROCAT_REALLY(a, b)
sezeroz@964
   567
+#ifndef MPG123_LARGESUFFIX
sezeroz@964
   568
+#define MPG123_LARGESUFFIX MPG123_MACROCAT(_, _FILE_OFFSET_BITS)
sezeroz@964
   569
+#endif
sezeroz@964
   570
+#define MPG123_LARGENAME(func) MPG123_MACROCAT(func, MPG123_LARGESUFFIX)
sezeroz@964
   571
+
sezeroz@964
   572
+#define mpg123_open         MPG123_LARGENAME(mpg123_open)
sezeroz@964
   573
+#define mpg123_open_fd      MPG123_LARGENAME(mpg123_open_fd)
sezeroz@964
   574
+#define mpg123_open_handle  MPG123_LARGENAME(mpg123_open_handle)
sezeroz@964
   575
+#define mpg123_framebyframe_decode MPG123_LARGENAME(mpg123_framebyframe_decode)
sezeroz@964
   576
+#define mpg123_decode_frame MPG123_LARGENAME(mpg123_decode_frame)
sezeroz@964
   577
+#define mpg123_tell         MPG123_LARGENAME(mpg123_tell)
sezeroz@964
   578
+#define mpg123_tellframe    MPG123_LARGENAME(mpg123_tellframe)
sezeroz@964
   579
+#define mpg123_tell_stream  MPG123_LARGENAME(mpg123_tell_stream)
sezeroz@964
   580
+#define mpg123_seek         MPG123_LARGENAME(mpg123_seek)
sezeroz@964
   581
+#define mpg123_feedseek     MPG123_LARGENAME(mpg123_feedseek)
sezeroz@964
   582
+#define mpg123_seek_frame   MPG123_LARGENAME(mpg123_seek_frame)
sezeroz@964
   583
+#define mpg123_timeframe    MPG123_LARGENAME(mpg123_timeframe)
sezeroz@964
   584
+#define mpg123_index        MPG123_LARGENAME(mpg123_index)
sezeroz@964
   585
+#define mpg123_set_index    MPG123_LARGENAME(mpg123_set_index)
sezeroz@964
   586
+#define mpg123_position     MPG123_LARGENAME(mpg123_position)
sezeroz@964
   587
+#define mpg123_length       MPG123_LARGENAME(mpg123_length)
sezeroz@964
   588
+#define mpg123_framelength  MPG123_LARGENAME(mpg123_framelength)
sezeroz@964
   589
+#define mpg123_set_filesize MPG123_LARGENAME(mpg123_set_filesize)
sezeroz@964
   590
+#define mpg123_replace_reader MPG123_LARGENAME(mpg123_replace_reader)
sezeroz@964
   591
+#define mpg123_replace_reader_handle MPG123_LARGENAME(mpg123_replace_reader_handle)
sezeroz@964
   592
+#define mpg123_framepos MPG123_LARGENAME(mpg123_framepos)
sezeroz@964
   593
+
sezeroz@964
   594
+#endif /* largefile hackery */
sezeroz@964
   595
+
sezeroz@964
   596
+#endif /* MPG123_NO_CONFIGURE */
sezeroz@964
   597
+
sezeroz@964
   598
+#ifdef __cplusplus
sezeroz@964
   599
+extern "C" {
sezeroz@964
   600
+#endif
sezeroz@964
   601
+
sezeroz@964
   602
+/** \defgroup mpg123_init mpg123 library and handle setup
sezeroz@964
   603
+ *
sezeroz@964
   604
+ * Functions to initialise and shutdown the mpg123 library and handles.
sezeroz@964
   605
+ * The parameters of handles have workable defaults, you only have to tune them when you want to tune something;-)
sezeroz@964
   606
+ * Tip: Use a RVA setting...
sezeroz@964
   607
+ *
sezeroz@964
   608
+ * @{
sezeroz@964
   609
+ */
sezeroz@964
   610
+
sezeroz@964
   611
+/** Opaque structure for the libmpg123 decoder handle. */
sezeroz@964
   612
+struct mpg123_handle_struct;
sezeroz@964
   613
+
sezeroz@964
   614
+/** Opaque structure for the libmpg123 decoder handle.
sezeroz@964
   615
+ *  Most functions take a pointer to a mpg123_handle as first argument and operate on its data in an object-oriented manner.
sezeroz@964
   616
+ */
sezeroz@964
   617
+typedef struct mpg123_handle_struct mpg123_handle;
sezeroz@964
   618
+
sezeroz@964
   619
+/** Function to initialise the mpg123 library. 
sezeroz@964
   620
+ *	This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library.
sezeroz@964
   621
+ *
sezeroz@964
   622
+ *	\return MPG123_OK if successful, otherwise an error number.
sezeroz@964
   623
+ */
sezeroz@964
   624
+MPG123_EXPORT int mpg123_init(void);
sezeroz@964
   625
+
sezeroz@964
   626
+/** Function to close down the mpg123 library. 
sezeroz@964
   627
+ *	This function is not thread-safe. Call it exactly once per process, before any other (possibly threaded) work with the library. */
sezeroz@964
   628
+MPG123_EXPORT void mpg123_exit(void);
sezeroz@964
   629
+
sezeroz@964
   630
+/** Create a handle with optional choice of decoder (named by a string, see mpg123_decoders() or mpg123_supported_decoders()).
sezeroz@964
   631
+ *  and optional retrieval of an error code to feed to mpg123_plain_strerror().
sezeroz@964
   632
+ *  Optional means: Any of or both the parameters may be NULL.
sezeroz@964
   633
+ *
sezeroz@964
   634
+ *  \param decoder optional choice of decoder variant (NULL for default)
sezeroz@964
   635
+ *  \param error optional address to store error codes
sezeroz@964
   636
+ *  \return Non-NULL pointer to fresh handle when successful.
sezeroz@964
   637
+ */
sezeroz@964
   638
+MPG123_EXPORT mpg123_handle *mpg123_new(const char* decoder, int *error);
sezeroz@964
   639
+
sezeroz@964
   640
+/** Delete handle, mh is either a valid mpg123 handle or NULL.
sezeroz@964
   641
+ *  \param mh handle
sezeroz@964
   642
+ */
sezeroz@964
   643
+MPG123_EXPORT void mpg123_delete(mpg123_handle *mh);
sezeroz@964
   644
+
sezeroz@964
   645
+/** Enumeration of the parameters types that it is possible to set/get. */
sezeroz@964
   646
+enum mpg123_parms
sezeroz@964
   647
+{
sezeroz@964
   648
+	MPG123_VERBOSE = 0,        /**< set verbosity value for enabling messages to stderr, >= 0 makes sense (integer) */
sezeroz@964
   649
+	MPG123_FLAGS,          /**< set all flags, p.ex val = MPG123_GAPLESS|MPG123_MONO_MIX (integer) */
sezeroz@964
   650
+	MPG123_ADD_FLAGS,      /**< add some flags (integer) */
sezeroz@964
   651
+	MPG123_FORCE_RATE,     /**< when value > 0, force output rate to that value (integer) */
sezeroz@964
   652
+	MPG123_DOWN_SAMPLE,    /**< 0=native rate, 1=half rate, 2=quarter rate (integer) */
sezeroz@964
   653
+	MPG123_RVA,            /**< one of the RVA choices above (integer) */
sezeroz@964
   654
+	MPG123_DOWNSPEED,      /**< play a frame N times (integer) */
sezeroz@964
   655
+	MPG123_UPSPEED,        /**< play every Nth frame (integer) */
sezeroz@964
   656
+	MPG123_START_FRAME,    /**< start with this frame (skip frames before that, integer) */ 
sezeroz@964
   657
+	MPG123_DECODE_FRAMES,  /**< decode only this number of frames (integer) */
sezeroz@964
   658
+	MPG123_ICY_INTERVAL,   /**< stream contains ICY metadata with this interval (integer) */
sezeroz@964
   659
+	MPG123_OUTSCALE,       /**< the scale for output samples (amplitude - integer or float according to mpg123 output format, normally integer) */
sezeroz@964
   660
+	MPG123_TIMEOUT,        /**< timeout for reading from a stream (not supported on win32, integer) */
sezeroz@964
   661
+	MPG123_REMOVE_FLAGS,   /**< remove some flags (inverse of MPG123_ADD_FLAGS, integer) */
sezeroz@964
   662
+	MPG123_RESYNC_LIMIT,   /**< Try resync on frame parsing for that many bytes or until end of stream (<0 ... integer). This can enlarge the limit for skipping junk on beginning, too (but not reduce it).  */
sezeroz@964
   663
+	MPG123_INDEX_SIZE      /**< Set the frame index size (if supported). Values <0 mean that the index is allowed to grow dynamically in these steps (in positive direction, of course) -- Use this when you really want a full index with every individual frame. */
sezeroz@964
   664
+	,MPG123_PREFRAMES /**< Decode/ignore that many frames in advance for layer 3. This is needed to fill bit reservoir after seeking, for example (but also at least one frame in advance is needed to have all "normal" data for layer 3). Give a positive integer value, please.*/
sezeroz@964
   665
+	,MPG123_FEEDPOOL  /**< For feeder mode, keep that many buffers in a pool to avoid frequent malloc/free. The pool is allocated on mpg123_open_feed(). If you change this parameter afterwards, you can trigger growth and shrinkage during decoding. The default value could change any time. If you care about this, then set it. (integer) */
sezeroz@964
   666
+	,MPG123_FEEDBUFFER /**< Minimal size of one internal feeder buffer, again, the default value is subject to change. (integer) */
sezeroz@964
   667
+};
sezeroz@964
   668
+
sezeroz@964
   669
+/** Flag bits for MPG123_FLAGS, use the usual binary or to combine. */
sezeroz@964
   670
+enum mpg123_param_flags
sezeroz@964
   671
+{
sezeroz@964
   672
+	 MPG123_FORCE_MONO   = 0x7  /**<     0111 Force some mono mode: This is a test bitmask for seeing if any mono forcing is active. */
sezeroz@964
   673
+	,MPG123_MONO_LEFT    = 0x1  /**<     0001 Force playback of left channel only.  */
sezeroz@964
   674
+	,MPG123_MONO_RIGHT   = 0x2  /**<     0010 Force playback of right channel only. */
sezeroz@964
   675
+	,MPG123_MONO_MIX     = 0x4  /**<     0100 Force playback of mixed mono.         */
sezeroz@964
   676
+	,MPG123_FORCE_STEREO = 0x8  /**<     1000 Force stereo output.                  */
sezeroz@964
   677
+	,MPG123_FORCE_8BIT   = 0x10 /**< 00010000 Force 8bit formats.                   */
sezeroz@964
   678
+	,MPG123_QUIET        = 0x20 /**< 00100000 Suppress any printouts (overrules verbose).                    */
sezeroz@964
   679
+	,MPG123_GAPLESS      = 0x40 /**< 01000000 Enable gapless decoding (default on if libmpg123 has support). */
sezeroz@964
   680
+	,MPG123_NO_RESYNC    = 0x80 /**< 10000000 Disable resync stream after error.                             */
sezeroz@964
   681
+	,MPG123_SEEKBUFFER   = 0x100 /**< 000100000000 Enable small buffer on non-seekable streams to allow some peek-ahead (for better MPEG sync). */
sezeroz@964
   682
+	,MPG123_FUZZY        = 0x200 /**< 001000000000 Enable fuzzy seeks (guessing byte offsets or using approximate seek points from Xing TOC) */
sezeroz@964
   683
+	,MPG123_FORCE_FLOAT  = 0x400 /**< 010000000000 Force floating point output (32 or 64 bits depends on mpg123 internal precision). */
sezeroz@964
   684
+	,MPG123_PLAIN_ID3TEXT = 0x800 /**< 100000000000 Do not translate ID3 text data to UTF-8. ID3 strings will contain the raw text data, with the first byte containing the ID3 encoding code. */
sezeroz@964
   685
+	,MPG123_IGNORE_STREAMLENGTH = 0x1000 /**< 1000000000000 Ignore any stream length information contained in the stream, which can be contained in a 'TLEN' frame of an ID3v2 tag or a Xing tag */
sezeroz@964
   686
+	,MPG123_SKIP_ID3V2 = 0x2000 /**< 10 0000 0000 0000 Do not parse ID3v2 tags, just skip them. */
sezeroz@964
   687
+	,MPG123_IGNORE_INFOFRAME = 0x4000 /**< 100 0000 0000 0000 Do not parse the LAME/Xing info frame, treat it as normal MPEG data. */
sezeroz@964
   688
+	,MPG123_AUTO_RESAMPLE = 0x8000 /**< 1000 0000 0000 0000 Allow automatic internal resampling of any kind (default on if supported). Especially when going lowlevel with replacing output buffer, you might want to unset this flag. Setting MPG123_DOWNSAMPLE or MPG123_FORCE_RATE will override this. */
sezeroz@964
   689
+	,MPG123_PICTURE = 0x10000 /**< 17th bit: Enable storage of pictures from tags (ID3v2 APIC). */
sezeroz@964
   690
+	,MPG123_NO_PEEK_END    = 0x20000 /**< 18th bit: Do not seek to the end of
sezeroz@964
   691
+	 *  the stream in order to probe
sezeroz@964
   692
+	 *  the stream length and search for the id3v1 field. This also means
sezeroz@964
   693
+	 *  the file size is unknown unless set using mpg123_set_filesize() and
sezeroz@964
   694
+	 *  the stream is assumed as non-seekable unless overridden.
sezeroz@964
   695
+	 */
sezeroz@964
   696
+	,MPG123_FORCE_SEEKABLE = 0x40000 /**< 19th bit: Force the stream to be seekable. */
sezeroz@964
   697
+};
sezeroz@964
   698
+
sezeroz@964
   699
+/** choices for MPG123_RVA */
sezeroz@964
   700
+enum mpg123_param_rva
sezeroz@964
   701
+{
sezeroz@964
   702
+	 MPG123_RVA_OFF   = 0 /**< RVA disabled (default).   */
sezeroz@964
   703
+	,MPG123_RVA_MIX   = 1 /**< Use mix/track/radio gain. */
sezeroz@964
   704
+	,MPG123_RVA_ALBUM = 2 /**< Use album/audiophile gain */
sezeroz@964
   705
+	,MPG123_RVA_MAX   = MPG123_RVA_ALBUM /**< The maximum RVA code, may increase in future. */
sezeroz@964
   706
+};
sezeroz@964
   707
+
sezeroz@964
   708
+/** Set a specific parameter, for a specific mpg123_handle, using a parameter 
sezeroz@964
   709
+ *  type key chosen from the mpg123_parms enumeration, to the specified value.
sezeroz@964
   710
+ *  \param mh handle
sezeroz@964
   711
+ *  \param type parameter choice
sezeroz@964
   712
+ *  \param value integer value
sezeroz@964
   713
+ *  \param fvalue floating point value
sezeroz@964
   714
+ *  \return MPG123_OK on success
sezeroz@964
   715
+ */
sezeroz@964
   716
+MPG123_EXPORT int mpg123_param( mpg123_handle *mh
sezeroz@964
   717
+,	enum mpg123_parms type, long value, double fvalue );
sezeroz@964
   718
+
sezeroz@964
   719
+/** Get a specific parameter, for a specific mpg123_handle. 
sezeroz@964
   720
+ *  See the mpg123_parms enumeration for a list of available parameters.
sezeroz@964
   721
+ *  \param mh handle
sezeroz@964
   722
+ *  \param type parameter choice
sezeroz@964
   723
+ *  \param value integer value return address
sezeroz@964
   724
+ *  \param fvalue floating point value return address
sezeroz@964
   725
+ *  \return MPG123_OK on success
sezeroz@964
   726
+ */
sezeroz@964
   727
+MPG123_EXPORT int mpg123_getparam( mpg123_handle *mh
sezeroz@964
   728
+,	enum mpg123_parms type, long *value, double *fvalue );
sezeroz@964
   729
+
sezeroz@964
   730
+/** Feature set available for query with mpg123_feature. */
sezeroz@964
   731
+enum mpg123_feature_set
sezeroz@964
   732
+{
sezeroz@964
   733
+	 MPG123_FEATURE_ABI_UTF8OPEN = 0     /**< mpg123 expects path names to be given in UTF-8 encoding instead of plain native. */
sezeroz@964
   734
+	,MPG123_FEATURE_OUTPUT_8BIT          /**< 8bit output   */
sezeroz@964
   735
+	,MPG123_FEATURE_OUTPUT_16BIT         /**< 16bit output  */
sezeroz@964
   736
+	,MPG123_FEATURE_OUTPUT_32BIT         /**< 32bit output  */
sezeroz@964
   737
+	,MPG123_FEATURE_INDEX                /**< support for building a frame index for accurate seeking */
sezeroz@964
   738
+	,MPG123_FEATURE_PARSE_ID3V2          /**< id3v2 parsing */
sezeroz@964
   739
+	,MPG123_FEATURE_DECODE_LAYER1        /**< mpeg layer-1 decoder enabled */
sezeroz@964
   740
+	,MPG123_FEATURE_DECODE_LAYER2        /**< mpeg layer-2 decoder enabled */
sezeroz@964
   741
+	,MPG123_FEATURE_DECODE_LAYER3        /**< mpeg layer-3 decoder enabled */
sezeroz@964
   742
+	,MPG123_FEATURE_DECODE_ACCURATE      /**< accurate decoder rounding    */
sezeroz@964
   743
+	,MPG123_FEATURE_DECODE_DOWNSAMPLE    /**< downsample (sample omit)     */
sezeroz@964
   744
+	,MPG123_FEATURE_DECODE_NTOM          /**< flexible rate decoding       */
sezeroz@964
   745
+	,MPG123_FEATURE_PARSE_ICY            /**< ICY support                  */
sezeroz@964
   746
+	,MPG123_FEATURE_TIMEOUT_READ         /**< Reader with timeout (network). */
sezeroz@964
   747
+	,MPG123_FEATURE_EQUALIZER            /**< tunable equalizer */
sezeroz@964
   748
+};
sezeroz@964
   749
+
sezeroz@964
   750
+/** Query libmpg123 features.
sezeroz@964
   751
+ *  \param key feature selection
sezeroz@964
   752
+ *  \return 1 for success, 0 for unimplemented functions
sezeroz@964
   753
+ */
sezeroz@964
   754
+MPG123_EXPORT int mpg123_feature(const enum mpg123_feature_set key);
sezeroz@964
   755
+
sezeroz@964
   756
+/* @} */
sezeroz@964
   757
+
sezeroz@964
   758
+
sezeroz@964
   759
+/** \defgroup mpg123_error mpg123 error handling
sezeroz@964
   760
+ *
sezeroz@964
   761
+ * Functions to get text version of the error numbers and an enumeration
sezeroz@964
   762
+ * of the error codes returned by libmpg123.
sezeroz@964
   763
+ *
sezeroz@964
   764
+ * Most functions operating on a mpg123_handle simply return MPG123_OK (0)
sezeroz@964
   765
+ * on success and MPG123_ERR (-1) on failure, setting the internal error
sezeroz@964
   766
+ * variable of the handle to the specific error code. If there was not a valid
sezeroz@964
   767
+ * (non-NULL) handle provided to a function operating on one, MPG123_BAD_HANDLE
sezeroz@964
   768
+ * may be returned if this can not be confused with a valid positive return
sezeroz@964
   769
+ * value.
sezeroz@964
   770
+ * Meaning: A function expected to return positive integers on success will
sezeroz@964
   771
+ * always indicate error or a special condition by returning a negative one.
sezeroz@964
   772
+ *
sezeroz@964
   773
+ * Decoding/seek functions may also return message codes MPG123_DONE,
sezeroz@964
   774
+ * MPG123_NEW_FORMAT and MPG123_NEED_MORE (all negative, see below on how to
sezeroz@964
   775
+ * react). Note that calls to those can be nested, so generally watch out
sezeroz@964
   776
+ * for these codes after initial handle setup.
sezeroz@964
   777
+ * Especially any function that needs information about the current stream
sezeroz@964
   778
+ * to work will try to at least parse the beginning if that did not happen
sezeroz@964
   779
+ * yet.
sezeroz@964
   780
+ *
sezeroz@964
   781
+ * On a function that is supposed to return MPG123_OK on success and
sezeroz@964
   782
+ * MPG123_ERR on failure, make sure you check for != MPG123_OK, not
sezeroz@964
   783
+ * == MPG123_ERR, as the error code could get more specific in future,
sezeroz@964
   784
+ * or there is just a special message from a decoding routine as indicated
sezeroz@964
   785
+ * above.
sezeroz@964
   786
+ *
sezeroz@964
   787
+ * @{
sezeroz@964
   788
+ */
sezeroz@964
   789
+
sezeroz@964
   790
+/** Enumeration of the message and error codes and returned by libmpg123 functions. */
sezeroz@964
   791
+enum mpg123_errors
sezeroz@964
   792
+{
sezeroz@964
   793
+	MPG123_DONE=-12,	/**< Message: Track ended. Stop decoding. */
sezeroz@964
   794
+	MPG123_NEW_FORMAT=-11,	/**< Message: Output format will be different on next call. Note that some libmpg123 versions between 1.4.3 and 1.8.0 insist on you calling mpg123_getformat() after getting this message code. Newer verisons behave like advertised: You have the chance to call mpg123_getformat(), but you can also just continue decoding and get your data. */
sezeroz@964
   795
+	MPG123_NEED_MORE=-10,	/**< Message: For feed reader: "Feed me more!" (call mpg123_feed() or mpg123_decode() with some new input data). */
sezeroz@964
   796
+	MPG123_ERR=-1,			/**< Generic Error */
sezeroz@964
   797
+	MPG123_OK=0, 			/**< Success */
sezeroz@964
   798
+	MPG123_BAD_OUTFORMAT, 	/**< Unable to set up output format! */
sezeroz@964
   799
+	MPG123_BAD_CHANNEL,		/**< Invalid channel number specified. */
sezeroz@964
   800
+	MPG123_BAD_RATE,		/**< Invalid sample rate specified.  */
sezeroz@964
   801
+	MPG123_ERR_16TO8TABLE,	/**< Unable to allocate memory for 16 to 8 converter table! */
sezeroz@964
   802
+	MPG123_BAD_PARAM,		/**< Bad parameter id! */
sezeroz@964
   803
+	MPG123_BAD_BUFFER,		/**< Bad buffer given -- invalid pointer or too small size. */
sezeroz@964
   804
+	MPG123_OUT_OF_MEM,		/**< Out of memory -- some malloc() failed. */
sezeroz@964
   805
+	MPG123_NOT_INITIALIZED,	/**< You didn't initialize the library! */
sezeroz@964
   806
+	MPG123_BAD_DECODER,		/**< Invalid decoder choice. */
sezeroz@964
   807
+	MPG123_BAD_HANDLE,		/**< Invalid mpg123 handle. */
sezeroz@964
   808
+	MPG123_NO_BUFFERS,		/**< Unable to initialize frame buffers (out of memory?). */
sezeroz@964
   809
+	MPG123_BAD_RVA,			/**< Invalid RVA mode. */
sezeroz@964
   810
+	MPG123_NO_GAPLESS,		/**< This build doesn't support gapless decoding. */
sezeroz@964
   811
+	MPG123_NO_SPACE,		/**< Not enough buffer space. */
sezeroz@964
   812
+	MPG123_BAD_TYPES,		/**< Incompatible numeric data types. */
sezeroz@964
   813
+	MPG123_BAD_BAND,		/**< Bad equalizer band. */
sezeroz@964
   814
+	MPG123_ERR_NULL,		/**< Null pointer given where valid storage address needed. */
sezeroz@964
   815
+	MPG123_ERR_READER,		/**< Error reading the stream. */
sezeroz@964
   816
+	MPG123_NO_SEEK_FROM_END,/**< Cannot seek from end (end is not known). */
sezeroz@964
   817
+	MPG123_BAD_WHENCE,		/**< Invalid 'whence' for seek function.*/
sezeroz@964
   818
+	MPG123_NO_TIMEOUT,		/**< Build does not support stream timeouts. */
sezeroz@964
   819
+	MPG123_BAD_FILE,		/**< File access error. */
sezeroz@964
   820
+	MPG123_NO_SEEK,			/**< Seek not supported by stream. */
sezeroz@964
   821
+	MPG123_NO_READER,		/**< No stream opened. */
sezeroz@964
   822
+	MPG123_BAD_PARS,		/**< Bad parameter handle. */
sezeroz@964
   823
+	MPG123_BAD_INDEX_PAR,	/**< Bad parameters to mpg123_index() and mpg123_set_index() */
sezeroz@964
   824
+	MPG123_OUT_OF_SYNC,	/**< Lost track in bytestream and did not try to resync. */
sezeroz@964
   825
+	MPG123_RESYNC_FAIL,	/**< Resync failed to find valid MPEG data. */
sezeroz@964
   826
+	MPG123_NO_8BIT,	/**< No 8bit encoding possible. */
sezeroz@964
   827
+	MPG123_BAD_ALIGN,	/**< Stack aligmnent error */
sezeroz@964
   828
+	MPG123_NULL_BUFFER,	/**< NULL input buffer with non-zero size... */
sezeroz@964
   829
+	MPG123_NO_RELSEEK,	/**< Relative seek not possible (screwed up file offset) */
sezeroz@964
   830
+	MPG123_NULL_POINTER, /**< You gave a null pointer somewhere where you shouldn't have. */
sezeroz@964
   831
+	MPG123_BAD_KEY,	/**< Bad key value given. */
sezeroz@964
   832
+	MPG123_NO_INDEX,	/**< No frame index in this build. */
sezeroz@964
   833
+	MPG123_INDEX_FAIL,	/**< Something with frame index went wrong. */
sezeroz@964
   834
+	MPG123_BAD_DECODER_SETUP,	/**< Something prevents a proper decoder setup */
sezeroz@964
   835
+	MPG123_MISSING_FEATURE  /**< This feature has not been built into libmpg123. */
sezeroz@964
   836
+	,MPG123_BAD_VALUE /**< A bad value has been given, somewhere. */
sezeroz@964
   837
+	,MPG123_LSEEK_FAILED /**< Low-level seek failed. */
sezeroz@964
   838
+	,MPG123_BAD_CUSTOM_IO /**< Custom I/O not prepared. */
sezeroz@964
   839
+	,MPG123_LFS_OVERFLOW /**< Offset value overflow during translation of large file API calls -- your client program cannot handle that large file. */
sezeroz@964
   840
+	,MPG123_INT_OVERFLOW /**< Some integer overflow. */
sezeroz@964
   841
+};
sezeroz@964
   842
+
sezeroz@964
   843
+/** Look up error strings given integer code.
sezeroz@964
   844
+ *  \param errcode integer error code
sezeroz@964
   845
+ *  \return string describing what that error error code means
sezeroz@964
   846
+ */
sezeroz@964
   847
+MPG123_EXPORT const char* mpg123_plain_strerror(int errcode);
sezeroz@964
   848
+
sezeroz@964
   849
+/** Give string describing what error has occured in the context of handle mh.
sezeroz@964
   850
+ *  When a function operating on an mpg123 handle returns MPG123_ERR, you should check for the actual reason via
sezeroz@964
   851
+ *  char *errmsg = mpg123_strerror(mh)
sezeroz@964
   852
+ *  This function will catch mh == NULL and return the message for MPG123_BAD_HANDLE.
sezeroz@964
   853
+ *  \param mh handle
sezeroz@964
   854
+ *  \return error message
sezeroz@964
   855
+ */
sezeroz@964
   856
+MPG123_EXPORT const char* mpg123_strerror(mpg123_handle *mh);
sezeroz@964
   857
+
sezeroz@964
   858
+/** Return the plain errcode intead of a string.
sezeroz@964
   859
+ *  \param mh handle
sezeroz@964
   860
+ *  \return error code recorded in handle or MPG123_BAD_HANDLE
sezeroz@964
   861
+ */
sezeroz@964
   862
+MPG123_EXPORT int mpg123_errcode(mpg123_handle *mh);
sezeroz@964
   863
+
sezeroz@964
   864
+/*@}*/
sezeroz@964
   865
+
sezeroz@964
   866
+
sezeroz@964
   867
+/** \defgroup mpg123_decoder mpg123 decoder selection
sezeroz@964
   868
+ *
sezeroz@964
   869
+ * Functions to list and select the available decoders.
sezeroz@964
   870
+ * Perhaps the most prominent feature of mpg123: You have several (optimized) decoders to choose from (on x86 and PPC (MacOS) systems, that is).
sezeroz@964
   871
+ *
sezeroz@964
   872
+ * @{
sezeroz@964
   873
+ */
sezeroz@964
   874
+
sezeroz@964
   875
+/** Get available decoder list.
sezeroz@964
   876
+ *  \return NULL-terminated array of generally available decoder names (plain 8bit ASCII)
sezeroz@964
   877
+ */
sezeroz@964
   878
+MPG123_EXPORT const char **mpg123_decoders(void);
sezeroz@964
   879
+
sezeroz@964
   880
+/** Get supported decoder list.
sezeroz@964
   881
+ *  \return NULL-terminated array of the decoders supported by the CPU (plain 8bit ASCII)
sezeroz@964
   882
+ */
sezeroz@964
   883
+MPG123_EXPORT const char **mpg123_supported_decoders(void);
sezeroz@964
   884
+
sezeroz@964
   885
+/** Set the active decoder.
sezeroz@964
   886
+ *  \param mh handle
sezeroz@964
   887
+ *  \param decoder_name name of decoder
sezeroz@964
   888
+ *  \return MPG123_OK on success
sezeroz@964
   889
+ */
sezeroz@964
   890
+MPG123_EXPORT int mpg123_decoder(mpg123_handle *mh, const char* decoder_name);
sezeroz@964
   891
+
sezeroz@964
   892
+/** Get the currently active decoder name.
sezeroz@964
   893
+ *  The active decoder engine can vary depening on output constraints,
sezeroz@964
   894
+ *  mostly non-resampling, integer output is accelerated via 3DNow & Co. but for
sezeroz@964
   895
+ *  other modes a fallback engine kicks in.
sezeroz@964
   896
+ *  Note that this can return a decoder that is only active in the hidden and not
sezeroz@964
   897
+ *  available as decoder choice from the outside.
sezeroz@964
   898
+ *  \param mh handle
sezeroz@964
   899
+ *  \return The decoder name or NULL on error.
sezeroz@964
   900
+ */
sezeroz@964
   901
+MPG123_EXPORT const char* mpg123_current_decoder(mpg123_handle *mh);
sezeroz@964
   902
+
sezeroz@964
   903
+/*@}*/
sezeroz@964
   904
+
sezeroz@964
   905
+
sezeroz@964
   906
+/** \defgroup mpg123_output mpg123 output audio format 
sezeroz@964
   907
+ *
sezeroz@964
   908
+ * Functions to get and select the format of the decoded audio.
sezeroz@964
   909
+ *
sezeroz@964
   910
+ * Before you dive in, please be warned that you might get confused by this. This seems to happen a lot, therefore I am trying to explain in advance.
sezeroz@964
   911
+ *
sezeroz@964
   912
+ * The mpg123 library decides what output format to use when encountering the first frame in a stream, or actually any frame that is still valid but differs from the frames before in the prompted output format. At such a deciding point, an internal table of allowed encodings, sampling rates and channel setups is consulted. According to this table, an output format is chosen and the decoding engine set up accordingly (including optimized routines for different output formats). This might seem unusual but it just follows from the non-existence of "MPEG audio files" with defined overall properties. There are streams, streams are concatenations of (semi) independent frames. We store streams on disk and call them "MPEG audio files", but that does not change their nature as the decoder is concerned (the LAME/Xing header for gapless decoding makes things interesting again).
sezeroz@964
   913
+ *
sezeroz@964
   914
+ * To get to the point: What you do with mpg123_format() and friends is to fill the internal table of allowed formats before it is used. That includes removing support for some formats or adding your forced sample rate (see MPG123_FORCE_RATE) that will be used with the crude internal resampler. Also keep in mind that the sample encoding is just a question of choice -- the MPEG frames do only indicate their native sampling rate and channel count. If you want to decode to integer or float samples, 8 or 16 bit ... that is your decision. In a "clean" world, libmpg123 would always decode to 32 bit float and let you handle any sample conversion. But there are optimized routines that work faster by directly decoding to the desired encoding / accuracy. We prefer efficiency over conceptual tidyness.
sezeroz@964
   915
+ *
sezeroz@964
   916
+ * People often start out thinking that mpg123_format() should change the actual decoding format on the fly. That is wrong. It only has effect on the next natural change of output format, when libmpg123 will consult its format table again. To make life easier, you might want to call mpg123_format_none() before any thing else and then just allow one desired encoding and a limited set of sample rates / channel choices that you actually intend to deal with. You can force libmpg123 to decode everything to 44100 KHz, stereo, 16 bit integer ... it will duplicate mono channels and even do resampling if needed (unless that feature is disabled in the build, same with some encodings). But I have to stress that the resampling of libmpg123 is very crude and doesn't even contain any kind of "proper" interpolation.
sezeroz@964
   917
+ *
sezeroz@964
   918
+ * In any case, watch out for MPG123_NEW_FORMAT as return message from decoding routines and call mpg123_getformat() to get the currently active output format.
sezeroz@964
   919
+ *
sezeroz@964
   920
+ * @{
sezeroz@964
   921
+ */
sezeroz@964
   922
+
sezeroz@964
   923
+/** They can be combined into one number (3) to indicate mono and stereo... */
sezeroz@964
   924
+enum mpg123_channelcount
sezeroz@964
   925
+{
sezeroz@964
   926
+	 MPG123_MONO   = 1 /**< mono */
sezeroz@964
   927
+	,MPG123_STEREO = 2 /**< stereo */
sezeroz@964
   928
+};
sezeroz@964
   929
+
sezeroz@964
   930
+/** An array of supported standard sample rates
sezeroz@964
   931
+ *  These are possible native sample rates of MPEG audio files.
sezeroz@964
   932
+ *  You can still force mpg123 to resample to a different one, but by default you will only get audio in one of these samplings.
sezeroz@964
   933
+ *  \param list Store a pointer to the sample rates array there.
sezeroz@964
   934
+ *  \param number Store the number of sample rates there. */
sezeroz@964
   935
+MPG123_EXPORT void mpg123_rates(const long **list, size_t *number);
sezeroz@964
   936
+
sezeroz@964
   937
+/** An array of supported audio encodings.
sezeroz@964
   938
+ *  An audio encoding is one of the fully qualified members of mpg123_enc_enum (MPG123_ENC_SIGNED_16, not MPG123_SIGNED).
sezeroz@964
   939
+ *  \param list Store a pointer to the encodings array there.
sezeroz@964
   940
+ *  \param number Store the number of encodings there. */
sezeroz@964
   941
+MPG123_EXPORT void mpg123_encodings(const int **list, size_t *number);
sezeroz@964
   942
+
sezeroz@964
   943
+/** Return the size (in bytes) of one mono sample of the named encoding.
sezeroz@964
   944
+ * \param encoding The encoding value to analyze.
sezeroz@964
   945
+ * \return positive size of encoding in bytes, 0 on invalid encoding. */
sezeroz@964
   946
+MPG123_EXPORT int mpg123_encsize(int encoding);
sezeroz@964
   947
+
sezeroz@964
   948
+/** Configure a mpg123 handle to accept no output format at all, 
sezeroz@964
   949
+ *  use before specifying supported formats with mpg123_format
sezeroz@964
   950
+ *  \param mh handle
sezeroz@964
   951
+ *  \return MPG123_OK on success
sezeroz@964
   952
+ */
sezeroz@964
   953
+MPG123_EXPORT int mpg123_format_none(mpg123_handle *mh);
sezeroz@964
   954
+
sezeroz@964
   955
+/** Configure mpg123 handle to accept all formats 
sezeroz@964
   956
+ *  (also any custom rate you may set) -- this is default.
sezeroz@964
   957
+ *  \param mh handle
sezeroz@964
   958
+ *  \return MPG123_OK on success
sezeroz@964
   959
+ */
sezeroz@964
   960
+MPG123_EXPORT int mpg123_format_all(mpg123_handle *mh);
sezeroz@964
   961
+
sezeroz@964
   962
+/** Set the audio format support of a mpg123_handle in detail:
sezeroz@964
   963
+ *  \param mh handle
sezeroz@964
   964
+ *  \param rate The sample rate value (in Hertz).
sezeroz@964
   965
+ *  \param channels A combination of MPG123_STEREO and MPG123_MONO.
sezeroz@964
   966
+ *  \param encodings A combination of accepted encodings for rate and channels, p.ex MPG123_ENC_SIGNED16 | MPG123_ENC_ULAW_8 (or 0 for no support). Please note that some encodings may not be supported in the library build and thus will be ignored here.
sezeroz@964
   967
+ *  \return MPG123_OK on success, MPG123_ERR if there was an error. */
sezeroz@964
   968
+MPG123_EXPORT int mpg123_format( mpg123_handle *mh
sezeroz@964
   969
+,	long rate, int channels, int encodings );
sezeroz@964
   970
+
sezeroz@964
   971
+/** Check to see if a specific format at a specific rate is supported 
sezeroz@964
   972
+ *  by mpg123_handle.
sezeroz@964
   973
+ *  \param mh handle
sezeroz@964
   974
+ *  \param rate sampling rate
sezeroz@964
   975
+ *  \param encoding encoding
sezeroz@964
   976
+ *  \return 0 for no support (that includes invalid parameters), MPG123_STEREO, 
sezeroz@964
   977
+ *          MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
sezeroz@964
   978
+MPG123_EXPORT int mpg123_format_support( mpg123_handle *mh
sezeroz@964
   979
+,	long rate, int encoding );
sezeroz@964
   980
+
sezeroz@964
   981
+/** Get the current output format written to the addresses given.
sezeroz@964
   982
+ *  If the stream is freshly loaded, this will try to parse enough
sezeroz@964
   983
+ *  of it to give you the format to come. This clears the flag that
sezeroz@964
   984
+ *  would otherwise make the first decoding call return
sezeroz@964
   985
+ *  MPG123_NEW_FORMAT.
sezeroz@964
   986
+ *  \param mh handle
sezeroz@964
   987
+ *  \param rate sampling rate return address
sezeroz@964
   988
+ *  \param channels channel count return address
sezeroz@964
   989
+ *  \param encoding encoding return address
sezeroz@964
   990
+ *  \return MPG123_OK on success
sezeroz@964
   991
+ */
sezeroz@964
   992
+MPG123_EXPORT int mpg123_getformat( mpg123_handle *mh
sezeroz@964
   993
+,	long *rate, int *channels, int *encoding );
sezeroz@964
   994
+
sezeroz@964
   995
+/** Get the current output format written to the addresses given.
sezeroz@964
   996
+ *  This differs from plain mpg123_getformat() in that you can choose
sezeroz@964
   997
+ *  _not_ to clear the flag that would trigger the next decoding call
sezeroz@964
   998
+ *  to return MPG123_NEW_FORMAT in case of a new format arriving.
sezeroz@964
   999
+ *  \param mh handle
sezeroz@964
  1000
+ *  \param rate sampling rate return address
sezeroz@964
  1001
+ *  \param channels channel count return address
sezeroz@964
  1002
+ *  \param encoding encoding return address
sezeroz@964
  1003
+ *  \param clear_flag if true, clear internal format flag
sezeroz@964
  1004
+ *  \return MPG123_OK on success
sezeroz@964
  1005
+ */
sezeroz@964
  1006
+MPG123_EXPORT int mpg123_getformat2( mpg123_handle *mh
sezeroz@964
  1007
+,	long *rate, int *channels, int *encoding, int clear_flag );
sezeroz@964
  1008
+
sezeroz@964
  1009
+/*@}*/
sezeroz@964
  1010
+
sezeroz@964
  1011
+
sezeroz@964
  1012
+/** \defgroup mpg123_input mpg123 file input and decoding
sezeroz@964
  1013
+ *
sezeroz@964
  1014
+ * Functions for input bitstream and decoding operations.
sezeroz@964
  1015
+ * Decoding/seek functions may also return message codes MPG123_DONE, MPG123_NEW_FORMAT and MPG123_NEED_MORE (please read up on these on how to react!).
sezeroz@964
  1016
+ * @{
sezeroz@964
  1017
+ */
sezeroz@964
  1018
+
sezeroz@964
  1019
+/* reading samples / triggering decoding, possible return values: */
sezeroz@964
  1020
+/** Enumeration of the error codes returned by libmpg123 functions. */
sezeroz@964
  1021
+
sezeroz@964
  1022
+/** Open and prepare to decode the specified file by filesystem path.
sezeroz@964
  1023
+ *  This does not open HTTP urls; libmpg123 contains no networking code.
sezeroz@964
  1024
+ *  If you want to decode internet streams, use mpg123_open_fd() or mpg123_open_feed().
sezeroz@964
  1025
+ *  \param mh handle
sezeroz@964
  1026
+ *  \param path filesystem path
sezeroz@964
  1027
+ *  \return MPG123_OK on success
sezeroz@964
  1028
+ */
sezeroz@964
  1029
+MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path);
sezeroz@964
  1030
+
sezeroz@964
  1031
+/** Use an already opened file descriptor as the bitstream input
sezeroz@964
  1032
+ *  mpg123_close() will _not_ close the file descriptor.
sezeroz@964
  1033
+ *  \param mh handle
sezeroz@964
  1034
+ *  \param fd file descriptor
sezeroz@964
  1035
+ *  \return MPG123_OK on success
sezeroz@964
  1036
+ */
sezeroz@964
  1037
+MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd);
sezeroz@964
  1038
+
sezeroz@964
  1039
+/** Use an opaque handle as bitstream input. This works only with the
sezeroz@964
  1040
+ *  replaced I/O from mpg123_replace_reader_handle()!
sezeroz@964
  1041
+ *  mpg123_close() will call the cleanup callback for your handle (if you gave one).
sezeroz@964
  1042
+ *  \param mh handle
sezeroz@964
  1043
+ *  \param iohandle your handle
sezeroz@964
  1044
+ *  \return MPG123_OK on success
sezeroz@964
  1045
+ */
sezeroz@964
  1046
+MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle);
sezeroz@964
  1047
+
sezeroz@964
  1048
+/** Open a new bitstream and prepare for direct feeding
sezeroz@964
  1049
+ *  This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream.
sezeroz@964
  1050
+ *  \param mh handle
sezeroz@964
  1051
+ *  \return MPG123_OK on success
sezeroz@964
  1052
+ */
sezeroz@964
  1053
+MPG123_EXPORT int mpg123_open_feed(mpg123_handle *mh);
sezeroz@964
  1054
+
sezeroz@964
  1055
+/** Closes the source, if libmpg123 opened it.
sezeroz@964
  1056
+ *  \param mh handle
sezeroz@964
  1057
+ *  \return MPG123_OK on success
sezeroz@964
  1058
+ */
sezeroz@964
  1059
+MPG123_EXPORT int mpg123_close(mpg123_handle *mh);
sezeroz@964
  1060
+
sezeroz@964
  1061
+/** Read from stream and decode up to outmemsize bytes.
sezeroz@964
  1062
+ *  \param mh handle
sezeroz@964
  1063
+ *  \param outmemory address of output buffer to write to
sezeroz@964
  1064
+ *  \param outmemsize maximum number of bytes to write
sezeroz@964
  1065
+ *  \param done address to store the number of actually decoded bytes to
sezeroz@964
  1066
+ *  \return MPG123_OK or error/message code
sezeroz@964
  1067
+ */
sezeroz@964
  1068
+MPG123_EXPORT int mpg123_read(mpg123_handle *mh
sezeroz@964
  1069
+,	unsigned char *outmemory, size_t outmemsize, size_t *done );
sezeroz@964
  1070
+
sezeroz@964
  1071
+/** Feed data for a stream that has been opened with mpg123_open_feed().
sezeroz@964
  1072
+ *  It's give and take: You provide the bytestream, mpg123 gives you the decoded samples.
sezeroz@964
  1073
+ *  \param mh handle
sezeroz@964
  1074
+ *  \param in input buffer
sezeroz@964
  1075
+ *  \param size number of input bytes
sezeroz@964
  1076
+ *  \return MPG123_OK or error/message code.
sezeroz@964
  1077
+ */
sezeroz@964
  1078
+MPG123_EXPORT int mpg123_feed( mpg123_handle *mh
sezeroz@964
  1079
+,	const unsigned char *in, size_t size );
sezeroz@964
  1080
+
sezeroz@964
  1081
+/** Decode MPEG Audio from inmemory to outmemory. 
sezeroz@964
  1082
+ *  This is very close to a drop-in replacement for old mpglib.
sezeroz@964
  1083
+ *  When you give zero-sized output buffer the input will be parsed until 
sezeroz@964
  1084
+ *  decoded data is available. This enables you to get MPG123_NEW_FORMAT (and query it) 
sezeroz@964
  1085
+ *  without taking decoded data.
sezeroz@964
  1086
+ *  Think of this function being the union of mpg123_read() and mpg123_feed() (which it actually is, sort of;-).
sezeroz@964
  1087
+ *  You can actually always decide if you want those specialized functions in separate steps or one call this one here.
sezeroz@964
  1088
+ *  \param mh handle
sezeroz@964
  1089
+ *  \param inmemory input buffer
sezeroz@964
  1090
+ *  \param inmemsize number of input bytes
sezeroz@964
  1091
+ *  \param outmemory output buffer
sezeroz@964
  1092
+ *  \param outmemsize maximum number of output bytes
sezeroz@964
  1093
+ *  \param done address to store the number of actually decoded bytes to
sezeroz@964
  1094
+ *  \return error/message code (watch out especially for MPG123_NEED_MORE)
sezeroz@964
  1095
+ */
sezeroz@964
  1096
+MPG123_EXPORT int mpg123_decode( mpg123_handle *mh
sezeroz@964
  1097
+,	const unsigned char *inmemory, size_t inmemsize
sezeroz@964
  1098
+,	unsigned char *outmemory, size_t outmemsize, size_t *done );
sezeroz@964
  1099
+
sezeroz@964
  1100
+/** Decode next MPEG frame to internal buffer
sezeroz@964
  1101
+ *  or read a frame and return after setting a new format.
sezeroz@964
  1102
+ *  \param mh handle
sezeroz@964
  1103
+ *  \param num current frame offset gets stored there
sezeroz@964
  1104
+ *  \param audio This pointer is set to the internal buffer to read the decoded audio from.
sezeroz@964
  1105
+ *  \param bytes number of output bytes ready in the buffer
sezeroz@964
  1106
+ *  \return MPG123_OK or error/message code
sezeroz@964
  1107
+ */
sezeroz@964
  1108
+MPG123_EXPORT int mpg123_decode_frame( mpg123_handle *mh
sezeroz@964
  1109
+,	off_t *num, unsigned char **audio, size_t *bytes );
sezeroz@964
  1110
+
sezeroz@964
  1111
+/** Decode current MPEG frame to internal buffer.
sezeroz@964
  1112
+ * Warning: This is experimental API that might change in future releases!
sezeroz@964
  1113
+ * Please watch mpg123 development closely when using it.
sezeroz@964
  1114
+ *  \param mh handle
sezeroz@964
  1115
+ *  \param num last frame offset gets stored there
sezeroz@964
  1116
+ *  \param audio this pointer is set to the internal buffer to read the decoded audio from.
sezeroz@964
  1117
+ *  \param bytes number of output bytes ready in the buffer
sezeroz@964
  1118
+ *  \return MPG123_OK or error/message code
sezeroz@964
  1119
+ */
sezeroz@964
  1120
+MPG123_EXPORT int mpg123_framebyframe_decode( mpg123_handle *mh
sezeroz@964
  1121
+,	off_t *num, unsigned char **audio, size_t *bytes );
sezeroz@964
  1122
+
sezeroz@964
  1123
+/** Find, read and parse the next mp3 frame
sezeroz@964
  1124
+ * Warning: This is experimental API that might change in future releases!
sezeroz@964
  1125
+ * Please watch mpg123 development closely when using it.
sezeroz@964
  1126
+ *  \param mh handle
sezeroz@964
  1127
+ *  \return MPG123_OK or error/message code
sezeroz@964
  1128
+ */
sezeroz@964
  1129
+MPG123_EXPORT int mpg123_framebyframe_next(mpg123_handle *mh);
sezeroz@964
  1130
+
sezeroz@964
  1131
+/** Get access to the raw input data for the last parsed frame.
sezeroz@964
  1132
+ * This gives you a direct look (and write access) to the frame body data.
sezeroz@964
  1133
+ * Together with the raw header, you can reconstruct the whole raw MPEG stream without junk and meta data, or play games by actually modifying the frame body data before decoding this frame (mpg123_framebyframe_decode()).
sezeroz@964
  1134
+ * A more sane use would be to use this for CRC checking (see mpg123_info() and MPG123_CRC), the first two bytes of the body make up the CRC16 checksum, if present.
sezeroz@964
  1135
+ * You can provide NULL for a parameter pointer when you are not interested in the value.
sezeroz@964
  1136
+ *
sezeroz@964
  1137
+ * \param mh handle
sezeroz@964
  1138
+ * \param header the 4-byte MPEG header
sezeroz@964
  1139
+ * \param bodydata pointer to the frame body stored in the handle (without the header)
sezeroz@964
  1140
+ * \param bodybytes size of frame body in bytes (without the header)
sezeroz@964
  1141
+ * \return MPG123_OK if there was a yet un-decoded frame to get the
sezeroz@964
  1142
+ *    data from, MPG123_BAD_HANDLE or MPG123_ERR otherwise (without further
sezeroz@964
  1143
+ *    explanation, the error state of the mpg123_handle is not modified by
sezeroz@964
  1144
+ *    this function).
sezeroz@964
  1145
+ */
sezeroz@964
  1146
+MPG123_EXPORT int mpg123_framedata( mpg123_handle *mh
sezeroz@964
  1147
+,	unsigned long *header, unsigned char **bodydata, size_t *bodybytes );
sezeroz@964
  1148
+
sezeroz@964
  1149
+/** Get the input position (byte offset in stream) of the last parsed frame.
sezeroz@964
  1150
+ *  This can be used for external seek index building, for example.
sezeroz@964
  1151
+ *  It just returns the internally stored offset, regardless of validity --
sezeroz@964
  1152
+ *  you ensure that a valid frame has been parsed before!
sezeroz@964
  1153
+ * \param mh handle
sezeroz@964
  1154
+ * \return byte offset in stream
sezeroz@964
  1155
+ */
sezeroz@964
  1156
+MPG123_EXPORT off_t mpg123_framepos(mpg123_handle *mh);
sezeroz@964
  1157
+
sezeroz@964
  1158
+/*@}*/
sezeroz@964
  1159
+
sezeroz@964
  1160
+
sezeroz@964
  1161
+/** \defgroup mpg123_seek mpg123 position and seeking
sezeroz@964
  1162
+ *
sezeroz@964
  1163
+ * Functions querying and manipulating position in the decoded audio bitstream.
sezeroz@964
  1164
+ * The position is measured in decoded audio samples, or MPEG frame offset for the specific functions.
sezeroz@964
  1165
+ * If gapless code is in effect, the positions are adjusted to compensate the skipped padding/delay - meaning, you should not care about that at all and just use the position defined for the samples you get out of the decoder;-)
sezeroz@964
  1166
+ * The general usage is modelled after stdlib's ftell() and fseek().
sezeroz@964
  1167
+ * Especially, the whence parameter for the seek functions has the same meaning as the one for fseek() and needs the same constants from stdlib.h: 
sezeroz@964
  1168
+ * - SEEK_SET: set position to (or near to) specified offset
sezeroz@964
  1169
+ * - SEEK_CUR: change position by offset from now
sezeroz@964
  1170
+ * - SEEK_END: set position to offset from end
sezeroz@964
  1171
+ *
sezeroz@964
  1172
+ * Note that sample-accurate seek only works when gapless support has been enabled at compile time; seek is frame-accurate otherwise.
sezeroz@964
  1173
+ * Also, really sample-accurate seeking (meaning that you get the identical sample value after seeking compared to plain decoding up to the position) is only guaranteed when you do not mess with the position code by using MPG123_UPSPEED, MPG123_DOWNSPEED or MPG123_START_FRAME. The first two mainly should cause trouble with NtoM resampling, but in any case with these options in effect, you have to keep in mind that the sample offset is not the same as counting the samples you get from decoding since mpg123 counts the skipped samples, too (or the samples played twice only once)!
sezeroz@964
  1174
+ * Short: When you care about the sample position, don't mess with those parameters;-)
sezeroz@964
  1175
+ * Also, seeking is not guaranteed to work for all streams (underlying stream may not support it).
sezeroz@964
  1176
+ * And yet another caveat: If the stream is concatenated out of differing pieces (Frankenstein stream), seeking may suffer, too.
sezeroz@964
  1177
+ *
sezeroz@964
  1178
+ * @{
sezeroz@964
  1179
+ */
sezeroz@964
  1180
+
sezeroz@964
  1181
+/** Returns the current position in samples.
sezeroz@964
  1182
+ *  On the next successful read, you'd get that sample.
sezeroz@964
  1183
+ *  \param mh handle
sezeroz@964
  1184
+ *  \return sample offset or MPG123_ERR (null handle)
sezeroz@964
  1185
+ */
sezeroz@964
  1186
+MPG123_EXPORT off_t mpg123_tell(mpg123_handle *mh);
sezeroz@964
  1187
+
sezeroz@964
  1188
+/** Returns the frame number that the next read will give you data from.
sezeroz@964
  1189
+ *  \param mh handle
sezeroz@964
  1190
+ *  \return frame offset or MPG123_ERR (null handle)
sezeroz@964
  1191
+ */
sezeroz@964
  1192
+MPG123_EXPORT off_t mpg123_tellframe(mpg123_handle *mh);
sezeroz@964
  1193
+
sezeroz@964
  1194
+/** Returns the current byte offset in the input stream.
sezeroz@964
  1195
+ *  \param mh handle
sezeroz@964
  1196
+ *  \return byte offset or MPG123_ERR (null handle)
sezeroz@964
  1197
+ */
sezeroz@964
  1198
+MPG123_EXPORT off_t mpg123_tell_stream(mpg123_handle *mh);
sezeroz@964
  1199
+
sezeroz@964
  1200
+/** Seek to a desired sample offset.
sezeroz@964
  1201
+ *  Usage is modelled afer the standard lseek().
sezeroz@964
  1202
+ * \param mh handle
sezeroz@964
  1203
+ * \param sampleoff offset in PCM samples
sezeroz@964
  1204
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
sezeroz@964
  1205
+ * \return The resulting offset >= 0 or error/message code
sezeroz@964
  1206
+ */
sezeroz@964
  1207
+MPG123_EXPORT off_t mpg123_seek( mpg123_handle *mh
sezeroz@964
  1208
+,	off_t sampleoff, int whence );
sezeroz@964
  1209
+
sezeroz@964
  1210
+/** Seek to a desired sample offset in data feeding mode. 
sezeroz@964
  1211
+ *  This just prepares things to be right only if you ensure that the next chunk of input data will be from input_offset byte position.
sezeroz@964
  1212
+ *  \param mh handle
sezeroz@964
  1213
+ *  \param sampleoff offset in PCM samples
sezeroz@964
  1214
+ *  \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
sezeroz@964
  1215
+ *  \param input_offset The position it expects to be at the 
sezeroz@964
  1216
+ *                      next time data is fed to mpg123_decode().
sezeroz@964
  1217
+ *  \return The resulting offset >= 0 or error/message code */
sezeroz@964
  1218
+MPG123_EXPORT off_t mpg123_feedseek( mpg123_handle *mh
sezeroz@964
  1219
+,	off_t sampleoff, int whence, off_t *input_offset );
sezeroz@964
  1220
+
sezeroz@964
  1221
+/** Seek to a desired MPEG frame offset.
sezeroz@964
  1222
+ *  Usage is modelled afer the standard lseek().
sezeroz@964
  1223
+ * \param mh handle
sezeroz@964
  1224
+ * \param frameoff offset in MPEG frames
sezeroz@964
  1225
+ * \param whence one of SEEK_SET, SEEK_CUR or SEEK_END
sezeroz@964
  1226
+ * \return The resulting offset >= 0 or error/message code */
sezeroz@964
  1227
+MPG123_EXPORT off_t mpg123_seek_frame( mpg123_handle *mh
sezeroz@964
  1228
+,	off_t frameoff, int whence );
sezeroz@964
  1229
+
sezeroz@964
  1230
+/** Return a MPEG frame offset corresponding to an offset in seconds.
sezeroz@964
  1231
+ *  This assumes that the samples per frame do not change in the file/stream, which is a good assumption for any sane file/stream only.
sezeroz@964
  1232
+ *  \return frame offset >= 0 or error/message code */
sezeroz@964
  1233
+MPG123_EXPORT off_t mpg123_timeframe(mpg123_handle *mh, double sec);
sezeroz@964
  1234
+
sezeroz@964
  1235
+/** Give access to the frame index table that is managed for seeking.
sezeroz@964
  1236
+ *  You are asked not to modify the values... Use mpg123_set_index to set the
sezeroz@964
  1237
+ *  seek index
sezeroz@964
  1238
+ *  \param mh handle
sezeroz@964
  1239
+ *  \param offsets pointer to the index array
sezeroz@964
  1240
+ *  \param step one index byte offset advances this many MPEG frames
sezeroz@964
  1241
+ *  \param fill number of recorded index offsets; size of the array
sezeroz@964
  1242
+ *  \return MPG123_OK on success
sezeroz@964
  1243
+ */
sezeroz@964
  1244
+MPG123_EXPORT int mpg123_index( mpg123_handle *mh
sezeroz@964
  1245
+,	off_t **offsets, off_t *step, size_t *fill );
sezeroz@964
  1246
+
sezeroz@964
  1247
+/** Set the frame index table
sezeroz@964
  1248
+ *  Setting offsets to NULL and fill > 0 will allocate fill entries. Setting offsets
sezeroz@964
  1249
+ *  to NULL and fill to 0 will clear the index and free the allocated memory used by the index.
sezeroz@964
  1250
+ *  \param mh handle
sezeroz@964
  1251
+ *  \param offsets pointer to the index array
sezeroz@964
  1252
+ *  \param step    one index byte offset advances this many MPEG frames
sezeroz@964
  1253
+ *  \param fill    number of recorded index offsets; size of the array
sezeroz@964
  1254
+ *  \return MPG123_OK on success
sezeroz@964
  1255
+ */
sezeroz@964
  1256
+MPG123_EXPORT int mpg123_set_index( mpg123_handle *mh
sezeroz@964
  1257
+,	off_t *offsets, off_t step, size_t fill );
sezeroz@964
  1258
+
sezeroz@964
  1259
+/** An old crutch to keep old mpg123 binaries happy.
sezeroz@964
  1260
+ *  WARNING: This function is there only to avoid runtime linking errors with
sezeroz@964
  1261
+ *  standalone mpg123 before version 1.23.0 (if you strangely update the
sezeroz@964
  1262
+ *  library but not the end-user program) and actually is broken
sezeroz@964
  1263
+ *  for various cases (p.ex. 24 bit output). Do never use. It might eventually
sezeroz@964
  1264
+ *  be purged from the library.
sezeroz@964
  1265
+ */
sezeroz@964
  1266
+MPG123_EXPORT int mpg123_position( mpg123_handle *mh, off_t frame_offset, off_t buffered_bytes, off_t *current_frame, off_t *frames_left, double *current_seconds, double *seconds_left);
sezeroz@964
  1267
+
sezeroz@964
  1268
+/*@}*/
sezeroz@964
  1269
+
sezeroz@964
  1270
+
sezeroz@964
  1271
+/** \defgroup mpg123_voleq mpg123 volume and equalizer
sezeroz@964
  1272
+ *
sezeroz@964
  1273
+ * @{
sezeroz@964
  1274
+ */
sezeroz@964
  1275
+
sezeroz@964
  1276
+/** another channel enumeration, for left/right choice */
sezeroz@964
  1277
+enum mpg123_channels
sezeroz@964
  1278
+{
sezeroz@964
  1279
+	 MPG123_LEFT=0x1	/**< The Left Channel. */
sezeroz@964
  1280
+	,MPG123_RIGHT=0x2	/**< The Right Channel. */
sezeroz@964
  1281
+	,MPG123_LR=0x3	/**< Both left and right channel; same as MPG123_LEFT|MPG123_RIGHT */
sezeroz@964
  1282
+};
sezeroz@964
  1283
+
sezeroz@964
  1284
+/** Set the 32 Band Audio Equalizer settings.
sezeroz@964
  1285
+ *  \param mh handle
sezeroz@964
  1286
+ *  \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for both.
sezeroz@964
  1287
+ *  \param band The equaliser band to change (from 0 to 31)
sezeroz@964
  1288
+ *  \param val The (linear) adjustment factor.
sezeroz@964
  1289
+ *  \return MPG123_OK on success
sezeroz@964
  1290
+ */
sezeroz@964
  1291
+MPG123_EXPORT int mpg123_eq( mpg123_handle *mh
sezeroz@964
  1292
+,	enum mpg123_channels channel, int band, double val );
sezeroz@964
  1293
+
sezeroz@964
  1294
+/** Get the 32 Band Audio Equalizer settings.
sezeroz@964
  1295
+ *  \param mh handle
sezeroz@964
  1296
+ *  \param channel Can be MPG123_LEFT, MPG123_RIGHT or MPG123_LEFT|MPG123_RIGHT for (arithmetic mean of) both.
sezeroz@964
  1297
+ *  \param band The equaliser band to change (from 0 to 31)
sezeroz@964
  1298
+ *  \return The (linear) adjustment factor (zero for pad parameters) */
sezeroz@964
  1299
+MPG123_EXPORT double mpg123_geteq(mpg123_handle *mh
sezeroz@964
  1300
+                                 , enum mpg123_channels channel, int band);
sezeroz@964
  1301
+
sezeroz@964
  1302
+/** Reset the 32 Band Audio Equalizer settings to flat
sezeroz@964
  1303
+ *  \param mh handle
sezeroz@964
  1304
+ *  \return MPG123_OK on success
sezeroz@964
  1305
+ */
sezeroz@964
  1306
+MPG123_EXPORT int mpg123_reset_eq(mpg123_handle *mh);
sezeroz@964
  1307
+
sezeroz@964
  1308
+/** Set the absolute output volume including the RVA setting, 
sezeroz@964
  1309
+ *  vol<0 just applies (a possibly changed) RVA setting.
sezeroz@964
  1310
+ *  \param mh handle
sezeroz@964
  1311
+ *  \param vol volume value (linear factor)
sezeroz@964
  1312
+ *  \return MPG123_OK on success
sezeroz@964
  1313
+ */
sezeroz@964
  1314
+MPG123_EXPORT int mpg123_volume(mpg123_handle *mh, double vol);
sezeroz@964
  1315
+
sezeroz@964
  1316
+/** Adjust output volume including the RVA setting by chosen amount
sezeroz@964
  1317
+ *  \param mh handle
sezeroz@964
  1318
+ *  \param change volume value (linear factor increment)
sezeroz@964
  1319
+ *  \return MPG123_OK on success
sezeroz@964
  1320
+ */
sezeroz@964
  1321
+MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
sezeroz@964
  1322
+
sezeroz@964
  1323
+/** Return current volume setting, the actual value due to RVA, and the RVA 
sezeroz@964
  1324
+ *  adjustment itself. It's all as double float value to abstract the sample 
sezeroz@964
  1325
+ *  format. The volume values are linear factors / amplitudes (not percent) 
sezeroz@964
  1326
+ *  and the RVA value is in decibels.
sezeroz@964
  1327
+ *  \param mh handle
sezeroz@964
  1328
+ *  \param base return address for base volume (linear factor)
sezeroz@964
  1329
+ *  \param really return address for actual volume (linear factor)
sezeroz@964
  1330
+ *  \param rva_db return address for RVA value (decibels)
sezeroz@964
  1331
+ *  \return MPG123_OK on success
sezeroz@964
  1332
+ */
sezeroz@964
  1333
+MPG123_EXPORT int mpg123_getvolume(mpg123_handle *mh, double *base, double *really, double *rva_db);
sezeroz@964
  1334
+
sezeroz@964
  1335
+/* TODO: Set some preamp in addition / to replace internal RVA handling? */
sezeroz@964
  1336
+
sezeroz@964
  1337
+/*@}*/
sezeroz@964
  1338
+
sezeroz@964
  1339
+
sezeroz@964
  1340
+/** \defgroup mpg123_status mpg123 status and information
sezeroz@964
  1341
+ *
sezeroz@964
  1342
+ * @{
sezeroz@964
  1343
+ */
sezeroz@964
  1344
+
sezeroz@964
  1345
+/** Enumeration of the mode types of Variable Bitrate */
sezeroz@964
  1346
+enum mpg123_vbr {
sezeroz@964
  1347
+	MPG123_CBR=0,	/**< Constant Bitrate Mode (default) */
sezeroz@964
  1348
+	MPG123_VBR,		/**< Variable Bitrate Mode */
sezeroz@964
  1349
+	MPG123_ABR		/**< Average Bitrate Mode */
sezeroz@964
  1350
+};
sezeroz@964
  1351
+
sezeroz@964
  1352
+/** Enumeration of the MPEG Versions */
sezeroz@964
  1353
+enum mpg123_version {
sezeroz@964
  1354
+	MPG123_1_0=0,	/**< MPEG Version 1.0 */
sezeroz@964
  1355
+	MPG123_2_0,		/**< MPEG Version 2.0 */
sezeroz@964
  1356
+	MPG123_2_5		/**< MPEG Version 2.5 */
sezeroz@964
  1357
+};
sezeroz@964
  1358
+
sezeroz@964
  1359
+
sezeroz@964
  1360
+/** Enumeration of the MPEG Audio mode.
sezeroz@964
  1361
+ *  Only the mono mode has 1 channel, the others have 2 channels. */
sezeroz@964
  1362
+enum mpg123_mode {
sezeroz@964
  1363
+	MPG123_M_STEREO=0,	/**< Standard Stereo. */
sezeroz@964
  1364
+	MPG123_M_JOINT,		/**< Joint Stereo. */
sezeroz@964
  1365
+	MPG123_M_DUAL,		/**< Dual Channel. */
sezeroz@964
  1366
+	MPG123_M_MONO		/**< Single Channel. */
sezeroz@964
  1367
+};
sezeroz@964
  1368
+
sezeroz@964
  1369
+
sezeroz@964
  1370
+/** Enumeration of the MPEG Audio flag bits */
sezeroz@964
  1371
+enum mpg123_flags {
sezeroz@964
  1372
+	MPG123_CRC=0x1,			/**< The bitstream is error protected using 16-bit CRC. */
sezeroz@964
  1373
+	MPG123_COPYRIGHT=0x2,	/**< The bitstream is copyrighted. */
sezeroz@964
  1374
+	MPG123_PRIVATE=0x4,		/**< The private bit has been set. */
sezeroz@964
  1375
+	MPG123_ORIGINAL=0x8	/**< The bitstream is an original, not a copy. */
sezeroz@964
  1376
+};
sezeroz@964
  1377
+
sezeroz@964
  1378
+/** Data structure for storing information about a frame of MPEG Audio */
sezeroz@964
  1379
+struct mpg123_frameinfo
sezeroz@964
  1380
+{
sezeroz@964
  1381
+	enum mpg123_version version;	/**< The MPEG version (1.0/2.0/2.5). */
sezeroz@964
  1382
+	int layer;						/**< The MPEG Audio Layer (MP1/MP2/MP3). */
sezeroz@964
  1383
+	long rate; 						/**< The sampling rate in Hz. */
sezeroz@964
  1384
+	enum mpg123_mode mode;			/**< The audio mode (Mono, Stereo, Joint-stero, Dual Channel). */
sezeroz@964
  1385
+	int mode_ext;					/**< The mode extension bit flag. */
sezeroz@964
  1386
+	int framesize;					/**< The size of the frame (in bytes, including header). */
sezeroz@964
  1387
+	enum mpg123_flags flags;		/**< MPEG Audio flag bits. Just now I realize that it should be declared as int, not enum. It's a bitwise combination of the enum values. */
sezeroz@964
  1388
+	int emphasis;					/**< The emphasis type. */
sezeroz@964
  1389
+	int bitrate;					/**< Bitrate of the frame (kbps). */
sezeroz@964
  1390
+	int abr_rate;					/**< The target average bitrate. */
sezeroz@964
  1391
+	enum mpg123_vbr vbr;			/**< The VBR mode. */
sezeroz@964
  1392
+};
sezeroz@964
  1393
+
sezeroz@964
  1394
+/** Get frame information about the MPEG audio bitstream and store it in a mpg123_frameinfo structure.
sezeroz@964
  1395
+ *  \param mh handle
sezeroz@964
  1396
+ *  \param mi address of existing frameinfo structure to write to
sezeroz@964
  1397
+ *  \return MPG123_OK on success
sezeroz@964
  1398
+ */
sezeroz@964
  1399
+MPG123_EXPORT int mpg123_info(mpg123_handle *mh, struct mpg123_frameinfo *mi);
sezeroz@964
  1400
+
sezeroz@964
  1401
+/** Get the safe output buffer size for all cases
sezeroz@964
  1402
+ *  (when you want to replace the internal buffer)
sezeroz@964
  1403
+ *  \return safe buffer size
sezeroz@964
  1404
+ */
sezeroz@964
  1405
+MPG123_EXPORT size_t mpg123_safe_buffer(void);
sezeroz@964
  1406
+
sezeroz@964
  1407
+/** Make a full parsing scan of each frame in the file. ID3 tags are found. An
sezeroz@964
  1408
+ *  accurate length value is stored. Seek index will be filled. A seek back to
sezeroz@964
  1409
+ *  current position is performed. At all, this function refuses work when
sezeroz@964
  1410
+ *  stream is not seekable.
sezeroz@964
  1411
+ *  \param mh handle
sezeroz@964
  1412
+ *  \return MPG123_OK on success
sezeroz@964
  1413
+ */
sezeroz@964
  1414
+MPG123_EXPORT int mpg123_scan(mpg123_handle *mh);
sezeroz@964
  1415
+
sezeroz@964
  1416
+/** Return, if possible, the full (expected) length of current track in frames.
sezeroz@964
  1417
+ * \param mh handle
sezeroz@964
  1418
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
sezeroz@964
  1419
+ */
sezeroz@964
  1420
+MPG123_EXPORT off_t mpg123_framelength(mpg123_handle *mh);
sezeroz@964
  1421
+
sezeroz@964
  1422
+/** Return, if possible, the full (expected) length of current track in samples.
sezeroz@964
  1423
+ * \param mh handle
sezeroz@964
  1424
+ * \return length >= 0 or MPG123_ERR if there is no length guess possible.
sezeroz@964
  1425
+ */
sezeroz@964
  1426
+MPG123_EXPORT off_t mpg123_length(mpg123_handle *mh);
sezeroz@964
  1427
+
sezeroz@964
  1428
+/** Override the value for file size in bytes.
sezeroz@964
  1429
+ *  Useful for getting sensible track length values in feed mode or for HTTP streams.
sezeroz@964
  1430
+ *  \param mh handle
sezeroz@964
  1431
+ *  \param size file size in bytes
sezeroz@964
  1432
+ *  \return MPG123_OK on success
sezeroz@964
  1433
+ */
sezeroz@964
  1434
+MPG123_EXPORT int mpg123_set_filesize(mpg123_handle *mh, off_t size);
sezeroz@964
  1435
+
sezeroz@964
  1436
+/** Get MPEG frame duration in seconds.
sezeroz@964
  1437
+ *  \param mh handle
sezeroz@964
  1438
+ *  \return frame duration in seconds, <0 on error
sezeroz@964
  1439
+ */
sezeroz@964
  1440
+MPG123_EXPORT double mpg123_tpf(mpg123_handle *mh);
sezeroz@964
  1441
+
sezeroz@964
  1442
+/** Get MPEG frame duration in samples.
sezeroz@964
  1443
+ *  \param mh handle
sezeroz@964
  1444
+ *  \return samples per frame for the most recently parsed frame; <0 on errors
sezeroz@964
  1445
+ */
sezeroz@964
  1446
+MPG123_EXPORT int mpg123_spf(mpg123_handle *mh);
sezeroz@964
  1447
+
sezeroz@964
  1448
+/** Get and reset the clip count.
sezeroz@964
  1449
+ *  \param mh handle
sezeroz@964
  1450
+ *  \return count of clipped samples
sezeroz@964
  1451
+ */
sezeroz@964
  1452
+MPG123_EXPORT long mpg123_clip(mpg123_handle *mh);
sezeroz@964
  1453
+
sezeroz@964
  1454
+
sezeroz@964
  1455
+/** The key values for state information from mpg123_getstate(). */
sezeroz@964
  1456
+enum mpg123_state
sezeroz@964
  1457
+{
sezeroz@964
  1458
+	 MPG123_ACCURATE = 1 /**< Query if positons are currently accurate (integer value, 0 if false, 1 if true). */
sezeroz@964
  1459
+	,MPG123_BUFFERFILL   /**< Get fill of internal (feed) input buffer as integer byte count returned as long and as double. An error is returned on integer overflow while converting to (signed) long, but the returned floating point value shold still be fine. */
sezeroz@964
  1460
+	,MPG123_FRANKENSTEIN /**< Stream consists of carelessly stitched together files. Seeking may yield unexpected results (also with MPG123_ACCURATE, it may be confused). */
sezeroz@964
  1461
+	,MPG123_FRESH_DECODER /**< Decoder structure has been updated, possibly indicating changed stream (integer value, 0 if false, 1 if true). Flag is cleared after retrieval. */
sezeroz@964
  1462
+};
sezeroz@964
  1463
+
sezeroz@964
  1464
+/** Get various current decoder/stream state information.
sezeroz@964
  1465
+ *  \param mh handle
sezeroz@964
  1466
+ *  \param key the key to identify the information to give.
sezeroz@964
  1467
+ *  \param val the address to return (long) integer values to
sezeroz@964
  1468
+ *  \param fval the address to return floating point values to
sezeroz@964
  1469
+ *  \return MPG123_OK on success
sezeroz@964
  1470
+ */
sezeroz@964
  1471
+MPG123_EXPORT int mpg123_getstate( mpg123_handle *mh
sezeroz@964
  1472
+,	enum mpg123_state key, long *val, double *fval );
sezeroz@964
  1473
+
sezeroz@964
  1474
+/*@}*/
sezeroz@964
  1475
+
sezeroz@964
  1476
+
sezeroz@964
  1477
+/** \defgroup mpg123_metadata mpg123 metadata handling
sezeroz@964
  1478
+ *
sezeroz@964
  1479
+ * Functions to retrieve the metadata from MPEG Audio files and streams.
sezeroz@964
  1480
+ * Also includes string handling functions.
sezeroz@964
  1481
+ *
sezeroz@964
  1482
+ * @{
sezeroz@964
  1483
+ */
sezeroz@964
  1484
+
sezeroz@964
  1485
+/** Data structure for storing strings in a safer way than a standard C-String.
sezeroz@964
  1486
+ *  Can also hold a number of null-terminated strings. */
sezeroz@964
  1487
+typedef struct 
sezeroz@964
  1488
+{
sezeroz@964
  1489
+	char* p;     /**< pointer to the string data */
sezeroz@964
  1490
+	size_t size; /**< raw number of bytes allocated */
sezeroz@964
  1491
+	size_t fill; /**< number of used bytes (including closing zero byte) */
sezeroz@964
  1492
+} mpg123_string;
sezeroz@964
  1493
+
sezeroz@964
  1494
+/** Create and allocate memory for a new mpg123_string
sezeroz@964
  1495
+ *  \param sb string handle (address of existing structure on your side)
sezeroz@964
  1496
+ */
sezeroz@964
  1497
+MPG123_EXPORT void mpg123_init_string(mpg123_string* sb);
sezeroz@964
  1498
+
sezeroz@964
  1499
+/** Free-up mempory for an existing mpg123_string
sezeroz@964
  1500
+ *  \param sb string handle
sezeroz@964
  1501
+ */
sezeroz@964
  1502
+MPG123_EXPORT void mpg123_free_string(mpg123_string* sb);
sezeroz@964
  1503
+
sezeroz@964
  1504
+/** Change the size of a mpg123_string
sezeroz@964
  1505
+ *  \param sb string handle
sezeroz@964
  1506
+ *  \param news new size in bytes
sezeroz@964
  1507
+ *  \return 0 on error, 1 on success
sezeroz@964
  1508
+ */
sezeroz@964
  1509
+MPG123_EXPORT int mpg123_resize_string(mpg123_string* sb, size_t news);
sezeroz@964
  1510
+
sezeroz@964
  1511
+/** Increase size of a mpg123_string if necessary (it may stay larger).
sezeroz@964
  1512
+ *  Note that the functions for adding and setting in current libmpg123
sezeroz@964
  1513
+ *  use this instead of mpg123_resize_string().
sezeroz@964
  1514
+ *  That way, you can preallocate memory and safely work afterwards with
sezeroz@964
  1515
+ *  pieces.
sezeroz@964
  1516
+ *  \param sb string handle
sezeroz@964
  1517
+ *  \param news new minimum size
sezeroz@964
  1518
+ *  \return 0 on error, 1 on success
sezeroz@964
  1519
+ */
sezeroz@964
  1520
+MPG123_EXPORT int mpg123_grow_string(mpg123_string* sb, size_t news);
sezeroz@964
  1521
+
sezeroz@964
  1522
+/** Copy the contents of one mpg123_string string to another.
sezeroz@964
  1523
+ *  Yes the order of arguments is reversed compated to memcpy().
sezeroz@964
  1524
+ *  \param from string handle
sezeroz@964
  1525
+ *  \param to string handle
sezeroz@964
  1526
+ *  \return 0 on error, 1 on success
sezeroz@964
  1527
+ */
sezeroz@964
  1528
+MPG123_EXPORT int mpg123_copy_string(mpg123_string* from, mpg123_string* to);
sezeroz@964
  1529
+
sezeroz@964
  1530
+/** Append a C-String to an mpg123_string
sezeroz@964
  1531
+ *  \param sb string handle
sezeroz@964
  1532
+ *  \param stuff to append
sezeroz@964
  1533
+ *  \return 0 on error, 1 on success
sezeroz@964
  1534
+ */
sezeroz@964
  1535
+MPG123_EXPORT int mpg123_add_string(mpg123_string* sb, const char* stuff);
sezeroz@964
  1536
+
sezeroz@964
  1537
+/** Append a C-substring to an mpg123 string
sezeroz@964
  1538
+ *  \param sb string handle
sezeroz@964
  1539
+ *  \param stuff content to copy
sezeroz@964
  1540
+ *  \param from offset to copy from
sezeroz@964
  1541
+ *  \param count number of characters to copy (a null-byte is always appended)
sezeroz@964
  1542
+ *  \return 0 on error, 1 on success
sezeroz@964
  1543
+ */
sezeroz@964
  1544
+MPG123_EXPORT int mpg123_add_substring( mpg123_string *sb
sezeroz@964
  1545
+,	const char *stuff, size_t from, size_t count );
sezeroz@964
  1546
+
sezeroz@964
  1547
+/** Set the content of a mpg123_string to a C-string
sezeroz@964
  1548
+ *  \param sb string handle
sezeroz@964
  1549
+ *  \param stuff content to copy
sezeroz@964
  1550
+ *  \return 0 on error, 1 on success
sezeroz@964
  1551
+ */
sezeroz@964
  1552
+MPG123_EXPORT int mpg123_set_string(mpg123_string* sb, const char* stuff);
sezeroz@964
  1553
+
sezeroz@964
  1554
+/** Set the content of a mpg123_string to a C-substring
sezeroz@964
  1555
+ *  \param sb string handle
sezeroz@964
  1556
+ *  \param stuff the future content
sezeroz@964
  1557
+ *  \param from offset to copy from
sezeroz@964
  1558
+ *  \param count number of characters to copy (a null-byte is always appended)
sezeroz@964
  1559
+ *  \return 0 on error, 1 on success
sezeroz@964
  1560
+ */
sezeroz@964
  1561
+MPG123_EXPORT int mpg123_set_substring( mpg123_string *sb
sezeroz@964
  1562
+,	const char *stuff, size_t from, size_t count );
sezeroz@964
  1563
+
sezeroz@964
  1564
+/** Count characters in a mpg123 string (non-null bytes or UTF-8 characters).
sezeroz@964
  1565
+ *  Even with the fill property, the character count is not obvious as there could be multiple trailing null bytes.
sezeroz@964
  1566
+ *  \param sb string handle
sezeroz@964
  1567
+ *  \param utf8 a flag to tell if the string is in utf8 encoding
sezeroz@964
  1568
+ *  \return character count
sezeroz@964
  1569
+*/
sezeroz@964
  1570
+MPG123_EXPORT size_t mpg123_strlen(mpg123_string *sb, int utf8);
sezeroz@964
  1571
+
sezeroz@964
  1572
+/** Remove trailing \\r and \\n, if present.
sezeroz@964
  1573
+ *  \param sb string handle
sezeroz@964
  1574
+ *  \return 0 on error, 1 on success
sezeroz@964
  1575
+ */
sezeroz@964
  1576
+MPG123_EXPORT int mpg123_chomp_string(mpg123_string *sb);
sezeroz@964
  1577
+
sezeroz@964
  1578
+/** The mpg123 text encodings. This contains encodings we encounter in ID3 tags or ICY meta info. */
sezeroz@964
  1579
+enum mpg123_text_encoding
sezeroz@964
  1580
+{
sezeroz@964
  1581
+	 mpg123_text_unknown  = 0 /**< Unkown encoding... mpg123_id3_encoding can return that on invalid codes. */
sezeroz@964
  1582
+	,mpg123_text_utf8     = 1 /**< UTF-8 */
sezeroz@964
  1583
+	,mpg123_text_latin1   = 2 /**< ISO-8859-1. Note that sometimes latin1 in ID3 is abused for totally different encodings. */
sezeroz@964
  1584
+	,mpg123_text_icy      = 3 /**< ICY metadata encoding, usually CP-1252 but we take it as UTF-8 if it qualifies as such. */
sezeroz@964
  1585
+	,mpg123_text_cp1252   = 4 /**< Really CP-1252 without any guessing. */
sezeroz@964
  1586
+	,mpg123_text_utf16    = 5 /**< Some UTF-16 encoding. The last of a set of leading BOMs (byte order mark) rules.
sezeroz@964
  1587
+	                           *   When there is no BOM, big endian ordering is used. Note that UCS-2 qualifies as UTF-8 when
sezeroz@964
  1588
+	                           *   you don't mess with the reserved code points. If you want to decode little endian data
sezeroz@964
  1589
+	                           *   without BOM you need to prepend 0xff 0xfe yourself. */
sezeroz@964
  1590
+	,mpg123_text_utf16bom = 6 /**< Just an alias for UTF-16, ID3v2 has this as distinct code. */
sezeroz@964
  1591
+	,mpg123_text_utf16be  = 7 /**< Another alias for UTF16 from ID3v2. Note, that, because of the mess that is reality,
sezeroz@964
  1592
+	                           *   BOMs are used if encountered. There really is not much distinction between the UTF16 types for mpg123
sezeroz@964
  1593
+	                           *   One exception: Since this is seen in ID3v2 tags, leading null bytes are skipped for all other UTF16
sezeroz@964
  1594
+	                           *   types (we expect a BOM before real data there), not so for utf16be!*/
sezeroz@964
  1595
+	,mpg123_text_max      = 7 /**< Placeholder for the maximum encoding value. */
sezeroz@964
  1596
+};
sezeroz@964
  1597
+
sezeroz@964
  1598
+/** The encoding byte values from ID3v2. */
sezeroz@964
  1599
+enum mpg123_id3_enc
sezeroz@964
  1600
+{
sezeroz@964
  1601
+	 mpg123_id3_latin1   = 0 /**< Note: This sometimes can mean anything in practice... */
sezeroz@964
  1602
+	,mpg123_id3_utf16bom = 1 /**< UTF16, UCS-2 ... it's all the same for practical purposes. */
sezeroz@964
  1603
+	,mpg123_id3_utf16be  = 2 /**< Big-endian UTF-16, BOM see note for mpg123_text_utf16be. */
sezeroz@964
  1604
+	,mpg123_id3_utf8     = 3 /**< Our lovely overly ASCII-compatible 8 byte encoding for the world. */
sezeroz@964
  1605
+	,mpg123_id3_enc_max  = 3 /**< Placeholder to check valid range of encoding byte. */
sezeroz@964
  1606
+};
sezeroz@964
  1607
+
sezeroz@964
  1608
+/** Convert ID3 encoding byte to mpg123 encoding index.
sezeroz@964
  1609
+ *  \param id3_enc_byte the ID3 encoding code
sezeroz@964
  1610
+ *  \return the mpg123 encoding index
sezeroz@964
  1611
+ */
sezeroz@964
  1612
+
sezeroz@964
  1613
+MPG123_EXPORT enum mpg123_text_encoding mpg123_enc_from_id3(unsigned char id3_enc_byte);
sezeroz@964
  1614
+
sezeroz@964
  1615
+/** Store text data in string, after converting to UTF-8 from indicated encoding
sezeroz@964
  1616
+ *  A prominent error can be that you provided an unknown encoding value, or this build of libmpg123 lacks support for certain encodings (ID3 or ICY stuff missing).
sezeroz@964
  1617
+ *  Also, you might want to take a bit of care with preparing the data; for example, strip leading zeroes (I have seen that).
sezeroz@964
  1618
+ *  \param sb  target string
sezeroz@964
  1619
+ *  \param enc mpg123 text encoding value
sezeroz@964
  1620
+ *  \param source source buffer with plain unsigned bytes (you might need to cast from signed char)
sezeroz@964
  1621
+ *  \param source_size number of bytes in the source buffer
sezeroz@964
  1622
+ *  \return 0 on error, 1 on success (on error, mpg123_free_string is called on sb)
sezeroz@964
  1623
+ */
sezeroz@964
  1624
+MPG123_EXPORT int mpg123_store_utf8(mpg123_string *sb, enum mpg123_text_encoding enc, const unsigned char *source, size_t source_size);
sezeroz@964
  1625
+
sezeroz@964
  1626
+/** Sub data structure for ID3v2, for storing various text fields (including comments).
sezeroz@964
  1627
+ *  This is for ID3v2 COMM, TXXX and all the other text fields.
sezeroz@964
  1628
+ *  Only COMM and TXXX have a description, only COMM and USLT have a language.
sezeroz@964
  1629
+ *  You should consult the ID3v2 specification for the use of the various text fields ("frames" in ID3v2 documentation, I use "fields" here to separate from MPEG frames). */
sezeroz@964
  1630
+typedef struct
sezeroz@964
  1631
+{
sezeroz@964
  1632
+	char lang[3]; /**< Three-letter language code (not terminated). */
sezeroz@964
  1633
+	char id[4];   /**< The ID3v2 text field id, like TALB, TPE2, ... (4 characters, no string termination). */
sezeroz@964
  1634
+	mpg123_string description; /**< Empty for the generic comment... */
sezeroz@964
  1635
+	mpg123_string text;        /**< ... */
sezeroz@964
  1636
+} mpg123_text;
sezeroz@964
  1637
+
sezeroz@964
  1638
+/** The picture type values from ID3v2. */
sezeroz@964
  1639
+enum mpg123_id3_pic_type
sezeroz@964
  1640
+{
sezeroz@964
  1641
+	 mpg123_id3_pic_other          =  0 /**< see ID3v2 docs */
sezeroz@964
  1642
+	,mpg123_id3_pic_icon           =  1 /**< see ID3v2 docs */
sezeroz@964
  1643
+	,mpg123_id3_pic_other_icon     =  2 /**< see ID3v2 docs */
sezeroz@964
  1644
+	,mpg123_id3_pic_front_cover    =  3 /**< see ID3v2 docs */
sezeroz@964
  1645
+	,mpg123_id3_pic_back_cover     =  4 /**< see ID3v2 docs */
sezeroz@964
  1646
+	,mpg123_id3_pic_leaflet        =  5 /**< see ID3v2 docs */
sezeroz@964
  1647
+	,mpg123_id3_pic_media          =  6 /**< see ID3v2 docs */
sezeroz@964
  1648
+	,mpg123_id3_pic_lead           =  7 /**< see ID3v2 docs */
sezeroz@964
  1649
+	,mpg123_id3_pic_artist         =  8 /**< see ID3v2 docs */
sezeroz@964
  1650
+	,mpg123_id3_pic_conductor      =  9 /**< see ID3v2 docs */
sezeroz@964
  1651
+	,mpg123_id3_pic_orchestra      = 10 /**< see ID3v2 docs */
sezeroz@964
  1652
+	,mpg123_id3_pic_composer       = 11 /**< see ID3v2 docs */
sezeroz@964
  1653
+	,mpg123_id3_pic_lyricist       = 12 /**< see ID3v2 docs */
sezeroz@964
  1654
+	,mpg123_id3_pic_location       = 13 /**< see ID3v2 docs */
sezeroz@964
  1655
+	,mpg123_id3_pic_recording      = 14 /**< see ID3v2 docs */
sezeroz@964
  1656
+	,mpg123_id3_pic_performance    = 15 /**< see ID3v2 docs */
sezeroz@964
  1657
+	,mpg123_id3_pic_video          = 16 /**< see ID3v2 docs */
sezeroz@964
  1658
+	,mpg123_id3_pic_fish           = 17 /**< see ID3v2 docs */
sezeroz@964
  1659
+	,mpg123_id3_pic_illustration   = 18 /**< see ID3v2 docs */
sezeroz@964
  1660
+	,mpg123_id3_pic_artist_logo    = 19 /**< see ID3v2 docs */
sezeroz@964
  1661
+	,mpg123_id3_pic_publisher_logo = 20 /**< see ID3v2 docs */
sezeroz@964
  1662
+};
sezeroz@964
  1663
+
sezeroz@964
  1664
+/** Sub data structure for ID3v2, for storing picture data including comment.
sezeroz@964
  1665
+ *  This is for the ID3v2 APIC field. You should consult the ID3v2 specification
sezeroz@964
  1666
+ *  for the use of the APIC field ("frames" in ID3v2 documentation, I use "fields"
sezeroz@964
  1667
+ *  here to separate from MPEG frames). */
sezeroz@964
  1668
+typedef struct
sezeroz@964
  1669
+{
sezeroz@964
  1670
+	char type;                 /**< mpg123_id3_pic_type value */
sezeroz@964
  1671
+	mpg123_string description; /**< description string */
sezeroz@964
  1672
+	mpg123_string mime_type;   /**< MIME type */
sezeroz@964
  1673
+	size_t size;               /**< size in bytes */
sezeroz@964
  1674
+	unsigned char* data;       /**< pointer to the image data */
sezeroz@964
  1675
+} mpg123_picture;
sezeroz@964
  1676
+
sezeroz@964
  1677
+/** Data structure for storing IDV3v2 tags.
sezeroz@964
  1678
+ *  This structure is not a direct binary mapping with the file contents.
sezeroz@964
  1679
+ *  The ID3v2 text frames are allowed to contain multiple strings.
sezeroz@964
  1680
+ *  So check for null bytes until you reach the mpg123_string fill.
sezeroz@964
  1681
+ *  All text is encoded in UTF-8. */
sezeroz@964
  1682
+typedef struct
sezeroz@964
  1683
+{
sezeroz@964
  1684
+	unsigned char version; /**< 3 or 4 for ID3v2.3 or ID3v2.4. */
sezeroz@964
  1685
+	mpg123_string *title;   /**< Title string (pointer into text_list). */
sezeroz@964
  1686
+	mpg123_string *artist;  /**< Artist string (pointer into text_list). */
sezeroz@964
  1687
+	mpg123_string *album;   /**< Album string (pointer into text_list). */
sezeroz@964
  1688
+	mpg123_string *year;    /**< The year as a string (pointer into text_list). */
sezeroz@964
  1689
+	mpg123_string *genre;   /**< Genre String (pointer into text_list). The genre string(s) may very well need postprocessing, esp. for ID3v2.3. */
sezeroz@964
  1690
+	mpg123_string *comment; /**< Pointer to last encountered comment text with empty description. */
sezeroz@964
  1691
+	/* Encountered ID3v2 fields are appended to these lists.
sezeroz@964
  1692
+	   There can be multiple occurences, the pointers above always point to the last encountered data. */
sezeroz@964
  1693
+	mpg123_text    *comment_list; /**< Array of comments. */
sezeroz@964
  1694
+	size_t          comments;     /**< Number of comments. */
sezeroz@964
  1695
+	mpg123_text    *text;         /**< Array of ID3v2 text fields (including USLT) */
sezeroz@964
  1696
+	size_t          texts;        /**< Numer of text fields. */
sezeroz@964
  1697
+	mpg123_text    *extra;        /**< The array of extra (TXXX) fields. */
sezeroz@964
  1698
+	size_t          extras;       /**< Number of extra text (TXXX) fields. */
sezeroz@964
  1699
+	mpg123_picture  *picture;     /**< Array of ID3v2 pictures fields (APIC). */
sezeroz@964
  1700
+	size_t           pictures;    /**< Number of picture (APIC) fields. */
sezeroz@964
  1701
+} mpg123_id3v2;
sezeroz@964
  1702
+
sezeroz@964
  1703
+/** Data structure for ID3v1 tags (the last 128 bytes of a file).
sezeroz@964
  1704
+ *  Don't take anything for granted (like string termination)!
sezeroz@964
  1705
+ *  Also note the change ID3v1.1 did: comment[28] = 0; comment[29] = track_number
sezeroz@964
  1706
+ *  It is your task to support ID3v1 only or ID3v1.1 ...*/
sezeroz@964
  1707
+typedef struct
sezeroz@964
  1708
+{
sezeroz@964
  1709
+	char tag[3];         /**< Always the string "TAG", the classic intro. */
sezeroz@964
  1710
+	char title[30];      /**< Title string.  */
sezeroz@964
  1711
+	char artist[30];     /**< Artist string. */
sezeroz@964
  1712
+	char album[30];      /**< Album string. */
sezeroz@964
  1713
+	char year[4];        /**< Year string. */
sezeroz@964
  1714
+	char comment[30];    /**< Comment string. */
sezeroz@964
  1715
+	unsigned char genre; /**< Genre index. */
sezeroz@964
  1716
+} mpg123_id3v1;
sezeroz@964
  1717
+
sezeroz@964
  1718
+#define MPG123_ID3     0x3 /**< 0011 There is some ID3 info. Also matches 0010 or NEW_ID3. */
sezeroz@964
  1719
+#define MPG123_NEW_ID3 0x1 /**< 0001 There is ID3 info that changed since last call to mpg123_id3. */
sezeroz@964
  1720
+#define MPG123_ICY     0xc /**< 1100 There is some ICY info. Also matches 0100 or NEW_ICY.*/
sezeroz@964
  1721
+#define MPG123_NEW_ICY 0x4 /**< 0100 There is ICY info that changed since last call to mpg123_icy. */
sezeroz@964
  1722
+
sezeroz@964
  1723
+/** Query if there is (new) meta info, be it ID3 or ICY (or something new in future).
sezeroz@964
  1724
+ *  \param mh handle
sezeroz@964
  1725
+ *  \return combination of flags, 0 on error (same as "nothing new")
sezeroz@964
  1726
+ */
sezeroz@964
  1727
+MPG123_EXPORT int mpg123_meta_check(mpg123_handle *mh);
sezeroz@964
  1728
+
sezeroz@964
  1729
+/** Clean up meta data storage (ID3v2 and ICY), freeing memory.
sezeroz@964
  1730
+ *  \param mh handle
sezeroz@964
  1731
+ */
sezeroz@964
  1732
+MPG123_EXPORT void mpg123_meta_free(mpg123_handle *mh);
sezeroz@964
  1733
+
sezeroz@964
  1734
+/** Point v1 and v2 to existing data structures wich may change on any next read/decode function call.
sezeroz@964
  1735
+ *  v1 and/or v2 can be set to NULL when there is no corresponding data.
sezeroz@964
  1736
+ *  \return MPG123_OK on success
sezeroz@964
  1737
+ */
sezeroz@964
  1738
+MPG123_EXPORT int mpg123_id3( mpg123_handle *mh
sezeroz@964
  1739
+,	mpg123_id3v1 **v1, mpg123_id3v2 **v2 );
sezeroz@964
  1740
+
sezeroz@964
  1741
+/** Point icy_meta to existing data structure wich may change on any next read/decode function call.
sezeroz@964
  1742
+ *  \param mh handle
sezeroz@964
  1743
+ *  \param icy_meta return address for ICY meta string (set to NULL if nothing there)
sezeroz@964
  1744
+ *  \return MPG123_OK on success
sezeroz@964
  1745
+ */
sezeroz@964
  1746
+MPG123_EXPORT int mpg123_icy(mpg123_handle *mh, char **icy_meta);
sezeroz@964
  1747
+
sezeroz@964
  1748
+/** Decode from windows-1252 (the encoding ICY metainfo used) to UTF-8.
sezeroz@964
  1749
+ *  Note that this is very similar to mpg123_store_utf8(&sb, mpg123_text_icy, icy_text, strlen(icy_text+1)) .
sezeroz@964
  1750
+ *  \param icy_text The input data in ICY encoding
sezeroz@964
  1751
+ *  \return pointer to newly allocated buffer with UTF-8 data (You free() it!) */
sezeroz@964
  1752
+MPG123_EXPORT char* mpg123_icy2utf8(const char* icy_text);
sezeroz@964
  1753
+
sezeroz@964
  1754
+
sezeroz@964
  1755
+/* @} */
sezeroz@964
  1756
+
sezeroz@964
  1757
+
sezeroz@964
  1758
+/** \defgroup mpg123_advpar mpg123 advanced parameter API
sezeroz@964
  1759
+ *
sezeroz@964
  1760
+ *  Direct access to a parameter set without full handle around it.
sezeroz@964
  1761
+ *	Possible uses:
sezeroz@964
  1762
+ *    - Influence behaviour of library _during_ initialization of handle (MPG123_VERBOSE).
sezeroz@964
  1763
+ *    - Use one set of parameters for multiple handles.
sezeroz@964
  1764
+ *
sezeroz@964
  1765
+ *	The functions for handling mpg123_pars (mpg123_par() and mpg123_fmt() 
sezeroz@964
  1766
+ *  family) directly return a fully qualified mpg123 error code, the ones 
sezeroz@964
  1767
+ *  operating on full handles normally MPG123_OK or MPG123_ERR, storing the 
sezeroz@964
  1768
+ *  specific error code itseld inside the handle. 
sezeroz@964
  1769
+ *
sezeroz@964
  1770
+ * @{
sezeroz@964
  1771
+ */
sezeroz@964
  1772
+
sezeroz@964
  1773
+/** Opaque structure for the libmpg123 decoder parameters. */
sezeroz@964
  1774
+struct mpg123_pars_struct;
sezeroz@964
  1775
+
sezeroz@964
  1776
+/** Opaque structure for the libmpg123 decoder parameters. */
sezeroz@964
  1777
+typedef struct mpg123_pars_struct   mpg123_pars;
sezeroz@964
  1778
+
sezeroz@964
  1779
+/** Create a handle with preset parameters.
sezeroz@964
  1780
+ *  \param mp parameter handle
sezeroz@964
  1781
+ *  \param decoder decoder choice
sezeroz@964
  1782
+ *  \param error error code return address
sezeroz@964
  1783
+ *  \return mpg123 handle
sezeroz@964
  1784
+ */
sezeroz@964
  1785
+MPG123_EXPORT mpg123_handle *mpg123_parnew( mpg123_pars *mp
sezeroz@964
  1786
+,	const char* decoder, int *error );
sezeroz@964
  1787
+
sezeroz@964
  1788
+/** Allocate memory for and return a pointer to a new mpg123_pars
sezeroz@964
  1789
+ *  \param error error code return address
sezeroz@964
  1790
+ *  \return new parameter handle
sezeroz@964
  1791
+ */
sezeroz@964
  1792
+MPG123_EXPORT mpg123_pars *mpg123_new_pars(int *error);
sezeroz@964
  1793
+
sezeroz@964
  1794
+/** Delete and free up memory used by a mpg123_pars data structure
sezeroz@964
  1795
+ *  \param mp parameter handle
sezeroz@964
  1796
+ */
sezeroz@964
  1797
+MPG123_EXPORT void mpg123_delete_pars(mpg123_pars* mp);
sezeroz@964
  1798
+
sezeroz@964
  1799
+/** Configure mpg123 parameters to accept no output format at all, 
sezeroz@964
  1800
+ *  use before specifying supported formats with mpg123_format
sezeroz@964
  1801
+ *  \param mp parameter handle
sezeroz@964
  1802
+ *  \return MPG123_OK on success
sezeroz@964
  1803
+ */
sezeroz@964
  1804
+MPG123_EXPORT int mpg123_fmt_none(mpg123_pars *mp);
sezeroz@964
  1805
+
sezeroz@964
  1806
+/** Configure mpg123 parameters to accept all formats 
sezeroz@964
  1807
+ *  (also any custom rate you may set) -- this is default. 
sezeroz@964
  1808
+ *  \param mp parameter handle
sezeroz@964
  1809
+ *  \return MPG123_OK on success
sezeroz@964
  1810
+ */
sezeroz@964
  1811
+MPG123_EXPORT int mpg123_fmt_all(mpg123_pars *mp);
sezeroz@964
  1812
+
sezeroz@964
  1813
+/** Set the audio format support of a mpg123_pars in detail:
sezeroz@964
  1814
+ * \param mp parameter handle
sezeroz@964
  1815
+ * \param rate The sample rate value (in Hertz).
sezeroz@964
  1816
+ * \param channels A combination of MPG123_STEREO and MPG123_MONO.
sezeroz@964
  1817
+ * \param encodings A combination of accepted encodings for rate and channels,
sezeroz@964
  1818
+ *                  p.ex MPG123_ENC_SIGNED16|MPG123_ENC_ULAW_8 (or 0 for no
sezeroz@964
  1819
+ *                  support).
sezeroz@964
  1820
+ * \return MPG123_OK on success
sezeroz@964
  1821
+*/
sezeroz@964
  1822
+MPG123_EXPORT int mpg123_fmt(mpg123_pars *mp
sezeroz@964
  1823
+,	long rate, int channels, int encodings);
sezeroz@964
  1824
+
sezeroz@964
  1825
+/** Check to see if a specific format at a specific rate is supported
sezeroz@964
  1826
+ *  by mpg123_pars.
sezeroz@964
  1827
+ *  \param mp parameter handle
sezeroz@964
  1828
+ *  \param rate sampling rate
sezeroz@964
  1829
+ *  \param encoding encoding
sezeroz@964
  1830
+ *  \return 0 for no support (that includes invalid parameters), MPG123_STEREO, 
sezeroz@964
  1831
+ *          MPG123_MONO or MPG123_STEREO|MPG123_MONO. */
sezeroz@964
  1832
+MPG123_EXPORT int mpg123_fmt_support(mpg123_pars *mp, long rate, int encoding);
sezeroz@964
  1833
+
sezeroz@964
  1834
+/** Set a specific parameter, for a specific mpg123_pars, using a parameter 
sezeroz@964
  1835
+ *  type key chosen from the mpg123_parms enumeration, to the specified value.
sezeroz@964
  1836
+ *  \param mp parameter handle
sezeroz@964
  1837
+ *  \param type parameter choice
sezeroz@964
  1838
+ *  \param value integer value
sezeroz@964
  1839
+ *  \param fvalue floating point value
sezeroz@964
  1840
+ *  \return MPG123_OK on success
sezeroz@964
  1841
+ */
sezeroz@964
  1842
+MPG123_EXPORT int mpg123_par( mpg123_pars *mp
sezeroz@964
  1843
+,	enum mpg123_parms type, long value, double fvalue );
sezeroz@964
  1844
+
sezeroz@964
  1845
+/** Get a specific parameter, for a specific mpg123_pars. 
sezeroz@964
  1846
+ *  See the mpg123_parms enumeration for a list of available parameters.
sezeroz@964
  1847
+ *  \param mp parameter handle
sezeroz@964
  1848
+ *  \param type parameter choice
sezeroz@964
  1849
+ *  \param value integer value return address
sezeroz@964
  1850
+ *  \param fvalue floating point value return address
sezeroz@964
  1851
+ *  \return MPG123_OK on success
sezeroz@964
  1852
+ */
sezeroz@964
  1853
+MPG123_EXPORT int mpg123_getpar( mpg123_pars *mp
sezeroz@964
  1854
+,	enum mpg123_parms type, long *value, double *fvalue);
sezeroz@964
  1855
+
sezeroz@964
  1856
+/* @} */
sezeroz@964
  1857
+
sezeroz@964
  1858
+
sezeroz@964
  1859
+/** \defgroup mpg123_lowio mpg123 low level I/O
sezeroz@964
  1860
+  * You may want to do tricky stuff with I/O that does not work with mpg123's default file access or you want to make it decode into your own pocket...
sezeroz@964
  1861
+  *
sezeroz@964
  1862
+  * @{ */
sezeroz@964
  1863
+
sezeroz@964
  1864
+/** Replace default internal buffer with user-supplied buffer.
sezeroz@964
  1865
+  * Instead of working on it's own private buffer, mpg123 will directly use the one you provide for storing decoded audio.
sezeroz@964
  1866
+  * Note that the required buffer size could be bigger than expected from output
sezeroz@964
  1867
+  * encoding if libmpg123 has to convert from primary decoder output (p.ex. 32 bit
sezeroz@964
  1868
+  * storage for 24 bit output).
sezeroz@964
  1869
+  * \param mh handle
sezeroz@964
  1870
+  * \param data pointer to user buffer
sezeroz@964
  1871
+  * \param size of buffer in bytes
sezeroz@964
  1872
+  * \return MPG123_OK on success
sezeroz@964
  1873
+  */
sezeroz@964
  1874
+MPG123_EXPORT int mpg123_replace_buffer(mpg123_handle *mh
sezeroz@964
  1875
+,	unsigned char *data, size_t size);
sezeroz@964
  1876
+
sezeroz@964
  1877
+/** The max size of one frame's decoded output with current settings.
sezeroz@964
  1878
+ *  Use that to determine an appropriate minimum buffer size for decoding one frame.
sezeroz@964
  1879
+ *  \param mh handle
sezeroz@964
  1880
+ *  \return maximum decoded data size in bytes
sezeroz@964
  1881
+ */
sezeroz@964
  1882
+MPG123_EXPORT size_t mpg123_outblock(mpg123_handle *mh);
sezeroz@964
  1883
+
sezeroz@964
  1884
+/** Replace low-level stream access functions; read and lseek as known in POSIX.
sezeroz@964
  1885
+ *  You can use this to make any fancy file opening/closing yourself, 
sezeroz@964
  1886
+ *  using mpg123_open_fd() to set the file descriptor for your read/lseek
sezeroz@964
  1887
+ *  (doesn't need to be a "real" file descriptor...).
sezeroz@964
  1888
+ *  Setting a function to NULL means that the default internal read is 
sezeroz@964
  1889
+ *  used (active from next mpg123_open call on).
sezeroz@964
  1890
+ *  Note: As it would be troublesome to mess with this while having a file open,
sezeroz@964
  1891
+ *  this implies mpg123_close().
sezeroz@964
  1892
+ * \param mh handle
sezeroz@964
  1893
+ * \param r_read callback for reading (behaviour like POSIX read)
sezeroz@964
  1894
+ * \param r_lseek callback for seeking (like POSIX lseek)
sezeroz@964
  1895
+ * \return MPG123_OK on success
sezeroz@964
  1896
+ */
sezeroz@964
  1897
+MPG123_EXPORT int mpg123_replace_reader( mpg123_handle *mh
sezeroz@964
  1898
+,	ssize_t (*r_read) (int, void *, size_t)
sezeroz@964
  1899
+,	off_t (*r_lseek)(int, off_t, int)
sezeroz@964
  1900
+);
sezeroz@964
  1901
+
sezeroz@964
  1902
+/** Replace I/O functions with your own ones operating on some kind of
sezeroz@964
  1903
+ *  handle instead of integer descriptors.
sezeroz@964
  1904
+ *  The handle is a void pointer, so you can pass any data you want...
sezeroz@964
  1905
+ *  mpg123_open_handle() is the call you make to use the I/O defined here.
sezeroz@964
  1906
+ *  There is no fallback to internal read/seek here.
sezeroz@964
  1907
+ *  Note: As it would be troublesome to mess with this while having a file open,
sezeroz@964
  1908
+ *  this mpg123_close() is implied here.
sezeroz@964
  1909
+ *  \param mh handle
sezeroz@964
  1910
+ *  \param r_read callback for reading (behaviour like POSIX read)
sezeroz@964
  1911
+ *  \param r_lseek callback for seeking (like POSIX lseek)
sezeroz@964
  1912
+ *  \param cleanup A callback to clean up an I/O handle on mpg123_close,
sezeroz@964
  1913
+ *         can be NULL for none (you take care of cleaning your handles).
sezeroz@964
  1914
+ * \return MPG123_OK on success
sezeroz@964
  1915
+ */
sezeroz@964
  1916
+MPG123_EXPORT int mpg123_replace_reader_handle( mpg123_handle *mh
sezeroz@964
  1917
+,	ssize_t (*r_read) (void *, void *, size_t)
sezeroz@964
  1918
+,	off_t (*r_lseek)(void *, off_t, int)
sezeroz@964
  1919
+,	void (*cleanup)(void*) );
sezeroz@964
  1920
+
sezeroz@964
  1921
+/* @} */
sezeroz@964
  1922
+
sezeroz@964
  1923
+#ifdef __cplusplus
sezeroz@964
  1924
+}
sezeroz@964
  1925
+#endif
sezeroz@964
  1926
+
sezeroz@964
  1927
+#endif
sezeroz@964
  1928
diff -u /dev/null mpg123-1.25.13/Android.mk
sezeroz@964
  1929
--- /dev/null
sezeroz@964
  1930
+++ mpg123-1.25.13/Android.mk
sezeroz@964
  1931
@@ -0,0 +1,225 @@
sezeroz@964
  1932
+LOCAL_PATH := $(call my-dir)
sezeroz@964
  1933
+
sezeroz@964
  1934
+include $(CLEAR_VARS)
sezeroz@964
  1935
+
sezeroz@964
  1936
+LOCAL_MODULE := libmpg123
sezeroz@964
  1937
+
sezeroz@964
  1938
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/android \
sezeroz@964
  1939
+                    $(LOCAL_PATH)/src \
sezeroz@964
  1940
+                    $(LOCAL_PATH)/src/compat \
sezeroz@964
  1941
+                    $(LOCAL_PATH)/src/libmpg123 \
sezeroz@964
  1942
+
sezeroz@964
  1943
+DECODER_CFLAGS_NEON := -DOPT_NEON -DREAL_IS_FLOAT
sezeroz@964
  1944
+
sezeroz@964
  1945
+DECODER_SRC_NEON := \
sezeroz@964
  1946
+    src/libmpg123/stringbuf.c \
sezeroz@964
  1947
+    src/libmpg123/icy.c \
sezeroz@964
  1948
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  1949
+    src/libmpg123/ntom.c \
sezeroz@964
  1950
+    src/libmpg123/synth.c \
sezeroz@964
  1951
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  1952
+    src/libmpg123/layer1.c \
sezeroz@964
  1953
+    src/libmpg123/layer2.c \
sezeroz@964
  1954
+    src/libmpg123/layer3.c \
sezeroz@964
  1955
+    src/libmpg123/dct36_neon.S \
sezeroz@964
  1956
+    src/libmpg123/dct64_neon_float.S \
sezeroz@964
  1957
+    src/libmpg123/synth_neon_float.S \
sezeroz@964
  1958
+    src/libmpg123/synth_neon_s32.S \
sezeroz@964
  1959
+    src/libmpg123/synth_stereo_neon_float.S \
sezeroz@964
  1960
+    src/libmpg123/synth_stereo_neon_s32.S \
sezeroz@964
  1961
+    src/libmpg123/dct64_neon.S \
sezeroz@964
  1962
+    src/libmpg123/synth_neon.S \
sezeroz@964
  1963
+    src/libmpg123/synth_stereo_neon.S \
sezeroz@964
  1964
+    src/libmpg123/synth_s32.c \
sezeroz@964
  1965
+    src/libmpg123/synth_real.c \
sezeroz@964
  1966
+    src/libmpg123/feature.c \
sezeroz@964
  1967
+
sezeroz@964
  1968
+DECODER_CFLAGS_NEON64 := -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_NEON64 -DREAL_IS_FLOAT
sezeroz@964
  1969
+
sezeroz@964
  1970
+DECODER_SRC_NEON64 := \
sezeroz@964
  1971
+    src/libmpg123/stringbuf.c \
sezeroz@964
  1972
+    src/libmpg123/icy.c \
sezeroz@964
  1973
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  1974
+    src/libmpg123/ntom.c \
sezeroz@964
  1975
+    src/libmpg123/synth.c \
sezeroz@964
  1976
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  1977
+    src/libmpg123/layer1.c \
sezeroz@964
  1978
+    src/libmpg123/layer2.c \
sezeroz@964
  1979
+    src/libmpg123/layer3.c \
sezeroz@964
  1980
+    src/libmpg123/dct36_neon64.S \
sezeroz@964
  1981
+    src/libmpg123/dct64_neon64_float.S \
sezeroz@964
  1982
+    src/libmpg123/synth_neon64_float.S \
sezeroz@964
  1983
+    src/libmpg123/synth_neon64_s32.S \
sezeroz@964
  1984
+    src/libmpg123/synth_stereo_neon64_float.S \
sezeroz@964
  1985
+    src/libmpg123/synth_stereo_neon64_s32.S \
sezeroz@964
  1986
+    src/libmpg123/dct64_neon64.S \
sezeroz@964
  1987
+    src/libmpg123/synth_neon64.S \
sezeroz@964
  1988
+    src/libmpg123/synth_stereo_neon64.S \
sezeroz@964
  1989
+    src/libmpg123/synth_s32.c \
sezeroz@964
  1990
+    src/libmpg123/synth_real.c \
sezeroz@964
  1991
+    src/libmpg123/dither.c \
sezeroz@964
  1992
+    src/libmpg123/getcpuflags_arm.c \
sezeroz@964
  1993
+    src/libmpg123/check_neon.S \
sezeroz@964
  1994
+    src/libmpg123/feature.c \
sezeroz@964
  1995
+
sezeroz@964
  1996
+# Unfortunately the assembly isn't relocatable so doesn't work on modern
sezeroz@964
  1997
+# Android devices
sezeroz@964
  1998
+DECODER_CFLAGS_X86 := -DOPT_GENERIC -DREAL_IS_FLOAT
sezeroz@964
  1999
+DECODER_CFLAGS_X86_ASM := -DOPT_MULTI -DOPT_GENERIC -DOPT_GENERIC_DITHER -DOPT_I386 -DOPT_I586 -DOPT_I586_DITHER -DOPT_MMX -DOPT_3DNOW -DOPT_3DNOW_VINTAGE -DOPT_3DNOWEXT -DOPT_3DNOWEXT_VINTAGE -DOPT_SSE -DOPT_SSE_VINTAGE -DREAL_IS_FLOAT
sezeroz@964
  2000
+
sezeroz@964
  2001
+DECODER_SRC_X86 := \
sezeroz@964
  2002
+    src/libmpg123/feature.c \
sezeroz@964
  2003
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  2004
+    src/libmpg123/icy.c \
sezeroz@964
  2005
+    src/libmpg123/layer1.c \
sezeroz@964
  2006
+    src/libmpg123/layer2.c \
sezeroz@964
  2007
+    src/libmpg123/layer3.c \
sezeroz@964
  2008
+    src/libmpg123/ntom.c \
sezeroz@964
  2009
+    src/libmpg123/stringbuf.c \
sezeroz@964
  2010
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  2011
+    src/libmpg123/synth.c \
sezeroz@964
  2012
+    src/libmpg123/synth_real.c \
sezeroz@964
  2013
+    src/libmpg123/synth_s32.c \
sezeroz@964
  2014
+    src/libmpg123/dither.c \
sezeroz@964
  2015
+
sezeroz@964
  2016
+DECODER_SRC_X86_ASM := \
sezeroz@964
  2017
+    src/libmpg123/stringbuf.c \
sezeroz@964
  2018
+    src/libmpg123/icy.c \
sezeroz@964
  2019
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  2020
+    src/libmpg123/ntom.c \
sezeroz@964
  2021
+    src/libmpg123/synth.c \
sezeroz@964
  2022
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  2023
+    src/libmpg123/layer1.c \
sezeroz@964
  2024
+    src/libmpg123/layer2.c \
sezeroz@964
  2025
+    src/libmpg123/layer3.c \
sezeroz@964
  2026
+    src/libmpg123/synth_s32.c \
sezeroz@964
  2027
+    src/libmpg123/synth_real.c \
sezeroz@964
  2028
+    src/libmpg123/dct64_i386.c \
sezeroz@964
  2029
+    src/libmpg123/synth_i586.S \
sezeroz@964
  2030
+    src/libmpg123/synth_i586_dither.S \
sezeroz@964
  2031
+    src/libmpg123/dct64_mmx.S \
sezeroz@964
  2032
+    src/libmpg123/tabinit_mmx.S \
sezeroz@964
  2033
+    src/libmpg123/synth_mmx.S \
sezeroz@964
  2034
+    src/libmpg123/synth_3dnow.S \
sezeroz@964
  2035
+    src/libmpg123/dct64_3dnow.S \
sezeroz@964
  2036
+    src/libmpg123/equalizer_3dnow.S \
sezeroz@964
  2037
+    src/libmpg123/dct36_3dnow.S \
sezeroz@964
  2038
+    src/libmpg123/dct64_3dnowext.S \
sezeroz@964
  2039
+    src/libmpg123/synth_3dnowext.S \
sezeroz@964
  2040
+    src/libmpg123/dct36_3dnowext.S \
sezeroz@964
  2041
+    src/libmpg123/dct64_sse_float.S \
sezeroz@964
  2042
+    src/libmpg123/synth_sse_float.S \
sezeroz@964
  2043
+    src/libmpg123/synth_stereo_sse_float.S \
sezeroz@964
  2044
+    src/libmpg123/synth_sse_s32.S \
sezeroz@964
  2045
+    src/libmpg123/synth_stereo_sse_s32.S \
sezeroz@964
  2046
+    src/libmpg123/dct36_sse.S \
sezeroz@964
  2047
+    src/libmpg123/dct64_sse.S \
sezeroz@964
  2048
+    src/libmpg123/synth_sse.S \
sezeroz@964
  2049
+    src/libmpg123/getcpuflags.S \
sezeroz@964
  2050
+    src/libmpg123/dither.c \
sezeroz@964
  2051
+    src/libmpg123/feature.c \
sezeroz@964
  2052
+
sezeroz@964
  2053
+DECODER_CFLAGS_X64 := -DOPT_MULTI -DOPT_X86_64 -DOPT_GENERIC -DOPT_GENERIC_DITHER -DREAL_IS_FLOAT -DOPT_AVX
sezeroz@964
  2054
+
sezeroz@964
  2055
+DECODER_SRC_X64 := \
sezeroz@964
  2056
+    src/libmpg123/stringbuf.c \
sezeroz@964
  2057
+    src/libmpg123/icy.c \
sezeroz@964
  2058
+    src/libmpg123/icy.h \
sezeroz@964
  2059
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  2060
+    src/libmpg123/icy2utf8.h \
sezeroz@964
  2061
+    src/libmpg123/ntom.c \
sezeroz@964
  2062
+    src/libmpg123/synth.c \
sezeroz@964
  2063
+    src/libmpg123/synth.h \
sezeroz@964
  2064
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  2065
+    src/libmpg123/synth_8bit.h \
sezeroz@964
  2066
+    src/libmpg123/layer1.c \
sezeroz@964
  2067
+    src/libmpg123/layer2.c \
sezeroz@964
  2068
+    src/libmpg123/layer3.c \
sezeroz@964
  2069
+    src/libmpg123/synth_s32.c \
sezeroz@964
  2070
+    src/libmpg123/synth_real.c \
sezeroz@964
  2071
+    src/libmpg123/dct36_x86_64.S \
sezeroz@964
  2072
+    src/libmpg123/dct64_x86_64_float.S \
sezeroz@964
  2073
+    src/libmpg123/synth_x86_64_float.S \
sezeroz@964
  2074
+    src/libmpg123/synth_x86_64_s32.S \
sezeroz@964
  2075
+    src/libmpg123/synth_stereo_x86_64_float.S \
sezeroz@964
  2076
+    src/libmpg123/synth_stereo_x86_64_s32.S \
sezeroz@964
  2077
+    src/libmpg123/synth_x86_64.S \
sezeroz@964
  2078
+    src/libmpg123/dct64_x86_64.S \
sezeroz@964
  2079
+    src/libmpg123/synth_stereo_x86_64.S \
sezeroz@964
  2080
+    src/libmpg123/dither.c \
sezeroz@964
  2081
+    src/libmpg123/dither.h \
sezeroz@964
  2082
+    src/libmpg123/getcpuflags_x86_64.S \
sezeroz@964
  2083
+    src/libmpg123/dct36_avx.S \
sezeroz@964
  2084
+    src/libmpg123/dct64_avx_float.S \
sezeroz@964
  2085
+    src/libmpg123/synth_stereo_avx_float.S \
sezeroz@964
  2086
+    src/libmpg123/synth_stereo_avx_s32.S \
sezeroz@964
  2087
+    src/libmpg123/dct64_avx.S \
sezeroz@964
  2088
+    src/libmpg123/synth_stereo_avx.S \
sezeroz@964
  2089
+    src/libmpg123/feature.c
sezeroz@964
  2090
+
sezeroz@964
  2091
+DECODER_CFLAGS_MIPS := -DOPT_GENERIC -DREAL_IS_FLOAT
sezeroz@964
  2092
+
sezeroz@964
  2093
+DECODER_SRC_MIPS := \
sezeroz@964
  2094
+    src/libmpg123/stringbuf.c \
sezeroz@964
  2095
+    src/libmpg123/icy.c \
sezeroz@964
  2096
+    src/libmpg123/icy2utf8.c \
sezeroz@964
  2097
+    src/libmpg123/ntom.c \
sezeroz@964
  2098
+    src/libmpg123/synth.c \
sezeroz@964
  2099
+    src/libmpg123/synth_8bit.c \
sezeroz@964
  2100
+    src/libmpg123/layer1.c \
sezeroz@964
  2101
+    src/libmpg123/layer2.c \
sezeroz@964
  2102
+    src/libmpg123/layer3.c \
sezeroz@964
  2103
+    src/libmpg123/synth_s32.c \
sezeroz@964
  2104
+    src/libmpg123/synth_real.c \
sezeroz@964
  2105
+    src/libmpg123/feature.c
sezeroz@964
  2106
+
sezeroz@964
  2107
+ifeq ($(TARGET_ARCH_ABI),armeabi)
sezeroz@964
  2108
+DECODER_CFLAGS := $(DECODER_CFLAGS_NEON)
sezeroz@964
  2109
+DECODER_SRC := $(DECODER_SRC_NEON)
sezeroz@964
  2110
+endif
sezeroz@964
  2111
+ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
sezeroz@964
  2112
+DECODER_CFLAGS := $(DECODER_CFLAGS_NEON)
sezeroz@964
  2113
+DECODER_SRC := $(DECODER_SRC_NEON)
sezeroz@964
  2114
+endif
sezeroz@964
  2115
+ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
sezeroz@964
  2116
+DECODER_CFLAGS := $(DECODER_CFLAGS_NEON64)
sezeroz@964
  2117
+DECODER_SRC := $(DECODER_SRC_NEON64)
sezeroz@964
  2118
+endif
sezeroz@964
  2119
+ifeq ($(TARGET_ARCH_ABI),x86)
sezeroz@964
  2120
+DECODER_CFLAGS := $(DECODER_CFLAGS_X86)
sezeroz@964
  2121
+DECODER_SRC := $(DECODER_SRC_X86)
sezeroz@964
  2122
+endif
sezeroz@964
  2123
+ifeq ($(TARGET_ARCH_ABI),x86_64)
sezeroz@964
  2124
+DECODER_CFLAGS := $(DECODER_CFLAGS_X64)
sezeroz@964
  2125
+DECODER_SRC := $(DECODER_SRC_X64)
sezeroz@964
  2126
+endif
sezeroz@964
  2127
+ifeq ($(TARGET_ARCH_ABI),mips)
sezeroz@964
  2128
+DECODER_CFLAGS := $(DECODER_CFLAGS_MIPS)
sezeroz@964
  2129
+DECODER_SRC := $(DECODER_SRC_MIPS)
sezeroz@964
  2130
+endif
sezeroz@964
  2131
+ifeq ($(TARGET_ARCH_ABI),mips64)
sezeroz@964
  2132
+DECODER_CFLAGS := $(DECODER_CFLAGS_MIPS)
sezeroz@964
  2133
+DECODER_SRC := $(DECODER_SRC_MIPS)
sezeroz@964
  2134
+endif
sezeroz@964
  2135
+
sezeroz@964
  2136
+LOCAL_CFLAGS := $(DECODER_CFLAGS)
sezeroz@964
  2137
+
sezeroz@964
  2138
+LOCAL_SRC_FILES := \
sezeroz@964
  2139
+    src/libmpg123/parse.c \
sezeroz@964
  2140
+    src/libmpg123/frame.c \
sezeroz@964
  2141
+    src/libmpg123/format.c \
sezeroz@964
  2142
+    src/libmpg123/dct64.c \
sezeroz@964
  2143
+    src/libmpg123/equalizer.c \
sezeroz@964
  2144
+    src/libmpg123/id3.c \
sezeroz@964
  2145
+    src/libmpg123/optimize.c \
sezeroz@964
  2146
+    src/libmpg123/readers.c \
sezeroz@964
  2147
+    src/libmpg123/tabinit.c \
sezeroz@964
  2148
+    src/libmpg123/libmpg123.c \
sezeroz@964
  2149
+    src/libmpg123/index.c \
sezeroz@964
  2150
+    src/compat/compat_str.c \
sezeroz@964
  2151
+    src/compat/compat.c \
sezeroz@964
  2152
+    $(DECODER_SRC)
sezeroz@964
  2153
+
sezeroz@964
  2154
+LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)
sezeroz@964
  2155
+
sezeroz@964
  2156
+include $(BUILD_SHARED_LIBRARY)