Click here to Skip to main content
14,606,461 members

DShow based player

Rate this:
2.19 (16 votes)
Please Sign up or sign in to vote.
2.19 (16 votes)
15 Jul 2008CPOL
a media file player based on DShow
Image 1


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.


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.


Initial release


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


About the Author

Web Developer
China China

Comments and Discussions

Questionno src Pin
Member 99941715-Jul-15 3:38
MemberMember 99941715-Jul-15 3:38 
AnswerRe: no src Pin
DoItFreely6-Sep-15 16:11
MemberDoItFreely6-Sep-15 16:11 
I don't know why the source code lost, if you'd wanna, I can send the code to you by email. Sorry for long time delay.
GeneralRe: no src Pin
Member 99941716-Sep-15 19:02
MemberMember 99941716-Sep-15 19:02 
GeneralRe: no src Pin
DoItFreely7-Sep-15 0:03
MemberDoItFreely7-Sep-15 0:03 
BugCan not download the Project Pin
majer6273-Apr-13 2:29
Membermajer6273-Apr-13 2:29 
GeneralRe: Can not download the Project Pin
hello dearbaby14-Mar-15 21:40
Memberhello dearbaby14-Mar-15 21:40 
GeneralRe: Can not download the Project Pin
DoItFreely7-Sep-15 0:06
MemberDoItFreely7-Sep-15 0:06 
GeneralMy vote is 5 Pin
StNickolay26-Oct-10 4:26
MemberStNickolay26-Oct-10 4:26 
GeneralMy vote of 1 Pin
Joe Woodbury21-Dec-09 11:57
professionalJoe Woodbury21-Dec-09 11:57 
General接受我的谢意 Pin
Member 66848413-Nov-09 21:27
MemberMember 66848413-Nov-09 21:27 
GeneralMy vote of 1 Pin
Jerry Jiang11-Aug-09 9:38
MemberJerry Jiang11-Aug-09 9:38 
Generalre: snapshot problem Pin
DoItFreely8-Aug-08 19:24
MemberDoItFreely8-Aug-08 19:24 
GeneralSnspshot Probelm Pin
ananduk766-Aug-08 6:21
Memberananduk766-Aug-08 6:21 
General你好! Pin
zxb8888888816-Jul-08 15:30
Memberzxb8888888816-Jul-08 15:30 
GeneralRe: 你好! Pin
YCJ4188-May-11 10:30
MemberYCJ4188-May-11 10:30 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 15 Jul 2008


23 bookmarked