【delphi开源代码栏目提醒】:网学会员--在 delphi开源代码编辑为广大网友搜集整理了:BaseClass.pas绩等信息,祝愿广大网友取得需要的信息,参考学习。
(*********************************************************************
* DSPack 2.3.3 *
* DirectShow BaseClass *
* *
* home page : http://www.progdigy.com *
* email : 3710167@qq.com *
* *
* date : 21-02-2003 *
* *
* The contents of this file are used with permission, subject to *
* the Mozilla Public License Version 1.1 (the "License"); you may *
* not use this file except in compliance with the License. You may *
* obtain a copy of the License at *
* http://www.mozilla.org/MPL/MPL-1.1.html *
* *
* Software distributed under the License is distributed on an *
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or *
* implied. See the License for the specific language governing *
* rights and limitations under the License. *
* *
* Contributor(s) *
* Andriy Nevhasymyy <a.3710167@qq.com> *
* Milenko Mitrovic <3710167@qq.com> *
* Michael Andersen <3710167@qq.com> *
* Martin Offenwanger <3710167@qq.com> *
* *
*********************************************************************)
{.$DEFINE DEBUG} // Debug Log
{.$DEFINE TRACE} // Trace Criteral Section (DEBUG must be ON)
{.$DEFINE MESSAGE} // Use OutputDebugString instead of a File (DEBUG must be ON)
{.$DEFINE PERF} // Show Performace Counter
{.$DEFINE VTRANSPERF} // Show additional TBCVideoTransformFilter Performace Counter (PERF must be ON)
{$MINENUMSIZE 4}
{$ALIGN ON}
unit BaseClass;
{$IFDEF VER150}
{$WARN UNSAFE_CODE OFF}
{$WARN UNSAFE_TYPE OFF}
{$WARN UNSAFE_CAST OFF}
{$ENDIF}
interface
uses Windows, SysUtils, Classes, Math, ActiveX, Forms, Messages, Controls,
DirectShow9, dialogs, ComObj, mmsystem, DSUtil;
const
OATRUE = -1;
OAFALSE = 0;
DEFAULTCACHE = 10; // Default node object cache size
type
TBCCritSec = class
private
FCritSec : TRTLCriticalSection;
{$IFDEF DEBUG}
FcurrentOwner: Longword;
FlockCount : Longword;
{$ENDIF}
public
constructor Create;
destructor Destroy; override;
procedure Lock;
procedure UnLock;
function CritCheckIn: boolean;
function CritCheckOut: boolean;
end;
TBCBaseObject = class(TObJect)
private
FName: string;
public
constructor Create(Name: string);
destructor Destroy; override;
class function NewInstance: TObject; override;
procedure FreeInstance; override;
class function ObjectsActive: integer;
end;
TBCClassFactory = Class;
TBCUnknown = class(TBCBaseObject, IUnKnown)
private
FRefCount: integer;
FOwner : Pointer;
protected
function IUnknown.QueryInterface = NonDelegatingQueryInterface;
function IUnknown._AddRef = NonDelegatingAddRef;
function IUnknown._Release = NonDelegatingRelease;
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
public
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
constructor Create(name: string; Unk: IUnknown);
constructor CreateFromFactory(Factory: TBCClassFactory; const Controller: IUnknown); virtual;
function NonDelegatingQueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
function NonDelegatingAddRef: Integer; virtual; stdcall;
function NonDelegatingRelease: Integer; virtual; stdcall;
function GetOwner: IUnKnown;
end;
TBCUnknownClass = Class of TBCUnknown;
TFormPropertyPage = class;
TFormPropertyPageClass = class of TFormPropertyPage;
TBCBaseFilter = class;
TBCBaseFilterClass = class of TBCBaseFilter;
TBCClassFactory = class(TObject, IUnKnown, IClassFactory)
private
FNext : TBCClassFactory;
FComClass : TBCUnknownClass;
FPropClass: TFormPropertyPageClass;
FName : String;
FClassID : TGUID;
FCategory : TGUID;
FMerit : LongWord;
FPinCount : Cardinal;
FPins : PRegFilterPins;
function RegisterFilter(FilterMapper: IFilterMapper; Register: Boolean): boolean