New makefile solution: A single invocation of 'make' to build the entire tree. Fully...
[kugel-rb.git] / apps / plugins / mpegplayer / mpegplayer.h
blob323f8f34f1f0bc72e4fc0eb9dab541a80736de57
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Main mpegplayer config header.
12 * Copyright (c) 2007 Michael Sevakis
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef MPEGPLAYER_H
24 #define MPEGPLAYER_H
26 /* Global API pointer */
27 extern const struct plugin_api* rb;
29 #ifdef HAVE_SCHEDULER_BOOSTCTRL
30 #define trigger_cpu_boost rb->trigger_cpu_boost
31 #define cancel_cpu_boost rb->cancel_cpu_boost
32 #endif
33 /* #else function-like empty macros are defined in the headers */
35 /* Memory allotments for various subsystems */
36 #define MIN_MEMMARGIN (4*1024)
38 enum mpeg_malloc_reason_t
40 __MPEG_ALLOC_FIRST = -256,
41 MPEG_ALLOC_CODEC_MALLOC,
42 MPEG_ALLOC_CODEC_CALLOC,
43 MPEG_ALLOC_MPEG2_BUFFER,
44 MPEG_ALLOC_AUDIOBUF,
45 MPEG_ALLOC_PCMOUT,
46 MPEG_ALLOC_DISKBUF,
49 /** Video thread **/
50 #define LIBMPEG2_ALLOC_SIZE (2*1024*1024)
52 /** MPEG audio buffer **/
53 #define AUDIOBUF_GUARD_SIZE (MPA_MAX_FRAME_SIZE + 2*MAD_BUFFER_GUARD)
54 #define AUDIOBUF_SIZE (64*1024)
55 #define AUDIOBUF_ALLOC_SIZE (AUDIOBUF_SIZE+AUDIOBUF_GUARD_SIZE)
57 /** PCM buffer **/
58 #define CLOCK_RATE NATIVE_FREQUENCY /* Our clock rate in ticks/second (samplerate) */
60 /* Define this as "1" to have a test tone instead of silence clip */
61 #define SILENCE_TEST_TONE 0
63 #define PCMOUT_BUFSIZE (CLOCK_RATE/2*4) /* 1/2s */
64 #define PCMOUT_GUARD_SAMPLES ((CLOCK_RATE*576+7999)/8000) /* Worst upsampling case */
65 #define PCMOUT_GUARD_SIZE (PCMOUT_GUARD_SAMPLES*4 + sizeof (struct pcm_frame_header))
66 #define PCMOUT_ALLOC_SIZE (PCMOUT_BUFSIZE + PCMOUT_GUARD_SIZE)
67 /* Start pcm playback @ 25% full */
68 #define PCMOUT_PLAY_WM (PCMOUT_BUFSIZE/4)
69 /* No valid audio frame is smaller */
70 #define PCMOUT_LOW_WM (sizeof (struct pcm_frame_header))
72 /** disk buffer **/
73 #define DISK_BUF_LOW_WATERMARK (1024*1024)
74 /* 65535+6 is required since each PES has a 6 byte header with a 16 bit
75 * packet length field */
76 #define DISK_GUARDBUF_SIZE ALIGN_UP(65535+6, 4)
78 #ifdef HAVE_LCD_COLOR
79 #define DRAW_BLACK LCD_BLACK
80 #define DRAW_DARKGRAY LCD_DARKGRAY
81 #define DRAW_LIGHTGRAY LCD_LIGHTGRAY
82 #define DRAW_WHITE LCD_WHITE
83 #define lcd_(fn) rb->lcd_##fn
84 #define lcd_splash splash
86 #else
88 #include "lib/grey.h"
89 #define DRAW_BLACK GREY_BLACK
90 #define DRAW_DARKGRAY GREY_DARKGRAY
91 #define DRAW_LIGHTGRAY GREY_LIGHTGRAY
92 #define DRAW_WHITE GREY_WHITE
93 #define lcd_(fn) grey_##fn
95 #endif
97 #include "mpeg2.h"
98 #include "video_out.h"
99 #include "mpeg_stream.h"
100 #include "mpeg_linkedlist.h"
101 #include "mpeg_misc.h"
102 #include "mpeg_alloc.h"
103 #include "stream_thread.h"
104 #include "parser.h"
105 #include "pcm_output.h"
106 #include "disk_buf.h"
107 #include "stream_mgr.h"
109 #define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0)
110 #define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1)
112 #endif /* MPEGPLAYER_H */