Giter Club home page Giter Club logo

dshowtestfilters's Introduction

DshowTestFilters

Example DirectShow Filters Project

This project creates a DLL containing example DirectShow filters of various sophistication and usefulness.

  • "Example Filter" is defined in CExFilter.cpp. It is a close adaptation of the example code in this MSDN article deriving from CTransformFilter. It has no real function other than to serve as an example.

  • "Audio Transfom Filter" is defined in CATFilter.cpp. It is derived from CTransInPlaceFilter and designed to work with PCM audio streams. Current function is hard coded to reducing the amplitude of the input waveform by 50%.

  • "Wave Source Filter" is defined in CWaveSource.cpp. This article helped provide some guidance on its creation. It is derived from CSource, with a capture pin derived from CSourceStream. It generates a tone as a proof of concept.

Windows 10 DirectShow Setup

DirectShow is an older technology, and requires some setup to use. The setup process I have followed is documented below.

  1. Install the Windows 7 SDK (Download Here)
    1. Manually uninstall VC++ 2010 Runtime (x86 and x64) from Control Panel->Programs and Features.
    2. Download and run the Windows 7 SDK Web Installer.
    3. Ensure "Samples" and "Visual C++ 2010 Runtime" options are included in the selection.
  2. Build the DirectShow Base Class Library
    1. Run the C++ project solution, "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\baseclasses.sln", that was installed with the SDK.
    2. Allow Visual Studio to update project references.
    3. Build in both Debug and Release modes.
    4. Verify "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug\strmbasd.lib" and "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Release\strmbase.lib" exist.
  3. Set Up Project References
    1. Create or Open C++ Project.
    2. Navigate to project properties->Configuration Properties->VC++ Directories.
    3. Add "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses" to Include Directories for both Debug and Release.
    4. Add "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Debug" and "C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\Release" to Library Directories for both Debug and Release (not strictly necessary to do both, but it won't hurt).
    5. Under Linker->Input->Additional Dependencies, add strmbasd.lib, msvcrtd.lib, and winmm.lib on Debug, and strmbase.lib, msvcrt.lib, and winmm.lib on Release

Running the Filters

The DLL may be registered for system use through the following command, ran from the directory containing the DLL:

regsvr32.exe .\DshowAudioTransform.dll

Similarly, it may be unregistered through the command:

regsvr32.exe -u .\DshowAudioTransform.dll

After registration, the filters should be available for use through GraphEdit and other DirectShow interfacing applications.

In addition, it is possible to debug the filter by setting the Local Windows Debugger command to GraphEdit, as has been done for this project. Simply implement the filter in a graph, and set a breakpoint.

Credits

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.