📄 kmpplgin.pas
字号:
/////////////////////////////////////////////////////////////////////////////
//
// KMP侩 坷叼坷/厚叼坷 敲矾弊牢 牢磐其捞胶
//
// KMP狼 敲矾弊牢 葛碘篮 扩沮橇狼 DSP敲矾弊牢苞
// 备炼啊 芭狼 鞍促. 坷叼坷 敲矾弊牢狼 版快绰 廊沮橇客 备炼啊
// 鞍扁 锭巩俊 扩沮橇狼 DSP敲矾弊牢阑 KMP俊辑 荤侩窍绰 巴捞 啊瓷窍促.
// 厚叼坷 敲矾弊牢狼 版快档 芭狼 厚搅窍骨肺 奖霸 累己且荐啊 乐阑巴捞促.
// 弊府绊 窃荐 痹距捞 cdel捞促.. 曼绊...
//
// 康惑敲矾弊牢狼 版快绰 WaSaVi客 崔扼脸促... 肚茄 曼绊...
//
/////////////////////////////////////////////////////////////////////////////
unit KMPPlgIn;
interface
uses
Windows;
// header version: 0x20 == 0.20 == winamp 2.0
const
DSP_HDRVER = $20;
// DSP plugin interface
// notes:
// any window that remains in foreground should optimally pass unused
// keystrokes to the parent (winamp's) window, so that the user
// can still control it. As for storing configuration,
// Configuration data should be stored in <dll directory>\plugin.ini
// (look at the vis plugin for configuration code)
type
//////////////////////////////////////////////////////////////////////////////
//
// Audio PlugIn Type...(same as Winamp DSP PlugIn Type...)
//
// 扩沮橇狼 DSP橇矾弊牢苞 备炼啊 100%老摹茄促.
//////////////////////////////////////////////////////////////////////////////
PwinampDSPModule = ^TwinampDSPModule;
TwinampDSPModule = record
description : pchar; // description
hwndParent : HWND; // parent window (filled in by calling app)
hDllInstance : LongWord; // instance handle to this DLL (filled in by calling app)
Config : procedure(this_mod : PwinampDSPModule); cdecl; // configuration dialog (if needed)
Init : function(this_mod : PwinampDSPModule) : integer; cdecl; // 0 on success, creates window, etc (if needed)
// modify waveform samples: returns number of samples to actually write
// (typically numsamples, but no more than twice numsamples, and no less than half numsamples)
// numsamples should always be at least 128. should, but I'm not sure
ModifySamples : function(this_mod : PwinampDSPModule;samples : PByte;
numsamples,bps,nch,srate : integer) : integer; cdecl;
// 扩沮橇俊辑 荤侩窍绰 澜己阑 函版窍绰 窃荐...
// samples : 基敲捞 甸绢啊 乐绰 滚欺
// numsamples : 基敲狼 肮荐(角龙利牢 滚欺狼 辨捞啊 酒聪扼 基敲狼 肮荐烙...
// bps : 基敲寸 厚飘荐 8 or 16
// nch : 盲澄荐 1 : 葛畴 , 2 : 胶飘饭坷
// srate : 基敲傅 饭捞飘 44000殿殿..
// 捞窃荐俊辑 府畔蔼捞 函版茄 单捞鸥狼 肮荐捞促. 肚茄 角龙利栏肺 免仿栏肺
// 唱啊绰 肮荐捞扁档 窍促. 扩沮橇俊辑 抛胶飘茄 版快绰 涝仿罐篮 基敲焊促
// 腹霸秦档 悼累阑 窍看促. 蝶扼辑 KMP俊辑档 涝仿焊促 3-4硅沥档狼
// 皋葛府甫 郴何利栏肺 且寸阑 秦初疽促. 弊矾骨肺 3-4硅 捞惑阑 贸府窍搁 坷幅啊
// 老绢朝荐档 乐促...
//
Quit : procedure(this_mod : PwinampDSPModule); cdecl; // called when unloading
userData : Pointer; // user data, optional
end;
PwinampDSPHeader = ^TwinampDSPHeader;
TwinampDSPHeader = record
version : integer; // DSP_HDRVER
description : pchar; // description of library
winampDSPModule : function(num : integer) : PwinampDSPModule; cdecl; // module retrieval function
end;
////////////////////////////////////
// Audio PlugIn DLL Exports Name...
////////////////////////////////////
//function winampDSPGetHeader2 : PwinampDSPHeader; cdecl;
// 澜己 DLL俊辑 Exports秦具 登绰 窃荐狼 屈侥
// 溜 困狼 窃荐甫 畴免矫难具 茄促....
////////////////////////////////////////////////////////////////////////////
//
// Video PlugIn Type( Modifyed from Winamp DSP Plugin type ...)
//
// 扩沮橇狼 DSP敲矾弊牢狼 备炼甫 炼陛 函版秦辑 KMP狼 厚叼坷
// 敲矾弊牢阑 荤侩茄促.
////////////////////////////////////////////////////////////////////////////
const
IID_IYV12ImageProcessor : TGUID = '{249F44BC-B8BF-411F-B047-D9C017DFECF2}';
type
// KMP俊辑 力傍登绰 拳惑狼 备炼
// KMP俊辑绰 敲饭牢 YV12捞固瘤狼 备炼甫 荤侩茄促.
// Y狼 农扁绰 捞固瘤狼 农扁客 鞍绊,
// U,V狼 农扁绰 啊肺啊 2硅累绊, 技肺啊 2硅累促.
// 溜 U,V狼 农扁绰 Y狼 农扁焊促 4硅啊 累促.
PkmpYV12Image = ^TkmpYV12Image;
TkmpYV12Image = record
Width, Height : integer; // 啊肺, 技肺狼 农扁 // 啊肺狼 版快绰 16狼 硅荐啊 登绢具 凳...
y_plain : pChar; // Y敲饭牢 滚欺, 农扁:Width*Height
u_plain : pChar; // U敲饭牢 滚欺, 农扁:Width*Height/4
v_plain : pChar; // V敲饭牢 滚欺, 农扁:Width*Height/4
YMask : pChar; // 捧疙阑 困茄 Y付胶农 郴何利栏肺 荤侩
UVMask : pChar; // 捧疙阑 困茄 UV付胶农 郴何利栏肺 荤侩
end;
IkmpYV12ImageProcessor = interface
// YV12捞固瘤甫 包府窍绊 贸府窍绰单 档框阑 林绰 牢磐其捞胶
// 泅犁 RGB32,24,565,555狼 DIB捞固瘤父 瘤盔茄促.
// 胆颇捞狼 版快绰 DelphiX狼 TDIB唱 TBitmap狼 DIB甫 捞侩窍搁
// 奖霸 DIB客 YV12Image甫 贸府且荐啊 乐促.
// 抗力甫 曼绊窍扁 官恩...
['{249F44BC-B8BF-411F-B047-D9C017DFECF2}']
function kmpAllocYV12Image(width,height : integer;out pImage : PkmpYV12Image) : HResult; stdcall;
// width, height狼 农扁肺 YV12Image备炼眉甫 父电促...
// 2狼 硅荐肺 沥纺捞 登绢 乐绢具 登绊,
// 啊瓷窍搁 16狼 硅荐啊 登绢 乐绢具父 救沥窍霸 悼累茄促.
// AllocYV12Image肺 父电巴篮 酒贰狼 FreeYV12Image肺 秦力甫 秦具 等促.
function kmpFreeYV12Image(var pImage : PkmpYV12Image) : HResult; stdcall;
// AllocYV12Image肺 父电 捞固瘤甫 秦力 茄促.
function kmpCopyYV12Image(pSrc,pDst : PkmpYV12Image) : HResult; stdcall;
// YV12Image甫 汗荤茄促.
function kmpRGB32ToYV12(DIB32 : pByte; Width, Height : integer;pImage : PkmpYV12Image) : HResult; stdcall;
function kmpRGB24ToYV12(DIB24 : pByte; Width, Height : integer;pImage : PkmpYV12Image) : HResult; stdcall;
function kmpRGB565ToYV12(DIB565 : pByte; Width, Height : integer;pImage : PkmpYV12Image) : HResult; stdcall;
function kmpRGB555ToYV12(DIB555 : pByte; Width, Height : integer;pImage : PkmpYV12Image) : HResult; stdcall;
// RGB器镐(DIB)阑 YV12捞固瘤肺 官槽促.
function kmpYV12ToRGB32(pImage : PkmpYV12Image; DIB32 : pByte; Width, Height : integer) : HResult; stdcall;
function kmpYV12ToRGB24(pImage : PkmpYV12Image; DIB24 : pByte; Width, Height : integer) : HResult; stdcall;
function kmpYV12ToRGB565(pImage : PkmpYV12Image; DIB565 : pByte; Width, Height : integer) : HResult; stdcall;
function kmpYV12ToRGB555(pImage : PkmpYV12Image; DIB555 : pByte; Width, Height : integer) : HResult; stdcall;
// YV12Image狼 屈侥栏肺 等巴阑 RGB(DIB)狼 屈侥栏肺 官槽促.
// 捞锭 Height俊 澜狼荐甫 持绢林搁 拳搁捞 第笼绢廉辑 唱柯促.
// Width绰 剧父 瘤盔窃...
function kmpYV12NormalDraw(Src,Dst : PkmpYV12Image;SRect : PRect;dx,dy : integer) : HResult; stdcall;
// 酒公繁 瓤苞 绝捞 捞固瘤甫 弊赴促.
function kmpYV12BlendDraw(Src,Dst : PkmpYV12Image;SRect : PRect;dx,dy : integer;alpha : integer) : HResult; stdcall;
// 馆捧疙瓤苞肺 捞固瘤甫 弊赴促. 0<=alpha<=255
function kmpYV12TransDraw(Src,Dst : PkmpYV12Image;SRect : PRect;dx,dy : integer) : HResult; stdcall;
// 硅版祸阑 捧疙栏肺 弊赴促. 硅版祸篮 0锅掳 祸阑 扁霖栏肺 茄促.
function kmpYV12BlendTransDraw(Src,Dst : PkmpYV12Image;SRect : PRect;dx,dy : integer;alpha : integer) : HResult; stdcall;
// 硅版祸阑 捧疙栏肺 弊府绊 馆捧疙瓤苞肺 弊赴促. 0<=alpha<=255
end;
PkmpDSPModule = ^TkmpDSPModule;
TkmpDSPModule = record
description : pchar; // description
hwndParent : HWND; // parent window (filled in by calling app)
hDllInstance : LongWord; // instance handle to this DLL (filled in by calling app)
Config : procedure(this_mod : PkmpDSPModule); cdecl; // configuration dialog (if needed)
Init : function(this_mod : PkmpDSPModule) : integer; cdecl; // 0 on success, creates window, etc (if needed)
BeforeModifyImage : function(this_mod : PkmpDSPModule;image : PkmpYV12Image;
ewidth : integer) : integer; cdecl; // 歹喉基敲傈俊 阂府绰 窃荐
// kmp俊辑 荤侩窍绰 康惑阑 函版窍绰 窃荐...
// image : 捞固瘤狼 滚欺, 困俊辑 汲疙
// ewidth : 角龙利牢 捞固瘤狼 啊肺 辨捞
// image狼 width绰 且寸等 捞固瘤狼 啊肺辨捞捞促.
// 角龙利牢巴苞 且寸利牢巴捞 瞒捞啊 唱绰 捞蜡绰 鞘磐甸捞 楷搬瞪锭俊绰
// 滚欺啊 沥纺捞 登绢 乐绢具 凳... 蝶扼辑 角力肺 康惑捞 甸绢啊 乐绰 辨捞客
// 且寸等 滚欺狼 辨捞啊 撇妨瘤霸凳...
// 焊烹 拳惑阑 贸府窍绰 版快绰 喊肺 脚版阑 臼静档 登瘤父 谅快甫 第笼绰 版快绰
// 康惑狼 场阑 舅酒具登扁 锭巩俊 颇扼皋磐肺 逞败霖促...
// 溜 image狼 width=ewidth+?? 咯扁辑 ??绰 眠啊 官捞飘肺 沥纺阑 困秦辑 眠啊等 官捞飘捞促.
// 技肺俊辑绰 沥纺捞 鞘夸啊 绝促.
// 康惑篮 农扁甫 函版且荐啊 绝促.
// 府畔蔼篮 乐瘤父 贸府窍瘤 臼酒档 等促.
AfterModifyImage : function(this_mod : PkmpDSPModule;image : PkmpYV12Image;
ewidth : integer) : integer; cdecl; // 歹喉基敲饶俊 阂府绰 窃荐
// 颇扼固磐绰 困客 鞍澜.
// BeforeModifyImage狼 版快绰 歹喉基敲捞 悼累且锭父 阂府绢瘤霸 等促.
// 蝶扼辑 粱歹狐弗 捞固瘤 贸府甫 困秦辑绰 BeforeModifyImage甫
// 贸府窍搁 等促.
// 溜 歹喉基敲 悼累矫 BeforeModifyImage -> AfterModifyImage
// 救窍搁 AfterModifyImage
// 贸府甫 救且妨搁 nil肺 汲沥窍搁 凳....
//
Quit : procedure(this_mod : PkmpDSPModule); cdecl; // called when unloading
userData : Pointer; // user data, optional
ImageProcessor : IkmpYV12ImageProcessor; // 捞固瘤 贸府甫 困茄 牢磐其捞胶
// 困俊辑 汲疙
end;
PkmpDSPHeader = ^TkmpDSPHeader;
TkmpDSPHeader = record
version : integer; // DSP_HDRVER
description : pchar; // description of library
kmpDSPModule : function(num : integer) : PkmpDSPModule; cdecl; // module retrieval function
end;
///////////////////////////////////////
// Video PlugIn DLL Exports...
///////////////////////////////////////
//function kmpDSPGetHeader2 : PkmpDSPHeader; cdecl;
// 康惑 DLL俊辑 Export秦具登绰 窃荐狼 屈侥
// 溜 困狼 窃荐甫 畴免矫难具 茄促....
implementation
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -