DEMO 2: AwareWare Supported Video-conferecing Application Demo |
---|
NOTE: All the source code are implemented in Microsoft Visual Studio 2005 1. Set the environment: Add the additional dependencies in the environment: DCEngine.lib 2. fine the messages and response functions: int gnArchChangeEventApp= RegisterWindowMessageA(szArchChangeEvent); ON_REGISTERED_MESSAGE(gnArchChangeEventApp, OnReceiveArchChange) 3. Start Engine: // create a new decision engine instance and set the script file pdcEngine = new CDCEngine("dcRules.xml"); //"dcRules.xml" is the xml script file; // Initialize the middleware based on the script file pdcEngine->Initialize(); // set application parameters pdcEngine->SetAppParam("GRAB", GRAB_APP_PARA_MAINWND, (void *)&hlocalwnd); ... pdcEngine->SetAppParam("AVAILABLEBW", "RemoteAddress", (void *)dest); // synchronize to the remote client pdcEngine->SyncTo(dest); 4. Implement the message response functions LRESULT CLocalView::OnReceiveArchChange(WPARAM wParam, LPARAM lPara) { // when the formatted data is ready, we can get it by GetFormatValue(); char buf[1024]; pdcEngine->GetFormatValue(buf); SetStatusBar(buf); return 0; } 5. Start the first executable components in the proactive component chains UpdateData(TRUE); // different from demo1, there is no data input and output from the application, // startmetaprocess start executable components, like GRAB component in this application // we can use a timer if need to start the executable components frequently. pdcEngine->StartMetaProcess(); 6. Stop the decision engine if (pdcEngine != NULL) { // stop the decision engine pdcEngine->Stop(); // release the memory delete pdcEngine; pdcEngine = NULL; } Name: “dcRules.xml” or UserDefinedName Users can define their own XML file, but it has to be set to the decision engine before it starts. Name: “dcRules.xsd” This file defines the format of XML file and it can not be changed. Name: “ComponentManager.exe” To better maintain and update AwareWare components, we have proposed a distributed service module, called the Component Manager (CM) that accepts component registration and provides such services to vehicle applications as component identification, evaluation, migration, and virtual connection. So far we have focused our concern on the component employment and realized component identification function according to a user-provided component name and version properties; thus we leave the component evaluation, migration, and virtual connection functions for further work. Name: “cm.inf” This file defines supported the component type, like .dll and .jar and the component location and address. Users can modify it based on their local setting. In our experiment, we create a small network by using two Cisco routers (Cisco 3200), two switches (Cisco Catalyst 2900XL), and two laptops (running Windows XP) to simulate the real mobile environment. As shown in Fig. 9, two Cisco 3200 routers are connected back-to-back. Although there are many ways to connect two routers back-to-back, such as through Ethernet ports, through AUI (auxiliary user interface) ports, etc. we choose connecting through serial ports by using a DCE/DTE cable because the serial port bandwidth that is also the bottleneck of the network can be easily controlled and changed through Window HyperTerminal tool. Figure1. The testbed of the video-conferencing application The video-conference application gets and sends the video frames in the proactive host (sender), and receives and displays the frames in the reactive host (receiver). There is one available bandwidth measurement tool component and four computing components are used in our application: Grab, Compress, Decompress, and Display. Based on the network condition and decision rules, sender’s application uses or does not use Compress component to process the grabbed image frame from the video camera. At the same time, receiver’s application needs to be synchronized to use or do not use Decompress component to process the received data. Required Files: Application File: AwareDllTest.exe, ComponentManager.exe Decision Engine: DCEngine.dll Components: AvailableBW.dll, Grab.dll, Compress.dll, Decompress.dll, and Display.dll Load and Parse Trace File: IniFile.dll Decision Adaptation Policy Script File: dcRules.xml and dcRules.xsd Component Manager Configuration File: cm.inf Steps: 1. Download all the files and put all the required files in the same folder. 2. Setup the XML script file and component manager configuration file based on your local settings. 3. Double click the ComponentManager.exe and start the component manager (fig 2). Figure2. The GUI of the component manager 4. Double click the AwareDllTest.exe file to start the application, and you will get the following GUI (Fig. 3). Figure3. The GUI of the video conferecing application The main frame is divided into two sub-frames. The left frame is view of local video; and the right frame is the view of remote video. The status bar shows the current action and internal stats. 5. Also start the application in another machine, then connect to that machine by click the “Connect to …” submenu in the “File” menu, shown as Fig. 4. Figure4. The GUI of the video conferecing application 6. After connecting that machine (or connecting to itself), click “start” menu to start the data video capture and transmission. The left frame will show the local camera video, and the connected remote application will show your video view in its right window, shown in Fig. 5 Figure5. The GUI of the video conferecing application 7. Change the bandwidth between the sender and receiver, you will see the application architecture (shown in the status bar of the application) and the image quality will also be adaptively changed according to the user defined adapation policies in the script file. |
|
Copyright(c) 2007 Lehigh University. All rights reserved.
Web
master: Shengpu Liu (shl204@lehigh.edu)