Click here to Skip to main content
15,893,190 members
Articles / Multimedia / DirectX

DirectShow Filters Development Part 1: Video Rendering with Direct2D

Rate me:
Please Sign up or sign in to vote.
4.85/5 (44 votes)
31 Jan 2011CPOL10 min read 218.8K   6.8K   118  
This article is about DirectShow development in general and filters development in detail.
#include <olectl.h>
#include <initguid.h>
#include "D2DVideoRender.h"

#pragma warning(disable:4710)  // 'function': function not inlined (optimzation)

const AMOVIESETUP_MEDIATYPE sudOpPinTypes =
{
    &MEDIATYPE_Video,       // Major type
    &MEDIASUBTYPE_NULL      // Minor type
};

const AMOVIESETUP_PIN sudOpPin =
{
    L"Input",               // Pin string name
    TRUE,                   // Is it rendered
    FALSE,                  // Is it an output
    FALSE,                  // Can we have none
    FALSE,                  // Can we have many
    &CLSID_NULL,            // Connects to filter
    NULL,                   // Connects to pin
    1,                      // Number of types
    &sudOpPinTypes };       // Pin details

const AMOVIESETUP_FILTER sudBallax =
{
	&CLSID_Direct2DVideoRenderer,    // Filter CLSID
	FILTER_NAME,            // String name
    MERIT_DO_NOT_USE,       // Filter merit
    1,                      // Number pins
    &sudOpPin               // Pin details
};

CFactoryTemplate g_Templates[] = 
{
  { 
	FILTER_NAME,
    &CLSID_Direct2DVideoRenderer,
    CD2DVideoRender::CreateInstance,
    NULL,
    &sudBallax 
  }
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);

STDAPI DllRegisterServer()
{
    return AMovieDllRegisterServer2(TRUE);
} 

STDAPI DllUnregisterServer()
{
    return AMovieDllRegisterServer2(FALSE);
} 

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions