Click here to Skip to main content
12,501,082 members (41,724 online)
Click here to Skip to main content
Add your own
alternative version

Stats

142.2K views
2.8K downloads
44 bookmarked
Posted

DirectX.Capture Class Library (Refresh)

, 3 Apr 2007 MIT
Rate this:
Please Sign up or sign in to vote.
An update to the DirectX.Capture project

Introduction

This project is a small update to the excellent DirectX.Capture library by Brian Low (see his article here).

I have made two changes:

  • The original was based on a managed DirectShow library here on CodeProject (DirectShow.NET). While that project is still a good learning aid, it has not been updated for several years (the graphics on the project page still refer to DirectX 8.1!). I therefore changed this capture library to use the DirectShow.NET project at (SourceForge), which is still being updated (last release was in August '06).
  • I changed the solution from a VS 2003 project to a VS 2005 one.
All functionality, method signatures, class names, etc. are unchanged.

Using the code

Please see the original article by Brian Low (DirectX.Capture Class Library) for info on using this library

Points of Interest

For the most part, upgrading this library was very straightforward. I just removed the reference to the old DirectShow library, added a reference to the new one, updated the "using" directives, and started fixing what was broken until the project would build successfully. Fortunately, since both the old and new DirectShow libraries are just managed wrappers for the same DirectShow classes, the vast majority of class names, properties, and method signatures were identical between the two libraries.

The difficulties were places where the newer DirectShow library has introduced cleaner code (such as replacing integer constants with enumerations and pointer references with class references). Most of the fixes were repetitive patterns of replacing blocks of code with "prettier", more managed versions. There were, however, one or two instances where I actually had to regress the code in the opposite direction.

While the new DirectShow library is more complete (in the sense that it has abstracted away a larger percentage of the underlying C++ details), it is by no means 100% complete, and there still exist some ugly bits in it. As the folks at the SourceForge project hack away at the remaining pieces, I will update this project to incorporate their changes.

A warning: while I have tested the code and everything seems to work great, I have not gone over it in thorough detail. It is certainly possible that due to slight differences in how the two DirectShow libraries wrap the C++ classes, I broke something when translating the code. I kept my changes to a minimum, but I would not be surprised to find errors. Let me know if you find anything, and in the meantime, caveat emptor.

History

Mar 2007 - refresh based on DirectShow.NET 1.5/VS 2005

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

Jacob Klint
Software Developer
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralFix for hack in Filter.cs Pin
Felix Collins8-Oct-09 15:42
memberFelix Collins8-Oct-09 15:42 
Generalpixels capture Pin
Michał Janic5-Oct-09 9:41
memberMichał Janic5-Oct-09 9:41 
GeneralRe: pixels capture Pin
Jacob Klint5-Oct-09 11:33
memberJacob Klint5-Oct-09 11:33 
QuestionNew Release? Pin
S,J.M.6-May-09 9:21
memberS,J.M.6-May-09 9:21 
GeneralHelp Required Pin
Saquib Kamran6-Apr-09 3:33
memberSaquib Kamran6-Apr-09 3:33 
GeneralIVideoProcAmp Interface in DirectShowLib Pin
anki12328-Mar-09 3:21
memberanki12328-Mar-09 3:21 
GeneralManage colors during Capturing Pin
anki12310-Mar-09 0:45
memberanki12310-Mar-09 0:45 
Questioncan i use Color Space Converter Filter to change bit depth? Pin
Pedro Zamuner13-Feb-09 9:06
memberPedro Zamuner13-Feb-09 9:06 
Generalpreview Pin
dbbtvlzfpz22-Sep-08 2:13
memberdbbtvlzfpz22-Sep-08 2:13 
GeneralRe: preview Pin
Jacob Klint30-Sep-08 13:36
memberJacob Klint30-Sep-08 13:36 
GeneralCaptureTest code is still old Pin
hungtdao29-Jul-08 10:50
memberhungtdao29-Jul-08 10:50 
GeneralCaptur HD Video Pin
Maryam.R9-Jun-08 0:49
memberMaryam.R9-Jun-08 0:49 
GeneralBrian Low posted newer code at wiki site... Pin
Robert Lathan4-Jun-08 11:29
memberRobert Lathan4-Jun-08 11:29 
QuestionAudio and video are out of sync (with compression) Pin
Webrat4-Dec-07 14:40
memberWebrat4-Dec-07 14:40 
GeneralRe: Audio and video are out of sync (with compression) Pin
Felix Collins25-Feb-08 12:31
memberFelix Collins25-Feb-08 12:31 
QuestionCapturing snapshots Pin
lalopepe8-Aug-07 5:52
memberlalopepe8-Aug-07 5:52 
QuestionCapture video with audio from a DV Firewire Cam Pin
eshy200730-Jul-07 1:52
membereshy200730-Jul-07 1:52 
QuestionProblem with FormatType DVInfo Pin
daa2424-Jul-07 23:27
memberdaa2424-Jul-07 23:27 
Questionwhat is the exception ? Pin
pastime_wang18-Jul-07 0:31
memberpastime_wang18-Jul-07 0:31 
QuestionI want to ask about the class u offered to capture the frame Pin
aishar27-Jun-07 7:43
memberaishar27-Jun-07 7:43 
AnswerRe: I want to ask about the class u offered to capture the frame Pin
almere1093-Jul-07 8:47
memberalmere1093-Jul-07 8:47 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
thwaites26-Jul-07 23:10
memberthwaites26-Jul-07 23:10 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere10927-Jul-07 8:21
memberalmere10927-Jul-07 8:21 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere10928-Jul-07 10:22
memberalmere10928-Jul-07 10:22 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere1092-Aug-07 0:28
memberalmere1092-Aug-07 0:28 
GeneralRe: I want to ask about the class u offered to capture the frame Pin
almere1099-Aug-07 10:39
memberalmere1099-Aug-07 10:39 
Questionabout the code u offer to capture asingle frame Pin
aishar20-Jun-07 0:25
memberaishar20-Jun-07 0:25 
AnswerRe: about the code u offer to capture asingle frame Pin
almere10920-Jun-07 11:53
memberalmere10920-Jun-07 11:53 
AnswerRe: about the code u offer to capture asingle frame Pin
Jacob Klint23-Jun-07 12:58
memberJacob Klint23-Jun-07 12:58 
Questionabout using Dxsnapshot with this code Pin
aishar19-Jun-07 21:55
memberaishar19-Jun-07 21:55 
AnswerRe: about using Dxsnapshot with this code Pin
Jacob Klint23-Jun-07 13:01
memberJacob Klint23-Jun-07 13:01 
QuestionI face aproblem in changing the video source Pin
aishar18-Jun-07 11:27
memberaishar18-Jun-07 11:27 
AnswerRe: I face aproblem in changing the video source Pin
Jacob Klint18-Jun-07 11:41
memberJacob Klint18-Jun-07 11:41 
AnswerRe: I face aproblem in changing the video source Pin
almere10920-Jun-07 11:25
memberalmere10920-Jun-07 11:25 
QuestionAbout taking asnapshot from the video stream Pin
aishar18-Jun-07 9:36
memberaishar18-Jun-07 9:36 
AnswerRe: About taking asnapshot from the video stream Pin
Jacob Klint18-Jun-07 11:22
memberJacob Klint18-Jun-07 11:22 
QuestionRe: About taking asnapshot from the video stream Pin
aishar18-Jun-07 11:30
memberaishar18-Jun-07 11:30 
AnswerRe: About taking asnapshot from the video stream Pin
Jacob Klint18-Jun-07 11:48
memberJacob Klint18-Jun-07 11:48 
AnswerRe: About taking asnapshot from the video stream Pin
almere10920-Jun-07 11:30
memberalmere10920-Jun-07 11:30 
GeneralCapture video on other DirectX sources Pin
DEGT13-Jun-07 5:08
memberDEGT13-Jun-07 5:08 
GeneralRe: Capture video on other DirectX sources Pin
Jacob Klint18-Jun-07 11:33
memberJacob Klint18-Jun-07 11:33 
QuestionPlease help me Pin
aishar17-May-07 10:18
memberaishar17-May-07 10:18 
AnswerRe: Please help me Pin
Jacob Klint17-May-07 14:08
memberJacob Klint17-May-07 14:08 
GeneralRe: Please help me Pin
almere10918-May-07 0:45
memberalmere10918-May-07 0:45 
GeneralRe: Please help me Pin
Jacob Klint23-May-07 9:44
memberJacob Klint23-May-07 9:44 
GeneralRe: Please help me Pin
almere10923-May-07 23:38
memberalmere10923-May-07 23:38 
GeneralRe: Please help me Pin
Jacob Klint24-May-07 18:31
memberJacob Klint24-May-07 18:31 
GeneralRe: Please help me Pin
almere10925-May-07 3:26
memberalmere10925-May-07 3:26 
AnswerRe: Please help me Pin
almere10918-May-07 0:58
memberalmere10918-May-07 0:58 
Questionplease help me?? Pin
aishar12-May-07 9:17
memberaishar12-May-07 9:17 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 3 Apr 2007
Article Copyright 2007 by Jacob Klint
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid