1 #ifndef __PCM_REMAP__H__
2 #define __PCM_REMAP__H__
5 * Copyright (C) 2005-2010 Team XBMC
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)
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.
18 * You should have received a copy of the GNU General Public License
19 * along with XBMC; see the file COPYING. If not, write to
20 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
21 * http://www.gnu.org/copyleft/gpl.html
27 #include "guilib/StdString.h"
39 PCM_FRONT_LEFT_OF_CENTER
,
40 PCM_FRONT_RIGHT_OF_CENTER
,
53 #define PCM_MAX_LAYOUT 10
70 enum PCMChannels channel
;
80 bool m_inSet
, m_outSet
;
81 enum PCMLayout m_channelLayout
;
82 unsigned int m_inChannels
, m_outChannels
;
83 unsigned int m_inSampleSize
;
84 enum PCMChannels m_inMap
[PCM_MAX_CH
];
85 enum PCMChannels m_outMap
[PCM_MAX_CH
];
86 enum PCMChannels m_layoutMap
[PCM_MAX_CH
+ 1];
89 bool m_useable
[PCM_MAX_CH
];
90 int m_inStride
, m_outStride
;
91 struct PCMMapInfo m_lookupMap
[PCM_MAX_CH
+ 1][PCM_MAX_CH
+ 1];
92 int m_counts
[PCM_MAX_CH
];
94 struct PCMMapInfo
* ResolveChannel(enum PCMChannels channel
, float level
, bool ifExists
, std::vector
<enum PCMChannels
> path
, struct PCMMapInfo
*tablePtr
);
95 void ResolveChannels(); //!< Partial BuildMap(), just enough to see which output channels are active
97 void DumpMap(CStdString info
, int unsigned channels
, enum PCMChannels
*channelMap
);
99 CStdString
PCMChannelStr(enum PCMChannels ename
);
100 CStdString
PCMLayoutStr(enum PCMLayout ename
);
107 enum PCMChannels
*SetInputFormat (unsigned int channels
, enum PCMChannels
*channelMap
, unsigned int sampleSize
);
108 void SetOutputFormat(unsigned int channels
, enum PCMChannels
*channelMap
, bool ignoreLayout
= false);
109 void Remap(void *data
, void *out
, unsigned int samples
);
111 int InBytesToFrames (int bytes
);
112 int FramesToOutBytes(int frames
);
113 int FramesToInBytes (int frames
);