diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-12-29 19:46:35 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-12-29 19:46:35 +0000 |
commit | a222f27c4a17ed8f9809cda7861fe5f23d4cc0c1 (patch) | |
tree | d393a23d83549f99772bb156e59ffb88725148b6 /apps/plugins/mpegplayer/mpeg_linkedlist.h | |
parent | 1d0f6b90ff43776e55b4b9f062c9bea3f99aa768 (diff) | |
download | rockbox-a222f27c4a17ed8f9809cda7861fe5f23d4cc0c1.tar.gz rockbox-a222f27c4a17ed8f9809cda7861fe5f23d4cc0c1.zip |
mpegplayer: Make playback engine fully seekable and frame-accurate and split into logical parts. Be sure to have all current features work. Actual UI for seeking will be added soon. Recommended GOP size is about 15-30 frames depending on target or seeking can be slow with really long GOPs (nature of MPEG video). More refined encoding recommendations for a particular player should be posted soon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15977 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg_linkedlist.h')
-rw-r--r-- | apps/plugins/mpegplayer/mpeg_linkedlist.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_linkedlist.h b/apps/plugins/mpegplayer/mpeg_linkedlist.h new file mode 100644 index 0000000000..17123cc9ca --- /dev/null +++ b/apps/plugins/mpegplayer/mpeg_linkedlist.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Linked list API declarations | ||
11 | * | ||
12 | * Copyright (c) 2007 Michael Sevakis | ||
13 | * | ||
14 | * All files in this archive are subject to the GNU General Public License. | ||
15 | * See the file COPYING in the source tree root for full license agreement. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef MPEG_LINKEDLIST_H | ||
22 | #define MPEG_LINKEDLIST_H | ||
23 | |||
24 | struct list_item | ||
25 | { | ||
26 | struct list_item *prev; /* previous item in list */ | ||
27 | struct list_item *next; /* next item in list */ | ||
28 | }; | ||
29 | |||
30 | /* Utility macros to help get the actual structure pointer back */ | ||
31 | #define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername) | ||
32 | #define TYPE_FROM_MEMBER(type, memberptr, membername) \ | ||
33 | ((type *)((intptr_t)(memberptr) - OFFSETOF(type, membername))) | ||
34 | |||
35 | /* Initialize a master list head */ | ||
36 | void list_initialize(struct list_item *master_list_head); | ||
37 | |||
38 | /* Are there items after the head item? */ | ||
39 | bool list_is_empty(struct list_item *head_item); | ||
40 | |||
41 | /* Does the item belong to a list? */ | ||
42 | bool list_is_item_listed(struct list_item *item); | ||
43 | |||
44 | /* Is the item a member in a particular list? */ | ||
45 | bool list_is_member(struct list_item *master_list_head, | ||
46 | struct list_item *item); | ||
47 | |||
48 | /* Remove an item from a list - no head item needed */ | ||
49 | void list_remove_item(struct list_item *item); | ||
50 | |||
51 | /* Add a list item after the base item */ | ||
52 | void list_add_item(struct list_item *head_item, | ||
53 | struct list_item *item); | ||
54 | |||
55 | /* Clear list items after the head item */ | ||
56 | void list_clear_all(struct list_item *head_item); | ||
57 | |||
58 | /* Enumerate all items after the head item - passing each item in turn | ||
59 | * to the callback as well as the data value. The current item may be | ||
60 | * safely removed. Items added after the current position will be enumated | ||
61 | * but not ones added before it. The callback may return false to stop | ||
62 | * the enumeration. */ | ||
63 | typedef bool (*list_enum_callback_t)(struct list_item *item, intptr_t data); | ||
64 | |||
65 | void list_enum_items(struct list_item *head_item, | ||
66 | list_enum_callback_t callback, | ||
67 | intptr_t data); | ||
68 | |||
69 | #endif /* MPEG_LINKEDLIST_H */ | ||