4 * Copyright (C) 2005-2008 Team XBMC
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)
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.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, write to
19 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 * http://www.gnu.org/copyleft/gpl.html
24 #if (defined HAVE_CONFIG_H) && (!defined WIN32)
27 #include "threads/CriticalSection.h"
28 #include "PlatformDefs.h"
30 #include "cores/AudioEngine/Utils/AEChannelInfo.h"
37 #if (defined USE_EXTERNAL_FFMPEG)
38 #if (defined HAVE_LIBAVCODEC_AVCODEC_H)
39 #include <libavcodec/avcodec.h>
40 #elif (defined HAVE_FFMPEG_AVCODEC_H)
41 #include <ffmpeg/avcodec.h>
44 #include "libavcodec/avcodec.h"
48 typedef struct stDVDAudioFrame DVDAudioFrame;
55 CDVDAudio(volatile bool& bStop);
58 void SetVolume(float fVolume);
59 void SetDynamicRangeCompression(long drc);
60 float GetCurrentAttenuation();
63 bool Create(const DVDAudioFrame &audioframe, CodecID codec, bool needresampler);
64 bool IsValidFormat(const DVDAudioFrame &audioframe);
66 DWORD AddPackets(const DVDAudioFrame &audioframe);
67 double GetDelay(); // returns the time it takes to play a packet if we add one at this time
68 double GetCacheTime(); // returns total amount of data cached in audio output at this time
69 double GetCacheTotal(); // returns total amount the audio device can buffer
74 void SetSpeed(int iSpeed);
75 void SetResampleRatio(double ratio);
77 IAEStream *m_pAudioStream;
79 DWORD AddPacketsRenderer(unsigned char* data, DWORD len, CSingleLock &lock);
80 BYTE* m_pBuffer; // should be [m_dwPacketSize]
83 CCriticalSection m_critSection;
87 double m_SecondsPerByte;
89 CAEChannelInfo m_channelLayout;
92 volatile bool& m_bStop;
93 //counter that will go from 0 to m_iSpeed-1 and reset, data will only be output when speedstep is 0