Thread: developing a simple media player

  1. #1
    Registered User sandeep080's Avatar
    Join Date
    Apr 2010
    Posts
    17

    developing a simple media player

    hi,

    I'm thinking of developing a media player(specifically a video player) in windows platform. As i'm totally new to windows programming i have no idea where to start... I checked out the msdn site, but the site by itself is so humongous... so i'd be grateful if anyone could me guide me from where to start... Also what compiler and IDE are most preferred for developing in windows?

    Thanks in Advance!,

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    I use Pelles C which you can get for free here --> Pelles C

    You can get a pretty good C++ compiler free from Microsoft --> Visual C++

    Of course, there are numerous other compilers that can produce executables for windows...

    No matter which compiler or language you use you will want to install the Windows SDK which gives you a full disclosure of the ~20,000 Windows function calls a programmer can use.

    You will need to be very familiar with C and a bit of C++ before you will get full benefit from the SDK documentation. You will find numerous tutorials around the web, including the ones on This Site

    Then probably the easiest way to begin Windows programming is with Forger's WinAPI Tutorial

    But I should caution you that in a world of 50+ audio and videol formats there is nothing simple about writing a media player... There is no "PlayMovie" function call... you can use.

  3. #3
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Quote Originally Posted by CommonTater View Post
    There is no "PlayMovie" function call... you can use.
    Not exactly, but it's not that much more involved
    Code:
    #include <dshow.h>
    void PlayAnyMediaFormatYouHaveCodecsFor(LPCWSTR file)
    {
        HRESULT coinitHr = CoInitialize();
        IGraphBuilder* pGraph = NULL;
        HRESULT hr = CoCreateInstance(CLSID_GraphBuilder, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pGraph));
        if(SUCCEEDED(hr))
        {
            hr = pGraph->RenderFile(file, NULL);
            pGraph->Release();
        }
        if(SUCCEEDED(coinitHr))
        {
            CoUninitialize();
        }
    }
    That's pretty much the entire crux of my crusty old AudioPlayer. In fact, I had to write extra code to filter OUT videos.

    To the OP, DirectShow is pretty much the easiest way to do it. The SDK linked to above contains some fully fledged samples in the Samples\Multimedia\DirectShow directory. The modern replacement for it is called Media Foundation, but that doesn't exist on anything before Vista so depending on your/your target platform you may have a choice.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 15
    Last Post: 10-20-2009, 09:39 AM
  2. uninstalling windows media player 10
    By MisterSako in forum Tech Board
    Replies: 0
    Last Post: 05-27-2006, 11:53 AM
  3. 'now playing' code for windows media player?
    By X PaYnE X in forum Windows Programming
    Replies: 0
    Last Post: 05-25-2006, 02:23 AM
  4. Simple or complex program? need suggestion
    By InvariantLoop in forum C++ Programming
    Replies: 5
    Last Post: 04-21-2004, 10:12 AM
  5. Someone help me with this game??
    By stehigs321 in forum Game Programming
    Replies: 15
    Last Post: 10-30-2003, 09:42 PM

Tags for this Thread