5 * Copyright (C) 2005-2013 Team XBMC
8 * This Program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2, or (at your option)
13 * This Program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, see
20 * <http://www.gnu.org/licenses/>.
25 #include "DllFlacEnc.h"
27 class CEncoderFlac : public CEncoder
31 virtual ~CEncoderFlac();
32 bool Init(const char* strFile, int iInChannels, int iInRate, int iInBits);
33 int Encode(int nNumBytesRead, uint8_t* pbtStream);
38 FLAC__StreamEncoder *m_encoder;
39 FLAC__StreamMetadata *m_metadata[2];
41 static const int SAMPLES_BUF_SIZE = 1024 * 2;
42 FLAC__int32 *m_samplesBuf;
44 static FLAC__StreamEncoderWriteStatus write_callback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data);
47 #endif // _ENCODERFLAC_H