Subscribe to our RSS Feeds
The postings and links in this blog are provided "AS IS" with no warranties, and confer no rights. The opinions expressed here are solely those of the authors.
Showing posts with label DirectShow. Show all posts
Showing posts with label DirectShow. Show all posts

DirectShow Filter Register Errors

0 Comments »

At Initial development stage, we all faced many problem while registering dshow filter properly.

Problem:
The module “WavDest.dll” was loaded but the call to DllRegisterServer failed with error code 0x80070005

Solution:
Problem seen mostly on Vista or Win7. Error occur due to no admin privilege.
you will need to use a command prompt that is executed as administrator.
- Right-click on the command prompt icon
- Select [ Run as administrator ]
- Now run "Regsvr32.exe WavDest.dll" 
9:32 PM

Registering DirectShow Filter in WinCE6

0 Comments »

We can register directshow filter in two ways
  1. Dynamically using regsvr tool
  2. statically at run-time image creation



1. Dynamically using regsvr tool

   If registry details for filter is not included in image then we go for dynamic registration.
It is same as window desktop DirectShow filter registration process. We use either regsvr32.exe or regsvrCE.exe for including filters registry information in WinCE registry. We need to register each time after image bootup before calling filter for any use.


Implementation Process
a.       Declare filter information in structures, DirectShow having a set of structures for describing filters, pins details, and media types details.
             AMOVIESETUP_FILTER - Describes a filter.
             AMOVIESETUP_PIN - Describes a pin.
             AMOVIESETUP_MEDIATYPE -Describes a media type.
Eg-
static const WCHAR g_wszName[] = L"Some Filter";
 
AMOVIESETUP_MEDIATYPE sudMediaTypes[] = {
    { &MEDIATYPE_Video, &MEDIASUBTYPE_RGB24 },
    { &MEDIATYPE_Video, &MEDIASUBTYPE_RGB32 },
};
 
AMOVIESETUP_PIN sudOutputPin = {
    L"Output",      // Pin string name.
    FALSE,          // Is this pin rendered?
    TRUE,           // Is it an output pin?
    FALSE,          // Can the filter create zero instances?
    FALSE,          // Does the filter create multiple instances?
    &GUID_NULL,     // Connects to filter.
    NULL,           // Connects to pin.
    2,              // Number of media types.
    sudMediaTypes   // Pointer to media types.
};
 
AMOVIESETUP_FILTER sudFilterReg = {
    &CLSID_SomeFilter,      // Filter CLSID.
    g_wszName,              // Filter name.
    MERIT_NORMAL,           // Merit.
    1,                      // Number of pin types.
    &sudPins                // Pointer to pin information.
};


b.      Declare a factory template which having a pointer for the filter information structure sudFilterReg. 

CFactoryTemplate g_Templates[] =
{
    {
        g_wszName,                      // Name.
        &CLSID_SomeFilter,              // CLSID.
        CSomeFilter::CreateInstance,    // Creation function.
        NULL,
        &sudFilterReg                   // Pointer to filter information.
    }
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);


c.     Implementing the DllRegisterServer  and DllUnregister function. 

These function will get call when regsvr32 and regsvrCE is used to register or unregister filter. We need to export these function in def file.
These functions internally calls AMovieDllRegisterServer and AMovieDllUnregisterServer function for creating registry entries for every component declared in the factory template array.
AMovieDllRegisterServer2(BOOL ) currently don’t support Windows CE6.

While writing these functions don’t pass any argument to AMovieDllRegisterServer as mentioned in MSDN (Link) and be careful with exact letter case.
Eg :
STDAPI DllRegisterServer()
{
    return AMovieDllRegisterServer();
}


STDAPI DllUnregisterServer()
{
      return AMovieDllUnregisterServer();
}

Registration process.

Click Start -> Run
Then type regsvrCE filter.dll
If you get success msg then start using your filter else start debugging.





2. statically at run-time image creation

add your registry, So filter will get register while image bootup.
will update this soon.. 



9:32 PM

Template Code: DirectShow Application and Filters in Windows Embedded CE 6.0

0 Comments »
This distribution contains template code for DirectShow source, transform and sink filters.  It also contains a simple DirectShow applicaton which connects the filters into a graph and runs the graph.

Note that while building and running the filters and application directly from this distribution will work, it will not do anything interesting.  Again this is template code, designed to abstract away the details of the DirectShow filter framework so developers can focus on adding the core functionality to their filters.

Download from Here

For the DirectShow Reference documentation, see
http://msdn.microsoft.com/en-us/library/aa931414.aspx
, 8:24 AM