Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Multimedia API Help

IltmmWMProfile::get_MutualExclusionCount Example for C

Show in webframe

For complete code, refer to the CNVWM demo. The example below checks all the streams for a mutual object. If the quality is less than 50, it is removed.

LPTSTR OLE2A(LPCOLESTR lpw)
{
   static CHAR convert[512];

   if(!lpw)
      return NULL;

   convert[0] = '\0';

   WideCharToMultiByte(CP_ACP, 0, lpw, -1, convert, 512, NULL, NULL);

   return convert;
}

void IltmmWMProfile_get_MutualExclusionCount_Example (IltmmWMProfile *pProfile)
{
   IltmmWMMutualExclusion *pMutualExc = NULL; 
   IltmmWMStreamConfig *pStreamConfig = NULL; 
   long lMCount; 
   long lSCount; 
   long lStreamNumber; 
   long lQuality; 
   BSTR bstrData; 
   char strUpdate[255];
   int i;
   int j;

   IltmmWMProfile_get_MutualExclusionCount(pProfile, &lMCount); 

   // iterate through the objects
   for(i=0; i<lMCount; i++)
   {
      IltmmWMProfile_GetMutualExclusion(pProfile, i, &pMutualExc); 

      IltmmWMMutualExclusion_get_StreamCount(pMutualExc, &lSCount); 

      if(lSCount == 0) 
      {
         IltmmWMProfile_RemoveMutualExclusion(pProfile, pMutualExc); 
         IltmmWMMutualExclusion_Release(pMutualExc); 
      }
      else
      {
         for(j=0; j<lSCount; j++)
         {
            // obtain the stream number
            IltmmWMMutualExclusion_GetStream(pMutualExc, j, &lStreamNumber); 
            // get the stream using it's number
            IltmmWMProfile_GetStreamByNumber (pProfile, lStreamNumber, &pStreamConfig); 
            // check it's quality, if it is less than 50, remove it... 
            IltmmWMStreamConfig_get_Quality(pStreamConfig, &lQuality); 
            if(lQuality < 50) 
            {
               // remove it... 
               IltmmWMMutualExclusion_RemoveStream(pMutualExc, lStreamNumber); 
            }

            // report the user with update... 
            IltmmWMMutualExclusion_get_Type(pMutualExc, &bstrData); 
            sprintf(strUpdate, "Updating Mutual object with type :\n %s", OLE2A(bstrData)); 
            SysFreeString(bstrData); 

            MessageBox(NULL, strUpdate, "Update...", MB_OK); 

            IltmmWMStreamConfig_Release(pStreamConfig); 
            IltmmWMMutualExclusion_Release(pMutualExc); 
         }
      }
   }
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.