]> git.sesse.net Git - vlc/blob - modules/demux/oggseek.h
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / demux / oggseek.h
1 /*****************************************************************************
2  * oggseek.h : ogg seeking functions for ogg demuxer vlc
3  *****************************************************************************
4  * Copyright (C) 2008 - 2010 Gabriel Finch <salsaman@gmail.com>
5  *
6  * Authors: Gabriel Finch <salsaman@gmail.com>
7  * adapted from: http://lives.svn.sourceforge.net/viewvc/lives/trunk/lives-plugins
8  * /plugins/decoders/ogg_theora_decoder.c
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28
29 #define PAGE_HEADER_BYTES 27
30
31 #define OGGSEEK_BYTES_TO_READ 8500
32
33 /* index entries are structured as follows:
34  *   - for theora, highest granulepos -> pagepos (bytes) where keyframe begins
35  *  - for dirac, kframe (sync point) -> pagepos of sequence start (?)
36  */
37
38 /* this is typedefed to demux_index_entry_t in ogg.h */
39 struct oggseek_index_entry
40 {
41     demux_index_entry_t *p_next;
42     demux_index_entry_t *p_prev;
43
44     /* value is highest granulepos for theora, sync frame for dirac */
45     int64_t i_value;
46     int64_t i_pagepos;
47
48     /* not used for theora because the granulepos tells us this */
49     int64_t i_pagepos_end;
50 };
51
52
53
54
55 void oggseek_index_entries_free ( demux_index_entry_t * );
56
57 int64_t oggseek_get_last_frame ( demux_t *, logical_stream_t *);
58
59 int oggseek_find_frame ( demux_t *, logical_stream_t *, int64_t i_tframe );
60