Fixed getting CV_CAP_PROP_FOURCC property value
authorArtur Wieczorek <artwik@wp.pl>
Thu, 2 Oct 2014 15:51:10 +0000 (17:51 +0200)
committerArtur Wieczorek <artwik@wp.pl>
Fri, 10 Oct 2014 06:53:52 +0000 (08:53 +0200)
Save selected FCC in order to return proper CV_CAP_PROP_FOURCC property value (currently FCC for RGB24 is always returned).

modules/videoio/src/cap_dshow.cpp

index bababea..33325e7 100644 (file)
@@ -2567,6 +2567,7 @@ int videoInput::start(int deviceID, videoDevice *VD){
 
             if( setSizeAndSubtype(VD, VD->tryWidth, VD->tryHeight, VD->tryVideoType) ){
                 VD->setSize(VD->tryWidth, VD->tryHeight);
+                VD->videoType = VD->tryVideoType;
                 foundSize = true;
             } else {
                 // try specified size with all formats
@@ -2577,6 +2578,7 @@ int videoInput::start(int deviceID, videoDevice *VD){
                     if(verbose)printf("SETUP: trying format %s @ %i by %i\n", guidStr, VD->tryWidth, VD->tryHeight);
                     if( setSizeAndSubtype(VD, VD->tryWidth, VD->tryHeight, mediaSubtypes[i]) ){
                         VD->setSize(VD->tryWidth, VD->tryHeight);
+                        VD->videoType = mediaSubtypes[i];
                         foundSize = true;
                         break;
                     }