Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

DirectX.Capture Class Library (Refresh)

0.00/5 (No votes)
3 Apr 2007 1  
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here