The Client Side Example for C

#define MAKE_MEDIA_PATH(pFileName) (TEXT("C:\\Program Files (x86)\\LEAD Technologies\\LEADTOOLS 19\\Media\\")TEXT(pFileName)) 
#include "ltmm.h" 
#include "ILMNetDmx2.h" 
void ClientSide_Example ( ) 
   IltmmPlay* pPlay ; 
   IUnknown* pUnk = NULL; 
   ILMNetDmx* pDmx; 
   long bitrate = 0; 
   BSTR Message; 
   BSTR sServer; 
   BSTR szFileName; 
   CoCreateInstance(&CLSID_ltmmPlay, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmPlay, (void**) &pPlay); 
// set the player source: 
   sServer = SysAllocString(L"ltsf://"); 
   IltmmPlay_put_SourceFile(pPlay , sServer); 
   // you can monitor the incoming bit rate by checking the BitRate property of 
// the demultiplexer object: 
   IltmmPlay_GetSubObject (pPlay, ltmmPlay_Object_Splitter, &pUnk); 
   IUnknown_QueryInterface(pUnk, &IID_ILMNetDmx, (void**) &pDmx); 
   ILMNetDmx_get_BitRate(pDmx, &bitrate); // you may display the value 
   // Get the output file name 
   ILMNetDmx_get_OutputFileName(pDmx, &szFileName); 
   if (szFileName == NULL) 
      // Set the output file name to record the incoming stream 
      szFileName = SysAllocString((OLECHAR*)MAKE_MEDIA_PATH("output.avi")); 
      ILMNetDmx_put_OutputFileName(pDmx, szFileName); 
// if the AutoStart property is not TRUE, you need to run the player: 
   // To give a chance to receive some data 
   /* to receive a text message sent by the server, use the ReadMessage method: */ 
   /* first, get the demux interface again (you might want to keep it for the life of 
the communication session: 
   read the message: */ 
   ILMNetDmx_ReadMessage(pDmx, &Message); 
   /* do something with the message. */ 
   /* You need to call ReadMessage continuously to check for new messages.*/ 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Multimedia C API Help