Revision: 18763
http://opalvoip.svn.sourceforge.net/opalvoip/?rev=18763&view=rev
Author: shorne
Date: 2007-10-24 14:11:45 -0700 (Wed, 24 Oct 2007)
Log Message:
-----------
Added GetDeviceCapabilities for Input device. Fixed colour format for windows
Modified Paths:
--------------
ptlib/trunk/samples/vidtest/main.cxx
Modified: ptlib/trunk/samples/vidtest/main.cxx
===================================================================
--- ptlib/trunk/samples/vidtest/main.cxx 2007-10-24 21:02:32 UTC (rev 18762)
+++ ptlib/trunk/samples/vidtest/main.cxx 2007-10-24 21:11:45 UTC (rev 18763)
@@ -190,6 +190,17 @@
PString inputDeviceName = args.GetOptionString("input-device");
if (inputDeviceName.IsEmpty())
inputDeviceName = devices[0];
+
+ InputDeviceCapabilities caps;
+ if (PVideoInputDevice::GetDeviceCapabilities(inputDeviceName,inputDriverName,&caps)) {
+ cout << "Grabber " << inputDeviceName << " capabilities." << endl;
+ for (std::list<InputDeviceCapability>::const_iterator r = caps.begin(); r != caps.end(); ++r) {
+ cout << " w: " << r->width << " h: " << r->height << " fmt: " << r->format << " fps: " << r->fps << endl;
+ }
+ cout << endl;
+ } else {
+ cout << "InputDevice " << inputDeviceName << " capabilities not Available." << endl;
+ }
if (grabber == NULL)
grabber = PVideoInputDevice::CreateDeviceByName(inputDeviceName);
@@ -332,8 +343,11 @@
cout << "Display frame size set to " << display->GetFrameWidth() << 'x' << display->GetFrameHeight() << endl;
-
+#ifdef _WIN32 // Must be BGR for the colour to appear correct
+ PCaselessString colourFormat = args.GetOptionString("colour-format", "BGR24").ToUpper();
+#else
PCaselessString colourFormat = args.GetOptionString("colour-format", "RGB24").ToUpper();
+#endif
if (!grabber->SetColourFormatConverter(colourFormat) ) {
cerr << "Video input device could not be set to colour format \"" << colourFormat << '"' << endl;
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|