xine-lib 1.2.13-20230125hg15249
demux_matroska.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2018 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 * demultiplexer for matroska streams: shared header
21 */
22
23#ifndef _DEMUX_MATROSKA_H_
24#define _DEMUX_MATROSKA_H_
25
26#include <ctype.h>
27#include <stdio.h>
28#include <fcntl.h>
29#include <unistd.h>
30#include <string.h>
31#include <stdlib.h>
32#include <zlib.h>
33
34#include <xine/xine_internal.h>
35#include <xine/demux.h>
36#include <xine/buffer.h>
37#include "bswap.h"
38
39#include "ebml.h"
40#include "matroska.h"
41
42#define NUM_PREVIEW_BUFFERS 10
43
44#define MAX_STREAMS 128
45#define MAX_FRAMES 128
46
47#define WRAP_THRESHOLD 90000
48
49typedef struct {
51 off_t *pos;
52 uint64_t *timecode;
54
56
57typedef struct {
58
60
62
64
65 int status;
66
68
69 /* segment element */
72 int duration; /* in millis */
75 char *title;
76
77 /* meta seek info */
80
81 /* seek info */
87
88 /* tracks */
93
96
97 /* maintain editions, number and capacity */
98 int num_editions, cap_editions;
100
101 /* block */
102 uint8_t *block_data;
104
105 /* current tracks */
108 matroska_track_t *sub_track; /* to remove */
110
113
114 /* seekhead parsing */
118
119 /* event handling (chapter navigation) */
122
123/* "entry points" for chapter handling.
124 * The parser descends into "Chapters" elements at the _parse_ function,
125 * and editions care about cleanup internally. */
128
129/* Search an edition for the chapter matching a given timecode.
130 *
131 * Return: chapter index, or -1 if none is found.
132 *
133 * TODO: does not handle chapter end times yet.
134 */
136
137#endif /* _DEMUX_MATROSKA_H_ */
void matroska_free_editions(demux_matroska_t *)
Definition demux_matroska-chapters.c:412
int matroska_parse_chapters(demux_matroska_t *)
Definition demux_matroska-chapters.c:352
#define MAX_STREAMS
Definition demux_matroska.h:44
int matroska_get_chapter(demux_matroska_t *, uint64_t, matroska_edition_t **)
Definition demux_matroska-chapters.c:423
Definition demux_matroska.h:57
int top_level_list_max_size
Definition demux_matroska.h:116
int num_tracks
Definition demux_matroska.h:89
int seekhead_handled
Definition demux_matroska.h:79
uint64_t timecode_scale
Definition demux_matroska.h:71
input_plugin_t * input
Definition demux_matroska.h:63
matroska_edition_t ** editions
Definition demux_matroska.h:99
int skip_to_timecode
Definition demux_matroska.h:85
uint8_t * block_data
Definition demux_matroska.h:102
matroska_track_t * video_track
Definition demux_matroska.h:106
size_t block_data_size
Definition demux_matroska.h:103
xine_stream_t * stream
Definition demux_matroska.h:61
int status
Definition demux_matroska.h:65
int preview_mode
Definition demux_matroska.h:74
ebml_parser_t * ebml
Definition demux_matroska.h:67
char * title
Definition demux_matroska.h:75
ebml_elem_t segment
Definition demux_matroska.h:70
int buf_flag_seek
Definition demux_matroska.h:112
int preview_sent
Definition demux_matroska.h:73
int first_cluster_found
Definition demux_matroska.h:84
int num_video_tracks
Definition demux_matroska.h:90
int skip_for_track
Definition demux_matroska.h:86
int has_seekhead
Definition demux_matroska.h:78
matroska_track_t * audio_track
Definition demux_matroska.h:107
int send_newpts
Definition demux_matroska.h:111
off_t * top_level_list
Definition demux_matroska.h:117
size_t compress_maxlen
Definition demux_matroska.h:95
xine_event_queue_t * event_queue
Definition demux_matroska.h:120
int cap_editions
Definition demux_matroska.h:98
matroska_track_t * sub_track
Definition demux_matroska.h:108
matroska_index_t * indexes
Definition demux_matroska.h:82
int top_level_list_size
Definition demux_matroska.h:115
int num_indexes
Definition demux_matroska.h:83
demux_plugin_t demux_plugin
Definition demux_matroska.h:59
int num_audio_tracks
Definition demux_matroska.h:91
int duration
Definition demux_matroska.h:72
uint64_t last_timecode
Definition demux_matroska.h:109
int num_sub_tracks
Definition demux_matroska.h:92
Definition demux.h:96
Definition ebml.h:40
Definition ebml.h:46
Definition input_plugin.h:90
Definition matroska.h:224
Definition demux_matroska.h:49
uint64_t * timecode
Definition demux_matroska.h:52
int track_num
Definition demux_matroska.h:50
int num_entries
Definition demux_matroska.h:53
off_t * pos
Definition demux_matroska.h:51
Definition matroska.h:263
Definition xine_internal.h:107
Definition xine_internal.h:123