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