enabling DirectShow video input
I successfully built the debug configurations of ptlib 2.4.5 (static), h323plus 1.21.0 and simpleplus 1.21.0 in VS2008SP1 + WinSDK 7.1 on Win7/x64.
Audio and text work fine. However, video does not work: "No Video Grabber available Disabling Video Support!".
DirectShow support in vidinput_directx.cxx is compiled successfully and the DirectShow branches in simpleplus/main.cxx are active, since P_DIRECTSHOW is #define'd as 1 in ptbuildopts.h. I tried #define'ing P_DSHOW to 1 as well in simpleplus, without any difference.
As far as I can tell, the problem is that the DirectShow service is never registered on startup.
I expanded the PCREATE_VIDINPUT_PLUGIN(DirectShow) macro in vidinput_directx.cxx to put a breakpoint in PPlugin_PVideoInputDevice_DirectShow_Registration::<ctor>() and that code is compiled but never executed. Actually, it appears to never be mapped into memory at all, which should imply that the linker is removing it from the final EXE, but adding /OPT:NOREF in the build config of simpleplus does not make a difference.
However FakeVideo is registered and it also uses the PCREATE_VIDINPUT_PLUGIN() macro, and I can not spot any difference between the way FakeVideo and DirectShow are compiled and linked.
The only reference to a similar issue I could find is from over one year ago:
http://lists.packetizer.com/pipermail/h323plus/2009-August/001165.html
But the current code already uses PCREATE_VIDINPUT_PLUGIN() and, as I said, FakeVideo uses the same macro but is correctly registered.
Alessandro
There are 2 directshow implementations. The original directshow (P_DIRECTSHOW) was dependent on DirectSound being present (which sometimes it is not) and the second directshow2 (P_DIRECTSHOW2) did not. DirectShow2 files should be in the distro but may or may not be loaded in the project (vidinput_directx2.h.cxx) Check to see in the ptbuildopts.h what has been enabled.
It appears directshow is not loading because the dependency is not present. Try DirectShow2.
The current PTLIB SVN and H323plus CVS now use DirectShow2 by default.
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Thursday, October 28, 2010 9:30 AM To: h323plus@lists.packetizer.com Subject: [h323plus] enabling DirectShow video input
I successfully built the debug configurations of ptlib 2.4.5 (static), h323plus 1.21.0 and simpleplus 1.21.0 in VS2008SP1 + WinSDK 7.1 on Win7/x64.
Audio and text work fine. However, video does not work: "No Video Grabber available Disabling Video Support!".
DirectShow support in vidinput_directx.cxx is compiled successfully and the DirectShow branches in simpleplus/main.cxx are active, since P_DIRECTSHOW is #define'd as 1 in ptbuildopts.h. I tried #define'ing P_DSHOW to 1 as well in simpleplus, without any difference.
As far as I can tell, the problem is that the DirectShow service is never registered on startup.
I expanded the PCREATE_VIDINPUT_PLUGIN(DirectShow) macro in vidinput_directx.cxx to put a breakpoint in PPlugin_PVideoInputDevice_DirectShow_Registration::<ctor>() and that code is compiled but never executed. Actually, it appears to never be mapped into memory at all, which should imply that the linker is removing it from the final EXE, but adding /OPT:NOREF in the build config of simpleplus does not make a difference.
However FakeVideo is registered and it also uses the PCREATE_VIDINPUT_PLUGIN() macro, and I can not spot any difference between the way FakeVideo and DirectShow are compiled and linked.
The only reference to a similar issue I could find is from over one year ago:
http://lists.packetizer.com/pipermail/h323plus/2009-August/001165.html
But the current code already uses PCREATE_VIDINPUT_PLUGIN() and, as I said, FakeVideo uses the same macro but is correctly registered.
-- Alessandro
From: "Simon Horne" s.horne@packetizer.com Date: Wednesday 27 October 2010 21:11
There are 2 directshow implementations. The original directshow (P_DIRECTSHOW) was dependent on DirectSound being present (which sometimes it is not) and the second directshow2 (P_DIRECTSHOW2) did not. DirectShow2 files should be in the distro but may or may not be loaded in the project (vidinput_directx2.h.cxx) Check to see in the ptbuildopts.h what has been enabled.
Thanks for your quick reply Simon.
In my case both DirectShow and DirectSound are present and correctly found in the Windows SDK 7.1 and they are both enabled and compiled without errors.
However, the static initialization code that registers the DirectShow service is never executed and, apparently, not even loaded in memory, which suggests that it was stripped by the linker, but I can not see why (since I can not spot any difference between DirectShow and FakeVideo and the latter is registered).
It appears directshow is not loading because the dependency is not present. Try DirectShow2.
The current PTLIB SVN and H323plus CVS now use DirectShow2 by default.
I will download a more recent snapshot of both libs and try them with DirectShow2.
Alessandro
The factory loader system was changed recently. I added this patch for DirectShow2 to load http://opalvoip.svn.sourceforge.net/viewvc/opalvoip/ptlib/trunk/include/ptli b/videoio.h?r1=23242&r2=23325
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Thursday, October 28, 2010 12:16 PM To: h323plus@lists.packetizer.com Subject: Re: [h323plus] enabling DirectShow video input
From: "Simon Horne" s.horne@packetizer.com Date: Wednesday 27 October 2010 21:11
There are 2 directshow implementations. The original directshow (P_DIRECTSHOW) was dependent on DirectSound being present (which sometimes it is not) and the second directshow2 (P_DIRECTSHOW2) did not. DirectShow2 files should be in the distro but may or may not be loaded in the project (vidinput_directx2.h.cxx) Check to see in the ptbuildopts.h what has been enabled.
Thanks for your quick reply Simon.
In my case both DirectShow and DirectSound are present and correctly found in the Windows SDK 7.1 and they are both enabled and compiled without errors.
However, the static initialization code that registers the DirectShow service is never executed and, apparently, not even loaded in memory, which suggests that it was stripped by the linker, but I can not see why (since I can not spot any difference between DirectShow and FakeVideo and the latter is registered).
It appears directshow is not loading because the dependency is not present. Try DirectShow2.
The current PTLIB SVN and H323plus CVS now use DirectShow2 by default.
I will download a more recent snapshot of both libs and try them with DirectShow2.
-- Alessandro
I think it should be noted in general, that the download archives on h323plus.org are rather old and everybody should use the CVS until there is a new release.
Regards, Jan
Simon Horne wrote:
Alessandro
The factory loader system was changed recently. I added this patch for DirectShow2 to load http://opalvoip.svn.sourceforge.net/viewvc/opalvoip/ptlib/trunk/include/ptli b/videoio.h?r1=23242&r2=23325
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Thursday, October 28, 2010 12:16 PM To: h323plus@lists.packetizer.com Subject: Re: [h323plus] enabling DirectShow video input
From: "Simon Horne" s.horne@packetizer.com Date: Wednesday 27 October 2010 21:11
There are 2 directshow implementations. The original directshow (P_DIRECTSHOW) was dependent on DirectSound being present (which sometimes it is not) and the second directshow2 (P_DIRECTSHOW2) did not. DirectShow2 files should be in the distro but may or may not be loaded in the project (vidinput_directx2.h.cxx) Check to see in the ptbuildopts.h what has been enabled.
Thanks for your quick reply Simon.
In my case both DirectShow and DirectSound are present and correctly found in the Windows SDK 7.1 and they are both enabled and compiled without errors.
However, the static initialization code that registers the DirectShow service is never executed and, apparently, not even loaded in memory, which suggests that it was stripped by the linker, but I can not see why (since I can not spot any difference between DirectShow and FakeVideo and the latter is registered).
It appears directshow is not loading because the dependency is not present. Try DirectShow2.
The current PTLIB SVN and H323plus CVS now use DirectShow2 by default.
I will download a more recent snapshot of both libs and try them with DirectShow2.
-- Alessandro
Yes Jan is right. You should be able to compile the h323plus CVS against the latest PTLIB release.
I am working towards a release in the not too distant future.
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Jan Willamowius Sent: Thursday, October 28, 2010 5:06 PM To: h323plus@lists.packetizer.com Subject: Re: [h323plus] enabling DirectShow video input
I think it should be noted in general, that the download archives on h323plus.org are rather old and everybody should use the CVS until there is a new release.
Regards, Jan
Simon Horne wrote:
Alessandro
The factory loader system was changed recently. I added this patch for DirectShow2 to load http://opalvoip.svn.sourceforge.net/viewvc/opalvoip/ptlib/trunk/includ e/ptli b/videoio.h?r1=23242&r2=23325
Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Thursday, October 28, 2010 12:16 PM To: h323plus@lists.packetizer.com Subject: Re: [h323plus] enabling DirectShow video input
From: "Simon Horne" s.horne@packetizer.com Date: Wednesday 27 October 2010 21:11
There are 2 directshow implementations. The original directshow (P_DIRECTSHOW) was dependent on DirectSound being present (which sometimes it is not) and the second directshow2 (P_DIRECTSHOW2) did not. DirectShow2 files should be in the distro but may or may not be loaded in the project (vidinput_directx2.h.cxx) Check to see in the ptbuildopts.h what has been enabled.
Thanks for your quick reply Simon.
In my case both DirectShow and DirectSound are present and correctly found in the Windows SDK 7.1 and they are both enabled and compiled without errors.
However, the static initialization code that registers the DirectShow service is never executed and, apparently, not even loaded in memory, which suggests that it was stripped by the linker, but I can not see why (since I can not spot any difference between DirectShow and FakeVideo and the latter is registered).
It appears directshow is not loading because the dependency is not present. Try DirectShow2.
The current PTLIB SVN and H323plus CVS now use DirectShow2 by default.
I will download a more recent snapshot of both libs and try them with DirectShow2.
-- Alessandro
-- Jan Willamowius, jan@willamowius.de, http://www.gnugk.org/
From: "Simon Horne" s.horne@packetizer.com Date: Thursday 28 October 2010 08:12
Yes Jan is right. You should be able to compile the h323plus CVS against the latest PTLIB release.
I am working towards a release in the not too distant future.
I finally managed to compile and run ptlib + h323plus + simpleplus from the latest source.
I do not know what the established procedure to fix bugs is, so I'll just report the issues here for the moment:
----------------------- 1. DirectShow2 needs qedit.h and ptbuildopts.h.in assumes that qedit.h is in the same location as dshow.h. But qedit.h is no longer part of the DirectShow SDK (included in the Windows SDK). Adding the directory where qedit.h can be found to the project settings does not work because of
#pragma include_alias(<Qedit.h>, <@DIRECTSHOW_DIR@/include/Qedit.h>)
which only works if one puts a copy of qedit.h in the <WinSDK>/include/ folder itself.
Since the WinCE branch in vidinput_directx2.cxx declares the needed interfaces and GUIDs, why not do the same for Win32/Win64 instead of relying on a no-longer supported qedit.h and forcing it to reside in the WinSDK where it should not be?
For the time being, I simply commented out the #pragma and added the directory containing qedit.h to the project's include path.
----------------------- 2. simpleplus/main.cxx has
#ifdef P_DIRECTSHOW2 PString inputDriverName = "DirectShow"; #else
but that should be "DirectShow2", otherwise the service is not found, since DirectShow2 registers itself as "DirectShow2" and not "DirectShow" (which makes sense but is not backward-compatible with looking for "DirectShow").
----------------------- 3. ptlib/common/sound.cxx
PBoolean PSoundChannel::Write(const void * buf, PINDEX len, const void * mark) { return Write(buf, len, mark); }
It is an infinite recursion ending in a stack overflow. I do not know what the call should have been so I have no fix for it.
Alessandro
I have checked in a fix for DirectShow2 so it can be compiled without requiring qedit.h. I have also updated simple with fixes for DirectShow2 and H.239
Bug fix to PSoundChannel::Write() also applied.
Thanks. Simon
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Saturday, October 30, 2010 10:34 AM To: h323plus@lists.packetizer.com Subject: Re: [h323plus] enabling DirectShow video input
From: "Simon Horne" s.horne@packetizer.com Date: Thursday 28 October 2010 08:12
Yes Jan is right. You should be able to compile the h323plus CVS against the latest PTLIB release.
I am working towards a release in the not too distant future.
I finally managed to compile and run ptlib + h323plus + simpleplus from the latest source.
I do not know what the established procedure to fix bugs is, so I'll just report the issues here for the moment:
----------------------- 1. DirectShow2 needs qedit.h and ptbuildopts.h.in assumes that qedit.h is in the same location as dshow.h. But qedit.h is no longer part of the DirectShow SDK (included in the Windows SDK). Adding the directory where qedit.h can be found to the project settings does not work because of
#pragma include_alias(<Qedit.h>, <@DIRECTSHOW_DIR@/include/Qedit.h>)
which only works if one puts a copy of qedit.h in the <WinSDK>/include/ folder itself.
Since the WinCE branch in vidinput_directx2.cxx declares the needed interfaces and GUIDs, why not do the same for Win32/Win64 instead of relying on a no-longer supported qedit.h and forcing it to reside in the WinSDK where it should not be?
For the time being, I simply commented out the #pragma and added the directory containing qedit.h to the project's include path.
----------------------- 2. simpleplus/main.cxx has
#ifdef P_DIRECTSHOW2 PString inputDriverName = "DirectShow"; #else
but that should be "DirectShow2", otherwise the service is not found, since DirectShow2 registers itself as "DirectShow2" and not "DirectShow" (which makes sense but is not backward-compatible with looking for "DirectShow").
----------------------- 3. ptlib/common/sound.cxx
PBoolean PSoundChannel::Write(const void * buf, PINDEX len, const void * mark) { return Write(buf, len, mark); }
It is an infinite recursion ending in a stack overflow. I do not know what the call should have been so I have no fix for it.
-- Alessandro
From: "Simon Horne" s.horne@packetizer.com Date: Sunday 31 October 2010 04:01
I have checked in a fix for DirectShow2 so it can be compiled without requiring qedit.h. I have also updated simple with fixes for DirectShow2 and H.239
Bug fix to PSoundChannel::Write() also applied.
1. The "Linker/General/Output File" of "SVN Get Revision" is now set to
$(SolutionDir)/svn_getrev.exe
which creates a invalid path: the / should be removed or at least replaced with a .
2. The CLSIDs and IIDs of the SampleGrabber are still only defined in the _WIN32_WCE branch of vidinput_directx2.cxx so now compiling that file results in 4 undeclared identifiers.
It seems to (almost) work now. Both endpoints see the webcams and both load the Vic H.261 plugin (but not the ffmpeg H.263 one). However, the server side (-n -l) only receives the video while the client side (-n <host>) neither sends not receives. Audio and text are fine.
Am I missing something?
-----Original Message----- From: h323plus-bounces@lists.packetizer.com [mailto:h323plus- bounces@lists.packetizer.com] On Behalf Of Alessandro Angeli Sent: Wednesday, 3 November 2010 9:27 AM
....
The "Linker/General/Output File" of "SVN Get Revision" is now set to
$(SolutionDir)/svn_getrev.exe
which creates a invalid path: the / should be removed or at least replaced with a .
While I find it strange that this has worked for me for I do not know how long, I have changed the output file to $(ProjectDir)....\svn_getrev.exe as this would be more accurate if the project is included in solutions in other directories.
Robert Jongbloed OPAL/OpenH323/PTLib Architect and Co-founder.
participants (4)
-
Alessandro Angeli
-
Jan Willamowius
-
Robert Jongbloed
-
Simon Horne