Click here to Skip to main content
Click here to Skip to main content
Go to top

DShow based player

, 15 Jul 2008
Rate this:
Please Sign up or sign in to vote.
a media file player based on DShow

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)

Share

About the Author

DoItFreely
Web Developer
China China
programmer

Comments and Discussions

 
BugCan not download the Project Pinmembermajer6273-Apr-13 2:29 
GeneralMy vote is 5 PinmemberStNickolay26-Oct-10 4:26 
GeneralMy vote of 1 PinmemberJoe Woodbury21-Dec-09 11:57 
General接受我的谢意 PinmemberMember 66848413-Nov-09 21:27 
GeneralMy vote of 1 PinmemberJerry Jiang11-Aug-09 9:38 
Generalre: snapshot problem PinmemberDoItFreely8-Aug-08 19:24 
GeneralSnspshot Probelm Pinmemberananduk766-Aug-08 6:21 
General你好! Pinmemberzxb8888888816-Jul-08 15:30 
GeneralRe: 你好! PinmemberYCJ4188-May-11 10:30 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140905.1 | Last Updated 15 Jul 2008
Article Copyright 2008 by DoItFreely
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid