Elecard
May 26, 2013, 01:37:59 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Adding a DirectShow Filter to the Graph without Registration  (Read 6014 times)
gil
Newbie
*
Posts: 6


View Profile
« on: June 21, 2010, 10:36:56 pm »

Hi,
I'm building a program that uses some Elecard filters to show video. I want to distribute the program for some end users and therefore I want to add those filters to the graph without registration. I've got Elecard Codec SDK G4 and its samples that show how to add a filter to the graph without registration. The problem is that those examples are written as MFC samples and therefore include MFC h files such as:

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes

#include <afxdtctl.h>      // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>         // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT


My program is NOT an MFC program, so I omitted those header files from "stdafx.h".
As a result my program doesn't complie because many identifiers are not declared. For example:

Error   1   error C2065: 'GUID_NULL' : undeclared identifier   c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlcomcli.h   365   DomoGraphDll with CFilterWrapper


On the other hand, if I don't omit those header I get other erros such as:

Error   1   fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]   c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afx.h   24   DomoGraphDll with CFilterWrapper

I've searched the SDK documents to see what header should I include when using classes such as CFilterWrapper, but unfortunately the only document that describes this class (Elecard Base Classes RM) is missing this kind of information.

I've also tried to figure out by myself how to add and activate filters in a non-MFC program, but failed to do so.

P.S the filters I want to add and activate are:

Elecard NWSource Plus
Elecard Push Demultiplexer
Elecard MPEG-2 Video Decoder HD

All the best

Gil
Logged
IrinaM
Moderator
*****
Posts: 139


View Profile
« Reply #1 on: June 27, 2010, 06:58:52 pm »

Hello gil,

Can you build Elecard BaseClasses and our SDK samples?

Quote
My program is NOT an MFC program
ATL? Win32?


Logged
gil
Newbie
*
Posts: 6


View Profile
« Reply #2 on: June 27, 2010, 08:19:55 pm »

Hi,
I am able to build Elecard BaseClasses (and as a result strmbase.lib and strmbasd.lib are created).
I am able to build and run the SDK samples (particularly, NW Player sample).
When I run the NW Player sample and press the "show graph" button the next graph is shown (and the video is played perfectly):

-------------------------         ----------------        --------------------------        ----------------------------------         -----------------
|                                 |         |                    |        |                          |        |                      |       |                      |
| Elecard NWSource-Plus |----> |Elecard InfTee |----> | Elecard Push Demuxer   |---->| Elecard MPEG2 Video Decoder 16k |---->| Video Renderer |
|                                 |         |                    |        |                          |        |                      |       |                      |
-------------------------         |                    |        --------------------------        ----------------------------------        ------------------
                                             |                   |        ------------------
                                             |                   |        |                       |
                                             |                   |----> | Elecard File Sink |
                                             |--------------|        |                       |
                                                                           -------------------


Technically, my program is a Win32 program, but in fact it is more complicated:
I build a WPF (Windows Presentation Foundation) application in C#. I want this application to show video. The problem is that the 'Video Renderer' filter presents its video in a Win32 window. In order to play the video in my WPF application I host a Win32 window inside my WPF application.
Since WPF is written in C# and DirectShow filters are written in C++ I have to bridge this gap somehow. I do that by creating a DLL file out of the C++ code and use this DLL in the WPF application.
This DLL file that i'm trying to create is a Win32 DLL. I want this DLL to build the aforementioned graph and activate the filters without registration.

In conclusion, my goal is to create a Win32 DLL that builds the graph and activates the filters without registration.

All the best

Gil


Logged
IrinaM
Moderator
*****
Posts: 139


View Profile
« Reply #3 on: June 27, 2010, 11:49:26 pm »

gil,
it is possible to use Elecard BaseClasses in your Win32 DLL, but your project should be 'Compile as C++ code'.

I would recommend to you to use Elecard Codec .NET SDK. This SDK is oriented on .NET technology and include PlayerView component. It is visual component which can be placed on a form. The main function of this component is to be a placeholder of the video window. Thus, the PlayerView class is a convenient way to locate video to the application form instead of a separate window.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!