decoder/FLAC*: rename files and symbols to Flac*

This commit is contained in:
Denis Krjuchkov 2013-05-05 18:19:04 +06:00
parent 1d9b84a5af
commit 21dac6c05d
14 changed files with 81 additions and 81 deletions

View File

@ -555,13 +555,13 @@ endif
if HAVE_FLAC if HAVE_FLAC
libdecoder_plugins_a_SOURCES += \ libdecoder_plugins_a_SOURCES += \
src/decoder/FLACInput.cxx src/decoder/FLACInput.hxx \ src/decoder/FlacInput.cxx src/decoder/FlacInput.hxx \
src/decoder/FLACIOHandle.cxx src/decoder/FLACIOHandle.hxx \ src/decoder/FlacIOHandle.cxx src/decoder/FlacIOHandle.hxx \
src/decoder/FLACMetaData.cxx src/decoder/FLACMetaData.hxx \ src/decoder/FlacMetadata.cxx src/decoder/FlacMetadata.hxx \
src/decoder/FLAC_PCM.cxx src/decoder/FLAC_PCM.hxx \ src/decoder/FlacPcm.cxx src/decoder/FlacPcm.hxx \
src/decoder/FLACCommon.cxx src/decoder/FLACCommon.hxx \ src/decoder/FlacCommon.cxx src/decoder/FlacCommon.hxx \
src/decoder/FLACDecoderPlugin.cxx \ src/decoder/FlacDecoderPlugin.cxx \
src/decoder/FLACDecoderPlugin.h src/decoder/FlacDecoderPlugin.h
endif endif
if HAVE_AUDIOFILE if HAVE_AUDIOFILE
@ -1137,7 +1137,7 @@ test_dump_playlist_SOURCES = test/dump_playlist.cxx \
if HAVE_FLAC if HAVE_FLAC
test_dump_playlist_SOURCES += \ test_dump_playlist_SOURCES += \
src/ReplayGainInfo.cxx \ src/ReplayGainInfo.cxx \
src/decoder/FLACMetaData.cxx src/decoder/FlacMetadata.cxx
endif endif
test_run_decoder_LDADD = \ test_run_decoder_LDADD = \

View File

@ -25,7 +25,7 @@
#include "decoder/pcm_decoder_plugin.h" #include "decoder/pcm_decoder_plugin.h"
#include "decoder/dsdiff_decoder_plugin.h" #include "decoder/dsdiff_decoder_plugin.h"
#include "decoder/dsf_decoder_plugin.h" #include "decoder/dsf_decoder_plugin.h"
#include "decoder/FLACDecoderPlugin.h" #include "decoder/FlacDecoderPlugin.h"
#include "decoder/OpusDecoderPlugin.h" #include "decoder/OpusDecoderPlugin.h"
#include "decoder/VorbisDecoderPlugin.h" #include "decoder/VorbisDecoderPlugin.h"
#include "decoder/AdPlugDecoderPlugin.h" #include "decoder/AdPlugDecoderPlugin.h"

View File

