summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/mpegplayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.h')
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h
new file mode 100644
index 0000000000..51fb9a8f8a
--- /dev/null
+++ b/apps/plugins/mpegplayer/mpegplayer.h
@@ -0,0 +1,95 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Main mpegplayer config header.
11 *
12 * Copyright (c) 2007 Michael Sevakis
13 *
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.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23#ifndef MPEGPLAYER_H
24#define MPEGPLAYER_H
25
26#ifdef HAVE_SCHEDULER_BOOSTCTRL
27#define trigger_cpu_boost rb->trigger_cpu_boost
28#define cancel_cpu_boost rb->cancel_cpu_boost
29#endif
30/* #else function-like empty macros are defined in the headers */
31
32/* Should be enough for now */
33#define MPEGPLAYER_MAX_STREAMS 4
34
35/* Memory allotments for various subsystems */
36#define MIN_MEMMARGIN (4*1024)
37
38/** Video thread **/
39#define LIBMPEG2_ALLOC_SIZE (2*1024*1024)
40
41/** MPEG audio buffer **/
42#define AUDIOBUF_GUARD_SIZE (MPA_MAX_FRAME_SIZE + 2*MAD_BUFFER_GUARD)
43#define AUDIOBUF_SIZE (64*1024)
44#define AUDIOBUF_ALLOC_SIZE (AUDIOBUF_SIZE+AUDIOBUF_GUARD_SIZE)
45
46/** PCM buffer **/
47#define CLOCK_RATE 44100 /* Our clock rate in ticks/second (samplerate) */
48
49/* Define this as "1" to have a test tone instead of silence clip */
50#define SILENCE_TEST_TONE 0
51
52/* NOTE: Sizes make no frame header allowance when considering duration */
53#define PCMOUT_BUFSIZE (CLOCK_RATE/2*4) /* 1/2s */
54#define PCMOUT_GUARD_SIZE (PCMOUT_BUFSIZE) /* guarantee contiguous sizes */
55#define PCMOUT_ALLOC_SIZE (PCMOUT_BUFSIZE + PCMOUT_GUARD_SIZE)
56 /* Start pcm playback @ 25% full */
57#define PCMOUT_PLAY_WM (PCMOUT_BUFSIZE/4)
58#define PCMOUT_LOW_WM (0)
59
60/** disk buffer **/
61#define DISK_BUF_LOW_WATERMARK (1024*1024)
62/* 65535+6 is required since each PES has a 6 byte header with a 16 bit
63 * packet length field */
64#define DISK_GUARDBUF_SIZE ALIGN_UP(65535+6, 4)
65
66#ifdef HAVE_LCD_COLOR
67#define mylcd_splash rb->splash
68#else
69#include "lib/grey.h"
70#define mylcd_splash grey_splash
71#endif
72
73#include "lib/mylcd.h"
74
75#include "libmpeg2/mpeg2.h"
76#include "video_out.h"
77#include "mpeg_stream.h"
78#include "mpeg_misc.h"
79#include "mpeg_alloc.h"
80#include "stream_thread.h"
81#include "parser.h"
82#include "pcm_output.h"
83#include "disk_buf.h"
84#include "stream_mgr.h"
85
86#define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0)
87#define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1)
88
89#ifdef PLUGIN_USE_IRAM
90/* IRAM preserving mechanism to enable talking menus */
91extern void mpegplayer_iram_preserve(void);
92extern void mpegplayer_iram_restore(void);
93#endif
94
95#endif /* MPEGPLAYER_H */