Merge pull request #5039 from CEikermann/patch-1
[vuplus_xbmc] / xbmc / cdrip / EncoderVorbis.h
1 #ifndef _ENCODERVORBIS_H
2 #define _ENCODERVORBIS_H
3
4 /*
5  *      Copyright (C) 2005-2013 Team XBMC
6  *      http://xbmc.org
7  *
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)
11  *  any later version.
12  *
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.
17  *
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/>.
21  *
22  */
23
24 #include "Encoder.h"
25 #include "DllOgg.h"
26 #include "DllVorbis.h"
27 #include "DllVorbisEnc.h"
28
29 class CEncoderVorbis : public CEncoder
30 {
31 public:
32   CEncoderVorbis();
33   virtual ~CEncoderVorbis() {};
34   bool Init(const char* strFile, int iInChannels, int iInRate, int iInBits);
35   int Encode(int nNumBytesRead, BYTE* pbtStream);
36   bool Close();
37   void AddTag(int key, const char* value);
38
39 protected:
40   vorbis_info m_sVorbisInfo; /* struct that stores all the static vorbis bitstream settings */
41   vorbis_dsp_state m_sVorbisDspState; /* central working state for the packet->PCM decoder */
42   vorbis_block m_sVorbisBlock; /* local working space for packet->PCM decode */
43   vorbis_comment m_sVorbisComment;
44
45   ogg_stream_state m_sOggStreamState; /* take physical pages, weld into a logical stream of packets */
46   ogg_page m_sOggPage; /* one Ogg bitstream page.  Vorbis packets are inside */
47   ogg_packet m_sOggPacket; /* one raw packet of data for decode */
48
49   BYTE* m_pBuffer;
50
51   DllOgg m_OggDll;
52   DllVorbis m_VorbisDll;
53   DllVorbisEnc m_VorbisEncDll;
54 };
55
56 #endif // _ENCODERVORBIS_H