IltmmAnalogVideoDecoder::put_TVFormat Example for C++

HRESULT SetTVFormat(IltmmCapture *pCapture) 
{ 
   HRESULT        hr; 
   long           lSupportFormats, lTVFormat, lLines; 
   VARIANT_BOOL   vLocked, vVCRLocked, vEnable; 
   IltmmAnalogVideoDecoder* pAnVidDec = NULL; 
 
   hr = pCapture->get_AnalogVideoDecoder(&pAnVidDec); 
   if (FAILED(hr)) 
      return hr; 
 
   hr = pAnVidDec->get_AvailableTVFormats(&lSupportFormats); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   hr = pAnVidDec->get_TVFormat(&lTVFormat); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   if ((lTVFormat != AnalogVideo_NTSC_M ) && (lSupportFormats & AnalogVideo_NTSC_M)) 
   { 
      hr = pAnVidDec->put_TVFormat(AnalogVideo_NTSC_M); 
      if (FAILED(hr)) 
      { 
         pAnVidDec->Release(); 
         pAnVidDec = NULL; 
         return hr; 
      } 
   } 
   hr = pAnVidDec->get_HorizontalLocked(&vLocked); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   hr = pAnVidDec->get_VCRHorizontalLocking(&vVCRLocked); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   if (vVCRLocked == VARIANT_FALSE) 
   { 
      hr = pAnVidDec->put_VCRHorizontalLocking(VARIANT_TRUE); 
      if (FAILED(hr)) 
      { 
         pAnVidDec->Release(); 
         pAnVidDec = NULL; 
         return hr; 
      } 
   } 
   hr = pAnVidDec->get_NumberOfLines(&lLines); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   hr = pAnVidDec->get_OutputEnable(&vEnable); 
   if (FAILED(hr)) 
   { 
      pAnVidDec->Release(); 
      pAnVidDec = NULL; 
      return hr; 
   } 
   if (vEnable == VARIANT_FALSE) 
   { 
      hr = pAnVidDec->put_OutputEnable(VARIANT_TRUE); 
      if (FAILED(hr)) 
      { 
         pAnVidDec->Release(); 
         pAnVidDec = NULL; 
         return hr; 
      } 
   } 
   pAnVidDec->Release(); 
   pAnVidDec = NULL; 
 
   return S_OK; 
} 
Help Version 22.0.2023.1.26
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.