changed: Improve (fallback) logic for subtitle downloading
[vuplus_xbmc] / xbmc / cores / dvdplayer / DVDCodecs / Audio / DVDAudioCodecFFmpeg.h
1 #pragma once
2
3 /*
4  *      Copyright (C) 2005-2013 Team XBMC
5  *      http://xbmc.org
6  *
7  *  This Program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2, or (at your option)
10  *  any later version.
11  *
12  *  This Program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with XBMC; see the file COPYING.  If not, see
19  *  <http://www.gnu.org/licenses/>.
20  *
21  */
22
23 #include "DVDAudioCodec.h"
24 #include "DllAvCodec.h"
25 #include "DllAvFormat.h"
26 #include "DllAvUtil.h"
27 #include "DllSwResample.h"
28
29 class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
30 {
31 public:
32   CDVDAudioCodecFFmpeg();
33   virtual ~CDVDAudioCodecFFmpeg();
34   virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
35   virtual void Dispose();
36   virtual int Decode(uint8_t* pData, int iSize);
37   virtual int GetData(uint8_t** dst);
38   virtual void Reset();
39   virtual int GetChannels();
40   virtual CAEChannelInfo GetChannelMap();
41   virtual int GetSampleRate();
42   virtual int GetEncodedSampleRate();
43   virtual enum AEDataFormat GetDataFormat();
44   virtual const char* GetName() { return "FFmpeg"; }
45   virtual int GetBufferSize() { return m_iBuffered; }
46   virtual int GetBitRate();
47
48 protected:
49   AVCodecContext*     m_pCodecContext;
50   SwrContext*         m_pConvert;
51   enum AVSampleFormat m_iSampleFormat;  
52   CAEChannelInfo      m_channelLayout;
53   bool                m_bLpcmMode;
54
55   AVFrame* m_pFrame1;
56   int      m_iBufferSize1;
57   uint8_t*    m_pBuffer2;
58   int      m_iBufferSize2;
59   int      m_iBufferTotalSize2;
60
61   bool m_bOpenedCodec;
62   int m_iBuffered;
63
64   int      m_channels;
65   uint64_t m_layout;
66
67   DllAvCodec m_dllAvCodec;
68   DllAvUtil m_dllAvUtil;
69   DllSwResample m_dllSwResample;
70
71   void BuildChannelMap();
72   void ConvertToFloat();  
73 };
74