Sirber
19th October 2004, 01:40
Hi
I'm trying to create a DShow filter that will load when RealVideo (FOURCC: RV40) will be played. I started a project with Delphi 7 and DSPack. So far I have not much. I'm also very new to DirectShow.
I'd like to know what do I need to do to have the filter loaded.
Currently my code is:unit UMain;
interface
uses BaseClass, ActiveX, DirectShow9, Windows;
const
CLSID_MyClass : TGUID = '{18F161CA-DEE6-4751-B103-5D8A05EB6BCE}';
MyPinTypes : TRegPinTypes =
(clsMajorType: @MEDIATYPE_NULL;
clsMinorType: @MEDIASUBTYPE_NULL);
MyPins : array[0..1] of TRegFilterPins =
((strName: 'Input'; bRendered: FALSE; bOutput: FALSE; bZero: FALSE; bMany: FALSE; oFilter: nil; strConnectsToPin: nil; nMediaTypes: 1; lpMediaType: @MyPinTypes),
(strName: 'Output'; bRendered: FALSE; bOutput: TRUE; bZero: FALSE; bMany: FALSE; oFilter: nil; strConnectsToPin: nil; nMediaTypes: 1; lpMediaType: @MyPinTypes));
type
THFE = class(TBCTransInPlaceFilter)
// Overrides the PURE virtual Transform of CTransInPlaceFilter base class
// This is where the "real work" is done by altering *pSample.
// We do the Null transform by leaving it alone.
function Transform(Sample: IMediaSample): HRESULT; override;
// We accept any input type. We'd return S_FALSE for any we didn't like.
function CheckInputType(mtin: PAMMediaType): HRESULT; override;
end;
implementation
{ THFE }
function THFE.CheckInputType(mtin: PAMMediaType): HRESULT;
begin
//if IsEqualGUID(mtin.majortype, MEDIATYPE_Video) and IsEqualGUID(mtin.subtype, MEDIASUBTYPE_RGB24) then result := S_OK else result := S_False;
result := S_OK;
end;
function THFE.Transform(Sample: IMediaSample): HRESULT;
begin
result := NOERROR;
end;
initialization
TBCClassFactory.CreateFilter(THFE, 'RealVideo Decoder Config', CLSID_MyClass,
CLSID_LegacyAmFilterCategory, MERIT_DO_NOT_USE, 2, @MyPins);
end.
Thanks!!! :D
I'm trying to create a DShow filter that will load when RealVideo (FOURCC: RV40) will be played. I started a project with Delphi 7 and DSPack. So far I have not much. I'm also very new to DirectShow.
I'd like to know what do I need to do to have the filter loaded.
Currently my code is:unit UMain;
interface
uses BaseClass, ActiveX, DirectShow9, Windows;
const
CLSID_MyClass : TGUID = '{18F161CA-DEE6-4751-B103-5D8A05EB6BCE}';
MyPinTypes : TRegPinTypes =
(clsMajorType: @MEDIATYPE_NULL;
clsMinorType: @MEDIASUBTYPE_NULL);
MyPins : array[0..1] of TRegFilterPins =
((strName: 'Input'; bRendered: FALSE; bOutput: FALSE; bZero: FALSE; bMany: FALSE; oFilter: nil; strConnectsToPin: nil; nMediaTypes: 1; lpMediaType: @MyPinTypes),
(strName: 'Output'; bRendered: FALSE; bOutput: TRUE; bZero: FALSE; bMany: FALSE; oFilter: nil; strConnectsToPin: nil; nMediaTypes: 1; lpMediaType: @MyPinTypes));
type
THFE = class(TBCTransInPlaceFilter)
// Overrides the PURE virtual Transform of CTransInPlaceFilter base class
// This is where the "real work" is done by altering *pSample.
// We do the Null transform by leaving it alone.
function Transform(Sample: IMediaSample): HRESULT; override;
// We accept any input type. We'd return S_FALSE for any we didn't like.
function CheckInputType(mtin: PAMMediaType): HRESULT; override;
end;
implementation
{ THFE }
function THFE.CheckInputType(mtin: PAMMediaType): HRESULT;
begin
//if IsEqualGUID(mtin.majortype, MEDIATYPE_Video) and IsEqualGUID(mtin.subtype, MEDIASUBTYPE_RGB24) then result := S_OK else result := S_False;
result := S_OK;
end;
function THFE.Transform(Sample: IMediaSample): HRESULT;
begin
result := NOERROR;
end;
initialization
TBCClassFactory.CreateFilter(THFE, 'RealVideo Decoder Config', CLSID_MyClass,
CLSID_LegacyAmFilterCategory, MERIT_DO_NOT_USE, 2, @MyPins);
end.
Thanks!!! :D