From f273cbeb2158eb8b24251a3c45afefb76a04b026 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 29 Oct 1999 10:23:25 +0000 Subject: ... beginning of the chaining example code. Monty svn path=/trunk/vorbis/; revision=155 --- lib/chaining_example.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/chaining_example.c (limited to 'lib') diff --git a/lib/chaining_example.c b/lib/chaining_example.c new file mode 100644 index 00000000..0c1e95b0 --- /dev/null +++ b/lib/chaining_example.c @@ -0,0 +1,49 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE Ogg Vorbis SOFTWARE CODEC SOURCE CODE. * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY * + * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. * + * PLEASE READ THESE TERMS DISTRIBUTING. * + * * + * THE OggSQUISH SOURCE CODE IS (C) COPYRIGHT 1994-1999 * + * by 1999 Monty and The XIPHOPHORUS Company * + * http://www.xiph.org/ * + * * + ******************************************************************** + + function: simple example of opening/seeking chained bitstreams + author: Monty + modifications by: Monty + last modification date: Oct 29 1999 + + ********************************************************************/ + + +#include +#include +#include "codec.h" + +/* A 'chained bitstream' is a Vorbis bitstream that contains more than + one logical bitstream arranged end to end (the only form of Ogg + multiplexing allowed in a Vorbis bitstream; grouping [parallel + multiplexing] is not allowed in Vorbis) */ + +/* A Vorbis file can be played beginning to end (streamed) without + worrying ahead of time about chaining. If we have the whole file, + however, and want random access (seeking/scrubbing) or desire to + know the total length/time of a file, we need to account for the + possibility of chaining. */ + +/* We can handle things a number of ways; we can determine the entire + bitstream structure right off the bat, or piece it together later. + This example determines and caches structure for the entire + bitstream, but builds a virtual decoder on the fly when moving from + one link of the chain to another */ + +/* There are also different ways to implement seeking. Enough + information exists in an Ogg bitstream to seek to + sample-granularity positions in the output. Or, one can seek by + picking some portion of the stream roughtly in the area we only + want course navigation through the stream. This example implements + the latter. */ + -- cgit v1.2.1