Re: Help - registering directshow filter in Pocket PC device



On Apr 3, 12:14 am, "Gary Daniels [MS]" <gary...@xxxxxxxxxxxxxxxxxxxx>
wrote:
"Michton" <y.michel.da...@xxxxxxxxx> wrote in message

news:1175408068.615279.138040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx





On Mar 29, 3:25 am, "Gary Daniels [MS]" <gary...@xxxxxxxxxxxxxxxxxxxx>
wrote:
.ax is just the extension that Windows XP/Vista/etc. use to indicate
DirectShow filters. If you want to use the .ax extension you can just
rename
your .dll. Windows CE/Mobile DirectShow will accept filters with either
extension and treat them the same.

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no
rights.
You assume all risk for your use.

"Michton" <y.michel.da...@xxxxxxxxx> wrote in message

news:1174503986.219740.242290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Feb 8, 3:42 pm, hazzy <h...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
thanx buddy

can i do like this

HINSTANCE hDLL = LoadLibrary("somefilter.ax");
if(NULL == hDLL)
{
// error
DWORD error = GetLastError();
TRACE1("LoadLibrary() Failed with: %i\n", error);
return FALSE;
}

typedef HRESULT (CALLBACK *HCRET)(void);
HCRET lpfnDllRegisterServer;

lpfnDllRegisterServer =
(HCRET)GetProcAddress(hDLL, "DllRegisterServer");
if(NULL == lpfnDllRegisterServer)
{
// error
DWORD error = GetLastError();
TRACE1("GetProcAddress() Failed with %i\n", error);
return FALSE;
}

or anything more is required

thanx n Regards
Hazzy

"Amit" wrote:
Hi,

Write another application (exe) which calls the DllRegsiterServer
function
that is exported by the dll.
LoadLibrary()
GetProcAddress(DllRegisterServer)..

--
Thanks and Regards
Amit Ranjan
blog:http://amitranjan.wordpress.com

"hazzy" wrote:

Hello Everybody

can anyone help me how can we register the directshow filter(
transform
filter) in Pocket PC device.
In system, we can register it via Regsvr32 i.e.regsvr32 <full path
of
target>
but how can i do the same in device...

or there another way so that we can use directshow filter ( our
own
written
filter) in device.

thanks in advance
looking for your response
Hazzy- Hide quoted text -

- Show quoted text -

Hi

Thank you for your question and answer.

How did you generate a ".ax" extension ? Only by renaming a DLL?
Something else in Settings ?
(I just succcessed to compile (!!) the NullRenderer from Gary Daniel)
Thank you.- Hide quoted text -

- Show quoted text -

Gary the White Angel.
Thank you for your help.

I could not compile theCSampleGrabberat all on CE5.0. Have you
working version of this essential Code for me?

Thank you VEEEERRRRRRYYYYYYYYYYY MUCH!!!

Michel

What problem are you having when compiling on CE 5.0? Do you mean Windows
Mobile 5.0, or are you compiling with Windows CE 5.0? They are different,
Windows CE 5.0 is shipped via Platform Builder and used for general
embedded.

I've only tried this with the Windows Mobile 5.0 SDK for visual studio, I
have not tried compiling it for CE 5.0 but it should work the same. I have
compiled it for CE 6.0. If you're compiling it for CE 5.0, you'll need to
generate an SDK with DirectShow when you build your image in
PlatformBuilder.

Gary Daniels
Windows CE Multimedia and Graphics

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.- Hide quoted text -

- Show quoted text -

OK. I found some code of CSampleGrabber. It compiles. I just cannot
register it:
==========================================
=============CSampleGrabber.CPP=============
==========================================
// CSampleGrabber.cpp : Defines the entry point for the DLL
application.
//

#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>

/*
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
*/
//SampleGrabber.cpp : Defines the entry point for the DLL
application.
//


#include "CSampleGrabber.h"


// Define your filter guid here
/*
DEFINE_GUID(CLSID_CSampleGrabber,
0x8a99caeb, 0xaef5, 0x11da,
0x95, 0x8b, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f );
*/
// {F3492A9B-6626-4345-AB8D-17F584DC1DE0}

DEFINE_GUID(CLSID_CSampleGrabber,
0xf3492a9b, 0x6626, 0x4345, 0xab, 0x8d, 0x17, 0xf5, 0x84, 0xdc,
0x1d, 0xe0);


// this is needed for COM to register the component with RegSvr
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);


