annotate asxparser.h @ 32529:0624fa95a2aa

Make the file protocol read up to 64 kB at once when the cache is used, assuming that files will generally be readable with high bandwidth. This should improve performance when playing e.g. from high-latency network shares.
author reimar
date Wed, 10 Nov 2010 17:21:28 +0000
parents dd7f15a3fb1b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30429
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
1 /*
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
2 * This file is part of MPlayer.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
3 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
5 * it under the terms of the GNU General Public License as published by
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
7 * (at your option) any later version.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
8 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
12 * GNU General Public License for more details.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
13 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
14 * You should have received a copy of the GNU General Public License along
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
17 */
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29263
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
19 #ifndef MPLAYER_ASXPARSER_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
20 #define MPLAYER_ASXPARSER_H
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
21
30632
dad8e0eb182a Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.
diego
parents: 30429
diff changeset
22 #include "playtree.h"
dad8e0eb182a Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.
diego
parents: 30429
diff changeset
23
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
24 typedef struct ASX_Parser_t ASX_Parser_t;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
25
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
26 typedef struct {
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
27 char* buffer;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
28 int line;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
29 } ASX_LineSave_t;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
30
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25553
diff changeset
31 struct ASX_Parser_t {
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
32 int line; // Curent line
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
33 ASX_LineSave_t *ret_stack;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
34 int ret_stack_size;
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
35 char* last_body;
4309
35b412015c39 Implementation of entryref
albeu
parents: 4043
diff changeset
36 int deep;
4043
25590564842f tree-based playlist parser code by Alban Bedel <albeu@free.fr>
arpi
parents:
diff changeset
37 };
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26029
diff changeset
38
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
39 ASX_Parser_t*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
40 asx_parser_new(void);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
41
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
42 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
43 asx_parser_free(ASX_Parser_t* parser);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
44
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
45 /*
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
46 * Return -1 on error, 0 when nothing is found, 1 on sucess
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
47 */
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
48 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
49 asx_get_element(ASX_Parser_t* parser,char** _buffer,
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30632
diff changeset
50 char** _element,char** _body,char*** _attribs);
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
51
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
52 int
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
53 asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
54
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
55 /////// Attribs utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
56
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
57 char*
19104
2ec2301183cd marks several read-only string parameters which aren't modified inside the called function as const. Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents: 19053
diff changeset
58 asx_get_attrib(const char* attrib,char** attribs);
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
59
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
60 int
19053
75327b24e06f marks several string parameters as const, as they are not modified inside the function, Patch by Stefan Huehner, stefan AT huehner-org
reynaldo
parents: 8170
diff changeset
61 asx_attrib_to_enum(const char* val,char** valid_vals);
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
62
23609
ec2bfbd0d647 Get rid of a completely useless cast
reimar
parents: 19104
diff changeset
63 #define asx_free_attribs(a) asx_list_free(&a,free)
8170
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
64
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
65 ////// List utils
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
66
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
67 typedef void (*ASX_FreeFunc)(void* arg);
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
68
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
69 void
1f6ae3d15f19 Allow to use the asx parser for some other purposes
albeu
parents: 8164
diff changeset
70 asx_list_free(void* list_ptr,ASX_FreeFunc free_func);
25553
6ac1ece1f9fe Add multiple inclusion guards to all header files that lack them.
diego
parents: 23609
diff changeset
71
30632
dad8e0eb182a Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.
diego
parents: 30429
diff changeset
72 play_tree_t*
dad8e0eb182a Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.
diego
parents: 30429
diff changeset
73 asx_parser_build_tree(char* buffer,int deep);
dad8e0eb182a Add asx_parser_build_tree() to asxparser.h instead of forward declaring it.
diego
parents: 30429
diff changeset
74
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25607
diff changeset
75 #endif /* MPLAYER_ASXPARSER_H */