mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
- Add iccvid, imaadp32.acm, msadp32.acm, msg711.acm, msvidc32 from Wine
svn path=/trunk/; revision=39825
This commit is contained in:
parent
35c0dcde31
commit
9f32d9e704
55 changed files with 5549 additions and 0 deletions
|
@ -18,6 +18,8 @@
|
|||
<property name="BASEADDRESS_SRCLIENT" value="0x512C0000" />
|
||||
<property name="BASEADDRESS_PSTOREC" value="0x513D0000" />
|
||||
<property name="BASEADDRESS_LPK" value="0x516C0000" />
|
||||
<property name="BASEADDRESS_MSG711ACM" value="0x584f0000" />
|
||||
<property name="BASEADDRESS_IMAADP32ACM" value="0x585e0000" />
|
||||
<property name="BASEADDRESS_TELEPHON" value="0x58750000" />
|
||||
<property name="BASEADDRESS_PWRCFG" value="0x587e0000" />
|
||||
<property name="BASEADDRESS_MMSYS" value="0x588a0000" />
|
||||
|
@ -119,17 +121,20 @@
|
|||
<property name="BASEADDRESS_WINFAX" value="0x722C0000" />
|
||||
<property name="BASEADDRESS_WINSCARD" value="0x723d0000" />
|
||||
<property name="BASEADDRESS_DEVMGR" value="0x72a90000" />
|
||||
<property name="BASEADDRESS_MSADP32ACM" value="0x72cb0000" />
|
||||
<property name="BASEADDRESS_WDMAUD" value="0x72d20000" />
|
||||
<property name="BASEADDRESS_WINSPOOL" value="0x72f50000" />
|
||||
<property name="BASEADDRESS_MSCAT32" value="0x732b0000" />
|
||||
<property name="BASEADDRESS_MSTASK" value="0x73520000" />
|
||||
<property name="BASEADDRESS_MCIAVI32" value="0x73610000" />
|
||||
<property name="BASEADDRESS_MSVIDC32" value="0x73650000" />
|
||||
<property name="BASEADDRESS_MSRLE32" value="0x73660000" />
|
||||
<property name="BASEADDRESS_MSDMO" value="0x73670000" />
|
||||
<property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" />
|
||||
<property name="BASEADDRESS_MSCMS" value="0x73af0000" />
|
||||
<property name="BASEADDRESS_DCIMAN32" value="0x73b10000" />
|
||||
<property name="BASEADDRESS_STI" value="0x73b60000" />
|
||||
<property name="BASEADDRESS_ICCVID" value="0x73bc0000" />
|
||||
<property name="BASEADDRESS_LZ32" value="0x73d80000" />
|
||||
<property name="BASEADDRESS_COREDLL" value="0x73d80000" />
|
||||
<property name="BASEADDRESS_KSUSER" value="0x73ea0000" />
|
||||
|
|
|
@ -60,6 +60,23 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midimapper",0x000
|
|||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wavemapper",0x00000000,"c:\reactos\system32\msacm32.dll"
|
||||
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wave",0x00000000,"sndblst.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midi",0x00000000,"c:\reactos\system32\beepmidi.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.msadpcm",0x00000000,"c:\reactos\system32\msadp32.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.msg711",0x00000000,"c:\reactos\system32\msg711.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.imaadpcm",0x00000000,"c:\reactos\system32\imaadp32.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.cvid",0x00000000,"c:\reactos\system32\iccvid.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.mrle",0x00000000,"c:\reactos\system32\msrle32.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.msvc",0x00000000,"c:\reactos\system32\msvidc32.dll"
|
||||
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","AVIVideo",0x00000002,"c:\reactos\system32\mciavi32.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","CDAudio",0x00000002,"c:\reactos\system32\mcicda.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","Sequencer",0x00000002,"c:\reactos\system32\mciseq.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","WaveAudio",0x00000002,"c:\reactos\system32\mciwave.dll"
|
||||
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","avi",0x00000002,"avivideo"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","cda",0x00000002,"CDAudio"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mid",0x00000002,"Sequencer"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"Sequencer"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","wav",0x00000002,"WaveAudio"
|
||||
|
||||
; Mesa OpenGL Driver
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers","DefaultDriver",0x00000000,"Mesa"
|
||||
|
|
|
@ -65,6 +65,23 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midimapper",0x000
|
|||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wavemapper",0x00000000,"c:\reactos\system32\msacm32.dll"
|
||||
;HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","wave",0x00000000,"sndblst.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","midi",0x00000000,"c:\reactos\system32\beepmidi.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.msadpcm",0x00000000,"c:\reactos\system32\msadp32.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.msg711",0x00000000,"c:\reactos\system32\msg711.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","msacm.imaadpcm",0x00000000,"c:\reactos\system32\imaadp32.acm"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.cvid",0x00000000,"c:\reactos\system32\iccvid.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.mrle",0x00000000,"c:\reactos\system32\msrle32.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32","vidc.msvc",0x00000000,"c:\reactos\system32\msvidc32.dll"
|
||||
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","AVIVideo",0x00000002,"c:\reactos\system32\mciavi32.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","CDAudio",0x00000002,"c:\reactos\system32\mcicda.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","Sequencer",0x00000002,"c:\reactos\system32\mciseq.dll"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","WaveAudio",0x00000002,"c:\reactos\system32\mciwave.dll"
|
||||
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","avi",0x00000002,"avivideo"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","cda",0x00000002,"CDAudio"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mid",0x00000002,"Sequencer"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"Sequencer"
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","wav",0x00000002,"WaveAudio"
|
||||
|
||||
; Mesa OpenGL Driver
|
||||
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers","DefaultDriver",0x00000000,"Mesa"
|
||||
|
|
|
@ -276,7 +276,9 @@ dll\win32\glu32\glu32.dll 1
|
|||
dll\win32\hhctrl.ocx\hhctrl.ocx 1
|
||||
dll\win32\hid\hid.dll 1
|
||||
dll\win32\hlink\hlink.dll 1
|
||||
dll\win32\iccvid\iccvid.dll 1
|
||||
dll\win32\icmp\icmp.dll 1
|
||||
dll\win32\imaadp32.acm\imaadp32.acm 1
|
||||
dll\win32\imagehlp\imagehlp.dll 1
|
||||
dll\win32\imm32\imm32.dll 1
|
||||
dll\win32\inetcomm\inetcomm.dll 1
|
||||
|
@ -303,12 +305,14 @@ dll\win32\modemui\modemui.dll 1
|
|||
dll\win32\mpr\mpr.dll 1
|
||||
dll\win32\mprapi\mprapi.dll 1
|
||||
dll\win32\msacm32\msacm32.dll 1
|
||||
dll\win32\msadp32.acm\msadp32.acm 1
|
||||
dll\win32\msafd\msafd.dll 1
|
||||
dll\win32\mscat32\mscat32.dll 1
|
||||
dll\win32\mscms\mscms.dll 1
|
||||
dll\win32\mscoree\mscoree.dll 1
|
||||
dll\win32\msctf\msctf.dll 1
|
||||
dll\win32\msftedit\msftedit.dll 1
|
||||
dll\win32\msg711.acm\msg711.acm 1
|
||||
dll\win32\msgina\msgina.dll 1
|
||||
dll\win32\mshtml\mshtml.dll 1
|
||||
dll\win32\mshtml.tlb\mshtml.tlb 1
|
||||
|
@ -321,6 +325,7 @@ dll\win32\msvcrt\msvcrt.dll 1
|
|||
dll\win32\msvcrt20\msvcrt20.dll 1
|
||||
dll\win32\msvcrt40\msvcrt40.dll 1
|
||||
dll\win32\msvfw32\msvfw32.dll 1
|
||||
dll\win32\msvidc32\msvidc32.dll 1
|
||||
dll\win32\mswsock\mswsock.dll 1
|
||||
dll\win32\msxml3\msxml3.dll 1
|
||||
dll\win32\nddeapi\nddeapi.dll 1
|
||||
|
|
1042
reactos/dll/win32/iccvid/iccvid.c
Normal file
1042
reactos/dll/win32/iccvid/iccvid.c
Normal file
File diff suppressed because it is too large
Load diff
12
reactos/dll/win32/iccvid/iccvid.rbuild
Normal file
12
reactos/dll/win32/iccvid/iccvid.rbuild
Normal file
|
@ -0,0 +1,12 @@
|
|||
<module name="iccvid" type="win32dll" baseaddress="${BASEADDRESS_ICCVID}" installbase="system32" installname="iccvid.dll" allowwarnings="true">
|
||||
<importlibrary definition="iccvid.spec" />
|
||||
<include base="iccvid">.</include>
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<define name="__WINESRC__" />
|
||||
<file>iccvid.c</file>
|
||||
<file>rsrc.rc</file>
|
||||
<library>wine</library>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
1
reactos/dll/win32/iccvid/iccvid.spec
Normal file
1
reactos/dll/win32/iccvid/iccvid.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall -private DriverProc(long long long long long) ICCVID_DriverProc
|
27
reactos/dll/win32/iccvid/iccvid_Da.rc
Normal file
27
reactos/dll/win32/iccvid/iccvid_Da.rc
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Danish resources for iccvid
|
||||
*
|
||||
* Copyright 2008 Jens Albretsen <jens@albretsen.dk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak videokodeks"
|
||||
IDS_DESCRIPTION "Cinepak videokodeks"
|
||||
}
|
26
reactos/dll/win32/iccvid/iccvid_De.rc
Normal file
26
reactos/dll/win32/iccvid/iccvid_De.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2005 Henning Gerhardt
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Video Codec"
|
||||
IDS_DESCRIPTION "Cinepak Video Codec"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_En.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_En.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Video codec"
|
||||
IDS_DESCRIPTION "Cinepak Video codec"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Fr.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Fr.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2006 Jonathan Ernst
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "codec vidéo Cinepak"
|
||||
IDS_DESCRIPTION "codec vidéo Cinepak"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Hu.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Hu.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2006 Andras Kovacs
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Video kodek"
|
||||
IDS_DESCRIPTION "Cinepak Video kodek"
|
||||
}
|
26
reactos/dll/win32/iccvid/iccvid_Ko.rc
Normal file
26
reactos/dll/win32/iccvid/iccvid_Ko.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2005 YunSomg Hwang
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "시네팩 비디오 코덱"
|
||||
IDS_DESCRIPTION "시네팩 비디오 코덱"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Nl.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Nl.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Frans Kool
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Video codec"
|
||||
IDS_DESCRIPTION "Cinepak Video codec"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_No.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_No.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Alexander N. Sørnes <alex@thehandofagony.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak-videokodek"
|
||||
IDS_DESCRIPTION "Cinepak-videokodek"
|
||||
}
|
26
reactos/dll/win32/iccvid/iccvid_Pl.rc
Normal file
26
reactos/dll/win32/iccvid/iccvid_Pl.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2006 Mikolaj Zalewski
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Kodek Cinepak Video"
|
||||
IDS_DESCRIPTION "Kodek Cinepak Video"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Pt.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Pt.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Ricardo Filipe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Codec Video Cinepak"
|
||||
IDS_DESCRIPTION "Codec Video Cinepak"
|
||||
}
|
26
reactos/dll/win32/iccvid/iccvid_Ro.rc
Normal file
26
reactos/dll/win32/iccvid/iccvid_Ro.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2008 Michael Stefaniuc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Codecul Cinepak Video"
|
||||
IDS_DESCRIPTION "Codecul Cinepak Video"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Ru.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Ru.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Vitaliy Margolen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Âèäåî êîäåð-äåêîäåð Cinepak"
|
||||
IDS_DESCRIPTION "Âèäåî êîäåð-äåêîäåð Cinepak"
|
||||
}
|
29
reactos/dll/win32/iccvid/iccvid_Si.rc
Normal file
29
reactos/dll/win32/iccvid/iccvid_Si.rc
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright 2008 Rok Mandeljc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#pragma code_page(65001)
|
||||
|
||||
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Video kodek"
|
||||
IDS_DESCRIPTION "Cinepak Video kodek"
|
||||
}
|
||||
|
||||
#pragma code_page(default)
|
25
reactos/dll/win32/iccvid/iccvid_Sv.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Sv.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2007 Daniel Nylander
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak videokodek"
|
||||
IDS_DESCRIPTION "Cinepak videokodek"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_Tr.rc
Normal file
25
reactos/dll/win32/iccvid/iccvid_Tr.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2006 Fatih Aþýcý
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "Cinepak Vidyo çözücü"
|
||||
IDS_DESCRIPTION "Cinepak Vidyo çözücü"
|
||||
}
|
25
reactos/dll/win32/iccvid/iccvid_private.h
Normal file
25
reactos/dll/win32/iccvid/iccvid_private.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __ICCVID_PRIVATE_H
|
||||
#define __ICCVID_PRIVATE_H
|
||||
|
||||
#define IDS_NAME 100
|
||||
#define IDS_DESCRIPTION 101
|
||||
|
||||
#endif /* __ICCVID_PRIVATE_H */
|
36
reactos/dll/win32/iccvid/rsrc.rc
Normal file
36
reactos/dll/win32/iccvid/rsrc.rc
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "windef.h"
|
||||
#include "iccvid_private.h"
|
||||
|
||||
#include "iccvid_Da.rc"
|
||||
#include "iccvid_De.rc"
|
||||
#include "iccvid_En.rc"
|
||||
#include "iccvid_Fr.rc"
|
||||
#include "iccvid_Hu.rc"
|
||||
#include "iccvid_Ko.rc"
|
||||
#include "iccvid_Nl.rc"
|
||||
#include "iccvid_No.rc"
|
||||
#include "iccvid_Pl.rc"
|
||||
#include "iccvid_Pt.rc"
|
||||
#include "iccvid_Ro.rc"
|
||||
#include "iccvid_Ru.rc"
|
||||
#include "iccvid_Si.rc"
|
||||
#include "iccvid_Sv.rc"
|
||||
#include "iccvid_Tr.rc"
|
12
reactos/dll/win32/imaadp32.acm/imaadp32.acm.rbuild
Normal file
12
reactos/dll/win32/imaadp32.acm/imaadp32.acm.rbuild
Normal file
|
@ -0,0 +1,12 @@
|
|||
<module name="imaadp32.acm" type="win32dll" baseaddress="${BASEADDRESS_IMAADP32ACM}" installbase="system32" installname="imaadp32.acm" allowwarnings="true" entrypoint="0">
|
||||
<importlibrary definition="imaadp32.acm.spec" />
|
||||
<include base="imaadp32.acm">.</include>
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<define name="__WINESRC__" />
|
||||
<file>imaadp32.c</file>
|
||||
<library>wine</library>
|
||||
<library>winmm</library>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
1
reactos/dll/win32/imaadp32.acm/imaadp32.acm.spec
Normal file
1
reactos/dll/win32/imaadp32.acm/imaadp32.acm.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall -private DriverProc (long long long long long) ADPCM_DriverProc
|
926
reactos/dll/win32/imaadp32.acm/imaadp32.c
Normal file
926
reactos/dll/win32/imaadp32.acm/imaadp32.c
Normal file
|
@ -0,0 +1,926 @@
|
|||
/*
|
||||
* IMA ADPCM handling
|
||||
*
|
||||
* Copyright (C) 2001,2002 Eric Pouech
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "mmsystem.h"
|
||||
#include "mmreg.h"
|
||||
#include "msacm.h"
|
||||
#include "msacmdrv.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
/* see http://www.pcisys.net/~melanson/codecs/adpcm.txt for the details */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(adpcm);
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_drvOpen
|
||||
*/
|
||||
static LRESULT ADPCM_drvOpen(LPCSTR str)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_drvClose
|
||||
*/
|
||||
static LRESULT ADPCM_drvClose(DWORD_PTR dwDevID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
typedef struct tagAcmAdpcmData
|
||||
{
|
||||
void (*convert)(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char*, LPDWORD, unsigned char*, LPDWORD);
|
||||
/* IMA encoding only */
|
||||
BYTE stepIndexL;
|
||||
BYTE stepIndexR;
|
||||
/* short sample; */
|
||||
} AcmAdpcmData;
|
||||
|
||||
/* table to list all supported formats... those are the basic ones. this
|
||||
* also helps given a unique index to each of the supported formats
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int nChannels;
|
||||
int nBits;
|
||||
int rate;
|
||||
} Format;
|
||||
|
||||
static const Format PCM_Formats[] =
|
||||
{
|
||||
{1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
|
||||
{1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
|
||||
{1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
|
||||
{1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
|
||||
};
|
||||
|
||||
static const Format ADPCM_Formats[] =
|
||||
{
|
||||
{1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025},
|
||||
{1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100},
|
||||
};
|
||||
|
||||
#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0]))
|
||||
#define NUM_ADPCM_FORMATS (sizeof(ADPCM_Formats) / sizeof(ADPCM_Formats[0]))
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_GetFormatIndex
|
||||
*/
|
||||
static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX *wfx)
|
||||
{
|
||||
int i, hi;
|
||||
const Format* fmts;
|
||||
|
||||
switch (wfx->wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
hi = NUM_PCM_FORMATS;
|
||||
fmts = PCM_Formats;
|
||||
break;
|
||||
case WAVE_FORMAT_IMA_ADPCM:
|
||||
hi = NUM_ADPCM_FORMATS;
|
||||
fmts = ADPCM_Formats;
|
||||
break;
|
||||
default:
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
for (i = 0; i < hi; i++)
|
||||
{
|
||||
if (wfx->nChannels == fmts[i].nChannels &&
|
||||
wfx->nSamplesPerSec == fmts[i].rate &&
|
||||
wfx->wBitsPerSample == fmts[i].nBits)
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* R16
|
||||
*
|
||||
* Read a 16 bit sample (correctly handles endianess)
|
||||
*/
|
||||
static inline short R16(const unsigned char* src)
|
||||
{
|
||||
return (short)((unsigned short)src[0] | ((unsigned short)src[1] << 8));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* W16
|
||||
*
|
||||
* Write a 16 bit sample (correctly handles endianess)
|
||||
*/
|
||||
static inline void W16(unsigned char* dst, short s)
|
||||
{
|
||||
dst[0] = LOBYTE(s);
|
||||
dst[1] = HIBYTE(s);
|
||||
}
|
||||
|
||||
/* IMA (or DVI) APDCM codec routines */
|
||||
|
||||
static const unsigned IMA_StepTable[89] =
|
||||
{
|
||||
7, 8, 9, 10, 11, 12, 13, 14,
|
||||
16, 17, 19, 21, 23, 25, 28, 31,
|
||||
34, 37, 41, 45, 50, 55, 60, 66,
|
||||
73, 80, 88, 97, 107, 118, 130, 143,
|
||||
157, 173, 190, 209, 230, 253, 279, 307,
|
||||
337, 371, 408, 449, 494, 544, 598, 658,
|
||||
724, 796, 876, 963, 1060, 1166, 1282, 1411,
|
||||
1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024,
|
||||
3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484,
|
||||
7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
|
||||
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794,
|
||||
32767
|
||||
};
|
||||
|
||||
static const int IMA_IndexTable[16] =
|
||||
{
|
||||
-1, -1, -1, -1, 2, 4, 6, 8,
|
||||
-1, -1, -1, -1, 2, 4, 6, 8
|
||||
};
|
||||
|
||||
static inline void clamp_step_index(int* stepIndex)
|
||||
{
|
||||
if (*stepIndex < 0 ) *stepIndex = 0;
|
||||
if (*stepIndex > 88) *stepIndex = 88;
|
||||
}
|
||||
|
||||
static inline void clamp_sample(int* sample)
|
||||
{
|
||||
if (*sample < -32768) *sample = -32768;
|
||||
if (*sample > 32767) *sample = 32767;
|
||||
}
|
||||
|
||||
static inline void process_nibble(unsigned char code, int* stepIndex, int* sample)
|
||||
{
|
||||
unsigned step;
|
||||
int diff;
|
||||
|
||||
code &= 0x0F;
|
||||
|
||||
step = IMA_StepTable[*stepIndex];
|
||||
diff = step >> 3;
|
||||
if (code & 1) diff += step >> 2;
|
||||
if (code & 2) diff += step >> 1;
|
||||
if (code & 4) diff += step;
|
||||
if (code & 8) *sample -= diff;
|
||||
else *sample += diff;
|
||||
clamp_sample(sample);
|
||||
*stepIndex += IMA_IndexTable[code];
|
||||
clamp_step_index(stepIndex);
|
||||
}
|
||||
|
||||
static inline unsigned char generate_nibble(int in, int* stepIndex, int* sample)
|
||||
{
|
||||
int effdiff, diff = in - *sample;
|
||||
unsigned step;
|
||||
unsigned char code;
|
||||
|
||||
if (diff < 0)
|
||||
{
|
||||
diff = -diff;
|
||||
code = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
code = 0;
|
||||
}
|
||||
|
||||
step = IMA_StepTable[*stepIndex];
|
||||
effdiff = (step >> 3);
|
||||
if (diff >= step)
|
||||
{
|
||||
code |= 4;
|
||||
diff -= step;
|
||||
effdiff += step;
|
||||
}
|
||||
step >>= 1;
|
||||
if (diff >= step)
|
||||
{
|
||||
code |= 2;
|
||||
diff -= step;
|
||||
effdiff += step;
|
||||
}
|
||||
step >>= 1;
|
||||
if (diff >= step)
|
||||
{
|
||||
code |= 1;
|
||||
effdiff += step;
|
||||
}
|
||||
if (code & 8) *sample -= effdiff;
|
||||
else *sample += effdiff;
|
||||
clamp_sample(sample);
|
||||
*stepIndex += IMA_IndexTable[code];
|
||||
clamp_step_index(stepIndex);
|
||||
return code;
|
||||
}
|
||||
|
||||
static void cvtSSima16K(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int i;
|
||||
int sampleL, sampleR;
|
||||
int stepIndexL, stepIndexR;
|
||||
int nsamp_blk = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
int nsamp;
|
||||
/* compute the number of entire blocks we can decode...
|
||||
* it's the min of the number of entire blocks in source buffer and the number
|
||||
* of entire blocks in destination buffer
|
||||
*/
|
||||
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
|
||||
*ndst / (nsamp_blk * 2 * 2));
|
||||
|
||||
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
|
||||
*ndst = nblock * (nsamp_blk * 2 * 2);
|
||||
|
||||
nsamp_blk--; /* remove the sample in block header */
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
const unsigned char* in_src = src;
|
||||
|
||||
/* handle headers first */
|
||||
sampleL = R16(src);
|
||||
stepIndexL = (unsigned)*(src + 2);
|
||||
clamp_step_index(&stepIndexL);
|
||||
src += 4;
|
||||
W16(dst, sampleL); dst += 2;
|
||||
|
||||
sampleR = R16(src);
|
||||
stepIndexR = (unsigned)*(src + 2);
|
||||
clamp_step_index(&stepIndexR);
|
||||
src += 4;
|
||||
W16(dst, sampleR); dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
process_nibble(*src, &stepIndexL, &sampleL);
|
||||
W16(dst + (2 * i + 0) * 4 + 0, sampleL);
|
||||
process_nibble(*src++ >> 4, &stepIndexL, &sampleL);
|
||||
W16(dst + (2 * i + 1) * 4 + 0, sampleL);
|
||||
}
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
process_nibble(*src , &stepIndexR, &sampleR);
|
||||
W16(dst + (2 * i + 0) * 4 + 2, sampleR);
|
||||
process_nibble(*src++ >>4, &stepIndexR, &sampleR);
|
||||
W16(dst + (2 * i + 1) * 4 + 2, sampleR);
|
||||
}
|
||||
dst += 32;
|
||||
}
|
||||
/* we have now to realign the source pointer on block */
|
||||
src = in_src + adsi->pwfxSrc->nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
static void cvtMMima16K(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int sample;
|
||||
int stepIndex;
|
||||
int nsamp_blk = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
int nsamp;
|
||||
/* compute the number of entire blocks we can decode...
|
||||
* it's the min of the number of entire blocks in source buffer and the number
|
||||
* of entire blocks in destination buffer
|
||||
*/
|
||||
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
|
||||
*ndst / (nsamp_blk * 2));
|
||||
|
||||
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
|
||||
*ndst = nblock * nsamp_blk * 2;
|
||||
|
||||
nsamp_blk--; /* remove the sample in block header */
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
const unsigned char* in_src = src;
|
||||
|
||||
/* handle header first */
|
||||
sample = R16(src);
|
||||
stepIndex = (unsigned)*(src + 2);
|
||||
clamp_step_index(&stepIndex);
|
||||
src += 4;
|
||||
W16(dst, sample); dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
|
||||
{
|
||||
process_nibble(*src, &stepIndex, &sample);
|
||||
W16(dst, sample); dst += 2;
|
||||
process_nibble(*src++ >> 4, &stepIndex, &sample);
|
||||
W16(dst, sample); dst += 2;
|
||||
}
|
||||
/* we have now to realign the source pointer on block */
|
||||
src = in_src + adsi->pwfxSrc->nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
static void cvtSS16imaK(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int stepIndexL, stepIndexR;
|
||||
int sampleL, sampleR;
|
||||
BYTE code1, code2;
|
||||
int nsamp_blk = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxDst)->wSamplesPerBlock;
|
||||
int i, nsamp;
|
||||
/* compute the number of entire blocks we can decode...
|
||||
* it's the min of the number of entire blocks in source buffer and the number
|
||||
* of entire blocks in destination buffer
|
||||
*/
|
||||
DWORD nblock = min(*nsrc / (nsamp_blk * 2 * 2),
|
||||
*ndst / adsi->pwfxDst->nBlockAlign);
|
||||
|
||||
*nsrc = nblock * (nsamp_blk * 2 * 2);
|
||||
*ndst = nblock * adsi->pwfxDst->nBlockAlign;
|
||||
|
||||
stepIndexL = ((AcmAdpcmData*)adsi->dwDriver)->stepIndexL;
|
||||
stepIndexR = ((AcmAdpcmData*)adsi->dwDriver)->stepIndexR;
|
||||
|
||||
nsamp_blk--; /* so that we won't count the sample in header while filling the block */
|
||||
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
unsigned char* in_dst = dst;
|
||||
|
||||
/* generate header */
|
||||
sampleL = R16(src); src += 2;
|
||||
W16(dst, sampleL); dst += 2;
|
||||
*dst = (unsigned char)(unsigned)stepIndexL;
|
||||
dst += 2;
|
||||
|
||||
sampleR = R16(src); src += 2;
|
||||
W16(dst, sampleR); dst += 2;
|
||||
*dst = (unsigned char)(unsigned)stepIndexR;
|
||||
dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 8)
|
||||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 0),
|
||||
&stepIndexL, &sampleL);
|
||||
code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 0),
|
||||
&stepIndexL, &sampleL);
|
||||
*dst++ = (code1 << 4) | code2;
|
||||
}
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
code1 = generate_nibble(R16(src + (2 * i + 0) * 2 + 1),
|
||||
&stepIndexR, &sampleR);
|
||||
code2 = generate_nibble(R16(src + (2 * i + 1) * 2 + 1),
|
||||
&stepIndexR, &sampleR);
|
||||
*dst++ = (code1 << 4) | code2;
|
||||
}
|
||||
src += 32;
|
||||
}
|
||||
dst = in_dst + adsi->pwfxDst->nBlockAlign;
|
||||
}
|
||||
((AcmAdpcmData*)adsi->dwDriver)->stepIndexL = stepIndexL;
|
||||
((AcmAdpcmData*)adsi->dwDriver)->stepIndexR = stepIndexR;
|
||||
}
|
||||
|
||||
static void cvtMM16imaK(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int stepIndex;
|
||||
int sample;
|
||||
BYTE code1, code2;
|
||||
int nsamp_blk = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxDst)->wSamplesPerBlock;
|
||||
int nsamp;
|
||||
/* compute the number of entire blocks we can decode...
|
||||
* it's the min of the number of entire blocks in source buffer and the number
|
||||
* of entire blocks in destination buffer
|
||||
*/
|
||||
DWORD nblock = min(*nsrc / (nsamp_blk * 2),
|
||||
*ndst / adsi->pwfxDst->nBlockAlign);
|
||||
|
||||
*nsrc = nblock * (nsamp_blk * 2);
|
||||
*ndst = nblock * adsi->pwfxDst->nBlockAlign;
|
||||
|
||||
stepIndex = ((AcmAdpcmData*)adsi->dwDriver)->stepIndexL;
|
||||
nsamp_blk--; /* so that we won't count the sample in header while filling the block */
|
||||
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
unsigned char* in_dst = dst;
|
||||
|
||||
/* generate header */
|
||||
/* FIXME: what about the last effective sample from previous block ??? */
|
||||
/* perhaps something like:
|
||||
* sample += R16(src);
|
||||
* clamp_sample(sample);
|
||||
* and with :
|
||||
* + saving the sample in adsi->dwDriver when all blocks are done
|
||||
+ + reset should set the field in adsi->dwDriver to 0 too
|
||||
*/
|
||||
sample = R16(src); src += 2;
|
||||
W16(dst, sample); dst += 2;
|
||||
*dst = (unsigned char)(unsigned)stepIndex;
|
||||
dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
|
||||
{
|
||||
code1 = generate_nibble(R16(src), &stepIndex, &sample);
|
||||
src += 2;
|
||||
code2 = generate_nibble(R16(src), &stepIndex, &sample);
|
||||
src += 2;
|
||||
*dst++ = (code1 << 4) | code2;
|
||||
}
|
||||
dst = in_dst + adsi->pwfxDst->nBlockAlign;
|
||||
}
|
||||
((AcmAdpcmData*)adsi->dwDriver)->stepIndexL = stepIndex;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_DriverDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add)
|
||||
{
|
||||
add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
|
||||
add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
|
||||
add->wMid = 0x1;
|
||||
add->wPid = 0x22;
|
||||
add->vdwACM = 0x3320000;
|
||||
add->vdwDriver = 0x04000000;
|
||||
add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
add->cFormatTags = 2; /* PCM, IMA ADPCM */
|
||||
add->cFilterTags = 0;
|
||||
add->hicon = NULL;
|
||||
MultiByteToWideChar( CP_ACP, 0, "Microsoft IMA ADPCM", -1,
|
||||
add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Microsoft IMA ADPCM CODEC", -1,
|
||||
add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
|
||||
add->szCopyright, sizeof(add->szCopyright)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
|
||||
add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) );
|
||||
add->szFeatures[0] = 0;
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatTagDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
|
||||
{
|
||||
static const WCHAR szPcm[]={'P','C','M',0};
|
||||
static const WCHAR szImaAdPcm[]={'I','M','A',' ','A','D','P','C','M',0};
|
||||
|
||||
switch (dwQuery)
|
||||
{
|
||||
case ACM_FORMATTAGDETAILSF_INDEX:
|
||||
if (aftd->dwFormatTagIndex >= 2) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
case ACM_FORMATTAGDETAILSF_LARGESTSIZE:
|
||||
if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
|
||||
{
|
||||
aftd->dwFormatTagIndex = 1; /* WAVE_FORMAT_IMA_ADPCM is bigger than PCM */
|
||||
break;
|
||||
}
|
||||
/* fall thru */
|
||||
case ACM_FORMATTAGDETAILSF_FORMATTAG:
|
||||
switch (aftd->dwFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
|
||||
case WAVE_FORMAT_IMA_ADPCM: aftd->dwFormatTagIndex = 1; break;
|
||||
default: return ACMERR_NOTPOSSIBLE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", dwQuery);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
switch (aftd->dwFormatTagIndex)
|
||||
{
|
||||
case 0:
|
||||
aftd->dwFormatTag = WAVE_FORMAT_PCM;
|
||||
aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
|
||||
aftd->cStandardFormats = NUM_PCM_FORMATS;
|
||||
lstrcpyW(aftd->szFormatTag, szPcm);
|
||||
break;
|
||||
case 1:
|
||||
aftd->dwFormatTag = WAVE_FORMAT_IMA_ADPCM;
|
||||
aftd->cbFormatSize = sizeof(IMAADPCMWAVEFORMAT);
|
||||
aftd->cStandardFormats = NUM_ADPCM_FORMATS;
|
||||
lstrcpyW(aftd->szFormatTag, szImaAdPcm);
|
||||
break;
|
||||
}
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
|
||||
{
|
||||
switch (dwQuery)
|
||||
{
|
||||
case ACM_FORMATDETAILSF_FORMAT:
|
||||
if (ADPCM_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
case ACM_FORMATDETAILSF_INDEX:
|
||||
afd->pwfx->wFormatTag = afd->dwFormatTag;
|
||||
switch (afd->dwFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE;
|
||||
afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
|
||||
afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
|
||||
afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
|
||||
/* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible
|
||||
* afd->pwfx->cbSize = 0;
|
||||
*/
|
||||
afd->pwfx->nBlockAlign =
|
||||
(afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
|
||||
afd->pwfx->nAvgBytesPerSec =
|
||||
afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
|
||||
break;
|
||||
case WAVE_FORMAT_IMA_ADPCM:
|
||||
if (afd->dwFormatIndex >= NUM_ADPCM_FORMATS) return ACMERR_NOTPOSSIBLE;
|
||||
afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels;
|
||||
afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate;
|
||||
afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;
|
||||
afd->pwfx->nBlockAlign = 1024;
|
||||
/* we got 4 bits per sample */
|
||||
afd->pwfx->nAvgBytesPerSec =
|
||||
(afd->pwfx->nSamplesPerSec * 4) / 8;
|
||||
if (afd->cbwfx >= sizeof(WAVEFORMATEX))
|
||||
afd->pwfx->cbSize = sizeof(WORD);
|
||||
if (afd->cbwfx >= sizeof(IMAADPCMWAVEFORMAT))
|
||||
((IMAADPCMWAVEFORMAT*)afd->pwfx)->wSamplesPerBlock = (1024 - 4 * afd->pwfx->nChannels) * (2 / afd->pwfx->nChannels) + 1;
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported tag %08x\n", afd->dwFormatTag);
|
||||
return MMSYSERR_INVALPARAM;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", dwQuery);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
afd->szFormat[0] = 0; /* let MSACM format this for us... */
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatSuggest
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
|
||||
{
|
||||
/* some tests ... */
|
||||
if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
|
||||
adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
|
||||
ADPCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
/* FIXME: should do those tests against the real size (according to format tag */
|
||||
|
||||
/* If no suggestion for destination, then copy source value */
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
|
||||
adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC))
|
||||
adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec;
|
||||
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE))
|
||||
{
|
||||
if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
|
||||
adfs->pwfxDst->wBitsPerSample = 4;
|
||||
else
|
||||
adfs->pwfxDst->wBitsPerSample = 16;
|
||||
}
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG))
|
||||
{
|
||||
if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
|
||||
adfs->pwfxDst->wFormatTag = WAVE_FORMAT_IMA_ADPCM;
|
||||
else
|
||||
adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM;
|
||||
}
|
||||
|
||||
/* check if result is ok */
|
||||
if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
|
||||
/* recompute other values */
|
||||
switch (adfs->pwfxDst->wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
|
||||
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxDst->nBlockAlign;
|
||||
break;
|
||||
case WAVE_FORMAT_IMA_ADPCM:
|
||||
adfs->pwfxDst->nBlockAlign = 1024;
|
||||
/* FIXME: not handling header overhead */
|
||||
adfs->pwfxDst->nAvgBytesPerSec = ((adfs->pwfxDst->nSamplesPerSec * 4) / 8) * adfs->pwfxSrc->nChannels;
|
||||
((IMAADPCMWAVEFORMAT*)adfs->pwfxDst)->wSamplesPerBlock = (1024 - 4 * adfs->pwfxSrc->nChannels) * (2 / adfs->pwfxSrc->nChannels) + 1;
|
||||
TRACE("setting spb=%u\n", ((IMAADPCMWAVEFORMAT*)adfs->pwfxDst)->wSamplesPerBlock);
|
||||
break;
|
||||
default:
|
||||
FIXME("\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_Reset
|
||||
*
|
||||
*/
|
||||
static void ADPCM_Reset(PACMDRVSTREAMINSTANCE adsi, AcmAdpcmData* aad)
|
||||
{
|
||||
aad->stepIndexL = aad->stepIndexR = 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamOpen
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
|
||||
{
|
||||
AcmAdpcmData* aad;
|
||||
unsigned nspb;
|
||||
|
||||
assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC));
|
||||
|
||||
if (ADPCM_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF ||
|
||||
ADPCM_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
|
||||
aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmAdpcmData));
|
||||
if (aad == 0) return MMSYSERR_NOMEM;
|
||||
|
||||
adsi->dwDriver = (DWORD_PTR)aad;
|
||||
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
goto theEnd;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
/* resampling or mono <=> stereo not available
|
||||
* ADPCM algo only define 16 bit per sample output
|
||||
*/
|
||||
if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
|
||||
adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
|
||||
adsi->pwfxDst->wBitsPerSample != 16)
|
||||
goto theEnd;
|
||||
|
||||
nspb = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
TRACE("spb=%u\n", nspb);
|
||||
|
||||
/* we check that in a block, after the header, samples are present on
|
||||
* 4-sample packet pattern
|
||||
* we also check that the block alignment is bigger than the expected size
|
||||
*/
|
||||
if (((nspb - 1) & 3) != 0) goto theEnd;
|
||||
if ((((nspb - 1) / 2) + 4) * adsi->pwfxSrc->nChannels < adsi->pwfxSrc->nBlockAlign)
|
||||
goto theEnd;
|
||||
|
||||
/* adpcm decoding... */
|
||||
if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2)
|
||||
aad->convert = cvtSSima16K;
|
||||
if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1)
|
||||
aad->convert = cvtMMima16K;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM)
|
||||
{
|
||||
if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
|
||||
adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
|
||||
adsi->pwfxSrc->wBitsPerSample != 16)
|
||||
goto theEnd;
|
||||
|
||||
nspb = ((LPIMAADPCMWAVEFORMAT)adsi->pwfxDst)->wSamplesPerBlock;
|
||||
TRACE("spb=%u\n", nspb);
|
||||
|
||||
/* we check that in a block, after the header, samples are present on
|
||||
* 4-sample packet pattern
|
||||
* we also check that the block alignment is bigger than the expected size
|
||||
*/
|
||||
if (((nspb - 1) & 3) != 0) goto theEnd;
|
||||
if ((((nspb - 1) / 2) + 4) * adsi->pwfxDst->nChannels < adsi->pwfxDst->nBlockAlign)
|
||||
goto theEnd;
|
||||
|
||||
/* adpcm coding... */
|
||||
if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2)
|
||||
aad->convert = cvtSS16imaK;
|
||||
if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1)
|
||||
aad->convert = cvtMM16imaK;
|
||||
}
|
||||
else goto theEnd;
|
||||
ADPCM_Reset(adsi, aad);
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
theEnd:
|
||||
HeapFree(GetProcessHeap(), 0, aad);
|
||||
adsi->dwDriver = 0L;
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamClose
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, (void*)adsi->dwDriver);
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamSize
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
|
||||
{
|
||||
switch (adss->fdwSize)
|
||||
{
|
||||
case ACM_STREAMSIZEF_DESTINATION:
|
||||
/* cbDstLength => cbSrcLength */
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM)
|
||||
{
|
||||
/* don't take block overhead into account, doesn't matter too much */
|
||||
adss->cbSrcLength = adss->cbDstLength * 4;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
FIXME("misses the block header overhead\n");
|
||||
adss->cbSrcLength = 256 + adss->cbDstLength / 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
break;
|
||||
case ACM_STREAMSIZEF_SOURCE:
|
||||
/* cbSrcLength => cbDstLength */
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_IMA_ADPCM)
|
||||
{
|
||||
FIXME("misses the block header overhead\n");
|
||||
adss->cbDstLength = 256 + adss->cbSrcLength / 4;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_IMA_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
/* don't take block overhead into account, doesn't matter too much */
|
||||
adss->cbDstLength = adss->cbSrcLength * 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", adss->fdwSize);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamConvert
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
|
||||
{
|
||||
AcmAdpcmData* aad = (AcmAdpcmData*)adsi->dwDriver;
|
||||
DWORD nsrc = adsh->cbSrcLength;
|
||||
DWORD ndst = adsh->cbDstLength;
|
||||
|
||||
if (adsh->fdwConvert &
|
||||
~(ACM_STREAMCONVERTF_BLOCKALIGN|
|
||||
ACM_STREAMCONVERTF_END|
|
||||
ACM_STREAMCONVERTF_START))
|
||||
{
|
||||
FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
|
||||
}
|
||||
/* ACM_STREAMCONVERTF_BLOCKALIGN
|
||||
* currently all conversions are block aligned, so do nothing for this flag
|
||||
* ACM_STREAMCONVERTF_END
|
||||
* no pending data, so do nothing for this flag
|
||||
*/
|
||||
if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START))
|
||||
{
|
||||
ADPCM_Reset(adsi, aad);
|
||||
}
|
||||
|
||||
aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
|
||||
adsh->cbSrcLengthUsed = nsrc;
|
||||
adsh->cbDstLengthUsed = ndst;
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ADPCM_DriverProc [exported]
|
||||
*/
|
||||
LRESULT CALLBACK ADPCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
||||
LPARAM dwParam1, LPARAM dwParam2)
|
||||
{
|
||||
TRACE("(%08lx %p %04x %08lx %08lx);\n",
|
||||
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||
|
||||
switch (wMsg)
|
||||
{
|
||||
case DRV_LOAD: return 1;
|
||||
case DRV_FREE: return 1;
|
||||
case DRV_OPEN: return ADPCM_drvOpen((LPSTR)dwParam1);
|
||||
case DRV_CLOSE: return ADPCM_drvClose(dwDevID);
|
||||
case DRV_ENABLE: return 1;
|
||||
case DRV_DISABLE: return 1;
|
||||
case DRV_QUERYCONFIGURE: return 1;
|
||||
case DRV_CONFIGURE: MessageBoxA(0, "MSACM IMA ADPCM filter !", "Wine Driver", MB_OK); return 1;
|
||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||
|
||||
case ACMDM_DRIVER_NOTIFY:
|
||||
/* no caching from other ACM drivers is done so far */
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
case ACMDM_DRIVER_DETAILS:
|
||||
return ADPCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
|
||||
|
||||
case ACMDM_FORMATTAG_DETAILS:
|
||||
return ADPCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
|
||||
|
||||
case ACMDM_FORMAT_DETAILS:
|
||||
return ADPCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
|
||||
|
||||
case ACMDM_FORMAT_SUGGEST:
|
||||
return ADPCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_OPEN:
|
||||
return ADPCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_CLOSE:
|
||||
return ADPCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_SIZE:
|
||||
return ADPCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
|
||||
|
||||
case ACMDM_STREAM_CONVERT:
|
||||
return ADPCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
|
||||
|
||||
case ACMDM_HARDWARE_WAVE_CAPS_INPUT:
|
||||
case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT:
|
||||
/* this converter is not a hardware driver */
|
||||
case ACMDM_FILTERTAG_DETAILS:
|
||||
case ACMDM_FILTER_DETAILS:
|
||||
/* this converter is not a filter */
|
||||
case ACMDM_STREAM_RESET:
|
||||
/* only needed for asynchronous driver... we aren't, so just say it */
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
case ACMDM_STREAM_PREPARE:
|
||||
case ACMDM_STREAM_UNPREPARE:
|
||||
/* nothing special to do here... so don't do anything */
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
default:
|
||||
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||
}
|
||||
}
|
12
reactos/dll/win32/msadp32.acm/msadp32.acm.rbuild
Normal file
12
reactos/dll/win32/msadp32.acm/msadp32.acm.rbuild
Normal file
|
@ -0,0 +1,12 @@
|
|||
<module name="msadp32.acm" type="win32dll" baseaddress="${BASEADDRESS_MSADP32ACM}" installbase="system32" installname="msadp32.acm" allowwarnings="true" entrypoint="0">
|
||||
<importlibrary definition="msadp32.acm.spec" />
|
||||
<include base="msadp32.acm">.</include>
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<define name="__WINESRC__" />
|
||||
<file>msadp32.c</file>
|
||||
<library>wine</library>
|
||||
<library>winmm</library>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
1
reactos/dll/win32/msadp32.acm/msadp32.acm.spec
Normal file
1
reactos/dll/win32/msadp32.acm/msadp32.acm.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall -private DriverProc (long long long long long) ADPCM_DriverProc
|
811
reactos/dll/win32/msadp32.acm/msadp32.c
Normal file
811
reactos/dll/win32/msadp32.acm/msadp32.c
Normal file
|
@ -0,0 +1,811 @@
|
|||
/*
|
||||
* MS ADPCM handling
|
||||
*
|
||||
* Copyright (C) 2002 Eric Pouech
|
||||
*
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "mmsystem.h"
|
||||
#include "mmreg.h"
|
||||
#include "msacm.h"
|
||||
#include "msacmdrv.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
/* see http://www.pcisys.net/~melanson/codecs/adpcm.txt for the details */
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(adpcm);
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_drvOpen
|
||||
*/
|
||||
static LRESULT ADPCM_drvOpen(LPCSTR str)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_drvClose
|
||||
*/
|
||||
static LRESULT ADPCM_drvClose(DWORD_PTR dwDevID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
typedef struct tagAcmAdpcmData
|
||||
{
|
||||
void (*convert)(const ACMDRVSTREAMINSTANCE *adsi,
|
||||
const unsigned char*, LPDWORD, unsigned char*, LPDWORD);
|
||||
} AcmAdpcmData;
|
||||
|
||||
/* table to list all supported formats... those are the basic ones. this
|
||||
* also helps given a unique index to each of the supported formats
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
int nChannels;
|
||||
int nBits;
|
||||
int rate;
|
||||
} Format;
|
||||
|
||||
static const Format PCM_Formats[] =
|
||||
{
|
||||
{1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000},
|
||||
{1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025},
|
||||
{1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050},
|
||||
{1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100},
|
||||
};
|
||||
|
||||
static const Format ADPCM_Formats[] =
|
||||
{
|
||||
{1, 4, 8000}, {2, 4, 8000}, {1, 4, 11025}, {2, 4, 11025},
|
||||
{1, 4, 22050}, {2, 4, 22050}, {1, 4, 44100}, {2, 4, 44100},
|
||||
};
|
||||
|
||||
#define NUM_PCM_FORMATS (sizeof(PCM_Formats) / sizeof(PCM_Formats[0]))
|
||||
#define NUM_ADPCM_FORMATS (sizeof(ADPCM_Formats) / sizeof(ADPCM_Formats[0]))
|
||||
|
||||
static int MS_Delta[] =
|
||||
{
|
||||
230, 230, 230, 230, 307, 409, 512, 614,
|
||||
768, 614, 512, 409, 307, 230, 230, 230
|
||||
};
|
||||
|
||||
|
||||
static ADPCMCOEFSET MSADPCM_CoeffSet[] =
|
||||
{
|
||||
{256, 0}, {512, -256}, {0, 0}, {192, 64}, {240, 0}, {460, -208}, {392, -232}
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_GetFormatIndex
|
||||
*/
|
||||
static DWORD ADPCM_GetFormatIndex(const WAVEFORMATEX* wfx)
|
||||
{
|
||||
int i, hi;
|
||||
const Format* fmts;
|
||||
|
||||
switch (wfx->wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
hi = NUM_PCM_FORMATS;
|
||||
fmts = PCM_Formats;
|
||||
break;
|
||||
case WAVE_FORMAT_ADPCM:
|
||||
hi = NUM_ADPCM_FORMATS;
|
||||
fmts = ADPCM_Formats;
|
||||
break;
|
||||
default:
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
for (i = 0; i < hi; i++)
|
||||
{
|
||||
if (wfx->nChannels == fmts[i].nChannels &&
|
||||
wfx->nSamplesPerSec == fmts[i].rate &&
|
||||
wfx->wBitsPerSample == fmts[i].nBits)
|
||||
return i;
|
||||
}
|
||||
|
||||
switch (wfx->wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
if(3 > wfx->nChannels &&
|
||||
wfx->nChannels > 0 &&
|
||||
wfx->nAvgBytesPerSec == 2 * wfx->nSamplesPerSec * wfx->nChannels &&
|
||||
wfx->nBlockAlign == 2 * wfx->nChannels &&
|
||||
wfx->wBitsPerSample == 16)
|
||||
return hi;
|
||||
break;
|
||||
case WAVE_FORMAT_ADPCM:
|
||||
if(3 > wfx->nChannels &&
|
||||
wfx->nChannels > 0 &&
|
||||
wfx->wBitsPerSample == 4 &&
|
||||
wfx->cbSize == 32)
|
||||
return hi;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
static void init_wfx_adpcm(ADPCMWAVEFORMAT* awfx)
|
||||
{
|
||||
register WAVEFORMATEX* pwfx = &awfx->wfx;
|
||||
|
||||
/* we assume wFormatTag, nChannels, nSamplesPerSec and wBitsPerSample
|
||||
* have been initialized... */
|
||||
|
||||
if (pwfx->wFormatTag != WAVE_FORMAT_ADPCM) {FIXME("wrong FT\n"); return;}
|
||||
if (ADPCM_GetFormatIndex(pwfx) == 0xFFFFFFFF) {FIXME("wrong fmt\n"); return;}
|
||||
|
||||
switch (pwfx->nSamplesPerSec)
|
||||
{
|
||||
case 8000: pwfx->nBlockAlign = 256 * pwfx->nChannels; break;
|
||||
case 11025: pwfx->nBlockAlign = 256 * pwfx->nChannels; break;
|
||||
case 22050: pwfx->nBlockAlign = 512 * pwfx->nChannels; break;
|
||||
case 44100: pwfx->nBlockAlign = 1024 * pwfx->nChannels; break;
|
||||
default: break;
|
||||
}
|
||||
pwfx->cbSize = 2 * sizeof(WORD) + 7 * sizeof(ADPCMCOEFSET);
|
||||
/* 7 is the size of the block head (which contains two samples) */
|
||||
|
||||
awfx->wSamplesPerBlock = pwfx->nBlockAlign * 2 / pwfx->nChannels - 12;
|
||||
pwfx->nAvgBytesPerSec = (pwfx->nSamplesPerSec * pwfx->nBlockAlign) / awfx->wSamplesPerBlock;
|
||||
awfx->wNumCoef = 7;
|
||||
memcpy(awfx->aCoef, MSADPCM_CoeffSet, 7 * sizeof(ADPCMCOEFSET));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* R16
|
||||
*
|
||||
* Read a 16 bit sample (correctly handles endianess)
|
||||
*/
|
||||
static inline short R16(const unsigned char* src)
|
||||
{
|
||||
return (short)((unsigned short)src[0] | ((unsigned short)src[1] << 8));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* W16
|
||||
*
|
||||
* Write a 16 bit sample (correctly handles endianess)
|
||||
*/
|
||||
static inline void W16(unsigned char* dst, short s)
|
||||
{
|
||||
dst[0] = LOBYTE(s);
|
||||
dst[1] = HIBYTE(s);
|
||||
}
|
||||
|
||||
static inline void clamp_sample(int* sample)
|
||||
{
|
||||
if (*sample < -32768) *sample = -32768;
|
||||
if (*sample > 32767) *sample = 32767;
|
||||
}
|
||||
|
||||
static inline void process_nibble(unsigned nibble, int* idelta,
|
||||
int* sample1, int* sample2,
|
||||
const ADPCMCOEFSET* coeff)
|
||||
{
|
||||
int sample;
|
||||
int snibble;
|
||||
|
||||
/* nibble is in fact a signed 4 bit integer => propagate sign if needed */
|
||||
snibble = (nibble & 0x08) ? (nibble - 16) : nibble;
|
||||
sample = ((*sample1 * coeff->iCoef1) + (*sample2 * coeff->iCoef2)) / 256 +
|
||||
snibble * *idelta;
|
||||
clamp_sample(&sample);
|
||||
|
||||
*sample2 = *sample1;
|
||||
*sample1 = sample;
|
||||
*idelta = ((MS_Delta[nibble] * *idelta) / 256);
|
||||
if (*idelta < 16) *idelta = 16;
|
||||
}
|
||||
|
||||
static void cvtSSms16K(const ACMDRVSTREAMINSTANCE *adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int ideltaL, ideltaR;
|
||||
int sample1L, sample2L;
|
||||
int sample1R, sample2R;
|
||||
ADPCMCOEFSET coeffL, coeffR;
|
||||
int nsamp;
|
||||
int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
|
||||
*ndst / (nsamp_blk * 2 * 2));
|
||||
|
||||
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
|
||||
*ndst = nblock * nsamp_blk * 2 * 2;
|
||||
|
||||
nsamp_blk -= 2; /* see below for samples from block head */
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
const unsigned char* in_src = src;
|
||||
|
||||
assert(*src <= 6);
|
||||
coeffL = MSADPCM_CoeffSet[*src++];
|
||||
assert(*src <= 6);
|
||||
coeffR = MSADPCM_CoeffSet[*src++];
|
||||
|
||||
ideltaL = R16(src); src += 2;
|
||||
ideltaR = R16(src); src += 2;
|
||||
sample1L = R16(src); src += 2;
|
||||
sample1R = R16(src); src += 2;
|
||||
sample2L = R16(src); src += 2;
|
||||
sample2R = R16(src); src += 2;
|
||||
|
||||
/* store samples from block head */
|
||||
W16(dst, sample2L); dst += 2;
|
||||
W16(dst, sample2R); dst += 2;
|
||||
W16(dst, sample1L); dst += 2;
|
||||
W16(dst, sample1R); dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp--)
|
||||
{
|
||||
process_nibble(*src >> 4, &ideltaL, &sample1L, &sample2L, &coeffL);
|
||||
W16(dst, sample1L); dst += 2;
|
||||
process_nibble(*src++ & 0x0F, &ideltaR, &sample1R, &sample2R, &coeffR);
|
||||
W16(dst, sample1R); dst += 2;
|
||||
}
|
||||
src = in_src + adsi->pwfxSrc->nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
static void cvtMMms16K(const ACMDRVSTREAMINSTANCE *adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
int idelta;
|
||||
int sample1, sample2;
|
||||
ADPCMCOEFSET coeff;
|
||||
int nsamp;
|
||||
int nsamp_blk = ((ADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
DWORD nblock = min(*nsrc / adsi->pwfxSrc->nBlockAlign,
|
||||
*ndst / (nsamp_blk * 2));
|
||||
|
||||
*nsrc = nblock * adsi->pwfxSrc->nBlockAlign;
|
||||
*ndst = nblock * nsamp_blk * 2;
|
||||
|
||||
nsamp_blk -= 2; /* see below for samples from block head */
|
||||
for (; nblock > 0; nblock--)
|
||||
{
|
||||
const unsigned char* in_src = src;
|
||||
|
||||
assert(*src <= 6);
|
||||
coeff = MSADPCM_CoeffSet[*src++];
|
||||
|
||||
idelta = R16(src); src += 2;
|
||||
sample1 = R16(src); src += 2;
|
||||
sample2 = R16(src); src += 2;
|
||||
|
||||
/* store samples from block head */
|
||||
W16(dst, sample2); dst += 2;
|
||||
W16(dst, sample1); dst += 2;
|
||||
|
||||
for (nsamp = nsamp_blk; nsamp > 0; nsamp -= 2)
|
||||
{
|
||||
process_nibble(*src >> 4, &idelta, &sample1, &sample2, &coeff);
|
||||
W16(dst, sample1); dst += 2;
|
||||
process_nibble(*src++ & 0x0F, &idelta, &sample1, &sample2, &coeff);
|
||||
W16(dst, sample1); dst += 2;
|
||||
}
|
||||
src = in_src + adsi->pwfxSrc->nBlockAlign;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void cvtSS16msK(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
}
|
||||
|
||||
static void cvtMM16msK(PACMDRVSTREAMINSTANCE adsi,
|
||||
const unsigned char* src, LPDWORD nsrc,
|
||||
unsigned char* dst, LPDWORD ndst)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_DriverDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_DriverDetails(PACMDRIVERDETAILSW add)
|
||||
{
|
||||
add->fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
|
||||
add->fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
|
||||
add->wMid = 0xFF;
|
||||
add->wPid = 0x00;
|
||||
add->vdwACM = 0x01000000;
|
||||
add->vdwDriver = 0x01000000;
|
||||
add->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
add->cFormatTags = 2; /* PCM, MS ADPCM */
|
||||
add->cFilterTags = 0;
|
||||
add->hicon = NULL;
|
||||
MultiByteToWideChar( CP_ACP, 0, "MS-ADPCM", -1,
|
||||
add->szShortName, sizeof(add->szShortName)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Wine MS ADPCM converter", -1,
|
||||
add->szLongName, sizeof(add->szLongName)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Brought to you by the Wine team...", -1,
|
||||
add->szCopyright, sizeof(add->szCopyright)/sizeof(WCHAR) );
|
||||
MultiByteToWideChar( CP_ACP, 0, "Refer to LICENSE file", -1,
|
||||
add->szLicensing, sizeof(add->szLicensing)/sizeof(WCHAR) );
|
||||
add->szFeatures[0] = 0;
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatTagDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
|
||||
{
|
||||
static const WCHAR szPcm[]={'P','C','M',0};
|
||||
static const WCHAR szMsAdPcm[]={'M','i','c','r','o','s','o','f','t',' ','A','D','P','C','M',0};
|
||||
|
||||
switch (dwQuery)
|
||||
{
|
||||
case ACM_FORMATTAGDETAILSF_INDEX:
|
||||
if (aftd->dwFormatTagIndex >= 2) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
case ACM_FORMATTAGDETAILSF_LARGESTSIZE:
|
||||
if (aftd->dwFormatTag == WAVE_FORMAT_UNKNOWN)
|
||||
{
|
||||
aftd->dwFormatTagIndex = 1; /* WAVE_FORMAT_ADPCM is bigger than PCM */
|
||||
break;
|
||||
}
|
||||
/* fall thru */
|
||||
case ACM_FORMATTAGDETAILSF_FORMATTAG:
|
||||
switch (aftd->dwFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM: aftd->dwFormatTagIndex = 0; break;
|
||||
case WAVE_FORMAT_ADPCM: aftd->dwFormatTagIndex = 1; break;
|
||||
default: return ACMERR_NOTPOSSIBLE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", dwQuery);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
aftd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
switch (aftd->dwFormatTagIndex)
|
||||
{
|
||||
case 0:
|
||||
aftd->dwFormatTag = WAVE_FORMAT_PCM;
|
||||
aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
|
||||
aftd->cStandardFormats = NUM_PCM_FORMATS;
|
||||
lstrcpyW(aftd->szFormatTag, szPcm);
|
||||
break;
|
||||
case 1:
|
||||
aftd->dwFormatTag = WAVE_FORMAT_ADPCM;
|
||||
aftd->cbFormatSize = sizeof(ADPCMWAVEFORMAT) + (7 - 1) * sizeof(ADPCMCOEFSET);
|
||||
aftd->cStandardFormats = NUM_ADPCM_FORMATS;
|
||||
lstrcpyW(aftd->szFormatTag, szMsAdPcm);
|
||||
break;
|
||||
}
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatDetails
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
|
||||
{
|
||||
switch (dwQuery)
|
||||
{
|
||||
case ACM_FORMATDETAILSF_FORMAT:
|
||||
if (ADPCM_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
case ACM_FORMATDETAILSF_INDEX:
|
||||
afd->pwfx->wFormatTag = afd->dwFormatTag;
|
||||
switch (afd->dwFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
if (afd->dwFormatIndex >= NUM_PCM_FORMATS) return ACMERR_NOTPOSSIBLE;
|
||||
afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
|
||||
afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
|
||||
afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
|
||||
/* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not accessible
|
||||
* afd->pwfx->cbSize = 0;
|
||||
*/
|
||||
afd->pwfx->nBlockAlign =
|
||||
(afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
|
||||
afd->pwfx->nAvgBytesPerSec =
|
||||
afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
|
||||
break;
|
||||
case WAVE_FORMAT_ADPCM:
|
||||
if (afd->dwFormatIndex >= NUM_ADPCM_FORMATS) return ACMERR_NOTPOSSIBLE;
|
||||
if (afd->cbwfx < sizeof(ADPCMWAVEFORMAT) + (7 - 1) * sizeof(ADPCMCOEFSET))
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
afd->pwfx->nChannels = ADPCM_Formats[afd->dwFormatIndex].nChannels;
|
||||
afd->pwfx->nSamplesPerSec = ADPCM_Formats[afd->dwFormatIndex].rate;
|
||||
afd->pwfx->wBitsPerSample = ADPCM_Formats[afd->dwFormatIndex].nBits;
|
||||
init_wfx_adpcm((ADPCMWAVEFORMAT*)afd->pwfx);
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported tag %08x\n", afd->dwFormatTag);
|
||||
return MMSYSERR_INVALPARAM;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", dwQuery);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
afd->fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
|
||||
afd->szFormat[0] = 0; /* let MSACM format this for us... */
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_FormatSuggest
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
|
||||
{
|
||||
/* some tests ... */
|
||||
if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
|
||||
adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
|
||||
adfs->pwfxSrc->wFormatTag == adfs->pwfxDst->wFormatTag ||
|
||||
ADPCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
/* FIXME: should do those tests against the real size (according to format tag */
|
||||
|
||||
/* If no suggestion for destination, then copy source value */
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NCHANNELS))
|
||||
adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_NSAMPLESPERSEC))
|
||||
adfs->pwfxDst->nSamplesPerSec = adfs->pwfxSrc->nSamplesPerSec;
|
||||
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WBITSPERSAMPLE))
|
||||
{
|
||||
if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
|
||||
adfs->pwfxDst->wBitsPerSample = 4;
|
||||
else
|
||||
adfs->pwfxDst->wBitsPerSample = 16;
|
||||
}
|
||||
if (!(adfs->fdwSuggest & ACM_FORMATSUGGESTF_WFORMATTAG))
|
||||
{
|
||||
if (adfs->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM)
|
||||
adfs->pwfxDst->wFormatTag = WAVE_FORMAT_ADPCM;
|
||||
else
|
||||
adfs->pwfxDst->wFormatTag = WAVE_FORMAT_PCM;
|
||||
}
|
||||
|
||||
/* recompute other values */
|
||||
switch (adfs->pwfxDst->wFormatTag)
|
||||
{
|
||||
case WAVE_FORMAT_PCM:
|
||||
adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
|
||||
adfs->pwfxDst->nAvgBytesPerSec = adfs->pwfxDst->nSamplesPerSec * adfs->pwfxDst->nBlockAlign;
|
||||
/* check if result is ok */
|
||||
if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
case WAVE_FORMAT_ADPCM:
|
||||
init_wfx_adpcm((ADPCMWAVEFORMAT*)adfs->pwfxDst);
|
||||
/* check if result is ok */
|
||||
if (ADPCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) return ACMERR_NOTPOSSIBLE;
|
||||
break;
|
||||
default:
|
||||
FIXME("\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_Reset
|
||||
*
|
||||
*/
|
||||
static void ADPCM_Reset(PACMDRVSTREAMINSTANCE adsi, AcmAdpcmData* aad)
|
||||
{
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamOpen
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
|
||||
{
|
||||
AcmAdpcmData* aad;
|
||||
|
||||
assert(!(adsi->fdwOpen & ACM_STREAMOPENF_ASYNC));
|
||||
|
||||
if (ADPCM_GetFormatIndex(adsi->pwfxSrc) == 0xFFFFFFFF ||
|
||||
ADPCM_GetFormatIndex(adsi->pwfxDst) == 0xFFFFFFFF)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
|
||||
aad = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmAdpcmData));
|
||||
if (aad == 0) return MMSYSERR_NOMEM;
|
||||
|
||||
adsi->dwDriver = (DWORD_PTR)aad;
|
||||
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
goto theEnd;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
/* resampling or mono <=> stereo not available
|
||||
* ADPCM algo only define 16 bit per sample output
|
||||
*/
|
||||
if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
|
||||
adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
|
||||
adsi->pwfxDst->wBitsPerSample != 16)
|
||||
goto theEnd;
|
||||
|
||||
#if 0
|
||||
{
|
||||
unsigned int nspb = ((IMAADPCMWAVEFORMAT*)adsi->pwfxSrc)->wSamplesPerBlock;
|
||||
FIXME("spb=%u\n", nspb);
|
||||
|
||||
/* we check that in a block, after the header, samples are present on
|
||||
* 4-sample packet pattern
|
||||
* we also check that the block alignment is bigger than the expected size
|
||||
*/
|
||||
if (((nspb - 1) & 3) != 0) goto theEnd;
|
||||
if ((((nspb - 1) / 2) + 4) * adsi->pwfxSrc->nChannels < adsi->pwfxSrc->nBlockAlign)
|
||||
goto theEnd;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* adpcm decoding... */
|
||||
if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 2)
|
||||
aad->convert = cvtSSms16K;
|
||||
if (adsi->pwfxDst->wBitsPerSample == 16 && adsi->pwfxDst->nChannels == 1)
|
||||
aad->convert = cvtMMms16K;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM)
|
||||
{
|
||||
if (adsi->pwfxSrc->nSamplesPerSec != adsi->pwfxDst->nSamplesPerSec ||
|
||||
adsi->pwfxSrc->nChannels != adsi->pwfxDst->nChannels ||
|
||||
adsi->pwfxSrc->wBitsPerSample != 16)
|
||||
goto theEnd;
|
||||
#if 0
|
||||
nspb = ((IMAADPCMWAVEFORMAT*)adsi->pwfxDst)->wSamplesPerBlock;
|
||||
FIXME("spb=%u\n", nspb);
|
||||
|
||||
/* we check that in a block, after the header, samples are present on
|
||||
* 4-sample packet pattern
|
||||
* we also check that the block alignment is bigger than the expected size
|
||||
*/
|
||||
if (((nspb - 1) & 3) != 0) goto theEnd;
|
||||
if ((((nspb - 1) / 2) + 4) * adsi->pwfxDst->nChannels < adsi->pwfxDst->nBlockAlign)
|
||||
goto theEnd;
|
||||
#endif
|
||||
#if 0
|
||||
/* adpcm coding... */
|
||||
if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 2)
|
||||
aad->convert = cvtSS16msK;
|
||||
if (adsi->pwfxSrc->wBitsPerSample == 16 && adsi->pwfxSrc->nChannels == 1)
|
||||
aad->convert = cvtMM16msK;
|
||||
#endif
|
||||
FIXME("We don't support encoding yet\n");
|
||||
goto theEnd;
|
||||
}
|
||||
else goto theEnd;
|
||||
ADPCM_Reset(adsi, aad);
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
theEnd:
|
||||
HeapFree(GetProcessHeap(), 0, aad);
|
||||
adsi->dwDriver = 0L;
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamClose
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, (void*)adsi->dwDriver);
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamSize
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamSize(const ACMDRVSTREAMINSTANCE *adsi, PACMDRVSTREAMSIZE adss)
|
||||
{
|
||||
DWORD nblocks;
|
||||
WORD wSamplesPerBlock;
|
||||
/* wSamplesPerBlock formula comes from MSDN ADPCMWAVEFORMAT page.*/
|
||||
switch (adss->fdwSize)
|
||||
{
|
||||
case ACM_STREAMSIZEF_DESTINATION:
|
||||
/* cbDstLength => cbSrcLength */
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM)
|
||||
{
|
||||
wSamplesPerBlock = adsi->pwfxDst->nBlockAlign * 2 / adsi->pwfxDst->nChannels - 12;
|
||||
nblocks = adss->cbDstLength / adsi->pwfxDst->nBlockAlign;
|
||||
if (nblocks == 0)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
adss->cbSrcLength = nblocks * adsi->pwfxSrc->nBlockAlign * wSamplesPerBlock;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
wSamplesPerBlock = adsi->pwfxSrc->nBlockAlign * 2 / adsi->pwfxSrc->nChannels - 12;
|
||||
nblocks = adss->cbDstLength / (adsi->pwfxDst->nBlockAlign * wSamplesPerBlock);
|
||||
if (nblocks == 0)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
adss->cbSrcLength = nblocks * adsi->pwfxSrc->nBlockAlign;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
break;
|
||||
case ACM_STREAMSIZEF_SOURCE:
|
||||
/* cbSrcLength => cbDstLength */
|
||||
if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_PCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_ADPCM)
|
||||
{
|
||||
wSamplesPerBlock = adsi->pwfxDst->nBlockAlign * 2 / adsi->pwfxDst->nChannels - 12;
|
||||
nblocks = adss->cbSrcLength / (adsi->pwfxSrc->nBlockAlign * wSamplesPerBlock);
|
||||
if (nblocks == 0)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
if (adss->cbSrcLength % (adsi->pwfxSrc->nBlockAlign * wSamplesPerBlock))
|
||||
/* Round block count up. */
|
||||
nblocks++;
|
||||
adss->cbDstLength = nblocks * adsi->pwfxDst->nBlockAlign;
|
||||
}
|
||||
else if (adsi->pwfxSrc->wFormatTag == WAVE_FORMAT_ADPCM &&
|
||||
adsi->pwfxDst->wFormatTag == WAVE_FORMAT_PCM)
|
||||
{
|
||||
wSamplesPerBlock = adsi->pwfxSrc->nBlockAlign * 2 / adsi->pwfxSrc->nChannels - 12;
|
||||
nblocks = adss->cbSrcLength / adsi->pwfxSrc->nBlockAlign;
|
||||
if (nblocks == 0)
|
||||
return ACMERR_NOTPOSSIBLE;
|
||||
if (adss->cbSrcLength % adsi->pwfxSrc->nBlockAlign)
|
||||
/* Round block count up. */
|
||||
nblocks++;
|
||||
adss->cbDstLength = nblocks * adsi->pwfxDst->nBlockAlign * wSamplesPerBlock;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
WARN("Unsupported query %08x\n", adss->fdwSize);
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* ADPCM_StreamConvert
|
||||
*
|
||||
*/
|
||||
static LRESULT ADPCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
|
||||
{
|
||||
AcmAdpcmData* aad = (AcmAdpcmData*)adsi->dwDriver;
|
||||
DWORD nsrc = adsh->cbSrcLength;
|
||||
DWORD ndst = adsh->cbDstLength;
|
||||
|
||||
if (adsh->fdwConvert &
|
||||
~(ACM_STREAMCONVERTF_BLOCKALIGN|
|
||||
ACM_STREAMCONVERTF_END|
|
||||
ACM_STREAMCONVERTF_START))
|
||||
{
|
||||
FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
|
||||
}
|
||||
/* ACM_STREAMCONVERTF_BLOCKALIGN
|
||||
* currently all conversions are block aligned, so do nothing for this flag
|
||||
* ACM_STREAMCONVERTF_END
|
||||
* no pending data, so do nothing for this flag
|
||||
*/
|
||||
if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START))
|
||||
{
|
||||
ADPCM_Reset(adsi, aad);
|
||||
}
|
||||
|
||||
aad->convert(adsi, adsh->pbSrc, &nsrc, adsh->pbDst, &ndst);
|
||||
adsh->cbSrcLengthUsed = nsrc;
|
||||
adsh->cbDstLengthUsed = ndst;
|
||||
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* ADPCM_DriverProc [exported]
|
||||
*/
|
||||
LRESULT CALLBACK ADPCM_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
|
||||
LPARAM dwParam1, LPARAM dwParam2)
|
||||
{
|
||||
TRACE("(%08lx %p %04x %08lx %08lx);\n",
|
||||
dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||
|
||||
switch (wMsg)
|
||||
{
|
||||
case DRV_LOAD: return 1;
|
||||
case DRV_FREE: return 1;
|
||||
case DRV_OPEN: return ADPCM_drvOpen((LPSTR)dwParam1);
|
||||
case DRV_CLOSE: return ADPCM_drvClose(dwDevID);
|
||||
case DRV_ENABLE: return 1;
|
||||
case DRV_DISABLE: return 1;
|
||||
case DRV_QUERYCONFIGURE: return 1;
|
||||
case DRV_CONFIGURE: MessageBoxA(0, "MSACM MS ADPCM filter !", "Wine Driver", MB_OK); return 1;
|
||||
case DRV_INSTALL: return DRVCNF_RESTART;
|
||||
case DRV_REMOVE: return DRVCNF_RESTART;
|
||||
|
||||
case ACMDM_DRIVER_NOTIFY:
|
||||
/* no caching from other ACM drivers is done so far */
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
case ACMDM_DRIVER_DETAILS:
|
||||
return ADPCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
|
||||
|
||||
case ACMDM_FORMATTAG_DETAILS:
|
||||
return ADPCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
|
||||
|
||||
case ACMDM_FORMAT_DETAILS:
|
||||
return ADPCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
|
||||
|
||||
case ACMDM_FORMAT_SUGGEST:
|
||||
return ADPCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_OPEN:
|
||||
return ADPCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_CLOSE:
|
||||
return ADPCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
|
||||
|
||||
case ACMDM_STREAM_SIZE:
|
||||
return ADPCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
|
||||
|
||||
case ACMDM_STREAM_CONVERT:
|
||||
return ADPCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
|
||||
|
||||
case ACMDM_HARDWARE_WAVE_CAPS_INPUT:
|
||||
case ACMDM_HARDWARE_WAVE_CAPS_OUTPUT:
|
||||
/* this converter is not a hardware driver */
|
||||
case ACMDM_FILTERTAG_DETAILS:
|
||||
case ACMDM_FILTER_DETAILS:
|
||||
/* this converter is not a filter */
|
||||
case ACMDM_STREAM_RESET:
|
||||
/* only needed for asynchronous driver... we aren't, so just say it */
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
case ACMDM_STREAM_PREPARE:
|
||||
case ACMDM_STREAM_UNPREPARE:
|
||||
/* nothing special to do here... so don't do anything */
|
||||
return MMSYSERR_NOERROR;
|
||||
|
||||
default:
|
||||
return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
|
||||
}
|
||||
}
|
12
reactos/dll/win32/msg711.acm/msg711.acm.rbuild
Normal file
12
reactos/dll/win32/msg711.acm/msg711.acm.rbuild
Normal file
|
@ -0,0 +1,12 @@
|
|||
<module name="msg711.acm" type="win32dll" baseaddress="${BASEADDRESS_MSG711ACM}" installbase="system32" installname="msg711.acm" allowwarnings="true" entrypoint="0">
|
||||
<importlibrary definition="msg711.acm.spec" />
|
||||
<include base="msg711.acm">.</include>
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<define name="__WINESRC__" />
|
||||
<file>msg711.c</file>
|
||||
<library>wine</library>
|
||||
<library>winmm</library>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
1
reactos/dll/win32/msg711.acm/msg711.acm.spec
Normal file
1
reactos/dll/win32/msg711.acm/msg711.acm.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall -private DriverProc(long long long long long) G711_DriverProc
|
1151
reactos/dll/win32/msg711.acm/msg711.c
Normal file
1151
reactos/dll/win32/msg711.acm/msg711.c
Normal file
File diff suppressed because it is too large
Load diff
12
reactos/dll/win32/msvidc32/msvidc32.rbuild
Normal file
12
reactos/dll/win32/msvidc32/msvidc32.rbuild
Normal file
|
@ -0,0 +1,12 @@
|
|||
<module name="msvidc32" type="win32dll" baseaddress="${BASEADDRESS_MSVIDC32}" installbase="system32" installname="msvidc32.dll" allowwarnings="true">
|
||||
<importlibrary definition="msvidc32.spec" />
|
||||
<include base="msvidc32">.</include>
|
||||
<include base="ReactOS">include/reactos/wine</include>
|
||||
<define name="__WINESRC__" />
|
||||
<file>msvideo1.c</file>
|
||||
<file>rsrc.rc</file>
|
||||
<library>wine</library>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>ntdll</library>
|
||||
</module>
|
1
reactos/dll/win32/msvidc32/msvidc32.spec
Normal file
1
reactos/dll/win32/msvidc32/msvidc32.spec
Normal file
|
@ -0,0 +1 @@
|
|||
@ stdcall -private DriverProc(long long long long long) CRAM_DriverProc
|
27
reactos/dll/win32/msvidc32/msvidc32_Da.rc
Normal file
27
reactos/dll/win32/msvidc32/msvidc32_Da.rc
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Danish language support
|
||||
*
|
||||
* Copyright (C) 2008 Jens Albretsen <jens@albretsen.dk>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 videokodeks"
|
||||
}
|
26
reactos/dll/win32/msvidc32/msvidc32_De.rc
Normal file
26
reactos/dll/win32/msvidc32/msvidc32_De.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2005 Henning Gerhardt
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 Video Codec"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_En.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_En.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 video codec"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Fr.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Fr.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2006 Jonathan Ernst
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "codec vidéo Wine Video 1"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Hu.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Hu.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2006 Andras Kovacs
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 video kodek"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Ko.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Ko.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine ºñµð¿À 1 ºñµð¿À ÄÚµ¦"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Nl.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Nl.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Frans Kool
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 video codec"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_No.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_No.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Alexander N. Sørnes <alex@thehandofagony.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1-videokodek"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Pl.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Pl.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Kodek Wine Video 1"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Pt.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Pt.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Ricardo Filipe
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "codec video Wine Video 1"
|
||||
}
|
26
reactos/dll/win32/msvidc32/msvidc32_Ro.rc
Normal file
26
reactos/dll/win32/msvidc32/msvidc32_Ro.rc
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
* Copyright 2008 Michael Stefaniuc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Codecul video Wine Video 1"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_Ru.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Ru.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2008 Vitaliy Margolen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Âèäåî êîäåð Wine Video 1"
|
||||
}
|
29
reactos/dll/win32/msvidc32/msvidc32_Si.rc
Normal file
29
reactos/dll/win32/msvidc32/msvidc32_Si.rc
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright 2008 Rok Mandeljc
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#pragma code_page(65001)
|
||||
|
||||
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 video kodek"
|
||||
}
|
||||
|
||||
#pragma code_page(default)
|
25
reactos/dll/win32/msvidc32/msvidc32_Sv.rc
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_Sv.rc
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2007 Daniel Nylander
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Video 1 videokodek"
|
||||
}
|
27
reactos/dll/win32/msvidc32/msvidc32_Tr.rc
Normal file
27
reactos/dll/win32/msvidc32/msvidc32_Tr.rc
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Turkish Resources
|
||||
*
|
||||
* Copyright 2006 Fatih Aþýcý
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_NAME "MS-CRAM"
|
||||
IDS_DESCRIPTION "Wine Vidyo 1 vidyo çözücü"
|
||||
}
|
25
reactos/dll/win32/msvidc32/msvidc32_private.h
Normal file
25
reactos/dll/win32/msvidc32/msvidc32_private.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __MSVIDC32_PRIVATE_H
|
||||
#define __MSVIDC32_PRIVATE_H
|
||||
|
||||
#define IDS_NAME 100
|
||||
#define IDS_DESCRIPTION 101
|
||||
|
||||
#endif /* __MSVIDC32_PRIVATE_H */
|
598
reactos/dll/win32/msvidc32/msvideo1.c
Normal file
598
reactos/dll/win32/msvidc32/msvideo1.c
Normal file
|
@ -0,0 +1,598 @@
|
|||
/*
|
||||
* Microsoft Video-1 Decoder
|
||||
* Copyright (C) 2003 the ffmpeg project
|
||||
*
|
||||
* Portions Copyright (C) 2004 Mike McCormack for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file msvideo1.c
|
||||
* Microsoft Video-1 Decoder by Mike Melanson (melanson@pcisys.net)
|
||||
* For more information about the MS Video-1 format, visit:
|
||||
* http://www.pcisys.net/~melanson/codecs/
|
||||
*
|
||||
* This decoder outputs either PAL8 or RGB555 data, depending on the
|
||||
* whether a RGB palette was passed through palctrl;
|
||||
* if it's present, then the data is PAL8; RGB555 otherwise.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "commdlg.h"
|
||||
#include "vfw.h"
|
||||
#include "mmsystem.h"
|
||||
#include "msvidc32_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(msvidc32);
|
||||
|
||||
static HINSTANCE MSVIDC32_hModule;
|
||||
|
||||
#define CRAM_MAGIC mmioFOURCC('C', 'R', 'A', 'M')
|
||||
#define MSVC_MAGIC mmioFOURCC('M', 'S', 'V', 'C')
|
||||
#define WHAM_MAGIC mmioFOURCC('W', 'H', 'A', 'M')
|
||||
|
||||
#define PALETTE_COUNT 256
|
||||
#define LE_16(x) ((((const uint8_t *)(x))[1] << 8) | ((const uint8_t *)(x))[0])
|
||||
|
||||
/* FIXME - check the stream size */
|
||||
#define CHECK_STREAM_PTR(n) \
|
||||
if ((stream_ptr + n) > buf_size ) { \
|
||||
WARN("stream_ptr out of bounds (%d >= %d)\n", \
|
||||
stream_ptr + n, buf_size); \
|
||||
return; \
|
||||
}
|
||||
|
||||
typedef BYTE uint8_t;
|
||||
|
||||
typedef struct Msvideo1Context {
|
||||
DWORD dwMagic;
|
||||
int mode_8bit; /* if it's not 8-bit, it's 16-bit */
|
||||
} Msvideo1Context;
|
||||
|
||||
static void
|
||||
msvideo1_decode_8bit( int width, int height, const unsigned char *buf, int buf_size,
|
||||
unsigned char *pixels, int stride)
|
||||
{
|
||||
int block_ptr, pixel_ptr;
|
||||
int total_blocks;
|
||||
int pixel_x, pixel_y; /* pixel width and height iterators */
|
||||
int block_x, block_y; /* block width and height iterators */
|
||||
int blocks_wide, blocks_high; /* width and height in 4x4 blocks */
|
||||
int block_inc;
|
||||
int row_dec;
|
||||
|
||||
/* decoding parameters */
|
||||
int stream_ptr;
|
||||
unsigned char byte_a, byte_b;
|
||||
unsigned short flags;
|
||||
int skip_blocks;
|
||||
unsigned char colors[8];
|
||||
|
||||
stream_ptr = 0;
|
||||
skip_blocks = 0;
|
||||
blocks_wide = width / 4;
|
||||
blocks_high = height / 4;
|
||||
total_blocks = blocks_wide * blocks_high;
|
||||
block_inc = 4;
|
||||
row_dec = stride + 4;
|
||||
|
||||
for (block_y = blocks_high; block_y > 0; block_y--) {
|
||||
block_ptr = ((block_y * 4) - 1) * stride;
|
||||
for (block_x = blocks_wide; block_x > 0; block_x--) {
|
||||
/* check if this block should be skipped */
|
||||
if (skip_blocks) {
|
||||
block_ptr += block_inc;
|
||||
skip_blocks--;
|
||||
total_blocks--;
|
||||
continue;
|
||||
}
|
||||
|
||||
pixel_ptr = block_ptr;
|
||||
|
||||
/* get the next two bytes in the encoded data stream */
|
||||
CHECK_STREAM_PTR(2);
|
||||
byte_a = buf[stream_ptr++];
|
||||
byte_b = buf[stream_ptr++];
|
||||
|
||||
/* check if the decode is finished */
|
||||
if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0))
|
||||
return;
|
||||
else if ((byte_b & 0xFC) == 0x84) {
|
||||
/* skip code, but don't count the current block */
|
||||
skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
|
||||
} else if (byte_b < 0x80) {
|
||||
/* 2-color encoding */
|
||||
flags = (byte_b << 8) | byte_a;
|
||||
|
||||
CHECK_STREAM_PTR(2);
|
||||
colors[0] = buf[stream_ptr++];
|
||||
colors[1] = buf[stream_ptr++];
|
||||
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
|
||||
{
|
||||
#if ORIGINAL
|
||||
pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
|
||||
#else
|
||||
pixels[width*(height-(pixel_ptr/width)-1) +
|
||||
pixel_ptr%width] =
|
||||
colors[(flags & 0x1) ^ 1];
|
||||
pixel_ptr++;
|
||||
#endif
|
||||
}
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
} else if (byte_b >= 0x90) {
|
||||
/* 8-color encoding */
|
||||
flags = (byte_b << 8) | byte_a;
|
||||
|
||||
CHECK_STREAM_PTR(8);
|
||||
memcpy(colors, &buf[stream_ptr], 8);
|
||||
stream_ptr += 8;
|
||||
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
|
||||
{
|
||||
#if ORIGINAL
|
||||
pixels[pixel_ptr++] =
|
||||
colors[((pixel_y & 0x2) << 1) +
|
||||
(pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
|
||||
#else
|
||||
pixels[width*(height-(pixel_ptr/width)-1) +
|
||||
pixel_ptr%width] =
|
||||
colors[((pixel_y & 0x2) << 1) +
|
||||
(pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
|
||||
pixel_ptr++;
|
||||
#endif
|
||||
}
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
} else {
|
||||
/* 1-color encoding */
|
||||
colors[0] = byte_a;
|
||||
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++)
|
||||
{
|
||||
#if ORIGINAL
|
||||
pixels[pixel_ptr++] = colors[0];
|
||||
#else
|
||||
pixels[width*(height-(pixel_ptr/width)-1) +
|
||||
pixel_ptr%width] = colors[0];
|
||||
pixel_ptr++;
|
||||
#endif
|
||||
}
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
}
|
||||
|
||||
block_ptr += block_inc;
|
||||
total_blocks--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
msvideo1_decode_16bit( int width, int height, const unsigned char *buf, int buf_size,
|
||||
unsigned short *pixels, int stride)
|
||||
{
|
||||
int block_ptr, pixel_ptr;
|
||||
int total_blocks;
|
||||
int pixel_x, pixel_y; /* pixel width and height iterators */
|
||||
int block_x, block_y; /* block width and height iterators */
|
||||
int blocks_wide, blocks_high; /* width and height in 4x4 blocks */
|
||||
int block_inc;
|
||||
int row_dec;
|
||||
|
||||
/* decoding parameters */
|
||||
int stream_ptr;
|
||||
unsigned char byte_a, byte_b;
|
||||
unsigned short flags;
|
||||
int skip_blocks;
|
||||
unsigned short colors[8];
|
||||
|
||||
stream_ptr = 0;
|
||||
skip_blocks = 0;
|
||||
blocks_wide = width / 4;
|
||||
blocks_high = height / 4;
|
||||
total_blocks = blocks_wide * blocks_high;
|
||||
block_inc = 4;
|
||||
row_dec = stride + 4;
|
||||
|
||||
for (block_y = blocks_high; block_y > 0; block_y--) {
|
||||
block_ptr = ((block_y * 4) - 1) * stride;
|
||||
for (block_x = blocks_wide; block_x > 0; block_x--) {
|
||||
/* check if this block should be skipped */
|
||||
if (skip_blocks) {
|
||||
block_ptr += block_inc;
|
||||
skip_blocks--;
|
||||
total_blocks--;
|
||||
continue;
|
||||
}
|
||||
|
||||
pixel_ptr = block_ptr;
|
||||
|
||||
/* get the next two bytes in the encoded data stream */
|
||||
CHECK_STREAM_PTR(2);
|
||||
byte_a = buf[stream_ptr++];
|
||||
byte_b = buf[stream_ptr++];
|
||||
|
||||
/* check if the decode is finished */
|
||||
if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0)) {
|
||||
return;
|
||||
} else if ((byte_b & 0xFC) == 0x84) {
|
||||
/* skip code, but don't count the current block */
|
||||
skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
|
||||
} else if (byte_b < 0x80) {
|
||||
/* 2- or 8-color encoding modes */
|
||||
flags = (byte_b << 8) | byte_a;
|
||||
|
||||
CHECK_STREAM_PTR(4);
|
||||
colors[0] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[1] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
|
||||
if (colors[0] & 0x8000) {
|
||||
/* 8-color encoding */
|
||||
CHECK_STREAM_PTR(12);
|
||||
colors[2] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[3] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[4] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[5] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[6] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
colors[7] = LE_16(&buf[stream_ptr]);
|
||||
stream_ptr += 2;
|
||||
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
|
||||
pixels[pixel_ptr++] =
|
||||
colors[((pixel_y & 0x2) << 1) +
|
||||
(pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
} else {
|
||||
/* 2-color encoding */
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
|
||||
pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* otherwise, it's a 1-color block */
|
||||
colors[0] = (byte_b << 8) | byte_a;
|
||||
|
||||
for (pixel_y = 0; pixel_y < 4; pixel_y++) {
|
||||
for (pixel_x = 0; pixel_x < 4; pixel_x++)
|
||||
pixels[pixel_ptr++] = colors[0];
|
||||
pixel_ptr -= row_dec;
|
||||
}
|
||||
}
|
||||
|
||||
block_ptr += block_inc;
|
||||
total_blocks--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
|
||||
{
|
||||
TRACE("ICM_DECOMPRESS_QUERY %p %p %p\n", info, in, out);
|
||||
|
||||
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
|
||||
return ICERR_BADPARAM;
|
||||
|
||||
TRACE("planes = %d\n", in->bmiHeader.biPlanes );
|
||||
TRACE("bpp = %d\n", in->bmiHeader.biBitCount );
|
||||
TRACE("height = %d\n", in->bmiHeader.biHeight );
|
||||
TRACE("width = %d\n", in->bmiHeader.biWidth );
|
||||
TRACE("compr = %x\n", in->bmiHeader.biCompression );
|
||||
|
||||
if( ( in->bmiHeader.biCompression != CRAM_MAGIC ) &&
|
||||
( in->bmiHeader.biCompression != MSVC_MAGIC ) &&
|
||||
( in->bmiHeader.biCompression != WHAM_MAGIC ) )
|
||||
return ICERR_UNSUPPORTED;
|
||||
|
||||
if( ( in->bmiHeader.biBitCount != 16 ) &&
|
||||
( in->bmiHeader.biBitCount != 8 ) )
|
||||
{
|
||||
TRACE("can't do %d bpp\n", in->bmiHeader.biBitCount );
|
||||
return ICERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/* output must be same dimensions as input */
|
||||
if( out )
|
||||
{
|
||||
if( in->bmiHeader.biBitCount != out->bmiHeader.biBitCount )
|
||||
return ICERR_UNSUPPORTED;
|
||||
if( in->bmiHeader.biPlanes != out->bmiHeader.biPlanes )
|
||||
return ICERR_UNSUPPORTED;
|
||||
if( in->bmiHeader.biHeight != out->bmiHeader.biHeight )
|
||||
return ICERR_UNSUPPORTED;
|
||||
if( in->bmiHeader.biWidth != out->bmiHeader.biWidth )
|
||||
return ICERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TRACE("OK!\n");
|
||||
|
||||
return ICERR_OK;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
CRAM_DecompressGetFormat( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
|
||||
{
|
||||
DWORD size;
|
||||
|
||||
TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out);
|
||||
|
||||
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
|
||||
return ICERR_BADPARAM;
|
||||
|
||||
size = in->bmiHeader.biSize;
|
||||
if (in->bmiHeader.biBitCount <= 8)
|
||||
size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD);
|
||||
|
||||
if( out )
|
||||
{
|
||||
memcpy( out, in, size );
|
||||
out->bmiHeader.biCompression = BI_RGB;
|
||||
out->bmiHeader.biSizeImage = in->bmiHeader.biHeight
|
||||
* in->bmiHeader.biWidth *4;
|
||||
return ICERR_OK;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
static LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
|
||||
{
|
||||
TRACE("ICM_DECOMPRESS_BEGIN %p %p %p\n", info, in, out);
|
||||
|
||||
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
|
||||
return ICERR_BADPARAM;
|
||||
|
||||
TRACE("bitmap is %d bpp\n", in->bmiHeader.biBitCount);
|
||||
if( in->bmiHeader.biBitCount == 8 )
|
||||
info->mode_8bit = 1;
|
||||
else if( in->bmiHeader.biBitCount == 16 )
|
||||
info->mode_8bit = 0;
|
||||
else
|
||||
{
|
||||
ERR("Bad output format\n");
|
||||
return ICERR_BADPARAM;
|
||||
}
|
||||
|
||||
return ICERR_OK;
|
||||
}
|
||||
|
||||
static LRESULT CRAM_Decompress( Msvideo1Context *info, ICDECOMPRESS *icd, DWORD size )
|
||||
{
|
||||
LONG width, height, stride, sz;
|
||||
WORD bit_per_pixel;
|
||||
|
||||
TRACE("ICM_DECOMPRESS %p %p %d\n", info, icd, size);
|
||||
|
||||
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
|
||||
return ICERR_BADPARAM;
|
||||
|
||||
/* FIXME: flags are ignored */
|
||||
|
||||
width = icd->lpbiInput->biWidth;
|
||||
height = icd->lpbiInput->biHeight;
|
||||
bit_per_pixel = icd->lpbiInput->biBitCount;
|
||||
stride = width*bit_per_pixel/8;
|
||||
sz = icd->lpbiInput->biSizeImage;
|
||||
|
||||
if (info->mode_8bit)
|
||||
{
|
||||
msvideo1_decode_8bit( width, height, icd->lpInput, sz,
|
||||
icd->lpOutput, stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
msvideo1_decode_16bit( width, height, icd->lpInput, sz,
|
||||
icd->lpOutput, stride);
|
||||
}
|
||||
|
||||
return ICERR_OK;
|
||||
}
|
||||
|
||||
static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DWORD size )
|
||||
{
|
||||
LONG width, height, stride, sz;
|
||||
WORD bit_per_pixel;
|
||||
|
||||
TRACE("ICM_DECOMPRESSEX %p %p %d\n", info, icd, size);
|
||||
|
||||
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
|
||||
return ICERR_BADPARAM;
|
||||
|
||||
/* FIXME: flags are ignored */
|
||||
|
||||
width = icd->lpbiSrc->biWidth;
|
||||
height = icd->lpbiSrc->biHeight;
|
||||
bit_per_pixel = icd->lpbiSrc->biBitCount;
|
||||
stride = width*bit_per_pixel/8;
|
||||
sz = icd->lpbiSrc->biSizeImage;
|
||||
|
||||
if (info->mode_8bit)
|
||||
{
|
||||
msvideo1_decode_8bit( width, height, icd->lpSrc, sz,
|
||||
icd->lpDst, stride);
|
||||
}
|
||||
else
|
||||
{
|
||||
msvideo1_decode_16bit( width, height, icd->lpSrc, sz,
|
||||
icd->lpDst, stride);
|
||||
}
|
||||
|
||||
return ICERR_OK;
|
||||
}
|
||||
|
||||
static LRESULT CRAM_GetInfo( const Msvideo1Context *info, ICINFO *icinfo, DWORD dwSize )
|
||||
{
|
||||
if (!icinfo) return sizeof(ICINFO);
|
||||
if (dwSize < sizeof(ICINFO)) return 0;
|
||||
|
||||
icinfo->dwSize = sizeof(ICINFO);
|
||||
icinfo->fccType = ICTYPE_VIDEO;
|
||||
icinfo->fccHandler = info ? info->dwMagic : CRAM_MAGIC;
|
||||
icinfo->dwFlags = 0;
|
||||
icinfo->dwVersion = ICVERSION;
|
||||
icinfo->dwVersionICM = ICVERSION;
|
||||
|
||||
LoadStringW(MSVIDC32_hModule, IDS_NAME, icinfo->szName, sizeof(icinfo->szName)/sizeof(WCHAR));
|
||||
LoadStringW(MSVIDC32_hModule, IDS_DESCRIPTION, icinfo->szDescription, sizeof(icinfo->szDescription)/sizeof(WCHAR));
|
||||
/* msvfw32 will fill icinfo->szDriver for us */
|
||||
|
||||
return sizeof(ICINFO);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DriverProc (MSVIDC32.@)
|
||||
*/
|
||||
LRESULT WINAPI CRAM_DriverProc( DWORD_PTR dwDriverId, HDRVR hdrvr, UINT msg,
|
||||
LPARAM lParam1, LPARAM lParam2 )
|
||||
{
|
||||
Msvideo1Context *info = (Msvideo1Context *) dwDriverId;
|
||||
LRESULT r = ICERR_UNSUPPORTED;
|
||||
|
||||
TRACE("%ld %p %04x %08lx %08lx\n", dwDriverId, hdrvr, msg, lParam1, lParam2);
|
||||
|
||||
switch( msg )
|
||||
{
|
||||
case DRV_LOAD:
|
||||
TRACE("Loaded\n");
|
||||
r = 1;
|
||||
break;
|
||||
|
||||
case DRV_ENABLE:
|
||||
break;
|
||||
|
||||
case DRV_OPEN:
|
||||
{
|
||||
ICINFO *icinfo = (ICINFO *)lParam2;
|
||||
|
||||
TRACE("Opened\n");
|
||||
|
||||
if (icinfo && icinfo->fccType != ICTYPE_VIDEO) return 0;
|
||||
|
||||
info = HeapAlloc( GetProcessHeap(), 0, sizeof (Msvideo1Context) );
|
||||
if( info )
|
||||
{
|
||||
memset( info, 0, sizeof info );
|
||||
info->dwMagic = CRAM_MAGIC;
|
||||
}
|
||||
r = (LRESULT) info;
|
||||
break;
|
||||
}
|
||||
|
||||
case DRV_CLOSE:
|
||||
HeapFree( GetProcessHeap(), 0, info );
|
||||
break;
|
||||
|
||||
case DRV_DISABLE:
|
||||
break;
|
||||
|
||||
case DRV_FREE:
|
||||
break;
|
||||
|
||||
case ICM_GETINFO:
|
||||
r = CRAM_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESS_QUERY:
|
||||
r = CRAM_DecompressQuery( info, (LPBITMAPINFO) lParam1,
|
||||
(LPBITMAPINFO) lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESS_GET_FORMAT:
|
||||
r = CRAM_DecompressGetFormat( info, (LPBITMAPINFO) lParam1,
|
||||
(LPBITMAPINFO) lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESS_GET_PALETTE:
|
||||
FIXME("ICM_DECOMPRESS_GET_PALETTE\n");
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESSEX_QUERY:
|
||||
FIXME("ICM_DECOMPRESSEX_QUERY\n");
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESS:
|
||||
r = CRAM_Decompress( info, (ICDECOMPRESS*) lParam1,
|
||||
(DWORD) lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESS_BEGIN:
|
||||
r = CRAM_DecompressBegin( info, (LPBITMAPINFO) lParam1,
|
||||
(LPBITMAPINFO) lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_DECOMPRESSEX:
|
||||
r = CRAM_DecompressEx( info, (ICDECOMPRESSEX*) lParam1,
|
||||
(DWORD) lParam2 );
|
||||
break;
|
||||
|
||||
case ICM_COMPRESS_QUERY:
|
||||
FIXME("compression not implemented\n");
|
||||
r = ICERR_BADFORMAT;
|
||||
break;
|
||||
|
||||
case ICM_CONFIGURE:
|
||||
r = ICERR_UNSUPPORTED;
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("Unknown message: %04x %ld %ld\n", msg, lParam1, lParam2);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllMain
|
||||
*/
|
||||
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
TRACE("(%p,%d,%p)\n", hModule, dwReason, lpReserved);
|
||||
|
||||
switch (dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hModule);
|
||||
MSVIDC32_hModule = hModule;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
36
reactos/dll/win32/msvidc32/rsrc.rc
Normal file
36
reactos/dll/win32/msvidc32/rsrc.rc
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright 2005 Dmitry Timoshkov
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "windef.h"
|
||||
#include "msvidc32_private.h"
|
||||
|
||||
#include "msvidc32_Da.rc"
|
||||
#include "msvidc32_De.rc"
|
||||
#include "msvidc32_Fr.rc"
|
||||
#include "msvidc32_En.rc"
|
||||
#include "msvidc32_Hu.rc"
|
||||
#include "msvidc32_Ko.rc"
|
||||
#include "msvidc32_Nl.rc"
|
||||
#include "msvidc32_No.rc"
|
||||
#include "msvidc32_Pl.rc"
|
||||
#include "msvidc32_Pt.rc"
|
||||
#include "msvidc32_Ro.rc"
|
||||
#include "msvidc32_Ru.rc"
|
||||
#include "msvidc32_Si.rc"
|
||||
#include "msvidc32_Sv.rc"
|
||||
#include "msvidc32_Tr.rc"
|
|
@ -124,9 +124,15 @@
|
|||
<directory name="hlink">
|
||||
<xi:include href="hlink/hlink.rbuild" />
|
||||
</directory>
|
||||
<directory name="iccvid">
|
||||
<xi:include href="iccvid/iccvid.rbuild" />
|
||||
</directory>
|
||||
<directory name="icmp">
|
||||
<xi:include href="icmp/icmp.rbuild" />
|
||||
</directory>
|
||||
<directory name="imaadp32.acm">
|
||||
<xi:include href="imaadp32.acm/imaadp32.acm.rbuild" />
|
||||
</directory>
|
||||
<directory name="imagehlp">
|
||||
<xi:include href="imagehlp/imagehlp.rbuild" />
|
||||
</directory>
|
||||
|
@ -208,6 +214,9 @@
|
|||
<directory name="msacm32">
|
||||
<xi:include href="msacm32/msacm32.rbuild" />
|
||||
</directory>
|
||||
<directory name="msadp32.acm">
|
||||
<xi:include href="msadp32.acm/msadp32.acm.rbuild" />
|
||||
</directory>
|
||||
<directory name="msafd">
|
||||
<xi:include href="msafd/msafd.rbuild" />
|
||||
</directory>
|
||||
|
@ -226,6 +235,9 @@
|
|||
<directory name="msftedit">
|
||||
<xi:include href="msftedit/msftedit.rbuild" />
|
||||
</directory>
|
||||
<directory name="msg711.acm">
|
||||
<xi:include href="msg711.acm/msg711.acm.rbuild" />
|
||||
</directory>
|
||||
<directory name="msgina">
|
||||
<xi:include href="msgina/msgina.rbuild" />
|
||||
</directory>
|
||||
|
@ -262,6 +274,9 @@
|
|||
<directory name="msvfw32">
|
||||
<xi:include href="msvfw32/msvfw32.rbuild" />
|
||||
</directory>
|
||||
<directory name="msvidc32">
|
||||
<xi:include href="msvidc32/msvidc32.rbuild" />
|
||||
</directory>
|
||||
<directory name="mswsock">
|
||||
<xi:include href="mswsock/mswsock.rbuild" />
|
||||
</directory>
|
||||
|
|
|
@ -50,7 +50,9 @@ reactos/dll/win32/dciman32 # Synced to Wine-1_0-rc2
|
|||
reactos/dll/win32/gdiplus # Autosync
|
||||
reactos/dll/win32/hhctrl.ocx # Autosync
|
||||
reactos/dll/win32/hlink # Autosync
|
||||
reactos/dll/win32/iccvid # Autosync
|
||||
reactos/dll/win32/icmp # Synced to Wine-0_9_10
|
||||
reactos/dll/win32/imaadp32.acm # Autosync
|
||||
reactos/dll/win32/imm32 # Autosync
|
||||
reactos/dll/win32/imagehlp # Patches for BindImage need review and submission to winehq.
|
||||
reactos/dll/win32/inetcomm # Autosync
|
||||
|
@ -71,11 +73,13 @@ reactos/dll/win32/mciwave # Autosync
|
|||
reactos/dll/win32/mlang # Autosync
|
||||
reactos/dll/win32/mpr # Autosync
|
||||
reactos/dll/win32/msacm32 # Out of sync
|
||||
reactos/dll/win32/msadp32.acm # Autosync
|
||||
reactos/dll/win32/mscat32 # Autosync
|
||||
reactos/dll/win32/mscms # Autosync
|
||||
reactos/dll/win32/mscoree # Autosync
|
||||
reactos/dll/win32/msctf # Autosync
|
||||
reactos/dll/win32/msftedit # Autosync
|
||||
reactos/dll/win32/msg711.acm # Autosync
|
||||
reactos/dll/win32/mshtml # Autosync
|
||||
reactos/dll/win32/msimg32 # Autosync
|
||||
reactos/dll/win32/msi # Autosync
|
||||
|
@ -84,6 +88,7 @@ reactos/dll/win32/msrle32 # Autosync
|
|||
reactos/dll/win32/mstask # Autosync
|
||||
reactos/dll/win32/msvcrt20 # Autosync
|
||||
reactos/dll/win32/msvfw32 # Autosync
|
||||
reactos/dll/win32/msvidc32 # Autosync
|
||||
reactos/dll/win32/msxml3 # Synced to Wine-20071230
|
||||
reactos/dll/win32/nddeapi # Autosync
|
||||
reactos/dll/win32/netapi32 # Autosync
|
||||
|
|
Loading…
Reference in a new issue