From 547893cb14e680f9787c6c7e006681a2d081b35b Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 30 Oct 2010 07:42:31 +0000 Subject: renamed ffmpeg audio/decoder to something generic git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2696 b956fd51-792f-4845-bead-9b4dfca2ff2c --- mediaplugin/src/media/UAudioDecoder_FFmpeg.pas | 48 +++++++++++++------------- mediaplugin/src/media/UMediaPlugin.pas | 4 +-- mediaplugin/src/media/UVideoDecoder_FFmpeg.pas | 48 ++++++++++++-------------- 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/mediaplugin/src/media/UAudioDecoder_FFmpeg.pas b/mediaplugin/src/media/UAudioDecoder_FFmpeg.pas index 6047cdd6..96d1e9e9 100644 --- a/mediaplugin/src/media/UAudioDecoder_FFmpeg.pas +++ b/mediaplugin/src/media/UAudioDecoder_FFmpeg.pas @@ -50,7 +50,7 @@ uses UPath; type - TAudioDecoder_FFmpeg = class(TInterfacedObject, IAudioDecoder) + TAudioDecoderPlugin = class(TInterfacedObject, IAudioDecoder) private fPluginInfo: PMediaPluginInfo; public @@ -74,7 +74,7 @@ uses ULog; type - TFFmpegDecodeStream = class(TAudioDecodeStream) + TPluginAudioDecodeStream = class(TAudioDecodeStream) private fAudioDecoderInfo: PAudioDecoderInfo; fFilename: IPath; @@ -100,9 +100,9 @@ type function ReadData(Buffer: PByteArray; BufferSize: integer): integer; override; end; -{ TFFmpegDecodeStream } +{ TPluginAudioDecodeStream } -constructor TFFmpegDecodeStream.Create(Info: PAudioDecoderInfo); +constructor TPluginAudioDecodeStream.Create(Info: PAudioDecoderInfo); begin inherited Create(); fAudioDecoderInfo := Info; @@ -112,13 +112,13 @@ end; {* * Frees the decode-stream data. *} -destructor TFFmpegDecodeStream.Destroy(); +destructor TPluginAudioDecodeStream.Destroy(); begin Close(); inherited; end; -function TFFmpegDecodeStream.Open(const Filename: IPath): boolean; +function TPluginAudioDecodeStream.Open(const Filename: IPath): boolean; var Info: TCAudioFormatInfo; begin @@ -142,7 +142,7 @@ begin Result := true; end; -procedure TFFmpegDecodeStream.Close(); +procedure TPluginAudioDecodeStream.Close(); begin Self.fFilename := PATH_NONE; if (fStream <> nil) then @@ -152,84 +152,84 @@ begin end; end; -function TFFmpegDecodeStream.GetLength(): real; +function TPluginAudioDecodeStream.GetLength(): real; begin Result := fAudioDecoderInfo.getLength(fStream); end; -function TFFmpegDecodeStream.GetAudioFormatInfo(): TAudioFormatInfo; +function TPluginAudioDecodeStream.GetAudioFormatInfo(): TAudioFormatInfo; begin Result := fFormatInfo; end; -function TFFmpegDecodeStream.IsEOF(): boolean; +function TPluginAudioDecodeStream.IsEOF(): boolean; begin Result := fAudioDecoderInfo.isEOF(fStream); end; -function TFFmpegDecodeStream.IsError(): boolean; +function TPluginAudioDecodeStream.IsError(): boolean; begin Result := fAudioDecoderInfo.isError(fStream); end; -function TFFmpegDecodeStream.GetPosition(): real; +function TPluginAudioDecodeStream.GetPosition(): real; begin Result := fAudioDecoderInfo.getPosition(fStream); end; -procedure TFFmpegDecodeStream.SetPosition(Time: real); +procedure TPluginAudioDecodeStream.SetPosition(Time: real); begin fAudioDecoderInfo.setPosition(fStream, Time); end; -function TFFmpegDecodeStream.GetLoop(): boolean; +function TPluginAudioDecodeStream.GetLoop(): boolean; begin Result := fAudioDecoderInfo.getLoop(fStream); end; -procedure TFFmpegDecodeStream.SetLoop(Enabled: boolean); +procedure TPluginAudioDecodeStream.SetLoop(Enabled: boolean); begin fAudioDecoderInfo.setLoop(fStream, Enabled); end; -function TFFmpegDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): integer; +function TPluginAudioDecodeStream.ReadData(Buffer: PByteArray; BufferSize: integer): integer; begin Result := fAudioDecoderInfo.readData(fStream, PCUint8(Buffer), BufferSize); end; -{ TAudioDecoder_FFmpeg } +{ TAudioDecoderPlugin } -constructor TAudioDecoder_FFmpeg.Create(Info: PMediaPluginInfo); +constructor TAudioDecoderPlugin.Create(Info: PMediaPluginInfo); begin inherited Create(); fPluginInfo := Info; end; -function TAudioDecoder_FFmpeg.GetName: String; +function TAudioDecoderPlugin.GetName: String; begin Result := 'Plugin:AudioDecoder:' + fPluginInfo.name; end; -function TAudioDecoder_FFmpeg.InitializeDecoder: boolean; +function TAudioDecoderPlugin.InitializeDecoder: boolean; begin //fPluginInfo.initialize(); Result := true; end; -function TAudioDecoder_FFmpeg.FinalizeDecoder(): boolean; +function TAudioDecoderPlugin.FinalizeDecoder(): boolean; begin //fPluginInfo.finalize(); Result := true; end; -function TAudioDecoder_FFmpeg.Open(const Filename: IPath): TAudioDecodeStream; +function TAudioDecoderPlugin.Open(const Filename: IPath): TAudioDecodeStream; var - Stream: TFFmpegDecodeStream; + Stream: TPluginAudioDecodeStream; begin Result := nil; - Stream := TFFmpegDecodeStream.Create(fPluginInfo.audioDecoder); + Stream := TPluginAudioDecodeStream.Create(fPluginInfo.audioDecoder); if (not Stream.Open(Filename)) then begin Stream.Free; diff --git a/mediaplugin/src/media/UMediaPlugin.pas b/mediaplugin/src/media/UMediaPlugin.pas index 0c0f7fb9..0fa72852 100644 --- a/mediaplugin/src/media/UMediaPlugin.pas +++ b/mediaplugin/src/media/UMediaPlugin.pas @@ -393,9 +393,9 @@ begin // register modules if (PluginInfo.audioDecoder <> nil) then - MediaManager.Add(TAudioDecoder_FFmpeg.Create(PluginInfo)); + MediaManager.Add(TAudioDecoderPlugin.Create(PluginInfo)); if (PluginInfo.videoDecoder <> nil) then - MediaManager.Add(TVideoDecoder_FFmpeg.Create(PluginInfo)); + MediaManager.Add(TVideoDecoderPlugin.Create(PluginInfo)); //if (PluginInfo.audioConverter <> nil) then // MediaManager.Add(); end; diff --git a/mediaplugin/src/media/UVideoDecoder_FFmpeg.pas b/mediaplugin/src/media/UVideoDecoder_FFmpeg.pas index b8b72a9d..073bef9c 100644 --- a/mediaplugin/src/media/UVideoDecoder_FFmpeg.pas +++ b/mediaplugin/src/media/UVideoDecoder_FFmpeg.pas @@ -39,7 +39,7 @@ uses UPath; type - TVideoDecoder_FFmpeg = class( TInterfacedObject, IVideoDecoder ) + TVideoDecoderPlugin = class( TInterfacedObject, IVideoDecoder ) private fPluginInfo: PMediaPluginInfo; public @@ -64,7 +64,7 @@ uses ULog; type - TVideoDecodeStream_FFmpeg = class (TVideoDecodeStream) + TPluginVideoDecodeStream = class (TVideoDecodeStream) private fVideoDecoderInfo: PVideoDecoderInfo; fFilename: IPath; @@ -90,40 +90,38 @@ type function GetFrame(Time: Extended): PByteArray; override; end; -{*------------------------------------------------------------------------------ - * TVideoPlayback_ffmpeg - *------------------------------------------------------------------------------} +{ TVideoDecoderPlugin } -constructor TVideoDecoder_FFmpeg.Create(Info: PMediaPluginInfo); +constructor TVideoDecoderPlugin.Create(Info: PMediaPluginInfo); begin inherited Create(); fPluginInfo := Info; end; -function TVideoDecoder_FFmpeg.GetName: String; +function TVideoDecoderPlugin.GetName: String; begin Result := 'Plugin:VideoDecoder:' + fPluginInfo.name; end; -function TVideoDecoder_FFmpeg.InitializeDecoder(): boolean; +function TVideoDecoderPlugin.InitializeDecoder(): boolean; begin //fPluginInfo.initialize(); Result := true; end; -function TVideoDecoder_FFmpeg.FinalizeDecoder(): boolean; +function TVideoDecoderPlugin.FinalizeDecoder(): boolean; begin //fPluginInfo.finalize(); Result := true; end; -function TVideoDecoder_FFmpeg.Open(const FileName : IPath): TVideoDecodeStream; +function TVideoDecoderPlugin.Open(const FileName : IPath): TVideoDecodeStream; var - Stream: TVideoDecodeStream_FFmpeg; + Stream: TPluginVideoDecodeStream; begin Result := nil; - Stream := TVideoDecodeStream_FFmpeg.Create(fPluginInfo.videoDecoder); + Stream := TPluginVideoDecodeStream.Create(fPluginInfo.videoDecoder); if (not Stream.Open(FileName)) then begin Stream.Free; @@ -134,22 +132,22 @@ begin end; -{* TVideoDecoder_FFmpeg *} +{ TPluginVideoDecodeStream } -constructor TVideoDecodeStream_FFmpeg.Create(Info: PVideoDecoderInfo); +constructor TPluginVideoDecodeStream.Create(Info: PVideoDecoderInfo); begin inherited Create(); fVideoDecoderInfo := Info; fFilename := PATH_NONE; end; -destructor TVideoDecodeStream_FFmpeg.Destroy; +destructor TPluginVideoDecodeStream.Destroy; begin Close(); inherited; end; -function TVideoDecodeStream_FFmpeg.Open(const FileName: IPath): boolean; +function TPluginVideoDecodeStream.Open(const FileName: IPath): boolean; begin Result := false; @@ -164,7 +162,7 @@ begin Result := true; end; -procedure TVideoDecodeStream_FFmpeg.Close; +procedure TPluginVideoDecodeStream.Close; begin Self.fFilename := PATH_NONE; if (fStream <> nil) then @@ -174,42 +172,42 @@ begin end; end; -function TVideoDecodeStream_FFmpeg.GetFrame(Time: Extended): PByteArray; +function TPluginVideoDecodeStream.GetFrame(Time: Extended): PByteArray; begin Result := PByteArray(fVideoDecoderInfo.getFrame(fStream, Time)); end; -procedure TVideoDecodeStream_FFmpeg.SetLoop(Enable: boolean); +procedure TPluginVideoDecodeStream.SetLoop(Enable: boolean); begin fVideoDecoderInfo.setLoop(fStream, Enable); end; -function TVideoDecodeStream_FFmpeg.GetLoop(): boolean; +function TPluginVideoDecodeStream.GetLoop(): boolean; begin Result := fVideoDecoderInfo.getLoop(fStream); end; -procedure TVideoDecodeStream_FFmpeg.SetPosition(Time: real); +procedure TPluginVideoDecodeStream.SetPosition(Time: real); begin fVideoDecoderInfo.setPosition(fStream, Time); end; -function TVideoDecodeStream_FFmpeg.GetPosition: real; +function TPluginVideoDecodeStream.GetPosition: real; begin Result := fVideoDecoderInfo.getPosition(fStream); end; -function TVideoDecodeStream_FFmpeg.GetFrameWidth(): integer; +function TPluginVideoDecodeStream.GetFrameWidth(): integer; begin Result := fVideoDecoderInfo.getFrameWidth(fStream); end; -function TVideoDecodeStream_FFmpeg.GetFrameHeight(): integer; +function TPluginVideoDecodeStream.GetFrameHeight(): integer; begin Result := fVideoDecoderInfo.getFrameHeight(fStream); end; -function TVideoDecodeStream_FFmpeg.GetFrameAspect(): real; +function TPluginVideoDecodeStream.GetFrameAspect(): real; begin Result := fVideoDecoderInfo.getFrameAspect(fStream); end; -- cgit v1.2.3