@ -22,9 +22,9 @@
*/ */
#include "config.h" #include "config.h"
#include "FLACCommon.hxx" #include "FlacCommon.hxx"
#include "FLACMetaData.hxx" #include "FlacMetadata.hxx"
#include "FLAC_PCM.hxx" #include "FlacPcm.hxx"
extern "C" { extern "C" {
#include "audio_check.h" #include "audio_check.h"
@ -36,7 +36,7 @@ extern "C" {
flac_data::flac_data(struct decoder *_decoder, flac_data::flac_data(struct decoder *_decoder,
struct input_stream *_input_stream) struct input_stream *_input_stream)
:FLACInput(_input_stream, _decoder), :FlacInput(_input_stream, _decoder),
initialized(false), unsupported(false), initialized(false), unsupported(false),
total_frames(0), first_frame(0), next_frame(0), position(0), total_frames(0), first_frame(0), next_frame(0), position(0),
decoder(_decoder), input_stream(_input_stream), decoder(_decoder), input_stream(_input_stream),

View File

@ -24,7 +24,7 @@
#ifndef MPD_FLAC_COMMON_HXX #ifndef MPD_FLAC_COMMON_HXX
#define MPD_FLAC_COMMON_HXX #define MPD_FLAC_COMMON_HXX
#include "FLACInput.hxx" #include "FlacInput.hxx"
#include "decoder_api.h" #include "decoder_api.h"
extern "C" { extern "C" {
@ -37,7 +37,7 @@ extern "C" {
#undef G_LOG_DOMAIN #undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "flac" #define G_LOG_DOMAIN "flac"
struct flac_data : public FLACInput { struct flac_data : public FlacInput {
struct pcm_buffer buffer; struct pcm_buffer buffer;
/** /**

View File

@ -18,9 +18,9 @@
*/ */
#include "config.h" /* must be first for large file support */ #include "config.h" /* must be first for large file support */
#include "FLACDecoderPlugin.h" #include "FlacDecoderPlugin.h"
#include "FLACCommon.hxx" #include "FlacCommon.hxx"
#include "FLACMetaData.hxx" #include "FlacMetadata.hxx"
#include "OggCodec.hxx" #include "OggCodec.hxx"
#include <glib.h> #include <glib.h>
@ -87,7 +87,7 @@ static bool
flac_scan_file(const char *file, flac_scan_file(const char *file,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
FLACMetadataChain chain; FlacMetadataChain chain;
if (!chain.Read(file)) { if (!chain.Read(file)) {
g_debug("Failed to read FLAC tags: %s", g_debug("Failed to read FLAC tags: %s",
chain.GetStatusString()); chain.GetStatusString());
@ -102,7 +102,7 @@ static bool
flac_scan_stream(struct input_stream *is, flac_scan_stream(struct input_stream *is,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
FLACMetadataChain chain; FlacMetadataChain chain;
if (!chain.Read(is)) { if (!chain.Read(is)) {
g_debug("Failed to read FLAC tags: %s", g_debug("Failed to read FLAC tags: %s",
chain.GetStatusString()); chain.GetStatusString());
@ -214,14 +214,14 @@ static FLAC__StreamDecoderInitStatus
stream_init_oggflac(FLAC__StreamDecoder *flac_dec, struct flac_data *data) stream_init_oggflac(FLAC__StreamDecoder *flac_dec, struct flac_data *data)
{ {
return FLAC__stream_decoder_init_ogg_stream(flac_dec, return FLAC__stream_decoder_init_ogg_stream(flac_dec,
FLACInput::Read, FlacInput::Read,
FLACInput::Seek, FlacInput::Seek,
FLACInput::Tell, FlacInput::Tell,
FLACInput::Length, FlacInput::Length,
FLACInput::Eof, FlacInput::Eof,
flac_write_cb, flac_write_cb,
flacMetadata, flacMetadata,
FLACInput::Error, FlacInput::Error,
data); data);
} }
@ -229,14 +229,14 @@ static FLAC__StreamDecoderInitStatus
stream_init_flac(FLAC__StreamDecoder *flac_dec, struct flac_data *data) stream_init_flac(FLAC__StreamDecoder *flac_dec, struct flac_data *data)
{ {
return FLAC__stream_decoder_init_stream(flac_dec, return FLAC__stream_decoder_init_stream(flac_dec,
FLACInput::Read, FlacInput::Read,
FLACInput::Seek, FlacInput::Seek,
FLACInput::Tell, FlacInput::Tell,
FLACInput::Length, FlacInput::Length,
FLACInput::Eof, FlacInput::Eof,
flac_write_cb, flac_write_cb,
flacMetadata, flacMetadata,
FLACInput::Error, FlacInput::Error,
data); data);
} }
@ -298,7 +298,7 @@ static bool
oggflac_scan_file(const char *file, oggflac_scan_file(const char *file,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
FLACMetadataChain chain; FlacMetadataChain chain;
if (!chain.ReadOgg(file)) { if (!chain.ReadOgg(file)) {
g_debug("Failed to read OggFLAC tags: %s", g_debug("Failed to read OggFLAC tags: %s",
chain.GetStatusString()); chain.GetStatusString());
@ -313,7 +313,7 @@ static bool
oggflac_scan_stream(struct input_stream *is, oggflac_scan_stream(struct input_stream *is,
const struct tag_handler *handler, void *handler_ctx) const struct tag_handler *handler, void *handler_ctx)
{ {
FLACMetadataChain chain; FlacMetadataChain chain;
if (!chain.ReadOgg(is)) { if (!chain.ReadOgg(is)) {
g_debug("Failed to read OggFLAC tags: %s", g_debug("Failed to read OggFLAC tags: %s",
chain.GetStatusString()); chain.GetStatusString());

View File

@ -18,14 +18,14 @@
*/ */
#include "config.h" #include "config.h"
#include "FLACIOHandle.hxx" #include "FlacIOHandle.hxx"
#include "io_error.h" #include "io_error.h"
#include "gcc.h" #include "gcc.h"
#include <errno.h> #include <errno.h>
static size_t static size_t
FLACIORead(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle) FlacIORead(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
{ {
input_stream *is = (input_stream *)handle; input_stream *is = (input_stream *)handle;
@ -63,7 +63,7 @@ FLACIORead(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
} }
static int static int
FLACIOSeek(FLAC__IOHandle handle, FLAC__int64 offset, int whence) FlacIOSeek(FLAC__IOHandle handle, FLAC__int64 offset, int whence)
{ {
input_stream *is = (input_stream *)handle; input_stream *is = (input_stream *)handle;
@ -71,7 +71,7 @@ FLACIOSeek(FLAC__IOHandle handle, FLAC__int64 offset, int whence)
} }
static FLAC__int64 static FLAC__int64
FLACIOTell(FLAC__IOHandle handle) FlacIOTell(FLAC__IOHandle handle)
{ {
input_stream *is = (input_stream *)handle; input_stream *is = (input_stream *)handle;
@ -79,7 +79,7 @@ FLACIOTell(FLAC__IOHandle handle)
} }
static int static int
FLACIOEof(FLAC__IOHandle handle) FlacIOEof(FLAC__IOHandle handle)
{ {
input_stream *is = (input_stream *)handle; input_stream *is = (input_stream *)handle;
@ -87,7 +87,7 @@ FLACIOEof(FLAC__IOHandle handle)
} }
static int static int
FLACIOClose(gcc_unused FLAC__IOHandle handle) FlacIOClose(gcc_unused FLAC__IOHandle handle)
{ {
/* no-op because the libFLAC caller is repsonsible for closing /* no-op because the libFLAC caller is repsonsible for closing
the #input_stream */ the #input_stream */
@ -96,19 +96,19 @@ FLACIOClose(gcc_unused FLAC__IOHandle handle)
} }
const FLAC__IOCallbacks flac_io_callbacks = { const FLAC__IOCallbacks flac_io_callbacks = {
FLACIORead, FlacIORead,
nullptr, nullptr,
nullptr, nullptr,
nullptr, nullptr,
FLACIOEof, FlacIOEof,
FLACIOClose, FlacIOClose,
}; };
const FLAC__IOCallbacks flac_io_callbacks_seekable = { const FLAC__IOCallbacks flac_io_callbacks_seekable = {
FLACIORead, FlacIORead,
nullptr, nullptr,
FLACIOSeek, FlacIOSeek,
FLACIOTell, FlacIOTell,
FLACIOEof, FlacIOEof,
FLACIOClose, FlacIOClose,
}; };

View File

@ -29,13 +29,13 @@ extern const FLAC__IOCallbacks flac_io_callbacks;
extern const FLAC__IOCallbacks flac_io_callbacks_seekable; extern const FLAC__IOCallbacks flac_io_callbacks_seekable;
static inline FLAC__IOHandle static inline FLAC__IOHandle
ToFLACIOHandle(input_stream *is) ToFlacIOHandle(input_stream *is)
{ {
return (FLAC__IOHandle)is; return (FLAC__IOHandle)is;
} }
static inline const FLAC__IOCallbacks & static inline const FLAC__IOCallbacks &
GetFLACIOCallbacks(const input_stream *is) GetFlacIOCallbacks(const input_stream *is)
{ {
return is->seekable return is->seekable
? flac_io_callbacks_seekable ? flac_io_callbacks_seekable

View File

@ -18,13 +18,13 @@
*/ */
#include "config.h" #include "config.h"
#include "FLACInput.hxx" #include "FlacInput.hxx"
#include "decoder_api.h" #include "decoder_api.h"
#include "gcc.h" #include "gcc.h"
#include "InputStream.hxx" #include "InputStream.hxx"
FLAC__StreamDecoderReadStatus FLAC__StreamDecoderReadStatus
FLACInput::Read(FLAC__byte buffer[], size_t *bytes) FlacInput::Read(FLAC__byte buffer[], size_t *bytes)
{ {
size_t r = decoder_read(decoder, input_stream, (void *)buffer, *bytes); size_t r = decoder_read(decoder, input_stream, (void *)buffer, *bytes);
*bytes = r; *bytes = r;
@ -42,7 +42,7 @@ FLACInput::Read(FLAC__byte buffer[], size_t *bytes)
} }
FLAC__StreamDecoderSeekStatus FLAC__StreamDecoderSeekStatus
FLACInput::Seek(FLAC__uint64 absolute_byte_offset) FlacInput::Seek(FLAC__uint64 absolute_byte_offset)
{ {
if (!input_stream->seekable) if (!input_stream->seekable)
return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED;
@ -56,7 +56,7 @@ FLACInput::Seek(FLAC__uint64 absolute_byte_offset)
} }
FLAC__StreamDecoderTellStatus FLAC__StreamDecoderTellStatus
FLACInput::Tell(FLAC__uint64 *absolute_byte_offset) FlacInput::Tell(FLAC__uint64 *absolute_byte_offset)
{ {
if (!input_stream->seekable) if (!input_stream->seekable)
return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED;
@ -66,7 +66,7 @@ FLACInput::Tell(FLAC__uint64 *absolute_byte_offset)
} }
FLAC__StreamDecoderLengthStatus FLAC__StreamDecoderLengthStatus
FLACInput::Length(FLAC__uint64 *stream_length) FlacInput::Length(FLAC__uint64 *stream_length)
{ {
if (input_stream->size < 0) if (input_stream->size < 0)
return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED; return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;
@ -76,7 +76,7 @@ FLACInput::Length(FLAC__uint64 *stream_length)
} }
FLAC__bool FLAC__bool
FLACInput::Eof() FlacInput::Eof()
{ {
return (decoder != nullptr && return (decoder != nullptr &&
decoder_get_command(decoder) != DECODE_COMMAND_NONE && decoder_get_command(decoder) != DECODE_COMMAND_NONE &&
@ -85,7 +85,7 @@ FLACInput::Eof()
} }
void void
FLACInput::Error(FLAC__StreamDecoderErrorStatus status) FlacInput::Error(FLAC__StreamDecoderErrorStatus status)
{ {
if (decoder == nullptr || if (decoder == nullptr ||
decoder_get_command(decoder) != DECODE_COMMAND_STOP) decoder_get_command(decoder) != DECODE_COMMAND_STOP)
@ -93,56 +93,56 @@ FLACInput::Error(FLAC__StreamDecoderErrorStatus status)
} }
FLAC__StreamDecoderReadStatus FLAC__StreamDecoderReadStatus
FLACInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FLAC__byte buffer[], size_t *bytes, FLAC__byte buffer[], size_t *bytes,
void *client_data) void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
return i->Read(buffer, bytes); return i->Read(buffer, bytes);
} }
FLAC__StreamDecoderSeekStatus FLAC__StreamDecoderSeekStatus
FLACInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Seek(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 absolute_byte_offset, void *client_data) FLAC__uint64 absolute_byte_offset, void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
return i->Seek(absolute_byte_offset); return i->Seek(absolute_byte_offset);
} }
FLAC__StreamDecoderTellStatus FLAC__StreamDecoderTellStatus
FLACInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Tell(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 *absolute_byte_offset, void *client_data) FLAC__uint64 *absolute_byte_offset, void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
return i->Tell(absolute_byte_offset); return i->Tell(absolute_byte_offset);
} }
FLAC__StreamDecoderLengthStatus FLAC__StreamDecoderLengthStatus
FLACInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Length(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FLAC__uint64 *stream_length, void *client_data) FLAC__uint64 *stream_length, void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
return i->Length(stream_length); return i->Length(stream_length);
} }
FLAC__bool FLAC__bool
FLACInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder, FlacInput::Eof(gcc_unused const FLAC__StreamDecoder *flac_decoder,
void *client_data) void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
return i->Eof(); return i->Eof();
} }
void void
FLACInput::Error(gcc_unused const FLAC__StreamDecoder *decoder, FlacInput::Error(gcc_unused const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderErrorStatus status, void *client_data) FLAC__StreamDecoderErrorStatus status, void *client_data)
{ {
FLACInput *i = (FLACInput *)client_data; FlacInput *i = (FlacInput *)client_data;
i->Error(status); i->Error(status);
} }

View File

@ -26,13 +26,13 @@
* This class wraps an #input_stream in libFLAC stream decoder * This class wraps an #input_stream in libFLAC stream decoder
* callbacks. * callbacks.
*/ */
class FLACInput { class FlacInput {
struct decoder *decoder; struct decoder *decoder;
struct input_stream *input_stream; struct input_stream *input_stream;
public: public:
FLACInput(struct input_stream *_input_stream, FlacInput(struct input_stream *_input_stream,
struct decoder *_decoder=nullptr) struct decoder *_decoder=nullptr)
:decoder(_decoder), input_stream(_input_stream) {} :decoder(_decoder), input_stream(_input_stream) {}

View File

@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "FLACMetaData.hxx" #include "FlacMetadata.hxx"
extern "C" { extern "C" {
#include "XiphTags.h" #include "XiphTags.h"
@ -239,7 +239,7 @@ flac_vorbis_comments_to_tag(struct tag *tag,
} }
void void
FLACMetadataChain::Scan(const struct tag_handler *handler, void *handler_ctx) FlacMetadataChain::Scan(const struct tag_handler *handler, void *handler_ctx)
{ {
FLACMetadataIterator iterator(*this); FLACMetadataIterator iterator(*this);

View File

@ -21,19 +21,19 @@
#define MPD_FLAC_METADATA_H #define MPD_FLAC_METADATA_H
#include "gcc.h" #include "gcc.h"
#include "FLACIOHandle.hxx" #include "FlacIOHandle.hxx"
#include <FLAC/metadata.h> #include <FLAC/metadata.h>
#include <assert.h> #include <assert.h>
class FLACMetadataChain { class FlacMetadataChain {
FLAC__Metadata_Chain *chain; FLAC__Metadata_Chain *chain;
public: public:
FLACMetadataChain():chain(::FLAC__metadata_chain_new()) {} FlacMetadataChain():chain(::FLAC__metadata_chain_new()) {}
~FLACMetadataChain() { ~FlacMetadataChain() {
::FLAC__metadata_chain_delete(chain); ::FLAC__metadata_chain_delete(chain);
} }
@ -52,7 +52,7 @@ public:
} }
bool Read(input_stream *is) { bool Read(input_stream *is) {
return Read(::ToFLACIOHandle(is), ::GetFLACIOCallbacks(is)); return Read(::ToFlacIOHandle(is), ::GetFlacIOCallbacks(is));
} }
bool ReadOgg(const char *path) { bool ReadOgg(const char *path) {
@ -66,7 +66,7 @@ public:
} }
bool ReadOgg(input_stream *is) { bool ReadOgg(input_stream *is) {
return ReadOgg(::ToFLACIOHandle(is), ::GetFLACIOCallbacks(is)); return ReadOgg(::ToFlacIOHandle(is), ::GetFlacIOCallbacks(is));
} }
gcc_pure gcc_pure
@ -88,7 +88,7 @@ class FLACMetadataIterator {
public: public:
FLACMetadataIterator():iterator(::FLAC__metadata_iterator_new()) {} FLACMetadataIterator():iterator(::FLAC__metadata_iterator_new()) {}
FLACMetadataIterator(FLACMetadataChain &chain) FLACMetadataIterator(FlacMetadataChain &chain)
:iterator(::FLAC__metadata_iterator_new()) { :iterator(::FLAC__metadata_iterator_new()) {
::FLAC__metadata_iterator_init(iterator, ::FLAC__metadata_iterator_init(iterator,
(FLAC__Metadata_Chain *)chain); (FLAC__Metadata_Chain *)chain);

View File

@ -18,7 +18,7 @@
*/ */
#include "config.h" #include "config.h"
#include "FLAC_PCM.hxx" #include "FlacPcm.hxx"
#include <assert.h> #include <assert.h>