Merge pull request #61 from Psychtoolbox-3/master

"Broken Windows" release: Post-Release bugfix for NVidia gpu driver bug.
Screen for OSX Octave & Matlab rebuilt against GStreamer SDK 2012.9 universal.

The 2012.9 SDK switches to universal binaries for combined 32/64-Bit.
This made Screen() link-time incompatible to the latest SDK runtime.
Fixed by recompilation/relinking.

Also a tiny doc update for GStreamer.m
PsychPortAudioTimingTest: Improve comments, tiny code cleanup.
PsychHID for OSX: Improve error handling.

Catch errors during HID device enumeration and handle them more
gracefully by output of a useful error message instead of crashing hard
later.

This to work around bugs in Apple's 64-Bit HID Utilities framework
(shoddy error handling), and potentially in some OSX HID drivers, e.g.,
for certain Wacom tablets. A specific tablet model could crash PsychHID
by messing with device enumeration, as reported in Issue#62 on
Psychtoolbox-3 at GitHub.
Merge pull request #63 from kleinerm/master

Fixes for latest OSX GStreamer SDK 2012.9 and OSX HID bugs.
Merge pull request #64 from Psychtoolbox-3/master

BETA UPDATE:

Compatibility fixes for Matlab, GStreamer on OSX and for OSX HID bugs.

OSX Screen's relinked against GStreamer SDK universal runtime binaries 2012.9 to restore compatibility.
PsychHID error handling for Apple and 3rd party driver brokeness improved.
Matlab compatibility fix by David Brainard for PsychColorimetric/LjgToXYZ.
Minor cleanups in demos.
Fix HideCursor() / ShowCursor() on some MS-Windows setups.

HideCursor() wasn't hiding the cursor anymore on some Matlab + Windows
combos for no conceivable reason. On others it worked fine. Apparently
ShowCursor(FALSE/TRUE), while still dec/incrementing the cursor
reference counter, had no effect anymore on the actual cursor.

Various workarounds are implemented in this commit, almost all utterly
ineffective, contrary to what Internet technical forums and Microsoft
MSDN docu says.

The one thing that works (at least on R2012a 32/64-Bit + Windows-7 in a
VirtualBox VM -- my only test system which was broken wrt.
HideCursor()), is defining our own cursor image via CreateCursor(),
which simply contains a 32-by-32 pixels invisible cursor and then
assigning that via SetCursor() during Hidecursor calls, restoring the
backed up original cursor on ShowCursor calls.

This seems to work well enough, as does changing the cursor shape.

I also tried AttachThreadInput() which should have helped, and should
have made GetChar() on WinVista+ working again by sharing all input
queues of our threads/windows with Matlabs queues, but it hasn't any
positive effect on either cursor or GetChar, also does not seem to do
damage to KbCheck or KbQueueXXX, so we leave it in for now.

Screen for 32-Bit and 64-Bit Matlab on Windows rebuilt and tested. What
a nightmare of a system.
Merge pull request #65 from kleinerm/master

Fix HideCursor() on some Windows setups.
Merge pull request #66 from Psychtoolbox-3/master

BETA UPDATE: Fix HideCursor on f$#$@#% MS-Windows.
Merge pull request #67 from Psychtoolbox-3/beta

Merge pull request #66 from Psychtoolbox-3/master
Screen GStreamer vidcap: Fix qtkitvideosrc, prepare for camerabin2

Some small fixes to make qtkitvideosrc plugin work on OSX with
GStreamer.
The plugin is less flexible than miovideosrc, can't probe its sources,
doesn't provide meaningful capture timestamps, so no big win. We still
prioritize miovideosrc for this reason. However, h264 video recording
worked with qtkitvideosrc, but created a deadlock-hang with
miovideosrc. At least one thing works better with qtkitvideosrc…

This also starts a camerabin2 implementation. This is half-finished, as
i can't test with the GStreamer-SDK, due to a bug in the SDK. Therefore
camerabin is still the only viable choice, which is fine on 32-Bit
Windows and all versions of Linux, but requires GStreamer from HomeBrew
on OSX.

VideoRecordingDemo cleaned up a bit.
PsychTweak: Improve VM handling and allow choice of GPU to use.

Add PsychTweak('UseGPUIndex') to select the target GPU to use for
low-level ops. Sets the relevant env var on behalf of user code.

PsychTweak('PrepareForVirtualMachine') - also disables sync tests and
calibrations on all systems, to make this more pain-free. Sets marker
env var PSYCH_IN_VM to signal to all components PTB is running inside a
VM. This is used by Priority() to no-op, as rt-scheduling and
memory-locking can wreak havoc in VMs.
Screen OSX: Add suppor for GPU selection for low-level ops.

Now also accepts the same environment variable from PsychTweak() as on
Linux. Screen not yet recompiled, this is not important enough for now.
Screen/Linux: Improve 'Framerate' detection further.

Our last hack to make Screen('Framerate') work inside VirtualBox VM's
by accepting a slightly weird modeline from RandR unfortunately broke
some specialized real setup with NVidia binary blob, which on that
setup also returns a invalid/weird modeline via RandR. That mode should
have been rejected and instead the XF86VidMode fallback used for proper
results, but our more lenient mode checking didn't reject the mode.

-> Failure on real setups, even exotic ones, is worse than failure in a
VM, so fix the real setup and return a zero "unknown" value in the VM,
where it doesn't hurt much on top of all other VM inflicted limitations.

Screen mex files for Linux rebuilt.
Merge pull request #71 from kleinerm/master

Bugfix for weird RandR modes on Linux returned by some drivers.
Merge pull request #72 from Psychtoolbox-3/master

PTB BETA small update.

Make Linux Screen('Framerate') more robust aganst weird drivers.
Improve PsychTweak('PrepareForVirtualmachine');
Enable qtkitvideosrc plugin for OSX video capture.
Merge pull request #73 from Psychtoolbox-3/beta

Merge pull request #72 from Psychtoolbox-3/master
pnet.mexw64: Bugfix for 64-Bit bug on Windows.

Use of size_t instead of mwSize for matrix dimensions and lack of
-largeArrayDims switch caused a miscompile, where mwSize was 32-Bit due
to lack of -largeArrayDims switch, but size_t was 64-Bit due to compile
for 64-Bit Matlab. Hilarity ensures when trying to receive any data
type other than uint8 / char, e.g., double. Fixed. Fixes forum bug
#14500.

pnet.mexw64 for 64-Bit Matlab on Windows rebuilt and tested.
Fixes to udp_plotter_demo.m and udp_send_demo.m
Merge pull request #74 from kleinerm/master

pnet bugfix for 64-Bit Windows.
Merge pull request #75 from Psychtoolbox-3/master

BETA UPDATE: Fix pnet for 64-Bit Matlab on Windows.