acquisition.cpp
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:2k
- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- */
- #include "stdafx.h"
- #include "acquisition.h"
- #include "protocol_thread.h"
- #include "video_thread.h"
- #include "text_thread.h"
- #include "exceptions.h"
- // few globals only here
- protocol_thread *protocolThread;
- video_thread *videoThread;
- text_thread *textThread;
- int main( int argc, char **argv )
- {
- unsigned long videoThread_handle;
- unsigned long textThread_handle;
- // allocate threads
- try
- {
- // this main thread will become the protocol thread
- protocolThread = new protocol_thread( argc, argv );
- videoThread = video_thread::create_instance( argc, argv );
- textThread = new text_thread( argc, argv );
- }
- catch ( SyntaxException e )
- {
- cerr << e.getText().c_str() << endl;
- return 1;
- }
- catch ( NetworkException e )
- {
- cerr << e.getText().c_str() << endl;
- return 1;
- }
- try
- {
- videoThread_handle = _beginthread
- ( videoThread->video_thread_entry_func, 0, videoThread );
- textThread_handle = _beginthread
- ( textThread->text_thread_entry_func, 0, textThread );
- // this main thread become the protocol thread
- protocolThread->protocol_thread_entry_func( protocolThread );
- }
- catch ( SyntaxException e )
- {
- cerr << e.getText().c_str() << endl;
- }
- catch ( ShutdownException e )
- {
- cerr << "should never happens at this level " << e.getText().c_str()
- << endl;
- }
- return 0;
- }