fix red.
[kugel-rb.git] / apps / plugins / mpegplayer / mpegplayer.h
blob79c25f6109b0156aa4007e7585eb5ac1d32eb22a
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 #include "mpeg2.h"
28 #ifdef HAVE_SCHEDULER_BOOSTCTRL
29 #define trigger_cpu_boost rb->trigger_cpu_boost
30 #define cancel_cpu_boost rb->cancel_cpu_boost
31 #endif
32 /* #else function-like empty macros are defined in the headers */
34 /* Should be enough for now */
35 #define MPEGPLAYER_MAX_STREAMS 4
37 /* Memory allotments for various subsystems */
38 #define MIN_MEMMARGIN (4*1024)
40 /** Video thread **/
41 #define LIBMPEG2_ALLOC_SIZE (2*1024*1024)
43 /** MPEG audio buffer **/
44 #define AUDIOBUF_GUARD_SIZE (MPA_MAX_FRAME_SIZE + 2*MAD_BUFFER_GUARD)
45 #define AUDIOBUF_SIZE (64*1024)
46 #define AUDIOBUF_ALLOC_SIZE (AUDIOBUF_SIZE+AUDIOBUF_GUARD_SIZE)
48 /** PCM buffer **/
49 #define CLOCK_RATE NATIVE_FREQUENCY /* Our clock rate in ticks/second (samplerate) */
51 /* Define this as "1" to have a test tone instead of silence clip */
52 #define SILENCE_TEST_TONE 0
54 #define PCMOUT_BUFSIZE (CLOCK_RATE/2*4) /* 1/2s */
55 #define PCMOUT_GUARD_SAMPLES ((CLOCK_RATE*576+7999)/8000) /* Worst upsampling case */
56 #define PCMOUT_GUARD_SIZE (PCMOUT_GUARD_SAMPLES*4 + sizeof (struct pcm_frame_header))
57 #define PCMOUT_ALLOC_SIZE (PCMOUT_BUFSIZE + PCMOUT_GUARD_SIZE)
58 /* Start pcm playback @ 25% full */
59 #define PCMOUT_PLAY_WM (PCMOUT_BUFSIZE/4)
60 /* No valid audio frame is smaller */
61 #define PCMOUT_LOW_WM (sizeof (struct pcm_frame_header))
63 /** disk buffer **/
64 #define DISK_BUF_LOW_WATERMARK (1024*1024)
65 /* 65535+6 is required since each PES has a 6 byte header with a 16 bit
66 * packet length field */
67 #define DISK_GUARDBUF_SIZE ALIGN_UP(65535+6, 4)
69 #ifdef HAVE_LCD_COLOR
70 #define mylcd_splash rb->splash
71 #else
72 #include "lib/grey.h"
73 #define mylcd_splash grey_splash
74 #endif
76 #include "lib/mylcd.h"
78 #include "mpeg2.h"
79 #include "video_out.h"
80 #include "mpeg_stream.h"
81 #include "mpeg_misc.h"
82 #include "mpeg_alloc.h"
83 #include "stream_thread.h"
84 #include "parser.h"
85 #include "pcm_output.h"
86 #include "disk_buf.h"
87 #include "stream_mgr.h"
89 #define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0)
90 #define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1)
92 #endif /* MPEGPLAYER_H */