Click here to Skip to main content
Click here to Skip to main content

DShow based player

By , 15 Jul 2008
 

Introduction

It's simple player, don't expect much.
DirectShow is the ideal media engine, if that the only thing you required is playback. Here is a sample player built on DShow.

Background

DShow consist of core engine and optional components, all exist as DLLs. They are exposed via COM interfaces. Thus COM technology is required. As well as that DirectX9.0c SDK is required to compile the code. Note: 9.0c is the newest and best version for VC6. You can try other version of DXSDK if you don't use VC6. (But no warranty that it would work.)
The core engine uses suplies the control all through. The optinal components classified by purpose. Those used to read media file/source are Parsers. Similarly, Decoders used to restore audio/video back to it's orignal form. Renderers show video picture or play sound for audio.
Normally, all you need for playing a given media file is that: the decoder(s). Other else have already installed on Windows system.
Follow the rule of DShow, media types are registered into Registry as GUIDs. Find out the appropriate parse the decoder for the media file, push the media data into the renderer, that all for the game of playing. It sounds easy, isn't it?

Using the code

The core engine has been capsulated(wrapped) as a single class: CPlayer. Render a media file by create DShow engine, then you're ready to play!
For nicer looking, we have embed the video window into the main dialog window. Current play position is synchronized with progress bar, and displayed as text in left to movie duration.

Points of Interest

The first goal of this project is prefer for preview and take snapshot, so it's named so. If you press Ctrl+Print Screen key when it playing, you'll notice that the video can be paste into mspaint. While Windows Media Player(WMP) can't do this. For WMP use video renderer in overlay mode.

History

Initial release

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

DoItFreely
Web Developer
China China
Member
programmer

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
BugCan not download the Projectmembermajer6273 Apr '13 - 2:29 
GeneralMy vote is 5memberStNickolay26 Oct '10 - 4:26 
GeneralMy vote of 1memberJoe Woodbury21 Dec '09 - 11:57 
General接受我的谢意memberMember 66848413 Nov '09 - 21:27 
GeneralMy vote of 1memberJerry Jiang11 Aug '09 - 9:38 
Generalre: snapshot problemmemberDoItFreely8 Aug '08 - 19:24 
GeneralSnspshot Probelmmemberananduk766 Aug '08 - 6:21 
General你好!memberzxb8888888816 Jul '08 - 15:30 
GeneralRe: 你好!memberYCJ4188 May '11 - 10:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 15 Jul 2008
Article Copyright 2008 by DoItFreely
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid