vout/macosx: fix Control not working with libvlc
[vlc.git] / modules / demux / oggseek.h
blob6db6db7c797ac229bb228ea5e714585c9772c23c
1 /*****************************************************************************
2 * oggseek.h : ogg seeking functions for ogg demuxer vlc
3 *****************************************************************************
4 * Copyright (C) 2008 - 2010 Gabriel Finch <salsaman@gmail.com>
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
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
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 Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
26 * Preamble
27 *****************************************************************************/
29 #define PAGE_HEADER_BYTES 27
31 #define OGGSEEK_BYTES_TO_READ 8500
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 (?)
38 /* this is typedefed to demux_index_entry_t in ogg.h */
39 struct oggseek_index_entry
41 demux_index_entry_t *p_next;
42 demux_index_entry_t *p_prev;
44 /* value is highest granulepos for theora, sync frame for dirac */
45 int64_t i_value;
46 int64_t i_pagepos;
48 /* not used for theora because the granulepos tells us this */
49 int64_t i_pagepos_end;
52 int64_t Ogg_GetKeyframeGranule ( logical_stream_t *p_stream, int64_t i_granule );
53 bool Ogg_IsKeyFrame ( logical_stream_t *, ogg_packet * );
55 int64_t Oggseek_GranuleToAbsTimestamp ( logical_stream_t *p_stream, int64_t i_granule,
56 bool b_presentation );
57 int Oggseek_BlindSeektoAbsoluteTime ( demux_t *, logical_stream_t *, int64_t, bool );
58 int Oggseek_BlindSeektoPosition ( demux_t *, logical_stream_t *, double f, bool );
59 int Oggseek_SeektoAbsolutetime ( demux_t *, logical_stream_t *, int64_t i_granulepos );
60 const demux_index_entry_t *OggSeek_IndexAdd ( logical_stream_t *, int64_t, int64_t );
61 void Oggseek_ProbeEnd( demux_t * );
63 void oggseek_index_entries_free ( demux_index_entry_t * );
65 int64_t oggseek_read_page ( demux_t * );