liboggz  1.1.1
oggz_seek.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Commonwealth Scientific and Industrial Research
3  Organisation (CSIRO) Australia
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions
7  are met:
8 
9  - Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  - Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  - Neither the name of CSIRO Australia nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
24  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 
33 #ifndef __OGGZ_SEEK_H__
34 #define __OGGZ_SEEK_H__
35 
99 ogg_int64_t oggz_tell_units (OGGZ * oggz);
100 
109 ogg_int64_t oggz_seek_units (OGGZ * oggz, ogg_int64_t units, int whence);
110 
119 ogg_int64_t
120 oggz_tell_granulepos (OGGZ * oggz);
121 
134 oggz_off_t oggz_tell (OGGZ * oggz);
135 
143 oggz_off_t oggz_seek (OGGZ * oggz, oggz_off_t offset, int whence);
144 
145 #ifdef _UNIMPLEMENTED
146 long oggz_seek_packets (OGGZ * oggz, long serialno, long packets, int whence);
147 #endif
148 
270 int oggz_get_preroll (OGGZ * oggz, long serialno);
271 
283 int oggz_set_preroll (OGGZ * oggz, long serialno, int preroll);
284 
294 int oggz_get_granuleshift (OGGZ * oggz, long serialno);
295 
308 int oggz_set_granuleshift (OGGZ * oggz, long serialno, int granuleshift);
309 
322 int oggz_get_granulerate (OGGZ * oggz, long serialno,
323  ogg_int64_t * granulerate_n,
324  ogg_int64_t * granulerate_d);
325 
339 int oggz_set_granulerate (OGGZ * oggz, long serialno,
340  ogg_int64_t granule_rate_numerator,
341  ogg_int64_t granule_rate_denominator);
342 
360 typedef ogg_int64_t (*OggzMetric) (OGGZ * oggz, long serialno,
361  ogg_int64_t granulepos, void * user_data);
362 
385 int oggz_set_metric (OGGZ * oggz, long serialno, OggzMetric metric,
386  void * user_data);
387 
388 #ifdef _UNIMPLEMENTED
389 
445 typedef int (*OggzOrder) (OGGZ * oggz, ogg_packet * op, void * target,
446  void * user_data);
454 int oggz_set_order (OGGZ * oggz, long serialno, OggzOrder order,
455  void * user_data);
456 
457 long oggz_seek_byorder (OGGZ * oggz, void * target);
458 
459 #endif /* _UNIMPLEMENTED */
460 
474 int oggz_set_data_start (OGGZ * oggz, oggz_off_t offset);
491 ogg_int64_t
493  ogg_int64_t unit_target,
494  ogg_int64_t offset_begin,
495  ogg_int64_t offset_end);
496 
497 #endif /* __OGGZ_SEEK_H__ */
ogg_int64_t oggz_bounded_seek_set(OGGZ *oggz, ogg_int64_t unit_target, ogg_int64_t offset_begin, ogg_int64_t offset_end)
Seeks Oggz to time unit_target, but with the bounds of the offset range [offset_begin, offset_end].
ogg_int64_t oggz_tell_units(OGGZ *oggz)
Query the current offset in milliseconds, or custom units as specified by a Metric function you have ...
int oggz_set_metric(OGGZ *oggz, long serialno, OggzMetric metric, void *user_data)
Set the OggzMetric to use for an OGGZ handle.
ogg_int64_t oggz_tell_granulepos(OGGZ *oggz)
Provide the exact stored granulepos (from the page header) if relevant to the current packet...
int oggz_set_data_start(OGGZ *oggz, oggz_off_t offset)
Tell Oggz to remember the given offset as the start of data.
int oggz_set_granuleshift(OGGZ *oggz, long serialno, int granuleshift)
Specify the granuleshift of a logical bitstream.
int oggz_get_preroll(OGGZ *oggz, long serialno)
Retrieve the preroll of a logical bitstream.
ogg_int64_t(* OggzMetric)(OGGZ *oggz, long serialno, ogg_int64_t granulepos, void *user_data)
This is the signature of a function to correlate Ogg streams.
Definition: oggz_seek.h:359
int oggz_set_preroll(OGGZ *oggz, long serialno, int preroll)
Specify the preroll of a logical bitstream.
oggz_off_t oggz_seek(OGGZ *oggz, oggz_off_t offset, int whence)
Seek to a specific byte offset.
off_t oggz_off_t
This typedef was determined on the system on which the documentation was generated.
Definition: oggz_off_t_generated.h:62
ogg_int64_t oggz_seek_units(OGGZ *oggz, ogg_int64_t units, int whence)
Seek to an offset in milliseconds, or custom units as specified by a Metric function you have provide...
int oggz_get_granulerate(OGGZ *oggz, long serialno, ogg_int64_t *granulerate_n, ogg_int64_t *granulerate_d)
Retrieve the granulerate of a logical bitstream.
void OGGZ
An opaque handle to an Ogg file.
Definition: oggz.h:441
oggz_off_t oggz_tell(OGGZ *oggz)
Query the file offset in bytes corresponding to the data read.
int oggz_get_granuleshift(OGGZ *oggz, long serialno)
Retrieve the granuleshift of a logical bitstream.
int oggz_set_granulerate(OGGZ *oggz, long serialno, ogg_int64_t granule_rate_numerator, ogg_int64_t granule_rate_denominator)
Specify the granulerate of a logical bitstream.