aboutsummaryrefslogtreecommitdiffstats
path: root/mediaplugin/src
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-11-08 08:33:31 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-11-08 08:33:31 +0000
commitb74578a2ad4940b467056d75a6888cda13960ddf (patch)
tree50e44ddbce8bccdde9c2a80194fb5c7c445253b1 /mediaplugin/src
parent7270ba69f010ed409af29704fff935867bff453e (diff)
downloadusdx-b74578a2ad4940b467056d75a6888cda13960ddf.tar.gz
usdx-b74578a2ad4940b467056d75a6888cda13960ddf.tar.xz
usdx-b74578a2ad4940b467056d75a6888cda13960ddf.zip
- fix audio-converter initialization
- constructors must be public in pascal git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2714 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'mediaplugin/src')
-rw-r--r--mediaplugin/src/media/UAudioConverterPlugin.pas27
1 files changed, 17 insertions, 10 deletions
diff --git a/mediaplugin/src/media/UAudioConverterPlugin.pas b/mediaplugin/src/media/UAudioConverterPlugin.pas
index b6ede1fb..9a321006 100644
--- a/mediaplugin/src/media/UAudioConverterPlugin.pas
+++ b/mediaplugin/src/media/UAudioConverterPlugin.pas
@@ -58,17 +58,18 @@ type
TPluginAudioConvertStream = class(TAudioConvertStream)
private
- fPluginInfo: PMediaPluginInfo;
fAudioConverter: PAudioConverterInfo;
fStream: PAudioConvertStream;
function Init(): boolean;
- protected
- constructor Create(SrcFormatInfo: TAudioFormatInfo;
- DstFormatInfo: TAudioFormatInfo);
public
+ // Do not call this directly, use Open() instead
+ constructor Create(Info: PAudioConverterInfo;
+ SrcFormatInfo: TAudioFormatInfo;
+ DstFormatInfo: TAudioFormatInfo);
destructor Destroy(); override;
- class function Open(SrcFormatInfo: TAudioFormatInfo;
+ class function Open(Info: PAudioConverterInfo;
+ SrcFormatInfo: TAudioFormatInfo;
DstFormatInfo: TAudioFormatInfo): TPluginAudioConvertStream;
function Convert(InputBuffer: PByteArray; OutputBuffer: PByteArray; var InputSize: integer): integer; override;
@@ -111,15 +112,20 @@ end;
function TAudioConverterPlugin.Open(SrcFormatInfo: TAudioFormatInfo;
DstFormatInfo: TAudioFormatInfo): TAudioConvertStream;
begin
- Result := TPluginAudioConvertStream.Open(SrcFormatInfo, DstFormatInfo);
+ Result := TPluginAudioConvertStream.Open(
+ fPluginInfo.audioConverter,
+ SrcFormatInfo, DstFormatInfo);
end;
{ TAudioConverterPlugin }
-constructor TPluginAudioConvertStream.Create(SrcFormatInfo: TAudioFormatInfo;
+constructor TPluginAudioConvertStream.Create(
+ Info: PAudioConverterInfo;
+ SrcFormatInfo: TAudioFormatInfo;
DstFormatInfo: TAudioFormatInfo);
begin
inherited Create(SrcFormatInfo, DstFormatInfo);
+ fAudioConverter := Info;
end;
destructor TPluginAudioConvertStream.Destroy();
@@ -129,13 +135,15 @@ begin
inherited;
end;
-class function TPluginAudioConvertStream.Open(SrcFormatInfo: TAudioFormatInfo;
+class function TPluginAudioConvertStream.Open(
+ Info: PAudioConverterInfo;
+ SrcFormatInfo: TAudioFormatInfo;
DstFormatInfo: TAudioFormatInfo): TPluginAudioConvertStream;
var
Stream: TPluginAudioConvertStream;
begin
Result := nil;
- Stream := TPluginAudioConvertStream.Create(SrcFormatInfo, DstFormatInfo);
+ Stream := TPluginAudioConvertStream.Create(Info, SrcFormatInfo, DstFormatInfo);
if (not Stream.Init()) then
begin
Stream.Free;
@@ -150,7 +158,6 @@ var
CDstFormatInfo: TCAudioFormatInfo;
begin
Result := false;
- fAudioConverter := fPluginInfo.audioConverter;
AudioFormatInfoToCStruct(SrcFormatInfo, CSrcFormatInfo);
AudioFormatInfoToCStruct(DstFormatInfo, CDstFormatInfo);