Displaying WMV from a stream

Dale_at_stopspam.com
Date: 10/15/04


Date: Fri, 15 Oct 2004 21:04:26 GMT


[I posted this from work on Wednesday, but apparently our outside newsgroup
access died about the same time. So I'm reposting it from home. If the previous
post shows up later, please forgive me.]

I posted this to borland.public.delphi.multimedia last week but I've gotten no
response; this group seems much more lively. Indeed, by lurking here I've
already picked up a few tips. So perhaps someone here can help me.

I'm trying to display a Windows Media Video-format file from a stream, using
DSpack. At first I tried this:

    VideoSrcStream: TMyStream;
    pSyncReader: IWMSyncReader;

    hr := WMCreateSyncReader(nil,WMT_RIGHT_PLAYBACK,pSyncReader);
    hr := pSyncReader.OpenStream(TStreamAdapter.Create(VideoSrcStream));
    AddFilter(pSyncReader as IBaseFilter);

but that doesn't work because IWMSyncReader doesn't inherit from IBaseFilter. So
then I tried this:

    VideoSrcStream: TMyStream;
    RA : IWMReaderAdvanced2;
    BF : IBaseFilter;
    ReaderObject: IUnknown;

    ReaderObject := CreateComObject(CLSID_WMAsfReader);
    ReaderObject.QueryInterface(IFileSourceFilter, FS);
    ReaderObject.QueryInterface(IWMReaderAdvanced2,RA);
    RA.SetPlayMode(WMT_PLAY_MODE_STREAMING);
    RA.OpenStream(TStreamAdapter.Create(VideoSrcStream),Self as
IWMReaderCallback,nil);
    ReaderObject.QueryInterface(IBaseFilter,BF);

but that doesn't work either: SetPlayMode returns E_FAIL and OpenStream returns
E_NOTIMPL.

Can anyone give me a clue how to proceed? The doc for CreateComObject says that
it returns a pointer to an uninitialized COM object; do I have to initialize it
somehow? How?

Thanks!

--
Dale


Relevant Pages

  • Re: Type text into form fields without it making other text move?
    ... This newsgroup is for questions about forms in Access, the database product ... You'd be best off reposting your question to a newsgroup that's related to ... form fields, but I can't type in them without moving all other text as I ...
    (microsoft.public.access.forms)
  • Re: Samwise Gamgee Making "24" Debut In 4 Hour Opener
    ... That wasn't crossposting, it was reposting. ... Crossposting is putting more than one newsgroup name on an article ... Tolkien letters FAQ: ...
    (rec.arts.books.tolkien)
  • Re: how can i start using Word, if it wont let me activate it?
    ... Sorry, but this newsgroup is for questions about Access, the database ... You'd be best off reposting your question to a newsgroup related to Word. ... Doug Steele, Microsoft Access MVP ...
    (microsoft.public.access.gettingstarted)
  • Re: PSI with 3rd party tool
    ... I suggest reposting your question to the ... Microsoft.Public.Project.Developer newsgroup. ... I have a request to pull time worked on tasks in a 3rd party tool ... load the time into buckets on Project Server. ...
    (microsoft.public.project)
  • Re: Supress dialog at FileOpen Interop
    ... I suggest reposting your question to the ... Microsoft.Public.Project.Developer newsgroup. ... The Project stops at this dialog and waits for the user action. ... Is there a way to supress all dialogs during the Interop calls? ...
    (microsoft.public.project)