[gst-devel] gst directshow wrapper weirdness

Ali Sabil ali.sabil at tandberg.com
Fri Jun 15 14:26:08 CEST 2007


Hmm something weird seems to be happening :

        $ gst-launch-0.10 dshowvideosrc ! directdrawsink
         
        ** (gst-launch-0.10:992): WARNING **: BOOL DllMain(void*, DWORD,
        void*) hModule=1651507200, dwReason=1, Filename=c:
        \gstreamer_erbium\bin\libgstdshow-0.10-0.dll
         
        ** (gst-launch-0.10:992): WARNING **: BOOL DllMain(void*, DWORD,
        void*) hModule=1872494592, dwReason=1, Filename=c:
        \gstreamer_erbium\lib\gstreamer-0.10\libgstdshowsrcwrapper.dll
        Setting pipeline to PAUSED ...
        0:00:00.249995000   992 003D42B8 ERROR        dshowvideosrc
        gstdshowvideosrc.c:602:gst_dshowvideosrc_start: Can't create an
        instance of our dshowfakesink filter (error=-2147221164)
        ERROR: Pipeline doesn't want to pause.
        Setting pipeline to NULL ...
        FREEING pipeline ...
         
        ** (gst-launch-0.10:992): WARNING **: BOOL DllMain(void*, DWORD,
        void*) hModule=1872494592, dwReason=0, Filename=c:
        \gstreamer_erbium\lib\gstreamer-0.10\libgstdshowsrcwrapper.dll
         
        ** (gst-launch-0.10:992): WARNING **: BOOL DllMain(void*, DWORD,
        void*) hModule=1651507200, dwReason=0, Filename=c:
        \gstreamer_erbium\bin\libgstdshow-0.10-0.dll


It looks like the DllMain get duplicated, and used by
libgstdshowsrcwrapper.dll, so I tried to hack around this, and create an
empty DllMain inside libgstdshowsrcwrapper.dll (just returns TRUE), and
the output is now :

        $ gst-launch-0.10 dshowvideosrc ! directdrawsink
         
        ** (gst-launch-0.10:7604): WARNING **: BOOL DllMain(void*,
        DWORD, void*) hModule=1651507200, dwReason=1, Filename=c:
        \gstreamer_erbium\bin\libgstdshow-0.10-0.dll
         
        ** (gst-launch-0.10:7604): WARNING **: long int
        DllRegisterServer() g_hInst=1651507200, Filename=c:
        \gstreamer_erbium\bin\libgstdshow-0.10-0.dll
        Setting pipeline to PAUSED ...
        0:00:00.531240000  7604 003E42B8 ERROR        dshowvideosrc
        gstdshowvideosrc.c:602:gst_dshowvideosrc_start: Can't create an
        instance of our dshow fakesink filter (error=-2147221164)
        ERROR: Pipeline doesn't want to pause.
        Setting pipeline to NULL ...
        FREEING pipeline ...
         
        ** (gst-launch-0.10:7604): WARNING **: BOOL DllMain(void*,
        DWORD, void*) hModule=1651507200, dwReason=0, Filename=c:
        \gstreamer_erbium\bin\libgstdshow-0.10-0.dll 

Any ideas ? I think I would need to use your .def file instead of using
dllexport ?

--
Ali

