Index: DirectXWebcamDriver.cpp
===================================================================
--- DirectXWebcamDriver.cpp	(revision 400)
+++ DirectXWebcamDriver.cpp	(working copy)
@@ -194,6 +194,7 @@
 
 webcamerrorcode DirectXWebcamDriver::setDevice(const std::string & deviceName) {
 	//TODO: test if a webcam is already open
+	bool save_isOpen = _isOpen; // will need this later
 
 	//TODO: refactor the COM initialization phase to avoid
 	//multiple initalisations and better handle unitialization
@@ -265,6 +266,8 @@
 
 	_pBuild->RenderStream(&PIN_CATEGORY_CAPTURE, NULL, _pCap, NULL, _pGrabberF);
 
+	save_isOpen = _isOpen;
+	_isOpen = true; // otherwise setCaps does nothing
 	//try to assign some palette until the webcam supports it
 	if (setCaps(PIX_OSI_YUV420P, _cachedFPS, 176, 144) != WEBCAM_OK ) {
 	if (setCaps(PIX_OSI_YUV420P, _cachedFPS, 160, 120) != WEBCAM_OK ) {
@@ -279,10 +282,14 @@
 	if (setCaps(PIX_OSI_RGB565, _cachedFPS, 176, 144) != WEBCAM_OK ) {
 	if (setCaps(PIX_OSI_RGB565, _cachedFPS, 160, 120) != WEBCAM_OK ) {
 	if (setCaps(PIX_OSI_RGB555, _cachedFPS, 176, 144) != WEBCAM_OK ) {
-	if (setCaps(PIX_OSI_RGB555, _cachedFPS, 160, 120) != WEBCAM_OK ) {
+	if (setCaps(PIX_OSI_RGB555, _cachedFPS, 160, 120) != WEBCAM_OK ) {
+	if (setCaps(PIX_OSI_YUY2, _cachedFPS, 176, 144) != WEBCAM_OK ) { //sony webcam
+	if (setCaps(PIX_OSI_YUY2, _cachedFPS, 160, 120) != WEBCAM_OK ) { //sony webcam
 	if (setCaps(PIX_OSI_UYVY, _cachedFPS, 176, 144) != WEBCAM_OK ) {
 	if (setCaps(PIX_OSI_UYVY, _cachedFPS, 160, 120) != WEBCAM_OK ) {
 	}}}}}}}}}}}}}}}}
+	}} //sony webcam
+	_isOpen = save_isOpen; // otherwise setCaps does nothing
 
 	readCaps();
 
