Quick patch to fix FLAC_metadata_object api docs.
[platform/upstream/flac.git] / include / FLAC / all.h
index 4018051..1aa3f7b 100644 (file)
@@ -1,5 +1,5 @@
 /* libFLAC - Free Lossless Audio Codec library
- * Copyright (C) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson
+ * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009  Josh Coalson
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -59,7 +59,7 @@
  * describing the components of FLAC streams, and functions for
  * encoding and decoding streams, as well as manipulating FLAC
  * metadata in files.  The public include files will be installed
- * in your include area as <include>/FLAC/...
+ * in your include area (for example /usr/include/FLAC/...).
  *
  * By writing a little code and linking against libFLAC, it is
  * relatively easy to add FLAC support to another program.  The
  * dependency on a thread library. However, libFLAC does not use
  * global variables and should be thread-safe.
  *
- * There is also a libOggFLAC library which wraps around libFLAC
- * to provide routines for encoding to and decoding from FLAC streams
- * inside an Ogg container.  The interfaces are very similar or identical
- * to their counterparts in libFLAC.  libOggFLAC is also licensed under
- * <A HREF="../license.html">Xiph's BSD license</A>.
+ * libFLAC also supports encoding to and decoding from Ogg FLAC.
+ * However the metadata editing interfaces currently have limited
+ * read-only support for Ogg FLAC files.
  *
  * \section cpp_api FLAC C++ API
  *
  * equivalent.  For the most part, they share the same usage as
  * their counterparts in libFLAC, and the FLAC C API documentation
  * can be used as a supplement.  The public include files
- * for the C++ API will be installed in your include area as
- * <include>/FLAC++/...
- *
- * There is also a libOggFLAC++ library, which provides classes
- * for encoding to and decoding from FLAC streams in an Ogg container.
- * The classes are very similar to their counterparts in libFLAC++.
+ * for the C++ API will be installed in your include area (for
+ * example /usr/include/FLAC++/...).
  *
- * Both libFLAC++ libOggFLAC++ are also licensed under
+ * libFLAC++ is also licensed under
  * <A HREF="../license.html">Xiph's BSD license</A>.
  *
  * \section getting_started Getting Started
  * individual functions.  You can see different views of the individual
  * functions through the links in top bar across this page.
  *
+ * If you prefer a more hands-on approach, you can jump right to some
+ * <A HREF="../documentation_example_code.html">example code</A>.
+ *
  * \section porting_guide Porting Guide
  *
  * Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink
  * - The decoder is independent of the encoder.  The encoder uses the
  *   decoder because of the verify feature, but this can be removed if
  *   not needed.
- * - The metadata interface requires the stream decoder.
+ * - Parts of the metadata interface require the stream decoder (but not
+ *   the encoder).
+ * - Ogg support is selectable through the compile time macro
+ *   \c FLAC__HAS_OGG.
  *
  * For example, if your application only requires the stream decoder, no
  * encoder, and no metadata interface, you can remove the stream encoder
  * and the metadata interface, which will greatly reduce the size of the
  * library.
+ *
+ * Also, there are several places in the libFLAC code with comments marked
+ * with "OPT:" where a #define can be changed to enable code that might be
+ * faster on a specific platform.  Experimenting with these can yield faster
+ * binaries.
  */
 
 /** \defgroup porting Porting Guide for New Versions
  * in FLAC 1.1.3 is a set of \c #defines in \c export.h of each
  * library's includes (e.g. \c include/FLAC/export.h).  The
  * \c #defines mirror the libraries'
- * <A HREF="http://www.gnu.org/software/libtool/manual.html#Libtool-versioning">libtool version numbers</A>,
+ * <A HREF="http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning">libtool version numbers</A>,
  * e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT,
  * \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE.
  * These can be used to support multiple versions of an API during the
  *
  * The the source will work for multiple versions and the legacy code can
  * easily be removed when the transition is complete.
+ *
+ * Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in
+ * include/FLAC/export.h), which can be used to determine whether or not
+ * the library has been compiled with support for Ogg FLAC.  This is
+ * simpler than trying to call an Ogg init function and catching the
+ * error.
  */
 
 /** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3
  *  \brief
  *  This module describes porting from FLAC 1.1.2 to FLAC 1.1.3.
  *
- * The main change between the APIs in 1.1.2 and 1.1.3 is that the three
+ * The main change between the APIs in 1.1.2 and 1.1.3 is that they have
+ * been simplified.  First, libOggFLAC has been merged into libFLAC and
+ * libOggFLAC++ has been merged into libFLAC++.  Second, both the three
  * decoding layers and three encoding layers have been merged into a
  * single stream decoder and stream encoder.  That is, the functionality
  * of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged
  * into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and
  * FLAC__FileEncoder into FLAC__StreamEncoder.  Only the
- * FLAC__StreamDecoder and FLAC__StreamEncoder remain.  This can
- * simplify code that needs to process both seekable and non-seekable
- * streams.
+ * FLAC__StreamDecoder and FLAC__StreamEncoder remain.  What this means
+ * is there is now a single API that can be used to encode or decode
+ * streams to/from native FLAC or Ogg FLAC and the single API can work
+ * on both seekable and non-seekable streams.
  *
  * Instead of creating an encoder or decoder of a certain layer, now the
  * client will always create a FLAC__StreamEncoder or
- * FLAC__StreamDecoder.  The different layers are differentiated by the
+ * FLAC__StreamDecoder.  The old layers are now differentiated by the
  * initialization function.  For example, for the decoder,
  * FLAC__stream_decoder_init() has been replaced by
  * FLAC__stream_decoder_init_stream().  This init function takes
  * FLAC__stream_decoder_set_client_data() are no longer needed.  The
  * rest of the calls to the decoder are the same as before.
  *
+ * There are counterpart init functions for Ogg FLAC, e.g.
+ * FLAC__stream_decoder_init_ogg_stream().  All the rest of the calls
+ * and callbacks are the same as for native FLAC.
+ *
  * As an example, in FLAC 1.1.2 a seekable stream decoder would have
  * been set up like so:
  *
  * The encoder now has a new setting:
  * FLAC__stream_encoder_set_apodization().  This is for setting the
  * method used to window the data before LPC analysis.  You only need to
- * add a call to this function if the default is not   There are also
- * two new convenience functions that may be useful:
+ * add a call to this function if the default is not suitable.   There
+ * are also two new convenience functions that may be useful:
  * FLAC__metadata_object_cuesheet_calculate_cddb_id() and
  * FLAC__metadata_get_cuesheet().
  *
- * In libOggFLAC++, OggFLAC::Decoder::Stream now inherits from
- * FLAC::Decoder::Stream and OggFLAC::Encoder::Stream now inherits from
- * FLAC::Encoder::Stream, which means both OggFLAC and FLAC can be
- * supported by using common code for everything after initialization.
+ * The \a bytes parameter to FLAC__StreamDecoderReadCallback,
+ * FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback
+ * is now \c size_t instead of \c unsigned.
+ */
+
+/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4
+ *  \ingroup porting
+ *
+ *  \brief
+ *  This module describes porting from FLAC 1.1.3 to FLAC 1.1.4.
+ *
+ * There were no changes to any of the interfaces from 1.1.3 to 1.1.4.
+ * There was a slight change in the implementation of
+ * FLAC__stream_encoder_set_metadata(); the function now makes a copy
+ * of the \a metadata array of pointers so the client no longer needs
+ * to maintain it after the call.  The objects themselves that are
+ * pointed to by the array are still not copied though and must be
+ * maintained until the call to FLAC__stream_encoder_finish().
+ */
+
+/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0
+ *  \ingroup porting
+ *
+ *  \brief
+ *  This module describes porting from FLAC 1.1.4 to FLAC 1.2.0.
+ *
+ * There were only very minor changes to the interfaces from 1.1.4 to 1.2.0.
+ * In libFLAC, \c FLAC__format_sample_rate_is_subset() was added.
+ * In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added.
+ *
+ * Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN
+ * has changed to reflect the conversion of one of the reserved bits
+ * into active use.  It used to be \c 2 and now is \c 1.  However the
+ * FLAC frame header length has not changed, so to skip the proper
+ * number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN +
+ * \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN
  */
 
 /** \defgroup flac FLAC C API