CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Dshow

  1. #1
    Join Date
    May 1999
    Location
    Sweden
    Posts
    55

    Dshow

    I have created a dialogbased application, where I in the maindialog have
    create some buttons, such as Play, stop, pause, options and openfile. When
    clicking the optionsfile another modal dialog is shown with some radio
    buttons where I can set the options of my program. The program is going to
    be a demonstrationprogram on how u can play video (mpeg) files on computer
    using different techniques:

    1 By using the MediaPlayer
    2 By using DirectShow
    3 By using DirectDraw
    4 MCI controlled.

    I´m done with MediaPlayer, it wasn´t hard. But now I want to be able to play
    it using Direct Show. What do I need to do? What kind of interfaces do I
    need to include? I´ve looked at the MFCPlay example in DirectX Media SDK,
    but that is doc/view based and I don´t understand How I can implement that
    in my Dialogbased application.

    Any help in this matter would be greatly appreciated. Maybe som short
    examples in code.

    /Frederik






  2. #2
    Join Date
    May 1999
    Posts
    2

    Re: Dshow

    All you need is to CoCreate an instance of IGraphBuilder and use the RenderFile method to create a filtergraph to play your file. Then you obtain the IMediaControl interface by calling QueryInterface on the IGraphBuilder interface and use the Run method to start playback.

    Bye,
    Marc



  3. #3
    Join Date
    May 1999
    Location
    Sweden
    Posts
    55

    Re: Dshow

    Thanx for your reply,
    I have tried that but still wont get it compile right. I include streams.h and mmsystem.h

    I have follewed the steps in the DirectX Media SDK. (Play Movie from
    C++ -example)
    I have tried to convert it to to my MFC dialogbased app, where I´ve made a
    dialog that will show the movie. I declare and initialize the interfaces in
    the OnInitDialog-function. Then I´ve added the variables needed like HRESULT
    hr;

    What I get is lots of compilationerrors like: left of '->QueryInterface'
    must point to class/struct/union


    Frederik.

    P.s I could send you my files and maybe you can have a look and se if you can see any obvious misstakes in my code?




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured