Adding a Custom Target Format for C

long AddCustomFormatExample (IltmmConvert *pConvert) 
{ 
   IltmmTargetFormats* pFormats; 
   IltmmTargetFormat* pFormat; 
   BSTR bstr; 
   long count, lStreams; 
 
   IltmmConvert_get_TargetFormats(pConvert, &pFormats); 
 
   // add a new format at the end of the Formats list 
   bstr = SysAllocString(L"My Own Format"); 
   IltmmTargetFormats_Add(pFormats, bstr, -1); 
 
   // get the new format 
   IltmmTargetFormats_get_Count(pFormats, &count); 
   IltmmTargetFormats_Item(pFormats, count-1, &pFormat); 
 
   // set the format's sink filter: this example uses "LEAD Network Sink" 
   bstr = SysAllocString(L"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\\{E2B7DE05-38C5-11D5-91F6-00104BDB8FF9}"); 
   IltmmTargetFormat_put_Sink(pFormat, bstr); 
   SysFreeString(bstr); 
 
   // set the format's mux filter: : this example uses "LEAD Network Multiplexer" 
   bstr = SysAllocString(L"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\\{E2B7DE01-38C5-11D5-91F6-00104BDB8FF9}"); 
   IltmmTargetFormat_put_Mux(pFormat, bstr); 
   SysFreeString(bstr); 
 
   // specify which streams your new format can have   
   IltmmTargetFormat_put_Streams(pFormat, ltmmTargetFormat_Stream_Audio | ltmmTargetFormat_Stream_Video); 
 
   // get the streams 
   IltmmTargetFormat_get_Streams(pFormat, &lStreams); 
 
   // verify them if needed ... 
 
   // that is it 
   IUnknown_Release(pFormat); 
   IUnknown_Release(pFormats); 
 
   // later, call put_TargetFormat(count-1) to use your new format. 
 
   // return the format index 
   return (count-1);  
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.