xine-lib 1.2.11
ebml.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2009 the xine project
3 *
4 * This file is part of xine, a free video player.
5 *
6 * xine is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * xine is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 *
20 * EBML parser
21 * a lot of ideas from the gstreamer parser
22 */
23#ifndef EBML_H
24#define EBML_H
25
26#define EBML_STACK_SIZE 10
27#define EBML_VERSION 1
28
29/* EBML IDs */
30#define EBML_ID_EBML 0x1A45DFA3
31#define EBML_ID_EBMLVERSION 0x4286
32#define EBML_ID_EBMLREADVERSION 0x42F7
33#define EBML_ID_EBMLMAXIDLENGTH 0x42F2
34#define EBML_ID_EBMLMAXSIZELENGTH 0x42F3
35#define EBML_ID_DOCTYPE 0x4282
36#define EBML_ID_DOCTYPEVERSION 0x4287
37#define EBML_ID_DOCTYPEREADVERSION 0x4285
38
39
40typedef struct ebml_elem_s {
41 uint32_t id;
42 off_t start;
43 uint64_t len;
45
46typedef struct ebml_parser_s {
47
48 /* xine stuff */
51
52 /* EBML Parser Stack Management */
54 int level;
55
56 /* EBML Header Infos */
57 uint64_t version;
58 uint64_t read_version;
59 uint64_t max_id_len;
60 uint64_t max_size_len;
61 char *doctype;
64
66
67
69
71
72/* check EBML header */
74
75
76/* Element Header */
78
79uint32_t ebml_get_next_level(ebml_parser_t *ebml, ebml_elem_t *elem);
80
81int ebml_skip(ebml_parser_t *ebml, ebml_elem_t *elem);
82
83/* EBML types */
84int ebml_read_uint(ebml_parser_t *ebml, ebml_elem_t *elem, uint64_t *val);
85
86#if 0
87int ebml_read_sint(ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *val);
88#endif
89
90int ebml_read_float(ebml_parser_t *ebml, ebml_elem_t *elem, double *val);
91
92int ebml_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem, char *str);
93
94#if 0
95int ebml_read_utf8(ebml_parser_t *ebml, ebml_elem_t *elem, char *str);
96#endif
97
99
100#if 0
101int ebml_read_date(ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *date);
102#endif
103
105
106int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, void *binary);
107
108#endif /* EBML_H */
int ebml_read_master(ebml_parser_t *ebml, ebml_elem_t *elem)
Definition: ebml.c:346
int ebml_skip(ebml_parser_t *ebml, ebml_elem_t *elem)
Definition: ebml.c:197
uint32_t ebml_get_next_level(ebml_parser_t *ebml, ebml_elem_t *elem)
Definition: ebml.c:61
void dispose_ebml_parser(ebml_parser_t *ebml)
Definition: ebml.c:53
int ebml_read_elem_head(ebml_parser_t *ebml, ebml_elem_t *elem)
Definition: ebml.c:208
struct ebml_parser_s ebml_parser_t
int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, void *binary)
Definition: ebml.c:370
int ebml_read_float(ebml_parser_t *ebml, ebml_elem_t *elem, double *val)
Definition: ebml.c:272
int ebml_check_header(ebml_parser_t *read)
Definition: ebml.c:374
int ebml_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem, char *str)
Definition: ebml.c:309
struct ebml_elem_s ebml_elem_t
int ebml_read_uint(ebml_parser_t *ebml, ebml_elem_t *elem, uint64_t *val)
Definition: ebml.c:220
ebml_parser_t * new_ebml_parser(xine_t *xine, input_plugin_t *input)
Definition: ebml.c:41
char * ebml_alloc_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem)
Definition: ebml.c:324
#define EBML_STACK_SIZE
Definition: ebml.h:26
static int input(void)
Definition: goomsl_lex.c:1495
#define XINE_MALLOC
Definition: attributes.h:141
Definition: ebml.h:40
uint64_t len
Definition: ebml.h:43
off_t start
Definition: ebml.h:42
uint32_t id
Definition: ebml.h:41
Definition: ebml.h:46
uint64_t max_id_len
Definition: ebml.h:59
int level
Definition: ebml.h:54
xine_t * xine
Definition: ebml.h:49
uint64_t read_version
Definition: ebml.h:58
char * doctype
Definition: ebml.h:61
uint64_t doctype_read_version
Definition: ebml.h:63
ebml_elem_t elem_stack[10]
Definition: ebml.h:53
input_plugin_t * input
Definition: ebml.h:50
uint64_t version
Definition: ebml.h:57
uint64_t doctype_version
Definition: ebml.h:62
uint64_t max_size_len
Definition: ebml.h:60
Definition: input_plugin.h:90
Definition: xine_internal.h:80