// Fill in media type information below, this information is used
when
// registering the filter with dshow
const AMOVIESETUP_MEDIATYPE sudPinTypes =
{ &MEDIATYPE_NULL, &MEDIASUBTYPE_NULL };
const AMOVIESETUP_PIN sudPins =
{ L"SampleGrabber", FALSE, FALSE, FALSE, FALSE, &CLSID_NULL, NULL, 1,
&sudPinTypes };
const AMOVIESETUP_FILTER sudNULL =
{ &CLSID_CSampleGrabber, L"SampleGrabberRend", MERIT_DO_NOT_USE, 1,
&sudPins



};


CSampleGrabber::CSampleGrabber(LPUNKNOWN pUnk, HRESULT *phr) :
CBaseRenderer(CLSID_CSampleGrabber, NAME("CSampleGrabber"), pUnk,
phr)
{


}


CUnknown* WINAPI CSampleGrabber::CreateInstance(LPUNKNOWN punk,
HRESULT *phr)
{
return new CSampleGrabber(punk, phr);


}


HRESULT CSampleGrabber::CheckMediaType( const CMediaType *pMT)
{
return S_OK;


}


// This is called for each media sample received.
HRESULT CSampleGrabber::DoRenderSample(IMediaSample *pMediaSample)
{
return S_OK;


}


ULONG CSampleGrabber::NonDelegatingRelease()
{
return 0;


}


// this is necessary for automatic registration of the filter when
doing
//a regsvr32.
AMOVIESETUP_FILTER* CSampleGrabber::GetSetupData()
{
return((AMOVIESETUP_FILTER*)&sudNULL);


}


STDAPI DllRegisterServer()
{
HRESULT hr = AMovieDllRegisterServer2( TRUE );
TCHAR s[200];
_stprintf(s,_T("DllRegisterServer for CSampleGrabber hr=%x\n"),hr);
OutputDebugString(s);
return hr;


}


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

BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID
lpReserved)
{
g_hInst = (HINSTANCE) hModule;
return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);



}


CFactoryTemplate g_Templates[] =
{ L"SampleGrabberRend", &CLSID_CSampleGrabber,
CSampleGrabber::CreateInstance, NULL, &sudNULL };
int g_cTemplates = 1;


==================================
=========CSampleGrabber.H===========
#pragma once


#include <windows.h>
#include <streams.h>
#include <initguid.h>


class CSampleGrabber : public CBaseRenderer
{
public:


DECLARE_IUNKNOWN


CSampleGrabber(LPUNKNOWN pUnk, HRESULT *phr);


static CUnknown* WINAPI CreateInstance(LPUNKNOWN punk, HRESULT
*phr);


HRESULT CheckMediaType( const CMediaType *pMT);


// This is called for each media sample received.
HRESULT DoRenderSample(IMediaSample *pMediaSample) ;
ULONG NonDelegatingRelease();


// this is necessary for automatic registration of the filter when
doing
//a regsvr32.
AMOVIESETUP_FILTER *GetSetupData();
private:
};
===================================
=======CSampleGrabber.DEF===========
LIBRARY CSampleGrabber.dll

; These exports are necessary in order for com to register the filter
EXPORTS
DllMain PRIVATE
;DllGetClassObject PRIVATE
;DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
=====================================

Compiled in Release mode with your precious recommendations
I Got :
DllRegisterServer for CSampleGrabber hr=800401f9
Some Ideas?


.



Relevant Pages

  • Re: vista custom filter media type is not acceptable - urgent help
    ... I retract my previous post. ... HRESULT as a negative number. ... I have custom network source filter which use ... previous windows versions. ...
    (microsoft.public.win32.programmer.directx.video)
  • "Catastrophic failure" in directshow graph
    ... The filter I'm writing is a "Heartbeat Filter" that keeps data flowing ... even if no data is arriving on the input pin. ... HeartbeatFilter(LPUNKNOWN punk, HRESULT *phr); ... virtual STDMETHODIMP Pause; ...
    (microsoft.public.win32.programmer.directx.video)
  • DirectShow Filter (COM Issues)
    ... I am trying to write a DirectShow filter to allow a programmer to send data ... DS Network Sender.CPP: ... CNetworkSenderFilter::CNetworkSenderFilter(TCHAR *tszName, LPUNKNOWN pUnk, ... HRESULT CNetworkSenderFilter::CheckMediaType{ ...
    (microsoft.public.win32.programmer.ole)
  • Re: Search for Text in .asp Files
    ... Ramesh - Microsoft MVP ... Something in Windows keeps changing the text filter back to the html filter. ... asp files 5 levels down which contain that same ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Search for Text in .asp Files
    ... Ramesh - Microsoft MVP ... Something in Windows keeps changing the text filter back to the html filter. ... asp files 5 levels down which contain that same ...
    (microsoft.public.windowsxp.general)

Quantcast