On Thu, 2007-06-14 at 23:48 +0200, Sébastien Moutte wrote:
> Hey,
> 
> Here is my result :
> C:\Documents and Settings\Sébastien>gst-launch-0.10 dshowvideosrc 
> num-buffers=10 ! ffmpegcolorspace ! directdrawsink
> ** (gst-launch-0.10:1528): WARNING **: DllMain, hModule=15073280, 
> reason=1, filename=c:\gstreamer\debug\bin\libgstdshow-0.10.dll
> ** (gst-launch-0.10:1528): WARNING **: DllRegisterServer, 
> hModule=15073280, filename=c:\gstreamer\debug\bin\libgstdshow-0.10.dll
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> Got EOS from element "pipeline0".
> Execution ended after 1812500000 ns.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> FREEING pipeline ...
> ** (gst-launch-0.10:1528): WARNING **: DllMain, hModule=15073280, 
> reason=0, filename=c:\gstreamer\debug\bin\libgstdshow-0.10.dll
> 
> Could you output dwReason so we can see why it's entering twice in DllMain ?
> Also you can call GetModuleFileName with each handle and add the result 
> to the debug so we can see which is the bad one.
> Anyway, it's strange as i've just tested that on another computer than 
> mine and it works fine ...
> I guess it could come from the build.
> Regards,
> Sebastien
> 
> Ali Sabil a écrit :
> > After putting a g_warning inside DllMain, and printing the hModule parameter, and putting a g_warning in DllRegisterServer and printing g_hInst, this is what I get :
> >
> > $ gst-launch-0.10 dshowvideosrc ! directdrawsink
> >
> > ** (gst-launch-0.10.exe:3364): WARNING **: BOOL DllMain(void*, DWORD, void*) 1651507200
> >
> > ** (gst-launch-0.10.exe:3364): WARNING **: BOOL DllMain(void*, DWORD, void*) 1872494592
> >
> > ** (gst-launch-0.10.exe:3364): WARNING **: long int DllRegisterServer() 1872494592
> > Setting pipeline to PAUSED ...
> > 0:00:00.609363000  3364 003E42B8 ERROR        dshowvideosrc gstdshowvideosrc.c:602:gst_dshowvideosrc_start: Can't create an instance of our dshow fakesink filter (error=-2147221164)
> > ERROR: Pipeline doesn't want to pause.
> > Setting pipeline to NULL ...
> > FREEING pipeline ...
> >
> > ** (gst-launch-0.10:3364): WARNING **: BOOL DllMain(void*, DWORD, void*) 1872494592
> >
> > ** (gst-launch-0.10:3364): WARNING **: BOOL DllMain(void*, DWORD, void*) 1651507200
> >
> >
> > Concerning g_hInst, I don't see any exported neither by libdshowsrcwrapper, nor by libgstdshow, is that normal ?
> >
> > Thank you a lot for your help
> >
> > --
> > Ali
> >
> >
> > -----Original Message-----
> > From: Sébastien Moutte [mailto:sebastien at moutte.net] 
> > Sent: Wednesday, June 13, 2007 11:21 PM
> > To: Ali Sabil
> > Cc: gstreamer-devel at lists.sourceforge.net
> > Subject: Re: [gst-devel] gst directshow wrapper weirdness
> >
> > So i guess the problem could come from AMovieDllRegisterServer2 which is 
> > the function called when registering the filters.
> > It's using GetModuleFileNameA to get the path of the current DLL thanks 
> > to a global variable g_hInst which is normally initialized in 
> > DllEntryPoint function.
> > You should try to debug this to see what's the problem trying to compare 
> > the handle passed to DLLMain of libdshow to the one in g_hInst used to 
> > register the COM object (they should be the same).
> > Is there a g_hInst exported from libdshowsrcwrapper ?
> > It seems you get a lot of exported elements from libdshowsrcwrapper, vs6 
> > is just doing explicit exportation maybe mingw+gcc is exporting to much 
> > thing from directshow baseclasses ...
> > Let me know.
> > Sebastien
> >
> > Ali Sabil a écrit :
> >   
> >> It doesn't seem to be the case, since gst_dshow_register_fakefilters is exported by libgstdshow, and libdshowsrcwrapper exports gst_dshowaudiosrc_get_type, gst_dshowvideosrc_get_type and gst_plugin_desc , as well as a lot of symbols like  TIME_FORMAT_BYTE, PIN_*, AMPROPSETID_Pin ...
> >>
> >> Still weird ...
> >>
> >> -----Original Message-----
> >> From: Sébastien Moutte [mailto:sebastien at moutte.net] 
> >> Sent: Wednesday, June 13, 2007 10:26 PM
> >> To: Ali Sabil
> >> Cc: gstreamer-devel at lists.sourceforge.net
> >> Subject: Re: [gst-devel] gst directshow wrapper weirdness
> >>
> >> well, this is really strange.
> >> It looks like you built some source files of libdshow in libdshowsrcwrapper.
> >> gst_dshow_register_fakefilters is called in plugin_init function of 
> >> libdshowsrcwrapper but this function must be implemented and exported 
> >> from libdshow.
> >> Could you check if it is the case ?
> >>
> >> Ali Sabil a écrit :
> >>   
> >>     
> >>> It seems like when I use regserv32 the key get set to the correct value,
> >>> but once I try to run gst-launch the key get reset to the wrong value :/
> >>>
> >>> On Mon, 2007-06-11 at 13:39 +0200, Sebastien Moutte wrote:
> >>>   
> >>>     
> >>>       
> >>>> It should point to libdshow-0.10.dll as the fake sink COM object is implemented in the library and not in the plugin.
> >>>>
> >>>> -----Original Message-----
> >>>> From: Ali Sabil [mailto:ali.sabil at tandberg.com] 
> >>>> Sent: lundi 11 juin 2007 12:26
> >>>> To: Sébastien Moutte
> >>>> Cc: gstreamer-devel at lists.sourceforge.net
> >>>> Subject: Re: [gst-devel] gst directshow wrapper weirdness
> >>>>
> >>>> Hello again :)
> >>>>
> >>>> the key exists, and it points to libgstdshowsrcwrapper.dll
> >>>>
> >>>> Thanks
> >>>>
> >>>> --
> >>>> Ali
> >>>>
> >>>> On Sun, 2007-06-10 at 23:42 +0200, Sébastien Moutte wrote:
> >>>>     
> >>>>       
> >>>>         
> >>>>> if you still have the same error code saying that it can't find the fake 
> >>>>> sink's CLSID in the registry, you should search for 
> >>>>> {6A780808-9725-4d0b-8695-A4DD8D210773} key in your registry to check if 
> >>>>> the filter object registration was done correctly or not.
> >>>>> Normally, you will find a key 
> >>>>> HKEY_CLASSES_ROOT\CLSID\{6A780808-9725-4D0B-8695-A4DD8D210773} with the 
> >>>>> path of DLL in as default value of InprocServer32 subkey.
> >>>>> Sebastien
> >>>>>
> >>>>> Ali Sabil a écrit :
> >>>>>       
> >>>>>         
> >>>>>           
> >>>>>> Hello again,
> >>>>>>
> >>>>>> Now I finally managed to fix the stdcall symbol naming problem (the @x
> >>>>>> that get appended), by making use of Aliasing (both symbols are
> >>>>>> available now), now Regsvr32 succeeds, but I still get this error saying
> >>>>>> that it failed at creating the FakeSink filter.
> >>>>>>
> >>>>>> Any help/idea/suggestion would be very welcome.
> >>>>>>
> >>>>>> Thanks
> >>>>>>
> >>>>>> --
> >>>>>> Ali
> >>>>>>
> >>>>>> On Thu, 2007-06-07 at 23:29 +0200, Sébastien Moutte wrote:
> >>>>>>   
> >>>>>>         
> >>>>>>           
> >>>>>>             
> >>>>>>> It could be an exportation problem, you should see DllRegisterServer in 
> >>>>>>> the Dependency Walker and not DllRegisterServer at 0
> >>>>>>> I'm using a .def to export functions, maybe mingw doesn't handle it 
> >>>>>>> correctly ...
> >>>>>>>
> >>>>>>> Ali Sabil a écrit :
> >>>>>>>     
> >>>>>>>           
> >>>>>>>             
> >>>>>>>               
> >>>>>>>> The actual error message from regsvr32 is "ligstdhow-0.10-0.dll was
> >>>>>>>> loaded, but the DllRegisterServer entry point was not found".
> >>>>>>>>
> >>>>>>>> The weird thing is that the DllRegisterServer at 0 symbol is defined in
> >>>>>>>> the .dll file (I checked using a tool called Dependency Walker)
> >>>>>>>>
> >>>>>>>> Any ideas about the problem ?
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Ali
> >>>>>>>>
> >>>>>>>> On Wed, 2007-06-06 at 18:13 +0200, Ali Sabil wrote:
> >>>>>>>>   
> >>>>>>>>       
> >>>>>>>>             
> >>>>>>>>               
> >>>>>>>>                 
> >>>>>>>>> It seems like the filter doesn't get registered as it should be. I
> >>>>>>>>> also tried to make DllRegister and DllUnregister dllexported and ran
> >>>>>>>>> regsvr32 to register it, but it failed saying that the filter could
> >>>>>>>>> not be registered.
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> Btw, I had to apply some fixes, to get it to build, and I am building
> >>>>>>>>> it using mingw32 on GNU/Linux, if you want I can make the compiled
> >>>>>>>>> libgstdshow available so hat you can take a look at it.
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> Thank you
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>>
> >>>>>>>>> Ali
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>>                                    
> >>>>>>>>> ______________________________________________________________________
> >>>>>>>>> From:Sebastien Moutte [mailto:sebastien at moutte.net] 
> >>>>>>>>> Sent: Wednesday, June 06, 2007 4:34 PM
> >>>>>>>>> To: Ali Sabil; gstreamer-devel at lists.sourceforge.net
> >>>>>>>>> Subject: RE: [gst-devel] gst directshow wrapper weirdness
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> Hi,
> >>>>>>>>>
> >>>>>>>>> It seems the DirectShow fake sink element is not registered on your
> >>>>>>>>> computer.
> >>>>>>>>>
> >>>>>>>>> This filter is implemented inside libdshow-0.10.dll and normally
> >>>>>>>>> dshowvideosrc and dshowaudiosrc are registering it automatically so
> >>>>>>>>> you have probably some dependency problem or there was a problem
> >>>>>>>>> during the registration.
> >>>>>>>>>
> >>>>>>>>> If you have installed DirectX SDK, you have probably graphedit.exe on your computer, you can use it to search for "DSHOW fake sink filter" in the DirectShow installed filters list.
> >>>>>>>>>
> >>>>>>>>> Regards,
> >>>>>>>>>
> >>>>>>>>> Sebastien
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> From:gstreamer-devel-bounces at lists.sourceforge.net
> >>>>>>>>> [mailto:gstreamer-devel-bounces at lists.sourceforge.net] On Behalf Of
> >>>>>>>>> Ali Sabil
> >>>>>>>>> Sent: mardi 5 juin 2007 11:55
> >>>>>>>>> To: gstreamer-devel at lists.sourceforge.net
> >>>>>>>>> Subject: [gst-devel] gst directshow wrapper weirdness
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>> Hello all,
> >>>>>>>>>
> >>>>>>>>> After many days trying to cross compile the new directshow wrapper,
> >>>>>>>>> and
> >>>>>>>>> the audio and video source for windows using mingw32, I finally
> >>>>>>>>> succeeded in building the .dll files, but now when I try to run it I
> >>>>>>>>> get
> >>>>>>>>> the following error :
> >>>>>>>>>
> >>>>>>>>>  $ gst-launch-0.10.exe dshowvideosrc ! ffmpegcolorspace !
> >>>>>>>>> directdrawsink
> >>>>>>>>> Setting pipeline to PAUSED ...
> >>>>>>>>> 0:00:00.264301000  2056 003D42E0 ERROR        dshowvideosrc
> >>>>>>>>> gstdshowvideosrc.c:602:gst_dshowvideosrc_start: Can't create an
> >>>>>>>>> instance
> >>>>>>>>> of our dshow fakesink filter (error=-2147221164)
> >>>>>>>>> ERROR: Pipeline doesn't want to pause.
> >>>>>>>>> Setting pipeline to NULL ...
> >>>>>>>>> FREEING pipeline ...
> >>>>>>>>>
> >>>>>>>>> Thanks
> >>>>>>>>>
> >>>>>>>>> --
> >>>>>>>>> Ali
> >>>>>>>>>
> >>>>>>>>>  
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> -------------------------------------------------------------------------
> >>>>>>>>> This SF.net email is sponsored by DB2 Express
> >>>>>>>>> Download DB2 Express C - the FREE version of DB2 express and take
> >>>>>>>>> control of your XML. No limits. Just data. Click to get it now.
> >>>>>>>>> http://sourceforge.net/powerbar/db2/
> >>>>>>>>> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>>>>>>>>     
> >>>>>>>>>         
> >>>>>>>>>               
> >>>>>>>>>                 
> >>>>>>>>>                   
> >>>>>>>> -------------------------------------------------------------------------
> >>>>>>>> This SF.net email is sponsored by DB2 Express
> >>>>>>>> Download DB2 Express C - the FREE version of DB2 express and take
> >>>>>>>> control of your XML. No limits. Just data. Click to get it now.
> >>>>>>>> http://sourceforge.net/powerbar/db2/
> >>>>>>>> _______________________________________________
> >>>>>>>> gstreamer-devel mailing list
> >>>>>>>> gstreamer-devel at lists.sourceforge.net
> >>>>>>>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>>>>>>>   
> >>>>>>>>       
> >>>>>>>>             
> >>>>>>>>               
> >>>>>>>>                 
> >>>>>>   
> >>>>>>         
> >>>>>>           
> >>>>>>             
> >>> -------------------------------------------------------------------------
> >>> This SF.net email is sponsored by DB2 Express
> >>> Download DB2 Express C - the FREE version of DB2 express and take
> >>> control of your XML. No limits. Just data. Click to get it now.
> >>> http://sourceforge.net/powerbar/db2/
> >>> _______________________________________________
> >>> gstreamer-devel mailing list
> >>> gstreamer-devel at lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>>   
> >>>     
> >>>       
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by DB2 Express
> >> Download DB2 Express C - the FREE version of DB2 express and take
> >> control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >> _______________________________________________
> >> gstreamer-devel mailing list
> >> gstreamer-devel at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
> >>
> >>   
> >>     
> >
> >   




More information about the gstreamer-devel mailing list