locked
Does MediaCapture::CapturePhotoToStorageFileAsync support UVC Still Image Capture method 2 for Metro Style APP?

    Question

  • Dear Sirs:

    My webcam supports UVC Still Image Capture method 2.
    This is confirmed by USBVIEW.EXE program reporting that:
        * the bStillCaptureMethod field in Class-specific VS Interface Input Header Descriptor is 2 (Mehtod 2)
        * the Still Image Frame Type Descriptor contains 13 entries    

    I used the following code to capture a still image.

    void App1::MainPage::OnCapture(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
    {
      if(!m_liveviewOn) return; 
    
      concurrency::task<StorageFile^>(KnownFolders::PicturesLibrary->CreateFileAsync("altekPhoto.jpg", CreationCollisionOption::GenerateUniqueName))
      .then([this] (concurrency::task<StorageFile^> a_task)
      {
    	  try
    	  {
    	    StorageFile^ vfile = a_task.get();
            concurrency::task<void>(m_ctr.Get()->VideoDeviceController->SetMediaStreamPropertiesAsync(MediaStreamType::Photo, m_PhotoType))	
    	    .then( [this, vfile] (concurrency::task<void> a_recordTask)
    		{
    		  ImageEncodingProperties ^iep = ImageEncodingProperties::CreateJpeg();
    		  return m_ctr->CapturePhotoToStorageFileAsync(iep , vfile);
    		})
            .then ([this, vfile] (concurrency::task<void> a_recordTask)
    		{
    			  TextBlock^ tb = safe_cast<TextBlock^> (this->FindName("TEXTBLOCK_Status"));
    			  tb->Text = L"Capture to : " + vfile->Path;
    
    	          return  m_ctr.Get()->VideoDeviceController->SetMediaStreamPropertiesAsync(MediaStreamType::VideoPreview, m_PreviewType);
    		});
    	  }
    	  catch (Exception^ ex)
    	  {
            OutputDebugString(ex->Message->Data());
          }
      });
    }
    

    The MediaCapture::>CapturePhotoToStorageFileAsync did not act as UVC method 2 behave described in "USB Device Class Definition for Video Devices" section 2.4.2.4.
    It just acts as UVC method 1 behave.

    I also query the MediaCapture::MediaCaptureSettings::VideoDeviceCharacteristic and it reports that AllStreamsIdentical (4)

    I query the MediaCapture::VideoDeviceController::GetAvailableMediaStreamProperties
    and it reports that the VideoPreview, VideoRecord, and the Photo are all of the same formats.

    My questions:
      1. How can I make MediaCapture::>CapturePhotoToStorageFileAsync to perofrm UVC method 2 behave with a webcam supporting UVC Method 2?
      2. How can I query Still stream formats with a webcam supporting UVC Method 2?

    Thanks,


    Friday, October 26, 2012 2:03 AM