Debian Codegraph @

src/defines.h

raw
1 /* dvbcut
2 Copyright (c) 2005 Sven Over <[email protected]>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 /* $Id$ */
20
21 #ifndef _DVBCUT_DEFINES_H
22 #define _DVBCUT_DEFINES_H
23
24 #define MUXER_FLAG_KEY (1<<0)
25
26 #define MAXAUDIOSTREAMS (0x20)
27 #define MAXVIDEOSTREAMS (1)
28 #define MAXAVSTREAMS (MAXVIDEOSTREAMS+MAXAUDIOSTREAMS)
29 #define VIDEOSTREAM (MAXAUDIOSTREAMS)
30
31 static inline int audiostream(int s=0)
32 {
33 return s;
34 }
35 static inline int videostream(int s=0)
36 {
37 #if MAXVIDEOSTREAMS == 1
38 return MAXAUDIOSTREAMS+s;
39 #else
40
41 return MAXAUDIOSTREAMS+(s%MAXVIDEOSTREAMS);
42 #endif
43 }
44
45 #if __BYTE_ORDER == __LITTLE_ENDIAN
46 #define mbo32(x) \
47 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
48 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
49 #define htom32(x) mbo32(x)
50 #define mbo16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
51 #define htom16(x) mbo16(x)
52 #else
53 #define mbo32(x) (x)
54 #define htom32(x) (x)
55 #define mbo16(x) (x)
56 #define htom16(x) (x)
57 #endif
58
59 #endif