Click here to Skip to main content
Licence MIT
First Posted 3 Apr 2007
Views 86,523
Downloads 1,231
Bookmarked 36 times

DirectX.Capture Class Library (Refresh)

By | 3 Apr 2007 | Article
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

About the Author

ekrlanw

Software Developer

United States United States

Member



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

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralFix for hack in Filter.cs PinmemberFelix Collins15:42 8 Oct '09  
Generalpixels capture PinmemberMichał Janic9:41 5 Oct '09  
GeneralRe: pixels capture PinmemberJacob Klint11:33 5 Oct '09  
QuestionNew Release? PinmemberS,J.M.9:21 6 May '09  
GeneralHelp Required PinmemberSaquib Kamran3:33 6 Apr '09  
GeneralIVideoProcAmp Interface in DirectShowLib Pinmemberanki1233:21 28 Mar '09  
GeneralManage colors during Capturing Pinmemberanki1230:45 10 Mar '09  
Questioncan i use Color Space Converter Filter to change bit depth? PinmemberPedro Zamuner9:06 13 Feb '09  
Generalpreview Pinmemberdbbtvlzfpz2:13 22 Sep '08  
GeneralRe: preview PinmemberJacob Klint13:36 30 Sep '08  
GeneralCaptureTest code is still old Pinmemberhungtdao10:50 29 Jul '08  
GeneralCaptur HD Video PinmemberMaryam.R0:49 9 Jun '08  
GeneralBrian Low posted newer code at wiki site... PinmemberRobert Lathan11:29 4 Jun '08  
QuestionAudio and video are out of sync (with compression) PinmemberWebrat14:40 4 Dec '07  
GeneralRe: Audio and video are out of sync (with compression) PinmemberFelix Collins12:31 25 Feb '08  
QuestionCapturing snapshots Pinmemberlalopepe5:52 8 Aug '07  
QuestionCapture video with audio from a DV Firewire Cam Pinmembereshy20071:52 30 Jul '07  
QuestionProblem with FormatType DVInfo Pinmemberdaa2423:27 24 Jul '07  
Questionwhat is the exception ? Pinmemberpastime_wang0:31 18 Jul '07  
QuestionI want to ask about the class u offered to capture the frame Pinmemberaishar7:43 27 Jun '07  
AnswerRe: I want to ask about the class u offered to capture the frame Pinmemberalmere1098:47 3 Jul '07  
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberthwaites23:10 26 Jul '07  
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere1098:21 27 Jul '07  
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere10910:22 28 Jul '07  
GeneralRe: I want to ask about the class u offered to capture the frame Pinmemberalmere1090:28 2 Aug '07  

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.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 3 Apr 2007
Article Copyright 2007 by ekrlanw
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid