-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.h
59 lines (48 loc) · 1.77 KB
/
http.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _OPUSFILE_HTTP_H
#define _OPUSFILE_HTTP_H (1)
#ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE
#endif
#ifndef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
#endif
#include <stdlib.h>
#include <opusfile.h>
#define OP_FATAL(_str) abort()
#define OP_ASSERT(_cond)
#define OP_ALWAYS_TRUE(_cond) ((void)(_cond))
#define OP_INT64_MAX (2*(((ogg_int64_t)1<<62)-1)|1)
#define OP_INT64_MIN (-OP_INT64_MAX-1)
#define OP_INT32_MAX (2*(((ogg_int32_t)1<<30)-1)|1)
#define OP_INT32_MIN (-OP_INT32_MAX-1)
#define OP_MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#define OP_MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
#define OP_CLAMP(_lo,_x,_hi) (OP_MAX(_lo,OP_MIN(_x,_hi)))
/* Advance a file offset by the given amount, clamping against OP_INT64_MAX.
* This is used to advance a known offset by things like OP_CHUNK_SIZE or
* OP_PAGE_SIZE_MAX, while making sure to avoid signed overflow.
* It assumes that both _offset and _amount are non-negative.
*/
#define OP_ADV_OFFSET(_offset,_amount) \
(OP_MIN(_offset,OP_INT64_MAX-(_amount))+(_amount))
/*The maximum channel count for any mapping we'll actually decode.*/
# define OP_NCHANNELS_MAX (8)
/*Initial state.*/
# define OP_NOTOPEN (0)
/*We've found the first Opus stream in the first link.*/
# define OP_PARTOPEN (1)
# define OP_OPENED (2)
/*We've found the first Opus stream in the current link.*/
# define OP_STREAMSET (3)
/*We've initialized the decoder for the chosen Opus stream in the current
link.*/
# define OP_INITSET (4)
/* Information cached for a single link in a chained Ogg Opus file.
* We choose the first Opus stream encountered in each link to play back (and
* require at least one).
*/
int op_strncasecmp(const char *_a,const char *_b,int _n);
#endif