* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_channels().
*/
unsigned FLAC__seekable_stream_encoder_get_channels(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_bits_per_sample().
*/
unsigned FLAC__seekable_stream_encoder_get_bits_per_sample(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_sample_rate().
*/
unsigned FLAC__seekable_stream_encoder_get_sample_rate(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_blocksize().
*/
unsigned FLAC__seekable_stream_encoder_get_blocksize(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_max_lpc_order().
*/
unsigned FLAC__seekable_stream_encoder_get_max_lpc_order(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_qlp_coeff_precision().
*/
unsigned FLAC__seekable_stream_encoder_get_qlp_coeff_precision(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_min_residual_partition_order().
*/
unsigned FLAC__seekable_stream_encoder_get_min_residual_partition_order(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_max_residual_partition_order().
*/
unsigned FLAC__seekable_stream_encoder_get_max_residual_partition_order(const FLAC__SeekableStreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__seekable_stream_encoder_set_rice_parameter_search_dist().
*/
unsigned FLAC__seekable_stream_encoder_get_rice_parameter_search_dist(const FLAC__SeekableStreamEncoder *encoder);
+/** Get the previously set estimate of the total samples to be encoded.
+ * This is inherited from FLAC__StreamEncoder; see
+ * FLAC__stream_encoder_get_total_samples_estimate().
+ *
+ * \param encoder An encoder instance to query.
+ * \assert
+ * \code encoder != NULL \endcode
+ * \retval FLAC__uint64
+ * See FLAC__seekable_stream_encoder_set_total_samples_estimate().
+ */
+FLAC__uint64 FLAC__seekable_stream_encoder_get_total_samples_estimate(const FLAC__SeekableStreamEncoder *encoder);
+
/** Initialize the encoder instance.
* Should be called after FLAC__seekable_stream_encoder_new() and
* FLAC__seekable_stream_encoder_set_*() but before FLAC__seekable_stream_encoder_process()
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_channels().
*/
unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_bits_per_sample().
*/
unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_sample_rate().
*/
unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_blocksize().
*/
unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_max_lpc_order().
*/
unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_qlp_coeff_precision().
*/
unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_min_residual_partition_order().
*/
unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_max_residual_partition_order().
*/
unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder);
* \param encoder An encoder instance to query.
* \assert
* \code encoder != NULL \endcode
- * \retval FLAC__bool
+ * \retval unsigned
* See FLAC__stream_encoder_set_rice_parameter_search_dist().
*/
unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder);
+/** Get the previously set estimate of the total samples to be encoded.
+ * The encoder merely mimics back the value given to
+ * FLAC__stream_encoder_set_total_samples_estimate() since it has no
+ * other way of knowing how many samples the user will encode.
+ *
+ * \param encoder An encoder instance to set.
+ * \assert
+ * \code encoder != NULL \endcode
+ * \retval FLAC__uint64
+ * See FLAC__stream_encoder_get_total_samples_estimate().
+ */
+FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder);
+
/** Initialize the encoder instance.
* Should be called after FLAC__stream_encoder_new() and
* FLAC__stream_encoder_set_*() but before FLAC__stream_encoder_process()
return ::FLAC__seekable_stream_encoder_get_rice_parameter_search_dist(encoder_);
}
+ FLAC__uint64 SeekableStream::get_total_samples_estimate() const
+ {
+ FLAC__ASSERT(is_valid());
+ return ::FLAC__seekable_stream_encoder_get_total_samples_estimate(encoder_);
+ }
+
SeekableStream::State SeekableStream::init()
{
FLAC__ASSERT(is_valid());
return ::FLAC__stream_encoder_get_rice_parameter_search_dist(encoder_);
}
+ FLAC__uint64 Stream::get_total_samples_estimate() const
+ {
+ FLAC__ASSERT(is_valid());
+ return ::FLAC__stream_encoder_get_total_samples_estimate(encoder_);
+ }
+
Stream::State Stream::init()
{
FLAC__ASSERT(is_valid());
return FLAC__stream_encoder_get_rice_parameter_search_dist(encoder->private_->stream_encoder);
}
+FLAC__uint64 FLAC__seekable_stream_encoder_get_total_samples_estimate(const FLAC__SeekableStreamEncoder *encoder)
+{
+ FLAC__ASSERT(0 != encoder);
+ FLAC__ASSERT(0 != encoder->private_);
+ return FLAC__stream_encoder_get_total_samples_estimate(encoder->private_->stream_encoder);
+}
+
FLAC__bool FLAC__seekable_stream_encoder_process(FLAC__SeekableStreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
{
FLAC__ASSERT(0 != encoder);
return encoder->protected_->rice_parameter_search_dist;
}
+FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder)
+{
+ FLAC__ASSERT(0 != encoder);
+ return encoder->protected_->total_samples_estimate;
+}
+
FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples)
{
unsigned i, j, channel;