[Lazarus] Lazarus and DirectShow Not Working Properly...

Justin Smyth delphian at smythconsulting.net
Fri Mar 12 15:18:01 CET 2010


Ok guys i have a really hairy one for you , i'm working on directshow player 
that i'm porting from Delphi to Lazarus x64 , in Lazarus in DirectShow when 
i call the RenderFile Function out of DirectShow it gives me a nasty 
exception error - Run Error 58632 ( is this a stub to say not supported yet 
? )

Yet if i manually create the direct show filter and add them to the filter 
graph and conect them together the graph works

The RenderFile Function in DirectShow is defined as

RenderFile(lpcwstrFile, lpcwstrPlayList: pWideChar): HResult; stdcall;

I'm using this function to change my ansistring into a pWideChar -

MultiByteToWideChar(CP_ACP, 0, PChar(FileName), -1, wstrFileName, MAX_PATH);

and i use RenderFile like this -> fGraphBuilder.RenderFile(wstrFileName,nil)


And the Interface for IGraphBuilder from MS is

  IGraphBuilder = interface(IFilterGraph)
    ['{56A868A9-0AD4-11CE-B03A-0020AF0BA770}']
    (*** IGraphBuilder methods ***)
    function Connect(ppinOut, ppinIn: IPin): HResult; stdcall;
    function Render(ppinOut: IPin): HResult; stdcall;
    function RenderFile(lpcwstrFile, lpcwstrPlayList: pWideChar): HResult; 
stdcall;
    function AddSourceFilter(lpcwstrFileName, lpcwstrFilterName: LPCWSTR;
        out ppFilter: IBaseFilter): HResult; stdcall;
    function SetLogFile(hFile: THandle): HResult; stdcall;
    function Abort: HResult; stdcall;
    function ShouldOperationContinue: HResult; stdcall;
  end;

and i filtergraph is

  IFilterGraph = interface(IUnknown)
    ['{56A8689F-0AD4-11CE-B03A-0020AF0BA770}']
    (*** IFilterGraph methods ***)
    function AddFilter(pFilter: IBaseFilter; pName: PWideChar): HResult; 
stdcall;
    function RemoveFilter(pFilter: IBaseFilter): HResult; stdcall;
    function EnumFilters(out ppEnum: IEnumFilters): HResult; stdcall;
    function FindFilterByName(pName: PWideChar; out ppFilter: IBaseFilter): 
HResult; stdcall;
    function ConnectDirect(ppinOut, ppinIn: IPin; pmt: PAMMediaType): 
HResult; stdcall;
    function Reconnect(ppin: IPin): HResult; stdcall;
    function Disconnect(ppin: IPin): HResult; stdcall;
    function SetDefaultSyncSource: HResult; stdcall;
  end;

Any help would be great , otherwise i'll have to do some messy hacking to 
get this working







More information about the Lazarus mailing list