PageRenderTime 28ms CodeModel.GetById 18ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h

http://github.com/xbmc/xbmc
C++ Header | 75 lines | 46 code | 10 blank | 19 comment | 0 complexity | 276f9e4eced8a6f33c83abb2edcf874f MD5 | raw file
 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
29class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
30{
31public:
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
48protected:
49  AVCodecContext*     m_pCodecContext;
50  SwrContext*         m_pConvert;
51  enum AVSampleFormat m_iSampleFormat;  
52  CAEChannelInfo      m_channelLayout;
53  bool                m_bLpcmMode;  
54  bool                m_bNeedConversion;
55
56  AVFrame* m_pFrame1;
57  int      m_iBufferSize1;
58  uint8_t*    m_pBuffer2;
59  int      m_iBufferSize2;
60  int      m_iBufferTotalSize2;
61
62  bool m_bOpenedCodec;
63  int m_iBuffered;
64
65  int      m_channels;
66  uint64_t m_layout;
67
68  DllAvCodec m_dllAvCodec;
69  DllAvUtil m_dllAvUtil;
70  DllSwResample m_dllSwResample;
71
72  void BuildChannelMap();
73  void ConvertToFloat();  
74};
75