diff options
Diffstat (limited to 'TAO')
280 files changed, 64898 insertions, 2943 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 91362fd7865..e099f1c49f0 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,275 +1,286 @@ -Tue Jul 31 12:53:06 2001 Carlos O'Ryan <coryan@uci.edu> +Tue Jul 31 12:55:07 2001 Carlos O'Ryan <coryan@uci.edu> + + * tao/Follower.h: + * tao/Follower.inl: + * tao/Follower.cpp: + * tao/Follower_Auto_Ptr.h: + * tao/Follower_Auto_Ptr.inl: + * tao/Follower_Auto_Ptr.cpp: + * tao/LF_Follower.h: + * tao/LF_Follower.inl: + * tao/LF_Follower.cpp: + * tao/LF_Follower_Auto_Ptr.h: + * tao/LF_Follower_Auto_Ptr.inl: + * tao/LF_Follower_Auto_Ptr.cpp: + * tao/Makefile: + * tao/Makefile.am: + * tao/Makefile.bor: + * tao/TAO.dsp: + * tao/TAO_Static.dsp: + Renamed TAO_Follower to TAO_LF_Follower and + TAO_Follower_Auto_Ptr to TAO_LF_Follower_Auto_Ptr, I think this + is more consistent with the other files in the project. + + * tao/LF_Follower_Auto_Adder.h: + * tao/LF_Follower_Auto_Adder.inl: + * tao/LF_Follower_Auto_Adder.cpp: + Remove unused code from the Auto_Adder files. + + * tao/LF_Event.h: + * tao/LF_Event.inl: + * tao/LF_Event.cpp: + * tao/LF_Event_Binder.h: + * tao/LF_Event_Binder.inl: + * tao/Leader_Follower.h: + * tao/Leader_Follower.i: + * tao/Leader_Follower.cpp: + Use the new class names and #includes. + +Mon Jul 30 14:41:43 2001 Carlos O'Ryan <coryan@uci.edu> + + * tao/LF_Follower_Auto_Adder.h: + * tao/LF_Follower_Auto_Adder.inl: + * tao/LF_Follower_Auto_Adder.cpp: + Automatically manipulate the L/F follower set: its constructor + inserts a follower into the set and the destructor removes it. + + * tao/Leader_Follower.cpp: + Use the new LF_Follower_Auto_Adder class. - * tao/Transport.cpp (register_handler): - Fixed race condition, the register_handler_i() method may use - the connection_handler_, but we do not check if it is nil before - calling. - -Tue Jul 31 13:40:59 2001 Balachandran Natarajan <bala@cs.wustl.edu> - - * tests/Oneways_Invoking_Twoways/client.dsp: Fixed a compile error - in release builds. - -Tue Jul 31 10:39:18 2001 Jeff Parsons <parsons@cs.wustl.edu> - - * tests/IDL_Test/gperf.idl: - - New file in IDL_Test containing examples sent in by - Karl Proese <karl.proese@mchp.siemens.de> and Vsevolod Novikov - <novikov@df.nnov.rfnet.ru> that uncovered bugs in gperf. - - * tests/IDL_Test/idl_test.dsp: - * tests/IDL_Test/Makefile: - * tests/IDL_Test/Makefile.bor: - - Updated project and makefiles to include the new generated files. - -Tue Jul 31 08:25:46 2001 Jeff Parsons <parsons@cs.wustl.edu> - - * TAO_IDL/fe/idl.ll: - * TAO_IDL/fe/idl.yy: - * TAO_IDL/fe/lex.yy.cpp: - * TAO_IDL/fe/lex.yy.cpp.diff: - * TAO_IDL/fe/y.tab.cpp: - * TAO_IDL/fe/y.tab.cpp.diff: - * TAO_IDL/fe/y.tab.h: - - Removed OBV-related token IDL_INIT and replaced it with - IDL_FACTORY, which is returned when the string 'factory' - is seen in an IDL file. This string signals the declaration - of an value type's initializing member function. Also changed - the production rule 'init_decl' to be closer to the correct - grammar for this type of function, although this feature - is completely implemented. And finally, modified two - production rules to eliminate long-standing shift/reduce - error messages when generating y.tab.* from idl.yy. Thanks - to Russ Noseworthy <j.russell.noseworthy@objectsciences.com> - for reporting that an 'init' identifier string in an IDL file - caused an error when compiled with the -Gv option (value types) - enabled. - -Tue Jul 31 06:58:59 2001 Balachandran Natarajan <bala@cs.wustl.edu> - - This checkin is for fixing a race condition while trying to - manipulate the number of upcalls. This was not a problem before - 575 fix, as the manipulation was done when there was an implicit - synchronisation in the TP Reactor. As the implicit synchronisation - has been broken, we had a race condition. The surpsising element - was the fact that it took sometime to figure out this race - condition. We have now added a lock that will be held by the - thread before the variable is manipulated. - - * tao/Connection_Handler.cpp: - * tao/Connection_Handler.h: - * tao/ Connection_Handler.inl: Added a lock to the class. Also - added three methods, incr_pending_upcalls (), - decr_pending_upcalls () and pending_upcalls (). The first two - does the manipulation of the pending_upcalls_ variable after - holding the lock. - - * tao/IIOP_Connection_Handler.cpp: - * tao/IIOP_Connection_Handler.h: Removed he peding_upcalls_ - variable and called the incr_pending_upcalls () and - decr_pending_upcalls () to achieve what needs to be done. - - * tao/Strategies/DIOP_Connection_Handler.cpp - * tao/Strategies/DIOP_Connection_Handler.h - * tao/Strategies/SHMIOP_Connection_Handler.cpp - * tao/Strategies/SHMIOP_Connection_Handler.h - * tao/Strategies/UIOP_Connection_Handler.cpp - * tao/Strategies/UIOP_Connection_Handler.h: - * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h: - * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: - Replicated the changes from IIOP to the above protocols. - - -Sun Jul 29 19:31:34 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu> - - * tao/RTCORBA/RT_Mutex.cpp (try_lock): Since we fixed the timed - ACE_OS::mutex_lock() to set errno to ETIME we can cleanup the - code here to remove the checks for errno == EBUSY and errno == - ETIMEDOUT. - -Sun Jul 29 20:00:00 2001 Craig Rodrigues <crodrigu@bbn.com> - - * tao/PortableServer/ORB_Manager.h: - - Improved comments and converted to doxygen format. - -Sun Jul 29 10:15:13 2001 Ossama Othman <ossama@uci.edu> - - * tao/TAO_Internal.cpp (open_services_i): - - Reverted my change that prevented the default resource factory - from being inserted into the Service Repository. The resource - factory must be inserted into the Service Repository so that - Service Configurator directives such as 'static Resource_Factory - "-ORBResources global"' actually work properly. An alternative - solution for the dynamic loading problem related the default - resource factory is necessary. - -Sun Jul 29 00:59:28 2001 Ossama Othman <ossama@uci.edu> - - * docs/Options.html: - - Updated documentation for the "-ORBSkipServiceConfigOpen" ORB - option. It is no longer necessary the Service Configurator is - now reentrant and thread-safe. This option is deprecated, and - will be removed in releases of TAO in the near future. - -Sun Jul 29 00:22:30 2001 Ossama Othman <ossama@uci.edu> - - * examples/Simple/time-date/svc.conf: - - The support for nested Service Configurator directive processing - that was just added to ACE made it possible to greatly simply - this `svc.conf' file. It is no longer necessary to pre-load - services that are by default loaded by the ORB. It is also no - longer necessary to use the "-ORBSkipServiceConfigOpen" ORB - option since the Service Configurator is now - reentrant/thread-safe. - - Instead of the nine Service Configurator directives that were - listed in this file, only three of them are now necessary. - -Sat Jul 28 23:29:21 2001 Ossama Othman <ossama@uci.edu> - - * tao/TAO_Internal.cpp (open_services_i): - - We cannot insert the default resource factory into the Service - Repository before the ORB is created since it will be finalized - before the ORB is finalized. The ORB requires that a resource - factory exist in order to reclaim the reactor during - finalization. - - This was only a problem when the ORB was dynamically - loaded/unloaded. - -Wed Jul 25 23:48:58 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu> - - * tests/Blocking_Sync_None/client.cpp (main): Changed an - error messages so that the "Right Thing[TM]" will happen when - this test fails, i.e., the build system will automagically - detect it. Thanks to Johnny Willemsen for reportng this. - -Fri Jul 27 21:48:12 2001 Balachandran Natarajan <bala@cs.wustl.edu> - - * performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl: Removed all - the references to the GIOP lite protocol from this script. - - * performance-tests/Cubit/TAO/IDL_Cubit/run_test_lite.pl: We dont - seem to be having any sort of tests that are run for GIOP - Lite. Now we will run this in our nightly builds. This test uses - IIOP_Lite & UIOP_Lite to run the IDL_Cubit test. Having a - protocol that we are not sure whether it works may be a bad - idea. - -Fri Jul 27 21:38:58 2001 Balachandran Natarajan <bala@cs.wustl.edu> - - * tao/GIOP_Message_Base.cpp: Added a TAO_debug_level guard around - the places where dump_msg () is called. Though dump_msg () - prints out information only if the TAO_debug_level is set, this - extra guard will prevent us from calling this method when we are - trying to do performance measurements. - - * tao/GIOP_Message_Lite.cpp: For some reason this class never had - a hexdump. Added the hexdump in dump_msg (). + * tao/Makefile: + * tao/Makefile.am: + * tao/Makefile.bor: + * tao/TAO.dsp: + * tao/TAO_Static.dsp: + Add the new files to Makefiles and projects. -Fri Jul 27 16:33:24 2001 Balachandran Natarajan <bala@cs.wustl.edu> +Sun Jul 29 11:58:51 2001 Carlos O'Ryan <coryan@uci.edu> - * tao/Strategies/DIOP_Connection_Handler.cpp: - * tao/Strategies/UIOP_Connection_Handler.cpp: - * tao/Strategies/SHMIOP_Connection_Handler.cpp: Enabled GIOP lite - flag to pass through to their transport object. + * tao/Leader_Follower.cpp: + If an error is detected while waiting as a follower the loop + should return -1. -Fri Jul 27 16:32:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> + * tao/Transport.cpp: + Merged in some bug fixes from the main trunk. - * tao/IIOP_Connection_Handler.cpp: Enabled GIOP lite flag to pass - through to their transport object. +Sun Jul 29 09:00:57 2001 Carlos O'Ryan <coryan@uci.edu> - * tao/GIOP_Message_Lite.cpp: Transfered the reply that has been - received to the another CDR which is used to dispatch the - reply. This was actually fixed in my branch. Looks like this got - missed when the branch was merged to the main trunk. Added some - cosmetic fixes to the debugging output. Thanks to Paul Calabrese - for alerting me about this miss. + * tao/LF_Event.cpp: + Fixed the error_detected() function -Fri Jul 27 14:43:46 2001 Balachandran Natarajan <bala@cs.wustl.edu> +Fri Jul 27 17:34:40 2001 Carlos O'Ryan <coryan@cs.wustl.edu> - * tests/BiDirectional_NestedUpcall/svc.conf: Removed from the - repository. It is no longer needed as this test will work with - a TP Reactor (the default one). + * tao/Leader_Follower.h: + * tao/default_resource.cpp: + Fixed warnings and compilation errors for gcc-2.7.2 -Fri Jul 27 12:58:51 2001 Balachandran Natarajan <bala@cs.wustl.edu> +Fri Jul 27 10:59:50 2001 Carlos O'Ryan <coryan@uci.edu> - * tao/Transport.cpp: Removed a debug statement. + * tao/LF_Event.h: + * tao/LF_Event.inl: + Add new method to unbind a LF_Event and its Follower: + Reply_Dispatchers can be used multiple times to wait for several + replys, mostly when a LOCATION_FORWARD message is received. -Fri Jul 27 12:25:49 2001 Balachandran Natarajan <bala@cs.wustl.edu> + * tao/LF_Event.cpp: + Modify the state machine: the state can go back to ACTIVE from + CONNECTION_CLOSED or SUCCESSFUL. This represents the location + forward scenario described above. - * tao/Transport.cpp: Reverted the change made in this Wed Jul 25 - 22:10:21 2001 Balachandran Natarajan <bala@cs.wustl.edu>. We - need to resume the handle as soon the reply is ready for - dispatching. The situation where it can create problems can be - easily seen in $TAO_ROOT/tests/LongUpcalls/run_ami_test.pl. + * tao/LF_Event_Binder.h: + * tao/LF_Event_Binder.inl: + * tao/LF_Event_Binder.cpp: + Helper class to automate the bind/unbind calls to a LF_Event. - Further, the fix that was done earlier was to resume the handle - after dispatching the reply. It was thought that it would fix a - race condition. I had a long discussion with Irfan yesterday, - and looks like the possibility of a race condition is not - there at all. + * tao/Leader_Follower.cpp: + Use LF_Event_Binder to handle the bind/unbind calls into the + LF_Event. -Fri Jul 27 11:09:25 2001 Chad Elliott <elliott_c@ociweb.com> + * tao/Makefile: + * tao/Makefile.bor: + * tao/TAO.dsp: + * tao/TAO_Static.dsp: + Add new files to the projects and Makefiles. - * tests/RTCORBA/Banded_Connections/bands.hpux: + * tao/Invocation.cpp: + * tao/Wait_On_Read.cpp: + * tao/Wait_On_Reactor.cpp: + * tao/Synch_Reply_Dispatcher.h: + * tao/Synch_Reply_Dispatcher.cpp: + Remove the reply_received() flag from Synch_Reply_Dispatcher, + the LF_Event state is enough to know what happens. - Added to fix the runtime problem on HP-UX. +Thu Jul 26 18:00:12 2001 Carlos O'Ryan <coryan@uci.edu> - * tests/RTCORBA/Banded_Connections/run_test.pl: - * tests/RTCORBA/Client_Propagated/client.cpp: - * tests/RTCORBA/Client_Propagated/server.cpp: - * tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: - * tests/RTCORBA/Server_Declared/run_test.pl: + * tao/Strategies/advanced_resource.cpp: + Fixed typo in last commit. + +Thu Jul 26 16:50:46 2001 Carlos O'Ryan <coryan@uci.edu> + + * Part of the fixes for + http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=886 + + the changes also close the following bug: + + http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=296 + + * tao/Leader_Follower_Flushing_Strategy.h: + * tao/Leader_Follower_Flushing_Strategy.cpp: + New flushing strategy that participates in the Leader/Followers + protocol. + To support this several changes to the Leader/Followers + implementation were required. The most important involved using + some abstract representation for the events that the + Leader/Followers wait for, in the old days there were only reply + events, so there was no need to abstract anything, but now the + Leader/Followers set can wait for both 'message flushed' events, + as well as 'reply received'. + With this explicit representation for events at hand it was + easier to encapsulate the Leader/Followers wait loop in + TAO_Leader_Follower class, instead of hidden in + Wait_On_Leader_Follower. + To match the events that L/F waits for and the threads waiting + for them we addd a class that represents a Follower thread. + These TAO_Follower objects had to implement an intrusive list + for fast addition into the follower set, once that intrusive + list was implemented adding a free list was trivial, and thus we + could solve bug 296 easily too. + + * tao/Asynch_Queued_Message.cpp: + * tao/Synch_Queued_Message.cpp: + Use the TAO_LF_Event methods to signal any waiters when the + state changes. + + * tao/Follower.h: + * tao/Follower.inl: + * tao/Follower.cpp: + This class represents a thread playing the Follower role. It + contains the condition variable used by the thread. + The class provides the necessary hooks to implement an intrusive + linked list. - Corrections to fix some of the RTCORBA runtime test problems for - HP-UX. These tests still have some problems (especially with - SHMIOP). + * tao/Invocation.cpp: + The waiting strategy wants the complete Synch_Reply_Dispatcher, + not just the reply_received flag. + + * tao/LF_Event.h: + * tao/LF_Event.inl: + * tao/LF_Event.cpp: + New class to represent events that the Leader/Followers loop + waits for. Used as a base class for both TAO_Queued_Message and + for TAO_Synch_Reply. + + * tao/LF_Event_Loop_Thread_Helper.h: + * tao/LF_Event_Loop_Thread_Helper.inl: + * tao/LF_Event_Loop_Thread_Helper.cpp: + Move helper class to its own file, no sense in exposing it to + everybody through the Leader_Follower.h file. + + * tao/Leader_Follower.h: + * tao/Leader_Follower.i: + * tao/Leader_Follower.cpp: + Add free list for TAO_Follower, as well as allocation and + deallocation methods. + Move Leader/Followers main loop to this class. + Move LF_Strategy and friends to their own files. -Fri Jul 27 10:50:42 2001 Jeff Parsons <parsons@cs.wustl.edu> + * tao/ORB_Core.h: + * tao/ORB_Core.i: + * tao/ORB_Core.cpp: + Removed the TSS Leader/Followers condition variable, the + Leader/Followers free list implements the same optimization with + less problems (i.e. without bug 296). - * tests/Smart_Proxies/Benchmark/Makefile: - * tests/Smart_Proxies/Policy/Makefile: + * tao/Queued_Message.h: + * tao/Queued_Message.cpp: + * tao/Synch_Reply_Dispatcher.h: + * tao/Synch_Reply_Dispatcher.cpp: + This class derives from TAO_LF_Event now. Any state or methods + required to detect timeouts, closed connections or transmition + errors are in the base class. - Replaced VLDLIBS with TAO_SRVR_LIBS for the server - target in each Makefile, in order to pull in - TAO_PortableServer. Thanks to Ekkehard Hoffmann - <ehoffman@fzi.de> for pointing out the link errors. + * tao/Reply_Dispatcher.h: + * tao/Asynch_Reply_Dispatcher.h: + * tao/Asynch_Reply_Dispatcher.cpp: + Remove the dispatcher_bound() calls, they are no longer required + to match follower threads and their reply dispatchers, this is + now done in the TAO_LF_Event::bind() method, called from + TAO_Leader_Follower::wait_for_event() -Thu Jul 26 22:41:00 2001 Craig Rodrigues <crodrigu@bbn.com> + * tao/Transport.h: + * tao/Transport.cpp: - * orbsvcs/orbsvcs/AV/AVStreams_i.h: + * tao/Transport_Mux_Strategy.h: + * tao/Transport_Mux_Strategy.cpp: + * tao/Muxed_TMS.cpp: + * tao/Exclusive_TMS.cpp: + Since there is no need to call dispatcher_bound() anymore the + bind_dispatcher() methods were simplified. + + * tao/Wait_On_Leader_Follower.h: + * tao/Wait_On_Leader_Follower.cpp: + * tao/Wait_On_Reactor.h: + * tao/Wait_On_Reactor.cpp: + * tao/Wait_On_Read.h: + * tao/Wait_On_Read.cpp: + * tao/Wait_Strategy.h: + * tao/Wait_Strategy.cpp: + Use a TAO_Synch_Reply_Dispatcher to wait for a reply. The hack + using a reply_received flag + a cond.var. was too ugly, plus it + was tightly coupling the Leader/Followers loop to the reply + dispatching logic. - Make TAO_FlowConnection and TAO_MMDevice virtually - inherit TAO_PropertySet. Thanks to Rob Ruff <rruff@scires.com> - for pointing this out. + * tao/default_resource.h: + * tao/default_resource.cpp: + Made Leader_Follower_Flushing_Strategy the default. -Thu Jul 26 21:48:00 2001 Craig Rodrigues <crodrigu@bbn.com> + * tao/orbconf.h: + * tao/default_client.cpp: + Made Muxed_TMS the default + + * tao/LF_Strategy.h: + * tao/LF_Strategy.inl: + * tao/LF_Strategy.cpp: + * tao/LF_Strategy_Complete.h: + * tao/LF_Strategy_Complete.inl: + * tao/LF_Strategy_Complete.cpp: + Move the LF_Strategy classes to their own files, no sense in + exposing them to everybody through the Leader_Follower.h file. + + * tao/Follower_Auto_Ptr.h: + * tao/Follower_Auto_Ptr.inl: + * tao/Follower_Auto_Ptr.cpp: + Helper class to automatically allocate and deallocate + TAO_Follower objects from the Leader/Followers set. - * orbsvcs/tests/AVStreams/mpeg/*: REMOVED + * tao/GIOP_Message_Base.cpp: + * tao/GIOP_Message_Lite.cpp: + * tao/Reactor_Registry.cpp: + Must #include the "LF_Strategy.h" file explicitly. - Example uses archaic version of AVStreams and does not - work well. + * tao/TAO.dsp: + * tao/TAO_Static.dsp: + * tao/Makefile: + * tao/Makefile.bor: + * tao/Strategies/TAO_Strategies.dsp: + * tao/Strategies/TAO_Strategies_Static.dsp: + * tao/Strategies/Makefile: + * tao/Strategies/Makefile.bor: + Add new files to the projects and Makefile - * orbsvcs/tests/AVStreams/mpeg/README.uav: (added) -Thu Jul 26 17:12:00 2001 Ossama Othman <ossama@uci.edu> + * tao/Strategies/advanced_resource.cpp: + * tao/Strategies/LF_Strategy_Null.h: + * tao/Strategies/LF_Strategy_Null.inl: + * tao/Strategies/LF_Strategy_Null.cpp: + Move the Null Leader/Follower Strategy to the TAO_Strategies + library, it was in TAO, but was only used here. - * tao/default_resource.cpp (get_parser_names): + * tao/RTPortableServer/TAO_RTPortableServer.dsp: + Fixed missing libraries in link line. - Fixed problem where the FILE and DLL parser Service Objects were - not inserted into the parser registry. This problem surfaced - when attempting to dynamically load the ORB, and manifested - itself as a CORBA::INV_OBJREF exception when attempting to - destringify an IOR such as "file://foo.ior". + * tao/TAO.dsw: + Add missing dependencies for RTPortableServer and RTCORBA Thu Jul 26 09:44:00 2001 Craig Rodrigues <crodrigu@bbn.com> diff --git a/TAO/TAO_IDL/fe/idl.ll b/TAO/TAO_IDL/fe/idl.ll index 44b2074e77f..f9bbbb1c0e3 100644 --- a/TAO/TAO_IDL/fe/idl.ll +++ b/TAO/TAO_IDL/fe/idl.ll @@ -159,7 +159,7 @@ native return IDL_NATIVE; local return IDL_LOCAL; abstract return scan_obv_token (IDL_ABSTRACT); custom return scan_obv_token (IDL_CUSTOM); -factory return scan_obv_token (IDL_FACTORY); +init return scan_obv_token (IDL_INIT); private return scan_obv_token (IDL_PRIVATE); public return scan_obv_token (IDL_PUBLIC); supports return scan_obv_token (IDL_SUPPORTS); diff --git a/TAO/TAO_IDL/fe/idl.yy b/TAO/TAO_IDL/fe/idl.yy index 8f3a7b214a0..6efb3bc0669 100644 --- a/TAO/TAO_IDL/fe/idl.yy +++ b/TAO/TAO_IDL/fe/idl.yy @@ -171,7 +171,7 @@ extern int yyleng; /* OBV tokens see OMG ptc/98-10-04 3.2.4 */ %token IDL_ABSTRACT %token IDL_CUSTOM -%token IDL_FACTORY +%token IDL_INIT %token IDL_PRIVATE %token IDL_PUBLIC %token IDL_SUPPORTS @@ -1627,11 +1627,37 @@ struct_type : } ; -at_least_one_member : member members ; +at_least_one_member + : member members + | /* EMPTY */ + { + idl_global->err()->syntax_error(idl_global->parse_state()); + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + yyerrok; + } + | error + { + idl_global->err()->syntax_error(idl_global->parse_state()); + } + ';' + { + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + yyerrok; + } + ; members : members member | /* EMPTY */ + | error + { + idl_global->err()->syntax_error(idl_global->parse_state()); + } + ';' + { + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + yyerrok; + } ; member : @@ -2586,15 +2612,15 @@ op_type_spec ; init_decl - : IDL_FACTORY IDENTIFIER parameter_list + : IDL_INIT { - // TODO: replace parameter_list with rule that accepts only IN args cerr << "error in " << idl_global->filename()->get_string() << " line " << idl_global->lineno() << ":\n" ; - cerr << "Sorry, I (TAO_IDL) can't handle factory yet\n"; + cerr << "Sorry, I (TAO_IDL) can't handle init yet\n"; } ; + parameter_list : '(' { diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp b/TAO/TAO_IDL/fe/lex.yy.cpp index 050de52ccb4..fb37c0d80cd 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp +++ b/TAO/TAO_IDL/fe/lex.yy.cpp @@ -283,7 +283,7 @@ static void tao_yy_fatal_error TAO_YY_PROTO(( tao_yyconst char msg[] )); #define TAO_YY_NUM_RULES 86 #define TAO_YY_END_OF_BUFFER 87 -static tao_yyconst short int tao_yy_accept[445] = +static tao_yyconst short int tao_yy_accept[441] = { 0, 83, 83, 87, 85, 83, 84, 84, 85, 85, 85, 85, 85, 58, 54, 85, 85, 85, 50, 50, 50, @@ -293,47 +293,46 @@ static tao_yyconst short int tao_yy_accept[445] = 51, 82, 0, 51, 58, 0, 0, 0, 54, 49, 47, 48, 50, 50, 0, 0, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 44, 50, 50, 50, 50, 50, 50, 50, + 50, 44, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 0, 77, 0, 0, 0, - 0, 0, 0, 0, 0, 61, 0, 61, 0, 0, - 57, 0, 53, 0, 51, 0, 81, 81, 51, 0, - 52, 56, 50, 0, 60, 0, 0, 0, 50, 50, - 1, 50, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 77, 0, 0, 0, 0, + 0, 0, 0, 0, 61, 0, 61, 0, 0, 57, + 0, 53, 0, 51, 0, 81, 81, 51, 0, 52, + 56, 50, 0, 60, 0, 0, 0, 50, 50, 1, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 45, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 0, 0, 0, 0, 0, 0, 0, 64, 62, 0, - 0, 55, 0, 51, 52, 50, 0, 65, 0, 41, + 50, 45, 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 0, 0, 64, 62, 0, 0, + 55, 0, 51, 52, 50, 0, 65, 0, 41, 50, - 50, 50, 50, 19, 26, 50, 50, 50, 50, 50, - 12, 50, 50, 50, 50, 50, 50, 50, 23, 50, + 50, 50, 19, 26, 50, 50, 50, 50, 50, 12, + 50, 50, 50, 35, 50, 50, 50, 23, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 30, 50, - 50, 0, 0, 0, 0, 0, 0, 0, 78, 0, - 0, 0, 0, 0, 0, 62, 0, 63, 0, 42, - 0, 0, 50, 50, 50, 9, 50, 50, 50, 50, - 50, 50, 17, 21, 43, 50, 32, 50, 50, 29, - 50, 50, 50, 50, 50, 50, 24, 50, 50, 50, - 50, 50, 50, 16, 50, 50, 27, 50, 73, 0, - + 50, 50, 50, 50, 50, 50, 50, 30, 50, 50, + 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, + 0, 0, 0, 0, 62, 0, 63, 0, 42, 0, + 0, 50, 50, 50, 9, 50, 50, 50, 50, 50, + 17, 21, 43, 50, 32, 50, 50, 29, 50, 50, + 50, 50, 50, 50, 24, 50, 50, 50, 50, 50, + 50, 16, 50, 50, 27, 50, 73, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, + 0, 50, 50, 50, 50, 34, 50, 22, 50, 50, + 2, 31, 46, 50, 37, 3, 50, 50, 13, 11, + 50, 18, 50, 50, 50, 50, 50, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 66, 0, 50, 50, 50, 50, 34, 50, 22, - 50, 50, 50, 2, 31, 46, 50, 37, 3, 50, - 50, 13, 11, 50, 18, 50, 50, 50, 50, 50, - 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 50, 50, 28, 7, - 20, 50, 35, 50, 36, 50, 50, 50, 50, 10, - 50, 50, 14, 0, 0, 69, 69, 0, 0, 75, - 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, - 33, 50, 50, 50, 4, 15, 38, 50, 25, 50, - - 0, 79, 79, 0, 0, 0, 0, 72, 0, 0, - 0, 0, 0, 0, 0, 5, 6, 8, 50, 40, - 0, 67, 67, 0, 0, 70, 70, 0, 0, 0, - 0, 50, 0, 80, 80, 0, 0, 0, 39, 76, - 0, 68, 68, 0 + 0, 0, 0, 50, 50, 28, 7, 20, 50, 50, + 36, 50, 50, 50, 50, 10, 50, 50, 14, 0, + 0, 69, 69, 0, 0, 75, 0, 0, 74, 0, + 0, 0, 0, 0, 0, 0, 33, 50, 50, 50, + 4, 15, 38, 50, 25, 50, 0, 79, 79, 0, + + 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, + 0, 5, 6, 8, 50, 40, 0, 67, 67, 0, + 0, 70, 70, 0, 0, 0, 0, 50, 0, 80, + 80, 0, 0, 0, 39, 76, 0, 68, 68, 0 } ; static tao_yyconst int tao_yy_ec[256] = @@ -378,119 +377,117 @@ static tao_yyconst int tao_yy_meta[57] = 8, 6, 8, 6, 8, 6 } ; -static tao_yyconst short int tao_yy_base[472] = +static tao_yyconst short int tao_yy_base[468] = { 0, - 0, 50, 922, 923, 56, 923, 923, 53, 888, 48, - 51, 59, 61, 66, 903, 901, 898, 0, 895, 81, - 888, 49, 869, 57, 50, 24, 63, 869, 867, 866, - 877, 56, 58, 36, 73, 46, 865, 83, 76, 128, - 888, 113, 107, 923, 0, 900, 131, 105, 136, 141, - 178, 923, 133, 162, 173, 184, 199, 0, 211, 923, - 923, 923, 0, 880, 128, 873, 874, 854, 847, 851, - 855, 850, 865, 853, 847, 857, 843, 842, 857, 856, - 836, 844, 77, 102, 852, 837, 836, 848, 834, 842, - 848, 840, 847, 832, 833, 829, 830, 834, 823, 827, - - 116, 830, 830, 830, 819, 826, 923, 116, 215, 826, - 830, 824, 816, 845, 129, 923, 855, 854, 224, 853, - 228, 0, 239, 246, 923, 169, 923, 180, 0, 166, - 253, 0, 831, 200, 923, 807, 850, 196, 833, 805, - 0, 806, 811, 815, 803, 195, 800, 816, 814, 804, - 809, 795, 807, 810, 791, 804, 807, 800, 787, 796, - 799, 782, 0, 782, 791, 783, 795, 779, 781, 182, - 782, 777, 782, 788, 779, 782, 771, 785, 787, 771, - 813, 812, 774, 778, 770, 780, 295, 923, 923, 250, - 805, 0, 256, 279, 923, 788, 0, 923, 0, 0, - - 762, 768, 771, 0, 0, 757, 769, 760, 753, 761, - 0, 756, 756, 764, 749, 748, 749, 754, 0, 753, - 742, 743, 759, 758, 749, 752, 743, 750, 736, 741, - 749, 738, 747, 746, 744, 735, 739, 740, 0, 728, - 734, 769, 270, 736, 728, 734, 731, 727, 923, 241, - 298, 727, 731, 725, 717, 923, 757, 923, 756, 0, - 337, 755, 728, 726, 726, 0, 704, 714, 714, 718, - 704, 705, 0, 0, 0, 714, 0, 657, 645, 0, - 615, 616, 628, 611, 604, 601, 0, 597, 575, 561, - 565, 571, 554, 0, 536, 528, 0, 533, 923, 325, - - 274, 525, 342, 531, 568, 567, 529, 533, 525, 535, - 363, 923, 560, 530, 505, 510, 502, 0, 500, 0, - 490, 473, 485, 0, 0, 0, 473, 0, 0, 467, - 468, 0, 0, 442, 0, 429, 417, 416, 397, 404, - 389, 923, 404, 284, 280, 412, 427, 390, 410, 328, - 377, 366, 352, 349, 435, 376, 331, 329, 0, 0, - 0, 323, 0, 332, 0, 311, 317, 304, 316, 0, - 311, 298, 0, 431, 286, 923, 360, 362, 434, 923, - 330, 281, 923, 461, 315, 284, 476, 281, 275, 307, - 0, 221, 205, 203, 0, 0, 0, 202, 0, 190, - - 392, 923, 458, 206, 464, 480, 484, 923, 492, 499, - 319, 507, 512, 407, 173, 0, 0, 0, 152, 0, - 512, 923, 521, 531, 527, 923, 533, 535, 163, 158, - 321, 103, 537, 923, 540, 77, 546, 556, 0, 923, - 559, 923, 561, 923, 582, 590, 594, 600, 608, 616, - 620, 627, 635, 640, 643, 650, 655, 658, 661, 665, - 672, 677, 684, 689, 696, 704, 712, 720, 728, 736, - 744 + 0, 50, 918, 919, 56, 919, 919, 53, 884, 48, + 51, 59, 61, 66, 899, 897, 894, 0, 891, 81, + 884, 49, 865, 57, 50, 24, 59, 865, 863, 862, + 873, 61, 43, 36, 67, 58, 861, 76, 75, 124, + 884, 110, 111, 919, 0, 896, 122, 117, 136, 141, + 178, 919, 120, 166, 171, 184, 196, 0, 211, 919, + 919, 919, 0, 876, 114, 869, 870, 850, 843, 847, + 851, 846, 861, 849, 843, 853, 839, 838, 853, 833, + 841, 127, 98, 849, 834, 833, 845, 831, 839, 845, + 837, 844, 829, 830, 826, 827, 831, 820, 824, 120, + + 827, 827, 827, 816, 823, 919, 129, 215, 823, 827, + 821, 813, 842, 143, 919, 852, 851, 224, 850, 228, + 0, 239, 246, 919, 243, 919, 255, 0, 174, 253, + 0, 828, 191, 919, 804, 847, 176, 830, 802, 0, + 803, 808, 812, 800, 108, 797, 813, 811, 801, 806, + 805, 808, 790, 788, 801, 804, 797, 784, 793, 796, + 779, 0, 779, 788, 780, 792, 776, 778, 162, 779, + 774, 779, 785, 776, 779, 768, 782, 784, 768, 810, + 809, 771, 775, 767, 777, 295, 919, 919, 257, 802, + 0, 259, 279, 919, 785, 0, 919, 0, 0, 759, + + 765, 768, 0, 0, 754, 766, 757, 750, 758, 0, + 753, 762, 747, 0, 746, 747, 752, 0, 751, 740, + 741, 757, 756, 747, 750, 741, 748, 734, 739, 747, + 736, 745, 744, 742, 733, 737, 738, 0, 726, 732, + 767, 280, 734, 726, 732, 729, 725, 919, 158, 309, + 725, 729, 723, 715, 919, 755, 919, 754, 0, 337, + 753, 726, 724, 724, 0, 702, 712, 712, 716, 702, + 0, 0, 0, 656, 0, 645, 633, 0, 611, 613, + 625, 599, 601, 592, 0, 586, 559, 557, 564, 558, + 543, 0, 534, 527, 0, 531, 919, 342, 232, 524, + + 334, 530, 567, 566, 528, 532, 524, 534, 363, 919, + 558, 521, 503, 508, 500, 0, 481, 0, 487, 485, + 0, 0, 0, 473, 0, 0, 467, 468, 0, 0, + 442, 0, 429, 417, 416, 397, 404, 389, 919, 404, + 284, 243, 412, 427, 390, 410, 286, 377, 366, 352, + 349, 435, 375, 330, 329, 0, 0, 0, 323, 332, + 0, 299, 316, 291, 306, 0, 296, 280, 0, 431, + 299, 919, 361, 363, 434, 919, 315, 277, 919, 461, + 324, 268, 476, 273, 275, 307, 0, 248, 225, 212, + 0, 0, 0, 206, 0, 195, 392, 919, 458, 209, + + 464, 480, 484, 919, 492, 499, 326, 507, 512, 407, + 179, 0, 0, 0, 132, 0, 512, 919, 521, 531, + 527, 919, 533, 535, 155, 140, 330, 104, 537, 919, + 540, 77, 546, 556, 0, 919, 559, 919, 561, 919, + 582, 590, 594, 600, 608, 616, 620, 627, 635, 640, + 643, 650, 655, 658, 661, 665, 672, 677, 684, 689, + 696, 704, 712, 720, 728, 736, 744 } ; -static tao_yyconst short int tao_yy_def[472] = +static tao_yyconst short int tao_yy_def[468] = { 0, - 444, 1, 444, 444, 444, 444, 444, 445, 446, 444, - 444, 444, 444, 444, 444, 444, 444, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 444, - 444, 444, 445, 444, 448, 444, 449, 444, 444, 444, - 444, 444, 450, 51, 444, 444, 444, 451, 444, 444, - 444, 444, 447, 447, 452, 453, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - - 447, 447, 447, 447, 447, 40, 444, 40, 444, 444, - 444, 444, 444, 444, 445, 444, 444, 444, 444, 454, - 444, 455, 444, 444, 444, 450, 444, 450, 54, 444, - 444, 451, 447, 452, 444, 444, 444, 444, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 456, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 457, 455, 444, 444, 444, 447, 458, 444, 459, 447, - - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 456, 444, 444, 444, 444, 444, 187, 444, 187, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 447, - 452, 460, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 444, 444, - - 444, 444, 444, 444, 461, 444, 444, 444, 444, 444, - 261, 444, 462, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 444, 444, 444, 463, 444, 444, 444, 444, 461, 444, - 444, 444, 444, 444, 261, 464, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 444, 463, 444, 463, 465, 444, 444, - 466, 444, 444, 444, 444, 444, 444, 444, 452, 444, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - - 465, 444, 465, 466, 444, 467, 444, 444, 444, 468, - 444, 444, 444, 444, 444, 447, 447, 447, 447, 447, - 467, 444, 467, 444, 468, 444, 468, 469, 470, 444, - 444, 447, 469, 444, 469, 470, 444, 471, 447, 444, - 471, 444, 471, 0, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444 + 440, 1, 440, 440, 440, 440, 440, 441, 442, 440, + 440, 440, 440, 440, 440, 440, 440, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 440, + 440, 440, 441, 440, 444, 440, 445, 440, 440, 440, + 440, 440, 446, 51, 440, 440, 440, 447, 440, 440, + 440, 440, 443, 443, 448, 449, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + + 443, 443, 443, 443, 40, 440, 40, 440, 440, 440, + 440, 440, 440, 441, 440, 440, 440, 440, 450, 440, + 451, 440, 440, 440, 446, 440, 446, 54, 440, 440, + 447, 443, 448, 440, 440, 440, 440, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 452, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 453, + 451, 440, 440, 440, 443, 454, 440, 455, 443, 443, + + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 452, 440, 440, 440, 440, 440, 186, 440, 186, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 443, 448, + 456, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 440, 440, 440, 440, + + 440, 440, 457, 440, 440, 440, 440, 440, 260, 440, + 458, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 440, 440, 440, + 459, 440, 440, 440, 440, 457, 440, 440, 440, 440, + 440, 260, 460, 443, 443, 443, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 443, 443, 443, 440, + 459, 440, 459, 461, 440, 440, 462, 440, 440, 440, + 440, 440, 440, 440, 448, 440, 443, 443, 443, 443, + 443, 443, 443, 443, 443, 443, 461, 440, 461, 462, + + 440, 463, 440, 440, 440, 464, 440, 440, 440, 440, + 440, 443, 443, 443, 443, 443, 463, 440, 463, 440, + 464, 440, 464, 465, 466, 440, 440, 443, 465, 440, + 465, 466, 440, 467, 443, 440, 467, 440, 467, 0, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440 } ; -static tao_yyconst short int tao_yy_nxt[980] = +static tao_yyconst short int tao_yy_nxt[976] = { 0, 4, 5, 6, 7, 5, 8, 4, 9, 4, 4, 10, 11, 12, 13, 14, 14, 15, 16, 4, 17, @@ -498,110 +495,110 @@ static tao_yyconst short int tao_yy_nxt[980] = 18, 18, 4, 22, 23, 24, 25, 26, 27, 18, 18, 28, 29, 30, 31, 32, 33, 18, 34, 35, 36, 37, 38, 39, 18, 18, 40, 42, 44, 48, - 42, 49, 50, 50, 51, 51, 51, 52, 78, 92, - 41, 53, 54, 93, 55, 55, 56, 54, 79, 59, - 59, 59, 437, 68, 57, 45, 65, 76, 66, 57, - 72, 87, 58, 69, 99, 77, 80, 73, 57, 70, - - 88, 100, 74, 57, 81, 82, 90, 89, 75, 91, - 94, 104, 44, 95, 42, 58, 102, 42, 51, 51, - 51, 181, 155, 96, 97, 105, 98, 156, 103, 106, - 107, 107, 108, 135, 44, 127, 128, 157, 118, 45, - 439, 109, 109, 109, 119, 119, 158, 54, 107, 121, - 121, 56, 54, 128, 123, 123, 123, 175, 444, 57, - 136, 45, 120, 429, 57, 176, 110, 122, 437, 111, - 112, 127, 128, 57, 113, 129, 129, 129, 57, 131, - 131, 131, 127, 128, 54, 120, 55, 55, 56, 128, - 122, 51, 51, 51, 432, 54, 57, 56, 56, 56, - - 128, 124, 125, 198, 125, 135, 431, 57, 130, 130, - 57, 405, 131, 131, 131, 124, 125, 107, 107, 182, - 125, 57, 54, 230, 59, 59, 59, 420, 109, 109, - 109, 189, 136, 231, 57, 107, 419, 190, 190, 54, - 418, 121, 121, 56, 206, 207, 305, 199, 57, 417, - 54, 57, 123, 123, 123, 193, 193, 256, 416, 194, - 194, 194, 57, 257, 257, 57, 131, 131, 131, 194, - 194, 194, 299, 299, 300, 344, 57, 195, 344, 195, - 135, 378, 406, 444, 378, 406, 376, 377, 376, 377, - 299, 195, 194, 194, 194, 195, 248, 249, 249, 250, - - 249, 249, 306, 125, 377, 125, 377, 136, 251, 251, - 251, 251, 251, 251, 312, 249, 410, 125, 249, 410, - 428, 125, 438, 428, 415, 438, 341, 342, 342, 341, - 383, 383, 384, 252, 411, 405, 253, 254, 343, 343, - 343, 255, 135, 346, 400, 342, 346, 399, 383, 398, - 311, 311, 311, 397, 396, 347, 347, 347, 311, 311, - 311, 311, 376, 377, 402, 403, 395, 394, 393, 136, - 311, 311, 311, 311, 311, 311, 355, 355, 355, 392, - 377, 391, 403, 312, 355, 355, 355, 355, 388, 387, - 341, 342, 342, 341, 402, 403, 355, 355, 355, 355, - - 355, 355, 374, 374, 374, 341, 342, 342, 341, 342, - 386, 430, 403, 346, 385, 350, 346, 343, 343, 343, - 414, 414, 414, 382, 342, 347, 347, 347, 379, 380, - 380, 379, 381, 342, 342, 379, 380, 380, 379, 381, - 347, 347, 347, 373, 374, 374, 374, 380, 389, 389, - 389, 342, 372, 371, 380, 370, 389, 389, 389, 389, - 402, 403, 407, 408, 408, 407, 380, 380, 389, 389, - 389, 389, 389, 389, 409, 409, 409, 412, 403, 369, - 413, 408, 422, 423, 380, 407, 408, 408, 407, 414, - 414, 414, 368, 407, 408, 408, 407, 424, 424, 424, - - 423, 426, 427, 367, 408, 409, 409, 409, 412, 366, - 365, 413, 408, 412, 422, 423, 413, 429, 364, 427, - 414, 414, 414, 422, 423, 414, 414, 414, 363, 426, - 427, 362, 423, 408, 408, 426, 427, 434, 435, 434, - 435, 423, 434, 435, 424, 424, 424, 427, 440, 440, - 361, 408, 360, 427, 359, 435, 358, 435, 442, 443, - 435, 442, 443, 442, 443, 357, 440, 312, 354, 353, - 352, 351, 305, 350, 348, 345, 443, 340, 339, 443, - 338, 443, 43, 43, 43, 43, 43, 43, 43, 43, - 46, 337, 46, 46, 46, 46, 46, 46, 63, 63, - - 63, 63, 115, 115, 336, 335, 115, 115, 117, 334, - 117, 117, 117, 117, 117, 117, 126, 126, 126, 126, - 126, 126, 126, 126, 132, 333, 132, 134, 134, 134, - 134, 134, 134, 134, 134, 137, 332, 137, 137, 137, - 137, 137, 137, 191, 191, 331, 191, 192, 330, 192, - 242, 242, 242, 242, 242, 242, 242, 242, 259, 259, - 329, 259, 261, 328, 261, 262, 327, 262, 313, 313, - 326, 313, 349, 349, 349, 349, 349, 349, 349, 349, - 356, 356, 325, 356, 375, 375, 375, 375, 375, 375, - 375, 375, 390, 390, 324, 390, 401, 401, 401, 401, - - 401, 401, 401, 401, 404, 404, 404, 404, 404, 404, - 404, 404, 421, 421, 421, 421, 421, 421, 421, 421, - 425, 425, 425, 425, 425, 425, 425, 425, 433, 433, - 433, 433, 433, 433, 433, 433, 436, 436, 436, 436, - 436, 436, 436, 436, 441, 441, 441, 441, 441, 441, - 441, 441, 323, 322, 321, 320, 319, 318, 317, 316, - 315, 314, 312, 258, 256, 310, 309, 308, 307, 444, - 304, 303, 302, 301, 243, 298, 297, 296, 295, 294, - 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - - 273, 272, 271, 270, 269, 268, 267, 266, 265, 264, - 263, 260, 258, 247, 246, 245, 244, 181, 243, 241, - 240, 239, 238, 237, 236, 235, 234, 233, 232, 229, - 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, - 208, 205, 204, 203, 202, 201, 200, 198, 197, 196, - 188, 188, 188, 187, 186, 185, 184, 183, 444, 180, - 179, 178, 177, 174, 173, 172, 171, 170, 169, 168, - 167, 166, 165, 164, 163, 162, 161, 160, 159, 154, - 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, - - 143, 142, 141, 140, 139, 138, 133, 116, 114, 101, - 86, 85, 84, 83, 71, 67, 64, 62, 61, 60, - 47, 444, 3, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444 + 42, 49, 50, 50, 51, 51, 51, 52, 78, 91, + 41, 53, 54, 92, 55, 55, 56, 54, 79, 59, + 59, 59, 433, 68, 57, 45, 65, 76, 66, 57, + 72, 89, 58, 69, 90, 77, 86, 73, 57, 70, + + 80, 81, 74, 57, 93, 87, 98, 94, 75, 101, + 103, 42, 88, 99, 42, 58, 44, 95, 96, 134, + 97, 102, 126, 127, 104, 105, 106, 106, 107, 117, + 51, 51, 51, 156, 180, 118, 118, 108, 108, 108, + 127, 435, 157, 45, 106, 425, 135, 54, 44, 120, + 120, 56, 54, 119, 122, 122, 122, 205, 206, 57, + 433, 174, 109, 303, 57, 110, 111, 121, 153, 175, + 112, 440, 154, 57, 428, 45, 119, 155, 57, 128, + 128, 128, 54, 197, 55, 55, 56, 130, 130, 130, + 121, 51, 51, 51, 57, 54, 134, 56, 56, 56, + + 440, 123, 124, 229, 124, 129, 129, 57, 57, 130, + 130, 130, 427, 230, 401, 123, 124, 106, 106, 181, + 124, 57, 54, 135, 59, 59, 59, 198, 108, 108, + 108, 188, 416, 341, 57, 106, 341, 189, 189, 54, + 415, 120, 120, 56, 374, 126, 127, 374, 57, 414, + 54, 57, 122, 122, 122, 192, 192, 126, 127, 193, + 193, 193, 57, 127, 255, 57, 130, 130, 130, 413, + 256, 256, 193, 193, 193, 127, 57, 194, 402, 194, + 134, 402, 297, 297, 298, 412, 372, 373, 379, 379, + 380, 194, 193, 193, 193, 194, 247, 248, 248, 249, + + 297, 372, 373, 124, 373, 124, 379, 135, 250, 250, + 250, 248, 248, 304, 310, 248, 411, 124, 407, 373, + 401, 124, 250, 250, 250, 406, 396, 424, 406, 248, + 424, 434, 395, 251, 434, 343, 252, 253, 343, 394, + 393, 254, 134, 338, 339, 339, 338, 344, 344, 344, + 309, 309, 309, 392, 391, 340, 340, 340, 309, 309, + 309, 309, 339, 372, 373, 398, 399, 390, 389, 135, + 309, 309, 309, 309, 309, 309, 352, 352, 352, 388, + 387, 373, 310, 399, 352, 352, 352, 352, 384, 383, + 338, 339, 339, 338, 398, 399, 352, 352, 352, 352, + + 352, 352, 370, 370, 370, 338, 339, 339, 338, 339, + 382, 426, 399, 343, 381, 347, 343, 340, 340, 340, + 410, 410, 410, 378, 339, 344, 344, 344, 375, 376, + 376, 375, 377, 339, 339, 375, 376, 376, 375, 377, + 344, 344, 344, 369, 370, 370, 370, 376, 385, 385, + 385, 339, 368, 367, 376, 366, 385, 385, 385, 385, + 398, 399, 403, 404, 404, 403, 376, 376, 385, 385, + 385, 385, 385, 385, 405, 405, 405, 408, 399, 365, + 409, 404, 418, 419, 376, 403, 404, 404, 403, 410, + 410, 410, 364, 403, 404, 404, 403, 420, 420, 420, + + 419, 422, 423, 363, 404, 405, 405, 405, 408, 362, + 361, 409, 404, 408, 418, 419, 409, 425, 360, 423, + 410, 410, 410, 418, 419, 410, 410, 410, 359, 422, + 423, 358, 419, 404, 404, 422, 423, 430, 431, 430, + 431, 419, 430, 431, 420, 420, 420, 423, 436, 436, + 357, 404, 356, 423, 355, 431, 354, 431, 438, 439, + 431, 438, 439, 438, 439, 310, 436, 351, 350, 349, + 348, 303, 347, 345, 342, 337, 439, 336, 335, 439, + 334, 439, 43, 43, 43, 43, 43, 43, 43, 43, + 46, 333, 46, 46, 46, 46, 46, 46, 63, 63, + + 63, 63, 114, 114, 332, 331, 114, 114, 116, 330, + 116, 116, 116, 116, 116, 116, 125, 125, 125, 125, + 125, 125, 125, 125, 131, 329, 131, 133, 133, 133, + 133, 133, 133, 133, 133, 136, 328, 136, 136, 136, + 136, 136, 136, 190, 190, 327, 190, 191, 326, 191, + 241, 241, 241, 241, 241, 241, 241, 241, 258, 258, + 325, 258, 260, 324, 260, 261, 323, 261, 311, 311, + 322, 311, 346, 346, 346, 346, 346, 346, 346, 346, + 353, 353, 321, 353, 371, 371, 371, 371, 371, 371, + 371, 371, 386, 386, 320, 386, 397, 397, 397, 397, + + 397, 397, 397, 397, 400, 400, 400, 400, 400, 400, + 400, 400, 417, 417, 417, 417, 417, 417, 417, 417, + 421, 421, 421, 421, 421, 421, 421, 421, 429, 429, + 429, 429, 429, 429, 429, 429, 432, 432, 432, 432, + 432, 432, 432, 432, 437, 437, 437, 437, 437, 437, + 437, 437, 319, 318, 317, 316, 315, 314, 313, 312, + 310, 257, 255, 308, 307, 306, 305, 440, 302, 301, + 300, 299, 242, 296, 295, 294, 293, 292, 291, 290, + 289, 288, 287, 286, 285, 284, 283, 282, 281, 280, + 279, 278, 277, 276, 275, 274, 273, 272, 271, 270, + + 269, 268, 267, 266, 265, 264, 263, 262, 259, 257, + 246, 245, 244, 243, 180, 242, 240, 239, 238, 237, + 236, 235, 234, 233, 232, 231, 228, 227, 226, 225, + 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, + 214, 213, 212, 211, 210, 209, 208, 207, 204, 203, + 202, 201, 200, 199, 197, 196, 195, 187, 187, 187, + 186, 185, 184, 183, 182, 440, 179, 178, 177, 176, + 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, + 163, 162, 161, 160, 159, 158, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, + + 138, 137, 132, 115, 113, 100, 85, 84, 83, 82, + 71, 67, 64, 62, 61, 60, 47, 440, 3, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440 } ; -static tao_yyconst short int tao_yy_chk[980] = +static tao_yyconst short int tao_yy_chk[976] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -611,105 +608,105 @@ static tao_yyconst short int tao_yy_chk[980] = 1, 1, 1, 1, 1, 1, 2, 5, 8, 10, 5, 10, 10, 10, 11, 11, 11, 12, 26, 34, 2, 12, 13, 34, 13, 13, 13, 14, 26, 14, - 14, 14, 436, 22, 13, 8, 20, 25, 20, 14, - 24, 32, 13, 22, 36, 25, 27, 24, 13, 22, - - 32, 36, 24, 14, 27, 27, 33, 32, 24, 33, - 35, 39, 43, 35, 42, 13, 38, 42, 48, 48, - 48, 108, 83, 35, 35, 39, 35, 83, 38, 40, - 40, 40, 40, 65, 115, 53, 53, 84, 47, 43, - 432, 40, 40, 40, 47, 47, 84, 49, 40, 49, - 49, 49, 50, 53, 50, 50, 50, 101, 108, 49, - 65, 115, 47, 430, 50, 101, 40, 49, 429, 40, - 40, 126, 126, 49, 40, 54, 54, 54, 50, 130, - 130, 130, 128, 128, 55, 47, 55, 55, 55, 126, - 49, 51, 51, 51, 419, 56, 55, 56, 56, 56, - - 128, 51, 51, 138, 51, 134, 415, 56, 57, 57, - 55, 404, 57, 57, 57, 51, 51, 109, 109, 109, - 51, 56, 59, 170, 59, 59, 59, 400, 109, 109, - 109, 119, 134, 170, 59, 109, 398, 119, 119, 121, - 394, 121, 121, 121, 146, 146, 250, 138, 59, 393, - 123, 121, 123, 123, 123, 124, 124, 190, 392, 124, - 124, 124, 123, 190, 190, 121, 131, 131, 131, 193, - 193, 193, 243, 243, 243, 301, 123, 131, 301, 131, - 389, 345, 382, 250, 345, 382, 344, 344, 375, 375, - 243, 131, 194, 194, 194, 131, 187, 187, 187, 187, - - 251, 251, 251, 194, 344, 194, 375, 389, 187, 187, - 187, 251, 251, 251, 390, 187, 385, 194, 251, 385, - 411, 194, 431, 411, 388, 431, 300, 300, 300, 300, - 350, 350, 350, 187, 386, 381, 187, 187, 300, 300, - 300, 187, 261, 303, 372, 300, 303, 371, 350, 369, - 261, 261, 261, 368, 367, 303, 303, 303, 261, 261, - 261, 261, 377, 377, 378, 378, 366, 364, 362, 261, - 261, 261, 261, 261, 261, 261, 311, 311, 311, 358, - 377, 357, 378, 356, 311, 311, 311, 311, 354, 353, - 341, 341, 341, 341, 401, 401, 311, 311, 311, 311, - - 311, 311, 341, 341, 341, 343, 343, 343, 343, 341, - 352, 414, 401, 346, 351, 349, 346, 343, 343, 343, - 414, 414, 414, 348, 343, 346, 346, 346, 347, 347, - 347, 347, 347, 374, 374, 379, 379, 379, 379, 379, - 347, 347, 347, 340, 374, 374, 374, 347, 355, 355, - 355, 374, 339, 338, 379, 337, 355, 355, 355, 355, - 403, 403, 384, 384, 384, 384, 405, 405, 355, 355, - 355, 355, 355, 355, 384, 384, 384, 387, 403, 336, - 387, 384, 406, 406, 405, 407, 407, 407, 407, 387, - 387, 387, 334, 409, 409, 409, 409, 407, 407, 407, - - 406, 410, 410, 331, 407, 409, 409, 409, 412, 330, - 327, 412, 409, 413, 421, 421, 413, 413, 323, 410, - 412, 412, 412, 423, 423, 413, 413, 413, 322, 425, - 425, 321, 421, 424, 424, 427, 427, 428, 428, 433, - 433, 423, 435, 435, 424, 424, 424, 425, 437, 437, - 319, 424, 317, 427, 316, 428, 315, 433, 438, 438, - 435, 441, 441, 443, 443, 314, 437, 313, 310, 309, - 308, 307, 306, 305, 304, 302, 438, 298, 296, 441, - 295, 443, 445, 445, 445, 445, 445, 445, 445, 445, - 446, 293, 446, 446, 446, 446, 446, 446, 447, 447, - - 447, 447, 448, 448, 292, 291, 448, 448, 449, 290, - 449, 449, 449, 449, 449, 449, 450, 450, 450, 450, - 450, 450, 450, 450, 451, 289, 451, 452, 452, 452, - 452, 452, 452, 452, 452, 453, 288, 453, 453, 453, - 453, 453, 453, 454, 454, 286, 454, 455, 285, 455, - 456, 456, 456, 456, 456, 456, 456, 456, 457, 457, - 284, 457, 458, 283, 458, 459, 282, 459, 460, 460, - 281, 460, 461, 461, 461, 461, 461, 461, 461, 461, - 462, 462, 279, 462, 463, 463, 463, 463, 463, 463, - 463, 463, 464, 464, 278, 464, 465, 465, 465, 465, - - 465, 465, 465, 465, 466, 466, 466, 466, 466, 466, - 466, 466, 467, 467, 467, 467, 467, 467, 467, 467, - 468, 468, 468, 468, 468, 468, 468, 468, 469, 469, - 469, 469, 469, 469, 469, 469, 470, 470, 470, 470, - 470, 470, 470, 470, 471, 471, 471, 471, 471, 471, - 471, 471, 276, 272, 271, 270, 269, 268, 267, 265, - 264, 263, 262, 259, 257, 255, 254, 253, 252, 248, - 247, 246, 245, 244, 242, 241, 240, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, - 225, 224, 223, 222, 221, 220, 218, 217, 216, 215, - - 214, 213, 212, 210, 209, 208, 207, 206, 203, 202, - 201, 196, 191, 186, 185, 184, 183, 182, 181, 180, - 179, 178, 177, 176, 175, 174, 173, 172, 171, 169, - 168, 167, 166, 165, 164, 162, 161, 160, 159, 158, - 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, - 147, 145, 144, 143, 142, 140, 139, 137, 136, 133, - 120, 118, 117, 114, 113, 112, 111, 110, 106, 105, - 104, 103, 102, 100, 99, 98, 97, 96, 95, 94, - 93, 92, 91, 90, 89, 88, 87, 86, 85, 82, - 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, - - 71, 70, 69, 68, 67, 66, 64, 46, 41, 37, - 31, 30, 29, 28, 23, 21, 19, 17, 16, 15, - 9, 3, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444 + 14, 14, 432, 22, 13, 8, 20, 25, 20, 14, + 24, 33, 13, 22, 33, 25, 32, 24, 13, 22, + + 27, 27, 24, 14, 35, 32, 36, 35, 24, 38, + 39, 42, 32, 36, 42, 13, 43, 35, 35, 65, + 35, 38, 53, 53, 39, 40, 40, 40, 40, 47, + 48, 48, 48, 83, 107, 47, 47, 40, 40, 40, + 53, 428, 83, 43, 40, 426, 65, 49, 114, 49, + 49, 49, 50, 47, 50, 50, 50, 145, 145, 49, + 425, 100, 40, 249, 50, 40, 40, 49, 82, 100, + 40, 107, 82, 49, 415, 114, 47, 82, 50, 54, + 54, 54, 55, 137, 55, 55, 55, 129, 129, 129, + 49, 51, 51, 51, 55, 56, 133, 56, 56, 56, + + 249, 51, 51, 169, 51, 57, 57, 56, 55, 57, + 57, 57, 411, 169, 400, 51, 51, 108, 108, 108, + 51, 56, 59, 133, 59, 59, 59, 137, 108, 108, + 108, 118, 396, 299, 59, 108, 299, 118, 118, 120, + 394, 120, 120, 120, 342, 125, 125, 342, 59, 390, + 122, 120, 122, 122, 122, 123, 123, 127, 127, 123, + 123, 123, 122, 125, 189, 120, 130, 130, 130, 389, + 189, 189, 192, 192, 192, 127, 122, 130, 378, 130, + 385, 378, 242, 242, 242, 388, 341, 341, 347, 347, + 347, 130, 193, 193, 193, 130, 186, 186, 186, 186, + + 242, 371, 371, 193, 341, 193, 347, 385, 186, 186, + 186, 250, 250, 250, 386, 186, 384, 193, 382, 371, + 377, 193, 250, 250, 250, 381, 368, 407, 381, 250, + 407, 427, 367, 186, 427, 301, 186, 186, 301, 365, + 364, 186, 260, 298, 298, 298, 298, 301, 301, 301, + 260, 260, 260, 363, 362, 298, 298, 298, 260, 260, + 260, 260, 298, 373, 373, 374, 374, 360, 359, 260, + 260, 260, 260, 260, 260, 260, 309, 309, 309, 355, + 354, 373, 353, 374, 309, 309, 309, 309, 351, 350, + 338, 338, 338, 338, 397, 397, 309, 309, 309, 309, + + 309, 309, 338, 338, 338, 340, 340, 340, 340, 338, + 349, 410, 397, 343, 348, 346, 343, 340, 340, 340, + 410, 410, 410, 345, 340, 343, 343, 343, 344, 344, + 344, 344, 344, 370, 370, 375, 375, 375, 375, 375, + 344, 344, 344, 337, 370, 370, 370, 344, 352, 352, + 352, 370, 336, 335, 375, 334, 352, 352, 352, 352, + 399, 399, 380, 380, 380, 380, 401, 401, 352, 352, + 352, 352, 352, 352, 380, 380, 380, 383, 399, 333, + 383, 380, 402, 402, 401, 403, 403, 403, 403, 383, + 383, 383, 331, 405, 405, 405, 405, 403, 403, 403, + + 402, 406, 406, 328, 403, 405, 405, 405, 408, 327, + 324, 408, 405, 409, 417, 417, 409, 409, 320, 406, + 408, 408, 408, 419, 419, 409, 409, 409, 319, 421, + 421, 317, 417, 420, 420, 423, 423, 424, 424, 429, + 429, 419, 431, 431, 420, 420, 420, 421, 433, 433, + 315, 420, 314, 423, 313, 424, 312, 429, 434, 434, + 431, 437, 437, 439, 439, 311, 433, 308, 307, 306, + 305, 304, 303, 302, 300, 296, 434, 294, 293, 437, + 291, 439, 441, 441, 441, 441, 441, 441, 441, 441, + 442, 290, 442, 442, 442, 442, 442, 442, 443, 443, + + 443, 443, 444, 444, 289, 288, 444, 444, 445, 287, + 445, 445, 445, 445, 445, 445, 446, 446, 446, 446, + 446, 446, 446, 446, 447, 286, 447, 448, 448, 448, + 448, 448, 448, 448, 448, 449, 284, 449, 449, 449, + 449, 449, 449, 450, 450, 283, 450, 451, 282, 451, + 452, 452, 452, 452, 452, 452, 452, 452, 453, 453, + 281, 453, 454, 280, 454, 455, 279, 455, 456, 456, + 277, 456, 457, 457, 457, 457, 457, 457, 457, 457, + 458, 458, 276, 458, 459, 459, 459, 459, 459, 459, + 459, 459, 460, 460, 274, 460, 461, 461, 461, 461, + + 461, 461, 461, 461, 462, 462, 462, 462, 462, 462, + 462, 462, 463, 463, 463, 463, 463, 463, 463, 463, + 464, 464, 464, 464, 464, 464, 464, 464, 465, 465, + 465, 465, 465, 465, 465, 465, 466, 466, 466, 466, + 466, 466, 466, 466, 467, 467, 467, 467, 467, 467, + 467, 467, 270, 269, 268, 267, 266, 264, 263, 262, + 261, 258, 256, 254, 253, 252, 251, 247, 246, 245, + 244, 243, 241, 240, 239, 237, 236, 235, 234, 233, + 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, + 222, 221, 220, 219, 217, 216, 215, 213, 212, 211, + + 209, 208, 207, 206, 205, 202, 201, 200, 195, 190, + 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, + 175, 174, 173, 172, 171, 170, 168, 167, 166, 165, + 164, 163, 161, 160, 159, 158, 157, 156, 155, 154, + 153, 152, 151, 150, 149, 148, 147, 146, 144, 143, + 142, 141, 139, 138, 136, 135, 132, 119, 117, 116, + 113, 112, 111, 110, 109, 105, 104, 103, 102, 101, + 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, + 89, 88, 87, 86, 85, 84, 81, 80, 79, 78, + 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, + + 67, 66, 64, 46, 41, 37, 31, 30, 29, 28, + 23, 21, 19, 17, 16, 15, 9, 3, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440 } ; static tao_yy_state_type tao_yy_last_accepting_state; @@ -731,7 +728,7 @@ char *tao_yytext_ptr; #line 1 "fe/idl.ll" #define INITIAL 0 #line 2 "fe/idl.ll" -/* $Id: idl.ll,v 1.54 2001/07/02 18:46:02 parsons Exp $ +/* $Id: idl.ll,v 1.53 2001/05/24 02:50:39 parsons Exp $ COPYRIGHT @@ -1055,13 +1052,13 @@ tao_yy_match: while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 445 ) + if ( tao_yy_current_state >= 441 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; ++tao_yy_cp; } - while ( tao_yy_base[tao_yy_current_state] != 923 ); + while ( tao_yy_base[tao_yy_current_state] != 919 ); tao_yy_find_action: tao_yy_act = tao_yy_accept[tao_yy_current_state]; @@ -1260,7 +1257,7 @@ return scan_obv_token (IDL_CUSTOM); case 35: TAO_YY_RULE_SETUP #line 162 "fe/idl.ll" -return scan_obv_token (IDL_FACTORY); +return scan_obv_token (IDL_INIT); TAO_YY_BREAK case 36: TAO_YY_RULE_SETUP @@ -1899,7 +1896,7 @@ static tao_yy_state_type tao_yy_get_previous_state() while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 445 ) + if ( tao_yy_current_state >= 441 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; @@ -1934,11 +1931,11 @@ tao_yy_state_type tao_yy_current_state; while ( tao_yy_chk[tao_yy_base[tao_yy_current_state] + tao_yy_c] != tao_yy_current_state ) { tao_yy_current_state = (int) tao_yy_def[tao_yy_current_state]; - if ( tao_yy_current_state >= 445 ) + if ( tao_yy_current_state >= 441 ) tao_yy_c = tao_yy_meta[(unsigned int) tao_yy_c]; } tao_yy_current_state = tao_yy_nxt[tao_yy_base[tao_yy_current_state] + (unsigned int) tao_yy_c]; - tao_yy_is_jam = (tao_yy_current_state == 444); + tao_yy_is_jam = (tao_yy_current_state == 440); return tao_yy_is_jam ? 0 : tao_yy_current_state; } diff --git a/TAO/TAO_IDL/fe/lex.yy.cpp.diff b/TAO/TAO_IDL/fe/lex.yy.cpp.diff index b32aec91961..f0058382ca5 100644 --- a/TAO/TAO_IDL/fe/lex.yy.cpp.diff +++ b/TAO/TAO_IDL/fe/lex.yy.cpp.diff @@ -9,7 +9,7 @@ #endif #define TAO_YY_RULE_SETUP \ -@@ -998,7 +998,7 @@ +@@ -995,7 +995,7 @@ TAO_YY_DECL { register tao_yy_state_type tao_yy_current_state; @@ -18,7 +18,7 @@ register int tao_yy_act; #line 126 "fe/idl.ll" -@@ -1503,7 +1503,7 @@ +@@ -1500,7 +1500,7 @@ idl_global->set_lineno(idl_global->lineno() + 1); idl_store_pragma(ace_tao_yytext); } @@ -27,7 +27,7 @@ case 69: #line 284 "fe/idl.ll" case 70: -@@ -1512,7 +1512,7 @@ +@@ -1509,7 +1509,7 @@ {/* ignore file */ idl_global->set_lineno(idl_global->lineno() + 1); } @@ -36,7 +36,7 @@ case 71: #line 288 "fe/idl.ll" case 72: -@@ -1521,7 +1521,7 @@ +@@ -1518,7 +1518,7 @@ { idl_parse_line_and_file(ace_tao_yytext); } @@ -45,7 +45,7 @@ case 72: case 73: #line 292 "fe/idl.ll" case 74: -@@ -1530,7 +1530,7 @@ +@@ -1527,7 +1527,7 @@ { idl_parse_line_and_file(ace_tao_yytext); } @@ -54,7 +54,7 @@ case 72: case 75: #line 296 "fe/idl.ll" case 76: -@@ -1539,7 +1539,7 @@ +@@ -1536,7 +1536,7 @@ { idl_parse_line_and_file(ace_tao_yytext); } @@ -63,7 +63,7 @@ case 72: case 77: #line 300 "fe/idl.ll" case 78: -@@ -1548,7 +1548,7 @@ +@@ -1545,7 +1545,7 @@ { idl_parse_line_and_file(ace_tao_yytext); } @@ -72,7 +72,7 @@ case 72: case 79: #line 304 "fe/idl.ll" case 80: -@@ -1557,7 +1557,7 @@ +@@ -1554,7 +1554,7 @@ { /* store cpp ident */ idl_global->ident_string (ace_tao_yytext); @@ -83,7 +83,7 @@ case 72: case 81: TAO_YY_RULE_SETUP #line 308 "fe/idl.ll" -@@ -1566,7 +1566,7 @@ +@@ -1563,7 +1563,7 @@ /* ignore comments */ idl_global->set_lineno(idl_global->lineno() + 1); } @@ -92,7 +92,7 @@ case 72: case 82: TAO_YY_RULE_SETUP #line 312 "fe/idl.ll" -@@ -1584,19 +1584,19 @@ +@@ -1581,19 +1581,19 @@ } } } @@ -115,7 +115,7 @@ case 72: case 85: TAO_YY_RULE_SETUP #line 330 "fe/idl.ll" -@@ -1606,7 +1606,7 @@ +@@ -1603,7 +1603,7 @@ TAO_YY_RULE_SETUP #line 332 "fe/idl.ll" TAO_YY_ECHO; diff --git a/TAO/TAO_IDL/fe/y.tab.cpp b/TAO/TAO_IDL/fe/y.tab.cpp index ac7eb771c79..7b9bc793da8 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp +++ b/TAO/TAO_IDL/fe/y.tab.cpp @@ -93,7 +93,7 @@ typedef union { #define IDL_LOCAL 294 #define IDL_ABSTRACT 295 #define IDL_CUSTOM 296 -#define IDL_FACTORY 297 +#define IDL_INIT 297 #define IDL_PRIVATE 298 #define IDL_PUBLIC 299 #define IDL_SUPPORTS 300 @@ -133,20 +133,20 @@ short tao_yylhs[] = { -1, 3, 29, 136, 30, 30, 63, 63, 31, 137, 32, 32, 64, 65, 51, 51, 57, 57, 57, 58, 58, 58, 54, 54, 54, 56, 52, 52, 60, 53, 55, - 138, 139, 141, 142, 7, 140, 144, 144, 145, 143, - 146, 147, 115, 148, 115, 149, 150, 151, 152, 153, - 154, 156, 157, 10, 9, 9, 9, 9, 9, 9, - 155, 159, 159, 160, 161, 158, 162, 158, 27, 28, - 28, 163, 48, 164, 165, 48, 166, 49, 167, 168, - 170, 171, 8, 169, 174, 173, 173, 172, 175, 176, - 5, 5, 177, 178, 13, 180, 181, 6, 6, 179, - 183, 184, 14, 14, 182, 185, 11, 25, 26, 26, - 186, 187, 47, 188, 189, 121, 66, 66, 190, 191, - 192, 193, 77, 194, 196, 197, 198, 123, 62, 62, - 62, 12, 12, 114, 199, 195, 201, 195, 200, 204, - 203, 203, 205, 206, 202, 15, 15, 15, 15, 61, - 61, 61, 207, 208, 23, 23, 209, 210, 17, 17, - 18, 211, 19, 19, + 138, 139, 141, 142, 7, 140, 140, 145, 140, 144, + 144, 146, 144, 147, 143, 148, 149, 115, 150, 115, + 151, 152, 153, 154, 155, 156, 158, 159, 10, 9, + 9, 9, 9, 9, 9, 157, 161, 161, 162, 163, + 160, 164, 160, 27, 28, 28, 165, 48, 166, 167, + 48, 168, 49, 169, 170, 172, 173, 8, 171, 176, + 175, 175, 174, 177, 178, 5, 5, 179, 180, 13, + 182, 183, 6, 6, 181, 185, 186, 14, 14, 184, + 187, 11, 25, 26, 26, 188, 189, 47, 190, 191, + 121, 66, 66, 192, 193, 194, 195, 77, 196, 198, + 199, 200, 123, 62, 62, 62, 12, 12, 114, 201, + 197, 203, 197, 202, 206, 205, 205, 207, 208, 204, + 15, 15, 15, 15, 61, 61, 61, 209, 210, 23, + 23, 211, 212, 17, 17, 18, 213, 19, 19, }; short tao_yylen[] = { 2, 1, 2, 0, 0, 3, 0, 3, 0, 3, 0, @@ -169,407 +169,410 @@ short tao_yylen[] = { 2, 1, 2, 0, 4, 0, 1, 1, 2, 0, 4, 0, 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 9, 2, 2, 0, 0, 2, - 0, 0, 5, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 17, 1, 1, 1, 1, 1, 1, - 2, 2, 0, 0, 0, 5, 0, 3, 2, 2, - 0, 0, 3, 0, 0, 5, 0, 3, 0, 0, - 0, 0, 9, 2, 0, 4, 0, 1, 0, 0, - 6, 2, 0, 0, 5, 0, 0, 6, 1, 1, - 0, 0, 6, 1, 1, 0, 3, 2, 2, 0, - 0, 0, 5, 0, 0, 6, 1, 0, 0, 0, - 0, 0, 9, 0, 0, 0, 0, 10, 1, 1, - 0, 1, 1, 3, 0, 3, 0, 4, 2, 0, - 4, 0, 0, 0, 5, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 6, 0, 0, 0, 6, 0, - 2, 0, 4, 0, + 0, 0, 0, 0, 9, 2, 0, 0, 3, 2, + 0, 0, 3, 0, 2, 0, 0, 5, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 0, 17, 1, + 1, 1, 1, 1, 1, 2, 2, 0, 0, 0, + 5, 0, 3, 2, 2, 0, 0, 3, 0, 0, + 5, 0, 3, 0, 0, 0, 0, 9, 2, 0, + 4, 0, 1, 0, 0, 6, 2, 0, 0, 5, + 0, 0, 6, 1, 1, 0, 0, 6, 1, 1, + 0, 3, 2, 2, 0, 0, 0, 5, 0, 0, + 6, 1, 0, 0, 0, 0, 0, 9, 0, 0, + 0, 0, 10, 1, 1, 0, 1, 1, 1, 0, + 3, 0, 4, 2, 0, 4, 0, 0, 0, 5, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 6, + 0, 0, 0, 6, 0, 2, 0, 4, 0, }; short tao_yydefred[] = { 3, - 0, 0, 16, 97, 18, 29, 146, 201, 216, 249, - 289, 0, 0, 0, 0, 52, 148, 150, 149, 25, + 0, 0, 16, 97, 18, 29, 146, 201, 221, 254, + 294, 0, 0, 0, 0, 52, 148, 150, 149, 25, 43, 0, 0, 4, 2, 6, 8, 10, 12, 14, 23, 24, 37, 38, 39, 40, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 151, 182, 0, 47, 0, 0, 0, 41, 0, 0, 0, 34, 31, 0, 188, 0, 192, 193, 196, 197, 198, 199, 195, - 200, 263, 270, 275, 54, 89, 60, 154, 155, 157, + 200, 268, 275, 280, 54, 89, 60, 154, 155, 157, 166, 167, 169, 171, 170, 0, 168, 0, 159, 161, 162, 160, 165, 164, 184, 185, 156, 163, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 17, 108, 109, 0, 98, 102, 103, 105, 106, 107, 104, 19, - 30, 152, 147, 202, 217, 250, 290, 32, 0, 33, + 30, 152, 147, 202, 222, 255, 295, 32, 0, 33, 53, 26, 44, 0, 187, 194, 0, 191, 0, 0, - 259, 262, 91, 0, 266, 271, 5, 7, 9, 11, + 264, 267, 91, 0, 271, 276, 5, 7, 9, 11, 13, 15, 0, 0, 0, 0, 0, 0, 0, 48, - 71, 62, 0, 35, 190, 264, 90, 0, 0, 0, + 71, 62, 0, 35, 190, 269, 90, 0, 0, 0, 51, 0, 0, 99, 20, 183, 153, 175, 176, 177, - 0, 203, 218, 251, 291, 71, 0, 0, 0, 0, + 0, 203, 223, 256, 296, 71, 0, 0, 0, 0, 136, 137, 138, 140, 142, 143, 144, 141, 139, 0, 0, 0, 0, 0, 145, 0, 0, 0, 0, 0, - 0, 125, 129, 134, 260, 92, 0, 267, 272, 0, - 3, 0, 0, 209, 0, 0, 208, 0, 82, 287, - 299, 300, 0, 0, 72, 74, 76, 0, 70, 78, - 80, 0, 68, 66, 0, 61, 63, 64, 65, 85, - 265, 130, 131, 132, 0, 0, 0, 0, 0, 0, + 0, 125, 129, 134, 265, 92, 0, 272, 277, 0, + 3, 0, 0, 0, 0, 0, 0, 0, 82, 292, + 304, 305, 0, 0, 72, 74, 76, 0, 70, 78, + 80, 309, 68, 66, 0, 61, 63, 64, 65, 85, + 270, 130, 131, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, - 173, 281, 277, 280, 204, 208, 0, 219, 258, 252, - 257, 0, 0, 0, 303, 317, 294, 318, 302, 0, - 316, 284, 0, 0, 0, 28, 0, 0, 0, 0, - 0, 46, 0, 135, 0, 0, 0, 0, 0, 0, - 0, 126, 127, 128, 261, 268, 273, 0, 0, 0, - 0, 0, 0, 0, 214, 211, 210, 0, 0, 0, - 207, 0, 50, 83, 0, 0, 73, 75, 77, 79, - 81, 0, 304, 69, 67, 0, 101, 111, 22, 174, - 282, 279, 205, 0, 0, 0, 229, 220, 0, 225, - 226, 228, 227, 253, 255, 293, 295, 285, 0, 0, - 0, 215, 212, 0, 0, 0, 0, 306, 320, 321, - 322, 313, 0, 312, 283, 0, 221, 256, 296, 286, - 181, 0, 308, 0, 213, 0, 0, 0, 314, 310, - 222, 323, 297, 179, 0, 0, 0, 0, 0, 0, - 315, 311, 237, 244, 242, 234, 241, 223, 233, 324, - 327, 298, 180, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 238, 245, 243, 247, 235, 240, 224, 232, - 0, 328, 0, 0, 0, 325, 0, 246, 248, 236, - 334, 0, 0, 329, 332, 0, 333, + 173, 286, 282, 285, 208, 204, 0, 0, 224, 263, + 257, 262, 212, 0, 0, 0, 308, 322, 299, 323, + 307, 0, 321, 289, 0, 0, 0, 28, 0, 0, + 0, 0, 46, 0, 135, 0, 0, 0, 0, 0, + 0, 0, 126, 127, 128, 266, 273, 278, 0, 0, + 0, 0, 0, 0, 0, 0, 219, 216, 215, 0, + 0, 0, 0, 210, 0, 50, 83, 0, 0, 73, + 75, 77, 79, 81, 69, 67, 0, 101, 111, 22, + 174, 287, 284, 209, 205, 0, 0, 0, 234, 225, + 0, 230, 231, 233, 232, 258, 260, 213, 298, 300, + 290, 0, 220, 217, 0, 0, 0, 0, 288, 0, + 226, 261, 0, 301, 291, 181, 218, 0, 0, 0, + 0, 0, 227, 311, 325, 326, 327, 318, 0, 317, + 328, 302, 179, 0, 0, 313, 0, 0, 0, 0, + 242, 249, 247, 239, 246, 228, 238, 319, 315, 329, + 332, 303, 180, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 243, 250, 248, 252, 240, 245, + 229, 237, 320, 316, 0, 333, 0, 0, 0, 330, + 0, 251, 253, 241, 339, 0, 0, 334, 337, 0, + 338, }; short tao_yydgoto[] = { 1, - 326, 78, 79, 80, 81, 82, 83, 84, 358, 85, - 176, 287, 86, 87, 289, 204, 422, 452, 453, 164, - 189, 60, 403, 171, 273, 322, 416, 428, 177, 222, - 390, 398, 20, 21, 347, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 274, 417, 437, 113, + 328, 78, 79, 80, 81, 82, 83, 84, 360, 85, + 176, 289, 86, 87, 291, 204, 422, 456, 457, 164, + 189, 60, 402, 171, 273, 323, 414, 428, 177, 222, + 385, 392, 20, 21, 348, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 274, 415, 439, 113, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 382, 233, 178, 179, 180, 234, 99, 22, 23, 100, + 398, 233, 178, 179, 180, 234, 99, 22, 23, 100, 235, 2, 25, 103, 236, 104, 237, 105, 28, 106, - 29, 107, 30, 108, 38, 40, 154, 221, 319, 31, + 29, 107, 30, 108, 38, 40, 154, 221, 320, 31, 32, 57, 187, 161, 238, 41, 134, 33, 34, 35, - 36, 37, 58, 188, 162, 245, 129, 186, 283, 56, - 246, 247, 239, 249, 327, 301, 300, 293, 294, 295, - 240, 297, 241, 298, 284, 303, 140, 169, 39, 153, - 220, 318, 123, 42, 155, 320, 410, 43, 156, 275, - 224, 323, 331, 282, 277, 355, 386, 354, 44, 157, - 225, 328, 374, 396, 418, 407, 429, 419, 430, 427, - 445, 424, 426, 425, 443, 444, 45, 158, 280, 226, - 329, 281, 330, 375, 168, 266, 139, 190, 101, 172, - 267, 102, 173, 268, 223, 321, 371, 336, 377, 46, - 159, 227, 332, 335, 343, 376, 397, 409, 369, 383, - 370, 384, 394, 406, 392, 405, 408, 431, 432, 447, - 456, + 36, 37, 58, 188, 162, 245, 129, 186, 285, 56, + 246, 247, 239, 249, 329, 302, 301, 295, 296, 297, + 240, 299, 241, 300, 286, 304, 140, 169, 39, 153, + 220, 319, 123, 42, 155, 321, 410, 43, 156, 276, + 224, 325, 334, 284, 324, 333, 278, 357, 380, 356, + 44, 157, 225, 330, 375, 388, 416, 404, 429, 417, + 430, 427, 449, 424, 426, 425, 447, 448, 45, 158, + 281, 226, 331, 282, 332, 376, 168, 266, 139, 190, + 101, 172, 267, 102, 173, 268, 223, 322, 372, 339, + 378, 46, 159, 227, 335, 338, 384, 377, 391, 409, + 389, 399, 390, 400, 407, 432, 405, 431, 408, 433, + 434, 451, 460, }; short tao_yysindex[] = { 0, - 0, 590, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -208, -197, -175, -224, 0, 0, 0, 0, 0, - 0, 26, 430, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 49, 566, -146, - -208, 448, -208, -208, -208, -208, 0, 0, 0, 26, - 0, 26, -186, -186, 0, -208, -5, 17, 0, 0, - -209, 0, -138, 0, 0, 0, 0, 0, 0, 0, + 0, 609, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -220, -219, -166, -252, 0, 0, 0, 0, 0, + 0, -4, 437, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 39, 585, -194, + -220, 463, -220, -220, -220, -220, 0, 0, 0, -4, + 0, -4, -214, -214, 0, -220, -28, 2, 0, 0, + -138, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 59, 0, -177, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, - 77, 87, 99, 105, 108, 113, 115, 134, 0, 0, - 0, -177, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 73, 0, - 0, 0, 0, -221, 0, 0, -59, 0, 149, -208, - 0, 0, 0, -88, 0, 0, 0, 0, 0, 0, - 0, 0, -208, 117, -208, 125, -51, 126, 127, 0, - 0, 0, -177, 0, 0, 0, 0, 12, -208, -221, - 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 648, 617, 207, 357, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 31, 31, 12, -177, 0, 130, 162, 220, -131, 132, - 129, 0, 0, 0, 0, 0, -177, 0, 0, 198, - 0, 221, 173, 0, 226, 16, 0, 648, 0, 0, - 0, 0, 515, -16, 0, 0, 0, 145, 0, 0, - 0, 18, 0, 0, 146, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 235, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 227, 229, 238, 0, 590, - 0, 0, 0, 0, 0, 0, 381, 0, 0, 0, - 0, 0, 152, 223, 0, 0, 0, 0, 0, -177, - 0, 0, 251, 253, 264, 0, 265, 268, 288, 381, - 381, 0, -221, 0, 162, 220, -131, 132, 132, 129, - 129, 0, 0, 0, 0, 0, 0, 12, 204, -208, - 12, 173, 205, 0, 0, 0, 0, 157, 206, 289, - 0, 217, 0, 0, 89, 548, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -177, 0, 0, 0, 0, - 0, 0, 0, 292, -208, 85, 0, 0, -177, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 311, -74, - 261, 0, 0, 314, 16, 288, -208, 0, 0, 0, - 0, 0, 315, 0, 0, 300, 0, 0, 0, 0, - 0, 548, 0, 316, 0, 239, 70, 319, 0, 0, - 0, 0, 0, 0, -208, -74, -188, 324, 74, -208, + 0, 0, 0, 0, 0, 20, 0, -199, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -4, 0, + 77, 89, 100, 113, 127, 129, 135, 138, 0, 0, + 0, -199, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, + 0, 0, 0, -222, 0, 0, -40, 0, 171, -220, + 0, 0, 0, -67, 0, 0, 0, 0, 0, 0, + 0, 0, -220, 117, -220, 120, -39, 134, 136, 0, + 0, 0, -199, 0, 0, 0, 0, 16, -220, -222, + 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 651, 601, 227, 512, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, + 33, 33, 16, -199, 0, 163, 194, 253, -86, 35, + 168, 0, 0, 0, 0, 0, -199, 0, 0, 228, + 0, 250, 205, 41, 270, 54, 56, 651, 0, 0, + 0, 0, 536, 29, 0, 0, 0, 189, 0, 0, + 0, 0, 0, 0, 190, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 277, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 269, 271, 273, 0, 609, + 0, 0, 0, 0, 0, 0, 56, 413, 0, 0, + 0, 0, 0, 0, 207, 289, 0, 0, 0, 0, + 0, -199, 0, 0, 293, 294, 295, 0, 296, 297, + 413, 413, 0, -222, 0, 194, 253, -86, 35, 35, + 168, 168, 0, 0, 0, 0, 0, 0, 16, 233, + -220, 16, 205, 300, 235, 0, 0, 0, 0, 153, + 236, 320, 308, 0, 240, 0, 0, 111, 562, 0, + 0, 0, 0, 0, 0, 0, -199, 0, 0, 0, + 0, 0, 0, 0, 0, 315, -220, 116, 0, 0, + -199, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 282, 0, 0, 336, 54, 339, -220, 0, 321, + 0, 0, 0, 0, 0, 0, 0, 259, 343, -60, + 94, 342, 0, 0, 0, 0, 0, 0, 348, 0, + 0, 0, 0, -92, 562, 0, 346, 351, 101, -220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 308, 12, 313, 448, -94, 244, -188, - -221, 336, 0, 0, 0, 0, 0, 0, 0, 0, - 337, 0, 321, -208, 318, 0, 94, 0, 0, 0, - 0, 359, 360, 0, 0, 98, 0, + 0, 0, 0, 333, 16, 337, 463, -47, 272, -92, + -220, -60, -222, 354, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 355, 0, 344, -220, 345, 0, + 102, 0, 0, 0, 0, 367, 365, 0, 0, 107, + 0, }; short tao_yyrindex[] = { 0, - 0, 407, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -1, -13, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 0, 42, 3, -43, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -98, 0, - 54, 91, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 151, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, + 0, 414, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 23, 0, 0, 0, 0, 0, 228, 277, 13, 0, + 0, -1, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, -19, 0, 120, 470, 537, 464, 111, - 38, 0, 0, 0, 0, 0, 293, 0, 0, 0, - 0, 352, 0, 0, 0, 0, 0, 305, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, + 0, 48, 81, -46, 0, 0, 0, 0, 0, 0, + -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -93, 0, + 9, 59, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 0, 301, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 290, + 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 118, 0, 0, 0, 0, 0, 0, 0, 160, + 162, 0, 0, 0, 0, 0, 278, 306, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 549, 539, 492, 148, 159, 61, - 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 0, 179, 0, 0, 0, 0, 0, 304, + 0, 0, 0, -19, 0, 155, 179, 550, 125, 51, + 38, 0, 0, 0, 0, 0, 302, 0, 0, 0, + 0, 359, 0, 226, 0, 0, 251, 335, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, -28, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 377, 0, 0, 390, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 303, + 0, 0, 0, 0, 0, 0, 251, 0, 0, 0, + 0, 0, 0, 177, 0, 0, 0, 0, 0, 0, + 0, 173, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 574, 569, 493, 76, 88, + 61, 115, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 49, 0, 0, 202, 0, 0, 0, 0, + 0, 307, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 394, 0, 0, + 396, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 393, 0, 0, -48, 378, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 379, 0, + 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, + -48, 379, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 411, 0, 398, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 497, 0, 329, + 0, 0, 0, 0, 0, 0, 0, 486, 0, 352, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 398, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 420, 0, 0, 0, + 0, }; short tao_yygindex[] = { 0, - -21, 250, 0, 0, 0, -35, 35, 4, 0, 39, - 0, 0, 0, -34, -306, -22, 0, 0, 0, 30, - 0, 57, 0, 0, 0, 0, 0, 0, 107, 0, - 0, 0, 0, 449, 0, -189, 0, 208, 209, 210, - -76, -42, -26, 45, 0, -113, 143, 41, 0, 0, - -32, -31, -30, 433, 0, 434, 0, 0, -191, -29, - 0, 0, -254, -9, 0, 0, 0, 215, 216, -12, - 10, 254, 0, 0, 14, 0, 25, 0, 0, 0, + -21, 292, 0, 0, 0, -35, 14, 4, 0, 36, + 0, 0, 0, -34, -314, -22, 0, 0, 0, 52, + 0, 34, 0, 0, 0, 0, 0, 0, 105, 0, + 0, 0, 0, 470, 0, -167, 0, 230, 244, 248, + 10, 6, -18, 50, 0, -127, 184, 82, 0, 0, + -32, -31, -30, 472, 0, 487, 0, 0, -178, -29, + 0, 0, -255, -9, 0, 0, 0, 262, 263, -12, + 11, 288, 0, 0, 13, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 291, 0, 0, 0, 0, 0, 0, 0, - 0, 459, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 294, 0, -67, 0, 0, 0, 0, 0, + 0, 0, 347, 0, 0, 0, 0, 0, 0, 0, + 0, 517, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 349, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 252, 202, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, + 0, 0, 314, 276, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, - 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, - 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 126, 0, 0, 0, 0, 0, 0, + 0, 0, 0, }; -#define TAO_YYTABLESIZE 941 +#define TAO_YYTABLESIZE 944 short tao_yytable[] = { 49, 88, 77, 48, 110, 111, 18, 114, 115, 116, 119, - 326, 24, 305, 255, 55, 26, 112, 133, 133, 88, - 122, 133, 133, 133, 36, 133, 27, 133, 121, 368, - 124, 125, 126, 127, 87, 47, 17, 87, 133, 133, - 19, 291, 133, 131, 55, 59, 278, 86, 47, 278, - 86, 203, 135, 84, 200, 136, 201, 94, 218, 219, - 55, 58, 6, 182, 278, 350, 182, 413, 189, 95, - 203, 189, 186, 133, 133, 122, 158, 16, 122, 55, - 122, 182, 122, 59, 6, 399, 189, 186, 76, 189, - 186, 158, 414, 415, 158, 122, 122, 269, 123, 122, - 96, 123, 141, 123, 133, 123, 128, 109, 130, 55, - 120, 163, 269, 276, 75, 269, 87, 132, 123, 123, - 142, 36, 123, 137, 138, 55, 16, 167, 348, 86, - 122, 122, 143, 36, 274, 84, 145, 202, 124, 133, - 174, 124, 181, 124, 291, 124, 146, 217, 119, 274, - 411, 119, 274, 123, 123, 144, 216, 147, 124, 124, - 112, 122, 124, 148, 36, 265, 149, 88, 119, 119, - 263, 150, 119, 151, 261, 264, 262, 112, 112, 259, - 260, 112, 308, 309, 123, 120, 414, 415, 120, 449, - 18, 18, 152, 124, 124, 160, 121, 286, 288, 121, - 291, 36, 165, 119, 119, 120, 120, 351, 166, 120, - 290, 170, 112, 379, 380, 381, 121, 121, 310, 311, - 121, 17, 17, 183, 124, 19, 19, 50, 52, 53, - 54, 18, 344, 345, 119, 434, 312, 313, 314, 175, - 120, 120, 292, 326, 252, 253, 254, 182, 184, 185, - 250, 121, 121, 256, 88, 257, 55, 258, 269, 307, - 307, 307, 17, 272, 271, 278, 19, 292, 47, 296, - 302, 120, 279, 18, 299, 304, 333, 88, 88, 24, - 346, 334, 121, 26, 189, 186, 55, 47, 315, 158, - 316, 133, 133, 87, 27, 360, 361, 362, 363, 317, - 286, 288, 55, 206, 17, 359, 86, 181, 19, 337, - 269, 338, 84, 290, 191, 192, 193, 194, 195, 196, - 197, 76, 339, 340, 198, 199, 341, 342, 349, 353, - 364, 357, 365, 191, 192, 193, 194, 195, 196, 197, - 76, 366, 181, 198, 199, 367, 135, 274, 122, 122, - 372, 378, 27, 385, 387, 393, 286, 288, 395, 400, - 402, 401, 404, 420, 49, 421, 433, 391, 439, 290, - 435, 123, 123, 209, 209, 442, 450, 446, 448, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 181, 209, 209, 209, 209, 49, 451, 454, - 423, 45, 457, 455, 88, 436, 1, 110, 163, 57, - 172, 124, 124, 47, 21, 56, 319, 186, 356, 62, - 63, 119, 119, 66, 67, 68, 69, 209, 254, 49, - 230, 181, 10, 309, 209, 209, 178, 330, 331, 251, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 231, 209, 209, 209, 209, 120, 120, - 441, 373, 51, 305, 352, 306, 76, 307, 438, 121, - 121, 117, 118, 55, 270, 276, 228, 324, 388, 440, - 412, 248, 0, 0, 301, 389, 0, 0, 209, 301, - 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, - 0, 117, 0, 0, 117, 301, 301, 0, 0, 0, - 113, 288, 0, 0, 301, 0, 0, 0, 0, 0, - 0, 117, 117, 0, 0, 117, 0, 113, 113, 118, - 0, 113, 118, 301, 0, 0, 0, 301, 301, 301, - 301, 301, 301, 301, 301, 301, 301, 301, 301, 118, - 118, 0, 0, 118, 301, 301, 117, 117, 0, 0, - 288, 301, 113, 301, 0, 0, 301, 301, 301, 301, - 301, 301, 301, 301, 301, 301, 301, 115, 0, 116, - 0, 0, 301, 301, 118, 118, 301, 117, 288, 114, - 0, 301, 0, 113, 115, 115, 116, 116, 115, 0, - 116, 0, 0, 0, 0, 0, 114, 114, 0, 0, - 114, 0, 0, 47, 301, 118, 0, 0, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 115, - 115, 116, 116, 72, 73, 74, 325, 47, 0, 0, - 0, 114, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 8, 9, 0, 10, 72, 73, 74, - 115, 0, 116, 0, 0, 0, 76, 0, 0, 0, - 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 47, 0, 0, 0, - 76, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 8, 9, 47, 10, 72, 73, 74, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 8, 9, 0, 10, 72, 73, 74, 0, 0, 0, - 75, 0, 0, 0, 0, 0, 0, 0, 0, 76, + 331, 55, 24, 310, 26, 17, 112, 133, 133, 88, + 122, 133, 133, 133, 371, 133, 27, 133, 121, 36, + 124, 125, 126, 127, 47, 255, 47, 19, 133, 133, + 6, 186, 133, 131, 218, 219, 158, 87, 189, 16, + 87, 189, 274, 59, 293, 203, 186, 94, 200, 186, + 201, 158, 120, 141, 158, 351, 189, 274, 86, 189, + 274, 86, 203, 133, 133, 122, 55, 261, 122, 262, + 122, 142, 122, 128, 84, 130, 75, 76, 119, 283, + 418, 119, 283, 6, 132, 122, 122, 109, 123, 122, + 95, 123, 279, 123, 133, 123, 96, 283, 119, 119, + 143, 163, 119, 120, 55, 59, 120, 279, 123, 123, + 279, 36, 123, 135, 133, 121, 136, 167, 121, 87, + 122, 122, 144, 120, 120, 16, 145, 120, 55, 58, + 174, 202, 181, 119, 119, 121, 121, 217, 146, 121, + 86, 349, 124, 123, 123, 124, 216, 124, 147, 124, + 293, 122, 117, 411, 36, 117, 84, 88, 120, 120, + 36, 148, 124, 124, 119, 443, 124, 137, 138, 55, + 121, 121, 117, 117, 123, 149, 117, 150, 412, 413, + 18, 18, 453, 151, 352, 112, 152, 288, 290, 120, + 17, 17, 182, 55, 265, 182, 36, 124, 124, 263, + 292, 121, 112, 112, 264, 160, 112, 117, 117, 113, + 182, 165, 19, 19, 259, 260, 293, 395, 396, 397, + 166, 18, 170, 412, 413, 183, 113, 113, 124, 175, + 113, 17, 182, 331, 313, 314, 315, 112, 117, 252, + 253, 254, 281, 55, 186, 88, 184, 436, 185, 158, + 312, 312, 312, 19, 189, 274, 311, 312, 309, 310, + 250, 113, 47, 18, 50, 52, 53, 54, 88, 88, + 24, 347, 26, 17, 345, 346, 256, 257, 269, 47, + 258, 133, 133, 271, 27, 272, 275, 362, 363, 364, + 365, 297, 113, 288, 290, 19, 87, 361, 181, 279, + 280, 283, 294, 298, 303, 279, 292, 305, 191, 192, + 193, 194, 195, 196, 197, 76, 206, 86, 198, 199, + 316, 336, 317, 359, 318, 191, 192, 193, 194, 195, + 196, 197, 76, 84, 181, 198, 199, 337, 122, 122, + 207, 340, 341, 342, 343, 344, 55, 350, 354, 355, + 366, 119, 119, 367, 369, 49, 368, 370, 386, 288, + 290, 123, 123, 373, 379, 211, 381, 135, 383, 387, + 55, 393, 292, 394, 401, 403, 120, 120, 406, 419, + 420, 435, 421, 446, 437, 450, 441, 49, 121, 121, + 423, 452, 27, 454, 88, 438, 455, 458, 459, 47, + 163, 461, 110, 1, 358, 62, 63, 172, 181, 66, + 67, 68, 69, 57, 56, 124, 124, 21, 10, 324, + 45, 259, 214, 214, 186, 181, 235, 178, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 314, 214, 214, 214, 214, 335, 214, 214, 49, + 336, 374, 76, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 236, 214, 214, 214, + 214, 251, 214, 51, 445, 306, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 307, 214, 214, 214, 214, 308, 353, 211, 270, 440, + 117, 214, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 118, 211, 211, 211, 211, + 118, 55, 228, 118, 306, 214, 248, 277, 442, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 118, 118, 326, 382, 118, 306, 306, 444, 0, 0, + 211, 293, 306, 0, 306, 0, 0, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 0, 0, + 0, 0, 0, 306, 306, 118, 118, 306, 0, 293, + 115, 306, 306, 0, 0, 0, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 115, 115, 116, + 0, 115, 306, 306, 114, 306, 118, 0, 293, 0, + 0, 306, 0, 0, 0, 0, 116, 116, 0, 0, + 116, 114, 114, 0, 0, 114, 0, 0, 0, 0, + 0, 0, 115, 115, 306, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 239, 0, 0, 0, 76, 239, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 47, 239, 239, 239, 239, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 0, 0, 0, - 0, 0, 73, 74, 0, 0, 0, 0, 0, 0, - 0, 285, 0, 0, 47, 0, 239, 0, 0, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 0, 0, 47, 0, 76, 73, 74, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 0, 0, 0, - 0, 0, 0, 73, 74, 3, 0, 4, 5, 6, - 7, 0, 0, 0, 0, 0, 0, 76, 0, 0, - 0, 0, 8, 9, 0, 10, 0, 0, 0, 11, - 0, 0, 229, 0, 4, 76, 0, 7, 0, 0, - 0, 0, 12, 13, 14, 15, 0, 0, 0, 8, - 9, 16, 10, 0, 0, 0, 11, 0, 0, 230, - 0, 231, 232, 229, 0, 4, 0, 0, 7, 12, - 0, 0, 0, 242, 243, 244, 0, 0, 0, 0, - 8, 9, 0, 10, 0, 0, 0, 11, 0, 0, - 230, 0, 231, 232, 0, 0, 0, 0, 0, 0, - 12, + 0, 116, 116, 0, 0, 0, 114, 0, 327, 47, + 0, 0, 0, 115, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 8, 9, 0, 10, 72, + 73, 74, 116, 47, 0, 0, 0, 114, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 8, + 9, 0, 10, 72, 73, 74, 0, 0, 0, 47, + 0, 0, 76, 0, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 8, 9, 75, 10, 72, + 73, 74, 244, 0, 0, 0, 76, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 0, 244, 244, 244, 244, 0, 0, 0, 47, 0, + 0, 0, 76, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 0, 0, 0, 0, 72, 73, + 74, 0, 47, 0, 0, 244, 0, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 0, 0, + 0, 0, 0, 73, 74, 0, 0, 0, 47, 0, + 0, 76, 287, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 0, 0, 0, 0, 0, 73, + 74, 47, 0, 0, 0, 76, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 229, 0, 4, 0, + 0, 7, 73, 74, 3, 0, 4, 5, 6, 7, + 0, 76, 0, 8, 9, 0, 10, 0, 0, 0, + 11, 8, 9, 230, 10, 231, 232, 0, 11, 0, + 0, 0, 0, 12, 76, 0, 0, 242, 243, 244, + 0, 12, 13, 14, 15, 0, 229, 0, 4, 0, + 16, 7, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 9, 0, 10, 0, 0, 0, + 11, 0, 0, 230, 0, 231, 232, 0, 0, 0, + 0, 0, 0, 12, }; short tao_yycheck[] = { 12, 23, 23, 12, 39, 39, 2, 39, 39, 39, 39, - 59, 2, 41, 203, 58, 2, 39, 37, 38, 42, - 42, 41, 42, 43, 123, 45, 2, 47, 41, 336, - 43, 44, 45, 46, 41, 257, 2, 44, 58, 59, - 2, 233, 62, 56, 58, 59, 41, 41, 257, 44, - 44, 40, 262, 41, 43, 265, 45, 59, 172, 173, - 58, 59, 260, 41, 59, 320, 44, 256, 41, 59, - 40, 44, 44, 93, 94, 38, 44, 302, 41, 123, - 43, 59, 45, 58, 260, 392, 59, 59, 310, 62, - 62, 59, 281, 282, 62, 58, 59, 44, 38, 62, - 59, 41, 44, 43, 124, 45, 50, 59, 52, 123, - 257, 134, 59, 91, 301, 62, 123, 123, 58, 59, - 62, 123, 62, 262, 263, 123, 302, 140, 318, 123, - 93, 94, 310, 123, 44, 123, 60, 126, 38, 123, - 153, 41, 155, 43, 336, 45, 60, 170, 38, 59, - 405, 41, 62, 93, 94, 99, 169, 59, 58, 59, - 41, 124, 62, 59, 123, 37, 59, 190, 58, 59, - 42, 59, 62, 59, 43, 47, 45, 58, 59, 311, - 312, 62, 259, 260, 124, 38, 281, 282, 41, 444, - 187, 188, 59, 93, 94, 123, 38, 233, 233, 41, - 392, 300, 262, 93, 94, 58, 59, 321, 60, 62, - 233, 300, 93, 288, 289, 290, 58, 59, 261, 262, - 62, 187, 188, 275, 124, 187, 188, 13, 14, 14, - 15, 228, 300, 301, 124, 425, 263, 264, 265, 123, - 93, 94, 125, 292, 200, 201, 202, 123, 123, 123, - 44, 93, 94, 124, 277, 94, 300, 38, 61, 288, - 289, 290, 228, 91, 44, 40, 228, 284, 257, 125, - 125, 124, 257, 270, 257, 41, 125, 300, 301, 270, - 303, 59, 124, 270, 257, 257, 300, 257, 62, 257, - 62, 311, 312, 300, 270, 328, 328, 328, 328, 62, - 336, 336, 300, 125, 270, 328, 300, 320, 270, 59, - 257, 59, 300, 336, 303, 304, 305, 306, 307, 308, - 309, 310, 59, 59, 313, 314, 59, 40, 125, 125, - 125, 328, 44, 303, 304, 305, 306, 307, 308, 309, - 310, 125, 355, 313, 314, 257, 262, 257, 311, 312, - 59, 41, 125, 93, 41, 41, 392, 392, 59, 44, - 291, 123, 44, 40, 377, 292, 59, 377, 125, 392, - 58, 311, 312, 256, 257, 40, 59, 41, 58, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 405, 276, 277, 278, 279, 410, 305, 41, - 410, 125, 305, 44, 427, 427, 0, 257, 431, 123, - 59, 311, 312, 257, 125, 123, 257, 41, 262, 263, - 264, 311, 312, 267, 268, 269, 270, 310, 125, 125, - 41, 444, 276, 41, 256, 257, 59, 59, 41, 190, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 125, 276, 277, 278, 279, 311, 312, - 431, 355, 14, 256, 322, 257, 310, 258, 428, 311, - 312, 39, 39, 15, 221, 224, 186, 276, 375, 430, - 406, 188, -1, -1, 257, 376, -1, -1, 310, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - -1, 38, -1, -1, 41, 278, 279, -1, -1, -1, - 41, 284, -1, -1, 287, -1, -1, -1, -1, -1, - -1, 58, 59, -1, -1, 62, -1, 58, 59, 38, - -1, 62, 41, 257, -1, -1, -1, 310, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 58, - 59, -1, -1, 62, 278, 279, 93, 94, -1, -1, - 284, 257, 93, 287, -1, -1, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 41, -1, 41, - -1, -1, 278, 279, 93, 94, 310, 124, 284, 41, - -1, 287, -1, 124, 58, 59, 58, 59, 62, -1, - 62, -1, -1, -1, -1, -1, 58, 59, -1, -1, - 62, -1, -1, 257, 310, 124, -1, -1, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 93, - 94, 93, 94, 277, 278, 279, 256, 257, -1, -1, - -1, 93, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, -1, 276, 277, 278, 279, - 124, -1, 124, -1, -1, -1, 310, -1, -1, -1, - -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 257, -1, -1, -1, - 310, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 257, 276, 277, 278, 279, 262, + 59, 58, 2, 41, 2, 2, 39, 37, 38, 42, + 42, 41, 42, 43, 339, 45, 2, 47, 41, 123, + 43, 44, 45, 46, 257, 203, 257, 2, 58, 59, + 260, 44, 62, 56, 172, 173, 44, 41, 41, 302, + 44, 44, 44, 58, 233, 40, 59, 59, 43, 62, + 45, 59, 257, 44, 62, 321, 59, 59, 41, 62, + 62, 44, 40, 93, 94, 38, 123, 43, 41, 45, + 43, 62, 45, 50, 41, 52, 301, 310, 38, 41, + 405, 41, 44, 260, 123, 58, 59, 59, 38, 62, + 59, 41, 44, 43, 124, 45, 59, 59, 58, 59, + 310, 134, 62, 38, 58, 59, 41, 59, 58, 59, + 62, 123, 62, 262, 123, 38, 265, 140, 41, 123, + 93, 94, 99, 58, 59, 302, 60, 62, 58, 59, + 153, 126, 155, 93, 94, 58, 59, 170, 60, 62, + 123, 319, 38, 93, 94, 41, 169, 43, 59, 45, + 339, 124, 38, 256, 123, 41, 123, 190, 93, 94, + 123, 59, 58, 59, 124, 431, 62, 262, 263, 123, + 93, 94, 58, 59, 124, 59, 62, 59, 281, 282, + 187, 188, 448, 59, 322, 41, 59, 233, 233, 124, + 187, 188, 41, 123, 37, 44, 300, 93, 94, 42, + 233, 124, 58, 59, 47, 123, 62, 93, 94, 41, + 59, 262, 187, 188, 311, 312, 405, 288, 289, 290, + 60, 228, 300, 281, 282, 275, 58, 59, 124, 123, + 62, 228, 123, 292, 263, 264, 265, 93, 124, 200, + 201, 202, 91, 300, 257, 278, 123, 425, 123, 257, + 288, 289, 290, 228, 257, 257, 261, 262, 259, 260, + 44, 93, 257, 270, 13, 14, 14, 15, 301, 302, + 270, 304, 270, 270, 301, 302, 124, 94, 61, 257, + 38, 311, 312, 44, 270, 91, 256, 330, 330, 330, + 330, 125, 124, 339, 339, 270, 300, 330, 321, 40, + 257, 256, 284, 125, 125, 257, 339, 41, 303, 304, + 305, 306, 307, 308, 309, 310, 125, 300, 313, 314, + 62, 125, 62, 330, 62, 303, 304, 305, 306, 307, + 308, 309, 310, 300, 357, 313, 314, 59, 311, 312, + 125, 59, 59, 59, 59, 59, 300, 125, 59, 125, + 125, 311, 312, 44, 125, 378, 59, 257, 378, 405, + 405, 311, 312, 59, 93, 125, 41, 262, 40, 59, + 300, 123, 405, 41, 291, 44, 311, 312, 41, 44, + 40, 59, 292, 40, 58, 41, 125, 410, 311, 312, + 410, 58, 125, 59, 427, 427, 305, 41, 44, 257, + 433, 305, 257, 0, 262, 263, 264, 59, 431, 267, + 268, 269, 270, 123, 123, 311, 312, 125, 276, 257, + 125, 125, 256, 257, 41, 448, 41, 59, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 41, 276, 277, 278, 279, 59, 256, 257, 125, + 41, 357, 310, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 125, 276, 277, 278, + 279, 190, 257, 14, 433, 256, 310, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 257, 276, 277, 278, 279, 258, 323, 257, 221, 428, + 39, 310, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 39, 276, 277, 278, 279, + 38, 15, 186, 41, 257, 310, 188, 224, 430, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, -1, 276, 277, 278, 279, -1, -1, -1, - 301, -1, -1, -1, -1, -1, -1, -1, -1, 310, + 58, 59, 277, 376, 62, 278, 279, 432, -1, -1, + 310, 284, 257, -1, 287, -1, -1, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, -1, -1, + -1, -1, -1, 278, 279, 93, 94, 310, -1, 284, + 41, 257, 287, -1, -1, -1, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 58, 59, 41, + -1, 62, 278, 279, 41, 310, 124, -1, 284, -1, + -1, 287, -1, -1, -1, -1, 58, 59, -1, -1, + 62, 58, 59, -1, -1, 62, -1, -1, -1, -1, + -1, -1, 93, 94, 310, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 257, -1, -1, -1, 310, 262, 263, + -1, 93, 94, -1, -1, -1, 93, -1, 256, 257, + -1, -1, -1, 124, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, -1, 276, 277, + 278, 279, 124, 257, -1, -1, -1, 124, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 257, 276, 277, 278, 279, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, -1, -1, -1, - -1, -1, 278, 279, -1, -1, -1, -1, -1, -1, - -1, 287, -1, -1, 257, -1, 310, -1, -1, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - -1, -1, 257, -1, 310, 278, 279, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, -1, -1, -1, - -1, -1, -1, 278, 279, 256, -1, 258, 259, 260, - 261, -1, -1, -1, -1, -1, -1, 310, -1, -1, - -1, -1, 273, 274, -1, 276, -1, -1, -1, 280, - -1, -1, 256, -1, 258, 310, -1, 261, -1, -1, - -1, -1, 293, 294, 295, 296, -1, -1, -1, 273, - 274, 302, 276, -1, -1, -1, 280, -1, -1, 283, - -1, 285, 286, 256, -1, 258, -1, -1, 261, 293, - -1, -1, -1, 297, 298, 299, -1, -1, -1, -1, - 273, 274, -1, 276, -1, -1, -1, 280, -1, -1, - 283, -1, 285, 286, -1, -1, -1, -1, -1, -1, - 293, + 274, -1, 276, 277, 278, 279, -1, -1, -1, 257, + -1, -1, 310, -1, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 301, 276, 277, + 278, 279, 257, -1, -1, -1, 310, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + -1, 276, 277, 278, 279, -1, -1, -1, 257, -1, + -1, -1, 310, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, -1, -1, -1, -1, 277, 278, + 279, -1, 257, -1, -1, 310, -1, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, -1, -1, + -1, -1, -1, 278, 279, -1, -1, -1, 257, -1, + -1, 310, 287, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, -1, -1, -1, -1, -1, 278, + 279, 257, -1, -1, -1, 310, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 256, -1, 258, -1, + -1, 261, 278, 279, 256, -1, 258, 259, 260, 261, + -1, 310, -1, 273, 274, -1, 276, -1, -1, -1, + 280, 273, 274, 283, 276, 285, 286, -1, 280, -1, + -1, -1, -1, 293, 310, -1, -1, 297, 298, 299, + -1, 293, 294, 295, 296, -1, 256, -1, 258, -1, + 302, 261, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 273, 274, -1, 276, -1, -1, -1, + 280, -1, -1, 283, -1, 285, 286, -1, -1, -1, + -1, -1, -1, 293, }; #define TAO_YYFINAL 1 #ifndef TAO_YYDEBUG @@ -592,8 +595,8 @@ const char *tao_yyname[] = { "IDL_ENUM","IDL_SEQUENCE","IDL_STRING","IDL_WSTRING","IDL_EXCEPTION","IDL_CASE", "IDL_DEFAULT","IDL_READONLY","IDL_ATTRIBUTE","IDL_ONEWAY","IDL_IDEMPOTENT", "IDL_VOID","IDL_IN","IDL_OUT","IDL_INOUT","IDL_RAISES","IDL_CONTEXT", -"IDL_NATIVE","IDL_LOCAL","IDL_ABSTRACT","IDL_CUSTOM","IDL_FACTORY", -"IDL_PRIVATE","IDL_PUBLIC","IDL_SUPPORTS","IDL_TRUNCATABLE","IDL_VALUETYPE", +"IDL_NATIVE","IDL_LOCAL","IDL_ABSTRACT","IDL_CUSTOM","IDL_INIT","IDL_PRIVATE", +"IDL_PUBLIC","IDL_SUPPORTS","IDL_TRUNCATABLE","IDL_VALUETYPE", "IDL_INTEGER_LITERAL","IDL_UINTEGER_LITERAL","IDL_STRING_LITERAL", "IDL_CHARACTER_LITERAL","IDL_FLOATING_PT_LITERAL","IDL_TRUETOK","IDL_FALSETOK", "IDL_SCOPE_DELIMITOR","IDL_LEFT_SHIFT","IDL_RIGHT_SHIFT","IDL_WCHAR_LITERAL", @@ -807,24 +810,29 @@ const char *tao_yyrule[] = { "$$46 :", "struct_type : IDL_STRUCT $$43 id $$44 '{' $$45 at_least_one_member $$46 '}'", "at_least_one_member : member members", +"at_least_one_member :", +"$$47 :", +"at_least_one_member : error $$47 ';'", "members : members member", "members :", -"$$47 :", -"member : $$47 member_i", "$$48 :", +"members : error $$48 ';'", "$$49 :", -"member_i : type_spec $$48 at_least_one_declarator $$49 ';'", +"member : $$49 member_i", "$$50 :", -"member_i : error $$50 ';'", "$$51 :", +"member_i : type_spec $$50 at_least_one_declarator $$51 ';'", "$$52 :", +"member_i : error $$52 ';'", "$$53 :", "$$54 :", "$$55 :", "$$56 :", "$$57 :", "$$58 :", -"union_type : IDL_UNION $$51 id $$52 IDL_SWITCH $$53 '(' $$54 switch_type_spec $$55 ')' $$56 '{' $$57 at_least_one_case_branch $$58 '}'", +"$$59 :", +"$$60 :", +"union_type : IDL_UNION $$53 id $$54 IDL_SWITCH $$55 '(' $$56 switch_type_spec $$57 ')' $$58 '{' $$59 at_least_one_case_branch $$60 '}'", "switch_type_spec : integer_type", "switch_type_spec : char_type", "switch_type_spec : octet_type", @@ -834,88 +842,88 @@ const char *tao_yyrule[] = { "at_least_one_case_branch : case_branch case_branches", "case_branches : case_branches case_branch", "case_branches :", -"$$59 :", -"$$60 :", -"case_branch : at_least_one_case_label $$59 element_spec $$60 ';'", "$$61 :", -"case_branch : error $$61 ';'", +"$$62 :", +"case_branch : at_least_one_case_label $$61 element_spec $$62 ';'", +"$$63 :", +"case_branch : error $$63 ';'", "at_least_one_case_label : case_label case_labels", "case_labels : case_labels case_label", "case_labels :", -"$$62 :", -"case_label : IDL_DEFAULT $$62 ':'", -"$$63 :", "$$64 :", -"case_label : IDL_CASE $$63 const_expr $$64 ':'", +"case_label : IDL_DEFAULT $$64 ':'", "$$65 :", -"element_spec : type_spec $$65 declarator", "$$66 :", +"case_label : IDL_CASE $$65 const_expr $$66 ':'", "$$67 :", +"element_spec : type_spec $$67 declarator", "$$68 :", "$$69 :", -"enum_type : IDL_ENUM $$66 id $$67 '{' $$68 at_least_one_enumerator $$69 '}'", -"at_least_one_enumerator : enumerator enumerators", "$$70 :", -"enumerators : enumerators ',' $$70 enumerator", -"enumerators :", -"enumerator : IDENTIFIER", "$$71 :", +"enum_type : IDL_ENUM $$68 id $$69 '{' $$70 at_least_one_enumerator $$71 '}'", +"at_least_one_enumerator : enumerator enumerators", "$$72 :", -"sequence_type_spec : seq_head ',' $$71 positive_int_expr $$72 '>'", -"sequence_type_spec : seq_head '>'", +"enumerators : enumerators ',' $$72 enumerator", +"enumerators :", +"enumerator : IDENTIFIER", "$$73 :", "$$74 :", -"seq_head : IDL_SEQUENCE $$73 '<' $$74 simple_type_spec", +"sequence_type_spec : seq_head ',' $$73 positive_int_expr $$74 '>'", +"sequence_type_spec : seq_head '>'", "$$75 :", "$$76 :", -"string_type_spec : string_head '<' $$75 positive_int_expr $$76 '>'", -"string_type_spec : string_head", -"string_head : IDL_STRING", +"seq_head : IDL_SEQUENCE $$75 '<' $$76 simple_type_spec", "$$77 :", "$$78 :", -"wstring_type_spec : wstring_head '<' $$77 positive_int_expr $$78 '>'", +"string_type_spec : string_head '<' $$77 positive_int_expr $$78 '>'", +"string_type_spec : string_head", +"string_head : IDL_STRING", +"$$79 :", +"$$80 :", +"wstring_type_spec : wstring_head '<' $$79 positive_int_expr $$80 '>'", "wstring_type_spec : wstring_head", "wstring_head : IDL_WSTRING", -"$$79 :", -"array_declarator : id $$79 at_least_one_array_dim", +"$$81 :", +"array_declarator : id $$81 at_least_one_array_dim", "at_least_one_array_dim : array_dim array_dims", "array_dims : array_dims array_dim", "array_dims :", -"$$80 :", -"$$81 :", -"array_dim : '[' $$80 positive_int_expr $$81 ']'", "$$82 :", "$$83 :", -"attribute : opt_readonly IDL_ATTRIBUTE $$82 param_type_spec $$83 at_least_one_simple_declarator", -"opt_readonly : IDL_READONLY", -"opt_readonly :", +"array_dim : '[' $$82 positive_int_expr $$83 ']'", "$$84 :", "$$85 :", +"attribute : opt_readonly IDL_ATTRIBUTE $$84 param_type_spec $$85 at_least_one_simple_declarator", +"opt_readonly : IDL_READONLY", +"opt_readonly :", "$$86 :", "$$87 :", -"exception : IDL_EXCEPTION $$84 id $$85 '{' $$86 members $$87 '}'", "$$88 :", "$$89 :", +"exception : IDL_EXCEPTION $$86 id $$87 '{' $$88 members $$89 '}'", "$$90 :", "$$91 :", -"operation : opt_op_attribute op_type_spec $$88 IDENTIFIER $$89 parameter_list $$90 opt_raises $$91 opt_context", +"$$92 :", +"$$93 :", +"operation : opt_op_attribute op_type_spec $$90 IDENTIFIER $$91 parameter_list $$92 opt_raises $$93 opt_context", "opt_op_attribute : IDL_ONEWAY", "opt_op_attribute : IDL_IDEMPOTENT", "opt_op_attribute :", "op_type_spec : param_type_spec", "op_type_spec : IDL_VOID", -"init_decl : IDL_FACTORY IDENTIFIER parameter_list", -"$$92 :", -"parameter_list : '(' $$92 ')'", -"$$93 :", -"parameter_list : '(' $$93 at_least_one_parameter ')'", -"at_least_one_parameter : parameter parameters", +"init_decl : IDL_INIT", "$$94 :", -"parameters : parameters ',' $$94 parameter", -"parameters :", +"parameter_list : '(' $$94 ')'", "$$95 :", +"parameter_list : '(' $$95 at_least_one_parameter ')'", +"at_least_one_parameter : parameter parameters", "$$96 :", -"parameter : direction $$95 param_type_spec $$96 declarator", +"parameters : parameters ',' $$96 parameter", +"parameters :", +"$$97 :", +"$$98 :", +"parameter : direction $$97 param_type_spec $$98 declarator", "param_type_spec : base_type_spec", "param_type_spec : string_type_spec", "param_type_spec : wstring_type_spec", @@ -923,17 +931,17 @@ const char *tao_yyrule[] = { "direction : IDL_IN", "direction : IDL_OUT", "direction : IDL_INOUT", -"$$97 :", -"$$98 :", -"opt_raises : IDL_RAISES $$97 '(' $$98 at_least_one_scoped_name ')'", -"opt_raises :", "$$99 :", "$$100 :", -"opt_context : IDL_CONTEXT $$99 '(' $$100 at_least_one_string_literal ')'", +"opt_raises : IDL_RAISES $$99 '(' $$100 at_least_one_scoped_name ')'", +"opt_raises :", +"$$101 :", +"$$102 :", +"opt_context : IDL_CONTEXT $$101 '(' $$102 at_least_one_string_literal ')'", "opt_context :", "at_least_one_string_literal : IDL_STRING_LITERAL string_literals", -"$$101 :", -"string_literals : string_literals ',' $$101 IDL_STRING_LITERAL", +"$$103 :", +"string_literals : string_literals ',' $$103 IDL_STRING_LITERAL", "string_literals :", }; #endif @@ -957,7 +965,7 @@ TAO_YYSTYPE tao_yylval; #define tao_yystacksize TAO_YYSTACKSIZE short tao_yyss[TAO_YYSTACKSIZE]; TAO_YYSTYPE tao_yyvs[TAO_YYSTACKSIZE]; -#line 2776 "fe/idl.tao_yy" +#line 2801 "fe/idl.tao_yy" /* programs */ /* @@ -979,7 +987,7 @@ tao_yyerror(const char *msg) "%s\n", msg)); } -#line 982 "y.tab.cpp" +#line 990 "y.tab.cpp" #define TAO_YYABORT goto tao_yyabort #define TAO_YYACCEPT goto tao_yyaccept #define TAO_YYERROR goto tao_yyerrlab @@ -2703,27 +2711,61 @@ case 205: idl_global->scopes()->pop(); } break; +case 207: +#line 1633 "fe/idl.tao_yy" +{ + idl_global->err()->syntax_error(idl_global->parse_state()); + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + tao_yyerrok; + } +break; +case 208: +#line 1639 "fe/idl.tao_yy" +{ + idl_global->err()->syntax_error(idl_global->parse_state()); + } +break; case 209: -#line 1638 "fe/idl.tao_yy" +#line 1643 "fe/idl.tao_yy" +{ + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + tao_yyerrok; + } +break; +case 212: +#line 1653 "fe/idl.tao_yy" +{ + idl_global->err()->syntax_error(idl_global->parse_state()); + } +break; +case 213: +#line 1657 "fe/idl.tao_yy" +{ + idl_global->set_parse_state(IDL_GlobalData::PS_NoState); + tao_yyerrok; + } +break; +case 214: +#line 1664 "fe/idl.tao_yy" { /* is $0 to member_i */ tao_yyval.vival = AST_Field::vis_NA; } break; -case 211: -#line 1647 "fe/idl.tao_yy" +case 216: +#line 1673 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_MemberTypeSeen); } break; -case 212: -#line 1651 "fe/idl.tao_yy" +case 217: +#line 1677 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_MemberDeclsSeen); } break; -case 213: -#line 1655 "fe/idl.tao_yy" +case 218: +#line 1681 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_DecllistActiveIterator *l = NULL; @@ -2758,51 +2800,51 @@ case 213: } } break; -case 214: -#line 1689 "fe/idl.tao_yy" +case 219: +#line 1715 "fe/idl.tao_yy" { idl_global->err()->syntax_error(idl_global->parse_state()); } break; -case 215: -#line 1693 "fe/idl.tao_yy" +case 220: +#line 1719 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_NoState); tao_yyerrok; } break; -case 216: -#line 1701 "fe/idl.tao_yy" +case 221: +#line 1727 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionSeen); } break; -case 217: -#line 1705 "fe/idl.tao_yy" +case 222: +#line 1731 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionIDSeen); } break; -case 218: -#line 1709 "fe/idl.tao_yy" +case 223: +#line 1735 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SwitchSeen); } break; -case 219: -#line 1713 "fe/idl.tao_yy" +case 224: +#line 1739 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SwitchOpenParSeen); } break; -case 220: -#line 1717 "fe/idl.tao_yy" +case 225: +#line 1743 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SwitchTypeSeen); } break; -case 221: -#line 1721 "fe/idl.tao_yy" +case 226: +#line 1747 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_ScopedName *n = new UTL_ScopedName(tao_yyvsp[-8].idval, NULL); @@ -2836,20 +2878,20 @@ case 221: idl_global->scopes()->push(u); } break; -case 222: -#line 1754 "fe/idl.tao_yy" +case 227: +#line 1780 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionSqSeen); } break; -case 223: -#line 1758 "fe/idl.tao_yy" +case 228: +#line 1784 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionBodySeen); } break; -case 224: -#line 1762 "fe/idl.tao_yy" +case 229: +#line 1788 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionQsSeen); /* @@ -2869,34 +2911,34 @@ case 224: } } break; -case 225: -#line 1784 "fe/idl.tao_yy" +case 230: +#line 1810 "fe/idl.tao_yy" { tao_yyval.dcval = idl_global->scopes()->bottom()->lookup_primitive_type(tao_yyvsp[0].etval); } break; -case 226: -#line 1788 "fe/idl.tao_yy" +case 231: +#line 1814 "fe/idl.tao_yy" { tao_yyval.dcval = idl_global->scopes()->bottom()->lookup_primitive_type(tao_yyvsp[0].etval); } break; -case 227: -#line 1792 "fe/idl.tao_yy" +case 232: +#line 1818 "fe/idl.tao_yy" { /* octets are not allowed*/ idl_global->err ()->error0 (UTL_Error::EIDL_DISC_TYPE); tao_yyval.dcval = idl_global->scopes()->bottom()->lookup_primitive_type(tao_yyvsp[0].etval); } break; -case 228: -#line 1798 "fe/idl.tao_yy" +case 233: +#line 1824 "fe/idl.tao_yy" { tao_yyval.dcval = idl_global->scopes()->bottom()->lookup_primitive_type(tao_yyvsp[0].etval); } break; -case 230: -#line 1803 "fe/idl.tao_yy" +case 235: +#line 1829 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); AST_Decl *d = NULL; @@ -2967,20 +3009,20 @@ case 230: idl_global->err()->lookup_error(tao_yyvsp[0].idlist); } break; -case 234: -#line 1883 "fe/idl.tao_yy" +case 239: +#line 1909 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionLabelSeen); } break; -case 235: -#line 1887 "fe/idl.tao_yy" +case 240: +#line 1913 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionElemSeen); } break; -case 236: -#line 1891 "fe/idl.tao_yy" +case 241: +#line 1917 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_LabellistActiveIterator *l = NULL; @@ -3005,27 +3047,27 @@ case 236: } } break; -case 237: -#line 1915 "fe/idl.tao_yy" +case 242: +#line 1941 "fe/idl.tao_yy" { idl_global->err()->syntax_error(idl_global->parse_state()); } break; -case 238: -#line 1920 "fe/idl.tao_yy" +case 243: +#line 1946 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_NoState); tao_yyerrok; } break; -case 239: -#line 1928 "fe/idl.tao_yy" +case 244: +#line 1954 "fe/idl.tao_yy" { tao_yyval.llval = new UTL_LabelList(tao_yyvsp[-1].ulval, tao_yyvsp[0].llval); } break; -case 240: -#line 1935 "fe/idl.tao_yy" +case 245: +#line 1961 "fe/idl.tao_yy" { if (tao_yyvsp[-1].llval == NULL) tao_yyval.llval = new UTL_LabelList(tao_yyvsp[0].ulval, NULL); @@ -3035,20 +3077,20 @@ case 240: } } break; -case 241: -#line 1944 "fe/idl.tao_yy" +case 246: +#line 1970 "fe/idl.tao_yy" { tao_yyval.llval = NULL; } break; -case 242: -#line 1951 "fe/idl.tao_yy" +case 247: +#line 1977 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_DefaultSeen); } break; -case 243: -#line 1955 "fe/idl.tao_yy" +case 248: +#line 1981 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_LabelColonSeen); @@ -3057,20 +3099,20 @@ case 243: NULL); } break; -case 244: -#line 1963 "fe/idl.tao_yy" +case 249: +#line 1989 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_CaseSeen); } break; -case 245: -#line 1967 "fe/idl.tao_yy" +case 250: +#line 1993 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_LabelExprSeen); } break; -case 246: -#line 1971 "fe/idl.tao_yy" +case 251: +#line 1997 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_LabelColonSeen); @@ -3078,14 +3120,14 @@ case 246: tao_yyvsp[-2].exval); } break; -case 247: -#line 1981 "fe/idl.tao_yy" +case 252: +#line 2007 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionElemTypeSeen); } break; -case 248: -#line 1985 "fe/idl.tao_yy" +case 253: +#line 2011 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_UnionElemDeclSeen); /* @@ -3109,14 +3151,14 @@ case 248: } } break; -case 249: -#line 2011 "fe/idl.tao_yy" +case 254: +#line 2037 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_EnumSeen); } break; -case 250: -#line 2015 "fe/idl.tao_yy" +case 255: +#line 2041 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_ScopedName *n = new UTL_ScopedName(tao_yyvsp[0].idval, NULL); @@ -3147,20 +3189,20 @@ case 250: idl_global->scopes()->push(e); } break; -case 251: -#line 2045 "fe/idl.tao_yy" +case 256: +#line 2071 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_EnumSqSeen); } break; -case 252: -#line 2049 "fe/idl.tao_yy" +case 257: +#line 2075 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_EnumBodySeen); } break; -case 253: -#line 2053 "fe/idl.tao_yy" +case 258: +#line 2079 "fe/idl.tao_yy" { UTL_StrList *p = 0; idl_global->set_parse_state(IDL_GlobalData::PS_EnumQsSeen); @@ -3177,14 +3219,14 @@ case 253: idl_global->set_pragmas (p); } break; -case 255: -#line 2075 "fe/idl.tao_yy" +case 260: +#line 2101 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_EnumCommaSeen); } break; -case 258: -#line 2084 "fe/idl.tao_yy" +case 263: +#line 2110 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_ScopedName *n = @@ -3205,20 +3247,20 @@ case 258: } } break; -case 259: -#line 2108 "fe/idl.tao_yy" +case 264: +#line 2134 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceCommaSeen); } break; -case 260: -#line 2112 "fe/idl.tao_yy" +case 265: +#line 2138 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceExprSeen); } break; -case 261: -#line 2116 "fe/idl.tao_yy" +case 266: +#line 2142 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceQsSeen); /* @@ -3253,8 +3295,8 @@ case 261: } } break; -case 262: -#line 2151 "fe/idl.tao_yy" +case 267: +#line 2177 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceQsSeen); /* @@ -3288,8 +3330,8 @@ case 262: } } break; -case 263: -#line 2187 "fe/idl.tao_yy" +case 268: +#line 2213 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceSeen); /* @@ -3298,33 +3340,33 @@ case 263: idl_global->scopes()->push(NULL); } break; -case 264: -#line 2195 "fe/idl.tao_yy" +case 269: +#line 2221 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceSqSeen); } break; -case 265: -#line 2199 "fe/idl.tao_yy" +case 270: +#line 2225 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_SequenceTypeSeen); tao_yyval.dcval = tao_yyvsp[0].dcval; } break; -case 266: -#line 2208 "fe/idl.tao_yy" +case 271: +#line 2234 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringSqSeen); } break; -case 267: -#line 2212 "fe/idl.tao_yy" +case 272: +#line 2238 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringExprSeen); } break; -case 268: -#line 2216 "fe/idl.tao_yy" +case 273: +#line 2242 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringQsSeen); /* @@ -3343,8 +3385,8 @@ case 268: } } break; -case 269: -#line 2234 "fe/idl.tao_yy" +case 274: +#line 2260 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringCompleted); /* @@ -3360,26 +3402,26 @@ case 269: ->fe_add_string(AST_String::narrow_from_decl(tao_yyval.dcval)); } break; -case 270: -#line 2252 "fe/idl.tao_yy" +case 275: +#line 2278 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringSeen); } break; -case 271: -#line 2260 "fe/idl.tao_yy" +case 276: +#line 2286 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringSqSeen); } break; -case 272: -#line 2264 "fe/idl.tao_yy" +case 277: +#line 2290 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringExprSeen); } break; -case 273: -#line 2268 "fe/idl.tao_yy" +case 278: +#line 2294 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringQsSeen); /* @@ -3398,8 +3440,8 @@ case 273: } } break; -case 274: -#line 2286 "fe/idl.tao_yy" +case 279: +#line 2312 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringCompleted); /* @@ -3415,20 +3457,20 @@ case 274: ->fe_add_string(AST_String::narrow_from_decl(tao_yyval.dcval)); } break; -case 275: -#line 2304 "fe/idl.tao_yy" +case 280: +#line 2330 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_StringSeen); } break; -case 276: -#line 2311 "fe/idl.tao_yy" +case 281: +#line 2337 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ArrayIDSeen); } break; -case 277: -#line 2315 "fe/idl.tao_yy" +case 282: +#line 2341 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ArrayCompleted); /* @@ -3440,14 +3482,14 @@ case 277: } } break; -case 278: -#line 2329 "fe/idl.tao_yy" +case 283: +#line 2355 "fe/idl.tao_yy" { tao_yyval.elval = new UTL_ExprList(tao_yyvsp[-1].exval, tao_yyvsp[0].elval); } break; -case 279: -#line 2336 "fe/idl.tao_yy" +case 284: +#line 2362 "fe/idl.tao_yy" { if (tao_yyvsp[-1].elval == NULL) tao_yyval.elval = new UTL_ExprList(tao_yyvsp[0].exval, NULL); @@ -3457,26 +3499,26 @@ case 279: } } break; -case 280: -#line 2345 "fe/idl.tao_yy" +case 285: +#line 2371 "fe/idl.tao_yy" { tao_yyval.elval = NULL; } break; -case 281: -#line 2352 "fe/idl.tao_yy" +case 286: +#line 2378 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_DimSqSeen); } break; -case 282: -#line 2356 "fe/idl.tao_yy" +case 287: +#line 2382 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_DimExprSeen); } break; -case 283: -#line 2360 "fe/idl.tao_yy" +case 288: +#line 2386 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_DimQsSeen); /* @@ -3490,20 +3532,20 @@ case 283: tao_yyval.exval = tao_yyvsp[-2].exval; } break; -case 284: -#line 2377 "fe/idl.tao_yy" +case 289: +#line 2403 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_AttrSeen); } break; -case 285: -#line 2381 "fe/idl.tao_yy" +case 290: +#line 2407 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_AttrTypeSeen); } break; -case 286: -#line 2385 "fe/idl.tao_yy" +case 291: +#line 2411 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_DecllistActiveIterator *l = NULL; @@ -3541,27 +3583,27 @@ case 286: idl_global->set_pragmas (p); } break; -case 287: -#line 2425 "fe/idl.tao_yy" +case 292: +#line 2451 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_AttrROSeen); tao_yyval.bval = I_TRUE; } break; -case 288: -#line 2430 "fe/idl.tao_yy" +case 293: +#line 2456 "fe/idl.tao_yy" { tao_yyval.bval = I_FALSE; } break; -case 289: -#line 2437 "fe/idl.tao_yy" +case 294: +#line 2463 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ExceptSeen); } break; -case 290: -#line 2441 "fe/idl.tao_yy" +case 295: +#line 2467 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_ScopedName *n = new UTL_ScopedName(tao_yyvsp[0].idval, NULL); @@ -3589,20 +3631,20 @@ case 290: idl_global->scopes()->push(e); } break; -case 291: -#line 2468 "fe/idl.tao_yy" +case 296: +#line 2494 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ExceptSqSeen); } break; -case 292: -#line 2472 "fe/idl.tao_yy" +case 297: +#line 2498 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ExceptBodySeen); } break; -case 293: -#line 2476 "fe/idl.tao_yy" +case 298: +#line 2502 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_ExceptQsSeen); /* @@ -3615,14 +3657,14 @@ case 293: idl_global->set_pragmas (p); } break; -case 294: -#line 2492 "fe/idl.tao_yy" +case 299: +#line 2518 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpTypeSeen); } break; -case 295: -#line 2496 "fe/idl.tao_yy" +case 300: +#line 2522 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); UTL_ScopedName *n = @@ -3657,20 +3699,20 @@ case 295: idl_global->scopes()->push(o); } break; -case 296: -#line 2530 "fe/idl.tao_yy" +case 301: +#line 2556 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpParsCompleted); } break; -case 297: -#line 2534 "fe/idl.tao_yy" +case 302: +#line 2560 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpRaiseCompleted); } break; -case 298: -#line 2538 "fe/idl.tao_yy" +case 303: +#line 2564 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); AST_Operation *o = NULL; @@ -3693,87 +3735,86 @@ case 298: idl_global->scopes()->pop(); } break; -case 299: -#line 2563 "fe/idl.tao_yy" +case 304: +#line 2589 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_oneway; } break; -case 300: -#line 2568 "fe/idl.tao_yy" +case 305: +#line 2594 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpAttrSeen); tao_yyval.ofval = AST_Operation::OP_idempotent; } break; -case 301: -#line 2573 "fe/idl.tao_yy" +case 306: +#line 2599 "fe/idl.tao_yy" { tao_yyval.ofval = AST_Operation::OP_noflags; } break; -case 303: -#line 2581 "fe/idl.tao_yy" +case 308: +#line 2607 "fe/idl.tao_yy" { tao_yyval.dcval = idl_global->scopes()->bottom() ->lookup_primitive_type(AST_Expression::EV_void); } break; -case 304: -#line 2590 "fe/idl.tao_yy" +case 309: +#line 2616 "fe/idl.tao_yy" { - /* TODO: replace parameter_list with rule that accepts only IN args*/ cerr << "error in " << idl_global->filename()->get_string() << " line " << idl_global->lineno() << ":\n" ; - cerr << "Sorry, I (TAO_IDL) can't handle factory yet\n"; + cerr << "Sorry, I (TAO_IDL) can't handle init yet\n"; } break; -case 305: -#line 2601 "fe/idl.tao_yy" +case 310: +#line 2626 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpSqSeen); } break; -case 306: -#line 2605 "fe/idl.tao_yy" +case 311: +#line 2630 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpQsSeen); } break; -case 307: -#line 2609 "fe/idl.tao_yy" +case 312: +#line 2634 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpSqSeen); } break; -case 308: -#line 2614 "fe/idl.tao_yy" +case 313: +#line 2639 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpQsSeen); } break; -case 310: -#line 2624 "fe/idl.tao_yy" +case 315: +#line 2649 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpParCommaSeen); } break; -case 313: -#line 2633 "fe/idl.tao_yy" +case 318: +#line 2658 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpParDirSeen); } break; -case 314: -#line 2637 "fe/idl.tao_yy" +case 319: +#line 2662 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpParTypeSeen); } break; -case 315: -#line 2641 "fe/idl.tao_yy" +case 320: +#line 2666 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); AST_Argument *a = NULL; @@ -3802,14 +3843,14 @@ case 315: } } break; -case 316: -#line 2672 "fe/idl.tao_yy" +case 321: +#line 2697 "fe/idl.tao_yy" { tao_yyval.dcval = idl_global->scopes()->bottom()->lookup_primitive_type(tao_yyvsp[0].etval); } break; -case 319: -#line 2678 "fe/idl.tao_yy" +case 324: +#line 2703 "fe/idl.tao_yy" { UTL_Scope *s = idl_global->scopes()->top_non_null(); AST_Decl *d = NULL; @@ -3821,88 +3862,88 @@ case 319: tao_yyval.dcval = d; } break; -case 320: -#line 2692 "fe/idl.tao_yy" +case 325: +#line 2717 "fe/idl.tao_yy" { tao_yyval.dival = AST_Argument::dir_IN; } break; -case 321: -#line 2696 "fe/idl.tao_yy" +case 326: +#line 2721 "fe/idl.tao_yy" { tao_yyval.dival = AST_Argument::dir_OUT; } break; -case 322: -#line 2700 "fe/idl.tao_yy" +case 327: +#line 2725 "fe/idl.tao_yy" { tao_yyval.dival = AST_Argument::dir_INOUT; } break; -case 323: -#line 2707 "fe/idl.tao_yy" +case 328: +#line 2732 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpRaiseSeen); } break; -case 324: -#line 2711 "fe/idl.tao_yy" +case 329: +#line 2736 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpRaiseSqSeen); } break; -case 325: -#line 2716 "fe/idl.tao_yy" +case 330: +#line 2741 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpRaiseQsSeen); tao_yyval.nlval = tao_yyvsp[-1].nlval; } break; -case 326: -#line 2721 "fe/idl.tao_yy" +case 331: +#line 2746 "fe/idl.tao_yy" { tao_yyval.nlval = NULL; } break; -case 327: -#line 2728 "fe/idl.tao_yy" +case 332: +#line 2753 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpContextSeen); } break; -case 328: -#line 2732 "fe/idl.tao_yy" +case 333: +#line 2757 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpContextSqSeen); } break; -case 329: -#line 2737 "fe/idl.tao_yy" +case 334: +#line 2762 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpContextQsSeen); tao_yyval.slval = tao_yyvsp[-1].slval; } break; -case 330: -#line 2742 "fe/idl.tao_yy" +case 335: +#line 2767 "fe/idl.tao_yy" { tao_yyval.slval = NULL; } break; -case 331: -#line 2749 "fe/idl.tao_yy" +case 336: +#line 2774 "fe/idl.tao_yy" { tao_yyval.slval = new UTL_StrList(tao_yyvsp[-1].sval, tao_yyvsp[0].slval); } break; -case 332: -#line 2757 "fe/idl.tao_yy" +case 337: +#line 2782 "fe/idl.tao_yy" { idl_global->set_parse_state(IDL_GlobalData::PS_OpContextCommaSeen); } break; -case 333: -#line 2761 "fe/idl.tao_yy" +case 338: +#line 2786 "fe/idl.tao_yy" { if (tao_yyvsp[-3].slval == NULL) tao_yyval.slval = new UTL_StrList(tao_yyvsp[0].sval, NULL); @@ -3912,13 +3953,13 @@ case 333: } } break; -case 334: -#line 2770 "fe/idl.tao_yy" +case 339: +#line 2795 "fe/idl.tao_yy" { tao_yyval.slval = NULL; } break; -#line 3921 "y.tab.cpp" +#line 3962 "y.tab.cpp" } tao_yyssp -= tao_yym; tao_yystate = *tao_yyssp; diff --git a/TAO/TAO_IDL/fe/y.tab.cpp.diff b/TAO/TAO_IDL/fe/y.tab.cpp.diff index 5c172efdf1f..a239775ea31 100644 --- a/TAO/TAO_IDL/fe/y.tab.cpp.diff +++ b/TAO/TAO_IDL/fe/y.tab.cpp.diff @@ -1,6 +1,6 @@ --- y.tab.cpp Tue Dec 19 09:31:07 2000 +++ y.tab.cpp.mod Tue Dec 19 09:28:09 2000 -@@ -942,7 +942,7 @@ +@@ -951,7 +951,7 @@ #ifdef TAO_YYMAXDEPTH #define TAO_YYSTACKSIZE TAO_YYMAXDEPTH #else @@ -9,7 +9,7 @@ #endif #endif int tao_yydebug; -@@ -1137,7 +1137,7 @@ +@@ -1146,7 +1146,7 @@ extern char *ace_foo(); #endif @@ -18,7 +18,7 @@ { tao_yyn = *tao_yys; if (tao_yyn >= '0' && tao_yyn <= '9') -@@ -1154,7 +1154,7 @@ +@@ -1163,7 +1163,7 @@ *tao_yyssp = tao_yystate = 0; tao_yyloop: @@ -27,7 +27,7 @@ if (tao_yychar < 0) { if ((tao_yychar = tao_yylex()) < 0) tao_yychar = 0; -@@ -1205,11 +1205,10 @@ +@@ -1213,11 +1213,10 @@ goto tao_yynewerror; #endif diff --git a/TAO/TAO_IDL/fe/y.tab.h b/TAO/TAO_IDL/fe/y.tab.h index 426abceb1e4..aa1e8b13d21 100644 --- a/TAO/TAO_IDL/fe/y.tab.h +++ b/TAO/TAO_IDL/fe/y.tab.h @@ -39,7 +39,7 @@ #define IDL_LOCAL 294 #define IDL_ABSTRACT 295 #define IDL_CUSTOM 296 -#define IDL_FACTORY 297 +#define IDL_INIT 297 #define IDL_PRIVATE 298 #define IDL_PUBLIC 299 #define IDL_SUPPORTS 300 diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index 04cf297792c..d8779edac5c 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -301,16 +301,10 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. </TR> <TR> <TD><CODE>-ORBSkipServiceConfigOpen</CODE></TD> - <TD><A name="-ORBSkipServiceConfigOpen"></a>Do not call the -<code>ACE_Service_Config::open</code> method when initializing the -ORB. This option is generally only useful when dynamically loading -the ORB. - <P> - <FONT COLOR=RED>This option is <STRONG>deprecated</STRONG>. It - is no longer needed since the Service Configurator is now - reentrant and thread-safe.</FONT> - - </TD> + <TD><A name="-ORBSkipServiceConfigOpen"></a>Do not call the <code>ACE_Service_Config::open</code> + method, which is necessary if the ORB is being linked dynamically via the ACE Service Configurator + which is not reentrant. If this flag is not specified, the default behavior of the ORB + is to <CODE>open</CODE> the Service Configurator. </TD> </TR> <TR> <TD><CODE>-ORBGIOPlite</CODE></TD> diff --git a/TAO/examples/Simple/time-date/svc.conf b/TAO/examples/Simple/time-date/svc.conf index 5910a17107d..a984fb78583 100644 --- a/TAO/examples/Simple/time-date/svc.conf +++ b/TAO/examples/Simple/time-date/svc.conf @@ -3,9 +3,27 @@ # to README for details. dynamic Resource_Factory Service_Object * ./Time_Date:_make_My_Resource_Factory() +# Dynamically configure the POA into the application process. +dynamic TAO_POA Service_Object * TAO_PortableServer:_make_TAO_Object_Adapter_Factory() "" + +# Dynamically configure the IORTable into the application process. +dynamic TAO_IORTable Service_Object * TAO_IORTable:_make_TAO_Table_Adapter_Factory() "" + +# Dynamically configure the default IOR parser schemes +dynamic DLL_Parser Service_Object * TAO:_make_TAO_DLL_Parser() +dynamic FILE_Parser Service_Object * TAO:_make_TAO_FILE_Parser() + +# Dynamically configure the CORBA LOC parser +dynamic CORBALOC_Parser Service_Object * TAO:_make_TAO_CORBALOC_Parser() "" + +# Dynamically configure the CORBA NAME parser +dynamic CORBANAME_Parser Service_Object * TAO:_make_TAO_CORBANAME_Parser() "" + +# Dynamically configure the RT Protocol Hooks +#dynamic RT_Protocols_Hooks Service_Object * TAO:_make_TAO_RT_Protocols_Hooks() "" + # Dynamically configure the ORB into the application process. -dynamic ORB Service_Object * ./Time_Date:_make_DLL_ORB() "dummy" +dynamic ORB Service_Object * ./Time_Date:_make_DLL_ORB() "dummy -ORBSkipServiceConfigOpen" # Once the ORB is configured, dynamically configure the Time_Date service. dynamic Time_Date_Servant Service_Object * ./Time_Date:_make_Time_Date_Servant() "dummy -n ORB -o ior" - diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h index d5ec1352d37..1d1344177f7 100644 --- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h +++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h @@ -949,7 +949,7 @@ class TAO_AV_Endpoint_Strategy; */ class TAO_AV_Export TAO_MMDevice :public virtual POA_AVStreams::MMDevice, - public virtual TAO_PropertySet, + public TAO_PropertySet, public virtual PortableServer::RefCountServantBase { @@ -1099,7 +1099,7 @@ class TAO_FlowProducer; */ class TAO_AV_Export TAO_FlowConnection : public virtual POA_AVStreams::FlowConnection, - public virtual TAO_PropertySet, + public TAO_PropertySet, public virtual PortableServer::RefCountServantBase { diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp index b7f31d62156..c6a112d777b 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp @@ -30,6 +30,7 @@ TAO_SSLIOP_Connection_Handler::TAO_SSLIOP_Connection_Handler ( TAO_Connection_Handler (0), current_ (), current_impl_ (), + pending_upcalls_ (1), tcp_properties_ (0), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { @@ -50,6 +51,7 @@ TAO_SSLIOP_Connection_Handler::TAO_SSLIOP_Connection_Handler ( TAO_Connection_Handler (orb_core), current_ (), current_impl_ (), + pending_upcalls_ (1), tcp_properties_ (ACE_static_cast (TAO_IIOP_Properties *, arg)), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) @@ -212,8 +214,8 @@ TAO_SSLIOP_Connection_Handler::handle_close (ACE_HANDLE handle, handle, rm)); - long pending = this->decr_pending_upcalls (); - if (pending <= 0) + --this->pending_upcalls_; + if (this->pending_upcalls_ <= 0) { if (this->transport ()->wait_strategy ()->is_registered ()) { @@ -347,7 +349,7 @@ int TAO_SSLIOP_Connection_Handler::handle_input (ACE_HANDLE) { // Increase the reference count on the upcall that have passed us. - this->incr_pending_upcalls (); + this->pending_upcalls_++; this->resume_flag_ = TAO_RESUMES_CONNECTION_HANDLER; @@ -357,7 +359,7 @@ TAO_SSLIOP_Connection_Handler::handle_input (ACE_HANDLE) int retval = this->transport ()->handle_input_i (resume_handle); // The upcall is done. Bump down the reference count - if (this->decr_pending_upcalls () <= 0) + if (--this->pending_upcalls_ <= 0) retval = -1; if (retval == -1) diff --git a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h index a679dd0a707..6c07a118aef 100644 --- a/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h +++ b/TAO/orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.h @@ -136,6 +136,12 @@ protected: private: + /// Reference count.It is used to count nested upcalls on this + /// svc_handler i.e., the connection can close during nested upcalls, + /// you should not delete the svc_handler until the stack unwinds + /// from the nested upcalls. + long pending_upcalls_; + /// TCP configuration for this connection. TAO_IIOP_Properties *tcp_properties_; diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl index 36239235c4e..55368fed025 100755 --- a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl @@ -57,35 +57,35 @@ sleep $sleeptime; print STDERR "Starting Sender\n"; -$sender = $SV->SpawnWaitKill (1000); +$sender = $SV->SpawnWaitKill (320); if ($sender != 0) { print STDERR "ERROR: sender returned $sender\n"; $status = 1; } -$distributer = $DI->TerminateWaitKill (1000); +$distributer = $DI->TerminateWaitKill (320); if ($distributer != 0) { print STDERR "ERROR: distributer returned $distributer\n"; $status = 1; } -$receiver1 = $RE1->TerminateWaitKill (1000); +$receiver1 = $RE1->TerminateWaitKill (320); if ($receiver1 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$receiver2 = $RE2->TerminateWaitKill (1000); +$receiver2 = $RE2->TerminateWaitKill (320); if ($receiver2 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$nserver = $NS->TerminateWaitKill (1000); +$nserver = $NS->TerminateWaitKill (320); if ($nserver != 0) { print STDERR "ERROR: Naming Service returned $nserver\n"; @@ -127,35 +127,35 @@ sleep $sleeptime; print STDERR "Starting Sender\n"; -$sender = $SV->SpawnWaitKill (1000); +$sender = $SV->SpawnWaitKill (320); if ($sender != 0) { print STDERR "ERROR: sender returned $sender\n"; $status = 1; } -$distributer = $DI->TerminateWaitKill (1000); +$distributer = $DI->TerminateWaitKill (320); if ($distributer != 0) { print STDERR "ERROR: distributer returned $distributer\n"; $status = 1; } -$receiver1 = $RE1->TerminateWaitKill (1000); +$receiver1 = $RE1->TerminateWaitKill (320); if ($receiver1 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$receiver2 = $RE2->TerminateWaitKill (1000); +$receiver2 = $RE2->TerminateWaitKill (320); if ($receiver2 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$nserver = $NS->TerminateWaitKill (1000); +$nserver = $NS->TerminateWaitKill (320); if ($nserver != 0) { print STDERR "ERROR: Naming Service returned $nserver\n"; @@ -197,35 +197,35 @@ sleep $sleeptime; print STDERR "Starting Distributer\n"; -$distributer = $DI->SpawnWaitKill (1000); +$distributer = $DI->SpawnWaitKill (320); if ($distributer != 0) { print STDERR "ERROR: sender returned $distributer\n"; $status = 1; } -$sender = $SV->TerminateWaitKill (1000); +$sender = $SV->TerminateWaitKill (320); if ($sender != 0) { print STDERR "ERROR: sender returned $sender\n"; $status = 1; } -$receiver1 = $RE1->TerminateWaitKill (1000); +$receiver1 = $RE1->TerminateWaitKill (320); if ($receiver1 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$receiver2 = $RE2->TerminateWaitKill (1000); +$receiver2 = $RE2->TerminateWaitKill (320); if ($receiver2 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$nserver = $NS->TerminateWaitKill (1000); +$nserver = $NS->TerminateWaitKill (320); if ($nserver != 0) { print STDERR "ERROR: Naming Service returned $nserver\n"; @@ -267,35 +267,35 @@ sleep $sleeptime; print STDERR "Starting Receiver 2\n"; -$receiver2 = $RE2->SpawnWaitKill (1000); +$receiver2 = $RE2->SpawnWaitKill (320); if ($receiver2 != 0) { print STDERR "ERROR: receiver2 returned $receiver2\n"; $status = 1; } -$distributer = $DI->TerminateWaitKill (1000); +$distributer = $DI->TerminateWaitKill (320); if ($distributer != 0) { print STDERR "ERROR: distributer returned $distributer\n"; $status = 1; } -$receiver1 = $RE1->TerminateWaitKill (1000); +$receiver1 = $RE1->TerminateWaitKill (320); if ($receiver1 != 0) { print STDERR "ERROR: receiver returned $receiver\n"; $status = 1; } -$sender = $SV->TerminateWaitKill (1000); +$sender = $SV->TerminateWaitKill (320); if ($sender != 0) { print STDERR "ERROR: sender returned $sender\n"; $status = 1; } -$nserver = $NS->TerminateWaitKill (1000); +$nserver = $NS->TerminateWaitKill (320); if ($nserver != 0) { print STDERR "ERROR: Naming Service returned $nserver\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl index 6eee4b845dd..ab487875422 100755 --- a/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl @@ -22,9 +22,9 @@ $makefile = PerlACE::LocalFile ("input"); unlink $nsior; $NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior"); -$SV1 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 30"); -$SV2 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 30"); -$SV3 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 30"); +$SV1 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 1"); +$SV2 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 1"); +$SV3 = new PerlACE::Process ("sender", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r 1"); $RE1 = new PerlACE::Process ("receiver", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s distributer -r receiver1 -f output1"); $RE2 = new PerlACE::Process ("receiver", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s distributer -r receiver2 -f output2"); $DI1 = new PerlACE::Process ("distributer", "-ORBSvcConf components_svc.conf -ORBInitRef NameService=file://$nsior -s sender -r distributer"); @@ -94,7 +94,7 @@ sleep $distributer_time; print STDERR "\nStarting Distributer 4\n\n"; -$distributer4 = $DI4->SpawnWaitKill (1500); +$distributer4 = $DI4->SpawnWaitKill (120); if ($distributer4 != 0) { print STDERR "ERROR: distributer4 returned $distributer4\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl index 3bcf1dd1d4e..fccbaee09ba 100755 --- a/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl @@ -49,7 +49,7 @@ sleep $sleeptime; print STDERR "Starting Client\n"; -$client = $CL->SpawnWaitKill (200); +$client = $CL->SpawnWaitKill (160); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl index 233774f256d..9c507bb244c 100755 --- a/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl @@ -41,7 +41,7 @@ sleep $sleeptime; print STDERR "Starting Client\n"; -$client = $CL->SpawnWaitKill (200); +$client = $CL->SpawnWaitKill (60); if ($client != 0) { print STDERR "ERROR: client returned $client\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl index 90885c21c69..34a7d7f4da8 100755 --- a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl @@ -48,7 +48,7 @@ sleep $sleeptime; print STDERR "Starting Distributer\n"; -$distributer = $DI->SpawnWaitKill (200); +$distributer = $DI->SpawnWaitKill (60); if ($distributer != 0) { print STDERR "ERROR: distributer returned $distributer\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl index 3dbedced3e7..2de9e19a586 100755 --- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl +++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl @@ -40,7 +40,7 @@ sleep $sleeptime; print STDERR "Starting Sender\n"; -$sender = $CL->SpawnWaitKill (200); +$sender = $CL->SpawnWaitKill (60); if ($sender != 0) { print STDERR "ERROR: sender returned $sender\n"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/INSTALL.UCB b/TAO/orbsvcs/tests/AVStreams/mpeg/INSTALL.UCB new file mode 100644 index 00000000000..38a656a538b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/INSTALL.UCB @@ -0,0 +1,105 @@ +These are the instructions for compiling mpeg_play, the software MPEG +decoder and player. + +1) Untar the file mpeg_play.tar.Z. This is best done by creating a new +directory for the files involved, moving the tar file into this directory +and invoking the command: + + zcat mpeg_play-2.0.tar.Z | tar xvf - + +2) Create and customize the Makefile. Do this by copying the file +Makefile.proto to Makefile. Then edit Makefile for your particular needs. + +In the makefile the CFLAGS definition is multiply defined for a couple of +different machines, uncomment the one you want to use, or define your own +if necessary. + +The INCLUDEDIR variable should be set to include the paths leading to the +standard header files such as stdio.h as well as to X11/Xlib.h (on most +systems, this is /usr/include). To do this set the INCLUDEDIR variable to +-I followed by the pathname. For example, if the path is /usr/local/include, +edit the Makefile to look like this: + + INCLUDEDIR = -I/usr/local/include + +If more than one pathname is necessary, simply prepend -I to each path. +For example if you needed to include /usr/local/include and /usr/X11/include, +the variable definition would look like: + + INCLUDEDIR = -I/usr/local/include -I/usr/X11/include + +Finally, make sure the LIBS variable is set to the path and name of your X11 +library. For example: + + LIBS = /usr/lib/X11/libX11.a + +3) Type make all. + +4) To remove .o files, type make clean + +5) Add yourself to the mailing list by sending mail to + mpeg-list-request@roger-rabbit.cs.berkeley.edu with the subject line + "ADD" (you can delete yourself by sending the subject line "DEL"). + If you are a uunet user, you can use the mail path + 'uunet!ucbvax!roger-rabbit.cs!mpeg-list-request' + + mail mpeg-list-request@roger-rabbit.cs.berkeley.edu + Subject: ADD + ^D + +6) Try it out! You can ftp some sample data files from the same site + you got this player from. Data files usually end in .mpg or .mpeg + The command line for the player is described in the man page, but + is basically: + + mpeg_play [options] [file_name] + +7) If you want the player to collect statistics on size of frames, + macroblocks, time to decode, etc., add the following to the + definition of CFLAGS in the Makefile: + -DANALYSIS + Remove all .o files with "make clean" and remake with "make all" + The player will now print summarized statistics at the end of the + video clip and can be made to print frame by frame statistics with + the use of the -eachstat flag. Read man page for more info. +------------------------------------------------------------------------ + +Using Imake + +We have included an Imakefile for use with Imake. Since we do not use +Imake ourselves and the file was provided by someone else, we can not +give any specific instructions on how to use it. Please, consult +someone more experienced with Imake. +Thanks. + +------------------------------------------------------------------------ +NOTES + +It seems that much of the time is spent converting the 24 bit MPEG image +to an 8 bit color space. This process is called "dithering". We've included +several dithering algorithms. Read the man pages for more instructions. + +The data files available are produced by XING. These images are +usually small (~160X120). XING data does not take advantage +of P or B frames (ie, frames with motion compensation). The data is simply +a series of I frames. Performance of the player on XING data is +significantly lower (half or less) of the performance when motion compensated +MPEG data is decoded. + +Reporting bugs: + If you find any bugs in this software, please send them to + mpeg-bugs@roger-rabbit.cs.berkeley.edu. Since this software + is unsupported, we make no guarantees about how long it will + take to fix the bug, or if it will be fixed at all. Bug fixes + will be cheerfully accepted. Please include as much detailed + information as possible, including: + + 1) the version number of the program you are using (cf. VERSION) + 2) the data file that caused the bug (if possible) + 3) the OS version and machine type you ran the program on + 4) the compiler used to compile the program + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile new file mode 100644 index 00000000000..061db66688f --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile @@ -0,0 +1,29 @@ +#$Id$ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 +# +# Makefile for MPEG stuff +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +INFO = README + +DIRS = source \ + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile.am new file mode 100644 index 00000000000..1a6e6484914 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/Makefile.am @@ -0,0 +1,27 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- mpeg directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +SUBDIRS = \ + source + +EXTRA_DIST = \ + INSTALL.UCB \ + PatchLevel \ + README \ + README.MI \ + README.OGI \ + README.UCB \ + vcr.1 \ + vcrs.1 diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/PatchLevel b/TAO/orbsvcs/tests/AVStreams/mpeg/PatchLevel new file mode 100644 index 00000000000..fc8384029fb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/PatchLevel @@ -0,0 +1,12 @@ + +1. Current patch level: version 2.0, patch level 1 + +Sun Jun 9 12:26:16 PDT 1996 + +(1). Port to linux 1.3 +(2). Reduce the number of semaphores used in the client to ONE. +(3). Various bug fix + +2. Patch level: version 2.0, patch level 0 + +Tue Nov 28 14:14:58 PST 1995 diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README b/TAO/orbsvcs/tests/AVStreams/mpeg/README new file mode 100644 index 00000000000..a4a5ca3d773 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/README @@ -0,0 +1,83 @@ +TAO MPEG Player +========================== + +This directory contains the source code for TAO's Audio/Video Mpeg +player. This is written using the TAO's Audio/Video streaming service. + +This is a modified version of the Distributed Audio/video Mpeg player +developed at the Oregon Graduate Institute. For more information about +the original player read README.OGI. + +The MPEG-1 player requires X windows and hence may not work on Windows +platforms. + +Linux notes +=========== + +This player requires the Motif headers and libraries in order to run. +Motif is usually not included with most Linux distributions. +Metrolink OpenMotif was tested for this application, and is available from: + +ftp://openmotif.opengroup.org/pub/openmotif/R2.1.30/binaries/metrolink/ + +More information about OpenMotif is available at: +http://www.opengroup.org/openmotif/ + +To run: +====== + +1. Start the Naming service. + +2. Start mpeg/source/server/server + +3. You can start the player + mpeg/source/client/vcr + +The video and audio files can be either specified on the command line +or be read from a file in + + ~/.vcr/vcrPrograms + +The format of the entries should be like this +Three Stooges-1 +/project/merengue/MPEG_movies/ts1_v.mpg +/project/merengue/MPEG_movies/ts1_a.au + +i.e +Name of the Movie. +Video file path +Audio file path. + +You can download some of the MPEG-1 audio and video files from this +URL. + http://www.cs.wustl.edu/~naga/MPEG_movies + +You can also download the .Info files used by the server to store the +information about the MPEG files. + +If you have the ~/.vcr/vcrPrograms then you can select the Prog button +on the player and select the movie. + +You can also give the audio and video files on the command line like + +vcr -v video_file_path -a audio_file_path. + +Using the Trading Service: +========================== + +The mpeg client can also be run using the Trading service to find the +server which can give the best QoS and other properties. + +But in this case follow the steps in 'To run' above but instead of step 2 do the following two steps: + +1. Start the Trading Service +2. Start the mpeg/source/server/augmented_server + +The files for the Trader Agent are in +$TAO_ROOT/orbsvcs/tests/AVStreams/server_discovery. + +For more instructions read the $TAO_ROOT/orbsvcs/tests/AVStreams/server_discovery/README. + + +Nagarajan Surendran (naga@cs.wustl.edu) +Yamuna Krishnamurthy (yamuna@cs.wustl.edu) diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README.MI b/TAO/orbsvcs/tests/AVStreams/mpeg/README.MI new file mode 100644 index 00000000000..85a3069e979 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/README.MI @@ -0,0 +1,39 @@ +Hello animation addicts, + +I'll be brief. This is the modified source of mpeg_play that has a new motif +user interface (finally!). I hope you will enjoy spending many hours using it! +This is a very rough first release and the source files + make files are not +particularly well organized. You might have to do a lot of hand tweaking to get +it to compile. + +Here are some helpful hints: + +/mib directory contains the source for my mib interface construction toolkit + which is really just a wrapper around motif. This is the majority of the + new code and is the same toolkit I used for the X11 version of Geomview + (3d visualization program), also available via ftp from geom.umn.edu. + +/interface directory contains the bitmaps for buttons, and the interface + geometry specified with .mib files. + +ui.c file contains the code which sets up the interface and processes button + callbacks. + +More minor modifications were made to gdith.c util.c util32.c and video.c. + +To compile you will need a decent compiler (gcc works the best!), as well as +the X11, Xt, and Xm (motif) libraries. + +You must first get mib/libmib.a to be created. The Makefile in /mib should take +care of this when properly tweaked. The main makefile should handle linking the +library into the mpeg_play binary. + +If you have any questions or need help with the compile feel free to send me +mail, but I may take a while to respond. I tend to correspond with quite a +few people about many different things. + +best wishes, + +Daeron Meyer + +daeron@geom.umn.edu diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README.OGI b/TAO/orbsvcs/tests/AVStreams/mpeg/README.OGI new file mode 100644 index 00000000000..26a835dac7f --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/README.OGI @@ -0,0 +1,142 @@ + Distributed real-time MPEG video audio player v2.0 + + Distributed Systems Research Group + Department of Computer Science and Engineering + Oregon Graduate Institute of Science & Technology + November, 1995 + + +This directory contains a freely available software distributed +real-time MPEG video and audio player, for use across the +Internet. Please install it, run it, play movies and music, and have +fun ! + +The player features common VCR functionalities like synchronized video +and audio play back, play speed change on the fly, fast-forward, rewind, +step forward, random Positioning, and more. + +This version of the player plays MPEG1 video (elementary stream) and +Sun Sparc format (mu-law) audio. It does not play MPEG1 system streams +or MPEG2 streams yet. + +The player is of server/client architecture, with audio/video servers +and a client distributed across the Internet. The server manages audio +video file retrieval and distribution. The client decodes video +frames, plays video and audio streams, and provides a Motif style user +interface. + +The servers stream out media data to clients, so there is NO NEED to +download all bits beforehand. + +Some important characteristics of Internet are resource sharing, +highly dynamic workload, no resource reservation facility, and lack of +a common clock. This player uses novel software feedback mechanisms +to synchronize servers and clients, and to adapt playback quality to +the current Internet workload. + + +As compared to version 1.0, this version has following improvements: + + - UDP/TCP video audio data connection choice + - support of both native audio device and AudioFile + - client invocable from web browser + - better organized source code tree + - bug fix + - and more... + + +The player has been compiled and tested on following architectures: + + HP-UX 09.03 + SunOS 4.1.3_U1 (sparc) + Solaris 2.3 (sparc) + Solaris 2.4 (i86pc) + Solaris 2.4 (sparc) + Ultrix 4.x + FreeBSD 2.0.5 + LINUX 1.3 + +If you decide to port the player to a new architecture, please let +us know so that we can incorporate the changes into our sources. + + +The player is publicly available via anonymous ftp from: + + ftp.cse.ogi.edu (129.29.20.2) in /pub/dsrg/Player/ + +or through following WWW pointer: + + http://cse.ogi.edu/DISC/projects/synthetix/Player/ + +To install the player, ftp file vcr.tar.Z to local host, move it to a +suitable directory (best to create a new directory for this software), +uncompress and untar the .Z file, and see INSTALL for instructions. +Following is an example of steps to ftp and untar the package: + + % mkdir vcr + % cd vcr + % ftp ftp.cse.ogi.edu + *** login as anonymous and your email address as passwd *** + ftp> cd pub/dsrg/Player + ftp> binary + ftp> get README + ftp> get vcr.tar.Z + ftp> quit + % gunzip vcr.tar.Z (or you may also use 'uncompress vcr.tar.Z') + % tar xf vcr.tar + +Binary code for platforms HPUX, Solaris 2.4 for x86, Solaris 2.x for +Sparc, SunOS4.1.3 and FreeBSD are also available in directory +/pub/dsrg/Player/binaries/. + + +This software is covered by copyrights. It contains code contributed +by the author and several other parties. Please see the beginning of +source files and copyright file(s) in the root directory of the source +tree for more information. + + +Please add yourself to our mailing list by sending a mail (with your +name and address) to following address, so that we can keep you +informed of software upgrade and bug fix. + + scen@cse.ogi.edu + + +We would highly appreciate it if you can share with us the performance +result you get when you play movies retrieved from the OGI +server. Please let us know following information: + + - The platform you use for the client. + + - How many hops from your site to OGI, and what is the + estimated bandwidth, + + - Which picture size (320x240, 256x192, 128x96 or 64x48) + works best for you, and on average how many + frames-per-second can be displayed. + + - Questions, comments, suggestions, and bug report. + +Information can also be sent to: scen@cse.ogi.edu Thank you! + + +ACKNOWLEDGMENT + +We gratefully thank ARPA and the National Science Foundation for their +financial support, and thank Tektronix, Hewlett-Packard and the +Portland Trail Blazers for their donations. + +We also want to thank following people for their code: + + Lawrence A. Rowe, Ketan Patel, and Brian Smith of Computer Science + Division-EECS, Univ. of Calif. at Berkeley. The MPEG decoder used by + the client of the player is originated from their MPEG decoder 2.0 + + Thomas M. Levergood, Andrew C. Payne, James Gettys, G. Winfield + Treese, and Lawrence C. Stewart of Cambridge Research Lab, Digital + Equipment Corporation. The player uses AudioFile as audio output. + + Daeron Meyer of the Geometry Center, University of Minnesota. The + Motif user interface is based on his version. + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README.UCB b/TAO/orbsvcs/tests/AVStreams/mpeg/README.UCB new file mode 100644 index 00000000000..3c122f92421 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/README.UCB @@ -0,0 +1,105 @@ + MPEG Video Software Decoder + (Version 2.0; Jan 27, 1993) + + Lawrence A. Rowe, Ketan Patel, and Brian Smith + Computer Science Division-EECS, Univ. of Calif. at Berkeley + +This directory contains a public domain MPEG video software +decoder. The decoder is implemented as a library that will +take a video stream and display it in an X window on an 8, 24 +or 32 bit deep display. The main routine is supplied to +demonstrate the use of the decoder library. Several dithering +algorithms are supplied based on the Floyd-Steinberg, ordered +dither, and half-toning algorithms that tradeoff quality and +performance. Neither the library nor the main routine handle +real-time synchronization or audio streams. + +The decoder implements the standard described in the Committee +Draft ISO/IEC CD 11172 dated December 6, 1991 which is +sometimes refered to as "Paris Format." The code has been +compiled and tested on the following platforms: + + HP PA-RISC (HP/UX 8.X, X11R4) (i.e., HP 9000/7XX and 9000/3XX) + Sun Sparc (SunOS 4.X, X11R5) + DECstation 5000 and Alpha + IBM RS6000 + Silicon Graphics Indigo + MIPS RISC/os 4.51 + Sequent Symmetry + Sony NEWS + and more than we can list here. + +If you decide to port the code to a new architecture, please let +us know so that we can incorporate the changes into our sources. + +This directory contains everything required to build and +display video. We have included source code, a makefile, an Imakefile, +installation instructions, and a man page. Data files can +be obtained from the same ftp site this was located in. +See the INSTALL file for instructions on how to +compile and run the decoder. + +The data files were produced by XING. XING data does not take +advantage of P or B frames (ie, frames with motion compensation). +Performance of the player on XING data is significantly slower +(half or less) than the performance when motion compensated MPEG +data is decoded. We are very interested in running the software +on other MPEG streams. Please contact us if you have a stream +that does not decode correctly. Also, please send us new streams +produced by others that do utilize P and B frames. + +NOTE: One particular XING data file: raiders.mpg, is not a +valid MPEG stream since it does not contain a sequence +header. + +We have established several mailing lists for messages about +the decoder: + +mpeg-list-dist@CS.Berkeley.EDU + General information on the decoder for everyone interested + should be sent to this list. This should become active after + 11/20/92 + +mpeg-list-request@CS.Berkeley.EDU + Requests to join or leave the list should be sent to this + address. The subject line should contain the single word + ADD or DELETE. + +mpeg-bugs@CS.Berkeley.EDU + Problems, questions, or patches should be sent to this address. + +Our future plans include porting the decoder to run on other +platforms, integrating it into a video playback system that +supports real-time synchronization and audio streams, and +further experiments to improve the performance of the +decoder. Vendors or other organizations interested in supporting +this research or discussing other aspects of this project should +contact Larry Rowe at Rowe@CS.Berkeley.EDU. + +We also plan on producing an MPEG encoder. The encoder will NOT be +a real time digitizer, but will be intended for offline processing +of video data. + +ACKNOWLEDGEMENTS: + We gratefully thank Hewlett-Packard, Fujitsu, the Semiconductor + Research Corporation for financial support. + + We also want to thank the following people for their help: + + Tom Lane of the Independent JPEG Group provided us with + the basic inverse DCT code used by our player. + (tom_lane@g.gp.cs.cmu.edu) + + Reid Judd of Sun Microsystems provided advice and assistance. + + Todd Brunhoff of NVR provided advise and assistance. + + Toshihiko Kawai of Sony provided advise and assistance. + + + + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav b/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav deleted file mode 100644 index c3f7f0135a6..00000000000 --- a/TAO/orbsvcs/tests/AVStreams/mpeg/README.uav +++ /dev/null @@ -1,14 +0,0 @@ -// $Id$ - -The original MPEG player in this directory has been removed, -since it has been superceded by a better example, developed -jointly by BBN Technologies and OOMWorks. - -The example is available here: -http://www.dist-systems.bbn.com/projects/AIRES/UAV/index.shtml - -The members of the team which developed this software were: - -Yamuna Krishnamurthy <yamuna@cs.wustl.edu>, OOMWorks -Irfan Pyarali <irfan@cs.wustl.edu>, OOMWorks -Craig Rodrigues <crodrigu@bbn.com>, BBN diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile new file mode 100644 index 00000000000..9c2153232bd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile @@ -0,0 +1,34 @@ +## $Id$ +#---------------------------------------------------------------------------- +# @(#)Makefile 1.1 +# +# Makefile for MPEG stuff +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +INFO = README + +DIRS = mpeg_shared \ + mpeg_mib \ + mpeg_server \ + mpeg_client \ + client \ + server + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile.am new file mode 100644 index 00000000000..bdcffaba0c7 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/Makefile.am @@ -0,0 +1,29 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- mpeg/source directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +SUBDIRS = \ + client \ + mpeg_client \ + mpeg_mib \ + mpeg_server \ + mpeg_shared \ + server + +EXTRA_DIST = TODO + +dist-hook: + $(mkinstalldirs) $(distdir)/$(subdir) + tar cf - ./include | (cd $(distdir)/$(subdir); tar xfBp -) + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/TODO b/TAO/orbsvcs/tests/AVStreams/mpeg/source/TODO new file mode 100644 index 00000000000..83369830726 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/TODO @@ -0,0 +1,50 @@ +$Id$ + +Use - for things to do, * for urgent things, and + for things that +have been done. + + +Bugs +---- + ++ States problem -- pressing play twice screws up, position is not working ++ client blocks forever while exiting sometimes (often after the above) ++ vs, as don't die as a result of the above ++ server segfaults if addr is already in use + + +- IF peer i.e client aborts connection for some reason the as and vs +processes should die. It currently prints the message peer probably +aborted connection in which case we can try to exit the process. + +Things to do +------------ + +"Simple" things + + +- Make #define's into enums in common.h/globals.h + ++ try compiling ACE and the application with fast=1 to see if + performance improves + +- Rename "play", "play_send" etc. appropriately + + + +"Not-so-simple" things + + ++ Logic for Video_Server is convoluted!! + ++ Need to modularize Audio_Server + ++ Seperate command parsing in its own class + +Naga: +---- +- handle leaks on the server side. + ++ handle leak on the client side due to Naming Service. + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile new file mode 100644 index 00000000000..3ab24c02594 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile @@ -0,0 +1,145 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +FILES = vcr + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) + +LDLIBS = -lTAO_CosNaming -lTAO +MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source +CPPFLAGS += -I$(MPEG_ROOT) + +BIN2 = vcr + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + BIN = $(BIN2) +endif # AV + + +LDLIBS += -lACE -lTAO_AV -lmpeg_shared -lmpeg_mib -lmpeg_client $(PLATFORM_X11_LDFLAGS) -lXm -lXext -lXt -lSM -lICE -lX11 +CPPFLAGS += -DSH_MEM -DNDEBUG $(PLATFORM_X11_CPPFLAGS) + + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/vcr.o .obj/vcr.so .shobj/vcr.o .shobj/vcr.so: vcr.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/dither.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile.am new file mode 100644 index 00000000000..a795144da28 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/Makefile.am @@ -0,0 +1,35 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- mpeg/source/client directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_PROGRAMS = vcr + +vcr_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +vcr_SOURCES = \ + vcr.cpp + +noinst_DATA = svc.conf + +EXTRA_DIST = $(noinst_DATA) + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/svc.conf b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/svc.conf new file mode 100644 index 00000000000..7b853699390 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/svc.conf @@ -0,0 +1,5 @@ +# $Id$ +# +static Resource_Factory "-ORBResources global" +static Client_Strategy_Factory "" +static Server_Strategy_Factory "-ORBConcurrency reactive -ORBSystemidPolicyDemuxStrategy dynamic -ORBTableSize 128" diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/vcr.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/vcr.cpp new file mode 100644 index 00000000000..43c238c56fb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/client/vcr.cpp @@ -0,0 +1,466 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <X11/Intrinsic.h> +#include <sys/types.h> +#include <signal.h> +#include <sys/wait.h> +#ifndef MIPS +#include <netinet/in.h> +#else +#include <bsd/netinet/in.h> +#endif +#if defined(sun) || defined(FreeBSD) +#include <stdlib.h> +#endif +#include <time.h> +#include <sys/time.h> +#include <sys/ipc.h> +#include <sys/shm.h> +#include <sys/sem.h> + +#include "include/common.h" + +#include "mpeg_client/video.h" +#include "mpeg_client/proto.h" +#include "mpeg_client/newproto.h" +#include "mpeg_client/global.h" + +#include "mpeg_client/util.h" +#include "mpeg_client/dither.h" + +#include "mpeg_shared/routine.h" +#include "mpeg_client/ab.h" + +ACE_RCSID(client, vcr, "$Id$") + +static int mainPid; +int orig_argc; +char **orig_argv; + +static time_t start_time; +/* + *-------------------------------------------------------------- + * + * usage -- + * + * Print mpeg_play usage + * + * Results: + * None. + * + * Side effects: + * exits with a return value -1 + * + *-------------------------------------------------------------- + */ + +void +usage(char *s) /* program name */ +{ + fprintf(stderr, "Usage:\n"); + fprintf(stderr, "%s [-rt] [-shmem] [-rmsem]\n", s); + fprintf(stderr, " [-dither ordered|ordered2|fs4|fs2|fs2fast|hybrid|\n"); + fprintf(stderr, " hybrid2|2x2|gray|color|mono|threshold]\n"); + fprintf(stderr, " [X-window options]\n"); + fprintf(stderr, " [-v video_file_name]\n"); + fprintf(stderr, " [-a audio_file_name]\n"); + + fprintf(stderr, " [-p movie_file_name]\n"); + fprintf(stderr, " [-l movie_list_file_name]\n"); + + fprintf(stderr, " [-help]\n"); + fprintf(stderr, " [-quiet]\n"); + + exit (-1); +} + +/* + *-------------------------------------------------------------- + * + * int_handler -- + * + * Handles Cntl-C interupts.. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static int on_exit_tag = 1; +extern AudioBuffer *abuffer; +extern VideoBuffer *vbuffer; + +void set_exit_routine_tag(int tag) +{ + on_exit_tag = tag; +} + +void on_exit_routine(void) +{ + ACE_DEBUG ((LM_DEBUG,"(%P)on_exit_routine")); + if (!on_exit_tag) + return; + if (mainPid ==ACE_OS::getpid ()) + { + extern void delete_semaphore(); + abuffer->ABdeleteSem (); + vbuffer->VBdeleteSem (); + VDdeleteSem(); + delete_semaphore(); + if (getuid() != DEVELOPER_UID) + { + FILE * fp; + char *buf = (char *)ACE_OS::malloc(100); + char *tbuf; + if (buf != NULL) { + sprintf(buf, "%s%s", LOG_DIR, "vcrSession.log"); + if ((fp = fopen(buf, "a")) != NULL) { + time_t val =ACE_OS::time (NULL); + get_hostname(buf, 100); + buf[99] = 0; + tbuf = ACE_OS::ctime (&start_time); + tbuf[strlen(tbuf) - 1] = 0; + fprintf(fp, "User %d on %s at %s %dm%ds\n", ACE_OS::getuid (), buf, + tbuf, (val - start_time) / 60, (val - start_time) % 60); + } + ACE_OS::free (buf); + } + } + } + on_exit_tag = 0; + cerr << "Main process sending SIGINT\n"; + ACE_OS::kill (0, SIGINT); +} + +static void int_handler(int sig) +{ + ACE_OS::exit (0); +} + +static void clear_child(int sig) +{ + int pid; + int status; + + while ((pid = ACE_OS::waitpid (-1, &status, WNOHANG)) > 0) + { + if (status == 0) { + continue; + } + fprintf(stderr, "VCR: child %d (status %d) ", pid, status); + if (WIFEXITED(status)) { + fprintf(stderr, "exited with status %d\n", WEXITSTATUS(status)); + } + else if (WIFSIGNALED(status)) { +#if defined(_HPUX_SOURCE) || defined(__svr4__) || defined(IRIX) + fprintf(stderr, "terminated at signal %d%s.\n", WTERMSIG(status), + WCOREDUMP(status) ? ", core dumped" : ""); +#else + fprintf(stderr, "terminated at signal %d.\n", WTERMSIG(status)); +#endif + } + else if (WIFSTOPPED(status)) { + fprintf(stderr, "stopped at signal %d\n", WSTOPSIG(status)); + } + + } +} + +/* + *-------------------------------------------------------------- + * + * main -- + * + * Parses command line, starts decoding and displaying. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +int main(int argc, char ** argv) +{ + + int mark; + int rmsemFlag = 0; + + argc_share = argc; + argv_share = argv; + + orig_argc = argc; + orig_argv = argv; + mark = 1; + argc--; + + displayName[0] = 0; + ditherType = ORDERED2_DITHER; + LUM_RANGE = 8; + CR_RANGE = CB_RANGE = 4; + noDisplayFlag = 0; + +#ifdef SH_MEM + shmemFlag = 0; +#endif + + while (argc) { + if (ACE_OS::strcmp (argv[mark], "-rt") == 0) { + realTimeFlag = 1; + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-rt1") == 0) { + realTimeFlag = 2; + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-rt2") == 0) { + realTimeFlag = 3; + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-shmem") == 0) { + argc--; mark++; + shmemFlag = 1; + } + else if (ACE_OS::strcmp (argv[mark], "-rmsem") == 0) { + argc--; mark++; + rmsemFlag = 1; + } +#if 0 + else if (ACE_OS::strcmp (argv[mark], "-nop") == 0) { + TogglePFlag(); + argc--; mark++; + } else if (ACE_OS::strcmp (argv[mark], "-nob") == 0) { + ToggleBFlag(); + argc--; mark++; + } +#endif + else if (ACE_OS::strcmp (argv[mark], "-l") == 0) { /* program list file name */ + strcpy(proglistName, argv[++mark]); + argc -= 2; mark++; + + } else if (ACE_OS::strcmp (argv[mark], "-display") == 0) { + strcpy(displayName,argv[++mark]); + argc -= 2; mark++; + } else if (ACE_OS::strcmp (argv[mark], "-dither") == 0) { + argc--; mark++; + if (argc < 1) { + perror("Must specify dither option after -dither flag"); + usage(argv[0]); + } + if (ACE_OS::strcmp (argv[mark], "hybrid") == 0) { + argc--; mark++; + ditherType = HYBRID_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "hybrid2") == 0) { + argc--; mark++; + ditherType = HYBRID2_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "fs4") == 0) { + argc--; mark++; + ditherType = FS4_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "fs2") == 0) { + argc--; mark++; + ditherType = FS2_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "fs2fast") == 0) { + argc--; mark++; + ditherType = FS2FAST_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "hybrid2") == 0) { + argc--; mark++; + ditherType = HYBRID2_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "2x2") == 0) { + argc--; mark++; + ditherType = Twox2_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "gray") == 0) { + argc--; mark++; + ditherType = GRAY_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "color") == 0) { + argc--; mark++; + ditherType = FULL_COLOR_DITHER; + } + /* + else if (ACE_OS::strcmp (argv[mark], "none") == 0) { + argc--; mark++; + ditherType = NO_DITHER; + } + */ + else if (ACE_OS::strcmp (argv[mark], "ordered") == 0) { + argc--; mark++; + ditherType = ORDERED_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "ordered2") == 0) { + argc--; mark++; + ditherType = ORDERED2_DITHER; + } + /* + else if (ACE_OS::strcmp (argv[mark], "mbordered") == 0) { + argc--; mark++; + ditherType = MBORDERED_DITHER; + } + */ + else if (ACE_OS::strcmp (argv[mark], "mono") == 0) { + argc--; mark++; + ditherType = MONO_DITHER; + } else if (ACE_OS::strcmp (argv[mark], "threshold") == 0) { + argc--; mark++; + ditherType = MONO_THRESHOLD; + } else { + perror("Illegal dither option."); + usage(argv[0]); + } + } + else if (ACE_OS::strcmp (argv[mark], "-quiet") == 0) { + argc--; mark++; + quietFlag = 1; + } + else if (ACE_OS::strcmp (argv[mark], "-l_range") == 0) { + argc--; mark++; + LUM_RANGE =ACE_OS::atoi (argv[mark]); + if (LUM_RANGE < 1) { + fprintf(stderr, "Illegal luminance range value: %d\n", LUM_RANGE); + exit(1); + } + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-cr_range") == 0) { + argc--; mark++; + CR_RANGE =ACE_OS::atoi (argv[mark]); + if (CR_RANGE < 1) { + fprintf(stderr, "Illegal cr range value: %d\n", CR_RANGE); + exit(1); + } + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-cb_range") == 0) { + argc--; mark++; + CB_RANGE =ACE_OS::atoi (argv[mark]); + if (CB_RANGE < 1) { + fprintf(stderr, "Illegal cb range value: %d\n", CB_RANGE); + exit(1); + } + argc--; mark++; + } + else if (ACE_OS::strcmp (argv[mark], "-help") == 0) { + usage(argv[0]); + } + else { + argc--; mark++; + } + /* + else if (argv[mark][0] == '-') { + fprintf(stderr, "Un-recognized flag %s\n",argv[mark]); + usage(argv[0]); + } + */ + /* the input video and audio files with options '-v', '-a' and '-p' are processed + at the end of 'ui.c' */ + } + if (ditherType == MBORDERED_DITHER) + { + fprintf(stderr, "Sorry, mbordered dithertype no longer supported.\n"); + ACE_OS::exit (1); + } + setsignal(SIGPIPE, SIG_IGN); + atexit (on_exit_routine); + + if (rmsemFlag) { + if (geteuid() == 0) { /* root, refuse to remove shm and sem ids */ + fprintf(stderr, "You are ROOT, -rmsem is ignored 'cause it's too dangerous.\n"); + } + else { + char *tmpf = tempnam("/tmp", ""); + if (tmpf != NULL) { + char buf[128]; + FILE *fp; + sprintf(buf, "ipcs >%s", tmpf); + system(buf); + if ((fp = fopen(tmpf, "r")) != NULL) { + while (fgets(buf, 128, fp) != NULL && (int)(strlen(buf)) > 10) { + int id; + sscanf(&buf[1], "%d", &id); + if (buf[0] == 'm') { + ACE_OS::shmctl (id, IPC_RMID, NULL); + } + else if (buf[0] == 's') { + union semun sem_union; + sem_union.val = 0; + ACE_OS::semctl (id, 0, IPC_RMID, sem_union); + } + } + fclose(fp); + ACE_OS::unlink (tmpf); + } + ACE_OS::free (tmpf); + } + } + } + + if (quietFlag) { + if ((freopen("/dev/null", "w", stdout) == NULL) || + (freopen("/dev/null", "w", stderr) == NULL)) { + ACE_OS::exit (10); + } + } + + start_time = ACE_OS::time (NULL); + + ACE_OS::setsid (); /* break controlling terminal and creat a new session */ + + mainPid = ACE_OS::getpid (); + + CTRmain(orig_argc,orig_argv); + + return 0; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/include/common.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/include/common.h new file mode 100644 index 00000000000..a2fbb40b4e2 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/include/common.h @@ -0,0 +1,591 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#ifndef _MPEG_COMMON_H +#define _MPEG_COMMON_H + +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +extern int gethostname (char*, size_t); + +#define VERSION 200 /* version 2.00 */ + +#ifdef LITTLE_ENDIAN +#define NeedByteOrderConversion +#elif !defined(BIG_ENDIAN) +#if (defined(vax) || defined(i386) || defined(i486)) && !defined(NeedByteOrderConversion) +#define NeedByteOrderConversion +#endif +#endif + +/*following is defined so that debuging information is printed out for only + specific user (usually software developer), LOG_DIR is also defined */ + +/* +#define LOG_DIR "/home/shanweic/log/" +#define DEVELOPER_UID 8640 +*/ + +/* %% this is where the logging is done.." */ +#define LOG_DIR "./" +#define DEVELOPER_UID 1735 + +#define SFprintf if ((!getuid()) || getuid() == DEVELOPER_UID) fprintf +#define Fprintf if (shared->config.verbose) fprintf + +#define VCR_TCP_PORT 7101 +#define VCR_UNIX_PORT "/tmp/vcr_unix_port01" +#define VCR_ATM_PORT "3005" + +#define SPEEDUP_INV_SCALE 5 /* VS fast starts at 5/(5-1) normal speed */ + +#define AB_BUF_SIZE (64 * 1024) /* size of client AB buffer */ + +#if 0 +#define VB_BUF_SIZE (256 * 1024) /* Size of client VB buffer */ +#endif + +#define VB_BUF_SIZE (1024 * 1024) /* Size of client VB buffer */ + +#define VD_BUF_SIZE (1024 * 1024) /* Size of client VD buffer */ + +#define PATH_SIZE 256 +#define PATTERN_SIZE 100 +#define MAX_FRAMES 54000 /* half hour video at 30FPS */ +#define MAX_VDQUEUE_SIZE 20 +#define MAX_FB_PACKETS 20 /* max number of feedback packet info collected. */ +#define POSITION_RANGE 100 +#define MSGGAP_MIN -10 /* these are used for recording stat of + msgs received by VB */ +#define MSGGAP_MAX 50 + +#define INET_SOCKET_BUFFER_SIZE 1400 + +/* audio type constants */ + +#define AudioTypeMuLaw 0 +#define AudioTypeALaw 1 +#define AudioTypeRIFF 2 +#define AudioTypeLiner16 3 +#define AudioTypeLiner8 4 +#define AudioTypeLiner8Offset 5 + +/* Video and audio compression format */ + +#define VIDEO_MPEG1 0 +#define VIDEO_MPEG2 1 +#define VIDEO_JPEG 3 +#define VIDEO_SIF 4 + +#define AUDIO_RAW 10 +#define AUDIO_MPEG1 11 +#define AUDIO_MPEG2 12 + + +/* system configuration default values */ + +#define DEFAULT_maxFPS 60 +#define DEFAULT_maxSPS 16000 +#define DEFAULT_ffFPS 150 +#define DEFAULT_fbFPS 150 +#define DEFAULT_feedBackDelay 2000 +#define DEFAULT_audioMask 0x1 +#define DEFAULT_encodeType AudioTypeMuLaw +#define DEFAULT_channels 1 +#define DEFAULT_samplesPerSecond 8000 +#define DEFAULT_bytesPerSample 1 +#define DEFAULT_audioTimerDuration 500 +#define DEFAULT_audioBufferedIntervals 2 +#define DEFAULT_framesPerAudioPlay 4 +#define DEFAULT_audioForward 800 +#define DEFAULT_filterPara 50 +#define DEFAULT_maxSPframes 60 +#define DEFAULT_VStimeAdvance 100 + +#define DEFAULT_volume 0 + +/* audio parameter data structure */ + +typedef struct +{ + int encodeType; + int channels; + int samplesPerSecond; + int bytesPerSample; +} AudioParameter; + +/* client processes shared data structure definition */ + +typedef struct +{ + int VDframeNumber; + int VBbufId, VDbufId; + char * VBbufAddr, * VDbufAddr; + int pixelValid; + unsigned char pixel[256]; /* for transfering pixel value from VP to VD */ + + /* command and status */ + int cmd; + int cmdsn; + int cmdBusy; + + int loopBack; + + int framesPerSecond; /* Frames per second */ + int usecPerFrame; /* micro-seconds per frame, actual video speed */ + int samplesPerSecond; /* Samples per second */ + int usecPerSample; /* micro-seconds per sample, actual audio speed */ + + int volumePosition; + int balancePosition; + int speedPosition; + int locationPosition; + struct hostent audioHost; + char audioPath[PATH_SIZE]; + struct hostent videoHost; + char videoPath[PATH_SIZE]; + + int live; /* non-zero if any of the video/audio streams are live source */ + int videoFormat; + int audioFormat; + + /* video channel parameters */ + int totalFrames; + int totalGroups; + int totalHeaders; + int averageFrameSize; + double pictureRate; + int horizontalSize; + int verticalSize; + int pelAspectRatio; + int vbvBufferSize; + int firstGopFrames; + int patternSize; + char pattern[PATTERN_SIZE]; + int IframeGap; + int VStimeAdvance; + + int lastIframeDecoded; + int sendPatternGops; + char sendPattern[PATTERN_SIZE]; + float frameRateLimit; + int framesDropped; + int qosRecomputes; + + /* video channel status */ + int currentGroup; + int currentFrame; + int currentDisplay; + int nextFrame; + int nextGroup; + + /* audio channel parameters */ + int totalSamples; + AudioParameter audioPara; + + /* audio channel status */ + int nextSample; /* played by AP */ + + /* AudioFile device parameter */ + AudioParameter AFPara; + + int currentUPF; + int rtplay; /* realtime tag, -- VD needs to drop frames when needed */ + int collectStat; /* to indicate if statistics should be collected or not */ + int VBheadFrame; /* ID of last frame put to VBbuffer by VB */ + int needHeader; /* VD requests resending of systerm Header */ + int playRoundTripDelay; /* play round trip time (from issuing play/FF/FB + command to first Decoded frame showup in + VD buffer) estimated by CTR start_timer() */ + int audioMaxPktSize; /* 0 -- reliable byte stream, + >0 - non-discard mode packet stream, + <0 - discard mode packet stream */ + int videoMaxPktSize; + + /* System configuration parameters */ + struct + { + int rt; /* play as fast as possible without dropping frames, + and audio turned off when this tag is set to 0 (zero) + */ + int maxFPS; /* maximum PLAY frames-per-second, this play speed is used + during playback when speed scale is set to 100 */ + int maxSPS; /* similar to maxFPS, used when audio is played without + corresponding video + */ + int ffFPS; /* play speed when Fast forward */ + int fbFPS; /* play speed when fast rewind */ + int feedBackDelay; /* msec, delay of feedback when AB, VB received first + packet, 0 (zero) default to adaptive */ + int audioMask; /* mask for audio output device */ + AudioParameter audioPara; /* default audio parameter by system */ + int audioTimerDuration; /* for audio-only case, miliseconds */ + int audioBufferedIntervals; /* for audio-only case, + audioTimerDuration * audioBufferedIntervals + milliseconds of audio samples will be buffered + in AF buffer + */ + int framesPerAudioPlay; /* for audio-video case, each time, samples corresponding + to this number of video frames will be played */ + int audioForward; /* forward value for audio channel, in AFTime unit + (number of samples), audio channel is played ahead of video + by this number of samples. This is introduce to compensate + the dely to AF in audio channel, and usually should be less + than 1 (one) second, but greater than zero. + */ + int VStimeAdvance; /* target VB buffer level to be mentained (micro-seconds). This + is sent in INIT message to VS, to decide how many frames to + be maintained in VB buffer + */ + float frameRateLimit; /* playback frame rate limit (frames per second) */ + int collectStat; /* tag to collect statistics to file 'stat.n' when set */ + int collectFrameInfo; /* collect MPEG frame info to file 'stat.n' when set*/ + int syncEffective; /* tag to make sync mechanism effective when set */ + int qosEffective; /* tag to make QoS control effective when set */ + int audioOffset; /* offset added to audio channel 'nextSample' when play(). + usually audio and video are not recorded strictly + synchronized. This parameter is to compensate it. The + value can be any integer value. + */ + int filterPara; /* 1/R of Median, nsamples of Mean and Average */ + int maxSPframes; /* max number of frame in a sendPattern */ + int audioConn; /* tag for connection oriented audio data channel */ + int videoConn; /* tag for connection oriented video data channel */ + int verbose; + } config; + +#ifdef STAT + struct + { + unsigned VBmaxBytes; /* max fill level (bytes) in VB */ + unsigned VBdroppedFrames; /* accumulative total number of frames dropped by VB + because VB buffer full */ + unsigned VBemptyTimes; /* number of time VD fail to get a frame from VB + immediately */ + unsigned VDnoRef; /* # of frames without reference */ + unsigned VDagainstSendPattern; /* # of frames against send pattern */ + unsigned VDtooLateI; /* # of I frames dropped 'cause too late */ + unsigned VDtooLateP; /* # of P frames dropped 'cause too late */ + unsigned VDtooLateB; /* # of B frames dropped 'cause too late */ + unsigned VDlastFrameDecoded; /* ID of last frame decoded by VD */ + unsigned CTRdropLate; + unsigned CTRdropOutOrder; + unsigned CTRdispOnTime; + unsigned CTRdispLate; + unsigned fbPacketNumber; /* # packets sent by feedback mechanism */ + struct { + int frameId; + int addUsecPerFrame; + int addFrames; + int frames; + int framesDropped; + float frameRateLimit; + int advance; + } fbPackets[MAX_FB_PACKETS]; /* recording FB packet contents */ + unsigned VDqueue[MAX_VDQUEUE_SIZE]; /* record number of frames with VD queue + length of index number */ + int VBmsgGaps[MSGGAP_MAX + 1 - MSGGAP_MIN]; /* # of ind-sized gaps between msgs */ + char VBframesReceived[(MAX_FRAMES + 7)/8]; /* bit array for frames received by VB */ + char VDframesDecoded[(MAX_FRAMES + 7)/8]; /* bit array for frames decoded by VD */ + char VPframesDisplayed[(MAX_FRAMES + 7)/8]; /* bit array for frames displayed by VP */ + short VBfillLevel[MAX_FRAMES]; /* VB buffer fill level (frames) recorded by CTR */ + } stat; +#endif +} SharedData; + +/* command and reply: GUI-CTR, CTR-VS, CTR-AS */ + +/* GUI to CTR, (and also CTR to VS and/or AS) */ + +#define CmdINIT 0 /* followed by: videoHost, videoPath, audioHost, audioPath + each item is passed as a string (without 0), led with length(int) */ +#define CmdINITaudio 1 /* for CTR-AS */ +#define CmdINITvideo 2 /* for CTR-VS */ +#define CmdSTOP 3 +#define CmdFF 4 +#define CmdFB 5 +#define CmdSTEP 6 +#define CmdPLAY 7 +#define CmdREF 20 /* this is for sending REFerence frame by VS + for CmdSTEP and CmdPLAY */ +#define CmdPOSITION 8 /* followed by position */ +#define CmdPOSITIONrelease 9 /* followed by position */ +#define CmdVOLUME 10 /* followed by position */ +#define CmdBALANCE 11 /* followed by position */ +#define CmdSPEED 12 /* followed by position */ +#define CmdLOOPenable 13 +#define CmdLOOPdisable 14 +#define CmdSTATstream 23 /* reply with { | type(byte) | size(int) }+ | */ +#define CmdSTATsent 24 /* reply with { | byte }+ | */ +#define CmdCLOSE 18 +#define CmdFAIL 19 /* followed by a string */ + +#define CmdDONE 15 /* CTR to GUI: + replay for accptance and execution of Above Cmd */ + +#define CmdVPinitScreen 30 /* CTR to VP(GUI), audio-only screen clearning */ +#define CmdVPdisplayFrame 31 /* CTR to VP(GUI) to display the single frame in buffer */ +#define CmdVPclearScreen 32 /* CTR to VP(GUI), to clear all images in VD buffer */ +#define CmdVPaudioPosition 33 /* CTR to VP(GUI), in audio-only case, set position bar */ + +// to terminate the event loop +#define CmdExit 34 + + +// cmd sent by Java GUI to Controller process +#define CmdJINIT 35 + +#define EXIT 36 +#define DECODED 37 + +/* CTR-VS */ + +/* CmdINITvideo: followd by parameters of a fixed structure of 3 integers + reply with CmdINITvideo followed by reply or CmdFAIL followed by a string, +*/ +typedef struct +{ + int sn; + int version; + int nameLength; /* the length of the video file */ + /* this structure is followed by a zero-terminated file name as follows: + char videoFile[]; + */ +} INITvideoPara; + +typedef struct +{ + int live; + int format; + + int totalHeaders; + int totalFrames; + int totalGroups; + int horizontalSize; + int verticalSize; + int pelAspectRatio; + int pictureRate1000; + int vbvBufferSize; + int sizeIFrame; + int sizePFrame; + int sizeBFrame; + int sizeSystemHeader; + int sizeGop; + int averageFrameSize; + int firstGopFrames; + int patternSize; + char pattern[PATTERN_SIZE]; +} INITvideoReply; + +/* CmdPOSITION, CmdPOSITIONrelease: followed by following parameter */ +typedef struct +{ + int sn; + int nextGroup; +} POSITIONpara; + +/* CmdSTEP: followed by following parameter */ +typedef struct +{ + int sn; + int nextFrame; +} STEPpara; + +/* CmdFF, CmdFB: followed by following parameter */ +typedef struct +{ + int sn; + int nextGroup; + int usecPerFrame; + int framesPerSecond; + int VStimeAdvance; +} FFpara; + +/*CmdPLAY: followed by following parameter */ +typedef struct +{ + int sn; + int collectStat; + int nextFrame; + int usecPerFrame; + int framesPerSecond; + int frameRateLimit1000; + int VStimeAdvance; + int sendPatternGops; + char sendPattern[PATTERN_SIZE]; +} PLAYpara; + +/* CmdSPEED: parameter */ +typedef struct +{ + int sn; + int usecPerFrame; + int framesPerSecond; + int frameRateLimit1000; + int sendPatternGops; + char sendPattern[PATTERN_SIZE]; +} SPEEDpara; + +/* CmdLOOPenabe, CmdLOOPdisable, CmdSTOP: following by SN */ + + +/* video channel data packet structure */ + +typedef struct +{ + int cmd; + int cmdsn; + int sh; + int gop; + int frame; + int display; /* display frame number */ + int future; + int past; + int currentUPF; + int dataBytes; +} VideoPacket; + + +/* video channel data message structure */ + +typedef struct +{ + int packetsn; + int packetSize; + int msgsn; + int msgOffset; + int msgSize; +} VideoMessage; + + +/* Feedback parameter structure */ + +typedef struct +{ + int cmdsn; + int needHeader; + int addUsecPerFrame; + int addFrames; + int frameRateLimit1000; + int sendPatternGops; + int sendPattern[PATTERN_SIZE]; +} VideoFeedBackPara; + + + +/* audio channel commands and parameters */ + +/* CmdINITaudio parameter of fixed structure of 3 integers and a AudioPara, + replys with CmdINITaudio followed by reply or CmdFAIL followed by a string */ +typedef struct +{ + int sn; + int version; + AudioParameter para; + int nameLength; + /* char audioFile[] */ +} INITaudioPara; + +typedef struct +{ + int live; + int format; + + AudioParameter para; + int totalSamples; +} INITaudioReply; + + +/* CmdPLAY parameter */ +typedef struct +{ + int sn; + int nextSample; +#if 0 + int samplesPerSecond; /* <= shared->audioPara.samplesPerSecond */ +#endif + int samplesPerSecond; /* audio playback speed */ + int samplesPerPacket; /* Number of samples in a packet */ + int ABsamples; /* size of client VB buffer in samples */ + int spslimit; /* QoS parameter: sps supported by the audio channel */ +} PLAYaudioPara; + +/* STOP followed only by SN */ + +/* CmdSPEED parameter */ +typedef struct +{ + int sn; + int samplesPerSecond; + int samplesPerPacket; /* Number of samples in a packet */ + int spslimit; +} SPEEDaudioPara; + +/* audio packet structure */ +typedef struct +{ + int cmdsn; + int resend; + int samplesPerSecond; + int firstSample; + int samples; + int actualSamples; + int dataBytes; +} AudioPacket; + +typedef struct +{ + int firstSample; /* Id of the first sample in this packet */ + int samples; /* number of samples in current packet */ +} APdescriptor; /* audio packet decriptor */ + +/* audio feedback packet */ +typedef struct +{ + int cmdsn; + int type; /* 0 - feedback command; >=1 - Number of packets to be resent */ + union { + struct { + int addsps; + int addSamples; + } fb; + APdescriptor ap; + } data; +} AudioFeedBackPara; +/* One actual resent request may have multiple APdescriptors depending on + the value in element type, all execpt the first one follows above structure*/ + +typedef struct { + int sh, gop, frame, display, future, past; + int refcount; /* reference count */ + unsigned char * data; /* data buffer for image */ +} FrameBlock; + + +#endif /* _MPEG_COMMON_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/24bit.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/24bit.cpp new file mode 100644 index 00000000000..8b8c0ee03ed --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/24bit.cpp @@ -0,0 +1,218 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <stdlib.h> +#include <string.h> +#include "video.h" +#include "dither.h" +#include "proto.h" + +ACE_RCSID(mpeg_client, 24bit, "$Id$") + +/* + * We'll define the "ConvertColor" macro here to do fixed point arithmetic + * that'll convert from YCrCb to RGB using: + * R = L + 1.40200*Cr; + * G = L - 0.34414*Cb - 0.71414*Cr + * B = L + 1.77200*Cb; + * + * We'll use fixed point by adding two extra bits after the decimal. + */ + +#define BITS 8 +#define ONE ((int) 1) +#define CONST_SCALE (ONE << BITS) +#define ROUND_FACTOR (ONE << (BITS-1)) + +/* Macro to convert integer to fixed. */ +#define UP(x) (((int)(x)) << BITS) + +/* Macro to convert fixed to integer (with rounding). */ +#define DOWN(x) (((x) + ROUND_FACTOR) >> BITS) + +/* Macro to convert a float to a fixed */ +#define FIX(x) ((int) ((x)*CONST_SCALE + 0.5)) + +#define CLAMP(ll,x,ul) ( ((x)<(ll)) ?(ll):( ((x)>(ul)) ?(ul):(x))) + +static int *Cb_r_tab, *Cr_g_tab, *Cb_g_tab, *Cr_b_tab; + +/* + *-------------------------------------------------------------- + * + * InitColorDither -- + * + * To get rid of the multiply and other conversions in color + * dither, we use a lookup table. + * + * Results: + * None. + * + * Side effects: + * The lookup tables are initialized. + * + *-------------------------------------------------------------- + */ + +void +InitColorDither() +{ + int CR, CB, i; + + Cr_b_tab = (int *)ACE_OS::malloc(256*sizeof(int)); + Cr_g_tab = (int *)ACE_OS::malloc(256*sizeof(int)); + Cb_g_tab = (int *)ACE_OS::malloc(256*sizeof(int)); + Cb_r_tab = (int *)ACE_OS::malloc(256*sizeof(int)); + + for (i=0; i<256; i++) { + CB = CR = i; + + CB -= 128; CR -= 128; + + Cb_r_tab[i] = FIX(1.40200) * CB; + Cr_g_tab[i] = -FIX(0.34414) * CR; + Cb_g_tab[i] = -FIX(0.71414) * CB; + Cr_b_tab[i] = FIX(1.77200) * CR; + } +} + + +/* + *-------------------------------------------------------------- + * + * ColorDitherImage -- + * + * Converts image into 24 bit color. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +ColorDitherImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int rows, int cols) +{ + int L, CR, CB; + unsigned int *row1, *row2; + unsigned char *lum2; + int x, y; + unsigned int r, b, g; + int cb_r; + int cr_g; + int cb_g; + int cr_b; + + row1 = (unsigned int *)out; + row2 = row1 + cols; + lum2 = lum + cols; + for (y=0; y<rows; y+=2) { + for (x=0; x<cols; x+=2) { + int R, G, B; + + CR = *cr++; + CB = *cb++; + cb_r = Cb_r_tab[CB]; + cr_g = Cr_g_tab[CR]; + cb_g = Cb_g_tab[CB]; + cr_b = Cr_b_tab[CR]; + + L = *lum++; + L = UP(L); + R = L + cb_r; + G = L + cr_g + cb_g; + B = L + cr_b; +#ifndef LITTLE_ENDIAN + r = CLAMP(0,R,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + b = (CLAMP(0,B,UP(255)) & 0xff00) << BITS; +#else + b = CLAMP(0,B,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + r = (CLAMP(0,R,UP(255)) & 0xff00) << BITS; +#endif + *row1++ = r | g | b; + + L = *lum++; + L = UP(L); + R = L + cb_r; + G = L + cr_g + cb_g; + B = L + cr_b; +#ifndef LITTLE_ENDIAN + r = CLAMP(0,R,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + b = (CLAMP(0,B,UP(255)) & 0xff00) << BITS; +#else + b = CLAMP(0,B,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + r = (CLAMP(0,R,UP(255)) & 0xff00) << BITS; +#endif + *row1++ = r | g | b; + + /* + * Now, do second row. + */ + L = *lum2++; + L = UP(L); + R = L + cb_r; + G = L + cr_g + cb_g; + B = L + cr_b; +#ifndef LITTLE_ENDIAN + r = CLAMP(0,R,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + b = (CLAMP(0,B,UP(255)) & 0xff00) << BITS; +#else + b = CLAMP(0,B,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + r = (CLAMP(0,R,UP(255)) & 0xff00) << BITS; +#endif + *row2++ = r | g | b; + + L = *lum2++; + L = UP(L); + R = L + cb_r; + G = L + cr_g + cb_g; + B = L + cr_b; +#ifndef LITTLE_ENDIAN + r = CLAMP(0,R,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + b = (CLAMP(0,B,UP(255)) & 0xff00) << BITS; +#else + b = CLAMP(0,B,UP(255)) >> BITS; + g = CLAMP(0,G,UP(255)) & 0xff00; + r = (CLAMP(0,R,UP(255)) & 0xff00) << BITS; +#endif + *row2++ = r | g | b; + } + lum += cols; + lum2 += cols; + row1 += cols; + row2 += cols; + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/2x2.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/2x2.cpp new file mode 100644 index 00000000000..43cdea9818b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/2x2.cpp @@ -0,0 +1,377 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <string.h> +#include <stdlib.h> +#include "video.h" +#include "dither.h" +#include "proto.h" + +ACE_RCSID(mpeg_client, 2x2, "$Id$") + +#define RAND_ERR_RANGE 7 +#define RAND_ERR_SUBVAL 3 + +/* Array containing actual pixel values for each possible 2x2 dither pattern. */ + +static unsigned char *dith_a; + +/* Arrays mapping lum, cr, and cb values to portions of dither pattern code. + The addtion of one value from each array yields a valid dither pattern + code. +*/ + +static int lval_a[256+RAND_ERR_RANGE-1]; +static int rval_a[256+RAND_ERR_RANGE-1]; +static int bval_a[256+RAND_ERR_RANGE-1]; + +/* Range of possible dither patterns in each channel. */ + +#define L_DITH_RANGE (((LUM_RANGE-1)*4)+1) +#define CR_DITH_RANGE (((CR_RANGE-1)*4)+1) +#define CB_DITH_RANGE (((CB_RANGE-1)*4)+1) + +/* Arrays of random error terms added to break up contours. */ + +static int *randval_a; +static int **randptr_a; + + +/* + *-------------------------------------------------------------- + * + * Init2x2Dither-- + * + * Initializes structures used for 2x2 dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +Init2x2Dither() +{ + unsigned char *dith_ca; + int numcodes; + int l_range, cr_range, cb_range; + int p1, p2, p3, p4; + int l_dith, cr_dith, cb_dith; + int big_part, small_part; + int i, j; + + l_range = L_DITH_RANGE; + cr_range = CR_DITH_RANGE; + cb_range = CB_DITH_RANGE; + + numcodes = l_range * cr_range * cb_range; + + dith_a = (unsigned char *) ACE_OS::malloc(numcodes*4); + + dith_ca = dith_a; + + for (i=0; i<numcodes; i++) { + l_dith = i % l_range; + + big_part = l_dith / 4; + small_part = l_dith % 4; + + p1 = big_part + ((small_part > 0) ? 1 : 0); + p2 = big_part + ((small_part > 2) ? 1 : 0); + p3 = big_part; + p4 = big_part + ((small_part > 1) ? 1 : 0); + + p1 *= CR_RANGE * CB_RANGE; + p2 *= CR_RANGE * CB_RANGE; + p3 *= CR_RANGE * CB_RANGE; + p4 *= CR_RANGE * CB_RANGE; + + cr_dith = (i/l_range) % cr_range; + + big_part = cr_dith / 4; + small_part = cr_dith % 4; + + p1 += (big_part + ((small_part > 0) ? 1 : 0))*CB_RANGE; + p2 += (big_part + ((small_part > 2) ? 1 : 0))*CB_RANGE; + p3 += (big_part)*CB_RANGE; + p4 += (big_part + ((small_part > 1) ? 1 : 0))*CB_RANGE; + + cb_dith = (i/(cr_range*l_range)) % cb_range; + + big_part = cb_dith / 4; + small_part = cb_dith % 4; + + p1 += (big_part + ((small_part > 0) ? 1 : 0)); + p2 += (big_part + ((small_part > 2) ? 1 : 0)); + p3 += (big_part); + p4 += (big_part + ((small_part > 1) ? 1 : 0)); + + *dith_ca++ = p1; + *dith_ca++ = p2; + *dith_ca++ = p3; + *dith_ca++ = p4; + } + + for (i=RAND_ERR_SUBVAL; i<256+RAND_ERR_SUBVAL; i++) { + j = i-RAND_ERR_SUBVAL; + lval_a[i] = (j * L_DITH_RANGE)/256; + rval_a[i] = (j * CR_DITH_RANGE)/256; + bval_a[i] = (j * CB_DITH_RANGE)/256; + + bval_a[i] *= CR_DITH_RANGE * L_DITH_RANGE * 4; + rval_a[i] *= L_DITH_RANGE * 4; + lval_a[i] *= 4; + } + + for (i=0; i<RAND_ERR_SUBVAL; i++) { + lval_a[i] = lval_a[RAND_ERR_SUBVAL]; + rval_a[i] = rval_a[RAND_ERR_SUBVAL]; + bval_a[i] = bval_a[RAND_ERR_SUBVAL]; + } + + for(i=256+RAND_ERR_SUBVAL; i<256+RAND_ERR_RANGE-1; i++) { + lval_a[i] = lval_a[255+RAND_ERR_SUBVAL]; + rval_a[i] = rval_a[255+RAND_ERR_SUBVAL]; + bval_a[i] = bval_a[255+RAND_ERR_SUBVAL]; + } +} + + +/* + *-------------------------------------------------------------- + * + * RandInit -- + * + * Initializes the random values used for 2x2 dithering. + * + * Results: + * randval_a filled with random values. + * randptr_a filled with random pointers to random value arrays. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void RandInit(int h, int w) +{ + int i; + + randval_a = (int *) ACE_OS::malloc(w*5*sizeof(int)); + randptr_a = (int **) ACE_OS::malloc(h*sizeof(int *)); + +#ifdef NO_LRAND48 + for (i=0; i<w*5; i++) { + long int random(); + + randval_a[i] = random() % RAND_ERR_RANGE; + } + + for (i=0; i<h; i++) { + long int random(); + + randptr_a[i] = randval_a + (random() % (w*2)); + } +#else /* NO_LRAND48 */ + + for (i=0; i<w*5; i++) { + + randval_a[i] = lrand48() % RAND_ERR_RANGE; + } + + for (i=0; i<h; i++) { + + randptr_a[i] = randval_a + (lrand48() % (w*2)); + } +#endif + +} + + +/* + *-------------------------------------------------------------- + * + * PostInit2x2Dither-- + * + * Remaps color numbers in dither patterns to actual pixel + * values allocated by the X server. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +PostInit2x2Dither() +{ + unsigned char *dith_ca; + int i; + + dith_ca = dith_a; + + for (i=0; i < (L_DITH_RANGE * CR_DITH_RANGE * CB_DITH_RANGE); i++) { + + *dith_ca = pixel[*dith_ca]; + dith_ca++; + *dith_ca = pixel[*dith_ca]; + dith_ca++; + *dith_ca = pixel[*dith_ca]; + dith_ca++; + *dith_ca = pixel[*dith_ca]; + dith_ca++; + } +} + + +/* + *-------------------------------------------------------------- + * + * Twox2DitherImage -- + * + * Dithers lum, cr, and cb channels togethor using predefined + * and computed 2x2 dither patterns. Each possible combination of + * lum, cr, and cb values combines to point to a particular dither + * pattern (2x2) which is used to represent the pixel. This assumes + * That the display plane is 4 times larger than the lumianance + * plane. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +Twox2DitherImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + int i, j; + unsigned short *o1, *o2, *o3, *o4; + unsigned char *l1, *l2, *base; + unsigned char B, R; + unsigned short *dith_ca; + int big_adv = 3*w; + int b_val, r_val, l_val; + int *randvalptr; + int randval; + static int first = 1; + + if (first) { + RandInit(h, w); + first = 0; + } + + o1 = (unsigned short *)out; + o2 = (unsigned short *)(out+(2*w)); + o3 = (unsigned short *)(out+(4*w)); + o4 = (unsigned short *)(out+(6*w)); + l1 = lum; + l2 = lum+w; + + for (i=0; i<h; i+=2) { + for(j=0; j<w; j+= 4) { + + B = cb[0]; + b_val = bval_a[B]; + R = cr[0]; + r_val = rval_a[R]; + base = dith_a + b_val + r_val; + + l_val = lval_a[l1[0]]; + dith_ca = (unsigned short *)(base + l_val); + o1[0] = dith_ca[0]; + o2[0] = dith_ca[1]; + + l_val = lval_a[l1[1]]; + dith_ca = (unsigned short *)(base + l_val); + o1[1] = dith_ca[0]; + o2[1] = dith_ca[1]; + + l_val = lval_a[l2[0]]; + dith_ca = (unsigned short *)(base + l_val); + o3[0] = dith_ca[0]; + o4[0] = dith_ca[1]; + + l_val = lval_a[l2[1]]; + dith_ca = (unsigned short *)(base + l_val); + o3[1] = dith_ca[0]; + o4[1] = dith_ca[1]; + + B = cb[1]; + b_val = bval_a[B]; + R = cr[1]; + r_val = rval_a[R]; + base = dith_a + b_val + r_val; + + l_val = lval_a[l1[2]]; + dith_ca = (unsigned short *)(base + l_val); + o1[2] = dith_ca[0]; + o2[2] = dith_ca[1]; + + l_val = lval_a[l1[3]]; + dith_ca = (unsigned short *)(base + l_val); + o1[3] = dith_ca[0]; + o2[3] = dith_ca[1]; + + l_val = lval_a[l2[2]]; + dith_ca = (unsigned short *)(base + l_val); + o3[2] = dith_ca[0]; + o4[2] = dith_ca[1]; + + l_val = lval_a[l2[3]]; + dith_ca = (unsigned short *)(base + l_val); + o3[3] = dith_ca[0]; + o4[3] = dith_ca[1]; + + o1 += 4; + o2 += 4; + o3 += 4; + o4 += 4; + l1 += 4; + l2 += 4; + cb += 2; + cr += 2; + } + + l1 += w; + l2 += w; + o1 += big_adv; + o2 += big_adv; + o3 += big_adv; + o4 += big_adv; + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp new file mode 100644 index 00000000000..a03b378e409 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.cpp @@ -0,0 +1,3292 @@ +// $Id$ + +#include "Command_Handler.h" +#include "ctr.cpp" +#include "tao/debug.h" + +ACE_RCSID(mpeg_client, Command_Handler, "$Id$") + + +Command_Handler::Command_Handler (ACE_HANDLE command_handle) + :command_suspended_ (UNSUSPENDED), + busy_ (0), + video_data_handle_ (-1), + audio_data_handle_ (-1), + command_handle_ (command_handle), + video_control_ (0), + video_reactive_strategy_ (0), + video_client_mmdevice_ (0), + video_streamctrl_ (0), + audio_control_ (0), + audio_reactive_strategy_ (0), + audio_client_mmdevice_ (0), + audio_streamctrl_ (0), + receiver_ (this), + data_host_ (0), + client_sig_handler_ (this), + notification_handler_ (this) +{ +} + +Command_Handler::~Command_Handler (void) +{ + // this->remove_handlers (); + if (ACE_OS::getpid () == CTRpid) + ::remove_all_semaphores (); +} + +int +Command_Handler::parse_args (int argc,char **argv) +{ + ACE_Get_Opt get_opts (argc,argv,"h:"); + int c; + + while ((c= get_opts ()) != -1) + switch (c) + { + case 'h': + this->data_host_ = ACE_OS::strdup (get_opts.optarg); + ACE_DEBUG ((LM_DEBUG,"data_host is %s\n",this->data_host_)); + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR,"Unknown argument %c\n",c),-1); + } + return 0; +} + +TAO_ORB_Manager * +Command_Handler::orb_manager (void) +{ + return &this->orb_manager_; +} + +void +Command_Handler::wait_for_display (Suspended reason) +{ + this->command_suspended_ = reason; + TAO_ORB_Core_instance ()->reactor ()->suspend_handler (this->command_handle_); +} + +// initialize the command handler. + +int +Command_Handler::init (int argc, + char *argv[]) +{ + this->argc_ = argc; + this->argv_ = argv; + + // Increase the debug_level so that we can see the output + TAO_debug_level++; + CORBA::String_var ior; + ACE_TRY_NEW_ENV + { + /* + TAO_AV_CORE::instance ()->init (this->argc_, + this->argv_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->orb_manager_ = TAO_AV_CORE::instance ()->orb_manager (); + */ + this->orb_manager_.init_child_poa (this->argc_, + this->argv_, + "child_poa", + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->parse_args (this->argc_, this->argv_); + // activate the client video mmdevice under the child poa. + ior = this->orb_manager_.activate (&this->receiver_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->orb_manager_.activate_poa_manager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Initialize the naming services + if (my_name_client_.init (orb_manager_.orb ()) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize " + "the TAO_Naming_Client. \n"), + -1); + + char receiver_file[BUFSIZ]; + + ACE_OS::sprintf (receiver_file, + "/tmp/receiver_ior.%d", + getuid ()); + // print the ior of the receiver to a file + FILE *fp = ACE_OS::fopen (receiver_file,"w"); + if (fp != 0) + { + ACE_OS::fprintf (fp,"%s",ior.in ()); + ACE_OS::fclose (fp); + } + + // initialize the client signal handler. + if (this->client_sig_handler_.register_handler () < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for sig_handler failed\n"), + -1); + + if (TAO_ORB_Core_instance ()->reactor ()->register_handler (&this->notification_handler_, + ACE_Event_Handler::READ_MASK) < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for notification handler failed\n"), + -1); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Command_Handler::init"); + return -1; + } + ACE_ENDTRY; + return 0; +} + +// Runs the ORB event loop +int +Command_Handler::run (void) +{ + int result = -1; + ACE_TRY_NEW_ENV + { + result = this->orb_manager_.run (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "orb:run ()"); + return -1; + } + ACE_ENDTRY; + return result; +} + + +int +Command_Handler::handle_timeout (const ACE_Time_Value &, + const void * /* arg */) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t)Command_Handler::handle_timeout called \n")); + return 0; +} + + +int +Command_Handler::resolve_audio_reference (void) +{ + ACE_TRY_NEW_ENV + { + if (this->audio_mmdevice_ior_.in ()!=0) + { + CORBA::Object_var mmdevice_obj = this->orb_manager_.orb ()->string_to_object (this->audio_mmdevice_ior_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (CORBA::is_nil (mmdevice_obj.in ()) == 0) + { + this->audio_server_mmdevice_ = AVStreams::MMDevice::_narrow (mmdevice_obj.in (), + ACE_TRY_ENV); + } + this->audio_mmdevice_ior_ = (char *)0; + return 0; + } + + CosNaming::Name audio_server_mmdevice_name (1); + + audio_server_mmdevice_name.length (1); + audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice"); + CORBA::Object_var audio_server_mmdevice_obj = + this->my_name_client_->resolve (audio_server_mmdevice_name, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->audio_server_mmdevice_ = + AVStreams::MMDevice::_narrow (audio_server_mmdevice_obj.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (this->audio_server_mmdevice_.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " could not resolve Audio_Server_Mmdevice in Naming service\n"), + -1); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Audio_MMDevice successfully resolved: %s\n", + this->orb_manager_.orb ()->object_to_string (this->audio_server_mmdevice_.in (), + ACE_TRY_ENV))); + ACE_TRY_CHECK; + + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Command_Handler::resolve_audio_reference"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +Command_Handler::resolve_video_reference (void) +{ + ACE_TRY_NEW_ENV + { + if (this->video_mmdevice_ior_.in ()!= 0) + { + CORBA::Object_var mmdevice_obj = this->orb_manager_.orb ()->string_to_object (this->video_mmdevice_ior_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (CORBA::is_nil (mmdevice_obj.in ()) == 0) + { + this->video_server_mmdevice_ = AVStreams::MMDevice::_narrow (mmdevice_obj.in (), + ACE_TRY_ENV); + } + this->video_mmdevice_ior_ = (char *) 0; + return 0; + } + CosNaming::Name video_server_mmdevice_name (1); + + video_server_mmdevice_name.length (1); + video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice"); + CORBA::Object_var video_server_mmdevice_obj = + this->my_name_client_->resolve (video_server_mmdevice_name, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->video_server_mmdevice_ = + AVStreams::MMDevice::_narrow (video_server_mmdevice_obj.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (this->video_server_mmdevice_.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " could not resolve Video_Server_Mmdevice in Naming service\n"), + -1); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Video_MMDevice successfully resolved: %s\n", + this->orb_manager_.orb ()->object_to_string (this->video_server_mmdevice_.in (), + ACE_TRY_ENV))); + ACE_TRY_CHECK; + + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Command_Handler::resolve_video_reference"); + return -1; + } + ACE_ENDTRY; + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) MMDevice successfully resolved.\n")); + return 0; +} + +ACE_HANDLE +Command_Handler::get_handle (void) const +{ + return this->command_handle_; +} + +// handle the command sent to us by the GUI process +// this is a reactor callback method +int +Command_Handler::handle_input (ACE_HANDLE fd) +{ + unsigned char cmd; + int val = -1; + + // ACE_DEBUG ((LM_DEBUG, "handle_input, fd: %d\n", fd)); + + if (!(this->busy_)) + { + // Weird hack coming up: + if (fd == cmdSocket) + { + val = OurCmdRead ((char*)&cmd, 1); + this->busy_ = 1; + this->client_sig_handler_.TimerProcessing (); + } + // ACE_DEBUG ((LM_DEBUG, "val: %d, cmd: %d\n", val, cmd)); + // if we get an interrupt while reading we go back to the event loop + if (val == 1) + { + this->busy_ = 0; + return 0; + } + + // fprintf(stderr, "CTR: cmd received - %d\n", cmd); + ACE_TRY_NEW_ENV + { + switch (cmd) + { + case CmdINIT: + ACE_DEBUG ((LM_DEBUG,"(%P|%t) command_handler:CmdINIT received\n")); + if (this->init_av () == -1) + { + this->busy_ = 0; + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) init_av failed\n"),0); + } + // cerr << "init_av done\n"; + break; + case CmdSTOP: + this->stop(); + break; + case CmdFF: + this->fast_forward (); + break; + case CmdFB: + this->fast_backward (); + break; + case CmdSTEP: + this->step (); + break; + case CmdPLAY: + if (this->play (0, + ACE_TRY_ENV) < 0) + { + this->busy_ = 0; + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t)play failed\n"),0); + } + ACE_TRY_CHECK; + break; + case CmdPOSITION: + this->position (); + break; + case CmdPOSITIONrelease: + this->position_release (); + break; + case CmdVOLUME: + this->volume (); + break; + case CmdBALANCE: + this->balance (); + break; + case CmdSPEED: + this->speed (); + break; + case CmdLOOPenable: + { + shared->loopBack = 1; + break; + } + case CmdLOOPdisable: + { + shared->loopBack = 0; + break; + } + default: + fprintf(stderr, "CTR: unexpected command from UI: cmd = %d.\n", cmd); + ACE_OS::exit (1); + break; + } + this->busy_ = 0; + // unset the busy flag,done with processing the command. + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Command_Handler::handle_input ()"); + return 0; + } + ACE_ENDTRY; + } + return 0; +} + +int +Command_Handler::init_av (void) +{ + cerr << "inside init_av \n"; + int i; + + ACE_Time_Value sleep_delay; + sleep_delay.usec(10000); + + /* try to stop and close previous playing */ + if (audioSocket >= 0 || videoSocket >= 0) + { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + // this may have to be taken care of afterwards. + int result = + this->stop_playing(); + if (result < 0) + return result; + + if (audioSocket >= 0) + { + if (ABpid > 0) { + ACE_DEBUG ((LM_DEBUG,"killing the abprocess\n")); + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (asp[0],&message,BUFSIZ); + ABpid = -1; + } + + ACE_OS::sleep(sleep_delay); + } + if (videoSocket >= 0) + { + if (VBpid > 0) { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (vsp[0],&message,BUFSIZ); + VBpid = -1; + } + + ACE_OS::sleep(sleep_delay); + + videoSocket = -1; + while ((!vbuffer->VBbufEmpty()) || !VDbufEmpty()) { + while (VDpeekMsg() != NULL) { + VDreclaimMsg(VDgetMsg()); + } + ACE_OS::sleep(sleep_delay); + } + ACE_OS::sleep(sleep_delay); + } + } + this->close (); + + int result; + /* read in video/audio files */ + // set the vf and af to 0 , very important. + vf [0]= 0; + af [0]=0; + + NewCmd(CmdINIT); + + i = 0; + result = OurCmdRead((char*)&i, 4); + result = OurCmdRead(vf, i); + vf[i] = 0; + result = OurCmdRead((char*)&i, 4); + result = OurCmdRead(af, i); + af[i] = 0; + /* + fprintf(stderr, "INIT: vh-%s, vf-%s, ah-%s, af-%s\n", vh, vf, ah, af); + */ + + shared->live = 0; + shared->audioMaxPktSize = !shared->config.audioConn; + shared->videoMaxPktSize = !shared->config.videoConn; + + if (af[0] != 0) + { + if ((result =init_audio_channel(af)) > 0) + return result; + else if (result < 0) + { + audioSocket = -1; + shared->totalSamples = 0; + } + else + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initialized audio\n")); + shared->nextSample = 0; + if (shared->config.maxSPS < shared->audioPara.samplesPerSecond) + shared->config.maxSPS = shared->audioPara.samplesPerSecond; + } + } + else + { + shared->totalSamples = 0; + audioSocket = -1; + } + if (vf[0] != 0) + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initializing video\n")); + if ((result = this->init_video_channel(vf)) > 0) + return result; + else if (result < 0) + { + shared->totalFrames = 0; /* disable video channel */ + videoSocket = -1; + } + else + { + ACE_DEBUG ((LM_DEBUG, + "%s %d\n", + __FILE__,__LINE__)); + shared->nextFrame = 1; + shared->nextGroup = 0; + shared->currentFrame = shared->currentGroup = shared->currentDisplay = 0; + if (shared->config.maxFPS < shared->framesPerSecond) + shared->config.maxFPS = shared->framesPerSecond; + } + } + else + { + videoSocket = -1; + shared->totalFrames = 0; /* disable video channel */ + } + if (audioSocket < 0 && videoSocket < 0) /* none of video/audio channels is setup */ + { + unsigned char tmp = CmdFAIL; + CmdWrite(&tmp, 1); + /* + fprintf(stderr, "CTR initialization failed.\n"); + */ + return -1; + } + else + { + unsigned char tmp = CmdDONE; + set_speed(); + if (videoSocket >= 0) + this->wait_for_display (INIT); + CmdWrite(&tmp, 1); + if (videoSocket < 0) + { + tmp = CmdVPclearScreen; + CmdWrite(&tmp, 1); + } + cerr << "returning from init_av \n"; + return 0; + } + cerr << "returning from init_av \n"; + return 0; +} + +int +Command_Handler::init_java_av (char *audio_ior, + char *video_ior, + char *audio_file, + char *video_file) +{ + ACE_Time_Value sleep_delay; + sleep_delay.usec(10000); + if (audio_file != 0) + ACE_DEBUG ((LM_DEBUG,"%s\n",audio_file)); + if (video_file != 0) + ACE_DEBUG ((LM_DEBUG,"%s\n",video_file)); + this->audio_mmdevice_ior_ = audio_ior; + this->video_mmdevice_ior_ = video_ior; + + /* try to stop and close previous playing */ + if (audioSocket >= 0 || videoSocket >= 0) + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + // this may have to be taken care of afterwards. + int result = + this->stop_playing(); + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR,"stop_playing failed\n"),result); + + if (audioSocket >= 0) + { + if (ABpid > 0) { + ACE_DEBUG ((LM_DEBUG,"Killing AB Process\n")); + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (asp[0],&message,BUFSIZ); + ABpid = -1; + } + ACE_OS::sleep(sleep_delay); + } + + if (videoSocket >= 0) + { + if (VBpid > 0) { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (vsp[0],&message,BUFSIZ); + VBpid = -1; + } + ACE_OS::sleep(sleep_delay); + + videoSocket = -1; + while ((!vbuffer->VBbufEmpty()) || !VDbufEmpty()) { + while (VDpeekMsg() != NULL) { + VDreclaimMsg(VDgetMsg()); + } + ACE_OS::sleep(sleep_delay); + } + ACE_OS::sleep(sleep_delay); + } + } + this->close (); + + int result; + NewCmd(CmdINIT); + + shared->live = 0; + shared->audioMaxPktSize = !shared->config.audioConn; + shared->videoMaxPktSize = !shared->config.videoConn; + + if (audio_file!= 0) + { + int result; + if ((result = init_audio_channel(audio_file)) > 0) + return result; + else if (result < 0) + { + audioSocket = -1; + shared->totalSamples = 0; + } + else + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initialized audio\n")); + shared->nextSample = 0; + if (shared->config.maxSPS < shared->audioPara.samplesPerSecond) + shared->config.maxSPS = shared->audioPara.samplesPerSecond; + } + } + else + { + shared->totalSamples = 0; + audioSocket = -1; + } + if (video_file!= 0) + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Initializing video\n")); + if ((result = this->init_video_channel(video_file)) > 0) + return result; + else if (result < 0) + { + shared->totalFrames = 0; /* disable video channel */ + videoSocket = -1; + } + else + { + ACE_DEBUG ((LM_DEBUG, + "%s %d\n", + __FILE__,__LINE__)); + shared->nextFrame = 1; + shared->nextGroup = 0; + shared->currentFrame = shared->currentGroup = shared->currentDisplay = 0; + if (shared->config.maxFPS < shared->framesPerSecond) + shared->config.maxFPS = shared->framesPerSecond; + } + } + else + { + videoSocket = -1; + shared->totalFrames = 0; /* disable video channel */ + } + if (audioSocket < 0 && videoSocket < 0) /* none of video/audio channels is setup */ + { + unsigned char tmp = CmdFAIL; + CmdWrite(&tmp, 1); + + fprintf(stderr, "CTR initialization failed.\n"); + + return -1; + } + else + { + unsigned char tmp = CmdDONE; + set_speed(); + if (videoSocket >= 0) + this->wait_for_display (INIT); + CmdWrite(&tmp, 1); + if (videoSocket < 0) + { + tmp = CmdVPclearScreen; + CmdWrite(&tmp, 1); + } + return 0; + } + cerr << "returning from init_av \n"; + return 0; +} + + +int +Command_Handler::init_audio_channel (char *audiofile) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) init_audio_channel called\n")); + this->audio_data_handle_ = -1; + + if (!hasAudioDevice) + { + fprintf(stderr, "CTR warning: Audio device not available, Audio ignored.\n"); + return -1; + } + + if (this->connect_to_audio_server() == -1) + return -1; + + shared->audioMaxPktSize = -INET_SOCKET_BUFFER_SIZE; + /* Initialize with AS */ + { + Audio_Control::INITaudioPara_var para (new + Audio_Control::INITaudioPara); + Audio_Control::INITaudioReply_var reply (new Audio_Control::INITaudioReply); + + + para->sn = shared->cmdsn; + para->version = VERSION; + para->para.encodeType = shared->AFPara.encodeType; + para->para.channels = shared->AFPara.channels; + para->para.samplesPerSecond = shared->AFPara.samplesPerSecond; + para->para.bytesPerSample = shared->AFPara.bytesPerSample; + para->nameLength =ACE_OS::strlen (audiofile)+1; + + para->audiofile.length (strlen(audiofile)); + + for (u_int i=0;i<para->audiofile.length ();i++) + para->audiofile [i] = audiofile [i]; + + // CORBA call + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->audio_control_->init_audio (para.in (), + reply.out (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%) init_audio failed\n"), + -1); + else + ACE_DEBUG ((LM_DEBUG,"(%P|%t) init_audio success \n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "audio_control_->init_audio (..)"); + return -1; + } + ACE_ENDTRY; + + /* + fprintf(stderr, "AF Audio para: encode %d, ch %d, sps %d, bps %d.\n", + para.para.encodeType, para.para.channels, + para.para.samplesPerSecond, para.para.bytesPerSample); + */ + { + + shared->live += reply->live; + shared->audioFormat = reply->format; + shared->audioPara.encodeType = reply->para.encodeType; + shared->audioPara.channels = reply->para.channels; + shared->audioPara.samplesPerSecond = reply->para.samplesPerSecond; + shared->audioPara.bytesPerSample = reply->para.bytesPerSample; + shared->totalSamples = reply->totalSamples; + + fprintf(stderr, "Audio: samples %d, sps %d, bps %d\n", + shared->totalSamples, shared->AFPara.samplesPerSecond, + shared->AFPara.bytesPerSample); + + SetAudioParameter(&shared->audioPara); + } + + /* create AB */ + { + if (ABpid == -1) + { + switch (ABpid = ACE_OS::fork ()) + { + case -1: + ACE_OS::perror ("CTR error on forking AB process"); + ACE_OS::exit (1); + break; + case 0: + { + if (realTimeFlag) { + SetRTpriority("AB", -1); + } + ACE_OS::free (vh); + ACE_OS::free (vf); + ACE_OS::free (ah); + ACE_OS::free (audiofile); + vbuffer->VBdeleteBuf(); + VDdeleteBuf(); + if (cmdSocket >= 0) + ACE_OS::close(cmdSocket); + if (realTimeFlag >= 2) { +#ifdef __svr4__ + if (SetRTpriority("AB", 0)) realTimeFlag = 0; +#elif defined(_HPUX_SOURCE) + if (SetRTpriority("AB", 1)) realTimeFlag = 0; +#endif + } + abuffer->ABprocess(this->audio_data_handle_); + // this->remove_handlers (); + // Before shutting down the orb remove all the handlers registered with it. + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Before shutdown")); + this->orb_manager_.orb ()->shutdown (); + ACE_DEBUG ((LM_DEBUG,"(%P|%t) After shutdown")); + return 1; + } + break; + default: + abuffer->ABflushBuf(0); + break; + } + } + } + } + ACE_DEBUG ((LM_DEBUG,"(%P) Init_audio_channel done\n")); + return 0; +} + +int +Command_Handler::remove_handlers (void) +{ + return 0; +} + +void +Command_Handler::set_mmdevice (CORBA::Object_ptr audio_mmdevice, + const char *audio_file, + CORBA::Object_ptr video_mmdevice, + const char *video_file) + +{ + CORBA::String_var audio_mmdevice_ior ; + CORBA::String_var video_mmdevice_ior ; + ACE_TRY_NEW_ENV + { + audio_mmdevice_ior = + this->orb_manager_.orb ()->object_to_string (audio_mmdevice, + ACE_TRY_ENV); + ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG,"audio_mmdevice ior is %s\n",audio_mmdevice_ior.in ())); + video_mmdevice_ior = + this->orb_manager_.orb ()->object_to_string (video_mmdevice, + ACE_TRY_ENV); + ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG,"audio_mmdevice ior is %s\n",video_mmdevice_ior.in ())); + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR,"set_audio_mmdevice failed\n")); + } + ACE_ENDTRY; + this->init_java_av (audio_mmdevice_ior,video_mmdevice_ior,(char *)audio_file,(char *)video_file); + return; +} + +void +Command_Handler::set_video_data_handle (ACE_HANDLE data_fd) +{ + videoSocket = this->video_data_handle_= data_fd; +} + +void +Command_Handler::set_video_control (Video_Control_ptr video_control) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Setting the video control\n")); + this->video_control_ = video_control; +} + +void +Command_Handler::set_audio_data_handle (ACE_HANDLE data_fd) +{ + audioSocket = this->audio_data_handle_= data_fd; +} + +void +Command_Handler::set_audio_control (Audio_Control_ptr audio_control) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) setting the audio control\n")); + this->audio_control_ = audio_control; +} + +char* +Command_Handler::get_data_host (void) +{ + return this->data_host_; +} + +int +Command_Handler::init_video_channel (char *videofile) +{ + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n",__LINE__, __FILE__, + + fprintf (stderr," File Name is %s\n",videofile); + + if (this->connect_to_video_server () == -1) + return -1; + // set the max_pkt size for video ?? very minimum + shared->videoMaxPktSize = -INET_SOCKET_BUFFER_SIZE; + /* Initialize with VS */ + { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + Video_Control::INITvideoPara_var para (new + Video_Control::INITvideoPara); + Video_Control::INITvideoReply *reply_ptr = 0; + Video_Control::INITvideoReply_out reply (reply_ptr); + + para->sn = shared->cmdsn; + para->version = VERSION; + para->videofile.length (strlen(videofile)); + + // string to sequence <char> + for (u_int i=0;i<para->videofile.length ();i++) + para->videofile [i] = videofile [i]; + + // CORBA call + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->video_control_->init_video (para.in (), + reply, + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + else + ACE_DEBUG ((LM_DEBUG,"(%P|%t) init_video success \n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->init_video (..)"); + return -1; + } + ACE_ENDTRY; + shared->live += reply->live; + shared->videoFormat = reply->format; + shared->totalHeaders = reply->totalHeaders; + shared->totalFrames = reply->totalFrames; + shared->totalGroups = reply->totalGroups; + shared->averageFrameSize = reply->averageFrameSize; + shared->horizontalSize = reply->horizontalSize; + shared->verticalSize = reply->verticalSize; + shared->pelAspectRatio = reply->pelAspectRatio; + shared->pictureRate = ((double)reply->pictureRate1000) / 1000.0; + shared->vbvBufferSize = reply->vbvBufferSize; + shared->firstGopFrames = reply->firstGopFrames; + shared->patternSize = reply->pattern.length (); + if (shared->patternSize == 0) { + + Fprintf(stderr, "CTR warning: patternsize %d\n", shared->patternSize); + + shared->patternSize = 1; + shared->pattern[0] = 'I'; + shared->pattern[1] = 0; + shared->IframeGap = 1; + } + else if (shared->patternSize < PATTERN_SIZE) + { + int i; + char * ptr = shared->pattern + shared->patternSize; + // strncpy(shared->pattern, reply->pattern, shared->patternSize); + for (i=0;i<shared->patternSize;i++) + shared->pattern[i] = reply->pattern [i]; + for (i = 1; i < PATTERN_SIZE / shared->patternSize; i ++) { + // ACE_OS::memcpy (ptr, shared->pattern, shared->patternSize); + for (int j=0; j < shared->patternSize ;j++) + ptr [j] = shared->pattern [j]; + ptr += shared->patternSize; + } + shared->IframeGap = 1; + while (shared->IframeGap < shared->patternSize) + { + if (shared->pattern[shared->IframeGap] == 'I') + break; + else + shared->IframeGap ++; + } + } + else + { + fprintf(stderr, "CTR Error: patternSize %d greater than PATTERN_SIZE %d.\n", + shared->patternSize, PATTERN_SIZE); + ACE_OS::exit (1); + } + fprintf(stderr, "Video: %s, %s\n", + shared->videoFormat == VIDEO_SIF ? "SIF" : + shared->videoFormat == VIDEO_JPEG ? "JPEG" : + shared->videoFormat == VIDEO_MPEG1 ? "MPEG1" : + shared->videoFormat == VIDEO_MPEG2 ? "MPEG2" : "UNKOWN format", + reply->live ? "live source" : "stored source"); + + fprintf(stderr, "Video: numS-%d, numG-%d, numF-%d, aveFrameSize-%d\n", + reply->totalHeaders, reply->totalGroups, reply->totalFrames, + reply->averageFrameSize); + fprintf(stderr, "Video: maxS-%d, maxG-%d, maxI-%d, maxP-%d, maxB-%d\n", + reply->sizeSystemHeader, reply->sizeGop, + reply->sizeIFrame, reply->sizePFrame, reply->sizeBFrame); + fprintf(stderr, + "Video: SHinfo: hsize-%d, vsize-%d, pelAspect-%d, rate-%f, vbv-%d.\n", + reply->horizontalSize, reply->verticalSize, reply->pelAspectRatio, + shared->pictureRate, reply->vbvBufferSize); + shared->pattern[shared->patternSize] = 0; + fprintf(stderr, "Video: firstGopFrames %d, IframeGap %d\n", + reply->firstGopFrames, shared->IframeGap); + shared->pattern[shared->patternSize] = 'I'; + if (reply->totalFrames > MAX_FRAMES && (!shared->live)) + { + fprintf(stderr, + "Error: totalFrames %d > MAX_FRAMES %d, needs change and recompile.\n", + reply->totalFrames, MAX_FRAMES); + ComCloseConn(this->video_data_handle_); + // ComCloseConn(videoSocket); + videoSocket = -1; + return -1; + } + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + + /* create VB, and put INIT frame to VB*/ + { + int sp[2]; /* sp[0] is for CTR and sp[1] is for VB */ + + /* create command socket pair for sending INIT frame to VB, the pipe + should be discard/non-discard in consistent with videoSocket*/ + if (socketpair(AF_UNIX, + shared->videoMaxPktSize >= 0 ? SOCK_STREAM : + SOCK_DGRAM, 0, sp) == -1) + { + ACE_OS::perror ("CTR error on open CTR-VB socketpair"); + ACE_OS::exit (1); + } + + if (VBpid == -1) + { + switch (VBpid = ACE_OS::fork ()) + { + case -1: + ACE_OS::perror ("CTR error on forking VB process"); + ACE_OS::exit (1); + break; + case 0: + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + if (realTimeFlag) { + SetRTpriority("VB", -1); + } + ACE_OS::free (vh); + ACE_OS::free (videofile); + ACE_OS::free (ah); + ACE_OS::free (af); + ::close(sp[0]); + //::close (videoSocket); + // if (audioSocket >= 0) + // ComCloseFd(audioSocket); + ::close (audioSocket); + abuffer->ABdeleteBuf(); + VDdeleteBuf(); + if (cmdSocket >= 0) + ::close(cmdSocket); + if (realTimeFlag >= 2) { +#ifdef __svr4__ + if (SetRTpriority("VB", 0)) realTimeFlag = 0; +#elif defined(_HPUX_SOURCE) + if (SetRTpriority("VB", 1)) realTimeFlag = 0; +#endif + } + if (vbuffer->VBprocess(sp[1], this->video_data_handle_) == -1) + { + ACE_DEBUG ((LM_DEBUG,"VBprocess exiting as init failed\n")); + ACE_OS::exit (2); + } + else + { + // this->remove_handlers (); + this->orb_manager_.orb ()->shutdown (); + return 1; + } + break; + default: + ::close(sp[1]); + // ::close(dataSocket); + { + int bytes, res; + /* passing all messages of INIT frame to VB here. */ + char * buf = (char *)ACE_OS::malloc(INET_SOCKET_BUFFER_SIZE); + VideoMessage *msg = (VideoMessage *)buf; + int pkts = 1, msgo = 0, msgs = 0; + + if (buf == NULL) { + ACE_OS::perror ("CTR error on ACE_OS::malloc() for INIT frame"); + ACE_OS::exit (1); + } + while (msgo + msgs < pkts) { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + // cerr << "expecting a packet of size " << sizeof (*msg) << endl; + + VideoRead(buf, sizeof(*msg)); + //~~ we need to read the first frame from the + // data socket instead of control socket. + // SocketRecv(dataSocket, buf, size); + // ACE_DEBUG ((LM_DEBUG,"packetsn = %d,msgsn = %d\n",msg->packetsn,msg->msgsn)); + pkts = ntohl(msg->packetSize); + msgo = ntohl(msg->msgOffset); + msgs = ntohl(msg->msgSize); + if (shared->videoMaxPktSize >= 0) { /* non-discard mode */ + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + write_bytes(sp[0], buf, sizeof(*msg)); + bytes = msgs; + while (bytes > 0) { + int size = min(bytes, INET_SOCKET_BUFFER_SIZE); + VideoRead(buf, size); + write_bytes(sp[0], buf, size); + bytes -= size; + } + } + else { + // cerr << "expecting a packet of size " << msgs << endl; + + VideoRead(buf + sizeof(*msg), msgs); + bytes = sizeof(*msg) + msgs; + while ((res = ACE_OS::write (sp[0], buf, bytes)) == -1) { + if (errno == EINTR || errno == ENOBUFS) continue; + ACE_OS::perror ("CTR error on sending INIT frame to VB"); + ACE_OS::exit (1); + } + if (res < bytes) { + fprintf(stderr, "CTR warn: send() res %dB < bytes %dB\n", res, bytes); + } + /* + Fprintf(stderr, + "CTR transferred INIT frame to VB: pkts %d, msgo %d, msgs %d\n", + pkts, msgo, msgs); + */ + } + } + ACE_OS::read (sp[0], buf, 1); /* read a garbage byte, to sync with VB */ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Command process read a garbage bytes\n")); + ::close(sp[0]); + ACE_OS::free (buf); + } + break; + } + } + } + } + return 0; +} + + +int +Command_Handler::stat_stream (CORBA::Char_out /* ch */, + CORBA::Long_out /* size */) +{ + return 0; +} + + +int +Command_Handler::close (void) +{ + ACE_TRY_NEW_ENV + { + if (CORBA::is_nil (this->audio_control_) == 0) + { + // one way function call. + this->audio_control_->close (ACE_TRY_ENV); + + ACE_TRY_CHECK; + if (ABpid > 0) { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (asp[0],&message,BUFSIZ); + ABpid = -1; + } + ACE_DEBUG ((LM_DEBUG,"(%P|%t) audio close done \n")); + } + + if (CORBA::is_nil (this->video_control_) == 0) + { + // one way function call. + this->video_control_->close (ACE_TRY_ENV); + ACE_TRY_CHECK; + if (VBpid > 0) { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (vsp[0],&message,BUFSIZ); + VBpid = -1; + } + ACE_DEBUG ((LM_DEBUG,"(%P|%t) video close done \n")); + } + this->orb_manager_.child_poa ()->destroy (1,0,ACE_TRY_ENV); + ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG,"(%P|%t)destroy childpoa done\n")); + + this->orb_manager_.init_child_poa (argc_, + argv_, + "child_poa", + ACE_TRY_ENV); + ACE_TRY_CHECK; + ACE_DEBUG ((LM_DEBUG,"(%P)New child poa initialized\n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->close (..)"); + return -1; + } + ACE_ENDTRY; + delete this->audio_reactive_strategy_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + delete this->audio_client_mmdevice_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + // delete this->audio_streamctrl_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + delete this->video_reactive_strategy_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + delete this->video_client_mmdevice_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + // delete this->video_streamctrl_; + ACE_DEBUG ((LM_DEBUG,"(%P)%N,%l")); + return 0; +} + + +int +Command_Handler::stat_sent (void) +{ + return 0; +} + + +int +Command_Handler::fast_forward (void) + +{ + // CORBA call + unsigned char tmp; + Video_Control::FFpara_var para (new Video_Control::FFpara); + /* + fprintf(stderr, "CTR: FF . . .\n"); + */ + if (shared->live) { + beep(); + } + else { + this->stop_playing (); + if (shared->nextGroup < 0) + shared->nextGroup = 0; + if (videoSocket >= 0 && shared->nextGroup < shared->totalGroups) + { + NewCmd(CmdFF); + shared->needHeader = 0; + shared->framesPerSecond = shared->config.ffFPS / + shared->patternSize; + shared->usecPerFrame = (int)(1000000.0 / (float)shared->config.ffFPS) * + shared->patternSize; + + shared->VStimeAdvance = + max(shared->config.VStimeAdvance, DEFAULT_VStimeAdvance) * 1000; + if (shared->VStimeAdvance < shared->usecPerFrame) + shared->VStimeAdvance = shared->usecPerFrame; + + para->VStimeAdvance = shared->VStimeAdvance; + para->sn = shared->cmdsn; + para->nextGroup = shared->nextGroup; + para->usecPerFrame = shared->usecPerFrame; + para->framesPerSecond = shared->framesPerSecond; + startTime = get_usec(); + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->video_control_->fast_forward (para.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + ACE_DEBUG ((LM_DEBUG,"(%P|%t) fast_forward done \n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->fast_forward_video (..)"); + return -1; + } + ACE_ENDTRY; + start_timer(); + } + } + tmp = CmdDONE; + CmdWrite(&tmp, 1); + return 0; +} + + +int +Command_Handler::fast_backward (void) + +{ + unsigned char tmp; + Video_Control::FBpara_var para (new Video_Control::FBpara); + /* + fprintf(stderr, "CTR: FB . . .\n"); + */ + if (shared->live) { + beep(); + } + else { + this->stop_playing(); + if (shared->nextGroup >= shared->totalGroups) + shared->nextGroup = shared->totalGroups - 1; + if (videoSocket >= 0 && shared->nextGroup >= 0) + { + NewCmd(CmdFB); + shared->needHeader = 0; + shared->framesPerSecond = shared->config.fbFPS / + shared->patternSize; + shared->usecPerFrame = (int)(1000000.0 / (float)shared->config.fbFPS) * + shared->patternSize; + + shared->VStimeAdvance = + max(shared->config.VStimeAdvance, DEFAULT_VStimeAdvance) * 1000; + if (shared->VStimeAdvance < shared->usecPerFrame) + shared->VStimeAdvance = shared->usecPerFrame; + + para->VStimeAdvance = shared->VStimeAdvance; + para->sn = shared->cmdsn; + para->nextGroup = shared->nextGroup; + para->usecPerFrame = shared->usecPerFrame; + para->framesPerSecond = shared->framesPerSecond; + startTime = get_usec(); + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->video_control_->fast_backward (para.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + ACE_DEBUG ((LM_DEBUG,"(%P|%t) fast_backward done \n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->fast_forward_video (..)"); + return -1; + } + ACE_ENDTRY; + + start_timer(); + } + } + tmp = CmdDONE; + CmdWrite(&tmp, 1); + return 0; +} + + +int +Command_Handler::step (void) + +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Command_Handler::step ()\n")); + Video_Control::STEPpara_var para (new Video_Control::STEPpara); + this->stop_playing (); + NewCmd (CmdSTEP); + if (videoSocket >= 0 && shared->nextFrame <= shared->totalFrames) + { /* when shared->nextFrame == shared->totalFrame, it will force VS to send a ENDSEQ, + to let VD give out the remaining frame in its ring[] buffer */ + para->sn = shared->cmdsn; + para->nextFrame = shared->nextFrame; + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->video_control_->step (para.in (), + ACE_TRY_ENV); + ACE_DEBUG ((LM_DEBUG,"(%P|%t) step done \n")); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->step (..)"); + return -1; + } + ACE_ENDTRY; + /* + fprintf(stderr, "CTR: STEP . . . frame-%d\n", para.nextFrame); + */ + this->wait_for_display (STEP); + } +// unsigned char tmp = CmdDONE; +// CmdWrite(&tmp, 1); + return 0; +} + +int +Command_Handler::play (int auto_exp, + CORBA::Environment& ACE_TRY_ENV) +{ + CORBA::Long vts = 0; + CORBA::Long ats = 0; + CORBA::Boolean result = 0; + int cmdstarted = 0; + int stuffsamples = 0; + + // this->timer_.start (); + fprintf (stderr, "CTR: PLAY . . .\n"); + + this->stop_playing (); + + if (!shared->live && !shared->config.rt && videoSocket >= 0) { + /* rtplay turned off only when video avaible and not want RT play */ + rtplay = 0; + fprintf (stderr, "VCR is not playing at in realtime mode, audio disabled\n"); + } + else { + rtplay = 1; + } + + if (shared->live) { + rtplay = 1; + shared->nextFrame = 0; + shared->nextSample = 0; + } + + shared->rtplay = rtplay; + + if (shared->nextFrame < 0) + shared->nextFrame = 0; + else if (shared->nextFrame >= shared->totalFrames) + { + shared->nextFrame = shared->totalFrames - 1; + } + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) nextFrame=%d,totalFrames=%d", + // shared->nextFrame,shared->totalFrames)); + if (audioSocket >= 0 && shared->nextSample < shared->totalSamples && rtplay) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) %s,%d\n",__FILE__,__LINE__)); + Audio_Control::PLAYPara_var para (new Audio_Control::PLAYPara); + if (cmdstarted == 0) + { + NewCmd (CmdPLAY); + if (!auto_exp) set_speed (); + cmdstarted = 1; + } + + if (videoSocket >= 0 && rtplay && !shared->live) { + /* video channel also active, recompute nextSample */ + shared->nextSample = (int) ( (double)shared->audioPara.samplesPerSecond * + ( (double)shared->nextFrame / shared->pictureRate)); + shared->nextSample += shared->config.audioOffset; + if (shared->nextSample < 0) { + stuffsamples = (- shared->nextSample); + shared->nextSample = 0; + } + else if (shared->nextSample >= shared->totalSamples) + shared->nextSample = shared->totalSamples - 1; + } + + abuffer->ABflushBuf (shared->nextSample); + + para->sn = shared->cmdsn; + para->nextSample = shared->nextSample; + para->samplesPerSecond = shared->samplesPerSecond; + para->samplesPerPacket = 1024 / shared->audioPara.bytesPerSample; + para->ABsamples = AB_BUF_SIZE / shared->audioPara.bytesPerSample; + para->spslimit = 32000; + + startTime = get_usec (); + // CORBA call. + + result =this->audio_control_->play (para.in (), + ats, + ACE_TRY_ENV); + + if (result == 0) + return -1; + ACE_CHECK_RETURN (-1); + } + if (videoSocket >= 0 && shared->nextFrame < shared->totalFrames) + { + Video_Control::PLAYpara_var para (new Video_Control::PLAYpara); + + if (cmdstarted == 0) + { + NewCmd (CmdPLAY); + if (!auto_exp) set_speed (); + cmdstarted = 1; + } + shared->VBheadFrame = -1; + shared->needHeader = 0; + { + int i = shared->config.maxSPframes; + i = (int) ( (double)i * (1000000.0 / (double)shared->usecPerFrame) / + shared->pictureRate); + shared->sendPatternGops = max (min (i, PATTERN_SIZE) / shared->patternSize, 1); + } + cmdstarted = 1; +#ifdef STAT + shared->collectStat = (shared->config.collectStat && (!shared->live)); + if (shared->collectStat) + { + int i; + memset (& (shared->stat), 0, sizeof (shared->stat)); + shared->stat.VDlastFrameDecoded = (unsigned)-1; + for (i = 0; i < MAX_FRAMES; i++) + shared->stat.VBfillLevel[i] = SHRT_MIN; + speedPtr = 0; + } +#endif + shared->VStimeAdvance = + max (shared->config.VStimeAdvance, DEFAULT_VStimeAdvance) * 1000; + if (shared->VStimeAdvance < shared->usecPerFrame) + shared->VStimeAdvance = shared->usecPerFrame; + + para->VStimeAdvance = shared->VStimeAdvance; + para->sn = shared->cmdsn; + para->nextFrame = shared->nextFrame; + para->usecPerFrame = shared->usecPerFrame; + para->framesPerSecond = shared->framesPerSecond; + para->collectStat = shared->collectStat; + frate = shared->config.frameRateLimit; + if (frate <= 0.0) { + frate = 1.0; + } + shared->frameRateLimit = frate; + para->frameRateLimit1000 = + (long) (shared->frameRateLimit * 1000.0); + compute_sendPattern (); + para->sendPatternGops = shared->sendPatternGops; + // memcpy (para->sendPattern, shared->sendPattern, PATTERN_SIZE); + + // Sequence of chars + + para->sendPattern.length (PATTERN_SIZE); + + for (int i=0; i<PATTERN_SIZE ; i++) + para->sendPattern [i] = shared->sendPattern [i]; + + startTime = get_usec (); + // CORBA call + result =this->video_control_->play (para.in (), + vts, + ACE_TRY_ENV); + if (result == 0) + return -1; + ACE_CHECK_RETURN (-1); + ACE_DEBUG ((LM_DEBUG,"(%P|%t)Reached line %d in %s",__LINE__,__FILE__)); + if (shared->config.qosEffective) { + /* + fprintf (stderr, "CTR start FeedBack with init frameRateLimit %lf\n", + frate); + */ + maxfr = frate; /* max frame rate all the time during one playback */ + minupf = (int) (1000000.0 / maxfr); /* min usec-per-frame all the time + during one playback */ + maxrate = (double)minupf / (double)max (shared->usecPerFrame, minupf); + /* this is current max frame rate in percentage against 'maxfr', + current max frame rate is the lower of 'maxfr' and play speed */ + frate = 1.0; /* current sending frame rate, in percentage against 'maxfr' + This value is set with init value as 1.0, so that if current + speed is lower than frameRateLimit, no frames are dropped, + then when play speed increases frame rate will increase + accordingly until frames are dropped*/ + adjstep = ( (double)minupf / (double)shared->usecPerFrame) / + (double)max (shared->patternSize * shared->sendPatternGops, 5); + /* adjust step for current play speed, in percentage against + 'maxfr' */ + + fbstate = 1; + fb_startup = 1; + + + fprintf (stderr, "CTR init frate: %f minupf %d, shared->upf %d\n", + frate, minupf, shared->usecPerFrame); + + } + } + + if (shared->live && (videoSocket >= 0) && (audioSocket >= 0)) { + int gap = get_duration (ats, vts); + if (gap < 0 || gap >= 5000000) { + Fprintf (stderr, "Error for live source: ats %u, vts %u, gap %d\n", + ats, vts, gap); + } + else { + int skipped = gap * shared->audioPara.samplesPerSecond / 1000000; + skipped += shared->config.audioOffset; + abuffer->ABskipSamples (skipped); + Fprintf (stderr, "Live source: skipped %d audio samples\n", skipped); + } + } + else if (stuffsamples) { + abuffer->ABskipSamples (-stuffsamples); + } + if (cmdstarted) + start_timer (); + unsigned char tmp = CmdDONE; + CmdWrite (&tmp, 1); + return 0; +} + +int +Command_Handler::position_action (int operation_tag) +{ + int val; + unsigned char tmp = CmdDONE; + OurCmdRead ((char*)&val, 4); + + this->operation_tag_ = operation_tag; + this->position_val_ = val; + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) position_action called\n")); + if (shared->live) { + beep(); + } + else { + shared->locationPosition = val; + this->stop_playing (); + NewCmd(CmdPOSITION); + if (videoSocket >= 0) + { + int gop = shared->nextGroup; + Video_Control::POSITIONpara_var para (new Video_Control::POSITIONpara); + shared->nextGroup = ((shared->totalGroups-1) * val) / POSITION_RANGE; + /* + fprintf(stderr, "CTR: POSITION%s %d (nextGop %d). . .\n", + operation_tag ? "_released" : "", val, shared->nextGroup); + */ + if (gop != shared->nextGroup || operation_tag) + { + shared->nextFrame = ((shared->totalFrames-1) * val) / POSITION_RANGE; + para->sn = shared->cmdsn; + para->nextGroup = shared->nextGroup; + tmp = CmdPOSITION; + ACE_TRY_NEW_ENV + { + CORBA::Boolean result; + result = this->video_control_->position (para.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) position done \n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_control_->position (..)"); + return -1; + } + ACE_ENDTRY; + if (operation_tag) /* release or LOOPrewind */ + this->wait_for_display (POSITION); + } +// if (operation_tag && audioSocket >= 0) /* needs to adjust audio position */ +// { + +// shared->nextSample = (int)((double)shared->audioPara.samplesPerSecond * +// ((double)shared->nextFrame / shared->pictureRate)); +// // ACE_DEBUG ((LM_DEBUG,"shared->nextsample = %d\n",shared->nextSample)); +// } + } +// else if (audioSocket >= 0) +// shared->nextSample = (shared->totalSamples-1) * val / POSITION_RANGE; + } +// tmp = CmdDONE; +// CmdWrite(&tmp, 1); + return 0; +} + +int +Command_Handler::position (void) + +{ + return this->position_action (0); +} + +int +Command_Handler::position_release (void) + +{ + return this->position_action (1); +} + +int +Command_Handler::volume (void) + +{ + OurCmdRead((char *)&shared->volumePosition, 4); + if (audioSocket >= 0) { + SetAudioGain(); + } + /* + unsigned char tmp = CmdDONE; + tmp = CmdDONE; + CmdWrite(&tmp, 1); + */ + return 0; +} + +int +Command_Handler::balance (void) + +{ + OurCmdRead((char *)&shared->balancePosition, 4); + /* + unsigned char tmp = CmdDONE; + tmp = CmdDONE; + CmdWrite(&tmp, 1); + */ + return 0; +} + +int +Command_Handler::speed (void) + +{ + ACE_DEBUG ((LM_DEBUG,"COmmand_Handler::speed ()\n")); + CORBA::Boolean result; + OurCmdRead((char *)&shared->speedPosition, 4); + set_speed(); + ACE_TRY_NEW_ENV + { + if (!shared->live && shared->cmd == CmdPLAY) + { + if (videoSocket >= 0) + { + Video_Control::SPEEDpara_var para (new Video_Control::SPEEDpara); + para->sn = shared->cmdsn; + para->usecPerFrame = shared->usecPerFrame; + para->framesPerSecond = shared->framesPerSecond; + para->frameRateLimit1000 = + (long)(shared->frameRateLimit * 1000.0); + { + int i = shared->config.maxSPframes; + i = (int) ((double)i * (1000000.0 / (double)shared->usecPerFrame) / + shared->pictureRate); + shared->sendPatternGops = max(min(i, PATTERN_SIZE) / shared->patternSize, 1); + } + compute_sendPattern(); + para->sendPatternGops = shared->sendPatternGops; + para->sendPattern.length (PATTERN_SIZE); + for (int i=0; i< PATTERN_SIZE ; i++) + para->sendPattern[i]=shared->sendPattern[i]; + // CORBA call + result = this->video_control_->speed (para.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + if (fbstate) { + maxrate = (double)minupf / (double)max(shared->usecPerFrame, minupf); + adjstep = ((double)minupf / (double)shared->usecPerFrame) / + (double)max(shared->patternSize * shared->sendPatternGops, 5); + fbstate = 1; + } + } + if (audioSocket >= 0) + { + Audio_Control::SPEEDPara_var para (new Audio_Control::SPEEDPara); + para->sn = shared->cmdsn; + para->samplesPerSecond = shared->samplesPerSecond; + para->samplesPerPacket = 1024 / shared->audioPara.bytesPerSample; + para->spslimit = 32000; + // CORBA call + result = + this->audio_control_->speed (para.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + if (result == (0)) + return -1; + } + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "audio_control->speed ()"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + + +int +Command_Handler::stop (void) + +{ +#ifdef STAT + unsigned char preCmd = shared->cmd; +#endif + /* + fprintf(stderr, "CTR: STOP . . .\n"); + */ + this->stop_playing (); + + if (shared->live && videoSocket >= 0) { + Fprintf(stderr, "CTR live video stat: average disp frame rate: %5.2f fps\n", + shared->pictureRate * displayedFrames / shared->nextFrame); + } + unsigned char tmp = CmdDONE; + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) command_handler::Stop :nextFrame=%d\n",shared->nextFrame)); + CmdWrite(&tmp, 1); + + return 0; +} + +int +Command_Handler::stop_playing (void) +{ + unsigned char precmd = shared->cmd; + ACE_Time_Value sleep_delay; + sleep_delay.usec(100000); + + ACE_TRY_NEW_ENV + { + if (precmd == CmdFF || precmd == CmdFB || precmd == CmdPLAY) + { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + NewCmd(CmdSTOP); + + /* notify AS and/or VS */ + if ((CORBA::is_nil (this->audio_control_) == 0) + && precmd == CmdPLAY + && rtplay) + { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + // CORBA call + CORBA::Boolean result = + this->audio_control_->stop (shared->cmdsn, + ACE_TRY_ENV); + // cerr << "audio_control_->stop result is " << result << endl; + if (result == (0)) + return -1; + ACE_TRY_CHECK; + } + if (CORBA::is_nil (this->video_control_) == 0) + { + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + // CORBA call + CORBA::Boolean result = + this->video_control_->stop (shared->cmdsn, + ACE_TRY_ENV); + if (result == (0)) + return -1; + ACE_TRY_CHECK; + } + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) Reached line %d in %s\n", __LINE__, __FILE__)); + + /* stop timer and sleep for a while */ + // cerr << "stopping timer" << endl; + this->client_sig_handler_.stop_timer (); + ACE_OS::sleep(sleep_delay); + + /* purge VDbuf and audio channel from AS*/ + if (videoSocket >= 0) + { + while (VDpeekMsg() != NULL) + VDreclaimMsg(VDgetMsg()); + /* + Fprintf(stderr, "CTR: VDbuf purged.\n"); + */ + fbstate = 0; + + } + + /* adjust some info */ + if (precmd == CmdPLAY && videoSocket >= 0) + shared->nextFrame = shared->currentFrame+1; + else + shared->nextGroup = shared->currentGroup + 1; + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Command_Handler.stop(..)"); + return -1; + } + ACE_ENDTRY; + return 0; +} + +// connects and handshakes with the server +int +Command_Handler::connect_to_video_server (void) +{ + // set the pointers to the correct values + // *max_pkt_size = -INET_SOCKET_BUFFER_SIZE; + // initialize the command handler , ORB + ACE_TRY_NEW_ENV + { + if (this->resolve_video_reference () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) command_handler: resolve_video_reference returned -1"), + -1); + AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); + AVStreams::flowSpec_var flow_spec (new AVStreams::flowSpec); + // Bind the client and server mmdevices. + + + ACE_NEW_RETURN (this->video_reactive_strategy_, + Video_Endpoint_Reactive_Strategy_A (&this->orb_manager_, + this), + -1); + ACE_NEW_RETURN (this->video_client_mmdevice_, + TAO_MMDevice (this->video_reactive_strategy_), + -1); + + this->orb_manager_.activate_under_child_poa ("Video_Client_MMDevice", + this->video_client_mmdevice_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_NEW_RETURN (this->video_streamctrl_, + TAO_StreamCtrl, + -1); + + AVStreams::MMDevice_var video_client_mmdevice + = this->video_client_mmdevice_->_this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->video_streamctrl_->bind_devs (video_client_mmdevice.in (), + this->video_server_mmdevice_.in (), + the_qos.inout (), + flow_spec.in (), + ACE_TRY_ENV); + + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "video_streamctrl.bind_devs:"); + return -1; + } + ACE_ENDTRY; + + return 0; + +} + +// connects and handshakes with the server +int +Command_Handler::connect_to_audio_server (void) +{ + + // // set the pointers to the correct values + // *max_pkt_size = -INET_SOCKET_BUFFER_SIZE; + + ACE_TRY_NEW_ENV + { + + if (this->resolve_audio_reference () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) command_handler: resolve_audio_reference returned -1"), + -1); + AVStreams::streamQoS_var the_qos (new AVStreams::streamQoS); + AVStreams::flowSpec_var the_flows (new AVStreams::flowSpec); + + ACE_NEW_RETURN (this->audio_reactive_strategy_, + Audio_Endpoint_Reactive_Strategy_A (&this->orb_manager_, + this), + -1); + + ACE_NEW_RETURN (this->audio_client_mmdevice_, + TAO_MMDevice (this->audio_reactive_strategy_), + -1); + + // activate the client audio mmdevice under the child poa. + this->orb_manager_.activate_under_child_poa ("Audio_Client_MMDevice", + this->audio_client_mmdevice_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_NEW_RETURN (this->audio_streamctrl_, + TAO_StreamCtrl, + -1); + + AVStreams::MMDevice_var audio_client_mmdevice + = this->audio_client_mmdevice_->_this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Bind the client and server mmdevices. + this->audio_streamctrl_->bind_devs (audio_client_mmdevice.in (), + this->audio_server_mmdevice_.in (), + the_qos.inout (), + the_flows.in (), + ACE_TRY_ENV); + + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "audio_streamctrl.bind_devs:"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +// ======================================== +// Decode_Notification_Handler methods. + +Decode_Notification_Handler::Decode_Notification_Handler (Command_Handler *command_handler) + :command_handler_ (command_handler) +{ +} + +ACE_HANDLE +Decode_Notification_Handler::get_handle (void) const +{ + return vdsp[0]; +} + +int +Decode_Notification_Handler::handle_input (ACE_HANDLE fd) +{ + ACE_DEBUG ((LM_DEBUG,"Decode_Notification_Handler::handle_input \n")); + char message[BUFSIZ]; + int result = + ACE_OS::read (fd,&message,BUFSIZ); + if (result == -1) + ACE_ERROR_RETURN ((LM_ERROR,"Decode_Notification_Handler::handle_input read failed\n"),0); + if (result == 0) + ACE_ERROR_RETURN ((LM_ERROR,"Decode_Notification_Handler::handle_input socket closed\n"),0); + + if (message[0] != DECODED) + ACE_ERROR_RETURN ((LM_ERROR,"Decode_Notification_Handler:: Not a decoded message\n"),0); + + // Resume the command handler. + if (this->command_handler_->command_suspended_ != UNSUSPENDED) + { + unsigned char tmp; + switch (this->command_handler_->command_suspended_) + { + case INIT: + tmp = CmdDONE; + CmdWrite(&tmp, 1); + if (videoSocket < 0) + { + tmp = CmdVPclearScreen; + CmdWrite(&tmp, 1); + } + break; + case STEP: + tmp = CmdDONE; + CmdWrite(&tmp, 1); + break; + case POSITION: + if (this->command_handler_->operation_tag_ && audioSocket >= 0) /* needs to adjust audio position */ + { + + shared->nextSample = (int)((double)shared->audioPara.samplesPerSecond * + ((double)shared->nextFrame / shared->pictureRate)); + // ACE_DEBUG ((LM_DEBUG,"shared->nextsample = %d\n",shared->nextSample)); + } + if (audioSocket >= 0) + shared->nextSample = (shared->totalSamples-1) * (this->command_handler_->position_val_) / POSITION_RANGE; + tmp = CmdDONE; + CmdWrite(&tmp, 1); + break; + default: + ACE_DEBUG ((LM_DEBUG,"INVALID STATE for command suspension\n")); + break; + } + TAO_ORB_Core_instance ()->reactor ()->resume_handler (this->command_handler_->get_handle ()); + } + ::usr1_handler (0); + return 0; +} + + +// ---------------------------------------------------------------------- +// Client_Sig_Handler methods + +void +Client_Sig_Handler::PlayAudioOnly(void) +{ + int maxSize; + int size, csize; /* all in samples */ + unsigned int AFtime; + + if (audioFirst) + { + audioFirst = 0; + nextAFtime = GetAudioTime() + audioForward; + } + else + if ((int)(nextAFtime - GetAudioTime()) >= bufferedSamples) + return; + + if (timer_on >4) + { + // ~~we may need to uncomment this ?? + this->stop_timer (); + + // stop both the audio and video servers + this->command_handler_->stop (); + /* tries to rewind and play again */ + if (shared->loopBack) + { + /* + fprintf(stderr, "CTR: trying loopBack().\n"); + */ + loopBack(); + } + + return; + } + if (nextASSample >= shared->totalSamples) + { + timer_on ++; + return; + } + if (shared->samplesPerSecond >= shared->audioPara.samplesPerSecond) + maxSize = (AudioBufSize/shared->audioPara.bytesPerSample); + else + maxSize = ((AudioBufSize/shared->audioPara.bytesPerSample) * + shared->samplesPerSecond) / + shared->audioPara.samplesPerSecond; + for (;;) + { + size = abuffer->ABgetSamples(rawBuf, maxSize); + csize = AudioConvert(size); + AFtime = PlayAudioSamples(nextAFtime, convBuf, csize); + nextASSample += size; + shared->nextSample += size; + nextAFtime += csize; + if ((int)(nextAFtime - AFtime) < 0) + nextAFtime = AFtime; + if (nextASSample >= shared->totalSamples) + { + timer_on ++; + break; + } + /* + Fprintf(stderr, "CTR: nextAFtime:%d, AFtime:%d, bufferedSamples:%d\n", + nextAFtime, AFtime, bufferedSamples); + */ + if ((int)(nextAFtime - AFtime) >= bufferedSamples) + break; + } + { + unsigned char tmp = CmdVPaudioPosition; + CmdWrite(&tmp, 1); + } +} + +// handles the timeout SIGALRM signal +Client_Sig_Handler::Client_Sig_Handler (Command_Handler *command_handler) + : command_handler_ (command_handler) +{ +} + +Client_Sig_Handler::~Client_Sig_Handler (void) +{ + TAO_ORB_Core_instance ()->reactor ()->remove_handler (this, + ACE_Event_Handler::NULL_MASK); + + TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set); +} + +int +Client_Sig_Handler::register_handler (void) +{ + // Assign the Sig_Handler a dummy I/O descriptor. Note that even + // though we open this file "Write Only" we still need to use the + // ACE_Event_Handler::NULL_MASK when registering this with the + // ACE_Reactor (see below). + this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); + ACE_ASSERT (this->handle_ != -1); + + // Register signal handler object. Note that NULL_MASK is used to + // keep the ACE_Reactor from calling us back on the "/dev/null" + // descriptor. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this, ACE_Event_Handler::NULL_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + + // Create a sigset_t corresponding to the signals we want to catch. + + this->sig_set.sig_add (SIGINT); + this->sig_set.sig_add (SIGQUIT); + this->sig_set.sig_add (SIGALRM); + this->sig_set.sig_add (SIGUSR2); + this->sig_set.sig_add (SIGSEGV); + + // Register the signal handler object to catch the signals. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler (sig_set, + this) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + return 0; +} + +int +Client_Sig_Handler::remove_handler (void) +{ + if (TAO_ORB_Core_instance ()->reactor ()->remove_handler (this, + ACE_Event_Handler::NULL_MASK) == -1) + ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler for null mask\n")); + + if (TAO_ORB_Core_instance ()->reactor ()->remove_handler (sig_set) == -1) + ACE_DEBUG ((LM_DEBUG,"(%P)remove_handler failed for client_sig handler for sig set\n")); + return 0; +} + +// Called by the ACE_Reactor to extract the fd. +ACE_HANDLE +Client_Sig_Handler::get_handle (void) const +{ + return this->handle_; +} + +int +Client_Sig_Handler::handle_input (ACE_HANDLE) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n")); + return 0; +} + +int +Client_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n")); + return 0; +} + +// This method handles all the signals that are being caught by this +// object. In our simple example, we are simply catching SIGALRM, +// SIGINT, and SIGQUIT. Anything else is logged and ignored. +// +// There are several advantages to using this approach. First, +// the behavior triggered by the signal is handled in the main event +// loop, rather than in the signal handler. Second, the ACE_Reactor's +// signal handling mechanism eliminates the need to use global signal +// handler functions and data. + +int +Client_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) +{ + int status; + pid_t pid; + //ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum)); + + switch (signum) + { + case SIGSEGV: + ::remove_all_semaphores (); + exit (0); + case SIGALRM: + // Handle the timeout + this->TimerHandler (signum); + // %% ??!!! + break; + case SIGCHLD: + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum)); + pid = ACE_OS::wait (&status); + return 0; + case SIGINT: + ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S, removing signal handlers from the reactor\n", signum)); + this->command_handler_->close (); + TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set); + TAO_ORB_Core_instance ()->orb ()->shutdown (); + return 0; + default: + ACE_DEBUG ((LM_DEBUG, + "(%t) %S: not handled, returning to program\n", + signum)); + return 0; + } + this->TimerProcessing (); + return 0; +} + +void +Client_Sig_Handler::TimerHandler(int /* sig */) +{ + int currentUPF = shared->currentUPF; + /* + Fprintf(stderr, "CTR in TimerHandler.\n"); + */ + if (videoSocket >= 0 && shared->cmd == CmdPLAY && currentUPF != timerUPF) + { + struct itimerval val; + { + val.it_interval.tv_sec = val.it_value.tv_sec = currentUPF / 1000000; + val.it_interval.tv_usec = val.it_value.tv_usec = currentUPF % 1000000; + setitimer(ITIMER_REAL, &val, NULL); + /* + fprintf(stderr, "CTR: timer speed changed to %d upf.\n", shared->currentUPF); + */ + } + timerUPF = currentUPF; +#ifdef STAT + if (shared->collectStat && speedPtr < SPEEDHIST_SIZE) + { + speedHistory[speedPtr].frameId = shared->nextFrame; + speedHistory[speedPtr].usecPerFrame = timerUPF; + speedHistory[speedPtr].frameRateLimit = shared->frameRateLimit; + speedHistory[speedPtr].frames = shared->sendPatternGops * shared->patternSize; + speedHistory[speedPtr].framesDropped = shared->framesDropped; + } + speedPtr ++; +#endif + } + /* + fprintf(stderr, "+\n"); + */ + if (!timerCount) { + int addedVSwat; + if (shared->cmd == CmdPLAY) { + addedVSwat = shared->usecPerFrame * (shared->VBheadFrame - shared->nextFrame); + } + else if (shared->cmd == CmdFF) { + addedVSwat = shared->usecPerFrame * (shared->VBheadFrame - shared->nextGroup); + } + else { /* shared->cmd == CmdFB */ + addedVSwat = shared->usecPerFrame * (shared->nextGroup - shared->VBheadFrame); + } + shared->VStimeAdvance += addedVSwat; + } + timerCount += timer_signals_skip + 1; + timer_signals_skip = 0; + + if (shared->live ) { + if (audioSocket <= 0) { /* video only */ + unsigned t = shared->VBheadFrame - startVSA; + if (timerCount < t) { + /* + Fprintf(stderr, "CTR: (av) timerCount %d, t %d\n", timerCount, t); + */ + timerCount = t; + } + } + } + double frames_per_group = + (double)shared->totalFrames/shared->totalGroups; + long nextframe = shared->nextGroup * frames_per_group; + + if (audioSocket > 0) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Adjusting audio nextsample value\n")); + shared->nextSample = (int)((double)shared->audioPara.samplesPerSecond * + ((double)nextframe / shared->pictureRate)); + + /* audio involved, TimerProcessing() will adjust the rate automatically */ + } + if ((shared->cmd == CmdFF) || (shared->cmd == CmdFB)) + shared->nextFrame = (int) (shared->nextGroup * frames_per_group); +} + +void +Client_Sig_Handler::stop_timer(void) +{ + struct itimerval val; + + if (!timer_on) + return; + + timer_on = 0; + + // setsignal(SIGALRM, SIG_IGN); + + val.it_interval.tv_sec = val.it_value.tv_sec = 0; + val.it_interval.tv_usec = val.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &val, NULL); + + fprintf(stderr, "CTR: timer stopped.\n"); + + // this->command_handler_->stop_timer (); + /* + ACE_Time_Value sleep_delay; + sleep_delay.usec(200000); + ACE_OS::sleep(sleep_delay); + */ +} + +void +Client_Sig_Handler::DisplayPicture(void) +{ + // ACE_DEBUG ((LM_DEBUG,"inside DisplayPicture\n")); + int toDisplay = 1; + int count = timerCount; + ACE_Time_Value sleep_delay; + + if ((shared->cmd != CmdPLAY && + shared->cmd != CmdFF && + shared->cmd != CmdFB) || + lastCount == count) + ACE_ERROR ((LM_ERROR,"Returning from first if in DisplayPicture\n")); + if (timer_on >4) /* 4 is a magic number */ + { + this->stop_timer(); + + // stop both the audio and video. + this->command_handler_->stop (); + + /* tries to rewind and play again */ + if (shared->cmd == CmdPLAY && shared->loopBack) + loopBack(); + + ACE_ERROR ((LM_ERROR,"Returning because timer_on > 4\n")); + } + /* + Fprintf(stderr, "CTR in diplayPicture().\n"); + */ + { + FrameBlock *buf, *next; +#if 0 + if (shared->cmd == CmdPLAY && rtplay && + (i = shared->nextFrame - shared->firstGopFrames) > 0) { + j = (i / shared->patternSize) % shared->sendPatternGops; + i %= shared->patternSize; + if (shared->pattern[i] != 'B') { + while (i > 0) { + if (shared->pattern[--i] != 'B') break; + } + } + toDisplay = (shared->sendPattern + j * shared->patternSize)[i]; + } + else if (shared->cmd != CmdPLAY) { + if (last_disp_fid != shared->nextGroup) toDisplay = 1; + else toDisplay = 0; + } + if (toDisplay) +#endif + { + if (shared->cmd == CmdPLAY && !rtplay) { /* if play with best effort */ + while (VDcheckMsg() <= 0) /* keep sleeping for 10 millisec until a decoded + frame show up in VD buffer */ + sleep_delay.usec(10000); + ACE_OS::sleep(sleep_delay); + } +#ifdef STAT + if (shared->collectStat) + { + shared->stat.VBfillLevel[shared->nextFrame] = + shared->VBheadFrame - shared->nextFrame; + i = VDcheckMsg(); + if (i < 0) i = 0; + else if (i >= MAX_VDQUEUE_SIZE) i = MAX_VDQUEUE_SIZE - 1; + shared->stat.VDqueue[i] ++; + } +#endif + toDisplay = 0; + for (;;) + { + buf = VDpeekMsg(); + + if (buf == NULL) { + // ACE_DEBUG ((LM_DEBUG,"Null buffer ")); + goto loop_end; + } + + switch (shared->cmd) + { + // ACE_DEBUG ((LM_DEBUG,"nextFrame = %d,nextGroup\n",shared->nextFrame,shared->nextGroup)); + int position; + case CmdPLAY: + position = shared->nextFrame; + // ACE_DEBUG ((LM_DEBUG,"nextFrame = %d,nextGroup\n",shared->nextFrame,shared->nextGroup)); + /* + Fprintf(stderr, "CTR PLAY: buf->display %d, position %d\n", + buf->display, position); + */ + if (buf->display == position) + { /* display it */ + buf = VDgetMsg(); + shared->nextGroup = buf->gop + 1; +#ifdef STAT + shared->stat.CTRdispOnTime ++; +#endif + goto display_picture; + } + else if (buf->display > position) + { /* too early, wait for future display */ + goto loop_end; + } + else /* this picture too late */ + { + // this line gets the buffer or dequeues from the shared memory queue + buf = VDgetMsg(); + if (((next = VDpeekMsg()) == NULL || next->display > position) && + buf->display > last_disp_fid) { +#ifdef STAT + shared->stat.CTRdispLate ++; +#endif + /* buf is the last one, or next too to early, display it anyway */ + goto display_picture; + } + else /* next not too early, discard buf */ + { +#ifdef STAT + if (buf->display < last_disp_fid) + shared->stat.CTRdropOutOrder ++; + else + shared->stat.CTRdropLate ++; +#endif + /* + Fprintf(stderr, "CTR drops frame display=%d, shared->nextFrame=%d\n", + buf->display, shared->nextFrame); + */ + VDreclaimMsg(buf); + continue; + } + } + break; + case CmdFF: + position = shared->nextGroup; + if (buf->gop == position) + { /* display it */ + buf = VDgetMsg(); + shared->nextFrame = buf->display; + // ACE_DEBUG ((LM_DEBUG,"nextFrame = %d\n",shared->nextFrame)); + goto display_picture; + } + else if (buf->gop > position) + { /* hold it for future display */ + goto loop_end; + } + else /* discard late picture */ + { + buf = VDgetMsg(); + if ((next = VDpeekMsg()) == NULL || next->gop > position) + /* buf is the last one, or next too to early, display it anyway */ + goto display_picture; + else /* next not too early, discard buf */ + { + VDreclaimMsg(buf); + continue; + } + } + break; + case CmdFB: + position = shared->nextGroup; + if (buf->gop == position) + { /* display it */ + buf = VDgetMsg(); + shared->nextFrame = buf->display; + // ACE_DEBUG ((LM_DEBUG,"nextFrame = %d\n",shared->nextFrame)); + goto display_picture; + } + else if (buf->gop < position) + { /* hold it for future display */ + goto loop_end; + } + else /* discard late picture */ + { + buf = VDgetMsg(); + if ((next = VDpeekMsg()) == NULL || next->gop < position) + /* buf is the last one, or next too to early, display it anyway */ + goto display_picture; + else /* next not too early, discard buf */ + { + VDreclaimMsg(buf); + continue; + } + } + break; + default: + goto loop_end; + } + } + display_picture: + toDisplay = 1; + if (shared->cmd == CmdPLAY) last_disp_fid = buf->display; + else last_disp_fid = buf->gop; +#ifdef STAT + if (shared->live) displayedFrames ++; + if (shared->collectStat) + shared->stat.VPframesDisplayed[buf->display >> 3] |= 1 << (buf->display % 8); +#endif + { + unsigned char tmp = CmdVPdisplayFrame; + CmdWrite(&tmp, 1); + } + CmdWrite((unsigned char *)&buf, sizeof(char *)); + loop_end:; + } + } + + if (shared->cmd == CmdPLAY) + { + shared->nextFrame += rtplay ? count - lastCount : 1; + if (shared->nextFrame >= shared->totalFrames) + { + timer_on ++; + shared->nextFrame = shared->totalFrames; + } + + /* following is frameRate feedback algorithm */ + if (fbstate && toDisplay && rtplay) { + static Filter *fr = NULL; /* frame-rate filter */ + static int start; /* feedback action time, in microseconds */ + static int delay; /* time to delay after each action, and to charge + the filter after action-delay */ + static int pretime; /* time of previous frame, in microseconds */ + static int throw_outlier = 0; + /* tag to throw away outlier. In case there are outliers, this + tag is flipped by the algorithm, so that If there are two + consecutive sample deviating very much from the filtered mean + value, the second is not considered outlier. This may mean + that the frame rate has dropped significantly. */ + static double vr; /* filtered frame-rate value, in microseconds/frame */ + double r, nr; + int t = get_usec(); + + switch (fbstate) { + case 3: /* working, monitoring */ + { + int interval = get_duration(pretime, t); + if (throw_outlier) { + if (interval >> 2 >= vr) { + /* at least four times the filtered mean value to be + considered outlier */ + /* In case an outlier is detected and thrown away, then + the following sample will never be classified as an + outlier, and the current time is recorded */ + throw_outlier = 0; + pretime = t; + Fprintf(stderr, "CTR detected a gap %d (vr = %d) us\n", + interval, (int)vr); + break; + } + } + else { + throw_outlier = 1; + } + vr = DoFilter(fr, (double)interval); + } + pretime = t; + + r = minupf / vr; /* convert the display fps to percentage of maxfr */ + + nr = 0; /* This variable contains the newly computed server frame rate */ + + /* let nr oscillate around 1.5 ~ 2.5 */ + if (min(frate, maxrate) - r >= 3.0 * adjstep) { + /* pipeline is considered overloaded if server fps is more than 3 adjsteps + higher than display fps */ + nr = min(frate, maxrate) - adjstep; /* slow down server frame rate + one step */ + if (fb_startup) { /* startup feedback action: jump set the server fps + to a value close to actually measure display + frame rate */ + fb_startup = 0; + while (nr >= r + 2.5 * adjstep) { + nr -= adjstep; + } + } + } + else if (frate - r <= 0.5 * adjstep && frate < maxrate) { + /* pipeline load is considered too light if the server frame rate + is less than 0.5fps higher than display frame rate, while the server + fps is no maximum yet. The server fps then is stepped up. */ + nr = min(frate + adjstep, maxrate); + } + if (nr > 0) { /* nr = 0 if not feedback action needs to be taken */ + shared->frameRateLimit = maxfr * nr; + compute_sendPattern(); + /* + fprintf(stderr, + "CTR adjust frameRate to %lf, vr=%lf minupf=%d, r=%lf, frate=%lf, nr=%lf\n", + shared->frameRateLimit, vr, minupf, r, frate, nr); + */ + frate = nr; /* remember new server frame rate */ + shared->qosRecomputes ++; + start = t; /* remember the action time */ + /* delay for some time before restarts, to let feedback take effect */ + delay = shared->usecPerFrame * (shared->VBheadFrame - shared->nextFrame) + + shared->playRoundTripDelay; + if (delay < 0) delay = shared->usecPerFrame; + fbstate = 4; + } + break; + case 4: /* delay and reset after action*/ + if (get_duration(start, t) >= delay) { + /* + fprintf(stderr, + "CTR VB from s2 to s3, vr %lf, frate %lf, maxrate %lf, step %lf\n", + vr, frate, maxrate, adjstep); + */ + fr = ResetFilter(fr, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + delay = shared->usecPerFrame * + max(shared->sendPatternGops * shared->patternSize, + shared->config.filterPara); + /* charge filter for time */ + start = pretime = t; + throw_outlier = 0; + fbstate = 2; + } + break; + case 2: /* charge the filter */ + { + int interval = get_duration(pretime, t); + if (throw_outlier) { + if (interval >> 2 >= vr) { /* at least four times the previous average */ + throw_outlier = 0; + pretime = t; + Fprintf(stderr, "CTR detected a gap %d (vr = %d) us\n", + interval, (int)vr); + break; + } + } + else { + throw_outlier = 1; + } + vr = DoFilter(fr, (double)interval); + } + pretime = t; + if (get_duration(start, t) >= delay) { + /* + fprintf(stderr, + "CTR VB from s2 to s3, vr %lf, frate %lf, maxrate %lf, step %lf\n", + vr, frate, maxrate, adjstep); + */ + fbstate = 3; + } + break; + case 1: /* start or speed change, wait until speed data consistant */ + if (shared->currentUPF == shared->usecPerFrame) { + if (fr == NULL) { + fr = NewFilter(FILTER_LOWPASS, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + } + else { + fr = ResetFilter(fr, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + } + if (fr == NULL) { + ACE_OS::perror ("CTR failed to allocate space for fr filter"); + fbstate = 0; + } + vr = DoFilter(fr, (double)shared->usecPerFrame); + delay = shared->usecPerFrame * + shared->sendPatternGops * shared->patternSize; + /* charge filter for some time */ + pretime = start = t; + throw_outlier = 0; + fbstate = 2; + } + break; + default: + fprintf(stderr, "CTR error: unknown feedback state: %d\n", fbstate); + fbstate = 1; + break; + } + } + /* end of frame rate control algorithm */ + + } + else if (shared->cmd == CmdFF) + { + shared->nextGroup += count - lastCount; + if (shared->nextGroup >= shared->totalGroups) + { + timer_on ++; + shared->nextGroup = shared->totalGroups - 1; + } + } + else + { + shared->nextGroup -= count - lastCount; + if (shared->nextGroup < 0) + { + timer_on ++; + shared->nextGroup = 0; + } + } + lastCount = count; +} + +void +Client_Sig_Handler::TimerProcessing (void) +{ + // cerr << "Timerprocessing signal went off\n"; + if (audioSocket >= 0 && shared->cmd == CmdPLAY) + { + if (videoSocket < 0) + this->PlayAudioOnly (); + else if (rtplay) + { + // cerr << "TimerProcessing: calling PlayAudio ()\n"; + int res = PlayAudio(); + /* and also tries to sync audio and video */ + if (res) + { + int jit; + res = forward - audioForward; + jit = (res>0 ? res : -res); + jit = (int)(((double)jit / (double)shared->samplesPerSecond) * 1000000.0); + if (res < -audioForward/2) /* needs to speedup the clock */ + { + struct itimerval val; + getitimer(ITIMER_REAL, &val); + if ((int)val.it_value.tv_usec > jit) + val.it_value.tv_usec -= jit; + else + { + timer_signals_skip ++; + val.it_value.tv_usec = 2; + } + setitimer(ITIMER_REAL, &val, NULL); + } + else if (res > audioForward) /* needs to slow down the clock */ + { + struct itimerval val; + /* + val.it_interval.tv_sec = val.it_value.tv_sec = 0; + val.it_interval.tv_usec = val.it_value.tv_usec = 0; + */ + getitimer(ITIMER_REAL, &val); + val.it_value.tv_usec += (jit % 1000000); + val.it_value.tv_sec += (jit / 1000000); + setitimer(ITIMER_REAL, &val, NULL); + } + /* + if (res < -audioForward || res > audioForward) + */ + if (res < -16000 || res > 16000) + { + Fprintf(stderr, "Audio forward jit %d samples\n", res); + } + } + } + } + if (videoSocket >= 0 && + (shared->cmd == CmdPLAY || shared->cmd == CmdFF || shared->cmd == CmdFB)) { + // cerr << "Timerprocessing signal-handler done\n"; + DisplayPicture(); + } + +} + +// ----------------------------------------------------------- +// Audio_Client_StreamEndPoint methods + +Audio_Client_StreamEndPoint::Audio_Client_StreamEndPoint (Command_Handler *command_handler, + char *host) + :command_handler_ (command_handler), + host_ (host) +{ +} + +int +Audio_Client_StreamEndPoint::handle_open (void) +{ + return -1; +} + +int +Audio_Client_StreamEndPoint::handle_close (void) +{ + return -1; +} + +// called by the framework before calling connect. Here we create our +// flow spec which is nothing but hostname::port_number of the +// datagram. +CORBA::Boolean +Audio_Client_StreamEndPoint::handle_preconnect (AVStreams::flowSpec &the_spec) +{ + + ACE_DEBUG ((LM_DEBUG,"(%P|%t) handle_preconnect called\n")); + ACE_INET_Addr local_addr; + + // Get the local UDP address + if (this->dgram_.open (ACE_Addr::sap_any) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) datagram open failed %p\n"),0); + + // set the socket buffer sizes to 64k. + int sndbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + int rcvbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + + if (this->dgram_.set_option (SOL_SOCKET, + SO_SNDBUF, + (void *) &sndbufsize, + sizeof (sndbufsize)) == -1 + && errno != ENOTSUP) + return 0; + else if (this->dgram_.set_option (SOL_SOCKET, + SO_RCVBUF, + (void *) &rcvbufsize, + sizeof (rcvbufsize)) == -1 + && errno != ENOTSUP) + return 0; + + if (this->dgram_.get_local_addr (local_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t)datagram get local addr failed %p"),0); + // form a string + char client_address_string [BUFSIZ]; + ::sprintf (client_address_string, + "%s=%s:%d", + "UDP", + this->host_ == 0 ? local_addr.get_host_name ():this->host_, + local_addr.get_port_number ()); + + //AVStreams::flowSpec_var the_spec; + //ACE_NEW_RETURN (the_spec, + // AVStreams::flowSpec, + // -1); + the_spec.length (1); + TAO_Forward_FlowSpec_Entry udp_flow_entry ("audio", + "IN", + "MIME:audio/au", + "TCP", + CORBA::string_dup (client_address_string)); + + the_spec [0] = udp_flow_entry.entry_to_string (); + + //the_spec.length (1); + //the_spec [0] = + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) client flow spec is %s\n", + client_address_string)); + return 1; +} + +// called by the A/V framework after calling connect. Passes the +// server streamendpoints' flowspec which we use to connect our +// datagram socket. +CORBA::Boolean +Audio_Client_StreamEndPoint::handle_postconnect (AVStreams::flowSpec& server_spec) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) handle_postconnect called \n")); + + TAO_Reverse_FlowSpec_Entry *entry = 0; + ACE_NEW_RETURN (entry, + TAO_Reverse_FlowSpec_Entry, + 0); + if (entry->parse (server_spec[0].in ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "Video_Client_StreamEndPoint::handle_postconnect parse failed\n"), 0); + + // Take the first string of the sequence . + ACE_INET_Addr server_udp_addr (entry->address_str ()); + + ACE_DEBUG ((LM_DEBUG, "\nFlow Spec %s\n", entry->address_str ())); + + server_udp_addr.dump (); + if (ACE_OS::connect (this->dgram_.get_handle (),(sockaddr *) server_udp_addr.get_addr (), + server_udp_addr.get_size ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) datagram connect failed %p\n"),0); + // Now set the data handle of the command handler. + + this->command_handler_->set_audio_data_handle (this->dgram_.get_handle ()); + return 0; +} + +int +Audio_Client_StreamEndPoint::handle_start (const AVStreams::flowSpec & /* the_spec */, + CORBA::Environment & /* env */) + +{ + return -1; +} + +int +Audio_Client_StreamEndPoint::handle_stop (const AVStreams::flowSpec & /* the_spec */, + CORBA::Environment & /* env */) + +{ + return -1; +} + +int +Audio_Client_StreamEndPoint::handle_destroy (const AVStreams::flowSpec & /* the_spec */, + CORBA::Environment & /* env */) + +{ + return -1; +} + +ACE_HANDLE +Audio_Client_StreamEndPoint::get_handle (void) +{ + return this->dgram_.get_handle (); +} + +// ----------------------------------------------------------- +// Video_Client_StreamEndPoint methods + +Video_Client_StreamEndPoint::Video_Client_StreamEndPoint (Command_Handler *command_handler, + char *host) + :command_handler_ (command_handler), + host_ (host) +{ +} + +int +Video_Client_StreamEndPoint::handle_open (void) +{ + return -1; +} + +int +Video_Client_StreamEndPoint::handle_close (void) +{ + return -1; +} + +CORBA::Boolean +Video_Client_StreamEndPoint::handle_preconnect (AVStreams::flowSpec &the_spec) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) handle_preconnect called\n")); + ACE_INET_Addr local_addr; + + // Get the local UDP address + if (this->dgram_.open (ACE_Addr::sap_any) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) datagram open failed %p\n"),0); + + // set the socket buffer sizes to 64k. + int sndbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + int rcvbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + + if (this->dgram_.set_option (SOL_SOCKET, + SO_SNDBUF, + (void *) &sndbufsize, + sizeof (sndbufsize)) == -1 + && errno != ENOTSUP) + return 0; + else if (this->dgram_.set_option (SOL_SOCKET, + SO_RCVBUF, + (void *) &rcvbufsize, + sizeof (rcvbufsize)) == -1 + && errno != ENOTSUP) + return 0; + + if (this->dgram_.get_local_addr (local_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t)datagram get local addr failed %p"),0); + // form a string + char client_address_string [BUFSIZ]; + ::sprintf (client_address_string, + "%s=%s:%d", + "UDP", + this->host_ == 0 ?local_addr.get_host_name ():this->host_, + local_addr.get_port_number ()); + + // AVStreams::flowSpec_var the_spec; +// ACE_NEW_RETURN (the_spec, +// AVStreams::theSpec, +// -1); + the_spec.length (1); + TAO_Forward_FlowSpec_Entry udp_flow_entry ("video", + "IN", + "MIME:video/mpeg", + "UDP", + CORBA::string_dup (client_address_string)); + + the_spec [0] = udp_flow_entry.entry_to_string (); + + //the_spec.length (1); + //the_spec [0] = CORBA::string_dup (client_address_string); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) client flow spec is %s\n", + client_address_string)); + return 1; +} + +CORBA::Boolean +Video_Client_StreamEndPoint::handle_postconnect (AVStreams::flowSpec& server_spec) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) handle_postconnect called \n")); + + TAO_Reverse_FlowSpec_Entry *entry = 0; + ACE_NEW_RETURN (entry, + TAO_Reverse_FlowSpec_Entry, + 0); + if (entry->parse (server_spec[0].in ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "Video_Client_StreamEndPoint::handle_postconnect parse failed\n"), 0); + + // Take the first string of the sequence . + ACE_INET_Addr server_udp_addr (entry->address_str ()); + + ACE_DEBUG ((LM_DEBUG, "\nFlow Spec %s\n", entry->address_str ())); + + server_udp_addr.dump (); + if (ACE_OS::connect (this->dgram_.get_handle (),(sockaddr *) server_udp_addr.get_addr (), + server_udp_addr.get_size ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"(%P|%t) datagram connect failed %p\n"),0); + // Now set the data handle of the command handler. + + this->command_handler_->set_video_data_handle (this->dgram_.get_handle ()); + return 0; +} + +int +Video_Client_StreamEndPoint::handle_start (const AVStreams::flowSpec & /* the_spec */, + CORBA::Environment & /* env */) + +{ + return -1; +} + +int +Video_Client_StreamEndPoint::handle_stop (const AVStreams::flowSpec &, + CORBA::Environment &) + +{ + return -1; +} + +int +Video_Client_StreamEndPoint::handle_destroy (const AVStreams::flowSpec &, + CORBA::Environment &) + +{ + return -1; +} + +ACE_HANDLE +Video_Client_StreamEndPoint::get_handle (void) +{ + return this->dgram_.get_handle (); +} + +// --------------------------------------------------------- +// Video_Client_VDev methods. + +Video_Client_VDev::Video_Client_VDev (void) + : video_control_ (0), + command_handler_ (0) +{ +} + + +Video_Client_VDev::Video_Client_VDev (Command_Handler *command_handler) + :video_control_ (0), + command_handler_ (command_handler) +{ +} + +CORBA::Boolean +Video_Client_VDev::set_media_ctrl (CORBA::Object_ptr media_ctrl, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_Client_VDev::set_media_ctrl ()\n")); + this->video_control_ = Video_Control::_narrow (media_ctrl, + ACE_TRY_ENV); + + ACE_CHECK_RETURN (0); + this->command_handler_->set_video_control (this->video_control_); + + return 1; +} + +// ----------------------------------------------------------- +// Audio_Client_VDev methods. + +Audio_Client_VDev::Audio_Client_VDev (void) + : audio_control_ (0), + command_handler_ (0) +{ +} + + +Audio_Client_VDev::Audio_Client_VDev (Command_Handler *command_handler) + :audio_control_ (0), + command_handler_ (command_handler) +{ +} + +CORBA::Boolean +Audio_Client_VDev::set_media_ctrl (CORBA::Object_ptr media_ctrl, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Client_VDev::set_media_ctrl ()\n")); + this->audio_control_ = Audio_Control::_narrow (media_ctrl, + ACE_TRY_ENV); + + ACE_CHECK_RETURN (0); + + this->command_handler_->set_audio_control (this->audio_control_); + + return 1; +} + +// ----------------------------------------------------------- +// Video_Endpoint_Reactive_Strategy_A methods + +Video_Endpoint_Reactive_Strategy_A::Video_Endpoint_Reactive_Strategy_A (TAO_ORB_Manager *orb_manager, + Command_Handler *command_handler) + : TAO_AV_Endpoint_Reactive_Strategy_A<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl> (orb_manager), + command_handler_ (command_handler) +{ +} + +Video_Endpoint_Reactive_Strategy_A::~Video_Endpoint_Reactive_Strategy_A (void) +{ + // delete this->vdev_; + // delete this->endpoint_; +} + +int +Video_Endpoint_Reactive_Strategy_A::make_vdev (Video_Client_VDev *&vdev) +{ + ACE_NEW_RETURN (this->vdev_, + Video_Client_VDev (this->command_handler_), + -1); + vdev = this->vdev_; + return 0; +} + +int +Video_Endpoint_Reactive_Strategy_A::make_stream_endpoint (Video_Client_StreamEndPoint *&endpoint) +{ + ACE_NEW_RETURN (this->endpoint_, + Video_Client_StreamEndPoint (this->command_handler_, + this->command_handler_->get_data_host ()), + -1); + endpoint = this->endpoint_; + return 0; +} + +// ------------------------------------------------------------ +// Audio_Endpoint_Reactive_Strategy_A methods + +Audio_Endpoint_Reactive_Strategy_A::Audio_Endpoint_Reactive_Strategy_A (TAO_ORB_Manager *orb_manager, + Command_Handler *command_handler) + : TAO_AV_Endpoint_Reactive_Strategy_A<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl> (orb_manager), + command_handler_ (command_handler) +{ +} + +Audio_Endpoint_Reactive_Strategy_A::~Audio_Endpoint_Reactive_Strategy_A (void) +{ + // delete this->vdev_; + // delete this->endpoint_; +} + +int +Audio_Endpoint_Reactive_Strategy_A::make_vdev (Audio_Client_VDev *&vdev) +{ + ACE_NEW_RETURN (this->vdev_, + Audio_Client_VDev (this->command_handler_), + -1); + vdev = this->vdev_; + return 0; +} + +int +Audio_Endpoint_Reactive_Strategy_A::make_stream_endpoint (Audio_Client_StreamEndPoint *&endpoint) +{ + ACE_NEW_RETURN (this->endpoint_, + Audio_Client_StreamEndPoint (this->command_handler_, + this->command_handler_->get_data_host ()), + -1); + endpoint = this->endpoint_; + return 0; +} + +//-------------------------------------------------------------------------------- + +Receiver_i::Receiver_i (Command_Handler *handler) + :command_handler_ (handler) +{ +} + +void +Receiver_i::push_mmdevice (CORBA::Object_ptr audio_mmdevice, + const char *audio_file, + CORBA::Object_ptr video_mmdevice, + const char *video_file, + CORBA::Environment&) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t)Receiver_i::push_audio_mmdevice")); + this->command_handler_->set_mmdevice (audio_mmdevice,audio_file,video_mmdevice,video_file); +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class TAO_AV_Endpoint_Reactive_Strategy<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl>; +template class TAO_AV_Endpoint_Reactive_Strategy_A<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl>; +template class TAO_AV_Endpoint_Reactive_Strategy<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl>; +template class TAO_AV_Endpoint_Reactive_Strategy_A<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate TAO_AV_Endpoint_Reactive_Strategy<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl> +#pragma instantiate TAO_AV_Endpoint_Reactive_Strategy_A<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl> +#pragma instantiate TAO_AV_Endpoint_Reactive_Strategy<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl> +#pragma instantiate TAO_AV_Endpoint_Reactive_Strategy_A<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.h new file mode 100644 index 00000000000..6d4577270a4 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Command_Handler.h @@ -0,0 +1,618 @@ +// $Id$ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// ============================================================================ +// +// = LIBRARY +// mpeg_client +// +// = FILENAME +// Command_Handler.h +// +// = DESCRIPTION +// Defines the client side components of the A/V framework like +// video stream endpoints ,video multi media device, video virtual device. +// +// = AUTHORS +// Sumedh Mungee (sumedh@cs.wustl.edu) +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + + +#ifndef AV_COMMAND_HANDLER_H +#define AV_COMMAND_HANDLER_H + +#include "ace/Reactor.h" +#include "ace/Event_Handler.h" +#include "ace/ARGV.h" +#include "tao/PortableServer/ORB_Manager.h" +#include "mpeg_shared/Video_ControlC.h" +#include "orbsvcs/CosNamingC.h" +#include "ace/SOCK_Dgram.h" +#include "ace/SOCK_Connector.h" +#include "mpeg_shared/Audio_ControlC.h" +#include "orbsvcs/AV/AVStreams_i.h" +#include "ace/High_Res_Timer.h" +#include "ace/Acceptor.h" +#include "orbsvcs/Naming/Naming_Utils.h" +#include "mpeg_shared/ReceiverS.h" +#include "ace/Get_Opt.h" +#include "ab.h" +#include "vb.h" + +class Command_Handler; + + +class Receiver_i + :public POA_Receiver +{ + public: + Receiver_i (Command_Handler *handler); + // constructor. + + void push_mmdevice (CORBA::Object_ptr audio_mmdevice, + const char* audio_file, + CORBA::Object_ptr video_mmdevice, + const char *video_file, + CORBA::Environment&) + ACE_THROW_SPEC (( CORBA::SystemException )); + + private: + Command_Handler *command_handler_; + // Reference to command handler. +}; + +class Video_Client_StreamEndPoint + :public virtual TAO_Client_StreamEndPoint +{ + // = TITLE + // Defines a video client StreamEndpoint class + // = DESCRIPTION + // Makes use of a connected dgram to receive data from the server + // side stream endpoint. +public: + Video_Client_StreamEndPoint (Command_Handler *command_handler =0, + char *host =0); + // constructor + + virtual int handle_open (void); + // called when streamendpoint is instantiated + + virtual int handle_close (void); + // called when streamendpoint is being destructed + + virtual CORBA::Boolean handle_preconnect (AVStreams::flowSpec &the_spec); + // called before connecting + + virtual CORBA::Boolean handle_postconnect (AVStreams::flowSpec &the_spec); + // called after connecting + + virtual int handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + + virtual int handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + + virtual int handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env); + + virtual ACE_HANDLE get_handle (void); + // gets the underlying socket descriptor from the SOCK_Dgram + +private: + ACE_SOCK_Dgram dgram_; + // The datagram used for streaming. + + Command_Handler *command_handler_; + // Reference to the command handler + + char *host_; + // host interface to bind to. +}; + +class Audio_Client_StreamEndPoint + :public virtual TAO_Client_StreamEndPoint +{ + // = TITLE + // Defines a audio client stream endpoint + // = DESCRIPTION + // Uses a connected dgram to receive data from the audio server. +public: + Audio_Client_StreamEndPoint (Command_Handler *command_handler = 0, + char *host = 0); + // constructor + + virtual int handle_open (void); + // called when streamendpoint is instantiated + + virtual int handle_close (void); + // called when streamendpoint is being destructed + + virtual CORBA::Boolean handle_preconnect (AVStreams::flowSpec &the_spec); + // called before connecting + + virtual CORBA::Boolean handle_postconnect (AVStreams::flowSpec &the_spec); + // called after connecting + + virtual int handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + + virtual int handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + + virtual int handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env); + + virtual ACE_HANDLE get_handle (void); + // gets the underlying socket descriptor from the SOCK_Dgram + +private: + ACE_SOCK_Dgram dgram_; + // The datagram used for streaming. + + Command_Handler *command_handler_; + // Reference to the command handler. + + char *host_; + // host interface to bind to. +}; + + +class Video_Client_VDev + : public virtual TAO_VDev +{ + // = TITLE + // Defines a class that is a client side Virtual device for video. + // = Description + // Needs a pointer to the command handler object so that it can + // set the video control pointer of the command handler. +public: + Video_Client_VDev (void); + Video_Client_VDev (Command_Handler *command_handler); + +protected: + CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl, + CORBA::Environment& env); + +private: + Video_Control_ptr video_control_; + // The video controller + + Command_Handler *command_handler_; + // pointer to the command handler object +}; + + +class Audio_Client_VDev + : public virtual TAO_VDev +{ + // = TITLE + // Defines a client side audio virtual device + // = DESCRIPTION + // Takes a pointer to a command handler object so that it can set + // the audio control object pointer of the command handler. +public: + Audio_Client_VDev (void); + Audio_Client_VDev (Command_Handler *command_handler); + +protected: + CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl, + CORBA::Environment& env); + +private: + Audio_Control_ptr audio_control_; + // The Audio controller + + Command_Handler *command_handler_; + // pointer to the command handler object +}; + +class Video_Endpoint_Reactive_Strategy_A + : public TAO_AV_Endpoint_Reactive_Strategy_A<Video_Client_StreamEndPoint,Video_Client_VDev,AV_Null_MediaCtrl> +{ + // = TITLE + // Implementation of the Reactive Strategy for the client + // video MMDevice. + // = DESCRIPTION + // Takes a command handler object pointer. It overrides the + // make_vdev and make_stream_endpoint hooks to create the video + // vdev and video streamendpoint with command handler object pointers. +public: + Video_Endpoint_Reactive_Strategy_A (TAO_ORB_Manager *orb_manager, + Command_Handler *command_handler); + // constructor . The orb manager is needed for the TAO_AV_Endpoint_Reactive_Strategy_A. + + virtual ~Video_Endpoint_Reactive_Strategy_A (void); + // destructor. + + virtual int make_vdev (Video_Client_VDev *&vdev); + // hook to make our Vdev with the pointer to command handler. + virtual int make_stream_endpoint (Video_Client_StreamEndPoint *& endpoint); + // hook to make our streamendpoint taking a command handler pointer +private: + Command_Handler *command_handler_; + // pointer to command handler object + + Video_Client_VDev *vdev_; + // reference to the created vdev . + + Video_Client_StreamEndPoint *endpoint_; + // reference to the created streamendpoint. +}; + +class Audio_Endpoint_Reactive_Strategy_A + : public TAO_AV_Endpoint_Reactive_Strategy_A<Audio_Client_StreamEndPoint,Audio_Client_VDev,AV_Null_MediaCtrl> +{ + // = TITLE + // Implementation of the Reactive Strategy for the client audio + // MMDevice + // = DESCRIPTION + // Takes a command handler object pointer. It overrides the + // make_vdev and make_stream_endpoint hooks to create the audio + // vdev and audio streamendpoint with command handler object pointers. +public: + Audio_Endpoint_Reactive_Strategy_A (TAO_ORB_Manager *orb_manager, + Command_Handler *command_handler); + // constructor . The orb manager is needed for the TAO_AV_Endpoint_Reactive_Strategy_A. + + ~Audio_Endpoint_Reactive_Strategy_A (void); + // Destructor. + + virtual int make_vdev (Audio_Client_VDev *&vdev); + // hook to make our Vdev with the pointer to command handler. + + virtual int make_stream_endpoint (Audio_Client_StreamEndPoint *& endpoint); + // hook to make our streamendpoint taking a command handler pointer + +private: + Command_Handler *command_handler_; + // pointer to command handler object + + Audio_Client_VDev *vdev_; + // reference to the vdev that was created. + + Audio_Client_StreamEndPoint *endpoint_; + //reference to the created streamendpoint. + +}; + +class Client_Sig_Handler + : public virtual ACE_Event_Handler + // = TITLE + // Defines the signal handler class for the client timer processing + // + // = DESCRIPTION + // Checks if the video is ready and refreshes the display and + // also plays the audio packets in the timer processing. +{ +public: + Client_Sig_Handler (Command_Handler *command_handler); + // We need the command handler to call close () + + ~Client_Sig_Handler (void); + // Destructor + + virtual ACE_HANDLE get_handle (void) const; + + int register_handler (void); + // this will register this sig_handler + // with the reactor for SIGCHLD,SIGTERM,SIGINT + + int remove_handler (void); + // removes the handlers. + + virtual int shutdown (ACE_HANDLE, + ACE_Reactor_Mask); + // handles the reactor shutdown + + virtual int handle_input (ACE_HANDLE); + // handle input on the dummy handle. + + virtual int handle_signal (ACE_HANDLE signum, + siginfo_t * = 0, + ucontext_t* = 0); + // handles SIGALRM + + void TimerHandler (int signum); + + void stop_timer (void); + + void DisplayPicture (void); + // display the picture. + + void TimerProcessing (void); + + void PlayAudioOnly (void); + +private: + ACE_HANDLE handle_; + // dummy handle for the sig handler. + + ACE_Sig_Set sig_set; + // the signal set + + Command_Handler *command_handler_; + // We need the command handler to call close () + +}; + +class Decode_Notification_Handler :public ACE_Event_Handler +{ +public: + Decode_Notification_Handler (Command_Handler *command_handler); + // constructor. + + virtual ACE_HANDLE get_handle (void) const; + // Get the Notification handle. + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // called when input events occur. +private: + Command_Handler *command_handler_; +}; + +enum Suspended +{ + UNSUSPENDED = 0,INIT=1,STEP=2,POSITION=3 +}; + +class Command_Handler + : public virtual ACE_Event_Handler + // public virtual ACE_Svc_Handler <ACE_SOCK_STREAM, ACE_NULL_SYNCH> +{ + // = TITLE + // Defines the event handler class for the client commands + // + // = DESCRIPTION + // This class makes use of a UNIX socket, over which + // it will receive commands from the GUI + +public: + + int command_suspended_; + // flag to indicate whether the GUI handler has been suspended. + + int operation_tag_; + // operation tag for release/press for position. + + int position_val_; + // value of the position button. + + Command_Handler (ACE_HANDLE command_handle = ACE_INVALID_HANDLE); + // Construct this handler with a control (UNIX) handle + + ~Command_Handler (void); + // Destructor + + int init (int argc,char **argv); + // initialize the ORB and NamingService + + int run (void); + // Run the ORB event loop + + int handle_timeout (const ACE_Time_Value &, + const void *arg); + // handle the timeout + + // void stop_timer (void); + // stop the internal timer + + void wait_for_display (Suspended reason); + // suspends the gui socket handler in the reactor. + + TAO_ORB_Manager *orb_manager (void); + // returns the orbmanager reference + + void set_mmdevice (CORBA::Object_ptr audio_mmdevice, + const char *audio_file, + CORBA::Object_ptr video_mmdevice, + const char *video_file); + // sets the audio mmdevice object ptr. + + void set_video_data_handle (ACE_HANDLE data_fd); + // sets the data handle (UDP) of the command handler + + void set_video_control (Video_Control_ptr video_control); + // called to set the video control object pointer of the comand handler. + + void set_audio_data_handle (ACE_HANDLE data_fd); + // sets the data handle (UDP) of the command handler + + void set_audio_control (Audio_Control_ptr video_control); + // called to set the video control object pointer of the comand handler. + + int get_video_control (void); + // Gets the video control reference thru the property service from + // the video server virtual device + + char *get_data_host (void); + // gets the data interface to be used. + + int resolve_video_reference (void); + // Resolve the video control reference. + + int resolve_audio_reference (void); + // Resolve the audio control reference. + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // Called when input events occur (e.g., connection or data). + + virtual ACE_HANDLE get_handle (void) const; + // Returns the handle used by the event_handler. + + int init_av (void); + // Initialize both the audio and video + + int init_java_av (char *audio_ior, + char *video_ior, + char *audio_file, + char *video_file); + // initialize both the audio and video reading the iors from java GUI thru a socket. + + int init_video_channel (char *videofile); + // Initializes the video channel by bind the client and server video + // mmdevices together and gets the video control object. + + int init_audio_channel (char *videofile); + // Initializes the audio channel by bind the client and server audio + // mmdevices together and gets the video control object. + + int stat_stream (CORBA::Char_out ch,CORBA::Long_out size) ; + // statistics of this stream. + + int close (void) ; + // close the audio and video connections + + int stat_sent (void) ; + + int fast_forward (void); + + int fast_backward (void); + + int step (void); + + int play (int flag, + CORBA::Environment& env); + + int position_action (int operation_tag); + + int position (void); + + int position_release (void); + + int volume (void); + + int balance (void); + + int speed (void); + + int stop (void); + + int stop_playing (void); + + int connect_to_video_server (void); + // resolves the server video mmdevice and binds the local and server + // mmdevices together. + + int connect_to_audio_server (void); + // resolves the server video mmdevice and binds the local and server + // mmdevices together. + +private: + + int parse_args (int argc,char **argv); + // parses the arguments. + + int remove_handlers (void); + // removes all the handlers. + + int busy_; + // flag to indicate the state of the command handler + + CORBA::String_var audio_mmdevice_ior_; + CORBA::String_var video_mmdevice_ior_; + + ACE_SOCK_Dgram video_dgram_; + // UDP socket on which to send/recv data + + ACE_SOCK_Dgram audio_dgram_; + // Audio UDP socket + + ACE_HANDLE video_data_handle_; + // UDP socket for video + + ACE_HANDLE audio_data_handle_; + // UDP socket for audio + + ACE_HANDLE command_handle_; + // The fd for the UNIX command socket + + TAO_ORB_Manager orb_manager_; + // the ORB manager + + TAO_Naming_Client my_name_client_; + // A Name_Client used to resolve the video_server_mmdevice + + Video_Control_ptr video_control_; + // Video Control CORBA object + + AVStreams::MMDevice_var video_server_mmdevice_; + // The video server multimedia device + + Video_Endpoint_Reactive_Strategy_A *video_reactive_strategy_; + // Strategy for creating stream endpoints + + TAO_MMDevice *video_client_mmdevice_; + // The video client multimedia device + + TAO_StreamCtrl *video_streamctrl_; + // Video stream controller + + Audio_Control_ptr audio_control_; + // Audio Control CORBA object + + AVStreams::MMDevice_var audio_server_mmdevice_; + // The audio server multimedia device + + Audio_Endpoint_Reactive_Strategy_A *audio_reactive_strategy_; + // Strategy for creating stream endpoints + + TAO_MMDevice *audio_client_mmdevice_; + // The audio client multimedia device + + TAO_StreamCtrl *audio_streamctrl_; + // audio stream controller + + // ACE_High_Res_Timer timer_; + // timer to record the time taken for the play sequence. + + Receiver_i receiver_; + // Receive object,called by the agent to give the mmdevice object + // reference. + + char *data_host_; + // interface name to bind to for data transfer. + + Client_Sig_Handler client_sig_handler_; + // Handler for the signals. + + Decode_Notification_Handler notification_handler_; + // handler for the decode signals from VD process. + + int argc_; + char **argv_; +}; + + + +#endif /* AV_COMMAND_HANDLER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile new file mode 100644 index 00000000000..4b20315647a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile @@ -0,0 +1,1503 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +MAKEFILE = Makefile +LIBNAME = libmpeg_client +LIB2 = $(LIBNAME).a +SHLIB2 = $(LIBNAME).$(SOEXT) + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +FILES= 24bit \ + 2x2 \ + ab \ + audio \ + decoders \ + file \ + fs2 \ + fs2fast \ + fs4 \ + global \ + gray \ + hybrid \ + hybriderr \ + info \ + jrevdct \ + mb_ordered \ + mono \ + motionvector \ + ordered \ + ordered2 \ + para \ + parseblock \ + prog \ + ui \ + util \ + util32 \ + vb \ + vd \ + video \ + vp \ + Command_Handler + +MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source +CPPFLAGS += -I$(MPEG_ROOT) -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +LDLIBS = -lTAO_AV -lTAO_CosNaming -lTAO + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) + + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + LIB = $(LIB2) + SHLIB = $(SHLIB2) +else # ! AV + override INSTALL = +endif # ! AV + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +LDFLAGS += -lACE $(PLATFORM_X11_LDFLAGS) -lXm -lXt -lXext -lSM -lICE -lX11 +CPPFLAGS += -DSH_MEM -DNDEBUG $(PLATFORM_X11_CPPFLAGS) + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/24bit.o .obj/24bit.so .shobj/24bit.o .shobj/24bit.so: 24bit.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + dither.h proto.h + +.obj/2x2.o .obj/2x2.so .shobj/2x2.o .shobj/2x2.so: 2x2.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + dither.h proto.h + +.obj/ab.o .obj/ab.so .shobj/ab.o .shobj/ab.so: ab.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i ab.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + vb.h + +.obj/audio.o .obj/audio.so .shobj/audio.o .shobj/audio.so: audio.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h + +.obj/decoders.o .obj/decoders.so .shobj/decoders.o .shobj/decoders.so: decoders.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + decoders.h util.h video.h proto.h + +.obj/file.o .obj/file.so .shobj/file.o .shobj/file.so: file.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h + +.obj/fs2.o .obj/fs2.so .shobj/fs2.o .shobj/fs2.so: fs2.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + dither.h fs2.h proto.h + +.obj/fs2fast.o .obj/fs2fast.so .shobj/fs2fast.o .shobj/fs2fast.so: fs2fast.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/fs4.o .obj/fs4.so .shobj/fs4.o .shobj/fs4.so: fs4.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i fs4.h \ + video.h proto.h dither.h + +.obj/global.o .obj/global.so .shobj/global.o .shobj/global.so: global.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h + +.obj/gray.o .obj/gray.so .shobj/gray.o .shobj/gray.so: gray.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/hybrid.o .obj/hybrid.so .shobj/hybrid.o .shobj/hybrid.so: hybrid.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/hybriderr.o .obj/hybriderr.so .shobj/hybriderr.o .shobj/hybriderr.so: hybriderr.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/info.o .obj/info.so .shobj/info.o .shobj/info.so: info.cpp \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i + +.obj/jrevdct.o .obj/jrevdct.so .shobj/jrevdct.o .shobj/jrevdct.so: jrevdct.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h + +.obj/mb_ordered.o .obj/mb_ordered.so .shobj/mb_ordered.o .shobj/mb_ordered.so: mb_ordered.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/mono.o .obj/mono.so .shobj/mono.o .shobj/mono.so: mono.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/motionvector.o .obj/motionvector.so .shobj/motionvector.o .shobj/motionvector.so: motionvector.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h util.h + +.obj/ordered.o .obj/ordered.so .shobj/ordered.o .shobj/ordered.so: ordered.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/ordered2.o .obj/ordered2.so .shobj/ordered2.o .shobj/ordered2.so: ordered2.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h dither.h + +.obj/para.o .obj/para.so .shobj/para.o .shobj/para.so: para.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h + +.obj/parseblock.o .obj/parseblock.so .shobj/parseblock.o .shobj/parseblock.so: parseblock.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h decoders.h util.h + +.obj/prog.o .obj/prog.so .shobj/prog.o .shobj/prog.so: prog.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h + +.obj/ui.o .obj/ui.so .shobj/ui.o .shobj/ui.so: ui.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.h \ + interface/fb.xbm interface/play.xbm interface/step.xbm \ + interface/stop.xbm interface/loop.xbm interface/ff.xbm \ + interface/MainWindow.mib interface/Info.mib video.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h + +.obj/util.o .obj/util.so .shobj/util.o .shobj/util.so: util.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h util.h + +.obj/util32.o .obj/util32.so .shobj/util32.o .shobj/util32.so: util32.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i video.h \ + proto.h ui.h + +.obj/vb.o .obj/vb.so .shobj/vb.o .shobj/vb.so: vb.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i vb.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h + +.obj/vd.o .obj/vd.so .shobj/vd.o .shobj/vd.so: vd.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h dither.h video.h proto.h vb.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h + +.obj/video.o .obj/video.so .shobj/video.o .shobj/video.so: video.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + decoders.h util.h video.h proto.h global.h ui.h + +.obj/vp.o .obj/vp.so .shobj/vp.o .shobj/vp.so: vp.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h dither.h video.h proto.h ui.h + +.obj/Command_Handler.o .obj/Command_Handler.so .shobj/Command_Handler.o .shobj/Command_Handler.so: Command_Handler.cpp Command_Handler.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/ARGV.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/ARGV.i \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(ACE_ROOT)/ace/High_Res_Timer.h \ + $(ACE_ROOT)/ace/High_Res_Timer.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/IOR_Multicast.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/svc_utils_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/ReceiverS.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + ab.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + newproto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + global.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + vb.h ctr.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile.am new file mode 100644 index 00000000000..c473df5ddfa --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/Makefile.am @@ -0,0 +1,83 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- +## mpeg/source/mpeg_client directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_LTLIBRARIES = libmpeg_client + +libmpeg_client_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +libmpeg_client_SOURCES = \ + 24bit.cpp \ + 2x2.cpp \ + Command_Handler.cpp \ + ab.cpp \ + audio.cpp \ + ctr.cpp \ + decoders.cpp \ + file.cpp \ + fs2.cpp \ + fs2fast.cpp \ + fs4.cpp \ + global.cpp \ + gray.cpp \ + hybrid.cpp \ + hybriderr.cpp \ + info.cpp \ + jrevdct.cpp \ + mb_ordered.cpp \ + mono.cpp \ + motionvector.cpp \ + ordered.cpp \ + ordered2.cpp \ + para.cpp \ + parseblock.cpp \ + prog.cpp \ + ui.cpp \ + util.cpp \ + util32.cpp \ + vb.cpp \ + vd.cpp \ + video.cpp \ + vp.cpp + +noinst_HEADERS = \ + Command_Handler.h \ + ab.h \ + decoders.h \ + dither.h \ + fs2.h \ + fs4.h \ + global.h \ + mibload.h \ + newproto.h \ + proto.h \ + ui.h \ + util.h \ + vb.h \ + video.h + +dist-hook: + $(mkinstalldirs) $(distdir)/$(subdir) + tar cf - ./interface | (cd $(distdir)/$(subdir); tar xfBp -) + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp new file mode 100644 index 00000000000..9dd938d9fdd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.cpp @@ -0,0 +1,578 @@ + +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +extern int asp[2]; +extern void set_exit_routine_tag(int tag); + +#include "ace/OS.h" +#include "ab.h" + +ACE_RCSID(mpeg_client, ab, "$Id$") + +AudioBuffer::AudioBuffer (void) + :temp (0), + bytes (-1), + abuf (0), + sid (-1), + exit_tag (0), + savedSocket (-1), + packet (0), + pkt_data (0), + conn_tag (-1), + fbstate (0), + waketime (0), + pcmdsn (-1), + mode_ (INVALID) +{ +} + +//destructor. +AudioBuffer::~AudioBuffer (void) +{ + if (ACE_Reactor::instance ()->remove_handler (this->handler_,ACE_Event_Handler::READ_MASK) == -1) + ACE_DEBUG ((LM_ERROR,"(%P)remove handler failed for Video_Notification_Handler\n")); + + delete this->handler_; + if (ACE_Reactor::instance ()->remove_handler (this,ACE_Event_Handler::READ_MASK) == -1) + ACE_DEBUG ((LM_ERROR,"(%P)remove handler failed for VideoBuffer\n")); + +} + +void +AudioBuffer::set_silence (char *buf, int samples) +{ + memset(buf, 0xff, samples * shared->audioPara.bytesPerSample); +} + +void +AudioBuffer::ABinitBuf (int size) /* size in bytes */ +{ + abuf = (ABBuffer *)creat_shared_mem(size); + abuf->bufsize = size - sizeof(*abuf); + abuf->buf = (char *)abuf + sizeof(*abuf); + sid = creat_semaphore(); +} + +void +AudioBuffer::ABflushBuf (int nextSample) /* flush the whole buffer */ +{ + enter_cs(sid); + abuf->bps = shared->audioPara.bytesPerSample; + abuf->size = abuf->bufsize / abuf->bps; + abuf->samples = 0; + abuf->stuff = 0; + abuf->ts = abuf->hs = nextSample; + abuf->tind = 0; + set_silence(abuf->buf, abuf->size); + leave_cs(sid); +} + +int +AudioBuffer::ABcheckSamples (void) /* returns # of samples in ABbuf */ +{ + return abuf->samples; +} + +int +AudioBuffer::ABgetSamples (char * buf, int samples) + /* read at most given number of samples from AB to buf, returns + number of sample actually read */ +{ + int as; + int tsamples = samples; + enter_cs(sid); + if (abuf->stuff > 0) { + as = min(abuf->stuff, samples); + set_silence(buf, as); + abuf->stuff -= as; + samples -= as; + buf += as * abuf->bps; + } + if (samples > 0) { + as = min(samples, max(0, abuf->samples)); + /* there may be fewer samples in abuf */ + if (as > 0) { + int part1 = min(as, abuf->size - abuf->tind); + ACE_OS::memcpy (buf, abuf->buf + (abuf->bps * abuf->tind), part1 * abuf->bps); + set_silence(abuf->buf + (abuf->bps * abuf->tind), part1); + if (part1 < as) { /* This read cross the boundary of abuf */ + ACE_OS::memcpy (buf + (part1 * abuf->bps), + abuf->buf, + (as - part1) * abuf->bps); + set_silence(abuf->buf, as - part1); + } + } + abuf->samples -= samples; + abuf->ts += samples; + abuf->tind = (abuf->tind + samples) % abuf->size; + if (as < samples) set_silence(buf + (as * abuf->bps), samples - as); + } + leave_cs(sid); + return tsamples; +} + +/* if samples < 0; then stuff |samples| silient samples to ABgetSamples(), + otherwise wipe out this number of samples from AB */ +int +AudioBuffer::ABskipSamples (int samples) +{ + enter_cs(sid); + if (samples <= 0) { + abuf->stuff += (- samples); + } + else { + abuf->samples -= samples; + abuf->ts += samples; + abuf->tind = (abuf->tind + samples) % abuf->size; + } + leave_cs(sid); + return samples; +} + +void +AudioBuffer::ABdeleteBuf (void) +{ + remove_shared_mem((char *)abuf); +} + +void +AudioBuffer::ABdeleteSem (void) +{ + remove_semaphore(sid); +} + +/* SIGUSR1 from CTR is for killing this process, without affecting any other ones. */ + +void +AudioBuffer::exit_on_kill (void) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) ABprocess killed \n")); + extern void set_exit_routine_tag(int tag); + set_exit_routine_tag(0); + // ComCloseConn(savedSocket); + vbuffer->VBdeleteBuf(); + ACE_OS::exit (0); +} + +ACE_HANDLE +AudioBuffer::get_handle (void) const +{ + return this->dataSocket; +} + +int +AudioBuffer::handle_input (ACE_HANDLE fd) +{ + // ACE_DEBUG ((LM_DEBUG,"handle_input:mode = %d\n",this->mode_)); + ACE_UNUSED_ARG (fd); + int len; + switch (this->mode_) + { + case READ_HEADER: + { + + if (conn_tag >= 0) + { + // ACE_DEBUG ((LM_DEBUG,"non discard mode: ")); + if (bytes < 0) + bytes = (int)sizeof(*packet); + len = ACE_OS::read (dataSocket, (char *)temp, bytes); + } + else + { /* discard mode packet stream, read all bytes */ + // ACE_DEBUG ((LM_DEBUG,"discard mode: ")); + if (bytes < 0) + bytes = PACKET_SIZE; + len = ACE_OS::read (dataSocket, (char *)packet, bytes); + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) ABprocess: got a %d sized packet\n",len)); + } + if (len == -1) + { + if (errno == EINTR || errno == EWOULDBLOCK || errno == EAGAIN) + { + return 0; + } + perror("AB ACE_OS::read () audio packet from discard-mode packet stream"); + ACE_Reactor::instance ()->end_event_loop (); + return -1; + } + + if (len == 0) + { + fprintf(stderr, "Error: AB found dataSocket broken\n"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + // ACE_DEBUG ((LM_DEBUG,"packet: bytes = %d,len = %d\n",bytes,len)); + if (conn_tag >= 0) + { + temp += len; + bytes -= len; + if (bytes == 0) + { + // header reading is done. + this->mode_ = READ_DATA; + bytes = -1; + len = (int)sizeof (*packet); + } + else + return 0; + } + if (len < (int)sizeof (*packet)) + { + fprintf(stderr, "Warn: AB discard len = %d bytes of supposed header.\n", len); + return 0; + } + // process the header. +#ifdef NeedByteOrderConversion + packet->dataBytes = ntohl(packet->dataBytes); +#endif + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) ABprocess: Received %d sized packet\n",len)); + if (packet->dataBytes <= 0) + { + fprintf(stderr, "AB Error: pkt->dataBytes %d, len %d\n", + packet->dataBytes, + len); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + bytes = packet->dataBytes + sizeof(*packet); + + if (bytes > PACKET_SIZE) + { + Fprintf(stderr, "Fatal error: AB packet buf (%dB) too small (%d)\n", + PACKET_SIZE, bytes); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + if (conn_tag > 0) + { + temp = (char *)packet + sizeof(*packet); + bytes = bytes - sizeof(*packet); + ACE_DEBUG ((LM_DEBUG,"(%P) Ready to read the data part of the packet\n")); + break; + } + } + // fall through and process the header. + case READ_DATA: + { + // code to read the audio packet and buffer it. + if (conn_tag >= 0) + { + len = ACE_OS::read (dataSocket,temp,bytes); + + if (len <= 0) + { + if (len == -1)ACE_OS::perror ("AB encounter error on wait_read_bytes()"); + else fprintf(stderr, "AB encounter EOF on wait_read_bytes()\n"); + } + temp +=len; + bytes -= len; + if (bytes != 0) + return 0; + } + // set the parameters for the header reading. + this->mode_ = READ_HEADER; + bytes = -1; + temp = (char *)packet; +#ifdef NeedByteOrderConversion + packet->cmdsn = ntohl(packet->cmdsn); + packet->samplesPerSecond = ntohl(packet->samplesPerSecond); + packet->resend = ntohl(packet->resend); + packet->firstSample = ntohl(packet->firstSample); + packet->samples = ntohl(packet->samples); + packet->actualSamples = ntohl(packet->actualSamples); + /* dataBytes already byte-reordered */ +#endif + /* + Fprintf(stderr, "AB got a packet: %d(%d)\n", + packet->firstSample, packet->samples); + */ + /* + if (packet->firstSample % 10240 && !packet->resend) continue; + */ + if (packet->samples * abuf->bps > PACKET_SIZE - (int)sizeof(*packet)) { + fprintf(stderr, "Fatal error: AB has too small packet buffer, %d out of %d\n", + PACKET_SIZE, packet->samples * abuf->bps + sizeof(*packet)); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + + if (packet->cmdsn != shared->cmdsn) { /* outdated packet */ + /* + Fprintf(stderr, "AB discarded an outdated packet\n"); + */ + return 0; + } + enter_cs(sid); + if (packet->firstSample + packet->samples <= abuf->ts) + { + /* all samples too late, discard it */ + abuf->hs = max(abuf->hs, packet->firstSample + packet->samples); + abuf->samples = abuf->hs - abuf->ts; + leave_cs(sid); + /* + Fprintf(stderr, "AB all sample in packet %d(%d) too late\n", + packet->firstSample, packet->samples); + */ + feedback (); + } + else if (packet->firstSample >= abuf->ts + abuf->size) { + /* all samples too early, discard the packet */ + abuf->hs = max(abuf->hs, packet->firstSample + packet->samples); + abuf->samples = abuf->hs - abuf->ts; + leave_cs(sid); + /* + Fprintf(stderr, "AB all sample in packet %d(%d) too early\n", + packet->firstSample, packet->samples); + */ + feedback (); + } + else if (packet->samples > packet->actualSamples) { + leave_cs(sid); + fprintf(stderr, "Error: AB interpolation not available yet.\n"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + else + { + int oldhs = abuf->hs; + int firstSample = max(packet->firstSample, abuf->ts); + int samples = min(packet->samples - + (firstSample - packet->firstSample), + (abuf->ts + abuf->size) - packet->firstSample); + char * data = pkt_data + + (firstSample - packet->firstSample) * abuf->bps; + int dstart = (abuf->tind + (firstSample - abuf->ts)) % abuf->size; + int part1 = min(samples, abuf->size - dstart); + ACE_OS::memcpy (abuf->buf + (dstart * abuf->bps), data, part1 * abuf->bps); + if (part1 < samples) { + memcpy(abuf->buf, data + part1 * abuf->bps, + (samples - part1) * abuf->bps); + } + abuf->hs = max(abuf->hs, packet->firstSample + packet->samples); + abuf->samples = abuf->hs - abuf->ts; + dstart =max(oldhs, abuf->ts); + + leave_cs(sid); + + part1 = firstSample - dstart; + if (packet->resend) { + Fprintf(stderr, "AB got resent %d(%d)\n", + packet->firstSample, packet->samples); + } + else if (part1 > 0) { + + AudioFeedBackPara para; + Fprintf(stderr, "AB found gap %d(%d)\n", dstart, part1); + para.cmdsn = htonl(shared->cmdsn); + para.type = htonl(1); + para.data.ap.firstSample = htonl(dstart); + para.data.ap.samples = htonl(part1); + // register ourself for the write handler. + int result; + result = ACE_Reactor::instance ()->register_handler (this,ACE_Event_Handler::WRITE_MASK); + if (result != 0) + return result; + this->mode_ = WRITE_FEEDBACK2; + temp = (char *)¶ + bytes = sizeof (para); + } + } + } + break; + default: + break; + } + return 0; +} + +int +AudioBuffer::handle_output (ACE_HANDLE fd) +{ + ACE_UNUSED_ARG(fd); + ACE_DEBUG ((LM_DEBUG,"handle_output:mode = %d\n",this->mode_)); + int res; + if ((this->mode_ == WRITE_FEEDBACK1) || (this->mode_ == WRITE_FEEDBACK2)) + { + // send feedback. + + if (conn_tag != 0) + { /* packet stream */ + res = ACE_OS::write (dataSocket, temp, bytes); + if (res == -1) + { + if (errno == ENOBUFS) { + ACE_OS::perror ("AB Warning, resend-req packet discarded for"); + return 0; + } + ACE_OS::perror ("AB error, resend-req packet sending failed"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + } + else + { + res = ACE_OS::write (dataSocket, temp, bytes); + if (res == -1) { + ACE_OS::perror ("AB error, resend-req packet sending failed"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + } + if (res == 0) + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t)AudioBuffer::handle_output:write failed\n")); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + temp += res; + bytes -= res; + if (bytes != 0) + return 0; + else + { + // remove the write handler. + int result; + result = ACE_Reactor::instance ()->remove_handler (this, + ACE_Event_Handler::WRITE_MASK); + if (result != 0) + return result; + + this->mode_ = READ_HEADER; + temp = (char *)packet; + bytes == -1; + } + } + if (this->mode_ == WRITE_FEEDBACK1) + { + // adjust the wakeup time and feedback state. + waketime = get_usec() + STARTUP_WAIT; + fbstate = 1; + } + return 0; +} + +int +AudioBuffer::ABprocess (int socket) +{ + int result; + ACE_DEBUG ((LM_DEBUG,"(%P|%t)AudioBuffer::ABprocess ()\n")); + packet = (AudioPacket *)ACE_OS::malloc(PACKET_SIZE); + if (packet == NULL) { + ACE_OS::perror ("AB failed to allocate mem for packet buffer"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + + this->dataSocket = socket; + ACE_NEW_RETURN (this->handler_, + Audio_Notification_Handler, + -1); + // Register the notification handler with the reactor. + result = ACE_Reactor::instance ()->register_handler (this->handler_, + ACE_Event_Handler::READ_MASK); + if (result != 0) + return result; + + result = ACE_Reactor::instance ()->register_handler (this, + ACE_Event_Handler::READ_MASK); + + if (result != 0) + return result; + + conn_tag = shared->audioMaxPktSize; + exit_tag = 0; + + this->mode_ = READ_HEADER; + pkt_data = (char *)packet + sizeof(*packet); + temp = (char *)packet; + bytes = -1; + return 0; +} + +// following is feedback algorithm. +void +AudioBuffer::feedback (void) +{ + if (shared->live || (!shared->config.syncEffective)) return; + /* + fprintf(stderr, "AB fbstate = %d\n", fbstate); + */ + switch (fbstate) { + case 0: /* startup init */ + if (pcmdsn != packet->cmdsn) { + fbstate = 0; + pcmdsn = packet->cmdsn; + } + else { + fbstate = 1; + waketime = get_usec() + STARTUP_WAIT; + } + break; + case 1: /* startup wait */ + if (pcmdsn != packet->cmdsn) { + fbstate = 0; + break; + } + if (get_usec() >= (int)waketime) { + fbstate = 2; + } + break; + case 2: /* monitoring */ + if (pcmdsn != packet->cmdsn) { + fbstate = 0; + break; + } + if (abuf->samples < abuf->size >>2 || + abuf->samples > (abuf->size * 3) >> 2) + { + /* feedback action needed */ + AudioFeedBackPara para; + + para.data.fb.addsps = 0; + para.data.fb.addSamples = (abuf->size >> 2) - abuf->samples; + + Fprintf(stderr, "AB sends fb: %dsps, %dsamples\n", + para.data.fb.addsps, + para.data.fb.addSamples); + para.cmdsn = htonl(shared->cmdsn); + para.type = htonl(0); + para.data.fb.addsps = htonl(para.data.fb.addsps); + para.data.fb.addSamples = htonl(para.data.fb.addSamples); + int result = ACE_Reactor::instance ()->register_handler (this,ACE_Event_Handler::WRITE_MASK); + if (result != 0) + ACE_DEBUG ((LM_DEBUG,"register_hanlder for write failed\n")); + this->mode_ = WRITE_FEEDBACK1; + temp = (char *)¶ + bytes = sizeof (para); + return; + } + break; + default: + break; + } +} + +ACE_HANDLE +Audio_Notification_Handler::get_handle (void) const +{ + return asp[1]; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.h new file mode 100644 index 00000000000..e1397665998 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ab.h @@ -0,0 +1,161 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// mpeg_client +// +// = FILENAME +// ab.h +// +// = DESCRIPTION +// Defines the audio packet buffering process. +// +// = AUTHORS +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#if !defined (AV_AB_H) +#define AV_AB_H + +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <unistd.h> +#include <stdlib.h> +#include <netinet/in.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> +#ifdef __svr4__ +#include <stropts.h> +#include <sys/conf.h> +#endif + +#include "include/common.h" +#include "newproto.h" +#include "global.h" +#include "mpeg_shared/filters.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "ace/OS.h" +#include "ace/Event_Handler.h" +#include "ace/Reactor.h" +#include "vb.h" + +extern VideoBuffer *vbuffer; + +/* magic number -- deviation is considered + caused by clock drift only if rate <= 1/MAX_CLOCK_DRIFT. + */ +#define MAX_CLOCK_DRIFT 50 + +#define max(a,b) ((a)>(b) ? (a) : (b)) +#define min(a,b) ((a)<(b) ? (a) : (b)) +#define PACKET_SIZE 8192 +#define STARTUP_WAIT 10000000 +#define ACTION_WAIT 5000000 + +typedef struct { + int bufsize; /* number of bytes for the buffer pointed by 'buf' */ + char * buf; /* pointer to the data buffer area */ + int bps; /* current byte-per-sample */ + int size; /* number of samples the buffer can hold */ + int samples; /* number of samples in the buffer; */ + int stuff; /* number of stuff samples to be read by ABgetSamples() */ + int ts; /* tail-sample: the next sample to be comsumed by CTR */ + int hs; /* head-sample: the next sample to be expected from the network */ + int tind; /* index of the ts-sample in the buf */ +} ABBuffer; + + +class Notification_Handler; + +class AudioBuffer :public ACE_Event_Handler +{ +public: + AudioBuffer (void); + // constructor. + + int ABprocess (int dataSocket); + // start the buffering process. + + ~AudioBuffer (void); + // destructor. + + virtual ACE_HANDLE get_handle (void) const; + // get the underlying I/O handle. + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // called when input arrives on the datasocket. + + virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // Called to send feedback. + + void set_silence(char *buf, int samples); + + void ABinitBuf(int size); + + void ABflushBuf(int nextSample); + // flush the whole buffer + + int ABcheckSamples(void); + // returns # of samples in ABbuf + + int ABgetSamples(char * buf, int samples); + // read at most given number of samples from AB to buf, returns + // number of sample actually read + + int ABskipSamples(int samples); + // if samples < 0; then stuff |samples| silient samples to ABgetSamples(), + // otherwise wipe out this number of samples from AB. + + void ABdeleteBuf(void); + + void ABdeleteSem(void); + + static void exit_on_kill(void); + + static void usr1_handler(int sig); + + static void usr2_handler(int sig); + + void feedback (void); + +private: + char *temp; + // temporary pointer. + int bytes; + // temporary placeholder for no.of bytes to be read. + ABBuffer *abuf; + int sid; + int exit_tag; + int savedSocket; + AudioPacket *packet; + char *pkt_data; + int conn_tag; + /* following are for feedback */ + int fbstate; + unsigned waketime; + int pcmdsn; + + int dataSocket; + // data socket handle. + + Notification_Handler *handler_; + + enum MODE {INVALID = -1,READ_HEADER,READ_DATA,WRITE_FEEDBACK1,WRITE_FEEDBACK2}; + int mode_; +}; + +class Audio_Notification_Handler :public Notification_Handler +{ +public: + virtual ACE_HANDLE get_handle (void) const; + // Returns the audio notification handle. +}; + +#endif /* AV_AB_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/audio.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/audio.cpp new file mode 100644 index 00000000000..117075a13f9 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/audio.cpp @@ -0,0 +1,495 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +/* ################################################################## + + When you port to a new architecture, you much add native audio + device support in this file by adding stuff to all relevant + functions, otherwise, it is disabled by default. + + ################################################################# */ + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <sys/ioctl.h> +#ifdef __svr4__ +#include <sys/audioio.h> +#elif defined(FreeBSD) +#include <machine/pcaudioio.h> +#elif defined(sun) +#include <sys/audioio.h> +#elif defined(_HPUX_SOURCE) +#include <sys/audio.h> +#elif defined(IRIX) +#include <audio.h> +#endif + +#ifdef FreeBSD +#define AUDIO_DEVICE "/dev/pcaudio" +#define AUDIO_CONTROL "/dev/pcaudioctl" +#elif defined(__svr4__) || defined(sun) +#define AUDIO_DEVICE "/dev/audio" +#define AUDIO_CONTROL "/dev/audioctl" +#elif defined(_HPUX_SOURCE) +#define AUDIO_DEVICE "/dev/audio" +#define AUDIO_CONTROL "/dev/audioCtl" +#elif defined(IRIX) +#define AUDIO_DEVICE "proprietary device" +#define AUDIO_CONTROL "proprietary device" +#elif defined(__linux__) +#define AUDIO_DEVICE "/dev/audio" +#define AUDIO_CONTROL "NO CONTROL DEV" +#endif + +#include <time.h> +#include <signal.h> +#include <sys/time.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#include "include/common.h" +#include "newproto.h" +#include "global.h" + +ACE_RCSID(mpeg_client, audio, "$Id$") + +static int cfd = -1, afd = -1; /* afd == -1 mean no native device available */ +static long start_time; +static long current_time; + +#ifdef IRIX +#define audioDevice AL_DEFAULT_DEVICE +static ALport playPort = NULL; +#endif + +#ifdef AUDIOFILE + +#include <AF/AFlib.h> +#include <AF/AFUtils.h> + +static int useAF = 0; + +static AFAudioConn *aud; +static AC ac; +static AFSetACAttributes attributes; + +/* + * Find a suitable default device + * Returns -1 if no suitable device can be found. + */ +static int FindDefaultDevice(AFAudioConn *aud) +{ + AFDeviceDescriptor *audioDevice; + int i; + for(i=0; i<ANumberOfAudioDevices(aud); i++) + { + audioDevice = AAudioDeviceDescriptor(aud, i); + if(audioDevice->inputsFromPhone == 0 && audioDevice->outputsToPhone == 0) + return i; + } + return -1; +} +#endif + +/* + returns: 0 - succ + -1 - failed +*/ +int InitAudioDevice(void) +{ +#ifdef AUDIOFILE + int device; + int gain; + unsigned int channels; + int endianflag = 0; +#endif + +#ifdef AUDIOFILE + device = -1; + attributes.preempt = Mix; + attributes.start_timeout = 0; + attributes.end_silence = 0; + attributes.play_gain = 0; + attributes.rec_gain = 0; + attributes.type = UNKNOWN_ENCODETYPE; + + if ( (aud = AFOpenAudioConn(NULL)) == NULL) + { + fprintf(stderr, "Failed locating default AudioFile.\n"); + goto native_audio; + } + + /* set up audio context, find sample size and sample rate + At this time, we only support default setings */ + device = FindDefaultDevice(aud); + attributes.type = aud->devices[device].playBufType; + ac = AFCreateAC(aud, device, (ACPlayGain | ACEncodingType | endianflag), + &attributes); + if (ac == NULL) + { + fprintf(stderr, "Failed Initializing default AudioFile.\n"); + AFCloseAudioConn(aud); + goto native_audio; + } + AFSync(aud, 0); /* Make sure we confirm encoding type support. */ + shared->AFPara.encodeType = attributes.type; + shared->AFPara.channels = ac->device->playNchannels; + shared->AFPara.bytesPerSample = + BytesPerUnit(attributes.type) / SampsPerUnit(attributes.type); + shared->AFPara.samplesPerSecond = ac->device->playSampleFreq; + /* + ACE_OS::memcpy (&(shared->AFPara), &(shared->config.audioPara), sizeof(AudioParameter)); + */ + useAF = 1; + fprintf(stderr, "Using default AudioFile.\n"); + return 0; +#elif defined(__svr4__) || defined(sun) || defined(FreeBSD) \ + || defined(_HPUX_SOURCE) || defined(IRIX) || defined(__linux__) + fprintf(stderr, "This vcr compiled without AudioFile, try native audio.\n"); +#else + fprintf(stderr, "This vcr compiled without AudioFile, audio to be ignored\n"); + afd = -1; + return -1; +#endif + + native_audio: + +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) || defined(_HPUX_SOURCE) + + afd = open(AUDIO_DEVICE, O_WRONLY | O_NDELAY); + if (afd == -1) { + fprintf(stderr, "%s", AUDIO_DEVICE); + ACE_OS::perror (" can't be opened for write"); + return -1; + } + cfd = open(AUDIO_CONTROL, O_WRONLY | O_NDELAY); + if (cfd == -1) { + fprintf(stderr, "%s", AUDIO_DEVICE); + ACE_OS::perror (" can't be opened for write"); + ACE_OS::close (afd); + afd = -1; + return -1; + } +#if defined(_HPUX_SOURCE) + + if (ioctl(cfd, AUDIO_SET_DATA_FORMAT, AUDIO_FORMAT_ULAW) < 0) { + fprintf(stderr, "%s" AUDIO_DEVICE); + ACE_OS::perror ("can't be set to u-law"); + ACE_OS::close (afd); + ACE_OS::close (cfd); + afd = -1; + return -1; + } + if (ioctl(cfd, AUDIO_SET_CHANNELS, 1) < 0) { + fprintf(stderr, "%s" AUDIO_DEVICE); + ACE_OS::perror ("can't be set to have single channel"); + ACE_OS::close (afd); + ACE_OS::close (cfd); + afd = -1; + return -1; + } + if (ioctl(cfd, AUDIO_SET_SAMPLE_RATE, 8000) < 0) { + fprintf(stderr, "%s" AUDIO_DEVICE); + ACE_OS::perror ("can't be set to 8000sps"); + ACE_OS::close (afd); + ACE_OS::close (cfd); + afd = -1; + return -1; + } + if (ioctl(cfd, AUDIO_SET_OUTPUT, AUDIO_OUT_SPEAKER | AUDIO_OUT_HEADPHONE)) + { + fprintf(stderr, "%s" AUDIO_DEVICE); + ACE_OS::perror ("can't be set output to both internal speaker and headphone"); + ACE_OS::close (afd); + ACE_OS::close (cfd); + afd = -1; + return -1; + } + if(ioctl(cfd, AUDIO_SET_TXBUFSIZE, 1024*64) < 0) + { + fprintf(stderr, "%s" AUDIO_DEVICE); + ACE_OS::perror ("can't be set output buffer size to 64K"); + ACE_OS::close (afd); + ACE_OS::close (cfd); + afd = -1; + return -1; + } +#endif /* _HPUX_SOURCE */ + +#elif defined(IRIX) + { +#define NCH 1 +#define MSQUEUE 100 + ALconfig c; + long params[2]; + + params[0] = AL_OUTPUT_RATE; + params[1] = 8000; + ALsetparams(audioDevice, params, 2); + + if ((c = ALnewconfig()) == NULL) { + afd = -1; + return -1; + } + ALsetwidth(c, AL_SAMPLE_16); + ALsetchannels(c, AL_MONO); + ALsetqueuesize(c, 10240); /* Minimal queue size */ + playPort = ALopenport(AUDIO_DEVICE, "w", c); + ALfreeconfig(c); + if (playPort == NULL) { + afd = -1; + return -1; + } + afd = 0; + } +#elif defined(__linux__) + + afd = open(AUDIO_DEVICE, O_WRONLY); + if (afd == -1) { + fprintf(stderr, "%s", AUDIO_DEVICE); + ACE_OS::perror (" can't be opened for write"); + return -1; + } + +#else /* no audio device supported on other platforms */ + + fprintf(stderr, "Audio device access not supported, audio to be ignored\n"); + afd = -1; + return -1; + +#endif /* sun, FreeBSD, _HPUX_SOURCE, ... */ + shared->AFPara.encodeType = AudioTypeMuLaw; + shared->AFPara.channels = 1; + shared->AFPara.bytesPerSample = 1; + shared->AFPara.samplesPerSecond = 8000; + start_time = get_msec(); + current_time = 0; + fprintf(stderr, "Using native %s\n", AUDIO_DEVICE); + return 0; +} + +void SetAudioParameter(AudioParameter * para) +{ +} + +unsigned int GetAudioTime(void) +{ +#ifdef AUDIOFILE + if (useAF) return AFGetTime(ac); +#endif +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) \ + || defined(_HPUX_SOURCE) || defined(IRIX) || defined(__linux__) + if (afd == -1) return 0; + return get_duration(start_time, get_msec()) * 8; /* 8K sampling speed */ +#else + return 0; +#endif +} + +/* Play size number of samples to AF */ +unsigned int PlayAudioSamples(unsigned int time, char * buf, int size) +{ +#ifdef AUDIOFILE + if (useAF) return AFPlaySamples(ac, time, size * shared->audioPara.bytesPerSample, + (unsigned char *)buf); +#endif + +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) \ + || defined(_HPUX_SOURCE) || defined(IRIX) || defined(__linux__) + if (afd == -1) return 0; + +#ifdef IRIX + { +#define BUFSIZE 1024 + static short AF_cvt_u2s[]={ + -32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956, + -23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764, + -15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412, + -11900,-11388,-10876,-10364, -9852, -9340, -8828, -8316, + -7932, -7676, -7420, -7164, -6908, -6652, -6396, -6140, + -5884, -5628, -5372, -5116, -4860, -4604, -4348, -4092, + -3900, -3772, -3644, -3516, -3388, -3260, -3132, -3004, + -2876, -2748, -2620, -2492, -2364, -2236, -2108, -1980, + -1884, -1820, -1756, -1692, -1628, -1564, -1500, -1436, + -1372, -1308, -1244, -1180, -1116, -1052, -988, -924, + -876, -844, -812, -780, -748, -716, -684, -652, + -620, -588, -556, -524, -492, -460, -428, -396, + -372, -356, -340, -324, -308, -292, -276, -260, + -244, -228, -212, -196, -180, -164, -148, -132, + -120, -112, -104, -96, -88, -80, -72, -64, + -56, -48, -40, -32, -24, -16, -8, 0, + 32124, 31100, 30076, 29052, 28028, 27004, 25980, 24956, + 23932, 22908, 21884, 20860, 19836, 18812, 17788, 16764, + 15996, 15484, 14972, 14460, 13948, 13436, 12924, 12412, + 11900, 11388, 10876, 10364, 9852, 9340, 8828, 8316, + 7932, 7676, 7420, 7164, 6908, 6652, 6396, 6140, + 5884, 5628, 5372, 5116, 4860, 4604, 4348, 4092, + 3900, 3772, 3644, 3516, 3388, 3260, 3132, 3004, + 2876, 2748, 2620, 2492, 2364, 2236, 2108, 1980, + 1884, 1820, 1756, 1692, 1628, 1564, 1500, 1436, + 1372, 1308, 1244, 1180, 1116, 1052, 988, 924, + 876, 844, 812, 780, 748, 716, 684, 652, + 620, 588, 556, 524, 492, 460, 428, 396, + 372, 356, 340, 324, 308, 292, 276, 260, + 244, 228, 212, 196, 180, 164, 148, 132, + 120, 112, 104, 96, 88, 80, 72, 64, + 56, 48, 40, 32, 24, 16, 8, 0 + }; + int left = size; + unsigned char * src = buf; + int i; + while (left > 0) { + short buffer[BUFSIZE]; + short * dst = buffer; + int len = left; + if (len > BUFSIZE) len = BUFSIZE; + left -= len; + for (i = 0; i < len; i ++) { + *(dst ++) = AF_cvt_u2s[*(src ++)]; + } + ALwritesamps(playPort, buffer, len); + } + } +#else + ACE_OS::write (afd, buf, size); +#endif + + current_time += size; + return get_duration(start_time, get_msec()) * 8; /* 8K sampling speed */ +#else + return 0; +#endif +} + +void StartAudioPlaySession(void) +{ + SetAudioGain(); +#ifdef AUDIOFILE + if (useAF) return; +#endif +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) \ + || defined(_HPUX_SOURCE) || defined(IRIX) + if (afd == -1) return; +#else + return; +#endif +} +void SetAudioGain(void) +{ +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) + audio_info_t sun_gapo; +#elif defined(_HPUX_SOURCE) + struct audio_gain ag; +#elif defined(IRIX) + long params[4]; +#endif + int volume = shared->volumePosition; + +#ifdef AUDIOFILE + if (useAF) { + AFSetOutputGain(ac, volume * 2); + /* + AFSetOutputGain(ac, (volume - 10)/3); + fprintf(stderr, "CTR audio.c: volume changed to %d.\n", volume); + */ + return; + } +#endif +#if defined(__svr4__) || defined(sun) || defined(FreeBSD) + if (afd == -1) return; + ioctl(cfd, AUDIO_GETINFO, &sun_gapo); + sun_gapo.play.gain = volume * 2; + ioctl(cfd, AUDIO_SETINFO, &sun_gapo); + return; +#elif defined(_HPUX_SOURCE) + ioctl(cfd, AUDIO_GET_GAINS, &ag); + ag.cgain[0].transmit_gain = AUDIO_OFF_GAIN+(AUDIO_MAX_GAIN-AUDIO_OFF_GAIN)*volume/100; + ag.cgain[1].transmit_gain = ag.cgain[0].transmit_gain; + ioctl(cfd, AUDIO_SET_GAINS, &ag); + return; +#elif defined(IRIX) + params[0] = AL_LEFT_SPEAKER_GAIN; + params[1] = volume; + params[2] = AL_RIGHT_SPEAKER_GAIN; + params[3] = volume; + ALsetparams(audioDevice, params, 4); + return; +#else + return; +#endif +} + +void AudioInterpolate(char *rBuf, int len, char * cBuf, int convLen) +{ + unsigned char *rawBuf = (unsigned char *)rBuf; + unsigned char *convBuf = (unsigned char *)cBuf; + int i; + float factor = (float)len / (float)convLen; + +#ifdef AUDIOFILE + if ((!useAF) && afd == -1) return; +#else + if (afd == -1) return; +#endif + + /* + Fprintf(stderr, "factor %5.2lf, len %d, convLen %d\n", factor, len, convLen); + */ + if (shared->audioPara.bytesPerSample == 1) + { + for (i=0; i<convLen; i++) + { + float a = i * factor; + int k = (int) (a + 0.5); + /* + int k = a; + a = a - k; + */ + if (k < len - 1) { /* interpolation algorithm can be improved */ + /* + convBuf[i] = AF_comp_u[(int)(a * AF_exp_u[(int)rawBuf[k+1] & 0xff] + (1.0 - a) * + AF_exp_u[(int)rawBuf[k] & 0xff]) + 8192]; + */ + + convBuf[i] = rawBuf[k]; + + } + else + convBuf[i] = rawBuf[len-1]; + } + } + else + { + fprintf(stderr, "CTR audio.c error: multi_byte samples not supported.\n"); + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp new file mode 100644 index 00000000000..49be9f6520b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ctr.cpp @@ -0,0 +1,990 @@ +// $Id$ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" + +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#include "include/common.h" +#include "newproto.h" +#include "global.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/sendpt.h" +#include "mpeg_shared/filters.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "Command_Handler.h" + +ACE_RCSID(mpeg_client, ctr, "$Id$") + +#define SPEEDHIST_SIZE 20 + +#if defined max +#undef max +#endif +#define max(a,b) (a>b ? a : b) + +#if defined min +#undef min +#endif +#define min(a,b) (a<b ? a : b) + +static int usr1_flag = 0; +static int rtplay = 1; +static int cmdSocket = -1; + +static int CTRpid = -1, VBpid = -1, VDpid = -1, UIpid = -1; +static int ABpid = -1; +static int videoSocket = -1; +static int audioSocket = -1; +static int hasAudioDevice = 0; +static int cmdBytes = 0; +static char *cmdBuffer = NULL; +static char *vh, *vf, *ah, *af; +static int cmdAcks = 0; +/* +static struct +{ + int frameId; + int usecPerFrame; + float frameRateLimit; + int frames; + int framesDropped; +} speedHistory[SPEEDHIST_SIZE]; + +*/ +/* following are for live video */ +static unsigned startTime; /* used to record start time for live playback, + also used to record FF/FB/PLAY round trip time */ +static unsigned startVSA; /* VS advance at the begining of playback of live video */ +static int displayedFrames; + +/* following static variable is for frameRate feedback. See comments on + initialization of these variables in function play()*/ + +static int fbstate = 0; /* state value of frame-rate feedback */ +static double maxfr = 0; /* frame-rate limit during playback, in fps. This is deduced + from frameRateLimit, a constant during a playback, even if + play speed changes */ +static int minupf = 0; /* minimum usec/frame, equals to 1000000/maxfr */ +static double maxrate = 0; /* current max frame rate, in percent of maxfr, after taken + playspeed into consideration. If play speed > maxfr, + then this value would be 1.0. Otherwise it would be + playspeed/maxfr */ +static double frate = 0; /* current server frame rate, in percentage of maxrate */ +static double adjstep = 0; /* step of frame-rate adjustment. In percentage value. + This is basically + maxrate/#frames-in-feedback-frame-sequence */ +static int fb_startup = 0; /* Indicate the first feedback action. The first feedback + action is to set the server fps directly according to + actully measured display frame-rate. All following + feedback action would then adjust server fps linearly + adjstep each time */ + +AudioBuffer *abuffer; +VideoBuffer *vbuffer; +int asp[2]; +int vsp[2]; +int vdsp[2]; + +#define max(a,b) (a>b ? a : b) +#define min(a,b) (a<b ? a : b) + +#define NewCmd(val) {shared->cmd = val; shared->cmdsn ++; } + +static void compute_sendPattern(void); + +int +OurCmdRead(char *buf, int size) +{ + + int val; + if (size == 0) return 0; + if (cmdBytes > 0) + { + ACE_OS::memcpy (buf, cmdBuffer, size); + cmdBytes -= size; + cmdBuffer += size; + return 0; + } + errno =0; + while ((val = ACE_OS::read (cmdSocket, buf, (size))) <= 0) + { + ACE_OS::printf("val is: %d\n", val); + if (val == -1 && errno == EINTR) return 1; + if (!val) { + ACE_OS::perror ("CTR error, EOF reached unexpected within CmdRead()"); + } + else { + ACE_OS::perror ("CTR CmdRead() from UI through CmdSocket"); + } + ACE_OS::exit (1); + } + return 0; +} + +static void CmdWrite(unsigned char * buf, int size) +{ + if (cmdAcks > 0 && size == 1 && *buf == CmdDONE) + { + cmdAcks --; + return; + } + + while (ACE_OS::write(cmdSocket, buf, size) == -1) + { + if (errno == EINTR) + continue; + ACE_OS::perror ("CTR writes to UI through cmdSocket"); + ACE_OS::exit (1); + } +} + +/* following function can be replaced by ../shared/fileio.c:read_bytes() + but SocketRead provides more error info */ + +static void SocketRead(int s, char *buf, int size) +{ int val, remain = size; + char * ptr = buf; + // fprintf (stderr, "SocketRead: videoSocket = %d\n",videoSocket); + for (;;) + { + val = ACE_OS::read (s, ptr, remain); + + // fprintf(stderr, "CTR got from %sSocket %d of %d.\n",s == videoSocket ? "video" : "audio", val, remain); + + if (val == -1 && errno == EINTR) + { + errno = 0; + continue; + } + if (val == -1) + { + fprintf(stderr, "CTR error read %sSocket, ret=%d(size=%d)", + s == videoSocket ? "video" : "audio", size-remain, size); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + if (val == 0) + { + fprintf(stderr, "CTR error read %sSocket, EOF met, ret=%d(size=%d).\n", + s == videoSocket ? "video" : "audio", size-remain, size); + ACE_OS::exit (1); + } + ptr += val; + remain -= val; + if (remain < 0) + { + fprintf(stderr, "CTR error read %sSocket, read too much, ret=%d(size=%d).\n", + s == videoSocket ? "video" : "audio", size-remain, size); + ACE_OS::exit (1); + } + if (remain == 0) + break; + } +} + +#define VideoRead(buf, size) SocketRead(videoSocket, buf, size) + +#define VideoWrite(buf, psize) \ + { int val; while ((val = ACE_OS::write (videoSocket, (buf), (psize))) == -1) \ + { if (errno == EINTR) continue; \ + ACE_OS::perror ("CTR writes to VS through videoSocket");\ + ACE_OS::exit (1); \ + } \ + if (val < (int)(psize)) { \ + fprintf(stderr, "CTR bad VideoWrite, size %d, val %d", psize, val);ACE_OS::perror (""); }\ + } + +#define AudioRead(buf, size) SocketRead(audioSocket, buf, size) + +#define AudioWrite(buf, size) \ + { while (write(audioSocket, (buf), (size)) == -1) \ + { if (errno == EINTR) continue; \ + ACE_OS::perror ("CTR writes to AS through audioSocket"); \ + ACE_OS::exit (1); \ + } \ + } + +/* +static void start_timer(void); +static void stop_timer(void); +static void timer_speed(void); +static void wait_display(void); +static void stop_playing(); +*/ + +static void set_speed(void) +{ + int val; + if (shared->live) { + shared->speedPosition = 50; + } + val = shared->speedPosition; + if (val == 0) + val = 1; + if (shared->cmd == CmdPLAY && audioSocket >= 0 && videoSocket >= 0 && rtplay) { + /* limit audio signal period to no more than 1.0 seconds, because AudioFile + will block if one send more than 4 seconds of sample ahead of current + time. and our timing control is not precise. + */ + double s = ((1.0 / shared->pictureRate) * 50.0) * + (double)max(shared->config.framesPerAudioPlay, 1) / 1.0; + if (s > 50.0) { + fprintf(stderr, "CTR warning: lower value of parameter framesPerAudioPlay,\n"); + fprintf(stderr, " otherwise the Player may not work properly.\n"); + } + if (val < s) { + if (shared->config.verbose) { + if (val < s * 1.0 / 2.0) { + val = (int)s; + fprintf(stderr, "CTR warning: speed too low, set to %d scale val.\n", val); + } + else { + fprintf(stderr, "CTR warning: audio signal period %3.2f > 1 sec.\n", + 1.0 * (float)s / (float) val); + fprintf(stderr, " lower framesPerAudioPlay or increase speed.\n"); + } + } + else { + val = (int)s; + } + } + } + if (videoSocket >= 0) + { + float fps; + if (val <= 50) + fps = shared->pictureRate * (float)val / 50.0; + else + { + float rate = shared->config.maxFPS - shared->pictureRate; + fps = shared->pictureRate + (float)rate * (float)(val - 50) / 50.0; + /* only B frames are to be dropped */ + } + Fprintf(stderr, "Play speed video %5.1ffps\n", fps); + shared->framesPerSecond = (int)fps; + shared->usecPerFrame = (int) (1000000.0/fps); + if (audioSocket >= 0) + { + float sps = shared->audioPara.samplesPerSecond * fps / shared->pictureRate; + shared->samplesPerSecond = (int)sps; + shared->usecPerSample = (int)(1000000.0/sps); + } + } + else if (audioSocket >= 0) + { + float sps; + if (val <= 50) + sps = (float)shared->audioPara.samplesPerSecond * (float)val / 50.0; + else + { + int rate = shared->config.maxSPS - shared->audioPara.samplesPerSecond; + sps = shared->audioPara.samplesPerSecond + (float)rate * (float)(val - 50) / 50.0; + } + Fprintf(stderr, "Play speed audio %5.1fsps\n", sps); + shared->samplesPerSecond = (int)sps; + shared->usecPerSample = (int)(1000000.0/sps); + } +} + +static int timer_on = 0; +static int timer_signals_skip = 0; +static int timerCount = 0; +static int lastCount = 0; +static int timerUPF; +static int wait_usr2 = 0; +static int last_disp_fid = 0; + +static void loopBack(void) +{ + static char loopBackCmd[7] = {CmdSTOP, CmdPOSITIONrelease, + 0, 0, 0, 0, CmdPLAY}; + cmdBuffer = loopBackCmd; + cmdBytes = 7; + cmdAcks = 3; +} + +#define AUDIO_BUFSIZE 2048 + +static int audioCount = 0; +static int audioFirst = 0; +static int needAudioSkip = 0; +static int bufferedSamples; +static int nextASSample, startSample; +static unsigned int nextAFtime; +static int forward; +static int audioForward, framesPerAudioPlay; +static int AudioBufSize; +static char * rawBuf = NULL, * workBuf = NULL, * convBuf = NULL; + +static void PlayAudioInit(void) +{ + audioCount = -1; + audioFirst = 1; + needAudioSkip = 0; + startSample = nextASSample = shared->nextSample; + audioForward = shared->config.audioForward; + framesPerAudioPlay = max(shared->config.framesPerAudioPlay, 1); + if (audioForward <= 0) + audioForward = DEFAULT_audioForward; + fprintf(stderr, "CTR audioForward: %d samples.\n", audioForward); + bufferedSamples = (int)(((double) + (shared->config.audioTimerDuration * + shared->config.audioBufferedIntervals)) + * (double)shared->audioPara.samplesPerSecond / 1000.0); + if (rawBuf == NULL) + { + if ((rawBuf = (char *)ACE_OS::malloc(AUDIO_BUFSIZE)) == NULL) + { + ACE_OS::perror ("CTR fails to allocate rawBuf for audio channel"); + ACE_OS::exit (1); + } + if ((workBuf = (char *)ACE_OS::malloc(AUDIO_BUFSIZE)) == NULL) + { + ACE_OS::perror ("CTR fails to allocate workBuf for audio channel"); + ACE_OS::exit (1); + } + } + AudioBufSize = (AUDIO_BUFSIZE / shared->audioPara.bytesPerSample) * + shared->audioPara.bytesPerSample; + + StartAudioPlaySession(); +} + +/* input the number of samples in the raw buffer, + returns the numberof samples in theconverted buffer */ +static int AudioConvert(int len) +{ + int convLen; + + if (shared->samplesPerSecond == shared->audioPara.samplesPerSecond) + { + convBuf = rawBuf; + return len; + } + + convBuf = workBuf; + convLen = len * shared->audioPara.samplesPerSecond / shared->samplesPerSecond; + AudioInterpolate(rawBuf, len, convBuf, convLen); + return convLen; +} + +/* returns: 0 - no forward calculated , 1 - forward calculated */ +static int PlayAudio(void) +{ + int timer_count = timerCount; + int i = timer_count / framesPerAudioPlay; + if (audioFirst) + { + audioFirst = 0; + nextAFtime = GetAudioTime() + audioForward;; + audioCount = -1; /* guarantee that PlayAudio do the first step */ + } + if (audioCount == i) /* current audio timer signal already processed */ + return 0; + if (audioCount < i - 1) /* some audio timer signal missing */ + { + needAudioSkip = 1; + /* + Fprintf(stderr, "CTR: some audio timer signal missed.\n"); + */ + } + if (nextASSample >= shared->totalSamples) + { + /* + timer_on ++; + */ + return 0; + } + + audioCount = i; + + if (needAudioSkip) + { + /* return if not enough skip can be done */ + int next_sample = (int)(startSample + + ((double)timer_count / shared->pictureRate) * + shared->audioPara.samplesPerSecond); + int skip_samples = next_sample - nextASSample; + abuffer->ABskipSamples(skip_samples); + nextAFtime += (unsigned int)(((double)skip_samples * + (double)shared->audioPara.samplesPerSecond) / + (double)shared->samplesPerSecond); + nextASSample += skip_samples; + needAudioSkip = 0; + } + + /* read current block, convert, put to AF, and update nextAFtime */ + { + int frame_samples = (int)(startSample + + ((double)(timer_count + framesPerAudioPlay) / shared->pictureRate) * + (double)shared->audioPara.samplesPerSecond - + nextASSample); + int fsize = frame_samples * shared->audioPara.bytesPerSample; + int read_samples; + unsigned int curAFtime; + unsigned int oldAFtime = nextAFtime; + char * ptr = rawBuf; + if (fsize > AudioBufSize) + { /* make sure the rawBuf is big enough */ + Fprintf(stderr, "CTR PlayAudio error: BytesPerFrame=%d > AudioBufSize=%d.\n", + fsize, AudioBufSize); + Fprintf(stderr, + "CTR PlayAudio: startSample=%d, timer_count=%d, nextASSmple=%d.\n", + startSample, timer_count, nextASSample); + fprintf(stderr, "Internal error: audio resampling buffer not big enough,\n\ + please reduce value of parameter 'Audio timer interval',\n\ + or 'Audio buffered intervals' or Frames per audio play',\n\ + and try again.\n"); + ACE_OS::exit (1); + } + + read_samples = abuffer->ABgetSamples(ptr, frame_samples); + + /* convert and play to AF */ + { + int maxSamples; + int left_samples = read_samples; + if (shared->samplesPerSecond >= shared->audioPara.samplesPerSecond) + maxSamples = (AudioBufSize/shared->audioPara.bytesPerSample); + else + maxSamples = ((AudioBufSize/shared->audioPara.bytesPerSample) * + shared->samplesPerSecond) / + shared->audioPara.samplesPerSecond; + for (;;) + { + int samples = (left_samples > maxSamples) ? maxSamples : left_samples; + int convSamples = AudioConvert(samples); + curAFtime = PlayAudioSamples(nextAFtime, convBuf, convSamples); + nextAFtime += convSamples; + left_samples -= samples; + if (left_samples == 0) + break; + else + { + ACE_OS::memcpy (rawBuf, rawBuf + samples * shared->audioPara.bytesPerSample, + left_samples * shared->audioPara.bytesPerSample); + } + } + } + + /* possible bugs in AF some times cause PlayAudioSample() to return 0 */ + forward = curAFtime ? (oldAFtime - curAFtime) : audioForward; + /* + if ((oldAFtime - curAFtime) > (audioForward << 6)) { + fprintf(stderr, "forward %d, oldAFtime %d, curAFtime %d\n", + oldAFtime - curAFtime, oldAFtime, curAFtime); + } + */ + /* check condition */ + if (read_samples == frame_samples) { /* all bytes for current frame already read */ + nextASSample += frame_samples; + } + else { /* read to the end of audio file */ + /* + timer_on ++; + */ + nextASSample += read_samples; + } + shared->nextSample = nextASSample; + } + return 1; +} + + + +#define MAX_WAIT_USEC 10000000 + +static void start_timer (void) +{ + struct itimerval val; + + if (audioSocket >= 0 && shared->cmd == CmdPLAY && rtplay) + { + // ACE_DEBUG ((LM_DEBUG,"calling playaudioinit ()\n")); + PlayAudioInit(); + } + + /* sleep for a while to wait for decoding the first picture + and/or audio stream ready */ + { + unsigned val1 = startTime; + if (audioSocket >= 0 && shared->cmd == CmdPLAY && rtplay) + { + if (shared->nextSample < shared->totalSamples) + { + int samples = videoSocket >= 0 ? 1200 : 1200; + while (abuffer->ABcheckSamples() <= samples) + { + if (get_duration(val1, get_usec()) >= MAX_WAIT_USEC) + { + fprintf(stderr, "CTR warning: audio is not ready yet.\n"); + break; + } + else + { + usleep(10000); + continue; + } + } + } + } + + if (videoSocket >= 0) + { + while (VDcheckMsg() <= 0) { /* keep sleeping for 1 millisec until a decoded + frame show up in VD buffer */ + if (get_duration(val1, get_usec()) >= MAX_WAIT_USEC) { + fprintf(stderr, "CTR warning: video is not ready yet.\n"); + break; + } + usleep(10000); + } + } + val1 = get_duration(val1, get_usec()) / 1000; + shared->playRoundTripDelay = val1; + + Fprintf(stderr, "CTR: estimated play round trip delay: %d millisec.\n", val1); + + /* + if (shared->collectStat) + { + fprintf(stderr, "CTR: estimated play round trip delay: %d millisec.\n", val1); + } + */ + } + timer_on = 1; + timer_signals_skip = 0; + timerCount = 0; + lastCount = 0; + + if (shared->live) { + + /* delay for shared->config.VStimeAdvance milliseconds, adjustable delay */ + if (shared->config.VStimeAdvance > 0) { + Fprintf(stderr, "CTR adds %d millisec of latency\n", + shared->config.VStimeAdvance); + usleep(shared->config.VStimeAdvance * 1000); + } + displayedFrames = 0; + startTime = get_usec(); + startVSA = shared->nextFrame - shared->VBheadFrame; + if (startVSA < 5) startVSA = 5; + /* + Fprintf(stderr, "CTR: startVSA %d\n", startVSA); + */ + } + + if (shared->cmd == CmdPLAY && rtplay) { + wait_usr2 = 0; + } + else { + wait_usr2 = 1; + } + last_disp_fid = -1; + /* + fprintf(stderr, "CTR start_timer() - %s for usr2\n", + wait_usr2 ? "wait" : "NOwait"); + */ + if (shared->cmd == CmdPLAY && audioSocket >= 0 && videoSocket < 0) + timerUPF = shared->config.audioTimerDuration * 1000; + else { + timerUPF = shared->usecPerFrame; + } +#ifdef STAT + speedPtr = 1; + speedHistory[0].frameId = shared->nextFrame; + speedHistory[0].usecPerFrame = timerUPF; + speedHistory[0].frameRateLimit = shared->frameRateLimit; + speedHistory[0].frames = shared->sendPatternGops * shared->patternSize; + speedHistory[0].framesDropped = shared->framesDropped; +#endif + /* + fprintf(stderr, "CTR: timer started at %d upf.\n", timerUPF); + */ + val.it_interval.tv_sec = val.it_value.tv_sec = timerUPF / 1000000; + val.it_interval.tv_usec = val.it_value.tv_usec = timerUPF % 1000000; + // setsignal(SIGALRM, TimerHandler); + setitimer(ITIMER_REAL, &val, NULL); +} + + +static void wait_display(void) +{ + if (!usr1_flag) { + if (shared->cmd == CmdINIT) sleep(10);// XXX hack to make the client wait until the server gets a chance. + else usleep(800000); + } + if (!usr1_flag) + { + if (shared->cmd == CmdSTEP) /* to skip undecodable pictures */ + shared->nextFrame ++; + else if (shared->cmd == CmdINIT) { + fprintf(stderr, "Warning: initialilzation failed. Please reinitialize the program.\n"); + } + return; + } + usr1_flag = 0; +} + +static void usr1_handler(int /* sig */) +{ + FrameBlock *buf; + unsigned char tmp; + /* + Fprintf(stderr, "CTR got USR1 for displaying single frame.\n"); + */ + usr1_flag = 1; + + if (shared->cmd == CmdINIT) { /* Initialize display window */ + tmp = CmdVPinitScreen; + CmdWrite(&tmp, 1); + } + /* + fprintf(stderr, "CTR: %d frames in VDbuf.\n", VDcheckMsg()); + */ + while (VDcheckMsg() > 1) + { + /* + Fprintf(stderr, "CTR: VDcheckMsg() = %d, to discard a picture.\n", VDcheckMsg()); + */ + if ((buf = VDgetMsg()) != NULL) + VDreclaimMsg(buf); + else + fprintf(stderr, "CTR error: VDgetMsg is NULL, unexpected.\n"); + } + if (VDcheckMsg() >0 ) { + /* + Fprintf(stderr, "CTR to display a frame in user1_handler()\n"); + */ + buf = VDgetMsg(); + } + else { + /* + Fprintf(stderr, "CTR no frame to display in user_handler()\n"); + */ + buf = NULL; + } + + if (buf != NULL) { + if (shared->cmd == CmdSTEP) + { + shared->nextFrame ++; + shared->nextGroup = buf->gop + 1; + } + else + { + shared->nextFrame = buf->display; + shared->nextGroup = buf->gop; + } + tmp = CmdVPdisplayFrame; + CmdWrite(&tmp, 1); + CmdWrite((unsigned char *)&buf, sizeof(char *)); + } + else if (shared->cmd == CmdSTEP) { + shared->nextFrame ++; + } +} + +static void compute_sendPattern(void) +{ + char buf[PATTERN_SIZE]; + float limit = shared->frameRateLimit; + char * pat = shared->pattern; + int len = shared->patternSize * shared->sendPatternGops; + int f; + + if (limit <= 0) + limit = 1.0; + if (rtplay) { + f = (int)((double)len * + ((double)limit / (1000000.0 / (double)shared->usecPerFrame)) + 0.5); + /* rounded to integer, instead of truncated */ + } + else { + f = len; + } + if (f >= len) + f = len; + else if (f <= 1) + f = 1; + + ComputeSendPattern(pat, buf, len, f); + shared->qosRecomputes ++; + + ACE_OS::memcpy (shared->sendPattern, buf, PATTERN_SIZE); + + f = len - f; + if (shared->config.verbose) { + fprintf(stderr, "speed %dupf, %d frames dropped, frames %d:\nsend pattern:", + shared->usecPerFrame, f, len); + shared->framesDropped = f; + { + int i; + for (i = 0; i < len; i ++) + fputc(buf[i] ? pat[i] : '-', stderr); + } + fputc('\n', stderr); + } +} + +/* +static void on_exit_routine(void) +{ + // ACE_DEBUG ((LM_DEBUG, + // "(%P|%t) %s:%d\n", + // __FILE__, + // __LINE__)); + + if (getpid() != CTRpid) return; + + if (audioSocket >= 0) + { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (asp[0],&message,BUFSIZ); + // ACE_OS::write (audioSocket, &tmp, 1); + // ComCloseConn(audioSocket); + audioSocket = -1; + } + + if (videoSocket >= 0) + { + // ACE_OS::write (videoSocket, &tmp, 1); + // ComCloseConn(videoSocket); + videoSocket = -1; + if (VBpid > 0) { + char message[BUFSIZ]; + message [0] = EXIT; + ACE_OS::write (vsp[0],&message,BUFSIZ); + // ACE_OS::kill (VBpid, SIGUSR1); + VBpid = -1; + } + } + ComCloseClient(); +} +*/ + +int CTRmain(int argc, + char **argv) +{ + ACE_HANDLE sv[2]; + extern void set_exit_routine_tag(int tag); + + + set_exit_routine_tag(0); + + /* allocate shared data structure and initialize it */ + shared = (SharedData *) creat_shared_mem(sizeof(*shared)); + shared->cmd = 0; + shared->cmdsn = 0; + shared->cmdBusy = 0; + shared->loopBack = 0; + shared->volumePosition = 0; + shared->balancePosition = 50; + shared->locationPosition = 0; + shared->speedPosition = 0; + shared->qosRecomputes = 0; + + shared->pixelValid = 0; + + shared->config.rt = 1; + shared->config.maxFPS = DEFAULT_maxFPS; + shared->config.maxSPS = DEFAULT_maxSPS; + shared->config.ffFPS = DEFAULT_ffFPS; + shared->config.fbFPS = DEFAULT_fbFPS; + shared->config.feedBackDelay = DEFAULT_feedBackDelay; + shared->config.audioMask = DEFAULT_audioMask; + shared->config.audioPara.encodeType = DEFAULT_encodeType; + shared->config.audioPara.channels = DEFAULT_channels; + shared->config.audioPara.samplesPerSecond = DEFAULT_samplesPerSecond; + shared->config.audioPara.bytesPerSample = DEFAULT_bytesPerSample; + shared->config.audioTimerDuration = DEFAULT_audioTimerDuration; + shared->config.audioBufferedIntervals = DEFAULT_audioBufferedIntervals; + shared->config.framesPerAudioPlay = DEFAULT_framesPerAudioPlay; + shared->config.audioForward = DEFAULT_audioForward; + shared->config.VStimeAdvance = DEFAULT_VStimeAdvance; + shared->config.frameRateLimit = DEFAULT_maxFPS; + shared->config.collectStat = 0; + shared->config.collectFrameInfo = 0; + shared->config.syncEffective = 1; + shared->config.qosEffective = 1; + shared->config.audioOffset = 0; + shared->config.filterPara = DEFAULT_filterPara; + shared->config.maxSPframes = DEFAULT_maxSPframes; + shared->config.audioConn = 0; + shared->config.videoConn = 0; + shared->config.verbose = (!getuid()) || ACE_OS::getuid () == DEVELOPER_UID; + + ACE_NEW_RETURN (vbuffer, + VideoBuffer (), + -1); + + ACE_NEW_RETURN (abuffer, + AudioBuffer (), + -1); + + /* create all shared buffers: AB-CTR, VB-VD, VD-VP */ + abuffer->ABinitBuf(AB_BUF_SIZE); + vbuffer->VBinitBuf(VB_BUF_SIZE); + VDinitBuf(VD_BUF_SIZE); + + CTRpid =ACE_OS::getpid (); + set_exit_routine_tag(1); + + + // create the notification socket pair. + if (ACE_OS::socketpair (AF_UNIX,SOCK_STREAM,0,asp) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"Error in opening notification socket:%p", + "notification socket"),-1); + + // create the notification socket pair. + if (ACE_OS::socketpair (AF_UNIX,SOCK_STREAM,0,vsp) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"Error in opening notification socket:%p", + "notification socket"),-1); + + if (ACE_OS::socketpair (AF_UNIX,SOCK_STREAM,0,vdsp) == -1) + ACE_ERROR_RETURN ((LM_ERROR,"Error in opening notification socket:%p", + "notification socket"),-1); + + /* create command socket pair */ + if (ACE_OS::socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == -1) + { + ACE_OS::perror ("CTR error on open cmd socketpair"); + ACE_OS::exit (1); + } + cmdSocket = sv[0]; + /* fork processes: VD, GUI */ + + if ((VDpid = ACE_OS::fork ()) == -1) + { + ACE_OS::perror ("CTR error on fork VD"); + ACE_OS::exit (1); + } else if (VDpid == 0) + { + abuffer->ABdeleteBuf(); + ACE_OS::close (sv[0]); + ACE_OS::close (sv[1]); + if (realTimeFlag >= 3) { + if (SetRTpriority("VD", 0)) realTimeFlag = 0; + } + VDprocess(CTRpid); + } + + if ((UIpid = ACE_OS::fork ()) == -1) + { + ACE_OS::perror ("CTR error on fork UI"); + ACE_OS::exit (1); + } else if (UIpid == 0) + { + vbuffer->VBdeleteBuf(); + abuffer->ABdeleteBuf(); + ACE_OS::close (sv[0]); + if (realTimeFlag >= 2) { +#ifdef __svr4__ + if (SetRTpriority("VB", 0)) realTimeFlag = 0; +#elif defined(_HPUX_SOURCE) + if (SetRTpriority("VB", 2)) realTimeFlag = 0; +#endif + } + UIprocess(sv[1]); + } + ACE_OS::close (sv[1]); + + /* initialize Audio device */ + if (InitAudioDevice() == 0) + hasAudioDevice = 1; + else + hasAudioDevice = 0; + + // ComInitClient(VCR_TCP_PORT, VCR_UNIX_PORT, VCR_ATM_PORT); + + if ((vh = (char *)ACE_OS::malloc(PATH_SIZE)) == NULL) + { + ACE_OS::perror ("CTR failed to allocate space for vh"); + ACE_OS::exit (1); + } + if ((vf = (char *)ACE_OS::malloc(PATH_SIZE)) == NULL) + { + ACE_OS::perror ("CTR failed to allocate space for vf"); + ACE_OS::exit (1); + } + if ((ah = (char *)ACE_OS::malloc(PATH_SIZE)) == NULL) + { + ACE_OS::perror ("CTR failed to allocate space for ah"); + ACE_OS::exit (1); + } + if ((af = (char *)ACE_OS::malloc(PATH_SIZE)) == NULL) + { + ACE_OS::perror ("CTR failed to allocate space for af"); + ACE_OS::exit (1); + } + if (realTimeFlag) { + if (SetRTpriority("CTR", 4)) realTimeFlag = 0; + } + + // instantiate our command handler + Command_Handler command_handler (cmdSocket); + if (command_handler.init (argc,argv) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) command_handler: init returned -1"), + -1); + + // .. and register it with the reactor. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler (&command_handler, + ACE_Event_Handler::READ_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for command_handler failed\n"), + -1); + + command_handler.run (); + if (ABpid == 0) + { + ACE_DEBUG ((LM_DEBUG,"(%d) Restarting the ACE_Reactor::instance ()\n",ACE_OS::getpid ())); + ACE_Reactor::instance ()->run_event_loop (); + int result = TAO_ORB_Core_instance ()->reactor ()->remove_handler (&command_handler, + ACE_Event_Handler::READ_MASK); + if (result == -1) + ACE_DEBUG ((LM_DEBUG,"(%P)Remove handler for Command Handler failed\n")); + } + + if (VBpid == 0) + { + ACE_DEBUG ((LM_DEBUG,"(%d) Restarting the ACE_Reactor::instance ()\n",ACE_OS::getpid ())); + ACE_Reactor::instance ()->run_event_loop (); + } + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Exited the client command handler event loop\n" + "%p\n", + "run_event_loop")); + + return 0; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.cpp new file mode 100644 index 00000000000..91585213d1f --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.cpp @@ -0,0 +1,938 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* + * decoders.c + * + * This file contains all the routines for Huffman decoding required in + * MPEG + * + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <assert.h> +#include "decoders.h" +#include "util.h" +#include "video.h" +#include "proto.h" + +ACE_RCSID(mpeg_client, decoders, "$Id$") + +/* Decoding table for macroblock_address_increment */ +mb_addr_inc_entry mb_addr_inc[2048]; + +/* Decoding table for macroblock_type in predictive-coded pictures */ +mb_type_entry mb_type_P[64]; + +/* Decoding table for macroblock_type in bidirectionally-coded pictures */ +mb_type_entry mb_type_B[64]; + +/* Decoding table for motion vectors */ +motion_vectors_entry motion_vectors[2048]; + +/* Decoding table for coded_block_pattern */ + +coded_block_pattern_entry coded_block_pattern[512] = +{ {(unsigned int)ERROR, 0}, {(unsigned int)ERROR, 0}, {39, 9}, {27, 9}, {59, 9}, {55, 9}, {47, 9}, {31, 9}, + {58, 8}, {58, 8}, {54, 8}, {54, 8}, {46, 8}, {46, 8}, {30, 8}, {30, 8}, + {57, 8}, {57, 8}, {53, 8}, {53, 8}, {45, 8}, {45, 8}, {29, 8}, {29, 8}, + {38, 8}, {38, 8}, {26, 8}, {26, 8}, {37, 8}, {37, 8}, {25, 8}, {25, 8}, + {43, 8}, {43, 8}, {23, 8}, {23, 8}, {51, 8}, {51, 8}, {15, 8}, {15, 8}, + {42, 8}, {42, 8}, {22, 8}, {22, 8}, {50, 8}, {50, 8}, {14, 8}, {14, 8}, + {41, 8}, {41, 8}, {21, 8}, {21, 8}, {49, 8}, {49, 8}, {13, 8}, {13, 8}, + {35, 8}, {35, 8}, {19, 8}, {19, 8}, {11, 8}, {11, 8}, {7, 8}, {7, 8}, + {34, 7}, {34, 7}, {34, 7}, {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7}, + {10, 7}, {10, 7}, {10, 7}, {10, 7}, {6, 7}, {6, 7}, {6, 7}, {6, 7}, + {33, 7}, {33, 7}, {33, 7}, {33, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7}, + {9, 7}, {9, 7}, {9, 7}, {9, 7}, {5, 7}, {5, 7}, {5, 7}, {5, 7}, + {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, {63, 6}, + {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, {3, 6}, + {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, {36, 6}, + {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, {24, 6}, + {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, + {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, {62, 5}, + {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, + {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, {2, 5}, + {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, + {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, {61, 5}, + {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, + {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, {1, 5}, + {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, + {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, {56, 5}, + {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, + {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, {52, 5}, + {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, + {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, {44, 5}, + {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, + {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, {28, 5}, + {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, + {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, {40, 5}, + {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, + {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, {20, 5}, + {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, + {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, {48, 5}, + {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, {12, 5}, + {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, + {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, + {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, + {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, + {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, + {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, + {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, + {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, + {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, + {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, + {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, + {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, {8, 4}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, + {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3}, {60, 3} +}; + +/* Decoding table for dct_dc_size_luminance */ +dct_dc_size_entry dct_dc_size_luminance[128] = +{ {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, + {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, {0, 3}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, + {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, {4, 3}, + {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4}, + {6, 5}, {6, 5}, {6, 5}, {6, 5}, {7, 6}, {7, 6}, {8, 7}, {(unsigned int)ERROR, 0} +}; + +/* Decoding table for dct_dc_size_chrominance */ +dct_dc_size_entry dct_dc_size_chrominance[256] = +{ {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, {4, 4}, + {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, {5, 5}, + {6, 6}, {6, 6}, {6, 6}, {6, 6}, {7, 7}, {7, 7}, {8, 8}, {(unsigned int)ERROR, 0} +}; + +/* DCT coeff tables. */ + +unsigned short int dct_coeff_tbl_0[256] = +{ +0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, +0xffff, 0xffff, 0xffff, 0xffff, +0x052f, 0x051f, 0x050f, 0x04ff, +0x183f, 0x402f, 0x3c2f, 0x382f, +0x342f, 0x302f, 0x2c2f, 0x7c1f, +0x781f, 0x741f, 0x701f, 0x6c1f, +0x028e, 0x028e, 0x027e, 0x027e, +0x026e, 0x026e, 0x025e, 0x025e, +0x024e, 0x024e, 0x023e, 0x023e, +0x022e, 0x022e, 0x021e, 0x021e, +0x020e, 0x020e, 0x04ee, 0x04ee, +0x04de, 0x04de, 0x04ce, 0x04ce, +0x04be, 0x04be, 0x04ae, 0x04ae, +0x049e, 0x049e, 0x048e, 0x048e, +0x01fd, 0x01fd, 0x01fd, 0x01fd, +0x01ed, 0x01ed, 0x01ed, 0x01ed, +0x01dd, 0x01dd, 0x01dd, 0x01dd, +0x01cd, 0x01cd, 0x01cd, 0x01cd, +0x01bd, 0x01bd, 0x01bd, 0x01bd, +0x01ad, 0x01ad, 0x01ad, 0x01ad, +0x019d, 0x019d, 0x019d, 0x019d, +0x018d, 0x018d, 0x018d, 0x018d, +0x017d, 0x017d, 0x017d, 0x017d, +0x016d, 0x016d, 0x016d, 0x016d, +0x015d, 0x015d, 0x015d, 0x015d, +0x014d, 0x014d, 0x014d, 0x014d, +0x013d, 0x013d, 0x013d, 0x013d, +0x012d, 0x012d, 0x012d, 0x012d, +0x011d, 0x011d, 0x011d, 0x011d, +0x010d, 0x010d, 0x010d, 0x010d, +0x282c, 0x282c, 0x282c, 0x282c, +0x282c, 0x282c, 0x282c, 0x282c, +0x242c, 0x242c, 0x242c, 0x242c, +0x242c, 0x242c, 0x242c, 0x242c, +0x143c, 0x143c, 0x143c, 0x143c, +0x143c, 0x143c, 0x143c, 0x143c, +0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, +0x0c4c, 0x0c4c, 0x0c4c, 0x0c4c, +0x085c, 0x085c, 0x085c, 0x085c, +0x085c, 0x085c, 0x085c, 0x085c, +0x047c, 0x047c, 0x047c, 0x047c, +0x047c, 0x047c, 0x047c, 0x047c, +0x046c, 0x046c, 0x046c, 0x046c, +0x046c, 0x046c, 0x046c, 0x046c, +0x00fc, 0x00fc, 0x00fc, 0x00fc, +0x00fc, 0x00fc, 0x00fc, 0x00fc, +0x00ec, 0x00ec, 0x00ec, 0x00ec, +0x00ec, 0x00ec, 0x00ec, 0x00ec, +0x00dc, 0x00dc, 0x00dc, 0x00dc, +0x00dc, 0x00dc, 0x00dc, 0x00dc, +0x00cc, 0x00cc, 0x00cc, 0x00cc, +0x00cc, 0x00cc, 0x00cc, 0x00cc, +0x681c, 0x681c, 0x681c, 0x681c, +0x681c, 0x681c, 0x681c, 0x681c, +0x641c, 0x641c, 0x641c, 0x641c, +0x641c, 0x641c, 0x641c, 0x641c, +0x601c, 0x601c, 0x601c, 0x601c, +0x601c, 0x601c, 0x601c, 0x601c, +0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, +0x5c1c, 0x5c1c, 0x5c1c, 0x5c1c, +0x581c, 0x581c, 0x581c, 0x581c, +0x581c, 0x581c, 0x581c, 0x581c, +}; + +unsigned short int dct_coeff_tbl_1[16] = +{ +0x00bb, 0x202b, 0x103b, 0x00ab, +0x084b, 0x1c2b, 0x541b, 0x501b, +0x009b, 0x4c1b, 0x481b, 0x045b, +0x0c3b, 0x008b, 0x182b, 0x441b, +}; + +unsigned short int dct_coeff_tbl_2[4] = +{ +0x4019, 0x1429, 0x0079, 0x0839, +}; + +unsigned short int dct_coeff_tbl_3[4] = +{ +0x0449, 0x3c19, 0x3819, 0x1029, +}; + +unsigned short int dct_coeff_next[256] = +{ +0xffff, 0xffff, 0xffff, 0xffff, +0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, +0x0826, 0x0826, 0x2416, 0x2416, +0x0046, 0x0046, 0x2016, 0x2016, +0x1c15, 0x1c15, 0x1c15, 0x1c15, +0x1815, 0x1815, 0x1815, 0x1815, +0x0425, 0x0425, 0x0425, 0x0425, +0x1415, 0x1415, 0x1415, 0x1415, +0x3417, 0x0067, 0x3017, 0x2c17, +0x0c27, 0x0437, 0x0057, 0x2817, +0x0034, 0x0034, 0x0034, 0x0034, +0x0034, 0x0034, 0x0034, 0x0034, +0x1014, 0x1014, 0x1014, 0x1014, +0x1014, 0x1014, 0x1014, 0x1014, +0x0c14, 0x0c14, 0x0c14, 0x0c14, +0x0c14, 0x0c14, 0x0c14, 0x0c14, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0xfbe1, 0xfbe1, 0xfbe1, 0xfbe1, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +0x0011, 0x0011, 0x0011, 0x0011, +}; + +unsigned short int dct_coeff_first[256] = +{ +0xffff, 0xffff, 0xffff, 0xffff, +0xf7d5, 0xf7d5, 0xf7d5, 0xf7d5, +0x0826, 0x0826, 0x2416, 0x2416, +0x0046, 0x0046, 0x2016, 0x2016, +0x1c15, 0x1c15, 0x1c15, 0x1c15, +0x1815, 0x1815, 0x1815, 0x1815, +0x0425, 0x0425, 0x0425, 0x0425, +0x1415, 0x1415, 0x1415, 0x1415, +0x3417, 0x0067, 0x3017, 0x2c17, +0x0c27, 0x0437, 0x0057, 0x2817, +0x0034, 0x0034, 0x0034, 0x0034, +0x0034, 0x0034, 0x0034, 0x0034, +0x1014, 0x1014, 0x1014, 0x1014, +0x1014, 0x1014, 0x1014, 0x1014, +0x0c14, 0x0c14, 0x0c14, 0x0c14, +0x0c14, 0x0c14, 0x0c14, 0x0c14, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0023, 0x0023, 0x0023, 0x0023, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0813, 0x0813, 0x0813, 0x0813, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0412, 0x0412, 0x0412, 0x0412, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +0x0010, 0x0010, 0x0010, 0x0010, +}; + +/* Macro for filling up the decoding table for mb_addr_inc */ +#define ASSIGN1(start, end, step, val, num) \ + for (i = start; i < end; i+= step) { \ + for (j = 0; j < step; j++) { \ + mb_addr_inc[i+j].value = val; \ + mb_addr_inc[i+j].num_bits = num; \ + } \ + val--; \ + } + + + +/* + *-------------------------------------------------------------- + * + * init_mb_addr_inc -- + * + * Initialize the VLC decoding table for macro_block_address_increment + * + * Results: + * The decoding table for macro_block_address_increment will + * be filled; illegal values will be filled as ERROR. + * + * Side effects: + * The global array mb_addr_inc will be filled. + * + *-------------------------------------------------------------- + */ +static void +init_mb_addr_inc() +{ + int i, j, val; + + for (i = 0; i < 8; i++) { + mb_addr_inc[i].value = (unsigned int)ERROR; + mb_addr_inc[i].num_bits = 0; + } + + mb_addr_inc[8].value = MACRO_BLOCK_ESCAPE; + mb_addr_inc[8].num_bits = 11; + + for (i = 9; i < 15; i++) { + mb_addr_inc[i].value = (unsigned int)ERROR; + mb_addr_inc[i].num_bits = 0; + } + + mb_addr_inc[15].value = MACRO_BLOCK_STUFFING; + mb_addr_inc[15].num_bits = 11; + + for (i = 16; i < 24; i++) { + mb_addr_inc[i].value = (unsigned int)ERROR; + mb_addr_inc[i].num_bits = 0; + } + + val = 33; + + ASSIGN1(24, 36, 1, val, 11); + ASSIGN1(36, 48, 2, val, 10); + ASSIGN1(48, 96, 8, val, 8); + ASSIGN1(96, 128, 16, val, 7); + ASSIGN1(128, 256, 64, val, 5); + ASSIGN1(256, 512, 128, val, 4); + ASSIGN1(512, 1024, 256, val, 3); + ASSIGN1(1024, 2048, 1024, val, 1); +} + + +/* Macro for filling up the decoding table for mb_type */ +#define ASSIGN2(start, end, quant, motion_forward, motion_backward, pattern, intra, num, mb_type) \ + for (i = start; i < end; i ++) { \ + mb_type[i].mb_quant = quant; \ + mb_type[i].mb_motion_forward = motion_forward; \ + mb_type[i].mb_motion_backward = motion_backward; \ + mb_type[i].mb_pattern = pattern; \ + mb_type[i].mb_intra = intra; \ + mb_type[i].num_bits = num; \ + } + + + +/* + *-------------------------------------------------------------- + * + * init_mb_type_P -- + * + * Initialize the VLC decoding table for macro_block_type in + * predictive-coded pictures. + * + * Results: + * The decoding table for macro_block_type in predictive-coded + * pictures will be filled; illegal values will be filled as ERROR. + * + * Side effects: + * The global array mb_type_P will be filled. + * + *-------------------------------------------------------------- + */ +static void +init_mb_type_P() +{ + int i; + + mb_type_P[0].mb_quant = mb_type_P[0].mb_motion_forward + = mb_type_P[0].mb_motion_backward = mb_type_P[0].mb_pattern + = mb_type_P[0].mb_intra = (unsigned int)ERROR; + mb_type_P[0].num_bits = 0; + + ASSIGN2(1, 2, 1, 0, 0, 0, 1, 6, mb_type_P) + ASSIGN2(2, 4, 1, 0, 0, 1, 0, 5, mb_type_P) + ASSIGN2(4, 6, 1, 1, 0, 1, 0, 5, mb_type_P); + ASSIGN2(6, 8, 0, 0, 0, 0, 1, 5, mb_type_P); + ASSIGN2(8, 16, 0, 1, 0, 0, 0, 3, mb_type_P); + ASSIGN2(16, 32, 0, 0, 0, 1, 0, 2, mb_type_P); + ASSIGN2(32, 64, 0, 1, 0, 1, 0, 1, mb_type_P); +} + + + + +/* + *-------------------------------------------------------------- + * + * init_mb_type_B -- + * + * Initialize the VLC decoding table for macro_block_type in + * bidirectionally-coded pictures. + * + * Results: + * The decoding table for macro_block_type in bidirectionally-coded + * pictures will be filled; illegal values will be filled as ERROR. + * + * Side effects: + * The global array mb_type_B will be filled. + * + *-------------------------------------------------------------- + */ +static void +init_mb_type_B() +{ + int i; + + mb_type_B[0].mb_quant = mb_type_B[0].mb_motion_forward + = mb_type_B[0].mb_motion_backward = mb_type_B[0].mb_pattern + = mb_type_B[0].mb_intra = (unsigned int)ERROR; + mb_type_B[0].num_bits = 0; + + ASSIGN2(1, 2, 1, 0, 0, 0, 1, 6, mb_type_B); + ASSIGN2(2, 3, 1, 0, 1, 1, 0, 6, mb_type_B); + ASSIGN2(3, 4, 1, 1, 0, 1, 0, 6, mb_type_B); + ASSIGN2(4, 6, 1, 1, 1, 1, 0, 5, mb_type_B); + ASSIGN2(6, 8, 0, 0, 0, 0, 1, 5, mb_type_B); + ASSIGN2(8, 12, 0, 1, 0, 0, 0, 4, mb_type_B); + ASSIGN2(12, 16, 0, 1, 0, 1, 0, 4, mb_type_B); + ASSIGN2(16, 24, 0, 0, 1, 0, 0, 3, mb_type_B); + ASSIGN2(24, 32, 0, 0, 1, 1, 0, 3, mb_type_B); + ASSIGN2(32, 48, 0, 1, 1, 0, 0, 2, mb_type_B); + ASSIGN2(48, 64, 0, 1, 1, 1, 0, 2, mb_type_B); +} + + +/* Macro for filling up the decoding tables for motion_vectors */ +#define ASSIGN3(start, end, step, val, num) \ + for (i = start; i < end; i+= step) { \ + for (j = 0; j < step / 2; j++) { \ + motion_vectors[i+j].code = val; \ + motion_vectors[i+j].num_bits = num; \ + } \ + for (j = step / 2; j < step; j++) { \ + motion_vectors[i+j].code = -val; \ + motion_vectors[i+j].num_bits = num; \ + } \ + val--; \ + } + + + +/* + *-------------------------------------------------------------- + * + * init_motion_vectors -- + * + * Initialize the VLC decoding table for the various motion + * vectors, including motion_horizontal_forward_code, + * motion_vertical_forward_code, motion_horizontal_backward_code, + * and motion_vertical_backward_code. + * + * Results: + * The decoding table for the motion vectors will be filled; + * illegal values will be filled as ERROR. + * + * Side effects: + * The global array motion_vector will be filled. + * + *-------------------------------------------------------------- + */ +static void +init_motion_vectors() +{ + int i, j, val = 16; + + for (i = 0; i < 24; i++) { + motion_vectors[i].code = (unsigned int)ERROR; + motion_vectors[i].num_bits = 0; + } + + ASSIGN3(24, 36, 2, val, 11); + ASSIGN3(36, 48, 4, val, 10); + ASSIGN3(48, 96, 16, val, 8); + ASSIGN3(96, 128, 32, val, 7); + ASSIGN3(128, 256, 128, val, 5); + ASSIGN3(256, 512, 256, val, 4); + ASSIGN3(512, 1024, 512, val, 3); + ASSIGN3(1024, 2048, 1024, val, 1); +} + + + + +/* + *-------------------------------------------------------------- + * + * init_tables -- + * + * Initialize all the tables for VLC decoding; this must be + * called when the system is set up before any decoding can + * take place. + * + * Results: + * All the decoding tables will be filled accordingly. + * + * Side effects: + * The corresponding global array for each decoding table + * will be filled. + * + *-------------------------------------------------------------- + */ +void +init_tables() +{ + extern void init_pre_idct(); + + init_mb_addr_inc(); + init_mb_type_P(); + init_mb_type_B(); + init_motion_vectors(); + init_pre_idct(); + +#ifdef ANALYSIS + { + init_stats(); + } +#endif +} + +/* + *-------------------------------------------------------------- + * + * DecodeDCTDCSizeLum -- + * + * Huffman Decoder for dct_dc_size_luminance; location where + * the result of decoding will be placed is passed as argument. + * The decoded values are obtained by doing a table lookup on + * dct_dc_size_luminance. + * + * Results: + * The decoded value for dct_dc_size_luminance or ERROR for + * unbound values will be placed in the location specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +void +decodeDCTDCSizeLum(unsigned int *value) +{ + unsigned int index; + + show_bits7(index); + + *value = dct_dc_size_luminance[index].value; + + flush_bits(dct_dc_size_luminance[index].num_bits); +} + + + + +/* + *-------------------------------------------------------------- + * + * DecodeDCTDCSizeChrom -- + * + * Huffman Decoder for dct_dc_size_chrominance; location where + * the result of decoding will be placed is passed as argument. + * The decoded values are obtained by doing a table lookup on + * dct_dc_size_chrominance. + * + * Results: + * The decoded value for dct_dc_size_chrominance or ERROR for + * unbound values will be placed in the location specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +void +decodeDCTDCSizeChrom(unsigned int *value) +{ + unsigned int index; + + show_bits8(index); + + *value = dct_dc_size_chrominance[index].value; + + flush_bits(dct_dc_size_chrominance[index].num_bits); +} + + + +/* + *-------------------------------------------------------------- + * + * decodeDCTCoeff -- + * + * Huffman Decoder for dct_coeff_first and dct_coeff_next; + * locations where the results of decoding: run and level, are to + * be placed and also the type of DCT coefficients, either + * dct_coeff_first or dct_coeff_next, are being passed as argument. + * + * The decoder first examines the next 8 bits in the input stream, + * and perform according to the following cases: + * + * '0000 0000' - examine 8 more bits (i.e. 16 bits total) and + * perform a table lookup on dct_coeff_tbl_0. + * One more bit is then examined to determine the sign + * of level. + * + * '0000 0001' - examine 4 more bits (i.e. 12 bits total) and + * perform a table lookup on dct_coeff_tbl_1. + * One more bit is then examined to determine the sign + * of level. + * + * '0000 0010' - examine 2 more bits (i.e. 10 bits total) and + * perform a table lookup on dct_coeff_tbl_2. + * One more bit is then examined to determine the sign + * of level. + * + * '0000 0011' - examine 2 more bits (i.e. 10 bits total) and + * perform a table lookup on dct_coeff_tbl_3. + * One more bit is then examined to determine the sign + * of level. + * + * otherwise - perform a table lookup on dct_coeff_tbl. If the + * value of run is not ESCAPE, extract one more bit + * to determine the sign of level; otherwise 6 more + * bits will be extracted to obtain the actual value + * of run , and then 8 or 16 bits to get the value of level. + * + * + * + * Results: + * The decoded values of run and level or ERROR for unbound values + * are placed in the locations specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +static void +decodeDCTCoeff(unsigned short int *dct_coeff_tbl, unsigned int *run, int *level) +{ + unsigned int temp, index /*, num_bits*/; + unsigned int value, next32bits, flushed; + + /* + * Grab the next 32 bits and use it to improve performance of + * getting the bits to parse. Thus, calls are translated as: + * + * show_bitsX <--> next32bits >> (32-X) + * get_bitsX <--> val = next32bits >> (32-flushed-X); + * flushed += X; + * next32bits &= bitMask[flushed]; + * flush_bitsX <--> flushed += X; + * next32bits &= bitMask[flushed]; + * + */ + show_bits32(next32bits); + flushed = 0; + + /* show_bits8(index); */ + index = next32bits >> 24; + + if (index > 3) { + value = dct_coeff_tbl[index]; + *run = (value & RUN_MASK) >> RUN_SHIFT; + if (*run == END_OF_BLOCK) { + *level = END_OF_BLOCK; + } + else { + /* num_bits = (value & NUM_MASK) + 1; */ + /* flush_bits(num_bits); */ + flushed = (value & NUM_MASK) + 1; + next32bits &= bitMask[flushed]; + if (*run != ESCAPE) { + *level = (value & LEVEL_MASK) >> LEVEL_SHIFT; + /* get_bits1(value); */ + /* if (value) *level = -*level; */ + if (next32bits >> (31-flushed)) *level = -*level; + flushed++; + /* next32bits &= bitMask[flushed]; last op before update */ + } + else { /* *run == ESCAPE */ + /* get_bits14(temp); */ + temp = next32bits >> (18-flushed); + flushed += 14; + next32bits &= bitMask[flushed]; + *run = temp >> 8; + temp &= 0xff; + if (temp == 0) { + /* get_bits8(*level); */ + *level = next32bits >> (24-flushed); + flushed += 8; + /* next32bits &= bitMask[flushed]; last op before update */ + assert(*level >= 128); + } else if (temp != 128) { + /* Grab sign bit */ + *level = ((int) (temp << 24)) >> 24; + } else { + /* get_bits8(*level); */ + *level = next32bits >> (24-flushed); + flushed += 8; + /* next32bits &= bitMask[flushed]; last op before update */ + *level = *level - 256; + assert(*level <= -128 && *level >= -255); + } + } + /* Update bitstream... */ + flush_bits(flushed); + } + } + else { + if (index == 2) { + /* show_bits10(index); */ + index = next32bits >> 22; + value = dct_coeff_tbl_2[index & 3]; + } + else if (index == 3) { + /* show_bits10(index); */ + index = next32bits >> 22; + value = dct_coeff_tbl_3[index & 3]; + } + else if (index) { /* index == 1 */ + /* show_bits12(index); */ + index = next32bits >> 20; + value = dct_coeff_tbl_1[index & 15]; + } + else { /* index == 0 */ + /* show_bits16(index); */ + index = next32bits >> 16; + value = dct_coeff_tbl_0[index & 255]; + } + *run = (value & RUN_MASK) >> RUN_SHIFT; + *level = (value & LEVEL_MASK) >> LEVEL_SHIFT; + + /* + * Fold these operations together to make it fast... + */ + /* num_bits = (value & NUM_MASK) + 1; */ + /* flush_bits(num_bits); */ + /* get_bits1(value); */ + /* if (value) *level = -*level; */ + + flushed = (value & NUM_MASK) + 2; + if ((next32bits >> (32-flushed)) & 0x1) *level = -*level; + + /* Update bitstream ... */ + flush_bits(flushed); + } +} + + +/* + *-------------------------------------------------------------- + * + * decodeDCTCoeffFirst -- + * + * Huffman Decoder for dct_coeff_first. Locations for the + * decoded results: run and level, are being passed as + * arguments. Actual work is being done by calling DecodeDCTCoeff, + * with the table dct_coeff_first. + * + * Results: + * The decoded values of run and level for dct_coeff_first or + * ERROR for unbound values are placed in the locations given. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +void +decodeDCTCoeffFirst(unsigned int *run, int *level) +{ + decodeDCTCoeff(dct_coeff_first, run, level); +} + + + + +/* + *-------------------------------------------------------------- + * + * decodeDCTCoeffNext -- + * + * Huffman Decoder for dct_coeff_first. Locations for the + * decoded results: run and level, are being passed as + * arguments. Actual work is being done by calling DecodeDCTCoeff, + * with the table dct_coeff_next. + * + * Results: + * The decoded values of run and level for dct_coeff_next or + * ERROR for unbound values are placed in the locations given. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +void +decodeDCTCoeffNext(unsigned int *run, int *level) +{ + decodeDCTCoeff(dct_coeff_next, run, level); +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.h new file mode 100644 index 00000000000..da6f73bca54 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/decoders.h @@ -0,0 +1,480 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ +/* + * decoders.h + * + * This file contains the declarations of structures required for Huffman + * decoding + * + */ + +/* Include util.h for bit i/o parsing macros. */ + +#include "util.h" +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/* Code for unbound values in decoding tables */ +#define ERROR -1 +#define DCT_ERROR 63 + +#define MACRO_BLOCK_STUFFING 34 +#define MACRO_BLOCK_ESCAPE 35 + +/* Two types of DCT Coefficients */ +#define DCT_COEFF_FIRST 0 +#define DCT_COEFF_NEXT 1 + +/* Special values for DCT Coefficients */ +#define END_OF_BLOCK 62 +#define ESCAPE 61 + +/* Structure for an entry in the decoding table of + * macroblock_address_increment */ +typedef struct { + unsigned int value; /* value for macroblock_address_increment */ + int num_bits; /* length of the Huffman code */ +} mb_addr_inc_entry; + +/* Decoding table for macroblock_address_increment */ +extern mb_addr_inc_entry mb_addr_inc[2048]; + + +/* Structure for an entry in the decoding table of macroblock_type */ +typedef struct { + unsigned int mb_quant; /* macroblock_quant */ + unsigned int mb_motion_forward; /* macroblock_motion_forward */ + unsigned int mb_motion_backward; /* macroblock_motion_backward */ + unsigned int mb_pattern; /* macroblock_pattern */ + unsigned int mb_intra; /* macroblock_intra */ + int num_bits; /* length of the Huffman code */ +} mb_type_entry; + +/* Decoding table for macroblock_type in predictive-coded pictures */ +extern mb_type_entry mb_type_P[64]; + +/* Decoding table for macroblock_type in bidirectionally-coded pictures */ +extern mb_type_entry mb_type_B[64]; + + +/* Structures for an entry in the decoding table of coded_block_pattern */ +typedef struct { + unsigned int cbp; /* coded_block_pattern */ + int num_bits; /* length of the Huffman code */ +} coded_block_pattern_entry; + +/* External declaration of coded block pattern table. */ + +extern coded_block_pattern_entry coded_block_pattern[512]; + + + +/* Structure for an entry in the decoding table of motion vectors */ +typedef struct { + int code; /* value for motion_horizontal_forward_code, + * motion_vertical_forward_code, + * motion_horizontal_backward_code, or + * motion_vertical_backward_code. + */ + int num_bits; /* length of the Huffman code */ +} motion_vectors_entry; + + +/* Decoding table for motion vectors */ +extern motion_vectors_entry motion_vectors[2048]; + + +/* Structure for an entry in the decoding table of dct_dc_size */ +typedef struct { + unsigned int value; /* value of dct_dc_size (luminance or chrominance) */ + int num_bits; /* length of the Huffman code */ +} dct_dc_size_entry; + +/* External declaration of dct dc size lumiance table. */ + +extern dct_dc_size_entry dct_dc_size_luminance[128]; + +/* External declaration of dct dc size chrom table. */ + +extern dct_dc_size_entry dct_dc_size_chrominance[256]; + + +/* DCT coeff tables. */ + +#define RUN_MASK 0xfc00 +#define LEVEL_MASK 0x03f0 +#define NUM_MASK 0x000f +#define RUN_SHIFT 10 +#define LEVEL_SHIFT 4 + +/* External declaration of dct coeff tables. */ + +extern unsigned short int dct_coeff_tbl_0[256]; +extern unsigned short int dct_coeff_tbl_1[16]; +extern unsigned short int dct_coeff_tbl_2[4]; +extern unsigned short int dct_coeff_tbl_3[4]; +extern unsigned short int dct_coeff_next[256]; +extern unsigned short int dct_coeff_first[256]; + +#define DecodeDCTDCSizeLum(macro_val) \ +{ \ + unsigned int index; \ + \ + show_bits7(index); \ + \ + macro_val = dct_dc_size_luminance[index].value; \ + \ + flush_bits(dct_dc_size_luminance[index].num_bits); \ +} + +#define DecodeDCTDCSizeChrom(macro_val) \ +{ \ + unsigned int index; \ + \ + show_bits8(index); \ + \ + macro_val = dct_dc_size_chrominance[index].value; \ + \ + flush_bits(dct_dc_size_chrominance[index].num_bits); \ +} + +#define DecodeDCTCoeff(dct_coeff_tbl, run, level) \ +{ \ + unsigned int temp, index; \ + unsigned int value, next32bits, flushed; \ + \ + /* \ + * Grab the next 32 bits and use it to improve performance of \ + * getting the bits to parse. Thus, calls are translated as: \ + * \ + * show_bitsX <--> next32bits >> (32-X) \ + * get_bitsX <--> val = next32bits >> (32-flushed-X); \ + * flushed += X; \ + * next32bits &= bitMask[flushed]; \ + * flush_bitsX <--> flushed += X; \ + * next32bits &= bitMask[flushed]; \ + * \ + * I've streamlined the code a lot, so that we don't have to mask \ + * out the low order bits and a few of the extra adds are removed. \ + */ \ + show_bits32(next32bits); \ + \ + /* show_bits8(index); */ \ + index = next32bits >> 24; \ + \ + if (index > 3) { \ + value = dct_coeff_tbl[index]; \ + run = value >> RUN_SHIFT; \ + if (run != END_OF_BLOCK) { \ + /* num_bits = (value & NUM_MASK) + 1; */ \ + /* flush_bits(num_bits); */ \ + if (run != ESCAPE) { \ + /* get_bits1(value); */ \ + /* if (value) level = -level; */ \ + flushed = (value & NUM_MASK) + 2; \ + level = (value & LEVEL_MASK) >> LEVEL_SHIFT; \ + value = next32bits >> (32-flushed); \ + value &= 0x1; \ + if (value) level = -level; \ + /* next32bits &= ((~0) >> flushed); last op before update */ \ + } \ + else { /* run == ESCAPE */ \ + /* Get the next six into run, and next 8 into temp */ \ + /* get_bits14(temp); */ \ + flushed = (value & NUM_MASK) + 1; \ + temp = next32bits >> (18-flushed); \ + /* Normally, we'd ad 14 to flushed, but I've saved a few \ + * instr by moving the add below */ \ + temp &= 0x3fff; \ + run = temp >> 8; \ + temp &= 0xff; \ + if (temp == 0) { \ + /* get_bits8(level); */ \ + level = next32bits >> (10-flushed); \ + level &= 0xff; \ + flushed += 22; \ + assert(level >= 128); \ + } else if (temp != 128) { \ + /* Grab sign bit */ \ + flushed += 14; \ + level = ((int) (temp << 24)) >> 24; \ + } else { \ + /* get_bits8(level); */ \ + level = next32bits >> (10-flushed); \ + level &= 0xff; \ + flushed += 22; \ + level = level - 256; \ + assert(level <= -128 && level >= -255); \ + } \ + } \ + /* Update bitstream... */ \ + flush_bits(flushed); \ + assert (flushed <= 32); \ + } \ + } \ + else { \ + if (index == 2) { \ + /* show_bits10(index); */ \ + index = next32bits >> 22; \ + value = dct_coeff_tbl_2[index & 3]; \ + } \ + else if (index == 3) { \ + /* show_bits10(index); */ \ + index = next32bits >> 22; \ + value = dct_coeff_tbl_3[index & 3]; \ + } \ + else if (index) { /* index == 1 */ \ + /* show_bits12(index); */ \ + index = next32bits >> 20; \ + value = dct_coeff_tbl_1[index & 15]; \ + } \ + else { /* index == 0 */ \ + /* show_bits16(index); */ \ + index = next32bits >> 16; \ + value = dct_coeff_tbl_0[index & 255]; \ + } \ + run = value >> RUN_SHIFT; \ + level = (value & LEVEL_MASK) >> LEVEL_SHIFT; \ + \ + /* \ + * Fold these operations together to make it fast... \ + */ \ + /* num_bits = (value & NUM_MASK) + 1; */ \ + /* flush_bits(num_bits); */ \ + /* get_bits1(value); */ \ + /* if (value) level = -level; */ \ + \ + flushed = (value & NUM_MASK) + 2; \ + value = next32bits >> (32-flushed); \ + value &= 0x1; \ + if (value) level = -level; \ + \ + /* Update bitstream ... */ \ + flush_bits(flushed); \ + assert (flushed <= 32); \ + } \ +} + +#define DecodeDCTCoeffFirst(runval, levelval) \ +{ \ + DecodeDCTCoeff(dct_coeff_first, runval, levelval); \ +} + +#define DecodeDCTCoeffNext(runval, levelval) \ +{ \ + DecodeDCTCoeff(dct_coeff_next, runval, levelval); \ +} + +/* + *-------------------------------------------------------------- + * + * DecodeMBAddrInc -- + * + * Huffman Decoder for macro_block_address_increment; the location + * in which the result will be placed is being passed as argument. + * The decoded value is obtained by doing a table lookup on + * mb_addr_inc. + * + * Results: + * The decoded value for macro_block_address_increment or ERROR + * for unbound values will be placed in the location specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +#define DecodeMBAddrInc(val) \ +{ \ + unsigned int index; \ + show_bits11(index); \ + val = mb_addr_inc[index].value; \ + flush_bits(mb_addr_inc[index].num_bits); \ +} + +/* + *-------------------------------------------------------------- + * + * DecodeMotionVectors -- + * + * Huffman Decoder for the various motion vectors, including + * motion_horizontal_forward_code, motion_vertical_forward_code, + * motion_horizontal_backward_code, motion_vertical_backward_code. + * Location where the decoded result will be placed is being passed + * as argument. The decoded values are obtained by doing a table + * lookup on motion_vectors. + * + * Results: + * The decoded value for the motion vector or ERROR for unbound + * values will be placed in the location specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +#define DecodeMotionVectors(value) \ +{ \ + unsigned int index; \ + show_bits11(index); \ + value = motion_vectors[index].code; \ + flush_bits(motion_vectors[index].num_bits); \ +} +/* + *-------------------------------------------------------------- + * + * DecodeMBTypeB -- + * + * Huffman Decoder for macro_block_type in bidirectionally-coded + * pictures;locations in which the decoded results: macroblock_quant, + * macroblock_motion_forward, macro_block_motion_backward, + * macroblock_pattern, macro_block_intra, will be placed are + * being passed as argument. The decoded values are obtained by + * doing a table lookup on mb_type_B. + * + * Results: + * The various decoded values for macro_block_type in + * bidirectionally-coded pictures or ERROR for unbound values will + * be placed in the locations specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +#define DecodeMBTypeB(quant, motion_fwd, motion_bwd, pat, intra) \ +{ \ + unsigned int index; \ + \ + show_bits6(index); \ + \ + quant = mb_type_B[index].mb_quant; \ + motion_fwd = mb_type_B[index].mb_motion_forward; \ + motion_bwd = mb_type_B[index].mb_motion_backward; \ + pat = mb_type_B[index].mb_pattern; \ + intra = mb_type_B[index].mb_intra; \ + flush_bits(mb_type_B[index].num_bits); \ +} +/* + *-------------------------------------------------------------- + * + * DecodeMBTypeI -- + * + * Huffman Decoder for macro_block_type in intra-coded pictures; + * locations in which the decoded results: macroblock_quant, + * macroblock_motion_forward, macro_block_motion_backward, + * macroblock_pattern, macro_block_intra, will be placed are + * being passed as argument. + * + * Results: + * The various decoded values for macro_block_type in intra-coded + * pictures or ERROR for unbound values will be placed in the + * locations specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +#define DecodeMBTypeI(quant, motion_fwd, motion_bwd, pat, intra) \ +{ \ + unsigned int index; \ + static int quantTbl[4] = {ERROR, 1, 0, 0}; \ + \ + show_bits2(index); \ + \ + motion_fwd = 0; \ + motion_bwd = 0; \ + pat = 0; \ + intra = 1; \ + quant = quantTbl[index]; \ + if (index) { \ + flush_bits (1 + quant); \ + } \ +} +/* + *-------------------------------------------------------------- + * + * DecodeMBTypeP -- + * + * Huffman Decoder for macro_block_type in predictive-coded pictures; + * locations in which the decoded results: macroblock_quant, + * macroblock_motion_forward, macro_block_motion_backward, + * macroblock_pattern, macro_block_intra, will be placed are + * being passed as argument. The decoded values are obtained by + * doing a table lookup on mb_type_P. + * + * Results: + * The various decoded values for macro_block_type in + * predictive-coded pictures or ERROR for unbound values will be + * placed in the locations specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +#define DecodeMBTypeP(quant, motion_fwd, motion_bwd, pat, intra) \ +{ \ + unsigned int index; \ + \ + show_bits6(index); \ + \ + quant = mb_type_P[index].mb_quant; \ + motion_fwd = mb_type_P[index].mb_motion_forward; \ + motion_bwd = mb_type_P[index].mb_motion_backward; \ + pat = mb_type_P[index].mb_pattern; \ + intra = mb_type_P[index].mb_intra; \ + \ + flush_bits(mb_type_P[index].num_bits); \ +} +/* + *-------------------------------------------------------------- + * + * DecodeCBP -- + * + * Huffman Decoder for coded_block_pattern; location in which the + * decoded result will be placed is being passed as argument. The + * decoded values are obtained by doing a table lookup on + * coded_block_pattern. + * + * Results: + * The decoded value for coded_block_pattern or ERROR for unbound + * values will be placed in the location specified. + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +#define DecodeCBP(coded_bp) \ +{ \ + unsigned int index; \ + \ + show_bits9(index); \ + coded_bp = coded_block_pattern[index].cbp; \ + flush_bits(coded_block_pattern[index].num_bits); \ +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/dither.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/dither.h new file mode 100644 index 00000000000..51320095ed5 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/dither.h @@ -0,0 +1,36 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +extern int LUM_RANGE; +extern int CR_RANGE; +extern int CB_RANGE; + + +#define CB_BASE 1 +#define CR_BASE (CB_BASE*CB_RANGE) +#define LUM_BASE (CR_BASE*CR_RANGE) + +extern unsigned char pixel[256]; +extern int *lum_values; +extern int *cr_values; +extern int *cb_values; + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/file.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/file.cpp new file mode 100644 index 00000000000..ec0de5cff0c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/file.cpp @@ -0,0 +1,151 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <stdlib.h> +#include "video.h" +#include <X11/Intrinsic.h> +#include <Xm/Xm.h> +#include <Xm/Text.h> +#include <Xm/FileSB.h> +#include <Xm/DialogS.h> +#if defined(sun) || defined(FreeBSD) +#include <stdlib.h> +#endif +#include "include/common.h" +#include "newproto.h" +#include "global.h" + +ACE_RCSID(mpeg_client, file, "$Id$") + +#ifdef XmFONTLIST_DEFAULT_TAG +#define XmStringTag XmFONTLIST_DEFAULT_TAG +#else +#define XmStringTag XmSTRING_DEFAULT_CHARSET +#endif +#define BUFSIZE 256 + +static Widget fileshell; + +void StartLocalServer(void) +{ + int res; + + static int startLocalServer = 1; + + if (startLocalServer) { + startLocalServer = 0; + if (access(VCR_UNIX_PORT, 0) == -1) { /* going to start a server */ + fprintf(stderr, "Trying to fork a server on local host...\n"); + res = system("vcrs -rt 2> /dev/null& exit"); + if (shared->config.verbose && res == -1) { + perror("Error on fork server on local host"); + } + usleep(1000000); + } + } +} + +/* hostname == "" defaults to local host */ +static void StartFile(char *hostname, char *filename) +{ + char *title = (char *)ACE_OS::malloc(strlen(hostname) +ACE_OS::strlen (filename) + 10); + char buf[BUFSIZE]; + int len; + + if (*hostname == 0) StartLocalServer(); + + if (*hostname == 0) { + get_full_path(filename, buf, BUFSIZE); + } + else { + strncpy(buf, filename, BUFSIZE); + buf[BUFSIZE-1] = 0; + } + len =ACE_OS::strlen (buf); + + if (title == NULL) title = filename; + else sprintf(title, "%s:%s", hostname, filename); + + if (!strcasecmp(".mpg", buf+len-4) || !strcasecmp(".mpeg", buf+len-5)) + StartProgram(title, hostname, buf, "", ""); + else if (!strcasecmp(".au", buf+len-3)) + StartProgram(title, "", "", hostname, buf); + else + fprintf(stderr, "Error: type of file %s not known (know only .mpeg .mpg, .au).\n", + filename); + if (title != filename) ACE_OS::free (title); +} + +static void dismissCB(Widget W, XtPointer closure, XtPointer call_data) +{ + + XtUnmanageChild (fileshell); +} + +static void playCB(Widget w, XtPointer closure, XtPointer call_data) +{ + char *filename = NULL; /* String containing file name */ + XmStringCharSet charset = (XmStringCharSet) XmSTRING_DEFAULT_CHARSET; + XmFileSelectionBoxCallbackStruct *fcb = + (XmFileSelectionBoxCallbackStruct *) call_data; + + XmStringGetLtoR(fcb->value, charset, &filename); + + if (filename == NULL) + { + fprintf(stderr, "Error: failed to get file name to play.\n"); + return; + } + StartFile("", filename); + //XmStringFree((XmString)filename); +} + +Widget CreateFileWindow(Widget parent, int cmdSock, int * playflag, Widget frametext) +{ + Arg args[10]; /* arg list */ + register int n; /* arg count */ + XmString okString, cancelString; + +/* Create the file selection box */ + okString = (XmString)XmStringCreateLtoR("Select", XmStringTag); + cancelString = (XmString)XmStringCreateLtoR("Dismiss", XmStringTag); + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR File Selection"); n++; + XtSetArg(args[n], XmNokLabelString, okString); n++; + XtSetArg(args[n], XmNcancelLabelString, cancelString); n++; + fileshell = XmCreateFileSelectionDialog(parent, "filebox", args, n); + XmStringFree(okString); + XmStringFree(cancelString); + XtAddCallback (fileshell, XmNokCallback, (XtCallbackProc)playCB, NULL); + XtAddCallback (fileshell, XmNcancelCallback, (XtCallbackProc)dismissCB, NULL); + + return fileshell; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.cpp new file mode 100644 index 00000000000..8739728e397 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.cpp @@ -0,0 +1,399 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <stdlib.h> +#include <string.h> +#include "video.h" +#include "dither.h" +#include "fs2.h" +#include "proto.h" + +ACE_RCSID(mpeg_client, fs2, "$Id$") + +/* Structures for precomputed error propogation values. */ + +static FS2DithVal lum_index[256]; +static FS2DithVal cr_index[256]; +static FS2DithVal cb_index[256]; + + + +/* + *-------------------------------------------------------------- + * + * InitFS2Dither -- + * + * Initializes structures for precomputed 2 error f-s dithering. + * The value field of the structure contains the pixel component + * of the particular channel in question. Thus the addition of + * the value field of a structure in the luminance index, a + * structure in the Cr index, and a structure in the Cb index will + * yeild a color number. This color number can then be transformed + * into a pixel value to be displayed. Each channel can then be + * processed (i.e. dithered) separately, with the results being + * added up and remapped to yield a final pixel value. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void InitFS2Dither() +{ + int i; + + /* For each possible pixel value, precompute propogated error and + store in array. + */ + + for (i=0; i<256; i++) { + lum_index[i].value = (i * LUM_RANGE) / 256; + + lum_index[i].e1 = (i-lum_values[lum_index[i].value]) / 2; + lum_index[i].e3 = (i - lum_values[lum_index[i].value]) - lum_index[i].e1; + + lum_index[i].value *= LUM_BASE; + + cr_index[i].value = (i * CR_RANGE) / 256; + + cr_index[i].e1 = (i - cr_values[cr_index[i].value]) / 2; + cr_index[i].e3 = (i - cr_values[cr_index[i].value]) - cr_index[i].e1 ; + + cr_index[i].value *= CR_BASE; + + cb_index[i].value = (i * CB_RANGE) / 256; + + cb_index[i].e1 = (i - cb_values[cb_index[i].value]) / 2; + cb_index[i].e3 = (i - cb_values[cb_index[i].value]) - cb_index[i].e1; + + cb_index[i].value *= CB_BASE; + + } + +} + + +/* + *-------------------------------------------------------------- + * + * DitherImage -- + * + * Converts lum, cr, cb image planes into fixed colormap + * space. + * + * Results: + * the display plane is replaced by 8-bit colormap space + * image. + * + * Side effects: + * Hopefully, none. + * + *-------------------------------------------------------------- + */ + +void FS2DitherImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *disp, + int rows, int cols) +{ + static char *cur_row_error, *next_row_error; + static int first = 1; + char *cur_row_err_mark, *next_row_err_mark; + char *temp; + int i, j, pixsum, c_cols; + unsigned char *cur_row, *channel, *dest_row; + FS2DithVal *chan_index; + + /* Allocate error arrays. */ + + if (first) { + cur_row_error = (char *) ACE_OS::malloc(cols+2); + next_row_error = (char *) ACE_OS::malloc(cols+2); + first = 0; + } + + /* Initialize error arrays. */ + + memset(cur_row_error, 0, cols+2); + memset(next_row_error, 0, cols+2); + + /* Use luminance values first. */ + + /* For each two rows, do... */ + + for(i=0; i<rows; i+=2) { + + /* Establish pointer to current source and destination rows. */ + cur_row = lum + (i*cols); + dest_row = disp + (i*cols); + + /* Establish pointers to error arrays. */ + cur_row_err_mark = cur_row_error + 1; + next_row_err_mark = next_row_error + 1; + + + /* For each column within first row do... */ + + for (j=0; j<cols; j++) { + + /* Calculate pixel value with error. */ + + pixsum = *cur_row + *cur_row_err_mark; + + /* Bounds check. */ + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + /* Establish dest value, propogate errors. */ + + *dest_row = lum_index[pixsum].value; + *(cur_row_err_mark+1) += lum_index[pixsum].e1; + *next_row_err_mark += lum_index[pixsum].e3; + + /* Advance pointers. */ + + cur_row++; + dest_row++; + cur_row_err_mark++; + next_row_err_mark++; + } + + /* Switch error arrays, so next row errors are now current row errors, and + vice versa. + */ + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + /* Reset next row errors. */ + + memset(next_row_error, 0, cols+2); + + /* Establish pointers for second row. This one will be processed right to + left to establish serpantine motion. + */ + + cur_row += cols-1; + dest_row += cols-1; + cur_row_err_mark = cur_row_error + cols; + next_row_err_mark = next_row_error + cols; + + /* Process each column... */ + + for (j=0; j<cols; j++) { + + pixsum = *cur_row + *cur_row_err_mark; + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + *dest_row = lum_index[pixsum].value; + *(cur_row_err_mark-1) += lum_index[pixsum].e1; + *next_row_err_mark += lum_index[pixsum].e3; + + cur_row--; + dest_row--; + cur_row_err_mark--; + next_row_err_mark--; + } + + /* Switch error arrays. */ + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + /* Reset next row errors. */ + + memset(next_row_error, 0, cols+2); + } + + /* Reset error arrays. */ + + memset(cur_row_error, 0, cols+2); + + /* Establish column length divided by two. */ + + c_cols = cols >> 1; + + /* Set channel to Cr. Use Cr index. */ + + channel = cr; + chan_index = cr_index; + + repeat: + + /* Process each row of chrominance data... */ + + for (i=0; i < rows; i+=2) { + + /* Establish pointers. */ + + cur_row = channel + ((i>>1)*c_cols); + dest_row = disp + (i*cols); + + cur_row_err_mark = cur_row_error+1; + next_row_err_mark = next_row_error+1; + + /* For each column in row... */ + + for (j=0; j<cols; j++) { + int p_val; + + /* Get pixel value as twos bit complement. */ + + p_val = *cur_row; + + /* Add error term. */ + + pixsum = *cur_row_err_mark + p_val; + + /* Bounds check. */ + + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + /* Increment dest value. */ + + *dest_row += chan_index[pixsum].value; + + /* Propogate error values. */ + + *(cur_row_err_mark+1) += chan_index[pixsum].e1; + *next_row_err_mark += chan_index[pixsum].e3; + + + /* If count is odd, advance source pointer (Cr and Cb channels are 2:1 + subsampled. + */ + + if (j&1) cur_row++; + + /* Advance destination and error pointers. */ + + dest_row++; + cur_row_err_mark++; + next_row_err_mark++; + } + + /* Switch error arrays. */ + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + /* Reset next row errors. */ + + memset(next_row_error, 0, cols+2); + + /* Re-establish pointers. */ + + cur_row += c_cols-1; + dest_row += cols-1; + cur_row_err_mark = cur_row_error+cols; + next_row_err_mark = next_row_error+cols; + + /* Process second row right to left. */ + + for (j=0; j<cols; j++) { + int p_val; + + /* Get source value as twos bit complement. */ + + p_val = *cur_row; + + /* Add error. */ + + pixsum = *cur_row_err_mark + p_val; + + /* Bounds check. */ + + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + /* Increment dest value. */ + + *dest_row += chan_index[pixsum].value; + + /* Propogate errors. */ + + *(cur_row_err_mark-1) += chan_index[pixsum].e1; + *next_row_err_mark += chan_index[pixsum].e3; + + /* If column counters is odd, decrement source pointer. */ + + if (j&1) cur_row--; + + /* Decrement dest and error pointers. */ + + dest_row--; + cur_row_err_mark--; + next_row_err_mark--; + } + + /* Switch error arrays. */ + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + /* Reinitialize next row errors. */ + + memset(next_row_error, 0, cols+2); + } + + /* If Cr channel completed, set channel to Cb and Cb index and repeat. */ + + if (channel == cr) { + channel = cb; + chan_index = cb_index; + memset(cur_row_error, 0, cols+2); + + goto repeat; + } + + /* Establish pointer to start of display frame. */ + + dest_row = disp; + + /* Transform all display values to pixel values. */ + + for (i=0; i<rows; i++) { + for (j=0; j<cols; j++) { + *dest_row = pixel[*dest_row]; + dest_row++; + } + } +} + + + + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.h new file mode 100644 index 00000000000..21991215259 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2.h @@ -0,0 +1,33 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +typedef struct { + unsigned char value; + int e1; + int e3; +} FS2DithVal; + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2fast.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2fast.cpp new file mode 100644 index 00000000000..ceee28f4987 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs2fast.cpp @@ -0,0 +1,300 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <stdlib.h> +#include <string.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, fs2fast, "$Id$") + +/* Arrays containing error values for floyd-steinberg dithering. */ + +static int deltay[256]; +static int deltau[256]; +static int deltav[256]; +static int deltay2[256]; +static int deltau2[256]; +static int deltav2[256]; + +/* Definitions governing number of bits used for luminance, cr, and cb. */ + +#define L_BITS 3 +#define CR_BITS 2 +#define CB_BITS 2 + +/* Masks for proper quantization of lum, cr, and cb values. */ + +#define L_MASK 0xe0 +#define CR_MASK 0xc0 +#define CB_MASK 0xc0 + + + +/* + *-------------------------------------------------------------- + * + * InitFS2FastDither -- + * + * Initializes structures and arrays neeeded for fast implementation + * of two error F-S dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void InitFS2FastDither() +{ + int i; + int lum_num, cr_num, cb_num; + + for (i=0; i<256; i++) { + lum_num = (i >> (8-L_BITS)); + cr_num = (i >> (8-CR_BITS)); + cb_num = (i >> (8-CB_BITS)); + + /* These arrays contain the error values propogated for each pixel value + for each channel. + */ + + deltay[i] = (i - ((int) lum_values[lum_num])) / 2; + deltau[i] = (i-((int) cr_values[cr_num])) / 2; + deltav[i] = (i-((int) cb_values[cb_num])) / 2; + deltay2[i] = (i - ((int) lum_values[lum_num])) - deltay[i]; + deltau2[i] = (i - ((int) cr_values[cr_num])) - deltau[i]; + deltav2[i] = (i - ((int) cb_values[cb_num])) - deltav[i]; + + } + +} + +/* + *-------------------------------------------------------------- + * + * DitherImage -- + * + * Dithers an image using floyd-steinberg. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +FS2FastDitherImage ( + unsigned char *lum, + unsigned char *cr, + unsigned char *cb, + unsigned char *out, + int w, int h) +{ + int i, j, idx, idx2; + int y, u, v; + int dy, du, dv; + int code; + static int *yerr1; + static int *yerr2; + static int *uerr1; + static int *uerr2; + static int *verr1; + static int *verr2; + int *ye1, *ue1, *ve1; + int *ye2, *ue2, *ve2; + unsigned char *o, *l, *r, *b; + static int first = 1; + + /* If first time called, allocate error arrays. */ + + if (first) { + first = 0; + yerr1 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + yerr2 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + uerr1 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + uerr2 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + verr1 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + verr2 = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + } + + /* + * Init error arrays and variables. + */ + memset ((char *)yerr1, 0, (w+5)*sizeof(int)); + memset ((char *)yerr2, 0, (w+5)*sizeof(int)); + memset ((char *)uerr1, 0, (w+5)*sizeof(int)); + memset ((char *)uerr2, 0, (w+5)*sizeof(int)); + memset ((char *)verr1, 0, (w+5)*sizeof(int)); + memset ((char *)verr2, 0, (w+5)*sizeof(int)); + du = dv = dy = 0; + + for (j=0; j<h; j+=2) { + ye1 = yerr1; + ue1 = uerr1; + ve1 = verr1; + ye2 = yerr2; + ue2 = uerr2; + ve2 = verr2; + idx = j*w; + idx2 = idx/4; + o = out+idx; + l = lum+idx; + r = cr+idx2; + b = cb+idx2; + /* Do the top row in forward order. */ + for (i=0; i<w; i+=2) { + /* Do left side of this pair... */ + y = *l++ + dy + *ye1++; + u = *r + du + *ue1++; + v = *b + dv + *ve1++; + + if (y < 0) y = 0; + else if (y > 255) y = 255; + if (u < 0) u = 0; + else if (u > 255) u = 255; + if (v < 0) v = 0; + else if (v > 255) v = 255; + + /* + * Construct a code using: + * high order 3 bits of y, + * high order 2 bits of u, + * high order 2 bits of v + */ + code = (((y & L_MASK) | ((u & CR_MASK) >> L_BITS) | (v >> (L_BITS+CR_BITS))) + >> (8-(L_BITS+CR_BITS+CB_BITS))); + *o++ = pixel[code]; + *ye2++ = deltay[y]; + *ue2++ = deltau[u]; + *ve2++ = deltav[v]; + dy = deltay2[y]; + du = deltau2[u]; + dv = deltav2[v]; + + /* Do right side of this pair... */ + y = *l++ + dy + *ye1++; + u = *r++ + du + *ue1++; + v = *b++ + dv + *ve1++; + + if (y < 0) y = 0; + else if (y > 255) y = 255; + if (u < 0) u = 0; + else if (u > 255) u = 255; + if (v < 0) v = 0; + else if (v > 255) v = 255; + + code = (((y & L_MASK) | ((u & CR_MASK) >> L_BITS) | (v >> (L_BITS+CR_BITS))) + >> (8-(L_BITS+CR_BITS+CB_BITS))); + *o++ = pixel[code]; + *ye2++ = deltay[y]; + *ue2++ = deltau[u]; + *ve2++ = deltav[v]; + dy = deltay2[y]; + du = deltau2[u]; + dv = deltav2[v]; + + } + + ye1 = yerr1+w-1; + ue1 = uerr1+w-1; + ve1 = verr1+w-1; + ye2 = yerr2+w-1; + ue2 = uerr2+w-1; + ve2 = verr2+w-1; + l += w-1; + o += w-1; + r--; + b--; + dy = du = dv = 0; + + /* Do bottom part of row, in right to left order. */ + for (i=w-1; i>0; i-=2) { + /* Do right side of this pair... */ + y = *l-- + dy + *ye2--; + u = *r + du + *ue2--; + v = *b + dv + *ve2--; + + if (y < 0) y = 0; + else if (y > 255) y = 255; + if (u < 0) u = 0; + else if (u > 255) u = 255; + if (v < 0) v = 0; + else if (v > 255) v = 255; + + /* + * Construct a code using: + * high order 3 bits of y, + * high order 2 bits of u, + * high order 2 bits of v + */ + code = (((y & L_MASK) | ((u & CR_MASK) >> L_BITS) | (v >> (L_BITS+CR_BITS))) + >> (8-(L_BITS+CR_BITS+CB_BITS))); + *o-- = pixel[code]; + *ye1-- = deltay[y]; + *ue1-- = deltau[u]; + *ve1-- = deltav[v]; + dy = deltay2[y]; + du = deltau2[u]; + dv = deltav2[v]; + + /* Do left side of this pair... */ + y = *l-- + dy + *ye2--; + u = *r-- + du + *ue2--; + v = *b-- + dv + *ve2--; + + if (y < 0) y = 0; + else if (y > 255) y = 255; + if (u < 0) u = 0; + else if (u > 255) u = 255; + if (v < 0) v = 0; + else if (v > 255) v = 255; + + code = (((y & L_MASK) | ((u & CR_MASK) >> L_BITS) | (v >> (L_BITS+CR_BITS))) + >> (8-(L_BITS+CR_BITS+CB_BITS))); + *o-- = pixel[code]; + *ye1-- = deltay[y]; + *ue1-- = deltau[u]; + *ve1-- = deltav[v]; + dy = deltay2[y]; + du = deltau2[u]; + dv = deltav2[v]; + + } + } +} + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.cpp new file mode 100644 index 00000000000..a61ba89e4fb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.cpp @@ -0,0 +1,313 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to do YCrCb -> colormap space. */ + +#include "ace/OS.h" +#include <stdlib.h> +#include <string.h> +#include "fs4.h" +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, fs4, "$Id$") + +/* Structures containing precomputed error terms. */ + +static FS4Dither lum_index[256]; +static FS4Dither cr_index[256]; +static FS4Dither cb_index[256]; + + +/* + *-------------------------------------------------------------- + * + * InitFS4Dither -- + * + * Initializes structures used for f-s dithering. Precomputes + * error terms. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitFS4Dither() +{ + int i; + + for (i=0; i<256; i++) { + lum_index[i].value = (i * LUM_RANGE) / 256; + + lum_index[i].e1 = (7 * (i-lum_values[lum_index[i].value])) / 16; + lum_index[i].e2 = (i-lum_values[lum_index[i].value])/16; + lum_index[i].e3 = (5 * (i - lum_values[lum_index[i].value])) / 16; + lum_index[i].e4 = (i-lum_values[lum_index[i].value]) - lum_index[i].e1 - + lum_index[i].e2 - lum_index[i].e3; + + lum_index[i].value *= LUM_BASE; + + cr_index[i].value = (i * CR_RANGE) / 256; + + cr_index[i].e1 = (7 * (i-cr_values[cr_index[i].value])) / 16; + cr_index[i].e2 = (i-cr_values[cr_index[i].value])/16; + cr_index[i].e3 = (5 * (i - cr_values[cr_index[i].value])) / 16; + cr_index[i].e4 = (i-cr_values[cr_index[i].value]) - cr_index[i].e1 - + cr_index[i].e2 - cr_index[i].e3; + cr_index[i].value *= CR_BASE; + + cb_index[i].value = (i * CB_RANGE) / 256; + + cb_index[i].e1 = (7 * (i-cb_values[cb_index[i].value])) / 16; + cb_index[i].e2 = (i-cb_values[cb_index[i].value])/16; + cb_index[i].e3 = (5 * (i - cb_values[cb_index[i].value])) / 16; + cb_index[i].e4 = (i-cb_values[cb_index[i].value]) - cb_index[i].e1 - + cb_index[i].e2 - cb_index[i].e3; + cb_index[i].value *= CB_BASE; + + } + +} + + +/* + *-------------------------------------------------------------- + * + * DitherImage -- + * + * Converts lum, cr, cb image planes into fixed colormap + * space. Uses Floyd-Steinberg dithering in serpentine + * pattern with standard 4 errors propogated. + * + * Results: + * The display plane is replaced by 8-bit colormap space + * image. + * + * Side effects: + * Hopefully, none. + * + *-------------------------------------------------------------- + */ + +void +FS4DitherImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *disp, + int rows, int cols) +{ + static char *cur_row_error, *next_row_error; + static int first = 1; + char *cur_row_err_mark, *next_row_err_mark; + char *temp; + int i, j, pixsum, c_cols; + unsigned char *cur_row, *channel, *dest_row; + FS4Dither *chan_index; + + if (first) { + cur_row_error = (char *) ACE_OS::malloc(cols+2); + next_row_error = (char *) ACE_OS::malloc(cols+2); + first = 0; + } + + memset(cur_row_error, 0, cols+2); + memset(next_row_error, 0, cols+2); + + for(i=0; i<rows; i+=2) { + cur_row = lum + (i*cols); + dest_row = disp + (i*cols); + + cur_row_err_mark = cur_row_error + 1; + next_row_err_mark = next_row_error + 1; + + for (j=0; j<cols; j++) { + + pixsum = *cur_row + *cur_row_err_mark; + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + *dest_row = lum_index[pixsum].value; + *(cur_row_err_mark+1) += lum_index[pixsum].e1; + *(next_row_err_mark+1) += lum_index[pixsum].e2; + *next_row_err_mark += lum_index[pixsum].e3; + *(next_row_err_mark-1) += lum_index[pixsum].e4; + + cur_row++; + dest_row++; + cur_row_err_mark++; + next_row_err_mark++; + } + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + memset(next_row_error, 0, cols+2); + + cur_row += cols-1; + dest_row += cols-1; + cur_row_err_mark = cur_row_error + cols; + next_row_err_mark = next_row_error + cols; + + for (j=0; j<cols; j++) { + + pixsum = *cur_row + *cur_row_err_mark; + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + *dest_row = lum_index[pixsum].value; + *(cur_row_err_mark-1) += lum_index[pixsum].e1; + *(next_row_err_mark-1) += lum_index[pixsum].e2; + *next_row_err_mark += lum_index[pixsum].e3; + *(next_row_err_mark+1) += lum_index[pixsum].e4; + + cur_row--; + dest_row--; + cur_row_err_mark--; + next_row_err_mark--; + } + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + memset(next_row_error, 0, cols+2); + } + + memset(cur_row_error, 0, cols+2); + + c_cols = cols >> 1; + + channel = cr; + chan_index = cr_index; + + repeat: + + for (i=0; i < rows; i+=2) { + cur_row = channel + ((i>>1)*c_cols); + dest_row = disp + (i*cols); + + cur_row_err_mark = cur_row_error+1; + next_row_err_mark = next_row_error+1; + + for (j=0; j<cols; j++) { + int p_val; + + p_val = *cur_row; + + pixsum = *cur_row_err_mark + p_val; + + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + *dest_row += chan_index[pixsum].value; + + *(cur_row_err_mark+1) += chan_index[pixsum].e1; + *(next_row_err_mark+1) += chan_index[pixsum].e2; + *next_row_err_mark += chan_index[pixsum].e3; + *(next_row_err_mark-1) += chan_index[pixsum].e4; + + + if (j&1) cur_row++; + dest_row++; + cur_row_err_mark++; + next_row_err_mark++; + } + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + memset(next_row_error, 0, cols+2); + + cur_row += c_cols-1; + dest_row += cols-1; + cur_row_err_mark = cur_row_error+cols; + next_row_err_mark = next_row_error+cols; + + for (j=0; j<cols; j++) { + int p_val; + + p_val = *cur_row; + + pixsum = *cur_row_err_mark + p_val; + + if (pixsum < 0) pixsum = 0; + else if (pixsum > 255) pixsum = 255; + + *dest_row += chan_index[pixsum].value; + + *(cur_row_err_mark-1) += chan_index[pixsum].e1; + *(next_row_err_mark-1) += chan_index[pixsum].e2; + *next_row_err_mark += chan_index[pixsum].e3; + *(next_row_err_mark+1) += chan_index[pixsum].e4; + + if (j&1) cur_row--; + dest_row--; + cur_row_err_mark--; + next_row_err_mark--; + } + + temp = cur_row_error; + cur_row_error = next_row_error; + next_row_error = temp; + + memset(next_row_error, 0, cols+2); + } + + if (channel == cr) { + channel = cb; + chan_index = cb_index; + memset(cur_row_error, 0, cols+2); + + goto repeat; + } + + dest_row = disp; + + + for (i=0; i<rows; i++) { + for (j=0; j<cols; j++) { + *dest_row = pixel[*dest_row]; + dest_row++; + } + } +} + + + + + + + + + + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.h new file mode 100644 index 00000000000..96a93ee1878 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/fs4.h @@ -0,0 +1,35 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +typedef struct { + unsigned char value; + int e1; + int e2; + int e3; + int e4; +} FS4Dither; + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.cpp new file mode 100644 index 00000000000..a14b12f9cd6 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.cpp @@ -0,0 +1,96 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include <stdio.h> +#include <sys/types.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#include "include/common.h" + +ACE_RCSID(mpeg_client, global, "$Id$") + +/* Declaration of global variable to hold dither info. */ + +int ditherType; + +/* Global file pointer to incoming data. */ +FILE *input; + +/* End of File flag. */ +int EOF_flag = 0; + +/* Loop flag. */ +int loopFlag = 0; + +/* Shared memory flag. */ +int shmemFlag = 0; + +/* Quiet flag. */ +int quietFlag = 0; + +/* Display image on screen? */ +int noDisplayFlag = 0; + +/* real time flag */ +int realTimeFlag = 0; + +/* shared version of command line argument */ +int argc_share; +char **argv_share; + +/* for command line display name */ +char displayName[64]; + +/* command line program list name */ +char proglistName[PATH_SIZE] = ""; + +/* shared data structure */ +SharedData * shared = NULL; + +/* Range values for lum, cr, cb. */ +int LUM_RANGE; +int CR_RANGE; +int CB_RANGE; + +/* Array that remaps color numbers to actual pixel values used by X server. */ + +unsigned char pixel[256]; + +/* Arrays holding quantized value ranged for lum, cr, and cb. */ + +int *lum_values = NULL; +int *cr_values = NULL; +int *cb_values = NULL; + +/* Structures used by the X server. */ + +Display *display; +Colormap cmap; + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.h new file mode 100644 index 00000000000..40bb64b0985 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/global.h @@ -0,0 +1,67 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* Declaration of global variable to hold dither info. */ + +extern int ditherType; + +/* Global file pointer to incoming data. */ +extern FILE *input; + +/* End of File flag. */ +extern int EOF_flag; + +/* Loop flag. */ +extern int loopFlag; + +/* Shared memory flag. */ +extern int shmemFlag; + +/* Quiet flag. */ +extern int quietFlag; + +/* Display image on screen? */ +extern int noDisplayFlag; + +/* real time flag */ +extern int realTimeFlag; + +/* shared version of command line argument */ +extern int argc_share; +extern char **argv_share; + +/* for command line display name */ +extern char displayName[]; + +/* command line program list name */ +extern char proglistName[PATH_SIZE]; + +/* shared data structure */ +extern SharedData * shared; + +/* Structures used by the X server. */ + +extern Display *display; +extern Colormap cmap; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/gray.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/gray.cpp new file mode 100644 index 00000000000..7fe155bbe12 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/gray.cpp @@ -0,0 +1,85 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <string.h> +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, gray, "$Id$") + + +/* + *-------------------------------------------------------------- + * + * GrayDitherImage -- + * + * Dithers image into 128 gray scales. Simply maps luminance + * value into 1 of 128 gray scale colors (divide by two, essentially). + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +GrayDitherImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + ACE_UNUSED_ARG(cr); ACE_UNUSED_ARG(cb); + int i, max = w*h/16; + + for (i=0; i<max; i++) { + out[0] = pixel[lum[0]]; + out[1] = pixel[lum[1]]; + out[2] = pixel[lum[2]]; + out[3] = pixel[lum[3]]; + out[4] = pixel[lum[4]]; + out[5] = pixel[lum[5]]; + out[6] = pixel[lum[6]]; + out[7] = pixel[lum[7]]; + out[8] = pixel[lum[8]]; + out[9] = pixel[lum[9]]; + out[10] = pixel[lum[10]]; + out[11] = pixel[lum[11]]; + out[12] = pixel[lum[12]]; + out[13] = pixel[lum[13]]; + out[14] = pixel[lum[14]]; + out[15] = pixel[lum[15]]; + out += 16; + lum += 16; + } +} + + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybrid.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybrid.cpp new file mode 100644 index 00000000000..0040daec65c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybrid.cpp @@ -0,0 +1,238 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to implement an ordered dither. */ + +#include "ace/OS.h" +#include <string.h> +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" +#include "ace/OS.h" + +ACE_RCSID(mpeg_client, hybrid, "$Id$") + +#define DITH_SIZE 16 + + +/* Structures used to implement hybrid ordered dither/floyd-steinberg + dither algorithm. +*/ + +static unsigned char *l_darrays[DITH_SIZE]; +static unsigned char cr_fsarray[256][4]; +static unsigned char cb_fsarray[256][4]; + + +/* + *-------------------------------------------------------------- + * + * InitHybridDither-- + * + * Structures intialized for hybrid dithering. Ordered dither + * patterns set for luminance channel, f-s errors precomputed + * for chrominance channels. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitHybridDither() +{ + int i, j, k, err_range, threshval; + unsigned char *lmark; + + for (i=0; i<DITH_SIZE; i++) { + lmark = l_darrays[i] = (unsigned char *) ACE_OS::malloc(256); + + for (j=0; j<lum_values[0]; j++) { + *lmark++ = 0; + } + + for (j=0; j<(LUM_RANGE-1); j++) { + err_range = lum_values[j+1] - lum_values[j]; + threshval = ((i * err_range) / DITH_SIZE)+lum_values[j]; + + for (k=lum_values[j]; k<lum_values[j+1]; k++) { + if (k > threshval) *lmark++ = ((j+1) * (CR_RANGE * CB_RANGE)); + else *lmark++ = (j * (CR_RANGE * CB_RANGE)); + } + } + + for (j=lum_values[LUM_RANGE-1]; j<256; j++) { + *lmark++ = (LUM_RANGE-1)*(CR_RANGE * CB_RANGE); + } + + } + { + int cr1, cr2, cr3, cr4, err1, err2; + int cb1, cb2, cb3, cb4, val, nval; + + for (i=0; i<256; i++) { + + val = i; + + cr1 = (val * CR_RANGE) / 256; + err1 = (val - cr_values[cr1])/2; + err2 = (val - cr_values[cr1]) - err1; + + nval = val+err1; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cr2 = (nval * CR_RANGE) / 256; + err1 = (nval - cr_values[cr2])/2; + + nval = val+err2; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cr3 = (nval * CR_RANGE) / 256; + err2 = (nval - cr_values[cr3])/2; + + nval = val+err1+err2; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cr4 = (nval * CR_RANGE) / 256; + + cr_fsarray[i][0] = cr1*CB_RANGE; + cr_fsarray[i][1] = cr2*CB_RANGE; + cr_fsarray[i][2] = cr3*CB_RANGE; + cr_fsarray[i][3] = cr4*CB_RANGE; + } + + for (i=0; i<256; i++) { + + val = i; + + cb1 = (val * CB_RANGE) / 256; + err1 = (val - cb_values[cb1])/2; + err2 = (val - cb_values[cb1]) - err1; + + nval = val+err1; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cb2 = (nval * CB_RANGE) / 256; + err1 = (nval - cb_values[cb2])/2; + + nval = val+err2; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cb3 = (nval * CB_RANGE) / 256; + err2 = (nval - cb_values[cb3])/2; + + nval = val+err1+err2; + if (nval > 255) nval = 255; + else if (nval < 0) nval = 0; + cb4 = (nval * CB_RANGE) / 256; + + cb_fsarray[i][0] = cb1; + cb_fsarray[i][1] = cb2; + cb_fsarray[i][2] = cb3; + cb_fsarray[i][3] = cb4; + } + } +} + +/* + *-------------------------------------------------------------- + * + * HybridDitherImage -- + * + * Dithers an image using an ordered dither. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * The luminance channel is dithered based on the standard + * ordered dither pattern for a 4x4 area. The Chrominance + * channels are dithered based on precomputed f-s errors. + * Two errors are propogated per pixel. Errors are NOT propogated + * beyond a 2x2 pixel area. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +HybridDitherImage (unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int w, int h) +{ + unsigned char *l, *r, *b, *o1, *o2; + unsigned char *l2; + int i, j; + + l = lum; + l2 = lum+w; + r = cr; + b = cb; + o1 = out; + o2 = out+w; + + for (i=0; i<h; i+=4) { + + for (j=0; j<w; j+=4) { + + *o1++ = pixel[(l_darrays[0][*l++] | cr_fsarray[*r][0] | cb_fsarray[*b][0])]; + *o1++ = pixel[(l_darrays[8][*l++] | cr_fsarray[*r][1] | cb_fsarray[*b][1])]; + *o2++ = pixel[(l_darrays[12][*l2++] | cr_fsarray[*r][2] | cb_fsarray[*b][2])]; + *o2++ = pixel[(l_darrays[4][*l2++] | cr_fsarray[*r++][3] | cb_fsarray[*b++][3])]; + + *o1++ = pixel[(l_darrays[2][*l++] | cr_fsarray[*r][0] | cb_fsarray[*b][0])]; + *o1++ = pixel[(l_darrays[10][*l++] | cr_fsarray[*r][1] | cb_fsarray[*b][1])]; + *o2++ = pixel[(l_darrays[14][*l2++] | cr_fsarray[*r][2] | cb_fsarray[*b][2])]; + *o2++ = pixel[(l_darrays[6][*l2++] | cr_fsarray[*r++][3] | cb_fsarray[*b++][3])]; + } + + l += w; l2 += w; + o1 += w; o2 += w; + + for (j=0; j<w; j+=4) { + + *o1++ = pixel[(l_darrays[3][*l++] | cr_fsarray[*r][1] | cb_fsarray[*b][1])]; + *o1++ = pixel[(l_darrays[11][*l++] | cr_fsarray[*r][0] | cb_fsarray[*b][0])]; + *o2++ = pixel[(l_darrays[15][*l2++] | cr_fsarray[*r][3] | cb_fsarray[*b][3])]; + *o2++ = pixel[(l_darrays[7][*l2++] | cr_fsarray[*r++][2] | cb_fsarray[*b++][2])]; + + *o1++ = pixel[(l_darrays[1][*l++] | cr_fsarray[*r][1] | cb_fsarray[*b][1])]; + *o1++ = pixel[(l_darrays[9][*l++] | cr_fsarray[*r][0] | cb_fsarray[*b][0])]; + *o2++ = pixel[(l_darrays[13][*l2++] | cr_fsarray[*r][3] | cb_fsarray[*b][3])]; + *o2++ = pixel[(l_darrays[5][*l2++] | cr_fsarray[*r++][2] | cb_fsarray[*b++][2])]; + } + + l += w; l2 += w; + o1 += w; o2 += w; + } +} + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybriderr.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybriderr.cpp new file mode 100644 index 00000000000..3ea5d8aafbf --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/hybriderr.cpp @@ -0,0 +1,360 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to implement an ordered dither in the + luminance channel and F-S error diffusion on chrominance. +*/ + +#include "ace/OS.h" +#include <stdlib.h> +#include <string.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, hybriderr, "$Id$") + +#define DITH_SIZE 16 + +/* Structures used for hybrid dither with errors propogated. */ + +static unsigned char *l_darrays[DITH_SIZE]; +static unsigned char *l_darrays0, *l_darrays1, *l_darrays2, *l_darrays3; +static unsigned char *l_darrays4, *l_darrays5, *l_darrays6, *l_darrays7; +static unsigned char *l_darrays8, *l_darrays9, *l_darrays10, *l_darrays11; +static unsigned char *l_darrays12, *l_darrays13, *l_darrays14, *l_darrays15; +static unsigned char cr_fsarray[256*256][4]; +static unsigned char cb_fsarray[256*256][4]; +static unsigned short c_fserr[256*256][2]; + + +/* + *-------------------------------------------------------------- + * + * InitHybridErrorDither-- + * + * Initializes structures used for hybrid dither algorithm + * with errors propogated on Cr and Cb. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitHybridErrorDither() +{ + int i, j, k, err_range, threshval; + unsigned char *lmark; + + + for (i=0; i<DITH_SIZE; i++) { + lmark = l_darrays[i] = (unsigned char *) ACE_OS::malloc(256); + + for (j=0; j<lum_values[0]; j++) { + *lmark++ = 0; + } + + for (j=0; j<(LUM_RANGE-1); j++) { + err_range = lum_values[j+1] - lum_values[j]; + threshval = ((i * err_range) / DITH_SIZE)+lum_values[j]; + + for (k=lum_values[j]; k<lum_values[j+1]; k++) { + if (k > threshval) *lmark++ = ((j+1) * (CR_RANGE * CB_RANGE)); + else *lmark++ = (j * (CR_RANGE * CB_RANGE)); + } + } + + for (j=lum_values[LUM_RANGE-1]; j <256; j++) { + *lmark++ = (LUM_RANGE-1)*(CR_RANGE * CB_RANGE); + } + } + l_darrays0 = l_darrays[0]; l_darrays8 = l_darrays[8]; + l_darrays1 = l_darrays[1]; l_darrays9 = l_darrays[9]; + l_darrays2 = l_darrays[2]; l_darrays10 = l_darrays[10]; + l_darrays3 = l_darrays[3]; l_darrays11 = l_darrays[11]; + l_darrays4 = l_darrays[4]; l_darrays12 = l_darrays[12]; + l_darrays5 = l_darrays[5]; l_darrays13 = l_darrays[13]; + l_darrays6 = l_darrays[6]; l_darrays14 = l_darrays[14]; + l_darrays7 = l_darrays[7]; l_darrays15 = l_darrays[15]; + { + int cr1, cr2, cr3, cr4, err1, err2; + int cb1, cb2, cb3, cb4, val, nval; + int outerr1, outerr2, outerr3, outerr4; + int inerr1, inerr2, inerr3, inerr4; + unsigned short oe1, oe2, oe3, oe4; + + for (j=0; j<65536; j+= 256) { + + inerr1 = (((j & 0xc000) >> 14)*8) - 12; + inerr2 = (((j & 0x3000) >> 12)*8) - 12; + inerr3 = (((j & 0x0c00) >> 10)*8) - 12; + inerr4 = (((j & 0x0300) >> 8) *8) - 12; + + for (i=0; i<256; i++) { + val = i; + + nval = val+inerr1+inerr3; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cr1 = ((nval) * CR_RANGE) / 256; + err1 = ((nval) - cr_values[cr1])/2; + err2 = ((nval) - cr_values[cr1]) - err1; + + nval = val+err1+inerr2; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cr2 = ((nval) * CR_RANGE) / 256; + err1 = ((nval) - cr_values[cr2])/2; + outerr3 = ((nval) - cr_values[cr2])-err1; + + nval = val+err2+inerr4; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cr3 = ((nval) * CR_RANGE) / 256; + err2 = ((nval) - cr_values[cr3])/2; + outerr1 = ((nval) - cr_values[cr3]) - err2; + + nval = val+err1+err2; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cr4 = ((nval) * CR_RANGE) / 256; + outerr2 = ((nval) - cr_values[cr4])/2; + outerr4 = ((nval) - cr_values[cr4])-outerr2; + + cr_fsarray[i+j][0] = cr1*CB_RANGE; + cr_fsarray[i+j][1] = cr2*CB_RANGE; + cr_fsarray[i+j][2] = cr3*CB_RANGE; + cr_fsarray[i+j][3] = cr4*CB_RANGE; + + if (outerr1 < -16) outerr1++; + else if (outerr1 > 15) outerr1--; + if (outerr2 < -16) outerr2++; + else if (outerr2 > 15) outerr2--; + if (outerr3 < -16) outerr3++; + else if (outerr3 > 15) outerr3--; + if (outerr4 < -16) outerr4++; + else if (outerr4 > 15) outerr4--; + + oe1 = (outerr1 + 16) / 8; + oe2 = (outerr2 + 16) / 8; + oe3 = (outerr3 + 16) / 8; + oe4 = (outerr4 + 16) / 8; + +/* This is a debugging check and should be removed if not needed. */ + if ((oe1 > 3) || (oe2 > 3) || (oe3 > 3) || (oe4 > 3)) + fprintf(stderr, "OE error!!!!\n"); + + + c_fserr[i+j][0] = ((oe1 << 14) | (oe2 << 12)); + + c_fserr[i+j][1] = ((oe3 << 10) | (oe4 << 8)); + } + + for (i=0; i<256; i++) { + val = i; + nval = val+inerr1+inerr3; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cb1 = ((nval) * CB_RANGE) / 256; + err1 = ((nval) - cb_values[cb1])/2; + err2 = ((nval) - cb_values[cb1]) - err1; + + nval = val+err1+inerr2; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cb2 = ((nval) * CB_RANGE) / 256; + err1 = ((nval) - cb_values[cb2])/2; + + nval = val+err2+inerr4; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cb3 = ((nval) * CB_RANGE) / 256; + err2 = ((nval) - cb_values[cb3])/2; + + nval = val+err1+err2; + if (nval < 0) nval = 0; else if (nval > 255) nval = 255; + cb4 = ((nval) * CB_RANGE) / 256; + + cb_fsarray[i+j][0] = cb1; + cb_fsarray[i+j][1] = cb2; + cb_fsarray[i+j][2] = cb3; + cb_fsarray[i+j][3] = cb4; + } + } + } +} + +/* + *-------------------------------------------------------------- + * + * HybridErrorDitherImage -- + * + * Dithers an image using a hybrid ordered/floyd-steinberg dither. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * This dither is almost exactly like the dither implemented in the + * file odith.c (i.e. hybrid dithering) except a quantized amount of + * error is propogated between 2x2 pixel areas in Cr and Cb. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +HybridErrorDitherImage (unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int w, int h) +{ + unsigned char *l, *r, *b, *o1, *o2; + unsigned char *l2; + static int *cr_row_errs; + static int *cb_row_errs; + int *cr_r_err; + int *cb_r_err; + int cr_c_err; + int cb_c_err; + unsigned char *cr_fsptr; + unsigned char *cb_fsptr; + static int first = 1; + int cr_code, cb_code; + + int i, j; + int row_advance, row_advance2; + int half_row_advance, half_row_advance2; + + /* If first time called, allocate error arrays. */ + + if (first) { + cr_row_errs = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + cb_row_errs = (int *) ACE_OS::malloc((w+5)*sizeof(int)); + first = 0; + } + + row_advance = (w << 1) - 1; + row_advance2 = row_advance+2; + half_row_advance = (w>>1)-1; + half_row_advance2 = half_row_advance+2; + + l = lum; + l2 = lum+w; + r = cr; + b = cb; + o1 = out; + o2 = out+w; + + memset( (char *) cr_row_errs, 0, (w+5)*sizeof(int)); + cr_r_err = cr_row_errs; + cr_c_err = 0; + memset( (char *) cb_row_errs, 0, (w+5)*sizeof(int)); + cb_r_err = cb_row_errs; + cb_c_err = 0; + + for (i=0; i<h; i+=4) { + + for (j=w; j>0; j-=4) { + + cr_code = (*cr_r_err | cr_c_err | *r++); + cb_code = (*cb_r_err | cb_c_err | *b++); + + cr_fsptr = cr_fsarray[cr_code]; + cb_fsptr = cb_fsarray[cb_code]; + + *o1++ = pixel[(l_darrays0[*l++] | *cr_fsptr++ | *cb_fsptr++)]; + *o1++ = pixel[(l_darrays8[*l++] | *cr_fsptr++ | *cb_fsptr++)]; + *o2++ = pixel[(l_darrays12[*l2++] | *cr_fsptr++ | *cb_fsptr++)]; + *o2++ = pixel[(l_darrays4[*l2++] | *cr_fsptr++ | *cb_fsptr++)]; + + cr_c_err = c_fserr[cr_code][1]; + cb_c_err = c_fserr[cb_code][1]; + *cr_r_err++ = c_fserr[cr_code][0]; + *cb_r_err++ = c_fserr[cb_code][0]; + cr_code = (*cr_r_err | cr_c_err | *r++); + cb_code = (*cb_r_err | cb_c_err | *b++); + + cr_fsptr = cr_fsarray[cr_code]; + cb_fsptr = cb_fsarray[cb_code]; + + *o1++ = pixel[(l_darrays2[*l++] | *cr_fsptr++ | *cb_fsptr++)]; + *o1++ = pixel[(l_darrays10[*l++] | *cr_fsptr++ | *cb_fsptr++)]; + *o2++ = pixel[(l_darrays14[*l2++] | *cr_fsptr++ | *cb_fsptr++)]; + *o2++ = pixel[(l_darrays6[*l2++] | *cr_fsptr++ | *cb_fsptr++)]; + + cr_c_err = c_fserr[cr_code][1]; + cb_c_err = c_fserr[cb_code][1]; + *cr_r_err++ = c_fserr[cr_code][0]; + *cb_r_err++ = c_fserr[cb_code][0]; + } + + l += row_advance; l2 += row_advance; + o1 += row_advance; o2 += row_advance; + cr_c_err = 0; + cb_c_err = 0; + cr_r_err--; cb_r_err--; + r += half_row_advance; b += half_row_advance; + + for (j=w; j>0; j-=4) { + + cr_code = (*cr_r_err | cr_c_err | *r--); + cb_code = (*cb_r_err | cb_c_err | *b--); + cr_fsptr = cr_fsarray[cr_code]; + cb_fsptr = cb_fsarray[cb_code]; + + *o1-- = pixel[(l_darrays9[*l--] | *cr_fsptr++ | *cb_fsptr++)]; + *o1-- = pixel[(l_darrays1[*l--] | *cr_fsptr++ | *cb_fsptr++)]; + *o2-- = pixel[(l_darrays5[*l2--] | *cr_fsptr++ | *cb_fsptr++)]; + *o2-- = pixel[(l_darrays13[*l2--] | *cr_fsptr++ | *cb_fsptr++)]; + + cr_c_err = c_fserr[cr_code][1]; + cb_c_err = c_fserr[cb_code][1]; + *cr_r_err-- = c_fserr[cr_code][0]; + *cb_r_err-- = c_fserr[cb_code][0]; + cr_code = (*cr_r_err | cr_c_err | *r--); + cb_code = (*cb_r_err | cb_c_err | *b--); + cr_fsptr = cr_fsarray[cr_code]; + cb_fsptr = cb_fsarray[cb_code]; + + *o1-- = pixel[(l_darrays11[*l--] | *cr_fsptr++ | *cb_fsptr++)]; + *o1-- = pixel[(l_darrays3[*l--] | *cr_fsptr++ | *cb_fsptr++)]; + *o2-- = pixel[(l_darrays7[*l2--] | *cr_fsptr++ | *cb_fsptr++)]; + *o2-- = pixel[(l_darrays15[*l2--] | *cr_fsptr++ | *cb_fsptr++)]; + + cr_c_err = c_fserr[cr_code][1]; + cb_c_err = c_fserr[cb_code][1]; + *cr_r_err-- = c_fserr[cr_code][0]; + *cb_r_err-- = c_fserr[cb_code][0]; + + } + + l += row_advance2; l2 += row_advance2; + o1 += row_advance2; o2 += row_advance2; + cr_c_err = 0; cb_c_err = 0; + cr_r_err++; cb_r_err++; + r += half_row_advance2; b += half_row_advance2; + } +} + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/info.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/info.cpp new file mode 100644 index 00000000000..6400a72bd42 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/info.cpp @@ -0,0 +1,85 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/ACE.h" + +ACE_RCSID(mpeg_client, info, "$Id$") + +char infomessage[] = "\ +\n\ +\n\ +\n\ +TAO Audio/Video Streaming service\n\ +---------------------------------\n\ +\n\ +This is a distributed audio/video streaming application that uses\n\ +interfaces and interactions defined in the OMG \"Control and Management\n\ +of A/V streams\" spec. An implementation of the spec can be found in\n\ +the following directory.\n\ +\n\ +TAO/orbsvcs/orbsvcs/AV/\n\ +\n\ +The TAO application is a modified version of a streaming application\n\ +developed at the Oregon Graduate Institute.\n\ +\n\ +\n\ +\n\ +The player features common VCR functionalities like synchronized\n\ +video(MPEG) and audio(.au) play back, play speed set on the fly,\n\ +fast-forward, rewind, step forward, random Positioning, and more.\n\ +\n\ +The player is of server/client architecture. The server manages program\n\ +retrieval and distribution. The client decodes video frames, plays video\n\ +and audio streams, and provides a Motif style user interface.\n\ +\n\ +\n\ +The basic client/server used by the application originated from:\n\ + Distributed Systems Research Group\n\ + Department of Computer Science and Engineering\n\ + Oregon Graduate Institute of Science and Technology\n\ + October, 1995\n\ +The MPEG decoder used by the client is originated from U.C.Berkeley\n\ +MPEG decoder 2.0, by Lawrence A. Rowe, Ketan Patel, and Brian Smith,\n\ +of Computer Science Division-EECS, Univ. of Calif. at Berkeley.\n\ +\n\ +The Motif user interface is based on an implementation by Daeron Meyer\n\ +of The Geometry Center, University of Minnesota.\n\ +\n\ +This software is covered by copyrights. It contains code contributed\n\ +by the authors and several other parties. Please see the beginning of\n\ +source files and copyright file(s) in the root directory of the source\n\ +kit.\n\ +\n\ +Sumedh Mungee <sumedh@cs.wustl.edu>\n\ +Nagarajan Surendran <naga@cs.wustl.edu>\n\ +Seth Widoff <sbw1@cs.wustl.edu>\n\ +Alexander Arulanthu <alex@cs.wustl.edu>\n\ +Distributed Object Computing Group\n\ +Washington University\n\ +\n\ +\n\ +"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/Info.mib b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/Info.mib new file mode 100644 index 00000000000..e42c3b7ec75 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/Info.mib @@ -0,0 +1,78 @@ +static char InfoMib[] = "\ +TotalWidgets: 4\n\ +Ref: 1\n\ +Widget: \"RootForm\"\n\ +Children: 2 3 4\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Root\"\n\ +Xmwidth: 562\n\ +Xmheight: 307\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 0\n\ +XmleftOffset: 0\n\ +XmrightOffset: 0\n\ +Private-\n\ +EndWidget.\n\ +Ref: 2\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Dismiss\"\n\ +Xmwidth: 62\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 270\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 506\n\ +XmrightOffset: 9\n\ +Private-\n\ +label: \"Dismiss\"\n\ +EndWidget.\n\ +Ref: 3\n\ +Widget: \"TextBig\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"TextBig\"\n\ +Xmwidth: 546\n\ +Xmheight: 256\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 8\n\ +XmbottomOffset: 43\n\ +XmleftOffset: 8\n\ +XmrightOffset: 8\n\ +Private-\n\ +EndWidget.\n\ +Ref: 4\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"OutFrame\"\n\ +Xmwidth: 561\n\ +Xmheight: 306\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 1\n\ +XmleftOffset: 1\n\ +XmrightOffset: 0\n\ +Private-\n\ +shadowtype: 1\n\ +EndWidget.\n\ +END.\n\ +"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MW.mib b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MW.mib new file mode 100644 index 00000000000..d1f432214bb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MW.mib @@ -0,0 +1,229 @@ +static char MainMib[] = "\ +TotalWidgets: 12\n\ +Ref: 1\n\ +Widget: \"RootForm\"\n\ +Children: 2 3 4 5 6 7 8 9 10 11 12\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Root\"\n\ +Xmwidth: 364\n\ +Xmheight: 216\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 0\n\ +XmleftOffset: 0\n\ +XmrightOffset: 0\n\ +Private-\n\ +EndWidget.\n\ +Ref: 2\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Info\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 200\n\ +XmrightOffset: 123\n\ +Private-\n\ +label: \"Info\"\n\ +EndWidget.\n\ +Ref: 3\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Loop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 140\n\ +XmrightOffset: 196\n\ +Private-\n\ +label: \"Loop\"\n\ +EndWidget.\n\ +Ref: 4\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Step\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 74\n\ +XmrightOffset: 262\n\ +Private-\n\ +label: \"Step\"\n\ +EndWidget.\n\ +Ref: 5\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Exit\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 314\n\ +XmrightOffset: 9\n\ +Private-\n\ +label: \"Exit\"\n\ +EndWidget.\n\ +Ref: 6\n\ +Widget: \"TextBox\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"FrameText\"\n\ +Xmwidth: 65\n\ +Xmheight: 29\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 8\n\ +XmleftOffset: 245\n\ +XmrightOffset: 54\n\ +Private-\n\ +EndWidget.\n\ +Ref: 7\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Rewind\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 8\n\ +XmrightOffset: 328\n\ +Private-\n\ +label: \"Rew\"\n\ +EndWidget.\n\ +Ref: 8\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Play\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 107\n\ +XmrightOffset: 229\n\ +Private-\n\ +label: \"Play\"\n\ +EndWidget.\n\ +Ref: 9\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Stop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 9\n\ +XmleftOffset: 41\n\ +XmrightOffset: 295\n\ +Private-\n\ +label: \"Stop\"\n\ +EndWidget.\n\ +Ref: 10\n\ +Widget: \"DrawingArea\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Monitor\"\n\ +Xmwidth: 336\n\ +Xmheight: 157\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 13\n\ +XmbottomOffset: 46\n\ +XmleftOffset: 13\n\ +XmrightOffset: 15\n\ +Private-\n\ +EndWidget.\n\ +Ref: 11\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"InFrame\"\n\ +Xmwidth: 347\n\ +Xmheight: 167\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 8\n\ +XmbottomOffset: 41\n\ +XmleftOffset: 8\n\ +XmrightOffset: 9\n\ +Private-\n\ +shadowtype: 0\n\ +EndWidget.\n\ +Ref: 12\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"OutFrame\"\n\ +Xmwidth: 362\n\ +Xmheight: 215\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 1\n\ +XmleftOffset: 1\n\ +XmrightOffset: 1\n\ +Private-\n\ +shadowtype: 1\n\ +EndWidget.\n\ +END.\n\ +"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MainWindow.mib b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MainWindow.mib new file mode 100644 index 00000000000..1005fba75e8 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/MainWindow.mib @@ -0,0 +1,324 @@ +static char MainMib[] = "\ +TotalWidgets: 17\n\ +Ref: 1\n\ +Widget: \"RootForm\"\n\ +Children: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Root\"\n\ +Xmwidth: 364\n\ +Xmheight: 306\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 0\n\ +XmleftOffset: 0\n\ +XmrightOffset: 0\n\ +Private-\n\ +EndWidget.\n\ +Ref: 2\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Exit\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 8\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Exit\"\n\ +EndWidget.\n\ +Ref: 3\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Info\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 53\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Info\"\n\ +EndWidget.\n\ +Ref: 4\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Para\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 98\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Para\"\n\ +EndWidget.\n\ +Ref: 5\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Prog\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 143\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Prog\"\n\ +EndWidget.\n\ +Ref: 6\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"File\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 188\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"File\"\n\ +EndWidget.\n\ +Ref: 7\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Step\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 9\n\ +Private-\n\ +label: \"Step\"\n\ +EndWidget.\n\ +Ref: 8\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Play\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 42\n\ +Private-\n\ +label: \"Play\"\n\ +EndWidget.\n\ +Ref: 9\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"FF\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 75\n\ +Private-\n\ +label: \"FF\"\n\ +EndWidget.\n\ +Ref: 10\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Stop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 108\n\ +Private-\n\ +label: \"Stop\"\n\ +EndWidget.\n\ +Ref: 11\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Rewind\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 141\n\ +Private-\n\ +label: \"Rewind\"\n\ +EndWidget.\n\ +Ref: 12\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Normal\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 174\n\ +Private-\n\ +label: \"Norm\"\n\ +EndWidget.\n\ +Ref: 13\n\ +Widget: \"Toggle\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Loop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 219\n\ +Private-\n\ +label: \"Loop\"\n\ +EndWidget.\n\ +Ref: 14\n\ +Widget: \"DrawingArea\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Monitor\"\n\ +Xmwidth: 336\n\ +Xmheight: 157\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 43\n\ +XmbottomOffset: 106\n\ +XmleftOffset: 13\n\ +XmrightOffset: 15\n\ +Private-\n\ +EndWidget.\n\ +Ref: 15\n\ +Widget: \"TextBox\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"TitleText\"\n\ +Xmwidth: 336\n\ +Xmheight: 29\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 0\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 8\n\ +XmbottomOffset: 106\n\ +XmleftOffset: 8\n\ +XmrightOffset: 9\n\ +Private-\n\ +EndWidget.\n\ +Ref: 16\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"InFrame\"\n\ +Xmwidth: 347\n\ +Xmheight: 197\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 38\n\ +XmbottomOffset: 101\n\ +XmleftOffset: 8\n\ +XmrightOffset: 9\n\ +Private-\n\ +shadowtype: 0\n\ +EndWidget.\n\ +Ref: 17\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"OutFrame\"\n\ +Xmwidth: 362\n\ +Xmheight: 275\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 1\n\ +XmleftOffset: 1\n\ +XmrightOffset: 1\n\ +Private-\n\ +shadowtype: 1\n\ +EndWidget.\n\ +END.\n\ +"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/fb.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/fb.xbm new file mode 100644 index 00000000000..e20c1d81d6c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/fb.xbm @@ -0,0 +1,9 @@ +#define fb_width 20 +#define fb_height 20 +static unsigned char fb_bits[] = { +0x00, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x8a, 0x02, 0x00, +0x4d, 0x03, 0x80, 0xaa, 0x02, 0x40, 0x5d, 0x03, 0xa0, 0x28, +0x02, 0x50, 0x1c, 0x03, 0x28, 0x00, 0x02, 0x1c, 0x00, 0x03, +0x38, 0x00, 0x02, 0x70, 0x1c, 0x03, 0xe0, 0x38, 0x02, 0xc0, +0x7d, 0x03, 0x80, 0xeb, 0x02, 0x00, 0xcf, 0x03, 0x00, 0x8e, +0x03, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/ff.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/ff.xbm new file mode 100644 index 00000000000..82b4c250417 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/ff.xbm @@ -0,0 +1,8 @@ +#define ff_width 20 +#define ff_height 20 +static unsigned char ff_bits[] = { + 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x14, 0x05, 0x00, 0x2c, 0x0b, 0x00, + 0x54, 0x15, 0x00, 0xac, 0x2b, 0x00, 0x44, 0x51, 0x00, 0x8c, 0xa3, 0x00, + 0x04, 0x40, 0x01, 0x0c, 0x80, 0x03, 0x04, 0xc0, 0x01, 0x8c, 0xe3, 0x00, + 0xc4, 0x71, 0x00, 0xec, 0x3b, 0x00, 0x74, 0x1d, 0x00, 0x3c, 0x0f, 0x00, + 0x1c, 0x07, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/loop.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/loop.xbm new file mode 100644 index 00000000000..9847623ba6a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/loop.xbm @@ -0,0 +1,8 @@ +#define loop_width 20 +#define loop_height 20 +static unsigned char loop_bits[] = { + 0x00, 0x10, 0x00, 0x00, 0xf0, 0x00, 0xa0, 0xa0, 0x03, 0x50, 0x51, 0x05, + 0xe8, 0xa0, 0x06, 0x74, 0x50, 0x03, 0x38, 0xe0, 0x02, 0x34, 0x70, 0x05, + 0x1a, 0x80, 0x06, 0x14, 0x00, 0x05, 0x1a, 0x80, 0x06, 0x14, 0x00, 0x05, + 0x2a, 0x80, 0x06, 0x54, 0x40, 0x03, 0xa8, 0xaa, 0x02, 0x50, 0x55, 0x01, + 0xb0, 0xea, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/old.MainWindow.mib b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/old.MainWindow.mib new file mode 100644 index 00000000000..b3cc211d9ad --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/old.MainWindow.mib @@ -0,0 +1,305 @@ +static char MainMib[] = "\ +TotalWidgets: 16\n\ +Ref: 1\n\ +Widget: \"RootForm\"\n\ +Children: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Root\"\n\ +Xmwidth: 364\n\ +Xmheight: 306\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 0\n\ +XmleftOffset: 0\n\ +XmrightOffset: 0\n\ +Private-\n\ +EndWidget.\n\ +Ref: 2\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Exit\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 8\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Exit\"\n\ +EndWidget.\n\ +Ref: 3\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Info\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 53\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Info\"\n\ +EndWidget.\n\ +Ref: 4\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Para\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 98\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Para\"\n\ +EndWidget.\n\ +Ref: 5\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Prog\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 0\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 143\n\ +XmrightOffset: 10\n\ +Private-\n\ +label: \"Prog\"\n\ +EndWidget.\n\ +Ref: 6\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Step\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 9\n\ +Private-\n\ +label: \"Step\"\n\ +EndWidget.\n\ +Ref: 7\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Play\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 42\n\ +Private-\n\ +label: \"Play\"\n\ +EndWidget.\n\ +Ref: 8\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"FF\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 75\n\ +Private-\n\ +label: \"FF\"\n\ +EndWidget.\n\ +Ref: 9\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Stop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 108\n\ +Private-\n\ +label: \"Stop\"\n\ +EndWidget.\n\ +Ref: 10\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Rewind\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 141\n\ +Private-\n\ +label: \"Rewind\"\n\ +EndWidget.\n\ +Ref: 11\n\ +Widget: \"Button\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Normal\"\n\ +Xmwidth: 41\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 174\n\ +Private-\n\ +label: \"Norm\"\n\ +EndWidget.\n\ +Ref: 12\n\ +Widget: \"Toggle\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Loop\"\n\ +Xmwidth: 28\n\ +Xmheight: 28\n\ +XmtopAttachment: 0\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 0\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 179\n\ +XmbottomOffset: 69\n\ +XmleftOffset: 100\n\ +XmrightOffset: 219\n\ +Private-\n\ +label: \"Loop\"\n\ +EndWidget.\n\ +Ref: 13\n\ +Widget: \"DrawingArea\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"Monitor\"\n\ +Xmwidth: 336\n\ +Xmheight: 157\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 43\n\ +XmbottomOffset: 106\n\ +XmleftOffset: 13\n\ +XmrightOffset: 15\n\ +Private-\n\ +EndWidget.\n\ +Ref: 14\n\ +Widget: \"TextBox\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"TitleText\"\n\ +Xmwidth: 336\n\ +Xmheight: 29\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 0\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 8\n\ +XmbottomOffset: 106\n\ +XmleftOffset: 8\n\ +XmrightOffset: 9\n\ +Private-\n\ +EndWidget.\n\ +Ref: 15\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"InFrame\"\n\ +Xmwidth: 347\n\ +Xmheight: 197\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 38\n\ +XmbottomOffset: 101\n\ +XmleftOffset: 8\n\ +XmrightOffset: 9\n\ +Private-\n\ +shadowtype: 0\n\ +EndWidget.\n\ +Ref: 16\n\ +Widget: \"Frame\"\n\ +Children: X\n\ +Parent: 1\n\ +Public-\n\ +Name: \"OutFrame\"\n\ +Xmwidth: 362\n\ +Xmheight: 275\n\ +XmtopAttachment: 1\n\ +XmbottomAttachment: 1\n\ +XmleftAttachment: 1\n\ +XmrightAttachment: 1\n\ +XmtopOffset: 0\n\ +XmbottomOffset: 1\n\ +XmleftOffset: 1\n\ +XmrightOffset: 1\n\ +Private-\n\ +shadowtype: 1\n\ +EndWidget.\n\ +END.\n\ +"; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/play.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/play.xbm new file mode 100644 index 00000000000..91955e5117c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/play.xbm @@ -0,0 +1,8 @@ +#define play_width 20 +#define play_height 20 +static unsigned char play_bits[] = { + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x40, 0x01, 0x00, 0xc0, 0x02, 0x00, + 0x40, 0x05, 0x00, 0xc0, 0x0a, 0x00, 0x40, 0x14, 0x00, 0xc0, 0x28, 0x00, + 0x40, 0x50, 0x00, 0xc0, 0xe0, 0x00, 0x40, 0x70, 0x00, 0xc0, 0x38, 0x00, + 0x40, 0x1c, 0x00, 0xc0, 0x0e, 0x00, 0x40, 0x07, 0x00, 0xc0, 0x03, 0x00, + 0xc0, 0x01, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/rewind.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/rewind.xbm new file mode 100644 index 00000000000..402643dcd25 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/rewind.xbm @@ -0,0 +1,8 @@ +#define rewind_width 20 +#define rewind_height 20 +static unsigned char rewind_bits[] = { + 0x00, 0x00, 0x00, 0x30, 0x80, 0x01, 0x28, 0x40, 0x01, 0x30, 0xa0, 0x01, + 0x28, 0x50, 0x01, 0x30, 0xa8, 0x01, 0x28, 0x14, 0x01, 0x30, 0x8a, 0x01, + 0x28, 0x05, 0x01, 0xb0, 0x83, 0x01, 0x28, 0x03, 0x01, 0x30, 0x8e, 0x01, + 0x28, 0x1c, 0x01, 0x30, 0xb8, 0x01, 0x28, 0x70, 0x01, 0x30, 0xe0, 0x01, + 0x28, 0xc0, 0x01, 0x38, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/step.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/step.xbm new file mode 100644 index 00000000000..3ac996cbdb7 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/step.xbm @@ -0,0 +1,8 @@ +#define step_width 20 +#define step_height 20 +static unsigned char step_bits[] = { + 0x00, 0x00, 0x00, 0x18, 0x03, 0x00, 0x14, 0x05, 0x00, 0x18, 0x0b, 0x00, + 0x14, 0x15, 0x00, 0x18, 0x2b, 0x00, 0x14, 0x51, 0x00, 0x18, 0xa3, 0x00, + 0x14, 0x41, 0x01, 0x18, 0x83, 0x03, 0x14, 0xc1, 0x01, 0x18, 0xe3, 0x00, + 0x14, 0x71, 0x00, 0x18, 0x3b, 0x00, 0x14, 0x1d, 0x00, 0x18, 0x0f, 0x00, + 0x14, 0x07, 0x00, 0x1c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/stop.xbm b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/stop.xbm new file mode 100644 index 00000000000..490ee392761 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/interface/stop.xbm @@ -0,0 +1,8 @@ +#define stop_width 20 +#define stop_height 20 +static unsigned char stop_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x03, 0x54, 0x55, 0x01, + 0xac, 0xaa, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, + 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, + 0x0c, 0x80, 0x02, 0x14, 0x80, 0x01, 0x0c, 0x80, 0x02, 0xf4, 0xff, 0x01, + 0xac, 0xaa, 0x02, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/jrevdct.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/jrevdct.cpp new file mode 100644 index 00000000000..5190b0fc96c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/jrevdct.cpp @@ -0,0 +1,1461 @@ +/* $Id$ */ + +/* + * jrevdct.c + * + * Copyright (C) 1991, 1992, Thomas G. Lane. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file contains the basic inverse-DCT transformation subroutine. + * + * This implementation is based on an algorithm described in + * C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT + * Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics, + * Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991. + * The primary algorithm described there uses 11 multiplies and 29 adds. + * We use their alternate method with 12 multiplies and 32 adds. + * The advantage of this method is that no data path contains more than one + * multiplication; this allows a very simple and accurate implementation in + * scaled fixed-point arithmetic, with a minimal number of shifts. + * + * I've made lots of modifications to attempt to take advantage of the + * sparse nature of the DCT matrices we're getting. Although the logic + * is cumbersome, it's straightforward and the resulting code is much + * faster. + * + * A better way to do this would be to pass in the DCT block as a sparse + * matrix, perhaps with the difference cases encoded. + */ + +#include "ace/OS.h" +#include <string.h> +#include "video.h" +#include "proto.h" + +ACE_RCSID(mpeg_client, jrevdct, "$Id$") + +#define GLOBAL /* a function referenced thru EXTERNs */ + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + +/* + * This routine is specialized to the case DCTSIZE = 8. + */ + +#if DCTSIZE != 8 + Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */ +#endif + + +/* + * A 2-D IDCT can be done by 1-D IDCT on each row followed by 1-D IDCT + * on each column. Direct algorithms are also available, but they are + * much more complex and seem not to be any faster when reduced to code. + * + * The poop on this scaling stuff is as follows: + * + * Each 1-D IDCT step produces outputs which are a factor of sqrt(N) + * larger than the true IDCT outputs. The final outputs are therefore + * a factor of N larger than desired; since N=8 this can be cured by + * a simple right shift at the end of the algorithm. The advantage of + * this arrangement is that we save two multiplications per 1-D IDCT, + * because the y0 and y4 inputs need not be divided by sqrt(N). + * + * We have to do addition and subtraction of the integer inputs, which + * is no problem, and multiplication by fractional constants, which is + * a problem to do in integer arithmetic. We multiply all the constants + * by CONST_SCALE and convert them to integer constants (thus retaining + * CONST_BITS bits of precision in the constants). After doing a + * multiplication we have to divide the product by CONST_SCALE, with proper + * rounding, to produce the correct output. This division can be done + * cheaply as a right shift of CONST_BITS bits. We postpone shifting + * as long as possible so that partial sums can be added together with + * full fractional precision. + * + * The outputs of the first pass are scaled up by PASS1_BITS bits so that + * they are represented to better-than-integral precision. These outputs + * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word + * with the recommended scaling. (To scale up 12-bit sample data further, an + * intermediate INT32 array would be needed.) + * + * To avoid overflow of the 32-bit intermediate results in pass 2, we must + * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis + * shows that the values given below are the most effective. + */ + +#ifdef EIGHT_BIT_SAMPLES +#define PASS1_BITS 2 +#else +#define PASS1_BITS 1 /* lose a little precision to avoid overflow */ +#endif + +#define ONE ((INT32) 1) + +#define CONST_SCALE (ONE << CONST_BITS) + +/* Convert a positive real constant to an integer scaled by CONST_SCALE. + * IMPORTANT: if your compiler doesn't do this arithmetic at compile time, + * you will pay a significant penalty in run time. In that case, figure + * the correct integer constant values and insert them by hand. + */ + +#define FIX(x) ((INT32) ((x) * CONST_SCALE + 0.5)) + +/* Descale and correctly round an INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + (ONE << ((n)-1)), n) + +/* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. + * For 8-bit samples with the recommended scaling, all the variable + * and constant values involved are no more than 16 bits wide, so a + * 16x16->32 bit multiply can be used instead of a full 32x32 multiply; + * this provides a useful speedup on many machines. + * There is no way to specify a 16x16->32 multiply in portable C, but + * some C compilers will do the right thing if you provide the correct + * combination of casts. + * NB: for 12-bit samples, a full 32-bit multiplication will be needed. + */ + +#ifdef EIGHT_BIT_SAMPLES +#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */ +#define MULTIPLY(var,const) (((INT16) (var)) * ((INT16) (const))) +#endif +#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */ +#define MULTIPLY(var,const) (((INT16) (var)) * ((INT32) (const))) +#endif +#endif + +#ifndef MULTIPLY /* default definition */ +#define MULTIPLY(var,const) ((var) * (const)) +#endif + +/* Precomputed idct value arrays. */ + +static DCTELEM PreIDCT[64][64]; + +void j_rev_dct (DCTBLOCK data); + +/* Pre compute singleton coefficient IDCT values. */ +void +init_pre_idct() { + int i; + + for (i=0; i<64; i++) { + memset((char *) PreIDCT[i], 0, 64*sizeof(DCTELEM)); + PreIDCT[i][i] = 2048; + j_rev_dct(PreIDCT[i]); + } +} + +#ifndef ORIG_DCT + + +/* + * Perform the inverse DCT on one block of coefficients. + */ + +void +j_rev_dct_sparse (DCTBLOCK data, int pos) +{ + register DCTELEM *dataptr; + short int val; + DCTELEM *ndataptr; + int /*scale,*/ coeff, rr; + register int *dp; + register int v; + + /* If DC Coefficient. */ + + if (pos == 0) { + dp = (int *)data; + v = *data; + /* Compute 32 bit value to assign. This speeds things up a bit */ + if (v < 0) val = (v-3)>>3; + else val = (v+4)>>3; + v = val | (val << 16); + dp[0] = v; dp[1] = v; dp[2] = v; dp[3] = v; + dp[4] = v; dp[5] = v; dp[6] = v; dp[7] = v; + dp[8] = v; dp[9] = v; dp[10] = v; dp[11] = v; + dp[12] = v; dp[13] = v; dp[14] = v; dp[15] = v; + dp[16] = v; dp[17] = v; dp[18] = v; dp[19] = v; + dp[20] = v; dp[21] = v; dp[22] = v; dp[23] = v; + dp[24] = v; dp[25] = v; dp[26] = v; dp[27] = v; + dp[28] = v; dp[29] = v; dp[30] = v; dp[31] = v; + return; + } + + /* Some other coefficient. */ + dataptr = (DCTELEM *)data; + coeff = dataptr[pos]; + ndataptr = PreIDCT[pos]; + + for (rr=0; rr<4; rr++) { + dataptr[0] = (ndataptr[0] * coeff) >> (CONST_BITS-2); + dataptr[1] = (ndataptr[1] * coeff) >> (CONST_BITS-2); + dataptr[2] = (ndataptr[2] * coeff) >> (CONST_BITS-2); + dataptr[3] = (ndataptr[3] * coeff) >> (CONST_BITS-2); + dataptr[4] = (ndataptr[4] * coeff) >> (CONST_BITS-2); + dataptr[5] = (ndataptr[5] * coeff) >> (CONST_BITS-2); + dataptr[6] = (ndataptr[6] * coeff) >> (CONST_BITS-2); + dataptr[7] = (ndataptr[7] * coeff) >> (CONST_BITS-2); + dataptr[8] = (ndataptr[8] * coeff) >> (CONST_BITS-2); + dataptr[9] = (ndataptr[9] * coeff) >> (CONST_BITS-2); + dataptr[10] = (ndataptr[10] * coeff) >> (CONST_BITS-2); + dataptr[11] = (ndataptr[11] * coeff) >> (CONST_BITS-2); + dataptr[12] = (ndataptr[12] * coeff) >> (CONST_BITS-2); + dataptr[13] = (ndataptr[13] * coeff) >> (CONST_BITS-2); + dataptr[14] = (ndataptr[14] * coeff) >> (CONST_BITS-2); + dataptr[15] = (ndataptr[15] * coeff) >> (CONST_BITS-2); + dataptr += 16; + ndataptr += 16; + } + return; +} + + +void +j_rev_dct (DCTBLOCK data) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + INT32 d0, d1, d2, d3, d4, d5, d6, d7; + register DCTELEM *dataptr; + int rowctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + + for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any row in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * row DCT calculations can be simplified this way. + */ + + register int *idataptr = (int*)dataptr; + d0 = dataptr[0]; + d1 = dataptr[1]; + if ((d1 == 0) && (idataptr[1] | idataptr[2] | idataptr[3]) == 0) { + /* AC terms all zero */ + if (d0) { + /* Compute a 32 bit value to assign. */ + DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS); + register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); + + idataptr[0] = v; + idataptr[1] = v; + idataptr[2] = v; + idataptr[3] = v; + } + + dataptr += DCTSIZE; /* advance pointer to next row */ + continue; + } + d2 = dataptr[2]; + d3 = dataptr[3]; + d4 = dataptr[4]; + d5 = dataptr[5]; + d6 = dataptr[6]; + d7 = dataptr[7]; + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + if (d6) { + if (d4) { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, -FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } + } else { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } + } + } else { + if (d4) { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ + tmp10 = tmp13 = (d0 + d4) << CONST_BITS; + tmp11 = tmp12 = (d0 - d4) << CONST_BITS; + } else { + /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */ + tmp10 = tmp13 = d4 << CONST_BITS; + tmp11 = tmp12 = -tmp10; + } + } + } else { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */ + tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS; + } else { + /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */ + tmp10 = tmp13 = tmp11 = tmp12 = 0; + } + } + } + } + + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + if (d7) { + if (d5) { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */ + z1 = d7 + d1; + z2 = d5 + d3; + z3 = d7 + d3; + z4 = d5 + d1; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */ + z1 = d7; + z2 = d5 + d3; + z3 = d7 + d3; + z5 = MULTIPLY(z3 + d5, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 = z1 + z4; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */ + z1 = d7 + d1; + z2 = d5; + z3 = d7; + z4 = d5 + d1; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 = z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */ + tmp0 = MULTIPLY(d7, - FIX(0.601344887)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + tmp1 = MULTIPLY(d5, - FIX(0.509795578)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + z5 = MULTIPLY(d5 + d7, FIX(1.175875602)); + + z3 += z5; + z4 += z5; + + tmp0 += z3; + tmp1 += z4; + tmp2 = z2 + z3; + tmp3 = z1 + z4; + } + } + } else { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */ + z1 = d7 + d1; + z3 = d7 + d3; + z5 = MULTIPLY(z3 + d1, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(d3, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(d1, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 = z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */ + z3 = d7 + d3; + + tmp0 = MULTIPLY(d7, - FIX(0.601344887)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + tmp2 = MULTIPLY(d3, FIX(0.509795579)); + z2 = MULTIPLY(d3, - FIX(2.562915447)); + z5 = MULTIPLY(z3, FIX(1.175875602)); + z3 = MULTIPLY(z3, - FIX(0.785694958)); + + tmp0 += z3; + tmp1 = z2 + z5; + tmp2 += z3; + tmp3 = z1 + z5; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */ + z1 = d7 + d1; + z5 = MULTIPLY(z1, FIX(1.175875602)); + + z1 = MULTIPLY(z1, FIX(0.275899379)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + tmp0 = MULTIPLY(d7, - FIX(1.662939224)); + z4 = MULTIPLY(d1, - FIX(0.390180644)); + tmp3 = MULTIPLY(d1, FIX(1.111140466)); + + tmp0 += z1; + tmp1 = z4 + z5; + tmp2 = z3 + z5; + tmp3 += z1; + } else { + /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */ + tmp0 = MULTIPLY(d7, - FIX(1.387039845)); + tmp1 = MULTIPLY(d7, FIX(1.175875602)); + tmp2 = MULTIPLY(d7, - FIX(0.785694958)); + tmp3 = MULTIPLY(d7, FIX(0.275899379)); + } + } + } + } else { + if (d5) { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */ + z2 = d5 + d3; + z4 = d5 + d1; + z5 = MULTIPLY(d3 + z4, FIX(1.175875602)); + + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(d1, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(d3, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 = z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */ + z2 = d5 + d3; + + z5 = MULTIPLY(z2, FIX(1.175875602)); + tmp1 = MULTIPLY(d5, FIX(1.662939225)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + z2 = MULTIPLY(z2, - FIX(1.387039845)); + tmp2 = MULTIPLY(d3, FIX(1.111140466)); + z3 = MULTIPLY(d3, - FIX(1.961570560)); + + tmp0 = z3 + z5; + tmp1 += z2; + tmp2 += z2; + tmp3 = z4 + z5; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */ + z4 = d5 + d1; + + z5 = MULTIPLY(z4, FIX(1.175875602)); + z1 = MULTIPLY(d1, - FIX(0.899976223)); + tmp3 = MULTIPLY(d1, FIX(0.601344887)); + tmp1 = MULTIPLY(d5, - FIX(0.509795578)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z4 = MULTIPLY(z4, FIX(0.785694958)); + + tmp0 = z1 + z5; + tmp1 += z4; + tmp2 = z2 + z5; + tmp3 += z4; + } else { + /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */ + tmp0 = MULTIPLY(d5, FIX(1.175875602)); + tmp1 = MULTIPLY(d5, FIX(0.275899380)); + tmp2 = MULTIPLY(d5, - FIX(1.387039845)); + tmp3 = MULTIPLY(d5, FIX(0.785694958)); + } + } + } else { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */ + z5 = d1 + d3; + tmp3 = MULTIPLY(d1, FIX(0.211164243)); + tmp2 = MULTIPLY(d3, - FIX(1.451774981)); + z1 = MULTIPLY(d1, FIX(1.061594337)); + z2 = MULTIPLY(d3, - FIX(2.172734803)); + z4 = MULTIPLY(z5, FIX(0.785694958)); + z5 = MULTIPLY(z5, FIX(1.175875602)); + + tmp0 = z1 - z4; + tmp1 = z2 + z4; + tmp2 += z5; + tmp3 += z5; + } else { + /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */ + tmp0 = MULTIPLY(d3, - FIX(0.785694958)); + tmp1 = MULTIPLY(d3, - FIX(1.387039845)); + tmp2 = MULTIPLY(d3, - FIX(0.275899379)); + tmp3 = MULTIPLY(d3, FIX(1.175875602)); + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */ + tmp0 = MULTIPLY(d1, FIX(0.275899379)); + tmp1 = MULTIPLY(d1, FIX(0.785694958)); + tmp2 = MULTIPLY(d1, FIX(1.175875602)); + tmp3 = MULTIPLY(d1, FIX(1.387039845)); + } else { + /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */ + tmp0 = tmp1 = tmp2 = tmp3 = 0; + } + } + } + } + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + dataptr = data; + for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { + /* Columns of zeroes can be exploited in the same way as we did with rows. + * However, the row calculation has created many nonzero AC terms, so the + * simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + + d0 = dataptr[DCTSIZE*0]; + d1 = dataptr[DCTSIZE*1]; + d2 = dataptr[DCTSIZE*2]; + d3 = dataptr[DCTSIZE*3]; + d4 = dataptr[DCTSIZE*4]; + d5 = dataptr[DCTSIZE*5]; + d6 = dataptr[DCTSIZE*6]; + d7 = dataptr[DCTSIZE*7]; + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + if (d6) { + if (d4) { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 != 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 != 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 != 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 == 0, d4 != 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, -FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } + } else { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 == 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 == 0, d6 != 0 */ + z1 = MULTIPLY(d2 + d6, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(d6, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(d2, FIX(0.765366865)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 == 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 == 0, d4 == 0, d6 != 0 */ + tmp2 = MULTIPLY(d6, - FIX(1.306562965)); + tmp3 = MULTIPLY(d6, FIX(0.541196100)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } + } + } else { + if (d4) { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 != 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = (d0 + d4) << CONST_BITS; + tmp1 = (d0 - d4) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 != 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = d4 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp2 - tmp0; + tmp12 = -(tmp0 + tmp2); + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 != 0, d6 == 0 */ + tmp10 = tmp13 = (d0 + d4) << CONST_BITS; + tmp11 = tmp12 = (d0 - d4) << CONST_BITS; + } else { + /* d0 == 0, d2 == 0, d4 != 0, d6 == 0 */ + tmp10 = tmp13 = d4 << CONST_BITS; + tmp11 = tmp12 = -tmp10; + } + } + } else { + if (d2) { + if (d0) { + /* d0 != 0, d2 != 0, d4 == 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp0 = d0 << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp0 + tmp2; + tmp12 = tmp0 - tmp2; + } else { + /* d0 == 0, d2 != 0, d4 == 0, d6 == 0 */ + tmp2 = MULTIPLY(d2, FIX(0.541196100)); + tmp3 = MULTIPLY(d2, FIX(1.306562965)); + + tmp10 = tmp3; + tmp13 = -tmp3; + tmp11 = tmp2; + tmp12 = -tmp2; + } + } else { + if (d0) { + /* d0 != 0, d2 == 0, d4 == 0, d6 == 0 */ + tmp10 = tmp13 = tmp11 = tmp12 = d0 << CONST_BITS; + } else { + /* d0 == 0, d2 == 0, d4 == 0, d6 == 0 */ + tmp10 = tmp13 = tmp11 = tmp12 = 0; + } + } + } + } + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + if (d7) { + if (d5) { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 != 0, d7 != 0 */ + z1 = d7 + d1; + z2 = d5 + d3; + z3 = d7 + d3; + z4 = d5 + d1; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 != 0, d7 != 0 */ + z1 = d7; + z2 = d5 + d3; + z3 = d7 + d3; + z5 = MULTIPLY(z3 + d5, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 = z1 + z4; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 != 0, d7 != 0 */ + z1 = d7 + d1; + z2 = d5; + z3 = d7; + z4 = d5 + d1; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 = z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 == 0, d5 != 0, d7 != 0 */ + tmp0 = MULTIPLY(d7, - FIX(0.601344887)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + tmp1 = MULTIPLY(d5, - FIX(0.509795578)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + z5 = MULTIPLY(d5 + d7, FIX(1.175875602)); + + z3 += z5; + z4 += z5; + + tmp0 += z3; + tmp1 += z4; + tmp2 = z2 + z3; + tmp3 = z1 + z4; + } + } + } else { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 == 0, d7 != 0 */ + z1 = d7 + d1; + z3 = d7 + d3; + z5 = MULTIPLY(z3 + d1, FIX(1.175875602)); + + tmp0 = MULTIPLY(d7, FIX(0.298631336)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(z1, - FIX(0.899976223)); + z2 = MULTIPLY(d3, - FIX(2.562915447)); + z3 = MULTIPLY(z3, - FIX(1.961570560)); + z4 = MULTIPLY(d1, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 = z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 == 0, d7 != 0 */ + z3 = d7 + d3; + + tmp0 = MULTIPLY(d7, - FIX(0.601344887)); + z1 = MULTIPLY(d7, - FIX(0.899976223)); + tmp2 = MULTIPLY(d3, FIX(0.509795579)); + z2 = MULTIPLY(d3, - FIX(2.562915447)); + z5 = MULTIPLY(z3, FIX(1.175875602)); + z3 = MULTIPLY(z3, - FIX(0.785694958)); + + tmp0 += z3; + tmp1 = z2 + z5; + tmp2 += z3; + tmp3 = z1 + z5; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 == 0, d7 != 0 */ + z1 = d7 + d1; + z5 = MULTIPLY(z1, FIX(1.175875602)); + + z1 = MULTIPLY(z1, FIX(0.275899379)); + z3 = MULTIPLY(d7, - FIX(1.961570560)); + tmp0 = MULTIPLY(d7, - FIX(1.662939224)); + z4 = MULTIPLY(d1, - FIX(0.390180644)); + tmp3 = MULTIPLY(d1, FIX(1.111140466)); + + tmp0 += z1; + tmp1 = z4 + z5; + tmp2 = z3 + z5; + tmp3 += z1; + } else { + /* d1 == 0, d3 == 0, d5 == 0, d7 != 0 */ + tmp0 = MULTIPLY(d7, - FIX(1.387039845)); + tmp1 = MULTIPLY(d7, FIX(1.175875602)); + tmp2 = MULTIPLY(d7, - FIX(0.785694958)); + tmp3 = MULTIPLY(d7, FIX(0.275899379)); + } + } + } + } else { + if (d5) { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 != 0, d7 == 0 */ + z2 = d5 + d3; + z4 = d5 + d1; + z5 = MULTIPLY(d3 + z4, FIX(1.175875602)); + + tmp1 = MULTIPLY(d5, FIX(2.053119869)); + tmp2 = MULTIPLY(d3, FIX(3.072711026)); + tmp3 = MULTIPLY(d1, FIX(1.501321110)); + z1 = MULTIPLY(d1, - FIX(0.899976223)); + z2 = MULTIPLY(z2, - FIX(2.562915447)); + z3 = MULTIPLY(d3, - FIX(1.961570560)); + z4 = MULTIPLY(z4, - FIX(0.390180644)); + + z3 += z5; + z4 += z5; + + tmp0 = z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + } else { + /* d1 == 0, d3 != 0, d5 != 0, d7 == 0 */ + z2 = d5 + d3; + + z5 = MULTIPLY(z2, FIX(1.175875602)); + tmp1 = MULTIPLY(d5, FIX(1.662939225)); + z4 = MULTIPLY(d5, - FIX(0.390180644)); + z2 = MULTIPLY(z2, - FIX(1.387039845)); + tmp2 = MULTIPLY(d3, FIX(1.111140466)); + z3 = MULTIPLY(d3, - FIX(1.961570560)); + + tmp0 = z3 + z5; + tmp1 += z2; + tmp2 += z2; + tmp3 = z4 + z5; + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 != 0, d7 == 0 */ + z4 = d5 + d1; + + z5 = MULTIPLY(z4, FIX(1.175875602)); + z1 = MULTIPLY(d1, - FIX(0.899976223)); + tmp3 = MULTIPLY(d1, FIX(0.601344887)); + tmp1 = MULTIPLY(d5, - FIX(0.509795578)); + z2 = MULTIPLY(d5, - FIX(2.562915447)); + z4 = MULTIPLY(z4, FIX(0.785694958)); + + tmp0 = z1 + z5; + tmp1 += z4; + tmp2 = z2 + z5; + tmp3 += z4; + } else { + /* d1 == 0, d3 == 0, d5 != 0, d7 == 0 */ + tmp0 = MULTIPLY(d5, FIX(1.175875602)); + tmp1 = MULTIPLY(d5, FIX(0.275899380)); + tmp2 = MULTIPLY(d5, - FIX(1.387039845)); + tmp3 = MULTIPLY(d5, FIX(0.785694958)); + } + } + } else { + if (d3) { + if (d1) { + /* d1 != 0, d3 != 0, d5 == 0, d7 == 0 */ + z5 = d1 + d3; + tmp3 = MULTIPLY(d1, FIX(0.211164243)); + tmp2 = MULTIPLY(d3, - FIX(1.451774981)); + z1 = MULTIPLY(d1, FIX(1.061594337)); + z2 = MULTIPLY(d3, - FIX(2.172734803)); + z4 = MULTIPLY(z5, FIX(0.785694958)); + z5 = MULTIPLY(z5, FIX(1.175875602)); + + tmp0 = z1 - z4; + tmp1 = z2 + z4; + tmp2 += z5; + tmp3 += z5; + } else { + /* d1 == 0, d3 != 0, d5 == 0, d7 == 0 */ + tmp0 = MULTIPLY(d3, - FIX(0.785694958)); + tmp1 = MULTIPLY(d3, - FIX(1.387039845)); + tmp2 = MULTIPLY(d3, - FIX(0.275899379)); + tmp3 = MULTIPLY(d3, FIX(1.175875602)); + } + } else { + if (d1) { + /* d1 != 0, d3 == 0, d5 == 0, d7 == 0 */ + tmp0 = MULTIPLY(d1, FIX(0.275899379)); + tmp1 = MULTIPLY(d1, FIX(0.785694958)); + tmp2 = MULTIPLY(d1, FIX(1.175875602)); + tmp3 = MULTIPLY(d1, FIX(1.387039845)); + } else { + /* d1 == 0, d3 == 0, d5 == 0, d7 == 0 */ + tmp0 = tmp1 = tmp2 = tmp3 = 0; + } + } + } + } + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3); + + dataptr++; /* advance pointer to next column */ + } +} + +#else + + +void +j_rev_dct_sparse (DCTBLOCK data, int pos) +{ + j_rev_dct(data); +} + +void +j_rev_dct (DCTBLOCK data) +{ + INT32 tmp0, tmp1, tmp2, tmp3; + INT32 tmp10, tmp11, tmp12, tmp13; + INT32 z1, z2, z3, z4, z5; + register DCTELEM *dataptr; + int rowctr; + SHIFT_TEMPS + + /* Pass 1: process rows. */ + /* Note results are scaled up by sqrt(8) compared to a true IDCT; */ + /* furthermore, we scale the results by 2**PASS1_BITS. */ + + dataptr = data; + for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { + /* Due to quantization, we will usually find that many of the input + * coefficients are zero, especially the AC terms. We can exploit this + * by short-circuiting the IDCT calculation for any row in which all + * the AC terms are zero. In that case each output is equal to the + * DC coefficient (with scale factor as needed). + * With typical images and quantization tables, half or more of the + * row DCT calculations can be simplified this way. + */ + + if ((dataptr[1] | dataptr[2] | dataptr[3] | dataptr[4] | + dataptr[5] | dataptr[6] | dataptr[7]) == 0) { + /* AC terms all zero */ + DCTELEM dcval = (DCTELEM) (dataptr[0] << PASS1_BITS); + + dataptr[0] = dcval; + dataptr[1] = dcval; + dataptr[2] = dcval; + dataptr[3] = dcval; + dataptr[4] = dcval; + dataptr[5] = dcval; + dataptr[6] = dcval; + dataptr[7] = dcval; + + dataptr += DCTSIZE; /* advance pointer to next row */ + continue; + } + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) dataptr[2]; + z3 = (INT32) dataptr[6]; + + z1 = MULTIPLY(z2 + z3, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(z3, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(z2, FIX(0.765366865)); + + tmp0 = ((INT32) dataptr[0] + (INT32) dataptr[4]) << CONST_BITS; + tmp1 = ((INT32) dataptr[0] - (INT32) dataptr[4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) dataptr[7]; + tmp1 = (INT32) dataptr[5]; + tmp2 = (INT32) dataptr[3]; + tmp3 = (INT32) dataptr[1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX(0.298631336)); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX(2.053119869)); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX(3.072711026)); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX(1.501321110)); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX(0.899976223)); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX(2.562915447)); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX(1.961570560)); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX(0.390180644)); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + + dataptr += DCTSIZE; /* advance pointer to next row */ + } + + /* Pass 2: process columns. */ + /* Note that we must descale the results by a factor of 8 == 2**3, */ + /* and also undo the PASS1_BITS scaling. */ + + dataptr = data; + for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--) { + /* Columns of zeroes can be exploited in the same way as we did with rows. + * However, the row calculation has created many nonzero AC terms, so the + * simplification applies less often (typically 5% to 10% of the time). + * On machines with very fast multiplication, it's possible that the + * test takes more time than it's worth. In that case this section + * may be commented out. + */ + +#ifndef NO_ZERO_COLUMN_TEST + if ((dataptr[DCTSIZE*1] | dataptr[DCTSIZE*2] | dataptr[DCTSIZE*3] | + dataptr[DCTSIZE*4] | dataptr[DCTSIZE*5] | dataptr[DCTSIZE*6] | + dataptr[DCTSIZE*7]) == 0) { + /* AC terms all zero */ + DCTELEM dcval = (DCTELEM) DESCALE((INT32) dataptr[0], PASS1_BITS+3); + + dataptr[DCTSIZE*0] = dcval; + dataptr[DCTSIZE*1] = dcval; + dataptr[DCTSIZE*2] = dcval; + dataptr[DCTSIZE*3] = dcval; + dataptr[DCTSIZE*4] = dcval; + dataptr[DCTSIZE*5] = dcval; + dataptr[DCTSIZE*6] = dcval; + dataptr[DCTSIZE*7] = dcval; + + dataptr++; /* advance pointer to next column */ + continue; + } +#endif + + /* Even part: reverse the even part of the forward DCT. */ + /* The rotator is sqrt(2)*c(-6). */ + + z2 = (INT32) dataptr[DCTSIZE*2]; + z3 = (INT32) dataptr[DCTSIZE*6]; + + z1 = MULTIPLY(z2 + z3, FIX(0.541196100)); + tmp2 = z1 + MULTIPLY(z3, - FIX(1.847759065)); + tmp3 = z1 + MULTIPLY(z2, FIX(0.765366865)); + + tmp0 = ((INT32) dataptr[DCTSIZE*0] + (INT32) dataptr[DCTSIZE*4]) << CONST_BITS; + tmp1 = ((INT32) dataptr[DCTSIZE*0] - (INT32) dataptr[DCTSIZE*4]) << CONST_BITS; + + tmp10 = tmp0 + tmp3; + tmp13 = tmp0 - tmp3; + tmp11 = tmp1 + tmp2; + tmp12 = tmp1 - tmp2; + + /* Odd part per figure 8; the matrix is unitary and hence its + * transpose is its inverse. i0..i3 are y7,y5,y3,y1 respectively. + */ + + tmp0 = (INT32) dataptr[DCTSIZE*7]; + tmp1 = (INT32) dataptr[DCTSIZE*5]; + tmp2 = (INT32) dataptr[DCTSIZE*3]; + tmp3 = (INT32) dataptr[DCTSIZE*1]; + + z1 = tmp0 + tmp3; + z2 = tmp1 + tmp2; + z3 = tmp0 + tmp2; + z4 = tmp1 + tmp3; + z5 = MULTIPLY(z3 + z4, FIX(1.175875602)); /* sqrt(2) * c3 */ + + tmp0 = MULTIPLY(tmp0, FIX(0.298631336)); /* sqrt(2) * (-c1+c3+c5-c7) */ + tmp1 = MULTIPLY(tmp1, FIX(2.053119869)); /* sqrt(2) * ( c1+c3-c5+c7) */ + tmp2 = MULTIPLY(tmp2, FIX(3.072711026)); /* sqrt(2) * ( c1+c3+c5-c7) */ + tmp3 = MULTIPLY(tmp3, FIX(1.501321110)); /* sqrt(2) * ( c1+c3-c5-c7) */ + z1 = MULTIPLY(z1, - FIX(0.899976223)); /* sqrt(2) * (c7-c3) */ + z2 = MULTIPLY(z2, - FIX(2.562915447)); /* sqrt(2) * (-c1-c3) */ + z3 = MULTIPLY(z3, - FIX(1.961570560)); /* sqrt(2) * (-c3-c5) */ + z4 = MULTIPLY(z4, - FIX(0.390180644)); /* sqrt(2) * (c5-c3) */ + + z3 += z5; + z4 += z5; + + tmp0 += z1 + z3; + tmp1 += z2 + z4; + tmp2 += z2 + z3; + tmp3 += z1 + z4; + + /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ + + dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0, + CONST_BITS+PASS1_BITS+3); + dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0, + CONST_BITS+PASS1_BITS+3); + + dataptr++; /* advance pointer to next column */ + } +} + + +#endif diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mb_ordered.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mb_ordered.cpp new file mode 100644 index 00000000000..edff6f4990c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mb_ordered.cpp @@ -0,0 +1,517 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to implement an ordered dither. */ + +#include "ace/OS.h" +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, mb_ordered, "$Id$") + +#define DITH_SIZE 16 + + +/* Structures used to implement macroblock ordered + dither algorithm. +*/ + +static unsigned char ***ditherPtr[DITH_SIZE]; + + +/* + *-------------------------------------------------------------- + * + * InitMBOrderedDither-- + * + * Structures intialized for ordered dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitMBOrderedDither() +{ + unsigned char ****pos_2_cb; + unsigned char ***cb_2_cr; + unsigned char **cr_2_l; + int cb_val, cb_rval, cr_val, cr_rval, l_val, l_rval; + int i, j, pos; + int err_range, threshval; + + pos_2_cb = (unsigned char ****) ACE_OS::malloc (DITH_SIZE*sizeof(unsigned char ***)); + cb_2_cr = (unsigned char ***) ACE_OS::malloc(CB_RANGE*sizeof(unsigned char **)); + cr_2_l = (unsigned char **) ACE_OS::malloc(CR_RANGE*sizeof(unsigned char *)); + + for (pos=0; pos<DITH_SIZE; pos++) { + + pos_2_cb[pos] = (unsigned char ***) ACE_OS::malloc(256*(sizeof(unsigned char **))); + + for (j=0; j<CB_RANGE; j++) { + cb_2_cr[j] = (unsigned char **) ACE_OS::malloc(256*(sizeof(unsigned char *))); + } + + for (cb_val=0; cb_val<cb_values[0]; cb_val++) { + (pos_2_cb[pos])[cb_val] = cb_2_cr[0]; + } + + for (cb_rval=0; cb_rval<(CB_RANGE-1); cb_rval++) { + err_range = cb_values[cb_rval+1] - cb_values[cb_rval]; + threshval = ((pos*err_range)/DITH_SIZE)+cb_values[cb_rval]; + + for (cb_val=cb_values[cb_rval]; cb_val<cb_values[cb_rval+1]; cb_val++) { + if (cb_val>threshval) (pos_2_cb[pos])[cb_val] = cb_2_cr[cb_rval+1]; + else (pos_2_cb[pos])[cb_val] = cb_2_cr[cb_rval]; + } + } + + for (cb_val=cb_values[CB_RANGE-1]; cb_val<256; cb_val++) { + (pos_2_cb[pos])[cb_val] = cb_2_cr[CB_RANGE-1]; + } + + for (cb_rval=0; cb_rval<CB_RANGE; cb_rval++) { + + for (j=0; j<CR_RANGE; j++) { + cr_2_l[j] = (unsigned char *) ACE_OS::malloc(256*(sizeof(unsigned char))); + } + + for (cr_val=0; cr_val < cr_values[0]; cr_val++) { + (cb_2_cr[cb_rval])[cr_val] = cr_2_l[0]; + } + + for (cr_rval=0; cr_rval<(CR_RANGE-1); cr_rval++) { + err_range = cr_values[cr_rval+1] - cr_values[cr_rval]; + threshval = ((pos*err_range)/DITH_SIZE)+cr_values[cr_rval]; + + for (cr_val=cr_values[cr_rval]; cr_val<cr_values[cr_rval+1]; cr_val++) { + if (cr_val>threshval) (cb_2_cr[cb_rval])[cr_val] = cr_2_l[cr_rval+1]; + else (cb_2_cr[cb_rval])[cr_val] = cr_2_l[cr_rval]; + } + } + + for (cr_val=cr_values[CR_RANGE-1]; cr_val<256; cr_val++) { + (cb_2_cr[cb_rval])[cr_val] = cr_2_l[CR_RANGE-1]; + } + + for (cr_rval=0; cr_rval<CR_RANGE; cr_rval++) { + + for (l_val = 0; l_val < lum_values[0]; l_val++) { + (cr_2_l[cr_rval])[l_val] = pixel[cb_rval+(cr_rval*CB_RANGE)+ + (0*CR_RANGE*CB_RANGE)]; + } + + for (l_rval=0; l_rval<(LUM_RANGE-1); l_rval++) { + err_range = lum_values[l_rval+1] - lum_values[l_rval]; + threshval = ((pos*err_range) /DITH_SIZE) + lum_values[l_rval]; + + for (l_val = lum_values[l_rval]; l_val < lum_values[l_rval+1]; l_val++) { + if (l_val>threshval) (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+((l_rval+1)*CR_RANGE*CB_RANGE)]; + else (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+(l_rval*CR_RANGE*CB_RANGE)]; + } + } + + for (l_val = lum_values[LUM_RANGE-1]; l_val < 256; l_val++) { + (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+((LUM_RANGE-1)*CR_RANGE*CB_RANGE)]; + } + } + } + } + + for (i=0; i<DITH_SIZE; i++) { + ditherPtr[i] = pos_2_cb[i]; + } +} + + + +/* + *-------------------------------------------------------------- + * + * MBOrderedDitherImage -- + * + * Dithers an image using an ordered dither at macroblock level. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * The channels are dithered based on the standard + * ordered dither pattern for a 4x4 area. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +MBOrderedDitherImage (unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + unsigned char *l, *r, *b, *o1, *o2; + unsigned char *l2; + unsigned char L, R, B; + int i, j, mbaddr, mbwidth; + unsigned char ***dp0 = ditherPtr[0]; + unsigned char ***dp2 = ditherPtr[2]; + unsigned char ***dp4 = ditherPtr[4]; + unsigned char ***dp6 = ditherPtr[6]; + unsigned char ***dp8 = ditherPtr[8]; + unsigned char ***dp10 = ditherPtr[10]; + unsigned char ***dp12 = ditherPtr[12]; + unsigned char ***dp14 = ditherPtr[14]; + unsigned char ***dp1 = ditherPtr[1]; + unsigned char ***dp3 = ditherPtr[3]; + unsigned char ***dp5 = ditherPtr[5]; + unsigned char ***dp7 = ditherPtr[7]; + unsigned char ***dp9 = ditherPtr[9]; + unsigned char ***dp11 = ditherPtr[11]; + unsigned char ***dp13 = ditherPtr[13]; + unsigned char ***dp15 = ditherPtr[15]; + + l = lum; + l2 = lum + w; + r = cr; + b = cb; + o1 = out; + o2 = out+w; + mbwidth = w / 16; + + for (i=0; i<h; i+=4) { + + mbaddr = (i / 16) * mbwidth ; + + for (j=0; j<w; j+=8) { + + if (ditherFlags[mbaddr+(j/16)]) { + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = ((dp0[B])[R])[L]; + L = l[1]; + o1[1] = ((dp8[B])[R])[L]; + L = l2[0]; + o2[0] = ((dp12[B])[R])[L]; + L = l2[1]; + o2[1] = ((dp4[B])[R])[L]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = ((dp2[B])[R])[L]; + L = l[3]; + o1[3] = ((dp10[B])[R])[L]; + L = l2[2]; + o2[2] = ((dp14[B])[R])[L]; + L = l2[3]; + o2[3] = ((dp6[B])[R])[L]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = ((dp0[B])[R])[L]; + L = l[5]; + o1[5] = ((dp8[B])[R])[L]; + L = l2[4]; + o2[4] = ((dp12[B])[R])[L]; + L = l2[5]; + o2[5] = ((dp4[B])[R])[L]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = ((dp2[B])[R])[L]; + L = l[7]; + o1[7] = ((dp10[B])[R])[L]; + L = l2[6]; + o2[6] = ((dp14[B])[R])[L]; + L = l2[7]; + o2[7] = ((dp6[B])[R])[L]; + } + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + + for (j=0; j<w; j+=8) { + + if (ditherFlags[mbaddr+(j/16)]) { + + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = ((dp3[B])[R])[L]; + L = l[1]; + o1[1] = ((dp11[B])[R])[L]; + L = l2[0]; + o2[0] = ((dp15[B])[R])[L]; + L = l2[1]; + o2[1] = ((dp7[B])[R])[L]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = ((dp1[B])[R])[L]; + L = l[3]; + o1[3] = ((dp9[B])[R])[L]; + L = l2[2]; + o2[2] = ((dp13[B])[R])[L]; + L = l2[3]; + o2[3] = ((dp5[B])[R])[L]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = ((dp3[B])[R])[L]; + L = l[5]; + o1[5] = ((dp11[B])[R])[L]; + L = l2[4]; + o2[4] = ((dp15[B])[R])[L]; + L = l2[5]; + o2[5] = ((dp7[B])[R])[L]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = ((dp1[B])[R])[L]; + L = l[7]; + o1[7] = ((dp9[B])[R])[L]; + L = l2[6]; + o2[6] = ((dp13[B])[R])[L]; + L = l2[7]; + o2[7] = ((dp5[B])[R])[L]; + } + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + } +} + +void +MBOrderedDitherDisplayCopy(VidStream *vid_stream, int mb_addr, + int motion_forw, int r_right_forw, int r_down_forw, + int motion_back, int r_right_back, int r_down_back, + unsigned char *past, unsigned char *future) +{ + int right_back, right_forw, down_back, down_forw; + unsigned char *dest = NULL; + unsigned char *src1, *src2; + int row, col, row_size, rr; + int mc, mr; + + row = (mb_addr / vid_stream->mb_width) << 4; + col = (mb_addr % vid_stream->mb_width) << 4; + row_size = vid_stream->mb_width << 4; +/* + dest = vid_stream->current->display + (row * row_size) + col; +*/ + if (motion_forw) { + right_forw = r_right_forw >> 1; + down_forw = r_down_forw >> 1; + src1 = past + ((row + down_forw) * row_size) + (col + right_forw); + } + + if (motion_back) { + right_back = r_right_back >> 1; + down_back = r_down_back >> 1; + src2 = future + ((row + down_back) * row_size) + (col + right_back); + } + + if (motion_forw) { + if (motion_back) { + for (rr = 0; rr<16; rr++) { + dest[0] = src1[0]; dest[1] = src2[1]; + dest[2] = src1[2]; dest[3] = src2[3]; + dest[4] = src1[4]; dest[5] = src2[5]; + dest[6] = src1[6]; dest[7] = src2[7]; + dest[8] = src1[8]; dest[9] = src2[9]; + dest[10] = src1[10]; dest[11] = src2[11]; + dest[12] = src1[12]; dest[13] = src2[13]; + dest[14] = src1[14]; dest[15] = src2[15]; + + dest += row_size; + src1 += row_size; + src2 += row_size; + } + } + else { + mc = col & 0x3; + mr = right_forw & 0x3; + if (!mc && !mr) { + /* Use 32 bit copy */ + int *d, *s; + + d = (int *) dest; + s = (int *) src1; + row_size /= 4; + + for (rr = 0; rr < 16; rr++) { + d[0] = s[0]; + d[1] = s[1]; + d[2] = s[2]; + d[3] = s[3]; + d += row_size; + s += row_size; + } + } else if ((!mc || (mc == 2)) && + (!mr || (mr == 2))) { + /* Use 16 bit copy */ + short int *d, * s; + + d = (short int *) dest; + s = (short int *) src1; + row_size /= 2; + + for (rr = 0; rr < 16; rr++) { + d[0] = s[0]; + d[1] = s[1]; + d[2] = s[2]; + d[3] = s[3]; + d[4] = s[4]; + d[5] = s[5]; + d[6] = s[6]; + d[7] = s[7]; + d += row_size; + s += row_size; + } + } + else { + for (rr = 0; rr < 16; rr++) { + dest[0] = src1[0]; + dest[1] = src1[1]; + dest[2] = src1[2]; + dest[3] = src1[3]; + dest[4] = src1[4]; + dest[5] = src1[5]; + dest[6] = src1[6]; + dest[7] = src1[7]; + dest[8] = src1[8]; + dest[9] = src1[9]; + dest[10] = src1[10]; + dest[11] = src1[11]; + dest[12] = src1[12]; + dest[13] = src1[13]; + dest[14] = src1[14]; + dest[15] = src1[15]; + + dest += row_size; + src1 += row_size; + } + } + } + } + else if (motion_back) { + mc = col & 0x3; + mr = right_back & 0x3; + if (!mc && !mr) { + /* Use 32 bit copy */ + int *d, *s; + + d = (int *) dest; + s = (int *) src2; + row_size /= 4; + + for (rr = 0; rr < 16; rr++) { + d[0] = s[0]; + d[1] = s[1]; + d[2] = s[2]; + d[3] = s[3]; + d += row_size; + s += row_size; + } + } + else if ((!mc || mc == 2) && + (!mr || mr == 2)) { + /* Use 8 bit copy */ + short int *d, *s; + + d = (short int *) dest; + s = (short int *) src2; + row_size /= 2; + + for (rr = 0; rr < 16; rr++) { + d[0] = s[0]; + d[1] = s[1]; + d[2] = s[2]; + d[3] = s[3]; + d[4] = s[4]; + d[5] = s[5]; + d[6] = s[6]; + d[7] = s[7]; + d += row_size; + s += row_size; + } + } + else { + for (rr = 0; rr < 16; rr++) { + /* Use 8 bit copy */ + dest[0] = src2[0]; + dest[1] = src2[1]; + dest[2] = src2[2]; + dest[3] = src2[3]; + dest[4] = src2[4]; + dest[5] = src2[5]; + dest[6] = src2[6]; + dest[7] = src2[7]; + dest[8] = src2[8]; + dest[9] = src2[9]; + dest[10] = src2[10]; + dest[11] = src2[11]; + dest[12] = src2[12]; + dest[13] = src2[13]; + dest[14] = src2[14]; + dest[15] = src2[15]; + + dest += row_size; + src2 += row_size; + } + } + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mibload.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mibload.h new file mode 100644 index 00000000000..085d1802ce0 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mibload.h @@ -0,0 +1,155 @@ +/* $Id$ */ +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with this file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include <stdio.h> +#include <X11/Intrinsic.h> +#include <X11/Shell.h> +#include <Xm/Xm.h> +#include <Xm/Text.h> +#include <Xm/TextF.h> +#include <Xm/RowColumn.h> +#include <Xm/MainW.h> +#include <Xm/Label.h> +#include <Xm/PushB.h> +#include <Xm/PushBG.h> +#include <Xm/ToggleB.h> +#include <Xm/ToggleBG.h> +#include <Xm/DrawingA.h> +#include <Xm/CascadeBG.h> +#include <Xm/SeparatoG.h> +#include <Xm/Frame.h> +#include <Xm/BulletinB.h> +#include <Xm/Scale.h> +#include <Xm/ScrollBar.h> +#include <Xm/Form.h> +#include <Xm/List.h> +#include <Xm/FileSB.h> +#include <Xm/AtomMgr.h> +#include <Xm/Protocols.h> +#include <Xm/MwmUtil.h> + + +/* Structure of mib_Widget */ +/*****************************************************************************/ + +typedef struct _mib_Widget { + char *mib_class; /* name of mib class (Button, TextBox, etc..)*/ + int mib_class_num; /* class number for ez reference :) */ + int mib_mynum; /* numbering for storage format */ + Widget me; /* Xt widget */ + int mib_selected; /* is selected */ + int mib_resizing; /* is resizing 1, or being moved 0 */ + int mib_resizetype;/* 1 = upper left, 2 = upper, 3 = ... */ + int mib_allowresize; /* can this widget be resized ? */ + + int clkx, clky; /* where user clicked */ + + void *myres; /* my resources (different for each widget) */ + + char *name; /* reference name of this widget */ + int width, height; /* width and height */ + + int topAttachment, bottomAttachment, leftAttachment, rightAttachment; + /* attachments 1=attached 0=not-attached */ + + int topOffset, bottomOffset, leftOffset, rightOffset; + /* offsets if attached */ + + struct _mib_Widget *parent; /* pointer to parent */ + struct _mib_Widget *sibling; /* remaining linked list of sibling widgets */ + struct _mib_Widget *prev; /* previous sibling or parent */ + struct _mib_Widget *child; /* linked list of children widgets */ +} mib_Widget; + +/* mib_Buffer structure */ +/*****************************************************************************/ + +typedef struct _mib_Buffer { + void *buffer; /* pointer to either a file or a char string */ + int buf_type; /* type of buffer (defined above) */ + int point; /* pointer for string */ + int buflen; /* length of string buffer */ +} mib_Buffer; + +/* mib_Widget functions */ +/*****************************************************************************/ + +void mib_add_mib_Widget(mib_Widget *, mib_Widget *); +void mib_add_backward_Widget(mib_Widget *, mib_Widget *); +void mib_remove_mib_Widget(mib_Widget *); +void mib_clear_myres(mib_Widget *); +mib_Widget *mib_new_mib_Widget(); +mib_Widget *mib_find_name(mib_Widget *, char *); +mib_Widget *mib_load_interface(Widget, char *, int); +int mib_count_all(mib_Widget *, int); +int mib_load_Root(Widget, mib_Widget **, mib_Buffer *); +mib_Widget *mib_load_public(mib_Widget *, mib_Widget *, mib_Buffer *); +int mib_load_mib_class(mib_Widget **, mib_Widget *, char *, char *, + mib_Buffer *); +int mib_load_private(mib_Widget *, mib_Buffer *); +void mib_reset_size(mib_Widget *); +int mib_read_line(mib_Buffer *, char *, char *); +void mib_set_eventhandlers(void *, void *, void *); +void mib_apply_eventhandlers(Widget, mib_Widget *); + +/* supporting functions and structures */ +/*****************************************************************************/ + +typedef struct _menu_item { + char *label; + WidgetClass *class; + char mnemonic; + char *accelerator; + char *accel_text; + void (*callback)(); + XtPointer callback_data; + struct _menu_item *subitems; +} MenuItem; + +Widget BuildMenu(Widget, int, char *, char, MenuItem *); + +/* mib class numbers */ + +#define MIB_NULL 0 +#define MIB_TEXTBOX 1 +#define MIB_BUTTON 2 +#define MIB_TOGGLE 3 +#define MIB_RADIOBOX 4 +#define MIB_DRAWINGAREA 5 +#define MIB_LABEL 6 +#define MIB_FRAME 7 +#define MIB_SCROLLBAR 8 +#define MIB_TEXTBIG 9 +#define MIB_LIST 10 +#define MIB_SCALE 11 +#define MIB_MENU 12 + +/* number of classes */ +#define MI_NUMCLASSES 12 + +/* for specifying creation of a widget with + default private values, no values at all (empty), + or no values and editable */ + +#define WDEFAULT 1 +#define WEMPTY 2 +#define WEDIT 3 + +/* for specifing whether we are loading an + interface from a file or from a string and whether it + is editable :) */ + +#define MI_FROMFILE 1 +#define MI_EDITFROMFILE 2 +#define MI_FROMSTRING 3 +#define MI_EDITFROMSTRING 4 + +#define MI_MAXSTRLEN 200 /* maximum string length */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mono.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mono.cpp new file mode 100644 index 00000000000..ba9c6485c22 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/mono.cpp @@ -0,0 +1,258 @@ +/* $Id$ */ + +/* + * Author: Yoichiro Ueno (ueno@cs.titech.ac.jp) + * + * Copyright (C) 1991, 1992, Yoichiro Ueno. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose is hereby granted by the Author without + * fee, provided that the above copyright notice appear in all copies and + * that both the copyright notice and this permission notice appear in + * supporting documentation, and that the name of the Author not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. The Author makes no + * representations about the suitability of this software for any purpose. + * It is provided "as is" without express or implied warranty. + * + * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "ace/OS.h" +#include <string.h> +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, mono, "$Id$") + +/* + *-------------------------------------------------------------- + * + * MonoDitherImage -- + * + * Dithers image into monochrome. + * Dither algorithm is based on dither.c in xli.1.11. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +#define MaxGrey 65280 +#define Threshold (MaxGrey/2) +#define MinGrey 0 + +#if ultrix && mips +# define SEED_BIT 0x01 +# define OPP_SEED_BIT 0x80 +# define SHIFT_SEED_BIT(b) (b <<= 1) +# define OPP_SHIFT_SEED_BIT(b) (b >>= 1) +#else +# define SEED_BIT 0x80 +# define OPP_SEED_BIT 0x01 +# define SHIFT_SEED_BIT(b) (b >>= 1) +# define OPP_SHIFT_SEED_BIT(b) (b <<= 1) +#endif + +static int *curr = NULL; +static int *next = NULL; + +#if 0 +void +MonoDitherImage(register unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + int bit_r2l; + register unsigned int bit; + register unsigned int data; + int i; + register int j; + int *swap; + register int out_err; + register int next1; + register int next2; + + if(curr == NULL) { + curr = (int *)ACE_OS::malloc(sizeof(int) * (w + 2)); + curr += 1; + } + if(next == NULL) { + next = (int *)ACE_OS::malloc(sizeof(int) * (w + 2)); + next += 1; + } + + bzero ((char *)curr, w * sizeof(*curr)); + + bit_r2l = SEED_BIT << (w - 1 & 7); + for(i = 0; i < h; i ++) { + if(i & 0x01) { /* Right to Left */ + bit = bit_r2l; + data = 0; + out_err = curr[w-1]; + next1 = 0; + next2 = 0; + for (j=(w-1); j>=0; j--) + { + out_err = (out_err >> 4) + (lum[j] << 8); + if(out_err > Threshold) { + data |= bit; + out_err -= MaxGrey; + } + else + out_err -= MinGrey; + + next[j+1] = next1 + (out_err * 3); + next1 = next2 + (out_err * 5); + next2 = (out_err * 1); + out_err = curr[j-1] + (out_err * 7); + + OPP_SHIFT_SEED_BIT(bit); +#if ultrix && mips + if(bit == 0) +#else + if(bit > 0x80) +#endif + { + out[j >> 3] = data; + bit = OPP_SEED_BIT; + data = 0; + } + } + next[0] = next1; + } + else { /* Left to Right */ + bit = SEED_BIT; + data = 0; + out_err = curr[0]; + next1 = 0; + next2 = 0; + for (j=0; j<w; j++) + { + out_err = (out_err >> 4) + (lum[j] << 8); + if(out_err > Threshold) { + data |= bit; + out_err = out_err - MaxGrey; + } + else + out_err = out_err - MinGrey; + + next[j-1] = next1 + (out_err * 3); + next1 = next2 + (out_err * 5); + next2 = (out_err * 1); + out_err = curr[j+1] + (out_err * 7); + + SHIFT_SEED_BIT(bit); +#if ultrix && mips + if(bit > 0x80) +#else + if(bit == 0) +#endif + { + out[j >> 3] = data; + bit = SEED_BIT; + data = 0; + } + } + next[w-1] = next1; + } + + lum += w; + out += w >> 3; + swap = curr; + curr = next; + next = swap; + } +} +#endif + +void +MonoDitherImage(register unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + ACE_UNUSED_ARG(cr); ACE_UNUSED_ARG(cb); + register unsigned int bit; + register unsigned int data; + register int j; + int i; + static unsigned char d[4][4] = {{0, 8, 2, 10}, + {12, 4, 14, 6}, + {3, 11, 1, 9}, + {15, 7, 13, 5}}; + + for(i = 0; i < h; i ++) { + bit = SEED_BIT; + data = 0; + for (j=0; j<w; j++) { + if((lum[j] >> 4) > d[i % 4][j % 4]) { + data |= bit; + } + SHIFT_SEED_BIT(bit); +#if ultrix && mips + if(bit > 0x80) +#else + if(bit == 0) +#endif + { + out[j >> 3] = data; + bit = SEED_BIT; + data = 0; + } + } + lum += w; + out += (w + 7) >> 3; + } +} + + +/* + *-------------------------------------------------------------- + * + * MonoThresholdImage -- + * + * convert image into monochrome with threshold. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +MonoThresholdImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + ACE_UNUSED_ARG(cr); ACE_UNUSED_ARG(cb); + unsigned char bit; + unsigned char data; + + bit = SEED_BIT; + data = 0; + for (w*=h; w>0; w--) { + if(*lum++>128) + data |= bit; + + SHIFT_SEED_BIT(bit); + if(bit == 0) { + *out ++ = data; + bit = SEED_BIT; + data = 0; + } + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/motionvector.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/motionvector.cpp new file mode 100644 index 00000000000..3b95e694cdc --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/motionvector.cpp @@ -0,0 +1,197 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include "video.h" +#include "proto.h" +#include "util.h" + +ACE_RCSID(mpeg_client, motionvector, "$Id$") + + +/* + *-------------------------------------------------------------- + * + * ComputeVector -- + * + * Computes motion vector given parameters previously parsed + * and reconstructed. + * + * Results: + * Reconstructed motion vector info is put into recon_* parameters + * passed to this function. Also updated previous motion vector + * information. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +#define ComputeVector(recon_right_ptr, recon_down_ptr, recon_right_prev, recon_down_prev, f, full_pel_vector, motion_h_code, motion_v_code, motion_h_r, motion_v_r) \ + \ +{ \ + int comp_h_r, comp_v_r; \ + int right_little, right_big, down_little, down_big; \ + int max, min, new_vector; \ + \ + /* The following procedure for the reconstruction of motion vectors \ + is a direct and simple implementation of the instructions given \ + in the mpeg December 1991 standard draft. \ + */ \ + \ + if (f == 1 || motion_h_code == 0) \ + comp_h_r = 0; \ + else \ + comp_h_r = f - 1 - motion_h_r; \ + \ + if (f == 1 || motion_v_code == 0) \ + comp_v_r = 0; \ + else \ + comp_v_r = f - 1 - motion_v_r; \ + \ + right_little = motion_h_code * f; \ + if (right_little == 0) \ + right_big = 0; \ + else { \ + if (right_little > 0) { \ + right_little = right_little - comp_h_r; \ + right_big = right_little - 32 * f; \ + } \ + else { \ + right_little = right_little + comp_h_r; \ + right_big = right_little + 32 * f; \ + } \ + } \ + \ + down_little = motion_v_code * f; \ + if (down_little == 0) \ + down_big = 0; \ + else { \ + if (down_little > 0) { \ + down_little = down_little - comp_v_r; \ + down_big = down_little - 32 * f; \ + } \ + else { \ + down_little = down_little + comp_v_r; \ + down_big = down_little + 32 * f; \ + } \ + } \ + \ + max = 16 * f - 1; \ + min = -16 * f; \ + \ + new_vector = recon_right_prev + right_little; \ + \ + if (new_vector <= max && new_vector >= min) \ + *recon_right_ptr = recon_right_prev + right_little; \ + /* just new_vector */ \ + else \ + *recon_right_ptr = recon_right_prev + right_big; \ + recon_right_prev = *recon_right_ptr; \ + if (full_pel_vector) \ + *recon_right_ptr = *recon_right_ptr << 1; \ + \ + new_vector = recon_down_prev + down_little; \ + if (new_vector <= max && new_vector >= min) \ + *recon_down_ptr = recon_down_prev + down_little; \ + /* just new_vector */ \ + else \ + *recon_down_ptr = recon_down_prev + down_big; \ + recon_down_prev = *recon_down_ptr; \ + if (full_pel_vector) \ + *recon_down_ptr = *recon_down_ptr << 1; \ +} + +/* + *-------------------------------------------------------------- + * + * ComputeForwVector -- + * + * Computes forward motion vector by calling ComputeVector + * with appropriate parameters. + * + * Results: + * Reconstructed motion vector placed in recon_right_for_ptr and + * recon_down_for_ptr. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +ComputeForwVector(int *recon_right_for_ptr, int *recon_down_for_ptr) +{ + + Pict *picture; + Macroblock *mblock; + + picture = &(curVidStream->picture); + mblock = &(curVidStream->mblock); + + ComputeVector(recon_right_for_ptr, recon_down_for_ptr, + mblock->recon_right_for_prev, + mblock->recon_down_for_prev, + picture->forw_f, picture->full_pel_forw_vector, + mblock->motion_h_forw_code, mblock->motion_v_forw_code, + mblock->motion_h_forw_r, mblock->motion_v_forw_r); +} + + +/* + *-------------------------------------------------------------- + * + * ComputeBackVector -- + * + * Computes backward motion vector by calling ComputeVector + * with appropriate parameters. + * + * Results: + * Reconstructed motion vector placed in recon_right_back_ptr and + * recon_down_back_ptr. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +ComputeBackVector(int *recon_right_back_ptr, int *recon_down_back_ptr) +{ + Pict *picture; + Macroblock *mblock; + + picture = &(curVidStream->picture); + mblock = &(curVidStream->mblock); + + ComputeVector(recon_right_back_ptr, recon_down_back_ptr, + mblock->recon_right_back_prev, + mblock->recon_down_back_prev, + picture->back_f, picture->full_pel_back_vector, + mblock->motion_h_back_code, mblock->motion_v_back_code, + mblock->motion_h_back_r, mblock->motion_v_back_r); + +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/newproto.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/newproto.h new file mode 100644 index 00000000000..9df0e313bbb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/newproto.h @@ -0,0 +1,110 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* ui.c */ +void UIprocess(int cmdSocket); + +#include "mpeg_shared/routine.h" + +/* ctr.c */ +int CTRmain(int argc,char **argv); + +/* ab.c */ +void ABinitBuf(int size); +void ABflushBuf(int nextSample); +int ABcheckSamples(void); /* returns # of samples in ABbuf */ +int ABgetSamples(char * buf, int samples); + /* read at most given number of samples from AB to buf, returns + number of sample actually read */ +int ABskipSamples(int samples); +/* if samples < 0; then stuff |samples| silient samples to ABgetSamples(), + otherwise wipe out this number of samples from AB */ +void ABdeleteBuf(void); +void ABdeleteSem(void); + +void ABprocess(int dataSocket); + +/* vb.c */ +void VBinitBuf(int size); +char * VBgetBuf(int size); /* block version */ +int VBcheckBuf(int size); /* non-block check, return True/False*/ +void VBputMsg(char * msgPtr); +char * VBgetMsg(); /* block version */ +int VBcheckMsg(); /* non-block check, return Number of Msgs in buffer */ +int VBbufEmpty(void); +void VBreclaimMsg(char * msgPtr); +void VBdeleteBuf(void); +void VBdeleteSem(void); + +void VBprocess(int initSocket, int dataSocket); + +/* vd.c */ +void VDprocess(int CTRpid); +void VDinitBuf(int size); +void VDresizeBuf(int height, int width); +FrameBlock * VDgetBuf(void); /* block version, return with interrupt */ +int VDcheckBuf(void); /* non-block check, return True/False */ +void VDputMsg(FrameBlock * msgPtr); +FrameBlock * VDgetMsg(void); /* block version, return with interrupt */ +FrameBlock * VDpeekMsg(void); /* returns a msg for checking only, no modification allowed */ +int VDcheckMsg(void); /* non-block check, return Number of Msg in buffer */ +int VDbufEmpty(void); +void VDreferMsg(FrameBlock * msgPtr); +void VDreclaimMsg(FrameBlock * msgPtr); +void VDdeleteBuf(void); +void VDdeleteSem(void); + +/* vp.c */ + +void VPinitWindow(Widget shell, Window monitorWindow, int cmdSocket); +void VPresizeWindow(int height, int width); + +/* -- in gdith.c -- */ +void VPcommand(int cmd, char * position); +void VPexpose(void); + +/* audio.c */ +int InitAudioDevice(void); +void SetAudioParameter(AudioParameter * para); +unsigned int GetAudioTime(void); +unsigned int PlayAudioSamples(unsigned int time, char * buf, int size); +void StartAudioPlaySession(void); +void SetAudioGain(void); +void AudioInterpolate(char *rawBuf, int len, char * convBuf, int convLen); + +/* prog.c */ + +void StartProgram(char * title, char * vh, char * vf, char * ah, char * af); +Widget CreateProgramWindow(Widget parent, int cmdSoket, int * playflag, Widget frametext); + +/* file.c */ + +void StartLocalServer(void); +Widget CreateFileWindow(Widget parent, int cmdSoket, int * playflag, Widget frametext); + + +/* para.c */ + +Widget CreateParameterWindow(Widget parent); diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered.cpp new file mode 100644 index 00000000000..377077c0f33 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered.cpp @@ -0,0 +1,290 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to implement an ordered dither. */ + +#include "ace/OS.h" +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, ordered, "$Id$") + +#define DITH_SIZE 16 + + +/* Structures used to implement hybrid ordered dither/floyd-steinberg + dither algorithm. +*/ + +static unsigned char *l_darrays[DITH_SIZE]; +static unsigned char *cr_darrays[DITH_SIZE]; +static unsigned char *cb_darrays[DITH_SIZE]; + +/* + *-------------------------------------------------------------- + * + * InitOrderedDither-- + * + * Structures intialized for ordered dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitOrderedDither() +{ + int i, j, k, err_range, threshval; + unsigned char *lmark, *cmark; + + for (i=0; i<DITH_SIZE; i++) { + lmark = l_darrays[i] = (unsigned char *) ACE_OS::malloc(256); + + for (j=0; j<lum_values[0]; j++) { + *lmark++ = 0; + } + + for (j=0; j<(LUM_RANGE-1); j++) { + err_range = lum_values[j+1] - lum_values[j]; + threshval = ((i * err_range) / DITH_SIZE)+lum_values[j]; + + for (k=lum_values[j]; k<lum_values[j+1]; k++) { + if (k > threshval) *lmark++ = ((j+1) * (CR_RANGE * CB_RANGE)); + else *lmark++ = (j * (CR_RANGE * CB_RANGE)); + } + } + + for (j=lum_values[LUM_RANGE-1]; j<256; j++) { + *lmark++ = (LUM_RANGE-1)*(CR_RANGE * CB_RANGE); + } + } + + for (i=0; i<DITH_SIZE; i++) { + cmark = cr_darrays[i] = (unsigned char *) ACE_OS::malloc(256); + + for (j=0; j<cr_values[0]; j++) { + *cmark++ = 0; + } + + for (j=0; j<(CR_RANGE-1); j++) { + err_range = cr_values[j+1] - cr_values[j]; + threshval = ((i * err_range) / DITH_SIZE)+cr_values[j]; + + for (k=cr_values[j]; k<cr_values[j+1]; k++) { + if (k > threshval) *cmark++ = ((j+1) * CB_RANGE); + else *cmark++ = (j * CB_RANGE); + } + } + + for (j=cr_values[CR_RANGE-1]; j<256; j++) { + *cmark++ = (CR_RANGE-1)*(CB_RANGE); + } + } + + for (i=0; i<DITH_SIZE; i++) { + cmark = cb_darrays[i] = (unsigned char *) ACE_OS::malloc(256); + + for (j=0; j<cb_values[0]; j++) { + *cmark++ = 0; + } + + for (j=0; j<(CB_RANGE-1); j++) { + err_range = cb_values[j+1] - cb_values[j]; + threshval = ((i * err_range) / DITH_SIZE)+cb_values[j]; + + for (k=cb_values[j]; k<cb_values[j+1]; k++) { + if (k > threshval) *cmark++ = j+1; + else *cmark++ = j; + } + } + + for (j=cb_values[CB_RANGE-1]; j<256; j++) { + *cmark++ = CB_RANGE-1; + } + } +} + +/* + *-------------------------------------------------------------- + * + * OrderedDitherImage -- + * + * Dithers an image using an ordered dither. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * The channels are dithered based on the standard + * ordered dither pattern for a 4x4 area. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +OrderedDitherImage (unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + unsigned char *l, *r, *b, *o1, *o2; + unsigned char *l2; + unsigned char L, R, B; + int i, j; + + l = lum; + l2 = lum+w; + r = cr; + b = cb; + o1 = out; + o2 = out+w; + + for (i=0; i<h; i+=4) { + + for (j=0; j<w; j+=8) { + + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = pixel[(l_darrays[0][L] + cr_darrays[0][R] + cb_darrays[0][B])]; + L = l[1]; + o1[1] = pixel[(l_darrays[8][L] + cr_darrays[8][R] + cb_darrays[8][B])]; + L = l2[0]; + o2[0] = pixel[(l_darrays[12][L] + cr_darrays[12][R] + cb_darrays[12][B])]; + L = l2[1]; + o2[1] = pixel[(l_darrays[4][L] + cr_darrays[4][R] + cb_darrays[4][B])]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = pixel[(l_darrays[2][L] + cr_darrays[2][R] + cb_darrays[2][B])]; + L = l[3]; + o1[3] = pixel[(l_darrays[10][L] + cr_darrays[10][R] + cb_darrays[10][B])]; + L = l2[2]; + o2[2] = pixel[(l_darrays[14][L] + cr_darrays[14][R] + cb_darrays[14][B])]; + L = l2[3]; + o2[3] = pixel[(l_darrays[6][L] + cr_darrays[6][R] + cb_darrays[6][B])]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = pixel[(l_darrays[0][L] + cr_darrays[0][R] + cb_darrays[0][B])]; + L = l[5]; + o1[5] = pixel[(l_darrays[8][L] + cr_darrays[8][R] + cb_darrays[8][B])]; + L = l2[4]; + o2[4] = pixel[(l_darrays[12][L] + cr_darrays[12][R] + cb_darrays[12][B])]; + L = l2[5]; + o2[5] = pixel[(l_darrays[4][L] + cr_darrays[4][R] + cb_darrays[4][B])]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = pixel[(l_darrays[2][L] + cr_darrays[2][R] + cb_darrays[2][B])]; + L = l[7]; + o1[7] = pixel[(l_darrays[10][L] + cr_darrays[10][R] + cb_darrays[10][B])]; + L = l2[6]; + o2[6] = pixel[(l_darrays[14][L] + cr_darrays[14][R] + cb_darrays[14][B])]; + L = l2[7]; + o2[7] = pixel[(l_darrays[6][L] + cr_darrays[6][R] + cb_darrays[6][B])]; + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + + for (j=0; j<w; j+=8) { + + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = pixel[(l_darrays[3][L] + cr_darrays[3][R] + cb_darrays[3][B])]; + L = l[1]; + o1[1] = pixel[(l_darrays[11][L] + cr_darrays[11][R] + cb_darrays[11][B])]; + L = l2[0]; + o2[0] = pixel[(l_darrays[15][L] + cr_darrays[15][R] + cb_darrays[15][B])]; + L = l2[1]; + o2[1] = pixel[(l_darrays[7][L] + cr_darrays[7][R] + cb_darrays[7][B])]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = pixel[(l_darrays[1][L] + cr_darrays[1][R] + cb_darrays[1][B])]; + L = l[3]; + o1[3] = pixel[(l_darrays[9][L] + cr_darrays[9][R] + cb_darrays[9][B])]; + L = l2[2]; + o2[2] = pixel[(l_darrays[13][L] + cr_darrays[13][R] + cb_darrays[13][B])]; + L = l2[3]; + o2[3] = pixel[(l_darrays[5][L] + cr_darrays[5][R] + cb_darrays[5][B])]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = pixel[(l_darrays[3][L] + cr_darrays[3][R] + cb_darrays[3][B])]; + L = l[5]; + o1[5] = pixel[(l_darrays[11][L] + cr_darrays[11][R] + cb_darrays[11][B])]; + L = l2[4]; + o2[4] = pixel[(l_darrays[15][L] + cr_darrays[15][R] + cb_darrays[15][B])]; + L = l2[5]; + o2[5] = pixel[(l_darrays[7][L] + cr_darrays[7][R] + cb_darrays[7][B])]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = pixel[(l_darrays[1][L] + cr_darrays[1][R] + cb_darrays[1][B])]; + L = l[7]; + o1[7] = pixel[(l_darrays[9][L] + cr_darrays[9][R] + cb_darrays[9][B])]; + L = l2[6]; + o2[6] = pixel[(l_darrays[13][L] + cr_darrays[13][R] + cb_darrays[13][B])]; + L = l2[7]; + o2[7] = pixel[(l_darrays[5][L] + cr_darrays[5][R] + cb_darrays[5][B])]; + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + } +} + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered2.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered2.cpp new file mode 100644 index 00000000000..42d1d808985 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ordered2.cpp @@ -0,0 +1,328 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* This file contains C code to implement an ordered dither. */ + +#include "ace/OS.h" +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "dither.h" + +ACE_RCSID(mpeg_client, ordered2, "$Id$") + +#define DITH_SIZE 16 + + +/* Structures used to implement hybrid ordered dither/floyd-steinberg + dither algorithm. +*/ + +static unsigned char ***ditherPtr[DITH_SIZE]; + + +/* + *-------------------------------------------------------------- + * + * InitOrderedDither-- + * + * Structures intialized for ordered dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitOrdered2Dither() +{ + unsigned char ****pos_2_cb; + unsigned char ***cb_2_cr; + unsigned char **cr_2_l; + int cb_val, cb_rval, cr_val, cr_rval, l_val, l_rval; + int i, j, pos; + int err_range, threshval; + + pos_2_cb = (unsigned char ****) ACE_OS::malloc (DITH_SIZE*sizeof(unsigned char ***)); + cb_2_cr = (unsigned char ***) ACE_OS::malloc(CB_RANGE*sizeof(unsigned char **)); + cr_2_l = (unsigned char **) ACE_OS::malloc(CR_RANGE*sizeof(unsigned char *)); + + for (pos=0; pos<DITH_SIZE; pos++) { + + pos_2_cb[pos] = (unsigned char ***) ACE_OS::malloc(256*(sizeof(unsigned char **))); + + for (j=0; j<CB_RANGE; j++) { + cb_2_cr[j] = (unsigned char **) ACE_OS::malloc(256*(sizeof(unsigned char *))); + } + + for (cb_val=0; cb_val<cb_values[0]; cb_val++) { + (pos_2_cb[pos])[cb_val] = cb_2_cr[0]; + } + + for (cb_rval=0; cb_rval<(CB_RANGE-1); cb_rval++) { + err_range = cb_values[cb_rval+1] - cb_values[cb_rval]; + threshval = ((pos*err_range)/DITH_SIZE)+cb_values[cb_rval]; + + for (cb_val=cb_values[cb_rval]; cb_val<cb_values[cb_rval+1]; cb_val++) { + if (cb_val>threshval) (pos_2_cb[pos])[cb_val] = cb_2_cr[cb_rval+1]; + else (pos_2_cb[pos])[cb_val] = cb_2_cr[cb_rval]; + } + } + + for (cb_val=cb_values[CB_RANGE-1]; cb_val<256; cb_val++) { + (pos_2_cb[pos])[cb_val] = cb_2_cr[CB_RANGE-1]; + } + + for (cb_rval=0; cb_rval<CB_RANGE; cb_rval++) { + + for (j=0; j<CR_RANGE; j++) { + cr_2_l[j] = (unsigned char *) ACE_OS::malloc(256*(sizeof(unsigned char))); + } + + for (cr_val=0; cr_val < cr_values[0]; cr_val++) { + (cb_2_cr[cb_rval])[cr_val] = cr_2_l[0]; + } + + for (cr_rval=0; cr_rval<(CR_RANGE-1); cr_rval++) { + err_range = cr_values[cr_rval+1] - cr_values[cr_rval]; + threshval = ((pos*err_range)/DITH_SIZE)+cr_values[cr_rval]; + + for (cr_val=cr_values[cr_rval]; cr_val<cr_values[cr_rval+1]; cr_val++) { + if (cr_val>threshval) (cb_2_cr[cb_rval])[cr_val] = cr_2_l[cr_rval+1]; + else (cb_2_cr[cb_rval])[cr_val] = cr_2_l[cr_rval]; + } + } + + for (cr_val=cr_values[CR_RANGE-1]; cr_val<256; cr_val++) { + (cb_2_cr[cb_rval])[cr_val] = cr_2_l[CR_RANGE-1]; + } + + for (cr_rval=0; cr_rval<CR_RANGE; cr_rval++) { + + for (l_val = 0; l_val < lum_values[0]; l_val++) { + (cr_2_l[cr_rval])[l_val] = pixel[cb_rval+(cr_rval*CB_RANGE)+ + (0*CR_RANGE*CB_RANGE)]; + } + + for (l_rval=0; l_rval<(LUM_RANGE-1); l_rval++) { + err_range = lum_values[l_rval+1] - lum_values[l_rval]; + threshval = ((pos*err_range) /DITH_SIZE) + lum_values[l_rval]; + + for (l_val = lum_values[l_rval]; l_val < lum_values[l_rval+1]; l_val++) { + if (l_val>threshval) (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+((l_rval+1)*CR_RANGE*CB_RANGE)]; + else (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+(l_rval*CR_RANGE*CB_RANGE)]; + } + } + + for (l_val = lum_values[LUM_RANGE-1]; l_val < 256; l_val++) { + (cr_2_l[cr_rval])[l_val] = + pixel[cb_rval+(cr_rval*CB_RANGE)+((LUM_RANGE-1)*CR_RANGE*CB_RANGE)]; + } + } + } + } + + for (i=0; i<DITH_SIZE; i++) { + ditherPtr[i] = pos_2_cb[i]; + } +} + +/* + *-------------------------------------------------------------- + * + * Ordered2DitherImage -- + * + * Dithers an image using an ordered dither. + * Assumptions made: + * 1) The color space is allocated y:cr:cb = 8:4:4 + * 2) The spatial resolution of y:cr:cb is 4:1:1 + * The channels are dithered based on the standard + * ordered dither pattern for a 4x4 area. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +Ordered2DitherImage (unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w) +{ + unsigned char *l, *r, *b, *o1, *o2; + unsigned char *l2; + unsigned char L, R, B; + int i, j; + unsigned char ***dp0 = ditherPtr[0]; + unsigned char ***dp2 = ditherPtr[2]; + unsigned char ***dp4 = ditherPtr[4]; + unsigned char ***dp6 = ditherPtr[6]; + unsigned char ***dp8 = ditherPtr[8]; + unsigned char ***dp10 = ditherPtr[10]; + unsigned char ***dp12 = ditherPtr[12]; + unsigned char ***dp14 = ditherPtr[14]; + unsigned char ***dp1 = ditherPtr[1]; + unsigned char ***dp3 = ditherPtr[3]; + unsigned char ***dp5 = ditherPtr[5]; + unsigned char ***dp7 = ditherPtr[7]; + unsigned char ***dp9 = ditherPtr[9]; + unsigned char ***dp11 = ditherPtr[11]; + unsigned char ***dp13 = ditherPtr[13]; + unsigned char ***dp15 = ditherPtr[15]; + + l = lum; + l2 = lum+w; + r = cr; + b = cb; + o1 = out; + o2 = out+w; + + for (i=0; i<h; i+=4) { + + for (j=0; j<w; j+=8) { + + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = ((dp0[B])[R])[L]; + L = l[1]; + o1[1] = ((dp8[B])[R])[L]; + L = l2[0]; + o2[0] = ((dp12[B])[R])[L]; + L = l2[1]; + o2[1] = ((dp4[B])[R])[L]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = ((dp2[B])[R])[L]; + L = l[3]; + o1[3] = ((dp10[B])[R])[L]; + L = l2[2]; + o2[2] = ((dp14[B])[R])[L]; + L = l2[3]; + o2[3] = ((dp6[B])[R])[L]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = ((dp0[B])[R])[L]; + L = l[5]; + o1[5] = ((dp8[B])[R])[L]; + L = l2[4]; + o2[4] = ((dp12[B])[R])[L]; + L = l2[5]; + o2[5] = ((dp4[B])[R])[L]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = ((dp2[B])[R])[L]; + L = l[7]; + o1[7] = ((dp10[B])[R])[L]; + L = l2[6]; + o2[6] = ((dp14[B])[R])[L]; + L = l2[7]; + o2[7] = ((dp6[B])[R])[L]; + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + + for (j=0; j<w; j+=8) { + + R = r[0]; B = b[0]; + + L = l[0]; + o1[0] = ((dp3[B])[R])[L]; + L = l[1]; + o1[1] = ((dp11[B])[R])[L]; + L = l2[0]; + o2[0] = ((dp15[B])[R])[L]; + L = l2[1]; + o2[1] = ((dp7[B])[R])[L]; + + R = r[1]; B = b[1]; + + L = l[2]; + o1[2] = ((dp1[B])[R])[L]; + L = l[3]; + o1[3] = ((dp9[B])[R])[L]; + L = l2[2]; + o2[2] = ((dp13[B])[R])[L]; + L = l2[3]; + o2[3] = ((dp5[B])[R])[L]; + + R = r[2]; B = b[2]; + + L = l[4]; + o1[4] = ((dp3[B])[R])[L]; + L = l[5]; + o1[5] = ((dp11[B])[R])[L]; + L = l2[4]; + o2[4] = ((dp15[B])[R])[L]; + L = l2[5]; + o2[5] = ((dp7[B])[R])[L]; + + R = r[3]; B = b[3]; + + L = l[6]; + o1[6] = ((dp1[B])[R])[L]; + L = l[7]; + o1[7] = ((dp9[B])[R])[L]; + L = l2[6]; + o2[6] = ((dp13[B])[R])[L]; + L = l2[7]; + o2[7] = ((dp5[B])[R])[L]; + + l += 8; + l2 += 8; + r += 4; + b += 4; + o1 += 8; + o2 += 8; + } + + l += w; l2 += w; + o1 += w; o2 += w; + } +} + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/para.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/para.cpp new file mode 100644 index 00000000000..bc5a9737f2a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/para.cpp @@ -0,0 +1,380 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <stdlib.h> +#include "video.h" +#include <X11/Intrinsic.h> +#include <Xm/DialogS.h> +#include <Xm/List.h> +#include <Xm/Frame.h> +#include <Xm/PushB.h> +#include <Xm/Form.h> +#include <Xm/Text.h> +#include <Xm/TextF.h> +#include <Xm/Label.h> +#include "include/common.h" +#include "newproto.h" +#include "global.h" + +ACE_RCSID(mpeg_client, para, "$Id$") + +#define NUM_LIST_ITEMS 25 +#define PARAMETER_FILE "~/.vcr/vcrParameters" +#define BANNER "Virtual VCR Parameter File, version 2.0 ** Do not Edit **" +#ifdef XmFONTLIST_DEFAULT_TAG +#define XmStringTag XmFONTLIST_DEFAULT_TAG +#else +#define XmStringTag XmSTRING_DEFAULT_CHARSET +#endif +#define STRING_SIZE 64 +#define ITEMS sizeof(shared->config)/4 + +static Widget parashell, wparalist, wparafield; + +static int * config; +static float *fconfig; + +static struct +{ + char * title; + int float_tag; /* 0 - integer, 1 - floating point */ +} +para[] = +{ + {"Real time (audio on)(tag)", 0}, + {"Video max frames-per-second", 0}, + {"Audio max sampels-per-second", 0}, + {"FF frames-per-second", 0}, + {"Rewind frames-per-second", 0}, + {"Feedback delay (msec)", 0}, + {"Audio output mask", 0}, + {"Audio_para.encodeType", 0}, + {"Audio_para.channels", 0}, + {"Audio_para.samplesPerSecond", 0}, + {"Audio_para.bytesPerSamples", 0}, + {"Audio timer interval (millisec)", 0}, + {"Audio buffered intervals", 0}, + {"Frames per audio play", 0}, + {"Audio forward (samples)", 0}, + {"VS work-ahead (milliseconds)", 0}, + {"frame rate limit (fps, float)", 1}, + {"collect statistics(tag)", 0}, + {"collect video structure info(tag)", 0}, + {"Sync effective(tag)", 0}, + {"QoS effective(tag)", 0}, + {"Audio offset(samples)", 0}, + {"Filter parameter(1/R or nsamples)", 0}, + {"Max send pattern frames", 0}, + {"Reliable byte-stream audio (tag)", 0}, + {"Reliable byte-stream video (tag)", 0}, + {"Verbose message(tag)", 0}, + {"", 0} /* this empty string is needed for testing the size of para */ +}; + +#define Fgets(s) {if (feof(fp) || fgets(s, STRING_SIZE, fp) == NULL) break; s[strlen(s)-1] = 0; } + +#define Fputs(s) {fputs(s, fp); fputc('\n', fp);} + +static void InitBuf(void) +{ + FILE * fp; + char buf[256]; + unsigned int i; + + config = (int *)&(shared->config); + fconfig = (float *)&(shared->config); + + get_full_path(PARAMETER_FILE, buf, 256); + fp = fopen(buf, "r"); + if (fp == NULL) + { + fprintf(stderr, "Warning: %s not found, use default parameter value\n", + PARAMETER_FILE); + InitBuf_exit1: + return; + } + if (fgets(buf, 100, fp) == NULL) + { + fclose(fp); + goto InitBuf_exit1; + } + buf[strlen(buf)-1] = 0; + if (ACE_OS::strcmp (buf, BANNER)) + { + fprintf(stderr, "BANNER in %s not expected, use default parameter value\n", + PARAMETER_FILE); + fclose(fp); + goto InitBuf_exit1; + } + for(i = 0; i < ITEMS; i++) + { + Fgets(buf); + if (para[i].float_tag) + sscanf(buf, "%f", &fconfig[i]); + else + sscanf(buf, "%d", &config[i]); + } + fclose(fp); +} + +static void SaveBuf(void) +{ + int i; + FILE * fp; + char buf[256]; + get_full_path(PARAMETER_FILE, buf, 256); + fp = fopen(buf, "w"); + if (fp == NULL) + { + fprintf(stderr, "Fail to open %s for saving para", buf); + ACE_OS::perror (""); + return; + } + Fputs(BANNER); + for (i = 0; i < (int)ITEMS; i++) + if (para[i].float_tag) + fprintf(fp, "%f\n", fconfig[i]); + else + fprintf(fp, "%d\n", config[i]); + fclose(fp); +} + + +static int curListPos(void) +{ + int * poses, count; + + if (XmListGetSelectedPos(wparalist, &poses, &count)) + { + count = poses[0]; + XtFree((char*)poses); + /* + fprintf(stderr, "curListPos: current pos = %d\n", count); + */ + return count - 1; + } + return -1; +} + +static void modifyCB(Widget w, XtPointer closure, XtPointer call_data) +{ + int i; + ACE_UNUSED_ARG(w); ACE_UNUSED_ARG(closure); ACE_UNUSED_ARG(call_data); + XmString item; + char buf[100], * valptr; + i = curListPos(); + if (i == -1) { beep(); return;} + valptr = XmTextGetString(wparafield); + if (para[i].float_tag) + sscanf(valptr, "%f", &fconfig[i]); + else + sscanf(valptr, "%d", &config[i]); + XtFree(valptr); + if (para[i].float_tag) + sprintf(buf, "%s: %f", para[i].title, fconfig[i]); + else + sprintf(buf, "%s: %d", para[i].title, config[i]); + item = (XmString)XmStringCreateLtoR(buf, XmStringTag); + XmListReplaceItemsPos(wparalist, &item, 1, i+1); + XmListSelectPos(wparalist, i+1, 0); + XmStringFree(item); + SaveBuf(); + /* + XtManageChild(parashell); + */ + return; +} + +static void dismissCB(Widget W, XtPointer closure, XtPointer call_data) +{ + + XtUnrealizeWidget(parashell); + ACE_UNUSED_ARG(W); ACE_UNUSED_ARG(closure); ACE_UNUSED_ARG(call_data); + /* + XtUnmanageChild(parashell); + */ +} + +Widget CreateParameterWindow(Widget parent) +{ + ACE_UNUSED_ARG(parent); + Arg args[20]; + int n; + Widget wform, frame1, frame2, + wmodify, wdismiss; + XmFontList fontlist; + XFontStruct * font; + XmStringCharSet cset = XmSTRING_DEFAULT_CHARSET; + + InitBuf(); + + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR Parameter List"); n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING);n++; + XtSetArg(args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; + XtSetArg(args[n], XmNwidth, 350); n++; + XtSetArg(args[n], XmNheight, 400); n++; + XtSetArg(args[n], XmNminWidth, 250); n++; + XtSetArg(args[n], XmNminHeight, 150); n++; + + parashell = XtAppCreateShell("Parameter List", "virtual_vcr", + topLevelShellWidgetClass, display, args, n); + /* + parashell = XmCreateDialogShell(parent, "virtual_vcr", args, n); + */ + + font = XLoadQueryFont (XtDisplay (parashell), "courB14"); + fontlist = XmFontListCreate (font, cset); + + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual Parameter List"); n++; + wform = XmCreateForm(parashell, "Parameters", args, n); + XtManageChild(wform); + /* + parashell = wform = XmCreateForm(parashell, "Parameters", args, n); + */ + + n = 0; + wmodify = XmCreatePushButton (wform, "Update", args, n); + XtManageChild(wmodify); + XtAddCallback (wmodify, XmNactivateCallback, (XtCallbackProc)modifyCB, NULL); + wdismiss = XmCreatePushButton (wform, "Dismiss", args, n); + XtManageChild(wdismiss); + XtAddCallback (wdismiss, XmNactivateCallback, (XtCallbackProc)dismissCB, NULL); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 20); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wmodify, args, n); + + n = 0; + XtSetArg(args[n], XmNcolumns, 10); n++; + XtSetArg (args[n], XmNleftOffset, 90); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + wparafield = XmCreateTextField(wform, "updata_text", args, n); + XtManageChild(wparafield); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNrightOffset, 20); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wdismiss, args, n); + + n = 0; + XtSetArg (args[n], XmNtopOffset, 5); n++; + XtSetArg (args[n], XmNleftOffset, 5); n++; + XtSetArg (args[n], XmNbottomOffset, 45); n++; + XtSetArg (args[n], XmNrightOffset, 5); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg(args[n], XmNfontList, fontlist); n++; + XtSetArg(args[n], XmNvisibleItemCount, NUM_LIST_ITEMS); n++; + + { + int items; + XmString * item; + int i; + /* + fprintf(stderr, "Total parameter items: %d\n", items); + */ + for (items = 0; para[items].title[0] != 0; items ++); + if (items > (int)ITEMS) + items = ITEMS; + else if (items < (int)ITEMS) + { + fprintf(stderr, "Error in para.c: fewer titles than parameters, %d out of %d.\n", + items, ITEMS); + ACE_OS::exit (1); + } + item = (XmString *)ACE_OS::malloc(sizeof(*item) * items); + if (item == NULL) + { + ACE_OS::perror ("UI allocate parameter list item(XmString)"); + ACE_OS::exit (1); + } + for (i = 0; i < items; i ++) + { + char buf[100]; + if (para[i].float_tag) + sprintf(buf, "%s: %f", para[i].title, fconfig[i]); + else{ + sprintf(buf, "%s: %d", para[i].title, config[i]); + } + item[i] = (XmString)XmStringCreateLtoR(buf, XmStringTag); + } + XtSetArg(args[n], XmNitems, item); n++; + XtSetArg(args[n], XmNitemCount, items); n++; + XtSetArg(args[n], XmNselectedItems, item); n++; + XtSetArg(args[n], XmNselectedItemCount, 1); n++; + wparalist = XmCreateScrolledList(wform, "ParameterList", args, n); + XtManageChild(wparalist); + for (i = 0; i < items; i++) + XmStringFree(item[i]); + ACE_OS::free (item); + } +// XmFontListFree(fontlist); + + n=0; + XtSetArg (args[n], XmNtopOffset, 5); n++; + XtSetArg (args[n], XmNleftOffset, 5); n++; + XtSetArg (args[n], XmNbottomOffset, 45); n++; + XtSetArg (args[n], XmNrightOffset, 5); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + frame2 = XmCreateFrame (wform, "frame", args, n); + XtManageChild(frame2); + + n=0; + XtSetArg (args[n], XmNtopOffset, 0); n++; + XtSetArg (args[n], XmNleftOffset, 0); n++; + XtSetArg (args[n], XmNbottomOffset, 0); n++; + XtSetArg (args[n], XmNrightOffset, 0); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + frame1 = XmCreateFrame (wform, "frame", args, n); + XtManageChild(frame1); + + return parashell; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/parseblock.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/parseblock.cpp new file mode 100644 index 00000000000..9a3168e7067 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/parseblock.cpp @@ -0,0 +1,461 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#define NO_SANITY_CHECKS + +#include "ace/OS.h" +#include <assert.h> +#include "video.h" +#include "proto.h" +#include "decoders.h" + +ACE_RCSID(mpeg_client, parseblock, "$Id$") + +/* External declarations. */ + +extern int zigzag_direct[]; + +/* Macro for returning 1 if num is positive, -1 if negative, 0 if 0. */ + +#define Sign(num) ((num > 0) ? 1 : ((num == 0) ? 0 : -1)) + + +/* + *-------------------------------------------------------------- + * + * ParseReconBlock -- + * + * Parse values for block structure from bitstream. + * n is an indication of the position of the block within + * the macroblock (i.e. 0-5) and indicates the type of + * block (i.e. luminance or chrominance). Reconstructs + * coefficients from values parsed and puts in + * block.dct_recon array in vid stream structure. + * sparseFlag is set when the block contains only one + * coeffictient and is used by the IDCT. + * + * Results: + * + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +#define DCT_recon blockPtr->dct_recon +#define DCT_dc_y_past blockPtr->dct_dc_y_past +#define DCT_dc_cr_past blockPtr->dct_dc_cr_past +#define DCT_dc_cb_past blockPtr->dct_dc_cb_past + +#define DECODE_DCT_COEFF_FIRST DecodeDCTCoeffFirst +#define DECODE_DCT_COEFF_NEXT DecodeDCTCoeffNext + +void +ParseReconBlock(int n) +{ +#ifdef RISC + unsigned int temp_curBits; + int temp_bitOffset; + int temp_bufLength; + unsigned int *temp_bitBuffer; +#endif + + Block *blockPtr = &curVidStream->block; + int coeffCount; + + if (bufLength < 2) + correct_underflow(); + +#ifdef RISC + temp_curBits = curBits; + temp_bitOffset = bitOffset; + temp_bufLength = bufLength; + temp_bitBuffer = bitBuffer; +#endif + + { + /* + * Copy the globals curBits, bitOffset, bufLength, and bitBuffer + * into local variables with the same names, so the macros use the + * local variables instead. This allows register allocation and + * can provide 1-2 fps speedup. On machines with not so many registers, + * don't do this. + */ +#ifdef RISC + register unsigned int curBits = temp_curBits; + register int bitOffset = temp_bitOffset; + register int bufLength = temp_bufLength; + register unsigned int *bitBuffer = temp_bitBuffer; +#endif + + int diff; + int size, level, i, run, pos, coeff; + short int *reconptr; + unsigned char *iqmatrixptr, *niqmatrixptr; + int qscale; + + reconptr = DCT_recon[0]; + + /* + * Hand coded version of memset that's a little faster... + * Old call: + * memset((char *) DCT_recon, 0, 64*sizeof(short int)); + */ + { + INT32 *p; + p = (INT32 *) reconptr; + + p[0] = p[1] = p[2] = p[3] = p[4] = p[5] = p[6] = p[7] = p[8] = p[9] = + p[10] = p[11] = p[12] = p[13] = p[14] = p[15] = p[16] = p[17] = p[18] = + p[19] = p[20] = p[21] = p[22] = p[23] = p[24] = p[25] = p[26] = p[27] = + p[28] = p[29] = p[30] = p[31] = 0; + + } + + if (curVidStream->mblock.mb_intra) { + + if (n < 4) { + + /* + * Get the luminance bits. This code has been hand optimized to + * get by the normal bit parsing routines. We get some speedup + * by grabbing the next 16 bits and parsing things locally. + * Thus, calls are translated as: + * + * show_bitsX <--> next16bits >> (16-X) + * get_bitsX <--> val = next16bits >> (16-flushed-X); + * flushed += X; + * next16bits &= bitMask[flushed]; + * flush_bitsX <--> flushed += X; + * next16bits &= bitMask[flushed]; + * + * I've streamlined the code a lot, so that we don't have to mask + * out the low order bits and a few of the extra adds are removed. + * bsmith + */ + unsigned int next16bits, index, flushed; + + show_bits16(next16bits); + index = next16bits >> (16-7); + size = dct_dc_size_luminance[index].value; + flushed = dct_dc_size_luminance[index].num_bits; + next16bits &= bitMask[16+flushed]; + + if (size != 0) { + flushed += size; + diff = next16bits >> (16-flushed); + if (!(diff & bitTest[32-size])) { + diff = rBitMask[size] | (diff + 1); + } + } else { + diff = 0; + } + flush_bits(flushed); + + if (n == 0) { + coeff = diff << 3; + if (curVidStream->mblock.mb_address - + curVidStream->mblock.past_intra_addr > 1) + coeff += 1024; + else coeff += DCT_dc_y_past; + DCT_dc_y_past = coeff; + } else { + coeff = DCT_dc_y_past + (diff << 3); + DCT_dc_y_past = coeff; + } + } else { + + /* + * Get the chrominance bits. This code has been hand optimized to + * as described above + */ + unsigned int next16bits, index, flushed; + + show_bits16(next16bits); + index = next16bits >> (16-8); + size = dct_dc_size_chrominance[index].value; + flushed = dct_dc_size_chrominance[index].num_bits; + next16bits &= bitMask[16+flushed]; + + if (size != 0) { + flushed += size; + diff = next16bits >> (16-flushed); + if (!(diff & bitTest[32-size])) { + diff = rBitMask[size] | (diff + 1); + } + } else { + diff = 0; + } + flush_bits(flushed); + + if (n == 4) { + coeff = diff << 3; + if (curVidStream->mblock.mb_address - + curVidStream->mblock.past_intra_addr > 1) + coeff += 1024; + else coeff += DCT_dc_cr_past; + DCT_dc_cr_past = coeff; + + } else { + coeff = diff << 3; + if (curVidStream->mblock.mb_address - + curVidStream->mblock.past_intra_addr > 1) + coeff += 1024; + else coeff += DCT_dc_cb_past; + DCT_dc_cb_past = coeff; + } + } + + *reconptr = coeff; + i = 0; pos = 0; + coeffCount = (coeff != 0); + + if (curVidStream->picture.code_type != 4) { + + qscale = curVidStream->slice.quant_scale; + iqmatrixptr = curVidStream->intra_quant_matrix[0]; + + while(1) { + + DECODE_DCT_COEFF_NEXT(run, level); + + if (run == END_OF_BLOCK) break; + if (i >= 64) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) subscript out of range \n")); + break; + } + i = i + run + 1; + pos = zigzag_direct[i]; + coeff = (level * qscale * ((int) iqmatrixptr[pos])) >> 3; + if (level < 0) { + coeff += (coeff & 1); + } else { + coeff -= (coeff & 1); + } + + reconptr[pos] = coeff; + if (coeff) { + coeffCount++; + } + + } + +#ifdef ANALYSIS + + { + extern unsigned int *mbCoeffPtr; + mbCoeffPtr[pos]++; + } +#endif + + flush_bits(2); + + goto end; + } + } + + else { + + niqmatrixptr = curVidStream->non_intra_quant_matrix[0]; + qscale = curVidStream->slice.quant_scale; + + DECODE_DCT_COEFF_FIRST(run, level); + i = run; + + pos = zigzag_direct[i]; + if (level < 0) { + coeff = (((level<<1) - 1) * qscale * + ((int) (niqmatrixptr[pos]))) >> 4; + coeff += (coeff & 1); + } else { + coeff = (((level<<1) + 1) * qscale * + ((int) (*(niqmatrixptr+pos)))) >> 4; + coeff -= (coeff & 1); + } + reconptr[pos] = coeff; + if (coeff) { + coeffCount = 1; + } + + if (curVidStream->picture.code_type != 4) { + + while(1) { + + DECODE_DCT_COEFF_NEXT(run, level); + + if (run == END_OF_BLOCK) break; + + i = i+run+1; + if (i >= 64) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) subscript out of range \n")); + break; + } + pos = zigzag_direct[i]; + if (level < 0) { + coeff = (((level<<1) - 1) * qscale * + ((int) (niqmatrixptr[pos]))) >> 4; + coeff += (coeff & 1); + } else { + coeff = (((level<<1) + 1) * qscale * + ((int) (*(niqmatrixptr+pos)))) >> 4; + coeff -= (coeff & 1); + } + reconptr[pos] = coeff; + if (coeff) { + coeffCount++; + } + } + +#ifdef ANALYSIS + { + extern unsigned int *mbCoeffPtr; + mbCoeffPtr[pos]++; + } +#endif + + flush_bits(2); + + goto end; + } + } + + end: + + if (coeffCount == 1) j_rev_dct_sparse (reconptr, pos); + else j_rev_dct(reconptr); + +#ifdef RISC + temp_curBits = curBits; + temp_bitOffset = bitOffset; + temp_bufLength = bufLength; + temp_bitBuffer = bitBuffer; +#endif + + } + +#ifdef RISC + curBits = temp_curBits; + bitOffset = temp_bitOffset; + bufLength = temp_bufLength; + bitBuffer = temp_bitBuffer; +#endif +} + +#undef DCT_recon +#undef DCT_dc_y_past +#undef DCT_dc_cr_past +#undef DCT_dc_cb_past + + +/* + *-------------------------------------------------------------- + * + * ParseAwayBlock -- + * + * Parses off block values, throwing them away. + * Used with grayscale dithering. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +ParseAwayBlock(int n) +{ + unsigned int diff; + unsigned int size, run; + int level; + + if (bufLength < 2) + correct_underflow(); + + if (curVidStream->mblock.mb_intra) { + + /* If the block is a luminance block... */ + + if (n < 4) { + + /* Parse and decode size of first coefficient. */ + + DecodeDCTDCSizeLum(size); + + /* Parse first coefficient. */ + + if (size != 0) { + get_bitsn(size, diff); + } + } + + /* Otherwise, block is chrominance block... */ + + else { + + /* Parse and decode size of first coefficient. */ + + DecodeDCTDCSizeChrom(size); + + /* Parse first coefficient. */ + + if (size != 0) { + get_bitsn(size, diff); + } + } + } + + /* Otherwise, block is not intracoded... */ + + else { + + /* Decode and set first coefficient. */ + + DECODE_DCT_COEFF_FIRST(run, level); + } + + /* If picture is not D type (i.e. I, P, or B)... */ + + if (curVidStream->picture.code_type != 4) { + + /* While end of macroblock has not been reached... */ + + while (1) { + + /* Get the dct_coeff_next */ + + DECODE_DCT_COEFF_NEXT(run, level); + + if (run == END_OF_BLOCK) break; + } + + /* End_of_block */ + + flush_bits(2); + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/prog.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/prog.cpp new file mode 100644 index 00000000000..93d5355a035 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/prog.cpp @@ -0,0 +1,935 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <stdlib.h> +#include <unistd.h> +#include "video.h" +#include <X11/Intrinsic.h> +#include <Xm/List.h> +#include <Xm/Frame.h> +#include <Xm/PushB.h> +#include <Xm/Form.h> +#include <Xm/Text.h> +#include <Xm/TextF.h> +#include <Xm/DialogS.h> +#include "include/common.h" +#include "newproto.h" +#include "global.h" + +ACE_RCSID(mpeg_client, prog, "$Id$") + +#define NUM_LIST_ITEMS 20 +#define STRING_SIZE 100 +#define ITEMS 100 +#define PROGRAM_FILE "~/.vcr/vcrPrograms" +#define BANNER "Virtual VCR Program DataBase. version 2.0 **DO NOT edit**" +#ifdef XmFONTLIST_DEFAULT_TAG +#define XmStringTag XmFONTLIST_DEFAULT_TAG +#else +#define XmStringTag XmSTRING_DEFAULT_CHARSET +#endif + +static int cmdSocket; +static int *playtag; +static Widget titlewidget, progshell, progmodifyshell; +static Widget wproglist, wprogmodify; + +static int items = 0; +static XmString * item; +static struct ProgramList +{ + char title[STRING_SIZE]; + char vh[STRING_SIZE]; + char vf[STRING_SIZE]; + char ah[STRING_SIZE]; + char af[STRING_SIZE]; +} * prog; + +static int progcmd, progid; /* progcmd == 0 - insert, 1 - modify*/ +static struct ProgramList deletedprog; + +#define LINE1 " Program Title: " +#define LINE2 "Video file host: " +#define LINE3 "Video file path: " +#define LINE4 "Audio file host: " +#define LINE5 "Audio file path: " +#define MarginHeight 10 +#define MarginWidth 10 +static int charHeight, charWidth; +static int titleSize; + +#define Fgets(s) {if (feof(fp) || fgets(s, STRING_SIZE, fp) == NULL) break; s[strlen(s)-1] = 0; } + +#define Fputs(s) {fputs(s, fp); fputc('\n', fp);} + +static void SaveBuf(void); + +static void InitBuf(void) +{ + FILE * fp; + char *fname; + char buf[256]; + int copyTag = 0; + + deletedprog.title[0] = 0; + + item = (XmString *)ACE_OS::malloc(sizeof(*item) * ITEMS); + if (item == NULL) + { + ACE_OS::perror ("UI allocate proglist item(XmString)"); + ACE_OS::exit (1); + } + prog = (struct ProgramList *) ACE_OS::malloc(sizeof(*prog) * ITEMS); + if (prog == NULL) + { + ACE_OS::perror ("UI allocate prog"); + ACE_OS::exit (1); + } + fp = NULL; + if (proglistName[0] != 0) { /* file name given in command line */ + get_full_path(proglistName, buf, 256); + fname = proglistName; + fp = fopen(buf, "r"); + if (fp == NULL) { + fprintf(stderr,"PROG.C error opening %s:", proglistName); + ACE_OS::perror (""); + } + } + if (fp == NULL) { + get_full_path(PROGRAM_FILE, buf, 256); + fname = PROGRAM_FILE; + fp = fopen(buf, "r"); + } + if (fp == NULL) { + { + + InitBuf_exit1: + + get_full_path(PROGRAM_FILE, buf, 256); + if (access(buf, 0) != 0) { /* PROGRAM_FILE does not exist, create it */ + if (strchr(fname, '/') != NULL) { /* create the default directory */ + char *ptr = strrchr(buf, '/'); + *ptr = 0; + mkdir(buf, 0755); + *ptr = '/'; + } + fname = PROGRAM_FILE; + fp = fopen(buf, "w+"); + } + else { /* Exist, create a temp file in /tmp */ + char *ptr = tempnam("/tmp/", "vcr"); + fname = tmpnam(NULL); + if (ptr != NULL) { + strncpy(fname, ptr, L_tmpnam); + ACE_OS::free (ptr); + } + strcpy(buf, fname); + fp = tmpfile(); + } + if (fp != NULL) { + if (strncmp(fname, "/tmp/", 5) != 0) { + fprintf(stderr, + "Warning: created file %s with default movie list.\n", + fname); + } + else fprintf(stderr, "Warning: using default movie list.\n"); + fprintf(fp, "%s\n", BANNER); + fprintf(fp, "\ +lemond: (va) Blazers Game 1 (128)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.128.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.au\n\ +lemond: (va) Blazers Game 1 (256)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.256.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.au\n\ +lemond: (va) Blazers Game 1 (320)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.320.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/c1.0.300.au\n\ +lemond: (va) Blazers Game 2 (128)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.128.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.au\n\ +lemond: (va) Blazers Game 2 (256)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.256.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.au\n\ +lemond: (va) Blazers Game 2 (320)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.320.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/h1.0.300.au\n\ +lemond: (va) Blazers Game 3 (128)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/s1.0.300.128.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/s1.0.300.au\n\ +lemond: (va) Blazers Game 3 (256)\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/s1.0.300.256.mpg\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/s1.0.300.au\n\ +lemond: (vo) Skiing on Mt. Rainer\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/skiRainer.mpeg\n\ +\n\ +\n\ +lemond: (ao) Following the sense (Chinese song)\n\ +\n\ +\n\ +lemond.cse.ogi.edu\n\ +/projects/dsrg/L/multimedia3/sense.au\n\ +"); + fseek(fp, (long)0, 0); + fgets(buf, 100, fp); + goto InitBuf_continue; + /* + fclose(fp); + fp = fopen(buf, "r"); + if (fp != NULL) { + fgets(buf, 100, fp); + goto InitBuf_continue; + } + else { + fprintf(stderr, "Warning: failed to read newly created %s:", buf); + ACE_OS::perror (""); + } + */ + } + else { + fprintf(stderr, "Warning: failed to create %s:", buf); + perror(""); + } + items = 0; + return; + } + } + if (fgets(buf, 100, fp) == NULL) + { + fclose(fp); + goto InitBuf_exit1; + } + buf[strlen(buf)-1] = 0; + if (strncmp(buf, BANNER,ACE_OS::strlen (BANNER))) + { + fprintf(stderr, "BANNER in %s not expected\n", fname); + fprintf(stderr, " Expected: %s\n", BANNER); + fprintf(stderr, " Actual : %s\n", buf); + fclose(fp); + goto InitBuf_exit1; + } + + InitBuf_continue: + + items = 0; + for(;;) + { + /* + fprintf(stderr, "Reading next program.\n"); + */ + Fgets(prog[items].title); + // Fgets(prog[items].vh); + Fgets(prog[items].vf); + // Fgets(prog[items].ah); + Fgets(prog[items].af); + item[items] = (XmString)XmStringCreateLtoR(prog[items].title, XmStringTag); + if ((++items) >= ITEMS) break; + } + /* + fprintf(stderr, "Total programs %d\n", items); + */ + fclose(fp); + if (copyTag) { + SaveBuf(); + } +} + +static void SaveBuf(void) +{ + int i; + FILE * fp; + char buf[256]; + get_full_path(PROGRAM_FILE, buf, 256); + fp = fopen(buf, "w"); + if (fp == NULL) + { + fprintf(stderr, "Fail to open %s for saving programs", buf); + ACE_OS::perror (""); + return; + } + Fputs(BANNER); + for (i = 0; i < items; i++) + { + Fputs(prog[i].title); + // Fputs(prog[i].vh); + Fputs(prog[i].vf); + // Fputs(prog[i].ah); + Fputs(prog[i].af); + } + fclose(fp); +} + +static void CmdWrite(char * buf, int size) +{ + if (size == 0) return; + while (write(cmdSocket, (buf), (size)) == -1) + { + if (errno == EINTR) continue; + ACE_OS::perror ("UI write to cmdSocket"); + ACE_OS::exit (1); + } +} + +void StartProgram(char * title, char * vh, char * vf, char * ah, char * af) +{ + extern int cmdBusy; + char tmp = CmdINIT; + int len; + if (!cmdBusy) { + char *str = title; + len =ACE_OS::strlen (str); +// if (len > 0 && str[len-1] == 0x0d) str[len - 1] = 0; +// str = vh; + // len =ACE_OS::strlen (str); + if (len > 0 && str[len-1] == 0x0d) str[len - 1] = 0; + str = vf; + // len =ACE_OS::strlen (str); + // if (len > 0 && str[len-1] == 0x0d) str[len - 1] = 0; + // str = ah; + len =ACE_OS::strlen (str); + if (len > 0 && str[len-1] == 0x0d) str[len - 1] = 0; + str = af; + len =ACE_OS::strlen (str); + if (len > 0 && str[len-1] == 0x0d) str[len - 1] = 0; + XmTextFieldSetString(titlewidget, title); + cmdBusy = 1; + CmdWrite(&tmp, 1); +// len =ACE_OS::strlen (vh); +// CmdWrite((char *)&len, 4); +// cerr << "StartProgram: len =" << len; +// CmdWrite(vh, len); +// cerr << " StartProgram: vh =" << vh << endl; + len =ACE_OS::strlen (vf); + CmdWrite((char *)&len, 4); + cerr << "StartProgram: len =" << len; + CmdWrite(vf, len); + cerr << " StartProgram: vf =" << vf << endl; +// len =ACE_OS::strlen (ah); +// CmdWrite((char *)&len, 4); +// cerr << "StartProgram: len =" << len; +// CmdWrite(ah, len); +// cerr << " StartProgram: ah =" << ah << endl; + len =ACE_OS::strlen (af); + CmdWrite((char *)&len, 4); + cerr << "StartProgram: len =" << len; + CmdWrite(af, len); + cerr << " StartProgram: af =" << af << endl; + } + else { + beep(); + } + cerr << "StartProgram done\n"; +} + +static int curListPos(void) +{ + int * poses, count; + + if (XmListGetSelectedPos(wproglist, &poses, &count)) + { + count = poses[0]; + XtFree((char*)poses); + /* + fprintf(stderr, "curListPos: current pos = %d\n", count); + */ + return count - 1; + } + return -1; +} + + +static void modifyprog(struct ProgramList *p) +{ + XmString item; + + if (items <0 || progid >= items || progid < 0) + { beep(); return; } + item = (XmString)XmStringCreateLtoR(p->title, XmStringTag); + XmListReplaceItemsPos(wproglist, &item, 1, progid+1); + XmListSelectPos(wproglist, progid+1, 0); + XmStringFree(item); + ACE_OS::memcpy (&(prog[progid]), p, sizeof(*p)); + SaveBuf(); +} + +static void insertprog(struct ProgramList *p) +{ + XmString item; + + if (items <= 0 || items >= ITEMS) return; + ACE_OS::memcpy ((char*)&(prog[items]), (char *)p, sizeof(*p)); + item = (XmString)XmStringCreateLtoR(p->title, XmStringTag); + XmListAddItemUnselected(wproglist, item, items+1); + XmStringFree(item); + if (items == 0) + XmListSelectPos(wproglist, 0, False); + items ++; + SaveBuf(); +} + +static void verifyCB(Widget w, XtPointer closure, XmTextVerifyCallbackStruct * cd); + +static void deleteCB(Widget w, XtPointer closure, XtPointer call_data) +{ + int i, j; + + // return; + + + if (items <= 0) { beep(); return; } + j = curListPos(); + if (j == -1) return; + ACE_OS::memcpy (&deletedprog, &prog[j], sizeof(deletedprog)); + for (i = j+1; i < items; i++) + ACE_OS::memcpy (&prog[i-1], &prog[i], sizeof(*prog)); + XmListDeletePos(wproglist, j+1); + items --; + SaveBuf(); + return; +} + +static void undoCB(Widget w, XtPointer closure, XtPointer call_data) +{ + // return; + + if (deletedprog.title[0] != 0) + { + insertprog(&deletedprog); + deletedprog.title[0] = 0; + } + else + beep(); + +} + +static void setposition(Widget w, int x, int y); + +static void insertCB (Widget w, XtPointer closure, XtPointer call_data) +{ + char buf[1000]; + + // return; + + //#if 0 + if (items >= ITEMS -1) + { + beep(); + return; + } + XtRemoveAllCallbacks(wprogmodify, XmNmodifyVerifyCallback); + XtRemoveAllCallbacks(wprogmodify, XmNmotionVerifyCallback); + progcmd = 0; + sprintf(buf, " *** append a program ***\n"); + strcat(buf, LINE1); + strcat(buf, "\n"); + strcat(buf, LINE2); + strcat(buf, "\n"); + strcat(buf, LINE3); + strcat(buf, "\n"); + strcat(buf, LINE4); + strcat(buf, "\n"); + strcat(buf, LINE5); + strcat(buf, "\n\n"); + XmTextSetString(wprogmodify, buf); + + setposition(wprogmodify, titleSize, 1); + XtAddCallback (wprogmodify, XmNmodifyVerifyCallback, (XtCallbackProc)verifyCB, NULL); + XtAddCallback (wprogmodify, XmNmotionVerifyCallback, (XtCallbackProc)verifyCB, NULL); + + // uncommented + //XtManageChild(progmodifyshell); + + XtRealizeWidget(progmodifyshell); + //#endif +} + +static void modifyCB(Widget w, XtPointer closure, XtPointer call_data) +{ + int i; + char buf[1000]; + if (items == 0) + { + beep(); + return; + } + XtRemoveAllCallbacks(wprogmodify, XmNmodifyVerifyCallback); + XtRemoveAllCallbacks(wprogmodify, XmNmotionVerifyCallback); + progid = i = curListPos(); + progcmd = 1; + sprintf(buf, " *** modify program: %s ***\n", prog[i].title); + strcat(buf, LINE1); + strcat(buf, prog[i].title); + strcat(buf, "\n"); + // strcat(buf, LINE2); + // strcat(buf, prog[i].vh); + // strcat(buf, "\n"); + strcat(buf, LINE3); + strcat(buf, prog[i].vf); + strcat(buf, "\n"); + // strcat(buf, LINE4); + // strcat(buf, prog[i].ah); + // strcat(buf, "\n"); + strcat(buf, LINE5); + strcat(buf, prog[i].af); + strcat(buf, "\n\n"); + XmTextSetString(wprogmodify, buf); + + setposition(wprogmodify, titleSize, 1); + XtAddCallback (wprogmodify, XmNmodifyVerifyCallback, (XtCallbackProc)verifyCB, NULL); + XtAddCallback (wprogmodify, XmNmotionVerifyCallback, (XtCallbackProc)verifyCB, NULL); + /* + XtManageChild(progmodifyshell); + */ + XtRealizeWidget(progmodifyshell); +} + +static void playCB(Widget w, XtPointer closure, XtPointer call_data) +{ + /* + fprintf(stderr, "play"); + */ + if (items > 0) + { + int i = curListPos(); + if (i >= items || i < 0) + return; + cerr << "PlayCB\n"; + cerr << prog[i].title << " " << " " <<prog[i].vf << " " << " " << prog[i].af << endl; + StartProgram(prog[i].title, prog[i].vh, prog[i].vf, prog[i].ah, prog[i].af); + } +} + +static void dismissCB(Widget W, XtPointer closure, XtPointer call_data) +{ + + XtUnrealizeWidget(progshell); + /* + XtUnmanageChild(progshell); + */ +} + +static void setposition(Widget w, int x, int y) +{ + Position x1, y1; + x1 = charWidth * x + (MarginWidth+4); + y1 = charHeight * y + (charHeight+MarginHeight+1); + XmTextSetInsertionPosition(w, XmTextXYToPos(w, x1, y1)); +} + +static int getposition(Widget w, XmTextVerifyCallbackStruct * cd, + int * x, int *y) +{ + Position x1, y1; + if (!XmTextPosToXY(w, cd->newInsert, &x1, &y1)) + return 0; + *x = (x1-(MarginWidth+4))/charWidth; + *y = (y1-(charHeight+MarginHeight+1))/charHeight; + if ((*x)*charWidth != x1-(MarginWidth+4) || (*y)*charHeight != y1-(charHeight+MarginHeight+1)) + { + /* + fprintf(stderr, "error: TextCursorConversion failed. \007\n"); + fprintf(stderr, "x-%d, x1-%d, y-%d, y1-%d\n", *x, (int)x1, *y, (int)y1); + */ + return 1; + } + return 1; + +} + +static void modifydismissCB(Widget w, XtPointer closure, XtPointer call_data) +{ + + XtUnrealizeWidget(progmodifyshell); + /* + XtUnmanageChild(progmodifyshell); + */ +} + +static void modifysaveCB(Widget w, XtPointer closure, XtPointer call_data) +{ + return; + + //#if 0 + if (progcmd == 1 && items <= progid) + { + beep(); + } + else if (progcmd == 1 || progcmd == 0) + { + char * buf, * ptr, *ptr1; + struct ProgramList p; + buf = XmTextGetString(wprogmodify); + ptr = buf; + fprintf(stderr, "Buf: %s\n", buf); + while (*ptr != '\n') ptr ++; + ptr ++; + + ptr1 = ptr + titleSize; + while (*ptr != '\n') ptr ++; + (*ptr) = 0; ptr ++; + strncpy(p.title, ptr1, STRING_SIZE); + p.title[STRING_SIZE-1] = 0; + + ptr1 = ptr + titleSize; + while (*ptr != '\n') ptr ++; + (*ptr) = 0; ptr ++; + strncpy(p.vh, ptr1, STRING_SIZE); + p.vh[STRING_SIZE-1] = 0; + + ptr1 = ptr + titleSize; + while (*ptr != '\n') ptr ++; + (*ptr) = 0; ptr ++; + strncpy(p.vf, ptr1, STRING_SIZE); + p.vf[STRING_SIZE-1] = 0; + + ptr1 = ptr + titleSize; + while (*ptr != '\n') ptr ++; + (*ptr) = 0; ptr ++; + strncpy(p.ah, ptr1, STRING_SIZE); + p.ah[STRING_SIZE-1] = 0; + + ptr1 = ptr + titleSize; + while (*ptr != '\n') ptr ++; + (*ptr) = 0; + strncpy(p.af, ptr1, STRING_SIZE); + p.af[STRING_SIZE-1] = 0; + /* + fprintf(stderr, "*|%s||%s||%s||%s||%s||*\n", p.title, p.vh, p.vf, p.ah, p.af); + */ + XtFree((char *)buf); + if (progcmd == 1) + modifyprog(&p); + else + insertprog(&p); + } + //#endif +} + +static void verifyCB(Widget w, XtPointer closure, XmTextVerifyCallbackStruct * cd) +{ + int x = 0, y = 0; + + if (!getposition(w, cd, &x, &y)) + { + fprintf(stderr, "error on conversion to x/y\n"); + return; + } +/* + fprintf(stderr, "verifyCB: %d (x-%d, y-%d)\n",cd->newInsert, x, y); +*/ + if (x < titleSize || x > titleSize+STRING_SIZE || y < 1 || y > 5) + { + beep(); + cd->doit = False; + return; + } + else + return; +} + +static void CreateModifyWindow(Widget parent) +{ + ACE_UNUSED_ARG (parent); + Arg args[20]; + int n; + Widget wform, wtext, wdone, wcancel; + XmFontList fontlist; + XFontStruct * font; + XmStringCharSet cset = XmSTRING_DEFAULT_CHARSET; + + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR Program List Edit"); n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING);n++; + XtSetArg(args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; + XtSetArg(args[n], XmNwidth, 700); n++; + XtSetArg(args[n], XmNheight, 160); n++; + XtSetArg(args[n], XmNallowShellResize, False); n++; + + progmodifyshell = XtAppCreateShell("Program List", "virtual_vcr", + topLevelShellWidgetClass, display, args, n); + + // uncommented. + // progmodifyshell = XmCreateDialogShell(parent, "virtual_vcr", args, n); + + n = 0; + + /* Create form widget */ + n = 0; + XtSetArg (args[n], XmNallowShellResize, False); n++; + /* + XtSetArg (args[n], XmNheight, 300); n++; + XtSetArg (args[n], XmNwidth, 800); n++; + */ + wform = XmCreateForm(progmodifyshell, "Programs", args, n); + + XtManageChild(wform); + + font = XLoadQueryFont (XtDisplay (progmodifyshell), "8x13"); + charHeight = 13; + charWidth = 8; + fontlist = XmStringCreateFontList (font, cset); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 20); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + wdone = XmCreatePushButton (wform, "Save", args, n); + XtManageChild(wdone); + XtAddCallback (wdone, XmNactivateCallback, (XtCallbackProc)modifysaveCB, NULL); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNrightOffset, 20); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + wcancel = XmCreatePushButton (wform, "Dismiss", args, n); + XtManageChild(wcancel); + XtAddCallback (wcancel, XmNactivateCallback, (XtCallbackProc)modifydismissCB, NULL); + + titleSize =ACE_OS::strlen (LINE1); + + n=0; + XtSetArg (args[n], XmNleftOffset, 5); n++; + XtSetArg (args[n], XmNtopOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg(args[n], XmNcolumns, titleSize + STRING_SIZE+1); n++; + XtSetArg(args[n], XmNrows, 7); n++; +/* + XtSetArg(args[n], XmNeditable, True); n++; +*/ + XtSetArg(args[n], XmNeditable, False); n++; + + XtSetArg(args[n], XmNmarginHeight, MarginHeight); n++; + XtSetArg(args[n], XmNmarginWidth, MarginWidth); n++; + XtSetArg(args[n], XmNborderWidth, 0); n++; + XtSetArg(args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; + /* + XtSetArg(args[n], XmNvalue, new_string1); n++; + */ + XtSetArg(args[n], XmNfontList, fontlist); n++; + wtext = XmCreateText(wform, "Virtual VCR program list modify text", args, n); + + XtManageChild(wtext); + + // XmFontListFree (fontlist); + wprogmodify = wtext; +} + +Widget CreateProgramWindow(Widget parent, int cmdSock, int * playflag, Widget frametext) +{ + Arg args[20]; + int n; + Widget wform, frame1, frame2, wlist, + wdelete, wundo, winsert, wmodify, wplay, wdismiss; + XmFontList fontlist; + XFontStruct * font; + XmStringCharSet cset = XmSTRING_DEFAULT_CHARSET; + + cmdSocket = cmdSock; + playtag = playflag; + titlewidget = frametext; + + InitBuf(); + + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR Program List"); n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING);n++; + XtSetArg(args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; + XtSetArg(args[n], XmNwidth, 396); n++; + XtSetArg(args[n], XmNheight, 300); n++; + XtSetArg(args[n], XmNminWidth, 396); n++; + XtSetArg(args[n], XmNminHeight, 150); n++; + + progshell = XtAppCreateShell("Program List", "virtual_vcr", + topLevelShellWidgetClass, display, args, n); + /* + progshell = XmCreateDialogShell(parent, "virtual_vcr", args, n); + */ + font = XLoadQueryFont (XtDisplay (progshell), "courB14"); + fontlist = XmStringCreateFontList (font, cset); + + n = 0; + XtSetArg(args[n], XmNtitle, "Program List"); n++; + wform = XmCreateForm(progshell, "Programs", args, n); + + XtManageChild(wform); + + n = 0; + wdelete = XmCreatePushButton (wform, "Delete", args, n); + XtManageChild(wdelete); + XtAddCallback (wdelete, XmNactivateCallback, (XtCallbackProc)deleteCB, NULL); + wundo = XmCreatePushButton (wform, "Undo", args, n); + XtManageChild(wundo); + XtAddCallback (wundo, XmNactivateCallback, (XtCallbackProc)undoCB, NULL); + winsert = XmCreatePushButton (wform, "Insert", args, n); + XtManageChild(winsert); + XtAddCallback (winsert, XmNactivateCallback, (XtCallbackProc)insertCB, NULL); + wmodify = XmCreatePushButton (wform, "Modify", args, n); + XtManageChild(wmodify); + XtAddCallback (wmodify, XmNactivateCallback, (XtCallbackProc)modifyCB, NULL); + wplay = XmCreatePushButton (wform, "Select", args, n); + XtManageChild(wplay); + XtAddCallback (wplay, XmNactivateCallback, (XtCallbackProc)playCB, NULL); + wdismiss = XmCreatePushButton (wform, "Dismiss", args, n); + XtManageChild(wdismiss); + XtAddCallback (wdismiss, XmNactivateCallback, (XtCallbackProc)dismissCB, NULL); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 5); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wdelete, args, n); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 70); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wundo, args, n); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 135); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (winsert, args, n); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 200); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wmodify, args, n); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 265); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wplay, args, n); + + n=0; + XtSetArg (args[n], XmNwidth, 60); n++; + XtSetArg (args[n], XmNheight, 28); n++; + XtSetArg (args[n], XmNleftOffset, 330); n++; + XtSetArg (args[n], XmNbottomOffset, 5); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetValues (wdismiss, args, n); + + n = 0; + XtSetArg (args[n], XmNtopOffset, 2); n++; + XtSetArg (args[n], XmNleftOffset, 2); n++; + XtSetArg (args[n], XmNbottomOffset, 38); n++; + XtSetArg (args[n], XmNrightOffset, 2); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg(args[n], XmNfontList, fontlist); n++; + XtSetArg(args[n], XmNvisibleItemCount, NUM_LIST_ITEMS); n++; + if (items > 0) + { + XtSetArg(args[n], XmNitems, item); n++; + XtSetArg(args[n], XmNitemCount, items); n++; + XtSetArg(args[n], XmNselectedItems, item); n++; + XtSetArg(args[n], XmNselectedItemCount, 1); n++; + } + wlist = XmCreateScrolledList(wform, "ProgramList", args, n); + XtManageChild(wlist); +// XmFontListFree(fontlist); + wproglist = wlist; + for (n = 0; n < items; n++) + XmStringFree(item[n]); + ACE_OS::free (item); + + n=0; + XtSetArg (args[n], XmNtopOffset, 2); n++; + XtSetArg (args[n], XmNleftOffset, 2); n++; + XtSetArg (args[n], XmNbottomOffset, 38); n++; + XtSetArg (args[n], XmNrightOffset, 2); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + frame2 = XmCreateFrame (wform, "frame", args, n); + XtManageChild(frame2); + + n=0; + XtSetArg (args[n], XmNtopOffset, 0); n++; + XtSetArg (args[n], XmNleftOffset, 0); n++; + XtSetArg (args[n], XmNbottomOffset, 0); n++; + XtSetArg (args[n], XmNrightOffset, 0); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + frame1 = XmCreateFrame (wform, "frame", args, n); + XtManageChild(frame1); + + CreateModifyWindow(parent); + + return progshell; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/proto.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/proto.h new file mode 100644 index 00000000000..023cd981944 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/proto.h @@ -0,0 +1,128 @@ +/* $Id$ */ + + +#ifdef __STDC__ +# define P(s) s +#else +# define P(s) () +#endif + + +/* util.c */ +void correct_underflow P((void )); +int next_bits P((int num , unsigned int mask )); +char *get_ext_data P((void )); +int next_start_code P((void )); +char *get_extra_bit_info P((void )); + +/* video.c */ +void init_stats P((void )); +void PrintAllStats P((void )); +double ReadSysClock P((void )); +void PrintTimeInfo P((void )); +VidStream *NewVidStream P((void )); +void DestroyVidStream P((VidStream *astream )); +PictImage *NewPictImage P((unsigned int width , unsigned int height )); +void DestroyPictImage P((PictImage *apictimage )); +int mpegVidRsrc P((char *p )); +void ToggleBFlag P((void )); +void TogglePFlag P((void )); + +/* parseblock.c */ +void ParseReconBlock P((int n )); +void ParseAwayBlock P((int n )); + +/* motionvector.c */ +void ComputeForwVector P((int *recon_right_for_ptr , int *recon_down_for_ptr )); +void ComputeBackVector P((int *recon_right_back_ptr , int *recon_down_back_ptr )); + +/* decoders.c */ +void init_tables P((void )); +void decodeDCTDCSizeLum P((unsigned int *value )); +void decodeDCTDCSizeChrom P((unsigned int *value )); +void decodeDCTCoeffFirst P((unsigned int *run , int *level )); +void decodeDCTCoeffNext P((unsigned int *run , int *level )); + +/* main.c */ +int get_more_data P((unsigned int *buf_start , int max_length , int *length_ptr , unsigned int **buf_ptr )); +int main P((int argc , char **argv )); +void usage P((char *s )); + +/* gdith.c */ +void InitColor P((void )); +int HandleXError P((Display *dpy , XErrorEvent *event )); +void InstallXErrorHandler P((void )); +void DeInstallXErrorHandler P((void )); +void ResizeDisplay P((int w , int h )); +void InitDisplay P((char *name )); +void InitGrayDisplay P((char *name )); +void InitMonoDisplay P((char *name )); +void InitColorDisplay P((char *name )); +void ExecuteDisplay P((VidStream *vid_stream )); + +/* fs2.c */ +void InitFS2Dither P((void )); +void FS2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *disp , int rows , int cols )); + +/* fs2fast.c */ +void InitFS2FastDither P((void )); +void FS2FastDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* fs4.c */ +void InitFS4Dither P((void )); +void FS4DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *disp , int rows , int cols )); + +/* hybrid.c */ +void InitHybridDither P((void )); +void HybridDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* hybriderr.c */ +void InitHybridErrorDither P((void )); +void HybridErrorDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* 2x2.c */ +void Init2x2Dither P((void )); +void RandInit P((int h , int w )); +void PostInit2x2Dither P((void )); +void Twox2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* gray.c */ +void GrayDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* mono.c */ +void MonoDitherImage(register unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w); +void MonoThresholdImage(unsigned char *lum, unsigned char *cr, + unsigned char *cb, unsigned char *out, + int h, int w); + +/* jrevdct.c */ +void init_pre_idct P((void )); +void j_rev_dct_sparse P((DCTBLOCK data , int pos )); +void j_rev_dct P((DCTBLOCK data )); +void j_rev_dct_sparse P((DCTBLOCK data , int pos )); +void j_rev_dct P((DCTBLOCK data )); + +/* 24bit.c */ +void InitColorDither P((void )); +void ColorDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int rows , int cols )); + +/* util32.c */ +Visual *FindFullColorVisual P((Display *dpy , int *depth )); +Window CreateFullColorWindow P((Display *dpy , int x , int y , int w , int h )); + +/* ordered.c */ +void InitOrderedDither P((void )); +void OrderedDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* ordered2.c */ +void InitOrdered2Dither P((void )); +void Ordered2DitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); + +/* mb_ordered.c */ +void InitMBOrderedDither P((void )); +void MBOrderedDitherImage P((unsigned char *lum , unsigned char *cr , unsigned char *cb , unsigned char *out , int h , int w )); +void MBOrderedDitherDisplayCopy P((VidStream *vid_stream , int mb_addr , int motion_forw , int r_right_forw , int r_down_forw , int motion_back , int r_right_back , int r_down_back , unsigned char *past , unsigned char *future )); + +#undef P diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.cpp new file mode 100644 index 00000000000..165ce3158c8 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.cpp @@ -0,0 +1,1001 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with this file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +/* This software is modified on January 15, 1995 by: + * + * Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +//#include "ace/OS.h" +#include "ace/Log_Msg.h" +/* include <stdio.h> +include <errno.h> +include <stdlib.h> +include <sys/types.h> +include <sys/uio.h> +include <unistd.h> */ +#include <X11/IntrinsicP.h> +#include <Xm/DialogS.h> +#include "mpeg_mib/mibload.h" +#include "interface/fb.xbm" +#include "interface/play.xbm" +#include "interface/step.xbm" +#include "interface/stop.xbm" +#include "interface/loop.xbm" +#include "interface/ff.xbm" +#include "interface/MainWindow.mib" +#include "interface/Info.mib" +#include "video.h" + +#include "include/common.h" +#include "newproto.h" +#include "global.h" + + +ACE_RCSID(mpeg_client, ui, "$Id$") + +int cmdBusy = 0; + +extern char infomessage[]; + +/*****************************************************************************/ + +/* Private Variables and Methods */ + +static int playtag = 0; +static int cmdSocket = -1; + +/* Intrinsics Application Context */ +static XtAppContext App; +static Window monitorwindow = (int)0; +static mib_Widget *mainload, *infoload; +static Widget shell = (int)0, infoshell = (int)0, + parashell = (int)0, progshell = (int)0, + fileshell = (int)0; +static Widget frametext= (int)0; +static Widget volumescale = (int)0, balancescale = (int)0, + speedscale = (int)0, positionscale = (int)0; +static int frameshown = 0; + +#define MINX 500 +#define MINY 360 + +static Window displaywin = (int)0; +static int privcolormap = 0; + +static void exit_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void info_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void para_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void prog_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void file_callback(Widget, XtPointer, XmAnyCallbackStruct *); + +static void loopchange_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void normal_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void fb_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void stop_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void ff_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void step_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void play_callback(Widget, XtPointer, XmAnyCallbackStruct *); + +static void volume_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void balance_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void speed_callback(Widget, XtPointer, XmAnyCallbackStruct *); +static void position_callback(Widget, XtPointer, XmAnyCallbackStruct *); + +static void cmdSocket_callback(Widget, XtPointer, XmAnyCallbackStruct *); + +static void monitor_expose(Widget, XtPointer, XmDrawingAreaCallbackStruct *); + +static void infoclose_callback(Widget, XtPointer, XmAnyCallbackStruct *); + +static void CmdWrite(char * buf, int size) +{ + // ACE_DEBUG ((LM_DEBUG,"(%P|%t)before writing cmd\n")); + while (ACE_OS::write(cmdSocket, (buf), (size)) == -1) + { + if (errno == EINTR) continue; + ACE_OS::perror ("UI write to cmdSocket"); + ACE_OS::exit (1); + } + // ACE_DEBUG ((LM_DEBUG,"(%P|%t)After writing cmd\n")); +} + +/***************************************************************************** + + UICreate: Create/load in a motif interface. + + *****************************************************************************/ + +static void UICreate() +{ + + Widget toplevel; + + Widget mainwindow, + temp; + + Pixel fg, bg; + Pixmap button_pix; + + XmFontList fontlist; + XFontStruct * font; + + Arg args[20]; + int n, depth; + + static String fallbacks[] = { + "*Foreground: black", + "*BorderWidth: 0", + "*Background: lavender", + "*XmToggleButton.selectColor: yellow", + "*XmToggleButton.indicatorSize: 16", + "*XmToggleButtonGadget.selectColor: yellow", + "*XmToggleButtonGadget.indicatorSize: 16", + "*fontList: -adobe-helvetica-medium-r-normal--14-*-*-*-p-*-iso8859-1", + "*XmText*fontList: -adobe-courier-medium-r-normal--12-*-*-*-m-70-iso8859-1", + 0 + }; + +/*****************************************************************************/ + + n = 0; + + toplevel = XtAppInitialize(&App, "virtual_vcr", 0, 0, &argc_share, + argv_share, fallbacks, args, n); + + display = XtDisplay(toplevel); + +/******************************************************************************/ + + n = 0; + XtSetArg(args[n], XmNtitle, "TAO Mpeg Player"); n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING);n++; + XtSetArg(args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; + XtSetArg(args[n], XmNwidth, MINX); n++; + XtSetArg(args[n], XmNminWidth, MINX); n++; + XtSetArg(args[n], XmNheight, MINY); n++; + XtSetArg(args[n], XmNminHeight, MINY); n++; + + shell = XtAppCreateShell("TAO Mpeg Player", "virtual_vcr", + topLevelShellWidgetClass, display, args, n); + +/*****************************************************************************/ + + n = 0; + XtSetArg(args[n], XmNtitle, "TAO Mpeg Player"); n++; + + mainwindow = XmCreateForm(shell, "MainForm", args, n); + XtManageChild(mainwindow); + { + XmStringCharSet cset = XmSTRING_DEFAULT_CHARSET; + XmString titleString; + + font = XLoadQueryFont (XtDisplay (shell), "courB14"); + fontlist = XmStringCreateFontList (font, cset); + + + titleString = XmStringCreateLtoR ("Balance", cset); + n = 0; + XtSetArg (args[n], XmNfontList, fontlist); n++; + XtSetArg (args[n], XmNshowValue, True); n++; + XtSetArg (args[n], XmNtitleString, titleString); n++; + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + XtSetArg (args[n], XmNmaximum, 100); n++; + XtSetArg (args[n], XmNvalue, 50); n++; + XtSetArg (args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++; + XtSetArg (args[n], XmNscaleHeight, 17);n++; + XtSetArg (args[n], XmNscaleWidth, 100);n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, 4);n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, 8);n++; + balancescale = XmCreateScale(mainwindow, "scale", args, n); + XmStringFree (titleString); + XtManageChild (balancescale); + XtAddCallback (balancescale, XmNvalueChangedCallback, (XtCallbackProc)balance_callback, 0); + XtAddCallback (balancescale, XmNdragCallback, (XtCallbackProc)balance_callback, 0); + + + titleString = XmStringCreateLtoR ("Volume", cset); + n = 0; + XtSetArg (args[n], XmNfontList, fontlist); n++; + XtSetArg (args[n], XmNshowValue, True); n++; + XtSetArg (args[n], XmNtitleString, titleString); n++; + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + XtSetArg (args[n], XmNmaximum, 100); n++; + XtSetArg (args[n], XmNvalue, DEFAULT_volume); n++; + XtSetArg (args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++; + XtSetArg (args[n], XmNscaleHeight, 17);n++; + XtSetArg (args[n], XmNscaleWidth, 100);n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, 4);n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, 128);n++; + volumescale = XmCreateScale(mainwindow, "scale", args, n); + XmStringFree (titleString); + XtManageChild (volumescale); + XtAddCallback (volumescale, XmNvalueChangedCallback, (XtCallbackProc)volume_callback, 0); + XtAddCallback (volumescale, XmNdragCallback, (XtCallbackProc)volume_callback, 0); + + + titleString = XmStringCreateLtoR ("Play Speed", cset); + n = 0; + XtSetArg (args[n], XmNfontList, fontlist); n++; + XtSetArg (args[n], XmNshowValue, True); n++; + XtSetArg (args[n], XmNtitleString, titleString); n++; + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + XtSetArg (args[n], XmNmaximum, 100); n++; + XtSetArg (args[n], XmNvalue, 50); n++; + XtSetArg (args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++; + XtSetArg (args[n], XmNscaleHeight, 17);n++; + XtSetArg (args[n], XmNscaleWidth, 100);n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, 4);n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, 248);n++; + speedscale = XmCreateScale(mainwindow, "scale", args, n); + XmStringFree (titleString); + XtManageChild (speedscale); + XtAddCallback (speedscale, XmNvalueChangedCallback, (XtCallbackProc)speed_callback, 0); + XtAddCallback (speedscale, XmNdragCallback, (XtCallbackProc)speed_callback, 0); + + + titleString = XmStringCreateLtoR ("Position", cset); + n = 0; + XtSetArg (args[n], XmNfontList, fontlist); n++; + XtSetArg (args[n], XmNshowValue, True); n++; + XtSetArg (args[n], XmNtitleString, titleString); n++; + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + XtSetArg (args[n], XmNmaximum, POSITION_RANGE); n++; + XtSetArg (args[n], XmNprocessingDirection, XmMAX_ON_RIGHT); n++; + XtSetArg (args[n], XmNscaleHeight, 17);n++; + XtSetArg (args[n], XmNscaleWidth, 100);n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, 4);n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, 368);n++; + positionscale = XmCreateScale(mainwindow, "scale", args, n); + XmStringFree (titleString); + XtManageChild (positionscale); + XtAddCallback (positionscale, XmNvalueChangedCallback, (XtCallbackProc)position_callback, 0); + XtAddCallback (positionscale, XmNdragCallback, (XtCallbackProc)position_callback, 0); + + } + + mainload = mib_load_interface(mainwindow, MainMib, MI_FROMSTRING); + XtSetMappedWhenManaged(shell, False); + XtRealizeWidget(shell); + + frametext = mib_find_name(mainload, "TitleText")->me; +/* XtVaSetValues(frametext, + XmNfontList, fontlist, + XmNcursorPositionVisible, False, + XmNeditable, False, + NULL); +*/ + temp = mib_find_name(mainload, "Monitor")->me; + XtAddCallback(temp, XmNexposeCallback, + (XtCallbackProc) monitor_expose, (XtPointer) 0); + XtVaSetValues(temp, XmNforeground, + BlackPixel(display, DefaultScreen(display)), + XmNbackground, + BlackPixel(display, DefaultScreen(display)), + 0); + monitorwindow = XtWindow(temp); + + temp = mib_find_name(mainload, "Info")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) info_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Para")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) para_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Prog")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) prog_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "File")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) file_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Exit")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) exit_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Loop")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)loop_bits, loop_width, loop_height, fg, bg, depth); + /* + { + int i; + for (i = 0; i < sizeof(loop_bits); i++) + loop_bits[i] = ~loop_bits[i]; + } + */ + XtVaSetValues(temp, + XmNshadowThickness, 2, + + XmNwidth, 45, + XmNheight, 28, + + XmNindicatorType, XmN_OF_MANY, + + XmNindicatorOn, False, + + XmNfillOnSelect, True, + XmNlabelType, XmPIXMAP, + XmNhighlightThickness, 0, + XmNrubberPositioning, False, + XmNlabelPixmap, button_pix, + XmNselectPixmap, button_pix, +/* + XmNselectPixmap, (XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)loop_bits, loop_width, loop_height, fg, bg, depth)), +*/ + 0); + XtAddCallback(temp, XmNvalueChangedCallback, (XtCallbackProc) loopchange_callback, + (XtPointer) 0); +/* + XtAddCallback(temp, XmNarmCallback, (XtCallbackProc) looparm_callback, + (XtPointer) 0); + XtAddCallback(temp, XmNdisarmCallback, (XtCallbackProc) loopdisarm_callback, + (XtPointer) 0); +*/ + temp = mib_find_name(mainload, "Normal")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) normal_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Rewind")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)fb_bits, fb_width, fb_height, fg, bg, depth); + XtVaSetValues(temp, XmNlabelType, XmPIXMAP, + XmNlabelPixmap, button_pix, 0); + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) fb_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Stop")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)stop_bits, stop_width, stop_height, fg, bg, depth); + XtVaSetValues(temp, XmNlabelType, XmPIXMAP, + XmNlabelPixmap, button_pix, 0); + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) stop_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "FF")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)ff_bits, ff_width, ff_height, fg, bg, depth); + XtVaSetValues(temp, XmNlabelType, XmPIXMAP, + XmNlabelPixmap, button_pix, 0); + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) ff_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Step")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)step_bits, step_width, step_height, fg, bg, depth); + XtVaSetValues(temp, XmNlabelType, XmPIXMAP, + XmNlabelPixmap, button_pix, 0); + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) step_callback, + (XtPointer) 0); + + temp = mib_find_name(mainload, "Play")->me; + XtVaGetValues(temp, XmNforeground, &fg, + XmNbackground, &bg, XmNdepth, &depth, NULL); + button_pix = XCreatePixmapFromBitmapData(display, DefaultRootWindow(display), + (char *)play_bits, play_width, play_height, fg, bg, depth); + XtVaSetValues(temp, XmNlabelType, XmPIXMAP, + XmNlabelPixmap, button_pix, NULL); + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) play_callback, + (XtPointer) 0); + +/*****************************************************************************/ + + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR Infomation"); n++; + XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING);n++; + XtSetArg(args[n], XmNkeyboardFocusPolicy, XmPOINTER); n++; + XtSetArg(args[n], XmNwidth, MINX); n++; + XtSetArg(args[n], XmNheight, MINY); n++; + /* + infoshell = XtAppCreateShell("Info", "virtual_vcr", + topLevelShellWidgetClass, display, args, n); + */ + temp = XmCreateDialogShell(shell, "virtual_vcr", args, n); + n = 0; + XtSetArg(args[n], XmNtitle, "Virtual VCR Infomation"); n++; + + infoshell = XmCreateForm(temp, "virtual_vcr", args, n); + infoload = mib_load_interface(infoshell, InfoMib, + MI_FROMSTRING); + + temp = mib_find_name(infoload, "Dismiss")->me; + XtAddCallback(temp, XmNactivateCallback, (XtCallbackProc) infoclose_callback, + (XtPointer) 0); + + temp = mib_find_name(infoload, "TextBig")->me; + XtVaSetValues(temp, XmNcursorPositionVisible, False, + XmNeditable, False, 0); + XmTextSetString(temp, infomessage); + +// XmFontListFree (fontlist); + + parashell = CreateParameterWindow(shell); + + progshell = CreateProgramWindow(shell, cmdSocket, &playtag, frametext); + + fileshell = CreateFileWindow(shell, cmdSocket, &playtag, frametext); + +} + +/*****************************************************************************/ + +Window MonitorWindow() +{ + return monitorwindow; +} + +/*****************************************************************************/ + +void UISetColormap() +{ + privcolormap = 1; +} + +/*****************************************************************************/ + +void UISetwin(Window win) +{ + displaywin = win; +} + +/*****************************************************************************/ + +void UISetFrame() +{ + char framestr[100]; + + sprintf(framestr, "%d of %d", shared->currentDisplay, shared->totalFrames); + XmTextFieldSetString(frametext, framestr); +} + +/*****************************************************************************/ + +void UIMinsize(int x, int y) +{ + int minx; + int miny; + int winx; + int winy; + + winx = x; + winy = y; + + x += 30; + y += 180; + + if (x < 450) x = MINX; + if (y < 350) y = MINY; + + minx = x; miny = y; + + if (privcolormap) + { + XtVaSetValues(shell, XmNcolormap, cmap, 0); + } + if (shell) + { + XtResizeWidget(shell, (Dimension)minx, (Dimension)miny, (Dimension)0); + XtVaSetValues(shell, + XmNminWidth, MINX, + XmNminHeight, MINY, + XmNmaxWidth, minx, + XmNmaxHeight, miny, + 0); + + XtMapWidget(shell); /* Map the shell now to avoid disappearing buttons! */ + if (displaywin) + { + x = winx; y = winy; + winx = minx - 30; winy = miny - 180; + XMoveWindow(display, displaywin, (winx - x)/2, (winy - y)/2+12); + } + } +} + +/***************************************************************************** + + From here on we have private methods: + + *****************************************************************************/ + +static void exit_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + ACE_OS::exit (0); +} + + +static void info_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + /* + XtRealizeWidget(infoshell); + */ + XtManageChild(infoshell); +} + +static void infoclose_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + /* + XtUnrealizeWidget(infoshell); + */ + XtUnmanageChild(infoshell); +} + +static void para_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + + XtRealizeWidget(parashell); + /* + XtManageChild(parashell); + */ +} + +static void prog_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + + XtRealizeWidget(progshell); + /* + XtManageChild(progshell); + */ +} + +static void file_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + /* + XtRealizeWidget(fileshell); + */ + XtManageChild (fileshell); +} + +/*****************************************************************************/ + +static void loopchange_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + static int loop = 0; + loop = !loop; + if (playtag) + { + char cmd = loop ? CmdLOOPenable : CmdLOOPdisable; + CmdWrite(&cmd, 1); + } + else + beep(); +} + +static void normal_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +/* set speed bar, suppose speed_callback should be called automatically */ +{ + char cmd = CmdSPEED; + int value = 50; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d\n",__FILE__,__LINE__)); + XmScaleSetValue(speedscale, 50); +} + +static void fb_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + if (playtag && !cmdBusy) + { + char cmd = CmdFB; + cmdBusy = 1; + CmdWrite(&cmd, 1); + } + else + beep(); +} + +static void stop_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + if (playtag && !cmdBusy) + { + char cmd = CmdSTOP; + cmdBusy = 1; + CmdWrite(&cmd, 1); + } + else + beep(); +} + +static void ff_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + if (playtag && !cmdBusy) + { + char cmd = CmdFF; + cmdBusy = 1; + CmdWrite(&cmd, 1); + } + else + beep(); +} + + +static void step_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + if (playtag && !cmdBusy) + { + char cmd = CmdSTEP; + cmdBusy = 1; + CmdWrite(&cmd, 1); + } + else { + /* + beep(); + */ + } +} + +static void play_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + ACE_DEBUG ((LM_DEBUG,"(%P)play_callback:cmdbusy= %d,playtag=%d\n",cmdBusy,playtag)); + if (playtag && !cmdBusy) + { + char cmd = CmdPLAY; + cmdBusy = 1; + CmdWrite(&cmd, 1); + } + else + beep(); +} + +static void volume_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + char cmd; + XmScaleCallbackStruct * call_value = (XmScaleCallbackStruct *) cbs; + int value = call_value ->value; + + switch (call_value->reason) + { + case XmCR_VALUE_CHANGED: + case XmCR_DRAG: + cmd = CmdVOLUME; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + break; + default: + fprintf(stderr, "Hit the default, incorrect reason sent for scale!!\n"); + break; + } +} + +static void speed_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + char cmd; + XmScaleCallbackStruct * call_value = (XmScaleCallbackStruct *) cbs; + int value = call_value ->value; + + switch (call_value->reason) + { + case XmCR_VALUE_CHANGED: + case XmCR_DRAG: + cmd = CmdSPEED; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + break; + default: + ACE_OS::fprintf(stderr, "Hit the default, incorrect reason sent for scale!!\n"); + break; + } +} + +static void balance_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + char cmd; + XmScaleCallbackStruct * call_value = (XmScaleCallbackStruct *) cbs; + int value = call_value ->value; + + switch (call_value->reason) + { + case XmCR_VALUE_CHANGED: + case XmCR_DRAG: + cmd = CmdBALANCE; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + break; + default: + ACE_OS::fprintf(stderr, "Hit the default, incorrect reason sent for scale!!\n"); + break; + } +} + +static void position_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + char cmd; + XmScaleCallbackStruct * call_value = (XmScaleCallbackStruct *) cbs; + int value = call_value ->value; + + switch (call_value->reason) + { + case XmCR_VALUE_CHANGED: + if (playtag && !cmdBusy) + { + cmdBusy = 1; + cmd = CmdPOSITIONrelease; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + } + else + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d\n",__FILE__,__LINE__)); + XmScaleSetValue(positionscale, shared->locationPosition); + /* + fprintf(stderr, "UI: shared->cmd = %d\n", shared->cmd); + if (shared->cmd != CmdPOSITION) + beep(); + */ + } + + break; + case XmCR_DRAG: + if (playtag && !cmdBusy) + { + cmdBusy = 1; + cmd = CmdPOSITION; + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + } + break; + default: + ACE_OS::fprintf(stderr, "Hit the default, incorrect reason sent for scale!!\n"); + break; + } +} + +static void cmdSocket_callback(Widget w, XtPointer data, XmAnyCallbackStruct *cbs) +{ + char cmd; +/* + fprintf(stderr, "UI in CmdSocket_callback.\n"); +*/ + while (read(cmdSocket, &cmd, 1) <= 0) + { + if (errno == EINTR) return; + ACE_OS::perror ("UI by callback read from CmdSocket"); + ACE_OS::exit (1); + } + // ACE_DEBUG ((LM_DEBUG,"(%P)cmdSocket_callback:cmd= %d",cmd)); + if (cmd == CmdDONE || cmd == CmdFAIL) + { + cmdBusy = 0; + if (shared->cmd == CmdINIT) + { + if (cmd == CmdDONE) + { + char cmd = CmdSPEED; + int value = 50; + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d\n",__FILE__,__LINE__)); + XmScaleSetValue(speedscale, 50); + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d\n",__FILE__,__LINE__)); + XmScaleSetValue(positionscale, 0); + CmdWrite(&cmd, 1); + CmdWrite((char *)&value, 4); + /* + fprintf(stderr, "UI: VCR program successfully initialized.\n"); + */ + playtag = 1; + } + else + { + ACE_OS::fprintf(stderr, "UI: VCR program initialization failed.\n"); + playtag = 0; + } + } + else { + /* + fprintf(stderr, "UI: cmd-%d finished successfully.\n", shared->cmd); + */ + } + /* + UISetFrame(); + */ + } + else + { + static int prepos = 0; + int curpos; + char * ptr; + + if (cmd == CmdVPdisplayFrame) { + ACE_OS::read (cmdSocket, (char *)&ptr, sizeof(char *)); + } + VPcommand((int)cmd, ptr); + + if (cmd == CmdVPaudioPosition) + { + curpos = (shared->nextSample * 100) / shared->totalSamples; + if (shared->cmd == CmdPLAY && + (curpos <= prepos - 1 || curpos >= prepos + 1)) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d,positionscale = %d,curpos = %d\n", + // __FILE__,__LINE__,positionscale,curpos)); + XmScaleSetValue(positionscale, curpos); + prepos = curpos; + } + } + else if (cmd == CmdVPdisplayFrame && shared->totalFrames) + { + curpos = (shared->currentDisplay * 100) / shared->totalFrames; + if ((shared->cmd == CmdSTEP || shared->cmd == CmdPLAY || + shared->cmd == CmdFF || shared->cmd == CmdFB) && + (curpos <= prepos - 1 || curpos >= prepos + 1)) + { + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Reached in %s line %d\n",__FILE__,__LINE__)); + XmScaleSetValue(positionscale, curpos); + prepos = curpos; + } + } + } +} + +static void monitor_expose(Widget w, XtPointer data, + XmDrawingAreaCallbackStruct *cbs) +{ + VPexpose(); +} + +#define BUFSIZE 256 + +void UIprocess(int cmdSock) +{ + char *title, *vh, *vf, *vb, *ah, *af, *ab; + int i; + cmdSocket = cmdSock; + UICreate(); + + VPinitWindow(shell, monitorwindow, cmdSock); + XtAppAddInput(App, cmdSock, (XtPointer)XtInputReadMask, + (XtInputCallbackProc)cmdSocket_callback, 0); + + title = vh = vf = vb = ah = af = ab = 0; + + for (i = 1; i < argc_share; i++) { + if (ACE_OS::strcmp (argv_share[i], "-v") == 0) { + if (argc_share > i + 1) { + i ++; + vh = argv_share[i]; + cerr << "vh = " << vh << endl; + } + else break; + } + else if (ACE_OS::strcmp (argv_share[i], "-a") == 0) { + if (argc_share > i + 1) { + i ++; + ah = argv_share[i]; + cerr << "ah = " << ah << endl; + } + else break; + } + else if (ACE_OS::strcmp (argv_share[i], "-p") == 0) { + if (argc_share > i + 1) { + i ++; + title = argv_share[i]; + } + } + } + + if (title != 0) { /* the init program is supplied by -l */ + cerr << "title is not null \n"; + FILE * fp; + char buf[PATH_SIZE]; + char vh[PATH_SIZE]; + char vf[PATH_SIZE]; + char ah[PATH_SIZE]; + char af[PATH_SIZE]; + + get_full_path(title, buf, 256); + fp = fopen(buf, "r"); + if (fp != 0) { + if ((!feof(fp)) && fgets(buf, PATH_SIZE, fp) != 0) { + buf[strlen(buf)-1] = 0; + } + else buf[0] = 0; + if ((!feof(fp)) && fgets(vh, PATH_SIZE, fp) != 0) { + vh[strlen(vh)-1] = 0; + } + else vh[0] = 0; + if ((!feof(fp)) && fgets(vf, PATH_SIZE, fp) != 0) { + vf[strlen(vf)-1] = 0; + } + else vf[0] = 0; + if ((!feof(fp)) && fgets(ah, PATH_SIZE, fp) != 0) { + ah[strlen(ah)-1] = 0; + } + else ah[0] = 0; + if ((!feof(fp)) && fgets(af, PATH_SIZE, fp) != 0) { + af[strlen(af)-1] = 0; + } + else af[0] = 0; + + fclose(fp); + Fprintf(stderr, "Init program: title %s, vh %s, vf %s, ah %s, af %s\n", + buf, vh, vf, ah, af); + StartProgram(buf, vh, vf, ah, af); + } + } + else if (vh != 0 || ah != 0) {/* init program supplied by -v and -a */ + char *ptr; + + /* form the title */ + if (vh != 0) { + title = (char *)ACE_OS::malloc(strlen(vh) + 1); + if (title != 0) { + strcpy(title, vh); + } + } + else { + title = (char *)ACE_OS::malloc(strlen(ah) + 1); + if (title != 0) { + strcpy(title, ah); + } + } + if (title == 0) { + title = "The program from the command line"; + } + + /* generate vh and vf */ + if (vh != 0) { + if ((ptr = strchr(vh, ':')) != 0) { + * ptr = 0; + vf = ptr + 1; + } + else { + vf = vh; + vh = ""; + } + } + else vh = vf = ""; + + /* generate ah and af */ + if (ah != 0) { + if ((ptr = strchr(ah, ':')) != 0) { + * ptr = 0; + af = ptr + 1; + } + else { + af = ah; + ah = ""; + } + } + else ah = af = ""; + + ACE_OS::fprintf(stderr, "Init program: title %s, vh %s, vf %s, ah %s, af %s\n", + title, vh, vf, ah, af); + StartProgram(title, vh, vf, ah, af); + ACE_OS::free (title); + if (ab != 0) ACE_OS::free (ab); + if (vb != 0) ACE_OS::free (vb); + } + + XtAppMainLoop(App); +} + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.h new file mode 100644 index 00000000000..a77b5fdbb4e --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/ui.h @@ -0,0 +1,18 @@ +/* $Id$ */ +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with this file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +void UICreate(); +void UIEnd(); +Window MonitorWindow(); +void UISetwin(Window); +void UIMinsize(int, int); +void UISetFrame(); +void UISetColormap(); diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.cpp new file mode 100644 index 00000000000..e085616b52a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.cpp @@ -0,0 +1,468 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#include "ace/OS.h" +#include <stdlib.h> +#include "video.h" +#include "proto.h" +#include "util.h" + +ACE_RCSID(mpeg_client, util, "$Id$") + +#define TRUE 1 +#define FALSE 0 + +/* Declarations of global variables used. */ + +unsigned int curBits; +int bitOffset; +int bufLength; +unsigned int *bitBuffer; + +/* Bit masks used by bit i/o operations. */ + +unsigned int nBitMask[] = { 0x00000000, 0x80000000, 0xc0000000, 0xe0000000, + 0xf0000000, 0xf8000000, 0xfc000000, 0xfe000000, + 0xff000000, 0xff800000, 0xffc00000, 0xffe00000, + 0xfff00000, 0xfff80000, 0xfffc0000, 0xfffe0000, + 0xffff0000, 0xffff8000, 0xffffc000, 0xffffe000, + 0xfffff000, 0xfffff800, 0xfffffc00, 0xfffffe00, + 0xffffff00, 0xffffff80, 0xffffffc0, 0xffffffe0, + 0xfffffff0, 0xfffffff8, 0xfffffffc, 0xfffffffe}; + +unsigned int bitMask[] = { 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff, + 0x0fffffff, 0x07ffffff, 0x03ffffff, 0x01ffffff, + 0x00ffffff, 0x007fffff, 0x003fffff, 0x001fffff, + 0x000fffff, 0x0007ffff, 0x0003ffff, 0x0001ffff, + 0x0000ffff, 0x00007fff, 0x00003fff, 0x00001fff, + 0x00000fff, 0x000007ff, 0x000003ff, 0x000001ff, + 0x000000ff, 0x0000007f, 0x0000003f, 0x0000001f, + 0x0000000f, 0x00000007, 0x00000003, 0x00000001}; + +unsigned int rBitMask[] = { 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, + 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, + 0xffffff00, 0xfffffe00, 0xfffffc00, 0xfffff800, + 0xfffff000, 0xffffe000, 0xffffc000, 0xffff8000, + 0xffff0000, 0xfffe0000, 0xfffc0000, 0xfff80000, + 0xfff00000, 0xffe00000, 0xffc00000, 0xff800000, + 0xff000000, 0xfe000000, 0xfc000000, 0xf8000000, + 0xf0000000, 0xe0000000, 0xc0000000, 0x80000000}; + +unsigned int bitTest[] = { 0x80000000, 0x40000000, 0x20000000, 0x10000000, + 0x08000000, 0x04000000, 0x02000000, 0x01000000, + 0x00800000, 0x00400000, 0x00200000, 0x00100000, + 0x00080000, 0x00040000, 0x00020000, 0x00010000, + 0x00008000, 0x00004000, 0x00002000, 0x00001000, + 0x00000800, 0x00000400, 0x00000200, 0x00000100, + 0x00000080, 0x00000040, 0x00000020, 0x00000010, + 0x00000008, 0x00000004, 0x00000002, 0x00000001}; + + +/* + *-------------------------------------------------------------- + * + * correct_underflow -- + * + * Called when buffer does not have sufficient data to + * satisfy request for bits. + * Calls get_more_data, an application specific routine + * required to fill the buffer with more data. + * + * Results: + * None really. + * + * Side effects: + * buf_length and buffer fields in curVidStream structure + * may be changed. + * + *-------------------------------------------------------------- + */ + +void +correct_underflow() { + + int status; + + status = get_more_data(curVidStream->buf_start, + curVidStream->max_buf_length, + &bufLength, &bitBuffer); + + if (status < 0) { + if (!quietFlag) { + fprintf (stderr, "\n"); + ACE_OS::perror ("Unexpected read error."); + } + ACE_OS::exit (1); + } + else if ((status == 0) && (bufLength < 1)) { + if (!quietFlag) { + fprintf(stderr, "\nImproper or missing sequence end code.\n"); + } +#ifdef ANALYSIS + PrintAllStats(); +#endif + if (!quietFlag) { + PrintTimeInfo(); + } +/* + if (loopFlag) longjmp(env, 1); + DestroyVidStream(curVidStream); +*/ + ACE_OS::exit (0); + } +#ifdef UTIL2 + curBits = *bitBuffer << bitOffset; +#else + curBits = *bitBuffer; +#endif + +} + + +/* + *-------------------------------------------------------------- + * + * next_bits -- + * + * Compares next num bits to low order position in mask. + * Buffer pointer is NOT advanced. + * + * Results: + * TRUE, FALSE, or error code. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +int next_bits(int num, unsigned int mask) +{ + unsigned int stream; + int ret_value; + + /* If no current stream, return error. */ + + if (curVidStream == NULL) + return NO_VID_STREAM; + + /* Get next num bits, no buffer pointer advance. */ + + show_bitsn(num, stream); + + /* Compare bit stream and mask. Set return value toTRUE if equal, FALSE if + differs. + */ + + if (mask == stream) { + ret_value = TRUE; + } else ret_value = FALSE; + + /* Return return value. */ + + return ret_value; +} + + +/* + *-------------------------------------------------------------- + * + * get_ext_data -- + * + * Assumes that bit stream is at begining of extension + * data. Parses off extension data into dynamically + * allocated space until start code is hit. + * + * Results: + * Pointer to dynamically allocated memory containing + * extension data. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +char *get_ext_data () +{ + int size, marker; + char *dataPtr; + unsigned int data; + + /* Set initial ext data buffer size. */ + + size = EXT_BUF_SIZE; + + /* Allocate ext data buffer. */ + + dataPtr = (char *) ACE_OS::malloc(size); + + /* Initialize marker to keep place in ext data buffer. */ + + marker = 0; + + /* While next data is not start code... */ + while (!next_bits(24, 0x000001)) { + + /* Get next byte of ext data. */ + + get_bits8(data); + + /* Put ext data into ext data buffer. Advance marker. */ + + dataPtr[marker] = (char) data; + marker++; + + /* If end of ext data buffer reached, resize data buffer. */ + + if (marker == size) { + size += EXT_BUF_SIZE; + dataPtr = (char *) realloc(dataPtr, size); + } + } + + /* Realloc data buffer to free any extra space. */ + + dataPtr = (char *) realloc(dataPtr, marker); + + /* Return pointer to ext data buffer. */ + + return dataPtr; +} + + +/* + *-------------------------------------------------------------- + * + * next_start_code -- + * + * Parses off bitstream until start code reached. When done + * next 4 bytes of bitstream will be start code. Bit offset + * reset to 0. + * + * Results: + * Status code. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +int next_start_code() +{ + int state; + int byteoff; + unsigned int data; + + /* If no current stream, return error. */ + + if (curVidStream == NULL) + return NO_VID_STREAM; + + /* If insufficient buffer length, correct underflow. */ +/* + if (bufLength < 2) { + correct_underflow(); + } + */ + + /* If bit offset not zero, reset and advance buffer pointer. */ + + byteoff = bitOffset % 8; + + if (byteoff != 0) { + flush_bits((8-byteoff)); + } + + /* Set state = 0. */ + + state = 0; + + /* While buffer has data ... */ + + while(bufLength > 0) { + + /* If insufficient data exists, correct underflow. */ +/* + if (bufLength < 2) { + correct_underflow(); + } +*/ + /* If next byte is zero... */ + + get_bits8(data); + + if (data == 0) { + + /* If state < 2, advance state. */ + + if (state < 2) state++; + } + + /* If next byte is one... */ + + else if (data == 1) { + + /* If state == 2, advance state (i.e. start code found). */ + + if (state == 2) state++; + + /* Otherwise, reset state to zero. */ + + else state = 0; + } + + /* Otherwise byte is neither 1 or 0, reset state to 0. */ + + else { + state = 0; + } + + /* If state == 3 (i.e. start code found)... */ + + if (state == 3) { + + /* Set buffer pointer back and reset length & bit offsets so + next bytes will be beginning of start code. + */ + + bitOffset = bitOffset - 24; + +#ifdef ANALYSIS + bitCount -= 24; +#endif + + if (bitOffset < 0) { + bitOffset = 32 + bitOffset; + bufLength++; + bitBuffer--; +#ifdef UTIL2 + curBits = *bitBuffer << bitOffset; +#else + curBits = *bitBuffer; +#endif + } + else { +#ifdef UTIL2 + curBits = *bitBuffer << bitOffset; +#else + curBits = *bitBuffer; +#endif + } + + /* Return success. */ + + return OK; + } + } + + /* Return underflow error. */ + + return UNDERFLOW; +} + + +/* + *-------------------------------------------------------------- + * + * get_extra_bit_info -- + * + * Parses off extra bit info stream into dynamically + * allocated memory. Extra bit info is indicated by + * a flag bit set to 1, followed by 8 bits of data. + * This continues until the flag bit is zero. Assumes + * that bit stream set to first flag bit in extra + * bit info stream. + * + * Results: + * Pointer to dynamically allocated memory with extra + * bit info in it. Flag bits are NOT included. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +char *get_extra_bit_info () +{ + int size, marker; + char *dataPtr; + unsigned int data; + + /* Get first flag bit. */ + get_bits1(data); + + /* If flag is false, return NULL pointer (i.e. no extra bit info). */ + + if (!data) return NULL; + + /* Initialize size of extra bit info buffer and allocate. */ + + size = EXT_BUF_SIZE; + dataPtr = (char *) ACE_OS::malloc(size); + + /* Reset marker to hold place in buffer. */ + + marker = 0; + + /* While flag bit is true. */ + + while (data) { + + /* Get next 8 bits of data. */ + get_bits8(data); + + /* Place in extra bit info buffer. */ + + dataPtr[marker] = (char) data; + marker++; + + /* If buffer is full, reallocate. */ + + if (marker == size) { + size += EXT_BUF_SIZE; + dataPtr = (char *) realloc(dataPtr, size); + } + + /* Get next flag bit. */ + get_bits1(data); + } + + /* Reallocate buffer to free extra space. */ + + dataPtr = (char *) realloc(dataPtr, marker); + + /* Return pointer to extra bit info buffer. */ + + return dataPtr; +} + + + + + + + + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.h new file mode 100644 index 00000000000..3c68ea365cd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util.h @@ -0,0 +1,368 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* Status codes for bit stream i/o operations. */ + +#ifndef AV_UTIL_H +#define AV_UTIL_H + +#define NO_VID_STREAM -1 +#define UNDERFLOW -2 +#define OK 1 +/* Size increment of extension data buffers. */ + +#define EXT_BUF_SIZE 1024 + +/* External declarations for bitstream i/o operations. */ +extern unsigned int bitMask[]; +extern unsigned int nBitMask[]; +extern unsigned int rBitMask[]; +extern unsigned int bitTest[]; + +/* External declarations of bitstream global variables. */ +extern unsigned int curBits; +extern int bitOffset; +extern int bufLength; +extern unsigned int *bitBuffer; + +/* Macro for updating bit counter if analysis tool is on. */ +#ifdef ANALYSIS +#define UPDATE_COUNT(numbits) bitCount += numbits +#else +#define UPDATE_COUNT(numbits) +#endif + +#ifdef NO_SANITY_CHECKS +#define get_bits1(result) \ +{ \ + UPDATE_COUNT(1); \ + result = ((curBits & 0x80000000) != 0); \ + curBits <<= 1; \ + bitOffset++; \ + \ + if (bitOffset & 0x20) { \ + bitOffset = 0; \ + bitBuffer++; \ + curBits = *bitBuffer; \ + bufLength--; \ + } \ +} + +#define get_bits2(result) \ +{ \ + UPDATE_COUNT(2); \ + bitOffset += 2; \ + \ + if (bitOffset & 0x20) { \ + bitOffset -= 32; \ + bitBuffer++; \ + bufLength--; \ + if (bitOffset) { \ + curBits |= (*bitBuffer >> (2 - bitOffset)); \ + } \ + result = ((curBits & 0xc0000000) >> 30); \ + curBits = *bitBuffer << bitOffset; \ + } \ + \ + result = ((curBits & 0xc0000000) >> 30); \ + curBits <<= 2; \ +} + +#define get_bitsX(num, mask, shift, result) \ +{ \ + UPDATE_COUNT(num); \ + bitOffset += num; \ + \ + if (bitOffset & 0x20) { \ + bitOffset -= 32; \ + bitBuffer++; \ + bufLength--; \ + if (bitOffset) { \ + curBits |= (*bitBuffer >> (num - bitOffset)); \ + } \ + result = ((curBits & mask) >> shift); \ + curBits = *bitBuffer << bitOffset; \ + } \ + else { \ + result = ((curBits & mask) >> shift); \ + curBits <<= num; \ + } \ +} +#else + +#define get_bits1(result) \ +{ \ + /* Check for underflow. */ \ + /* \ + if (bufLength < 2) { \ + correct_underflow(); \ + } */ \ + UPDATE_COUNT(1); \ + result = ((curBits & 0x80000000) != 0); \ + curBits <<= 1; \ + bitOffset++; \ + \ + if (bitOffset & 0x20) { \ + bitOffset = 0; \ + bitBuffer++; \ + curBits = *bitBuffer; \ + bufLength--; \ + } \ +} + +#define get_bits2(result) \ +{ \ + /* Check for underflow. */ \ + /* \ + if (bufLength < 2) { \ + correct_underflow(); \ + } */ \ + UPDATE_COUNT(2); \ + bitOffset += 2; \ + \ + if (bitOffset & 0x20) { \ + bitOffset -= 32; \ + bitBuffer++; \ + bufLength--; \ + if (bitOffset) { \ + curBits |= (*bitBuffer >> (2 - bitOffset)); \ + } \ + result = ((curBits & 0xc0000000) >> 30); \ + curBits = *bitBuffer << bitOffset; \ + } \ + \ + result = ((curBits & 0xc0000000) >> 30); \ + curBits <<= 2; \ +} + +#define get_bitsX(num, mask, shift, result) \ +{ \ + /* Check for underflow. */ \ + /* \ + if (bufLength < 2) { \ + correct_underflow(); \ + } */ \ + UPDATE_COUNT(num); \ + bitOffset += num; \ + \ + if (bitOffset & 0x20) { \ + bitOffset -= 32; \ + bitBuffer++; \ + bufLength--; \ + if (bitOffset) { \ + curBits |= (*bitBuffer >> (num - bitOffset)); \ + } \ + result = ((curBits & mask) >> shift); \ + curBits = *bitBuffer << bitOffset; \ + } \ + else { \ + result = ((curBits & mask) >> shift); \ + curBits <<= num; \ + } \ +} +#endif + +#define get_bits3(result) get_bitsX(3, 0xe0000000, 29, result) +#define get_bits4(result) get_bitsX(4, 0xf0000000, 28, result) +#define get_bits5(result) get_bitsX(5, 0xf8000000, 27, result) +#define get_bits6(result) get_bitsX(6, 0xfc000000, 26, result) +#define get_bits7(result) get_bitsX(7, 0xfe000000, 25, result) +#define get_bits8(result) get_bitsX(8, 0xff000000, 24, result) +#define get_bits9(result) get_bitsX(9, 0xff800000, 23, result) +#define get_bits10(result) get_bitsX(10, 0xffc00000, 22, result) +#define get_bits11(result) get_bitsX(11, 0xffe00000, 21, result) +#define get_bits12(result) get_bitsX(12, 0xfff00000, 20, result) +#define get_bits14(result) get_bitsX(14, 0xfffc0000, 18, result) +#define get_bits16(result) get_bitsX(16, 0xffff0000, 16, result) +#define get_bits18(result) get_bitsX(18, 0xffffc000, 14, result) +#define get_bits32(result) get_bitsX(32, 0xffffffff, 0, result) + +#define get_bitsn(num, result) get_bitsX((num), nBitMask[num], (32-(num)), result) + +#ifdef NO_SANITY_CHECKS +#define show_bits32(result) \ +{ \ + if (bitOffset) { \ + result = curBits | (*(bitBuffer+1) >> (32 - bitOffset)); \ + } \ + else { \ + result = curBits; \ + } \ +} + +#define show_bitsX(num, mask, shift, result) \ +{ \ + int bO; \ + bO = bitOffset + num; \ + if (bO > 32) { \ + bO -= 32; \ + result = ((curBits & mask) >> shift) | \ + (*(bitBuffer+1) >> (shift + (num - bO))); \ + } \ + else { \ + result = ((curBits & mask) >> shift); \ + } \ +} + +#else +#define show_bits32(result) \ +{ \ + /* Check for underflow. */ \ + /* if (bufLength < 2) { \ + correct_underflow(); \ + } */ \ + if (bitOffset) { \ + result = curBits | (*(bitBuffer+1) >> (32 - bitOffset)); \ + } \ + else { \ + result = curBits; \ + } \ +} + +#define show_bitsX(num, mask, shift, result) \ +{ \ + int bO; \ + \ + /* Check for underflow. */ \ + /* if (bufLength < 2) { \ + correct_underflow(); \ + } */ \ + bO = bitOffset + num; \ + if (bO > 32) { \ + bO -= 32; \ + result = ((curBits & mask) >> shift) | \ + (*(bitBuffer+1) >> (shift + (num - bO))); \ + } \ + else { \ + result = ((curBits & mask) >> shift); \ + } \ +} +#endif + +#define show_bits1(result) show_bitsX(1, 0x80000000, 31, result) +#define show_bits2(result) show_bitsX(2, 0xc0000000, 30, result) +#define show_bits3(result) show_bitsX(3, 0xe0000000, 29, result) +#define show_bits4(result) show_bitsX(4, 0xf0000000, 28, result) +#define show_bits5(result) show_bitsX(5, 0xf8000000, 27, result) +#define show_bits6(result) show_bitsX(6, 0xfc000000, 26, result) +#define show_bits7(result) show_bitsX(7, 0xfe000000, 25, result) +#define show_bits8(result) show_bitsX(8, 0xff000000, 24, result) +#define show_bits9(result) show_bitsX(9, 0xff800000, 23, result) +#define show_bits10(result) show_bitsX(10, 0xffc00000, 22, result) +#define show_bits11(result) show_bitsX(11, 0xffe00000, 21, result) +#define show_bits12(result) show_bitsX(12, 0xfff00000, 20, result) +#define show_bits13(result) show_bitsX(13, 0xfff80000, 19, result) +#define show_bits14(result) show_bitsX(14, 0xfffc0000, 18, result) +#define show_bits15(result) show_bitsX(15, 0xfffe0000, 17, result) +#define show_bits16(result) show_bitsX(16, 0xffff0000, 16, result) +#define show_bits17(result) show_bitsX(17, 0xffff8000, 15, result) +#define show_bits18(result) show_bitsX(18, 0xffffc000, 14, result) +#define show_bits19(result) show_bitsX(19, 0xffffe000, 13, result) +#define show_bits20(result) show_bitsX(20, 0xfffff000, 12, result) +#define show_bits21(result) show_bitsX(21, 0xfffff800, 11, result) +#define show_bits22(result) show_bitsX(22, 0xfffffc00, 10, result) +#define show_bits23(result) show_bitsX(23, 0xfffffe00, 9, result) +#define show_bits24(result) show_bitsX(24, 0xffffff00, 8, result) +#define show_bits25(result) show_bitsX(25, 0xffffff80, 7, result) +#define show_bits26(result) show_bitsX(26, 0xffffffc0, 6, result) +#define show_bits27(result) show_bitsX(27, 0xffffffe0, 5, result) +#define show_bits28(result) show_bitsX(28, 0xfffffff0, 4, result) +#define show_bits29(result) show_bitsX(29, 0xfffffff8, 3, result) +#define show_bits30(result) show_bitsX(30, 0xfffffffc, 2, result) +#define show_bits31(result) show_bitsX(31, 0xfffffffe, 1, result) + +#define show_bitsn(num,result) show_bitsX((num), (0xffffffff << (32-(num))), (32-(num)), result) + +#ifdef NO_SANITY_CHECKS +#define flush_bits32 \ +{ \ + UPDATE_COUNT(32); \ + \ + bitBuffer++; \ + bufLength--; \ + curBits = *bitBuffer << bitOffset; \ +} + +#define flush_bits(num) \ +{ \ + bitOffset += num; \ + \ + UPDATE_COUNT(num); \ + \ + if (bitOffset & 0x20) { \ + bitOffset -= 32; \ + bitBuffer++; \ + bufLength--; \ + curBits = *bitBuffer << bitOffset; \ + } \ + else { \ + curBits <<= num; \ + } \ +} +#else +#define flush_bits32 \ +{ \ + if (curVidStream == NULL) { \ + /* Deal with no vid stream here. */ \ + } \ + /* \ + if (bufLength < 2) { \ + correct_underflow(); \ + } \ + */ \ + UPDATE_COUNT(32); \ + \ + bitBuffer++; \ + bufLength--; \ + curBits = *bitBuffer << bitOffset; \ +} + +#define flush_bits(num) \ +{ \ + if (curVidStream == NULL) { \ + /* Deal with no vid stream here. */ \ + } \ + /* \ + if (bufLength < 2) { \ + correct_underflow(); \ + } \ + */ \ + UPDATE_COUNT(num); \ + \ + bitOffset += num; \ + \ + if (bitOffset & 0x20) { \ + bufLength--; \ + bitOffset -= 32; \ + bitBuffer++; \ + curBits = *bitBuffer << bitOffset; \ + } \ + else { \ + curBits <<= num; \ + } \ +} +#endif + +#define UTIL2 + +#endif /* if !defined (AV_UTIL_H) */ + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util32.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util32.cpp new file mode 100644 index 00000000000..38a7926427d --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/util32.cpp @@ -0,0 +1,81 @@ +/* $Id$ */ + +#include "ace/OS.h" +#include <stdio.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include "video.h" +#include "proto.h" +#include "ui.h" /* include user interface */ + +ACE_RCSID(mpeg_client, util32, "$Id$") + +/* + * Return a pointer to a full color bit visual on the dpy + */ +Visual * +FindFullColorVisual (Display *dpy, int *depth) +{ + XVisualInfo vinfo; + XVisualInfo *vinfo_ret; + int numitems, maxdepth; + +#ifdef __cplusplus + vinfo.c_class = TrueColor; +#else + vinfo.class = TrueColor; +#endif + vinfo_ret = XGetVisualInfo(dpy, VisualClassMask, &vinfo, &numitems); + + if (numitems == 0) return NULL; + + maxdepth = 0; + while(numitems > 0) { + if (vinfo_ret[numitems-1].depth > maxdepth) { + maxdepth = vinfo_ret[numitems-1 ].depth; + } + numitems--; + } + XFree(vinfo_ret); + + if (maxdepth < 24) return NULL; + + if (XMatchVisualInfo(dpy, DefaultScreen(dpy), maxdepth, + TrueColor, &vinfo)) { + *depth = maxdepth; + return vinfo.visual; + } + + return NULL; +} + +Window +CreateFullColorWindow (Display *dpy, int x, int y, int w, int h) +{ + int depth; + Visual *visual; + XSetWindowAttributes xswa; + Window temp; + unsigned int mask; + unsigned int valclass; + int screen; + + screen = XDefaultScreen(dpy); + valclass = InputOutput; /* Could be InputOnly */ + visual = FindFullColorVisual (dpy, &depth); + if (visual == NULL) { + return 0; + } + mask = CWBackPixel | CWColormap | CWBorderPixel; + xswa.colormap = XCreateColormap(dpy, XRootWindow(dpy, screen), + visual, AllocNone); + xswa.background_pixel = BlackPixel(dpy, DefaultScreen(dpy)); + xswa.border_pixel = WhitePixel(dpy, DefaultScreen(dpy)); + + temp = XCreateWindow(dpy, MonitorWindow(), x, y, w, h, + 1, depth, valclass, visual, mask, &xswa); + + UISetwin(temp); + + return temp; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp new file mode 100644 index 00000000000..ae050b3d595 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.cpp @@ -0,0 +1,1130 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +extern int vsp[2]; +extern void set_exit_routine_tag(int tag); + +#include "ace/OS.h" +#include "vb.h" + +ACE_RCSID(mpeg_client, vb, "$Id$") + +block ** VideoBuffer::head = 0; +block ** VideoBuffer::tail = 0; +char * VideoBuffer::buf = 0; +int VideoBuffer::bufsize = -1; +int VideoBuffer::sid = -1; +int VideoBuffer::countid = -1; +int VideoBuffer::exit_tag = -1; +int VideoBuffer::conn_tag = -1; +int VideoBuffer::savedSocket = -1; + +//constructor. +VideoBuffer::VideoBuffer (void) + :msg (0), + packet (0), + msgsn (-1), + ptr (0), + ptr1 (0), + tmp_buf (0), + cmdsn (-1), + fb_state (0), + qosRecomputes (0), + f (0), + fa (0), + reach_limit (0), + not_action (1) +#ifdef STAT + ,to_count (1), + gap_msgsn (-1) +#endif +{ +} + +// Destructor. +VideoBuffer::~VideoBuffer (void) +{ + if (ACE_Reactor::instance ()->remove_handler (this->handler_,ACE_Event_Handler::READ_MASK) == -1) + ACE_DEBUG ((LM_ERROR,"(%P)remove handler failed for Video_Notification_Handler\n")); + + delete this->handler_; + if (ACE_Reactor::instance ()->remove_handler (this,ACE_Event_Handler::READ_MASK) == -1) + ACE_DEBUG ((LM_ERROR,"(%P)remove handler failed for VideoBuffer\n")); +} + +/* size in byte */ +void +VideoBuffer::VBinitBuf (int size) +{ + bufsize = size - sizeof(struct header); + buf = creat_shared_mem(size); + head = &((struct header *)buf)->h; + tail = &((struct header *)buf)->t; + buf += sizeof(struct header); + sid = creat_semaphore(); + countid = creat_semaphore(); + enter_cs(countid); + *head = *tail = (struct block *)buf; + (*tail)->full = 0; + (*tail)->next = NULL; + (*tail)->shcode = SHCODE; +} + +/* block version */ +char* +VideoBuffer::VBgetBuf (int size) +{ + return 0; +} + +/* non-block check, return True/False*/ +int +VideoBuffer::VBcheckBuf (int size) +{ + return 0; +} + +void +VideoBuffer::VBputMsg (char * msgPtr) +{ +} + +/* block version */ +char * +VideoBuffer::VBgetMsg () +{ + char *vb_ptr; + +#ifdef STAT + if (shared->collectStat && *head == *tail) + shared->stat.VBemptyTimes ++; +#endif + // ACE_DEBUG ((LM_DEBUG,"(%P)waiting for countid\n")); + enter_cs(countid); + enter_cs(sid); + while (*tail != *head && (*tail)->full == 0) + *tail = (*tail)->next; + leave_cs(sid); + if (*head == *tail) + { + fprintf(stderr, "VB: getMsg run out of msg unexpectedly.\n"); + ACE_OS::exit (1); + } + vb_ptr = ((char*)*tail)+sizeof(**tail)+sizeof(VideoMessage); + + // fprintf(stderr,"VBgetMsg: buf:%x, msg:%x\n", (int)buf, (int)vb_ptr); + + return vb_ptr; +} + +/* non-block check, return Number of Msgs in buffer */ +int +VideoBuffer::VBcheckMsg () +{ + return get_semval(countid); +} + +int +VideoBuffer::VBbufEmpty (void) +{ + /* + Fprintf(stderr, "VB countid %d\n", get_semval(countid)); + */ + return get_semval(countid) <= 0; +} + +void +VideoBuffer::VBreclaimMsg (char * msgPtr) +{ + enter_cs(sid); + *tail = (*tail)->next; + leave_cs(sid); +} + +void +VideoBuffer::VBdeleteBuf (void) +{ + remove_shared_mem (buf - sizeof(struct header)); +} + +void +VideoBuffer::VBdeleteSem (void) +{ + remove_semaphore(sid); + remove_semaphore(countid); +} + +int +VideoBuffer::VBprocess (int init_socket, int normal_socket) +{ + this->initSocket = init_socket; + this->normalSocket = normal_socket; + msgsn = -1; + dataSocket = initSocket; + exit_tag = 0; + conn_tag = shared->videoMaxPktSize; + savedSocket = normalSocket; + + // ACE_DEBUG ((LM_DEBUG,"VideoBuffer::VBProcess ()\n")); + /* buffer big enough for discard mode packet stream */ + if (conn_tag < 0) + { + tmp_buf = (char *)ACE_OS::malloc(-conn_tag); + if (tmp_buf == NULL) { + fprintf(stderr, "AB failed to allocate %d bytes"); + ACE_OS::perror ("of tmp_buf"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + } + + ACE_NEW_RETURN (this->handler_, + Video_Notification_Handler (), + -1); + + // Register the notification handler with the reactor. + int result = ACE_Reactor::instance ()->register_handler (this->handler_, + ACE_Event_Handler::READ_MASK); + if (result != 0) + return result; + + result = ACE_Reactor::instance ()->register_handler (this, + ACE_Event_Handler::READ_MASK); + + if (result != 0) + return result; + + this->state_ = READ_HEADER; + temp = (char *)&msghd; + bytes = sizeof (msghd); + return 0; +} + +ACE_HANDLE +VideoBuffer::get_handle (void) const +{ + if (this->socket_flag_) + return this->normalSocket; + else + return this->initSocket; +} + +int +VideoBuffer::handle_input (ACE_HANDLE fd) +{ + // ACE_DEBUG ((LM_DEBUG,"VideoBuffer::handle_input:state = %d\n",this->state_)); + switch (this->state_) + { + case READ_NEXT_HEADER: + case READ_HEADER: + { + if (conn_tag >= 0) + len = ACE_OS::read (dataSocket,temp,bytes); + else + { + len = ACE_OS::read (dataSocket,tmp_buf,-conn_tag); + // fprintf (stderr,"VB read packet len = %d\n",len); + ACE_OS::memcpy ((char *)&msghd, tmp_buf, sizeof(msghd)); + } + if (len == -1) { + if (errno == EWOULDBLOCK || errno == EAGAIN) { + perror("VB sleep for 10ms"); + usleep(10000); + // set the pointers before going into the next loop. + temp = (char *)&msghd; + bytes = sizeof (msghd); + return 0; + } + ACE_OS::perror ("VB ACE_OS::read () data"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + if (len == 0) { /* EOF, connection closed by peer */ + fprintf(stderr, "Error: VB found dataSocket broken\n"); + for (;;) { + usleep(1000000); + } + } + if (conn_tag >= 0) + { + temp += len; + bytes -= len; + if (bytes != 0) + return 0; + else + len = sizeof (msghd); + } + if (len < sizeof(msghd)) + { + // go back to reading the next header. + temp = (char *)&msghd; + bytes = sizeof (msghd); + fprintf(stderr, "VD warn: PEEK1ed %dB < expected %dB\n",len, sizeof(msghd)); + // continue; + } +#ifdef NeedByteOrderConversion + msghd.packetsn = ntohl(msghd.packetsn); + msghd.packetSize = ntohl(msghd.packetSize); + msghd.msgsn = ntohl(msghd.msgsn); + msghd.msgOffset = ntohl(msghd.msgOffset); + msghd.msgSize = ntohl(msghd.msgSize); +#endif + + if (this->state_ == READ_NEXT_HEADER) + { +#ifdef STAT + { + int gap = msghd.msgsn - gap_msgsn; + gap = (gap >MSGGAP_MAX) ? MSGGAP_MAX : gap < MSGGAP_MIN ? MSGGAP_MIN : gap; + shared->stat.VBmsgGaps[gap - MSGGAP_MIN] ++; + if (gap >0) gap_msgsn = msghd.msgsn; + } +#endif + if (msghd.msgsn <= msgsn) + { /* outdated message, wait for next one */ + + fprintf(stderr, "VB discard outdated or dup msgsn %d, pktsn %d\n", + msghd.msgsn, msghd.packetsn); + + this->state_ = SKIP_NEXT_MESSAGE; + bytes = msghd.msgSize; + // skip_message(dataSocket, &msghd); + // continue; + return 0; + } + + if ((msghd.msgsn > msgsn + 1) || (msghd.msgOffset == 0)) + { + /* message out of order, abandon current packet */ + /* + fprintf(stderr, "VB msg out of order for current packet, discard it.\n"); + */ +#ifdef STAT + to_count = 0; +#endif + } + else + { + // ACE_DEBUG ((LM_DEBUG,"assigning next msgsn %d\n",msghd.msgsn)); + msgsn = msghd.msgsn; + this->state_ = READ_MESSAGE; + temp = ptr +sizeof (msghd); + bytes = msghd.msgSize; + // make a recursive call as we just have to do a memcpy from the buffer. + this->handle_input (dataSocket); + return 0; + } + } + + // fprintf(stderr, "VB PEEK1 a msg sn-%d, size-%d, pkt-%d, pktsize-%d\n",msghd.msgsn, msghd.msgSize, msghd.packetsn, msghd.packetSize); + +#ifdef STAT + if (to_count) { + int gap = msghd.msgsn - gap_msgsn; + gap = (gap >MSGGAP_MAX) ? MSGGAP_MAX : gap < MSGGAP_MIN ? MSGGAP_MIN : gap; + shared->stat.VBmsgGaps[gap - MSGGAP_MIN] ++; + if (gap >0) gap_msgsn = msghd.msgsn; + } + to_count = 1; +#endif + if (msghd.msgsn <= msgsn) /* outdated msg */ + { + fprintf(stderr, "VB discard outdated msgsn %d, pktsn %d when expecting first %d\n", + msghd.msgsn, msghd.packetsn,msgsn); + this->state_ = SKIP_MESSAGE; + bytes = msghd.msgSize; + // skip_message(dataSocket, &msghd); + // continue; + return 0; + } + else if (msghd.msgOffset != 0) /* not first msg of a packet */ + { + + /* + Fprintf(stderr, "VB discard non-first msg msgsn %d, pktsn %d\n", + msghd.msgsn, msghd.packetsn); + */ + this->state_ = SKIP_MESSAGE; + bytes = msghd.msgSize; + // skip_message(dataSocket, &msghd); + // continue; + return 0; + } + else + { + // ACE_DEBUG ((LM_DEBUG,"assigning msgsn %d\n",msghd.msgsn)); + msgsn = msghd.msgsn; + } + + /* allocate packet for the incoming msg */ + bsize = msghd.packetSize + sizeof(**head)*2 + sizeof(msghd); + bsize = ((bsize+3)>>2)<<2; + enter_cs(sid); + if (*head >= *tail) + { + if (bufsize - (int)((char*)*head - buf) >= bsize ) + msg =(VideoMessage *)((char*)*head + sizeof(**head)); + else if ((int)((char*)*tail - buf) >= bsize) + { + (*head)->next = (struct block *)buf; + (*head)->full = 0; + *head = (struct block *)buf; + msg = (VideoMessage *)(buf + sizeof(**head)); + *head = (struct block *)buf; + (*head)->shcode = SHCODE; + } + else /* not enough buffer, discard current message */ + { + leave_cs(sid); +#ifdef STAT + if (shared->collectStat) + shared->stat.VBdroppedFrames ++; +#endif + /* + Fprintf(stderr, "VB not enough space 1, drop msg.sn %d pktsn %d\n", + msghd.msgsn, msghd.packetsn); + */ + this->state_ = SKIP_MESSAGE; + bytes = msghd.msgSize; + // skip_message(dataSocket, &msghd); + // continue; + return 0; + } + } + else /* *head < *tail */ + if ((char*)*tail - (char*)*head >= bsize) + msg = (VideoMessage *)((char*)*head + sizeof(**head)); + else /* not enough buffer, abandon current message */ + { + leave_cs(sid); +#ifdef STAT + if (shared->collectStat) + shared->stat.VBdroppedFrames ++; +#endif + /* + Fprintf(stderr, "VB not enough space 1, drop msg.sn %d pktsn %d\n", + msghd.msgsn, msghd.packetsn); + + */ + this->state_ = SKIP_MESSAGE; + bytes = msghd.msgSize; + // skip_message(dataSocket, &msghd); + // continue; + return 0; + } + leave_cs(sid); + + //fprintf(stderr, "VB allocated a buffer for comming packet.\n"); + + psize = msghd.packetSize; + poffset = 0; + packet = (VideoPacket *)((char*)msg + sizeof(msghd)); + *(((int*)packet)+(msghd.packetSize>>2)) = 0; + /* clear the last no more than three bytes, for + proper detecting the end of packet by VD */ + ptr = (char*)msg; + this->state_ = READ_MESSAGE; + temp = ptr +sizeof (msghd); + bytes = msghd.msgSize; + } + break; + case SKIP_NEXT_MESSAGE: + case SKIP_MESSAGE: + { + char buffer[BUFSIZ]; + if (conn_tag >= 0) + { + int size = bytes > BUFSIZ ? BUFSIZ : bytes; + int res =ACE_OS::read (dataSocket, buffer, size); + bytes -= res; + + if (bytes != 0) + return 0; + } + if (this->state_ == SKIP_MESSAGE) + this->state_ = READ_HEADER; + else if (this->state_ == SKIP_NEXT_MESSAGE) + this->state_ = READ_NEXT_HEADER; + temp = (char *)&msghd; + bytes = sizeof (msghd); + break; + } + case READ_MESSAGE: + { + if (conn_tag >= 0) + { + int val; + val = ACE_OS::read (dataSocket,temp,bytes); + + if (val == -1 && (errno == EINTR || errno == EAGAIN | errno == EWOULDBLOCK)) + { /* interrupted or need to wait, try again */ + if (errno == EAGAIN | errno == EWOULDBLOCK) usleep(10000); + errno = 0; + return 0; + } + if (val == -1) + { + ACE_OS::perror ("Error -- Read from socket"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + if (val == 0) /* EOF encountered */ + { + ACE_DEBUG ((LM_DEBUG, "Error -- EOF reached while trying to read %d bytes.\n")); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + temp += val; + bytes -= val; + if (bytes < 0) /* weird thing is happening */ + { + ACE_DEBUG ((LM_DEBUG, "Error: read too much from socket, %d out of %d bytes.\n")); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + if (bytes != 0) + return 0; + } + else + memcpy(temp, tmp_buf + sizeof(msghd), bytes); + poffset += msghd.msgSize; + psize -= msghd.msgSize; + ptr += msghd.msgSize; + + // fprintf(stderr, "VB packet remain size %d\n", psize); + + if (psize == 0) + { + // ACE_DEBUG ((LM_DEBUG,"finished receiving current packet\n")); + /* finished receiving the current packet */ +#ifdef NeedByteOrderConversion + packet->cmd = ntohl(packet->cmd); + packet->cmdsn = ntohl(packet->cmdsn); + packet->sh = ntohl(packet->sh); + packet->gop = ntohl(packet->gop); + packet->frame = ntohl(packet->frame); + packet->display = ntohl(packet->display); + packet->future = ntohl(packet->future); + packet->past = ntohl(packet->past); + packet->currentUPF = ntohl(packet->currentUPF); + packet->dataBytes = ntohl(packet->dataBytes); +#endif + pcmdsn = packet->cmdsn; + pcmd = packet->cmd; + pfid = packet->frame; + pgop = packet->gop; + shared->VBheadFrame = (pcmd == CmdPLAY) ? pfid : pgop; + + shared->currentUPF = packet->currentUPF; + enter_cs(sid); + (*head)->full = 1; + psize = sizeof(**head) + sizeof(*msg) + msghd.packetSize; + psize = ((psize+3)>>2)<<2; + ptr = (char*)*head + psize; + (*head)->next = (struct block *) ptr; + (*head) = (struct block *)ptr; + (*head)->shcode = SHCODE; + leave_cs(countid); + leave_cs(sid); + + /* VB receives all frame except for the INIT one through normalSocket */ + if (dataSocket != normalSocket) + { + this->socket_flag_ = 1; + fprintf(stderr, "VB got INIT frame.\n"); + ACE_OS::write (initSocket, (char *)&initSocket, 1); /* write a garbage byte */ + // ACE_OS::close (initSocket); + // dataSocket = normalSocket; + // int result = ACE_Reactor::instance ()->remove_handler (this,ACE_Event_Handler::READ_MASK); + // if (result != 0) + // ACE_DEBUG ((LM_DEBUG,"remove handler failed for read_mask\n")); + + } + + /* following is synchronization feedback algorithm */ + this->sync_feedback (); + if (dataSocket != normalSocket) + { + dataSocket = normalSocket; + int result = ACE_Reactor::instance ()->register_handler (this,ACE_Event_Handler::READ_MASK); + if (result != 0) + ACE_DEBUG ((LM_DEBUG,"register handler failed for read_mask after datasocket change\n")); + return -1; + } + // return 0; + break; /* got the whole packet, break to the out-most loop for next packet */ + } /* end if (psize == 0) */ + else if (psize < 0) + { + fprintf(stderr, "VB error: received too many msgs for a packet.\n"); + ACE_Reactor::instance ()->end_event_loop (); + return -1; + } + this->state_ = READ_NEXT_HEADER; + temp = (char *)&msghd; + bytes = sizeof (msghd); + break; + } + } + return 0; +} + +int +VideoBuffer::handle_output (ACE_HANDLE fd) +{ + if ((this->state_ == WRITE_FEEDBACK1) || (this->state_ == WRITE_FEEDBACK2)) + { + // send the feedback to the server. + VideoFeedBackPara para; + para.cmdsn = htonl(shared->cmdsn); + para.addUsecPerFrame = htonl(fb_addupf); + para.addFrames = htonl(fb_addf); + para.needHeader = htonl(shared->needHeader); + shared->needHeader = 0; + para.frameRateLimit1000 = + htonl((long)(shared->frameRateLimit * 1000.0)); + para.sendPatternGops = htonl(shared->sendPatternGops); + ACE_OS::memcpy (para.sendPattern, shared->sendPattern, PATTERN_SIZE); + + // fprintf(stderr, "VB to send a fb packet..."); + + int res; + if (conn_tag != 0) + { /* packet stream */ + if (temp == 0) + { + temp = (char *)¶ + bytes = sizeof (para); + } + res = ACE_OS::write (dataSocket, temp, bytes); + if (res == -1) + { + if (errno == EINTR) + return 0; + if (errno == ENOBUFS) { + perror("VB Warning, fb packet discarded for"); + // Here we should handle the return -1 case! + fb_state = 4; + } + else + { + ACE_OS::perror ("VB error, fb packet sending failed"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + } + else if (res == 0) + { + ACE_OS::perror ("VB error, sending fb,socket closed"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + else + { + temp += res; + bytes -= res; + if (bytes != 0) + return 0; + } + } + else + { + res = ACE_OS::write (dataSocket, (char *)¶, sizeof(para)); + if (res == -1) + { + ACE_OS::perror ("VB error, fb packet sending failed"); + ACE_Reactor::instance ()->end_event_loop (); return -1; + } + if (res < sizeof(para)) + { + fprintf(stderr, "VB send_feedback() warn: res %dB < sizeof(para) %dB\n", + res, sizeof(para)); + } + } + if (errno != ENOBUFS) // fb_state == 4; + qosRecomputes = len; + ACE_Reactor::instance ()->remove_handler (this, + ACE_Event_Handler::WRITE_MASK); + if (this->state_ == WRITE_FEEDBACK2) + { + if (fb_state == 6) + { /* record the time if an action packet is + successfully send, and indicate that an + feedback action leads to state 6, which after + delay sometime leads to state 3. + The action_delay should have been related + to round-trip time. */ + action_time = get_usec(); + action_delay = shared->usecPerFrame * 100; + not_action = 0; + } + } + else if (this->state_ == WRITE_FEEDBACK2) + { + this->feedback_action (); + } +#ifdef STAT + { + int i; + if ((i = shared->stat.fbPacketNumber) < MAX_FB_PACKETS) { + shared->stat.fbPackets[i].frameId = shared->nextFrame; + shared->stat.fbPackets[i].addUsecPerFrame = addupf; + shared->stat.fbPackets[i].addFrames = addf; + shared->stat.fbPackets[i].frames = shared->sendPatternGops * + shared->patternSize; + shared->stat.fbPackets[i].framesDropped = shared->framesDropped; + shared->stat.fbPackets[i].frameRateLimit = shared->frameRateLimit; + shared->stat.fbPackets[i].advance = advance; + } + shared->stat.fbPacketNumber ++; + } +#endif + // Now return to the reading header position. + this->state_ = READ_HEADER; + temp = (char *)&msghd; + bytes = sizeof (msghd); + int result = ACE_Reactor::instance ()->remove_handler (this, + ACE_Event_Handler::WRITE_MASK); + if (result != 0) + ACE_DEBUG ((LM_DEBUG,"remove_handler failed for write")); + } + return 0; +} + +int +VideoBuffer::sync_feedback (void) +{ + int result; + if (shared->config.syncEffective) + { + if (fb_state > 1 && fb_state != 4 && (len = shared->qosRecomputes) != qosRecomputes) + { + /* QoS feedback packet is sent if at any time send pattern is + recomputed, and sync feedback is not in active fb_state*/ + this->state_ = WRITE_FEEDBACK1; + result = ACE_Reactor::instance ()->register_handler (this,ACE_Event_Handler::WRITE_MASK); + if (result != 0) + return result; + fb_addupf = 0; + fb_addf = 0; + fb_advance = advance; + temp = 0; + return 0; + } + this->feedback_action (); + } /* end if (shared->config.syncEffective) */ + else + fb_state = 0; + return 0; +} + +int +VideoBuffer::feedback_action (void) +{ + switch (fb_state) + { + case 4: /* active */ + if (pcmdsn != cmdsn) + { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) + fb_state = 0; + else + fb_state = 1; + break; + } + if (pcmd == CmdPLAY && shared->usecPerFrame != upf) + { + /* jump to fb_state 5 if speed changes */ + fb_state = 5; + break; + } + { + int interval = shared->usecPerFrame; + double val = (double)(pcmd == CmdPLAY ? + pfid - shared->nextFrame : + (pcmd == CmdFF ? + pgop - shared->nextGroup : + shared->nextGroup - pgop)); + fv = DoFilter(f, val); /* get average #frames in the whole client + pipeline, including all stages */ + val = val - fv; + fav = DoFilter(fa, val >= 0.0 ? val : -val); + /* get average #frames jitter in the whole client pipeline */ + + val = fav * interval * 6; + /* convert deviation in frame into microseconds, 6 is a magic number */ + + /* tries to recompute advance (in microseconds), and med/high/low + in adaptation to current jitter level */ + if ((val > advance && !reach_limit) || + (advance > min_advance && val < advance >> 3)) { + advance = (int) max(2 * val, min_advance); + med = advance / interval; + /* + if (pcmd == CmdPLAY) { + if (med < shared->VDframeNumber) { + med = shared->VDframeNumber; + } + } + else + */ + if (med < 2 ) { /* but keep minimum buffer fill level */ + med = 2; + } + if (med > (VB_BUF_SIZE / shared->averageFrameSize) / 2) { + reach_limit = 1; + med = (VB_BUF_SIZE / shared->averageFrameSize) / 2; + Fprintf(stderr, + "VB VSadvance control: VBbuf limit reached, med %d.\n", med); + } + else reach_limit = 0; + high = med + med / 2; + low = med - med / 2; + period = med * MAX_CLOCK_DRIFT; + Fprintf(stderr, + "VB: VS advance control: fav %5.2f, med %d, advance %d at nextFrame %d\n", + fav, med, advance, shared->nextFrame); + } + } + /* record the current time (fid or gopid) if buffer fill level drift + only very little */ + if ((int)fv == med) + { + init_fv = fv; + init_pos = pcmd == CmdPLAY ? pfid : pgop; + break; + } + /* + fprintf(stderr, "VB fb: fv %lf\n", fv); + */ + /* try send action if low/high water mark is passed, or qos recomputed */ + /* There is problem here, the deltas of upf are sent, instead of upf + and frame themself. This scheme is not robust in case case feedback + packets are lost, and get resent */ + len = shared->qosRecomputes; + if (fv >= high || fv <= low || len != qosRecomputes) + { + int addupf, addf; + int pos = pcmd == CmdPLAY ? pfid : pgop; + int dist = (int)(pcmd == CmdFB ? init_pos - pos : pos - init_pos); + if (fv >= high || fv <= low) + { + if (dist < period) + { /* try skip or stall */ + addf = (int)(med - fv); + addupf = 0; + } + else + { /* try adjust VS clock rate */ + int added = (int)((double)cupf * (fv - (double)med) / (double) dist); + addf = (int)(med - fv); + addupf = added; + cupf += added; + } + fb_state = 6; + } + else + { /* fb only recomputed sendpattern, no fb_state change */ + addupf = 0; + addf = 0; + } + + /* tries to send a feedback packet. */ + if (shared->live) + /* no sync feedback with live video */ + qosRecomputes = len; + else + { + this->state_ = WRITE_FEEDBACK2; + int result = ACE_Reactor::instance ()->register_handler (this,ACE_Event_Handler::WRITE_MASK); + if (result != 0) + return result; + fb_addupf = addupf; + fb_addf = addf; + fb_advance = advance; + return 0; + } + if (fb_state == 6) + { /* record the time if an action packet is + successfully send, and indicate that an + feedback action leads to fb_state 6, which after + delay sometime leads to fb_state 3. + The action_delay should have been related + to round-trip time. */ + action_time = get_usec(); + action_delay = shared->usecPerFrame * 100; + not_action = 0; + } + } + break; + case 6: /* reset after action */ + if (pcmdsn != cmdsn) + { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) + fb_state = 0; + else + fb_state = 1; + break; + } + if (pcmd == CmdPLAY && shared->usecPerFrame != upf) + { + fb_state = 5; + break; + } + /* Jump to transition fb_state 3 only after delay for some + time, when feedback action has been taken, and the + effect has been propogated back to the client */ + if (get_duration(action_time, get_usec()) >= action_delay) + fb_state = 3; + break; + case 5: /* reset after speed change, feedback stays in this + fb_state as long as play speed is changing */ + if (pcmdsn != cmdsn) + { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) + fb_state = 0; + else + fb_state = 1; + break; + } + /* Jump to transition fb_state 3, indicating that the transition + is not caused by feedback action */ + if (shared->currentUPF == shared->usecPerFrame) + { + not_action = 1; + fb_state = 3; + } + break; + case 2: /* delay after start, this delay is for avoiding feedback + action during server fast start-up. */ + if (pcmdsn != cmdsn) { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) { + fb_state = 0; + } + else { + fb_state = 1; + } + break; + } + if (pcmd == CmdPLAY) { + if (pfid - startpos >= delay) { + advance = shared->VStimeAdvance; + fb_state = 3; + } + } + else if (pcmd == CmdFF) { + if (pgop - startpos >= delay) { + advance = shared->VStimeAdvance; + fb_state = 3; + } + } + else { /* CmdFB */ + if (startpos - pgop >= delay) { + advance = shared->VStimeAdvance; + fb_state = 3; + } + } + break; + case 3: /* transient fb_state, entered after start-up delay, + action-delay, or play-speed change */ + if (pcmdsn != cmdsn) { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) { + fb_state = 0; + } + else { + fb_state = 1; + } + break; + } + /* Initialize both buffer-fill-level and jitter filters */ + if (f == NULL) { + f = NewFilter(FILTER_LOWPASS, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + } + else { + f = ResetFilter(f, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + } + if (fa == NULL) { + fa = NewFilter(FILTER_LOWPASS, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + DoFilter(fa, 0.0); + } + else if (not_action) { /* reset jitter level filter only + if entering this fb_state is not + cause by feedback action */ + fa = ResetFilter(fa, shared->config.filterPara >= 1 ? + shared->config.filterPara : 100); + } + if (f == NULL || fa == NULL) { + ACE_OS::perror ("VB failed to allocate space for filters"); + fb_state = 0; + } + else { + init_fv = + DoFilter(f, (double)(pcmd == CmdPLAY ? + pfid - shared->nextFrame : + (pcmd == CmdFF ? + pgop - shared->nextGroup : + shared->nextGroup - pgop))); + init_pos = pcmd == CmdPLAY ? pfid : pgop; + upf = shared->currentUPF; + cupf = upf; + { + int interval = shared->usecPerFrame; + + /* upon speed change, 'advance', in microseconds, will + not change, but med/high/low will be updated. This + may suggest that in the new toolkit version of the + same feedback systems, the buffer-fill level and + jitter is measured directly in microseconds, not in + #frames then converting to microseconds. */ + med = advance / interval; + /* + if (pcmd == CmdPLAY) { + if (med < shared->VDframeNumber) { + med = shared->VDframeNumber; + min_advance = advance = med * interval; + } + } + else + */ + if (med < 2 ) { + med = 2; + advance = med * interval; + min_advance = max(advance, shared->VStimeAdvance); + } + else min_advance = shared->VStimeAdvance; + if (med > (VB_BUF_SIZE / shared->averageFrameSize) / 2) { + reach_limit = 1; + med = (VB_BUF_SIZE / shared->averageFrameSize) / 2; + if (not_action) { + Fprintf(stderr, + "VB start/speed-change: VBbuf limit reached, med %d.\n", med); + } + } + else reach_limit = 0; + } + high = med + med / 2; + low = med - med / 2; + delay = med * (SPEEDUP_INV_SCALE - 1); /* this delay is to avoid + feedback when VS is in + fast-start period */ + period = med * MAX_CLOCK_DRIFT; + if (not_action) { + Fprintf(stderr, + "VB start/speed-change: med %d, advance %d at nextFrame %d\n", + med, advance, shared->nextFrame); + } + fb_state = 4; + } + break; + case 0: /* idle */ + if (pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB) { + cmdsn = pcmdsn; + fb_state = 1; + } + break; + case 1: /* start */ + if (pcmdsn != cmdsn) { + cmdsn = pcmdsn; + if (!(pcmd == CmdPLAY || pcmd == CmdFF || pcmd == CmdFB)) { + fb_state = 0; + } + break; + } + startpos = pcmd == CmdPLAY ? pfid : pgop; + advance = shared->VStimeAdvance; + + /* following from vs.c: + timerAdjust = (VStimeAdvance * SPEEDUP_INV_SCALE) / currentUPF; + */ + med = advance / shared->usecPerFrame; + /* + if (pcmd != CmdPLAY) med /= shared->patternSize; + */ + delay = med * (SPEEDUP_INV_SCALE - 1); /* this delay is to avoid + feedback when VS is in + fast-start period */ + not_action = 1; + fb_state = 2; + break; + default: + fprintf(stderr, "VB: unknown Feedback fb_state %d reached.\n", fb_state); + fb_state = 0; + break; + } +} + +ACE_HANDLE +Notification_Handler::get_handle (void) const +{ + return -1; +} + +int +Notification_Handler::handle_input (ACE_HANDLE fd) +{ + ACE_DEBUG ((LM_DEBUG,"Notification_Handler::handle_input")); + char message[BUFSIZ]; + message [0] = 0; + // used to indicate that we should exit. + int result = + ACE_OS::read (fd,message,BUFSIZ); + + ACE_DEBUG ((LM_DEBUG,"result:%d,message[0]:%d\n",result,message[0])); + if (result == 0) + { + ACE_DEBUG ((LM_DEBUG,"AB process exiting, notification socket eof while reading\n")); + ACE_Reactor::instance ()->end_event_loop (); + return -1; + } + if (result == -1) + { + ACE_DEBUG ((LM_DEBUG,"AB process exiting, notification socket error while reading\n")); + ACE_Reactor::instance ()->end_event_loop (); + return -1; + } + ACE_DEBUG ((LM_DEBUG," %d %d\n",result,message[0])); + + switch (message[0]) + { + case EXIT: + ACE_DEBUG ((LM_DEBUG,"VB process exiting because of exit signal\n")); + set_exit_routine_tag(0); + VideoBuffer::VBdeleteBuf(); + ACE_Reactor::instance ()->end_event_loop (); + return -1; + default: + break; + } + return 0; +} + +ACE_HANDLE +Video_Notification_Handler::get_handle (void) const +{ + return vsp[1]; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.h new file mode 100644 index 00000000000..6c0e4e69a86 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vb.h @@ -0,0 +1,265 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// mpeg_client +// +// = FILENAME +// vb.h +// +// = DESCRIPTION +// Defines the video packet buffering process. +// +// = AUTHORS +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#if !defined (AV_VB_H) +#define AV_VB_H + +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/uio.h> +#include <unistd.h> +#include <stdlib.h> +#include <netinet/in.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> +#if defined(__svr4__) || defined(IRIX) +#include <stropts.h> +#include <sys/conf.h> +#endif +#include "include/common.h" +#include "newproto.h" +#include "global.h" +#include "mpeg_shared/filters.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "ace/Event_Handler.h" +#include "ace/Reactor.h" + +/* magic number -- deviation is considered + caused by clock drift only if rate <= 1/MAX_CLOCK_DRIFT. + */ +#define MAX_CLOCK_DRIFT 50 +#define SHCODE 0x000001b3 +#define max(a,b) ((a)>(b) ? (a) : (b)) + +struct block +{ + unsigned shcode; + struct block * next; + int full; +}; + +struct header +{ + struct block *h, *t; +}; + +class Notification_Handler; + +class VideoBuffer :public ACE_Event_Handler +{ +public: + VideoBuffer (void); + // constructor. + + virtual ~VideoBuffer (void); + // destructor. + + virtual int handle_input (ACE_HANDLE fd); + // callback when data arrives on the video socket. + + virtual int handle_output (ACE_HANDLE fd); + // callback when data can be written on the video socket. + + ACE_HANDLE get_handle (void) const; + // gets the video socket. + + void VBinitBuf (int size); + // size in byte. + + char * VBgetBuf (int size); + // block version. + + int VBcheckBuf (int size); + // non-block check, return True/False + + void VBputMsg (char * msgPtr); + + char * VBgetMsg (); + // block version. + + int VBcheckMsg(); + // non-block check, return Number of Msgs in buffer. + + int VBbufEmpty(void); + + void VBreclaimMsg(char * msgPtr); + + static void VBdeleteBuf(void); + + static void VBdeleteSem(void); + + static void exit_on_kill(void); + + int VBprocess(int initSocket, int normalSocket); + +private: + + int sync_feedback (void); + int feedback_action (void); + + static block ** head; + static block ** tail; + static char * buf; + static int bufsize; + static int sid, countid; + static int exit_tag; + static int conn_tag; + static int savedSocket; + + VideoMessage *msg, msghd; + VideoPacket *packet; + int len, bsize, msgsn; + int psize, poffset; + char * ptr, *ptr1; + char *tmp_buf; + int dataSocket; + int initSocket,normalSocket; + + // following variables are for feedback + int pcmdsn, pcmd; + // to store the cmdsn and cmd of previous frame, + // to detect new commands + + int pfid, pgop; + // frame-id of gopid of previous frame + + int cmdsn; + // cmdsn of previous command + + int fb_state; + // state of the control law/regulator + + int startpos; + // gopid or frameid when the regulator is in 'start' state 1 + + int delay; + // #frames to delay after 'start' + + int qosRecomputes; + // indicate if qos has been recomputed recently + + int action_delay; + // microseconds to delay after feedback action + + int action_time; + // the time when feedback action is taken, used to enforce + // action_delay + + int upf, cupf; + // upf -- currentUPF as carried in all frames, + // cupf -- real current UPF, being adjusted by FB + + double fv; + // current buffer fill level in term of #frames + + double init_fv; + // init_fv and init_pos record the fv value and position + // (frameid or gopid) when fv is very close to med + + double init_pos; + int high, low, med; + // median, high and low water marks, in term of #frames + + int period; + // interms of #frames, (high-med, period) defined the max + // buffer fill drift which can be assumed as caused by + // clock drift + + Filter * f; + // buffer fill level filter + + int advance, min_advance; + // in microseconds, advance holds the + // current target buffer-fill-level as + // determined by jitter level + // estimate. min_advance sets a absolute + // minimun level, no matter how low jitter + // level is.'advance' does not change when + // play-speed changes, but med/high/low + // will be updated upon speed change + + double fav; + // #frames, jitter level output by the filter. + + Filter * fa; + // jitter filter. + + int reach_limit; + // indicate that the target 'advance' has reached client VB + // buffer limit, and can not further increase, even if + // jitter increases. + + int not_action; + // indicates entering state=3 is not caused by + // feedback action. If not_action = 1 entering state=3 + // is caused either by 'start' or speed change, and + // the jitter filter needs to be reset. + +#ifdef STAT + int to_count; + int gap_msgsn; +#endif + + Notification_Handler *handler_; + // handler to be used for exit notification. + + enum state {INVALID = -1, + READ_HEADER = 0, + READ_NEXT_HEADER = 1, + READ_MESSAGE = 2, + SKIP_MESSAGE = 3, + SKIP_NEXT_MESSAGE = 4, + WRITE_FEEDBACK1 = 5, + WRITE_FEEDBACK2 = 6}; + state state_; + + char *temp; + // temporary pointer. + int bytes; + // temporary placeholder for no.of bytes to be read. + + int fb_addupf; + int fb_addf; + int fb_advance; + + int socket_flag_; + // flag to indicate which socket to be used. +}; + +class Notification_Handler :public ACE_Event_Handler +{ +public: + virtual ACE_HANDLE get_handle (void) const; + // Get the Notification handle. + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // called when input events occur. + +}; + +class Video_Notification_Handler :public Notification_Handler +{ +public: + virtual ACE_HANDLE get_handle (void) const; + // Returns the video notification handle. +}; +#endif /* AV_VB_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vd.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vd.cpp new file mode 100644 index 00000000000..2543f0d1014 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vd.cpp @@ -0,0 +1,934 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +extern int vdsp[2]; + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include <unistd.h> +#include <stdlib.h> +/* +#include <sys/types.h> +#include <sys/socket.h> +*/ +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> +#include "include/common.h" +#include "newproto.h" +#include "global.h" +#include "dither.h" +#include "video.h" +#include "proto.h" +#include "vb.h" + +ACE_RCSID(mpeg_client, vd, "$Id$") + +#define MAX_VDBLOCK_NUM 8 +#define CQUEUE_SIZE MAX_VDBLOCK_NUM + 2 +#define ESTACK 0 +#define CQUEUE 1 + +static int win_width, win_height; +static int ecountid, ccountid; +static int sid; + +extern VidStream * curVidStream; +extern VideoBuffer *vbuffer; + +static struct shared_mem_block +{ + int size; + int block_num; + int width, height; + int sptr, qhead, qtail; + FrameBlock *estack[MAX_VDBLOCK_NUM]; + FrameBlock *cqueue[CQUEUE_SIZE]; /* cqueue will never get full */ +} * shm = NULL; + +static void InitDitherEnv(void); +static void DitherFrame(PictImage * pict, FrameBlock * frame); +static void DoDitherImage(unsigned char *l, unsigned char *Cr, unsigned char *Cb, + unsigned char *disp, int h, int w); + +void VDinitBuf(int size) +/* size in bytes */ +{ + shm = (struct shared_mem_block *)creat_shared_mem_id(size, &shared->VDbufId); + shared->VDbufAddr = (char *)shm; + + shm->width = shm->height = 0; + shm->size = size - sizeof(*shm); + sid = creat_semaphore(); + ecountid = creat_semaphore(); + ccountid = creat_semaphore(); + enter_cs(ccountid); + enter_cs(ecountid); +} + +static void put_block(FrameBlock * bptr, int tag) +{ + if (tag == ESTACK) + { + shm->estack[shm->sptr] = bptr; + shm->sptr ++; + if (shm->sptr > MAX_VDBLOCK_NUM) + { + fprintf(stderr, "VD weird error: ESTACK full.\n"); + ACE_OS::exit (1); + } + } + else + { + if (shm->qtail == shm->qhead) /* empty queue */ + { + shm->qtail = 0; + shm->qhead = 1; + shm->cqueue[0] = bptr; + } + else + { + int val = CQUEUE_SIZE; + int pos = (shm->qhead - 1 + val) % val; /* pos = shm->qhead - 1 */ + if (shared->cmd == CmdPLAY) + while ((pos + 1) % val != shm->qtail) + { + if (shm->cqueue[pos]->display > bptr->display) + { + shm->cqueue[(pos + 1) % val] = shm->cqueue[pos]; + pos = (pos - 1 + val) % val; /* pos -= 1 */ + } + else + break; + } + shm->cqueue[(pos + 1) % val] = bptr; + shm->qhead = (shm->qhead + 1) % val; + } + } +} + +static FrameBlock * get_block(int tag) +{ + FrameBlock * ptr; + + if (tag == ESTACK) + { + if (shm->sptr <= 0) + { + fprintf(stderr, "VD get_block error: ESTACK empty.\n"); + return NULL; + } + shm->sptr --; + ptr = shm->estack[shm->sptr]; + } + else + { + if (shm->qtail == shm->qhead) + { + fprintf(stderr, "VD get_block error: CQUEUE empty.\n"); + return NULL; + } + ptr = shm->cqueue[shm->qtail]; + shm->qtail = (shm->qtail + 1) % (CQUEUE_SIZE); + } + return ptr; +} + +void VDresizeBuf(int height, int width) +{ + char * ptr = (char*)shm + sizeof(*shm); + int imagesize; + int i; + + enter_cs(sid); + + if (get_semval(ecountid) < 0) { + fprintf(stderr, "Error<weird>: pid %d get (ecountid) = %d < 0\n", + ACE_OS::getpid (), get_semval(ecountid)); + ACE_OS::exit (1); + } + /* + fprintf(stderr, "VD before resizeBuf(): get_semval(ecountid) = %d\n", + get_semval(ecountid)); + */ + while (get_semval(ecountid) > 0) enter_cs(ecountid); + + shm->width = width; + shm->height = height; + width = ((width+15)>>4) << 4; + height = ((height+15)>>4) << 4; + imagesize = (((height * width)+3)>>2)<<2; + if ((ditherType == Twox2_DITHER) || (ditherType == FULL_COLOR_DITHER)) + imagesize <<= 2; + + shm->block_num = (shm->size)/(sizeof(FrameBlock) + imagesize); + if (shm->block_num > MAX_VDBLOCK_NUM) + shm->block_num = MAX_VDBLOCK_NUM; + + Fprintf(stderr, "VD resizeBuf: got %d(max %d) blocks of size %d.\n", + shm->block_num, + (shm->size)/(sizeof(FrameBlock) + imagesize), + (sizeof(FrameBlock) + imagesize)); + + if (shm->block_num < 3) + { + fprintf(stderr, + "VD error: VDbuf fails to hold at least 3(three) block.\n"); + ACE_OS::exit (1); + } + shm->sptr = 0; /* empty stack */ + shm->qhead = shm->qtail = 0; /* empty cqueue */ + for (i=0; i<shm->block_num; i++) + { + put_block((FrameBlock *)ptr, ESTACK); + ((FrameBlock *)ptr)->data = (unsigned char *)(ptr + sizeof(FrameBlock)); + ptr += sizeof(FrameBlock) + imagesize; + leave_cs(ecountid); + } + leave_cs(sid); + + shared->VDframeNumber = shm->block_num; + /* + fprintf(stderr, "VD after resizeBuf(): get_semval(ecountid) = %d\n", + get_semval(ecountid)); + */ +} + +FrameBlock * VDgetBuf(void) /* block version, return with interrupt */ +{ + FrameBlock * ptr; + enter_cs(ecountid); + enter_cs(sid); + ptr = get_block(ESTACK); + if (ptr != NULL) + ptr->refcount = 1; + leave_cs(sid); + if (ptr == NULL) + fprintf(stderr, "VD error: VDgetBuf should not return NULL.\n"); + /* + fprintf(stderr, "pid %d VDgetBuf() %u, ref %d, ecount %d\n", + ACE_OS::getpid (), (unsigned)ptr, ptr->refcount, get_semval(ecountid)); + */ + return ptr; +} + +int VDcheckBuf(void) /* non-block check, return True/False */ +{ + if (get_semval(ecountid) > 0) + return 1; + else + return 0; +} + +void VDputMsg(FrameBlock * msgPtr) +{ + enter_cs(sid); + put_block(msgPtr, CQUEUE); + leave_cs(ccountid); + leave_cs(sid); + /* + fprintf(stderr, "pid %d VDputMsg() %u, ref %d, ccount %d\n", + ACE_OS::getpid (), (unsigned)msgPtr, msgPtr->refcount, get_semval(ccountid)); + */ +} + +FrameBlock * VDgetMsg(void) /* block version, return with interrupt */ +{ + FrameBlock * ptr; + enter_cs(ccountid); + enter_cs(sid); + ptr = get_block(CQUEUE); + leave_cs(sid); + if (ptr == NULL) + fprintf(stderr, "VD error: VDgetMsg should not return NULL.\n"); + /* + fprintf(stderr, "pid %d VDgetMsg() %u, ref %d, ccount %d\n", + ACE_OS::getpid (), (unsigned)ptr, ptr->refcount, get_semval(ccountid)); + */ + return ptr; +} + +int VDcheckMsg(void) /* non-block check, return Number of Msg in buffer */ +{ + return get_semval(ccountid); +} + +int VDbufEmpty(void) +{ + /* + Fprintf(stderr, "VD ecountid %d, shm-block_num %d\n", + get_semval(ecountid), shm->block_num); + */ + return (get_semval(ecountid) == shm->block_num); +} + +FrameBlock * VDpeekMsg(void) +{ + FrameBlock * ptr; + + enter_cs(sid); + + if (shm->qhead == shm->qtail) + ptr = NULL; + else + ptr = shm->cqueue[shm->qtail]; + leave_cs(sid); + /* + if (ptr != NULL) { + fprintf(stderr, "pid %d VDpeekMsg() = %u, ref=%d\n", + ACE_OS::getpid (), (unsigned)ptr, ptr->refcount); + } + */ + return ptr; +} + +void VDreferMsg(FrameBlock * msgPtr) +{ + enter_cs(sid); + msgPtr->refcount ++; + leave_cs(sid); + /* + fprintf(stderr, "pid %d VDreferMsg() %u, ccount %d\n", + ACE_OS::getpid (), (unsigned)msgPtr, get_semval(ccountid)); + */ +} + +void VDreclaimMsg(FrameBlock * msgPtr) +{ + int ref; + enter_cs(sid); + ref = msgPtr->refcount; + if (msgPtr->refcount <= 1) + { + put_block(msgPtr, ESTACK); + leave_cs(ecountid); + } + else + msgPtr->refcount --; + leave_cs(sid); + /* + fprintf(stderr, "pid %d VDreclaimMsg() %u, ref %d, ecount %d\n", + ACE_OS::getpid (), (unsigned)msgPtr, ref, get_semval(ecountid)); + */ + if (ref <= 0) { + Fprintf(stderr, "pid %d VDreclaimMsg() %u WEIRD, :ref %d:, ecount %d\n", + ACE_OS::getpid (), (unsigned)msgPtr, ref, get_semval(ecountid)); + } +} + +void VDdeleteBuf(void) +{ + remove_shared_mem((char*)shm); +} + +void VDdeleteSem(void) +{ + remove_semaphore(ecountid); + remove_semaphore(ccountid); + remove_semaphore(sid); +} + +int +get_more_data(unsigned int *buf_start, int max_length, + int *length_ptr, unsigned int **buf_ptr) +{ + fprintf(stderr, + "Fatel error: vd.c get_more_data() should not be called, bufLength = %d.!\n", + *length_ptr); + fprintf(stderr, " **** Please report this bug. ****\n"); + // ACE_OS::exit (1); + return 0; +} + +static void printPacket(VideoPacket *p) +{ + fprintf(stderr, "VD: Packet(%x)=cmd-%d, cmdsn-%d sh-%d, gop-%d\n", + (int)p, p->cmd, p->cmdsn, p->sh, p->gop); + fprintf(stderr, " frame-%d, display-%d, future-%d, past-%d, bytes-%d\n", + p->frame, p->display, p->future, + p->past, p->dataBytes); +} + + +void VDprocess (int CTRpid) +{ + FrameBlock * curBlk = NULL; + PictImage * curPict = NULL; + + InitDitherEnv(); + + curVidStream = NewVidStream(); + if (curVidStream == NULL) + { + fprintf(stderr, "VD: unable to allocat curVidStream.\n"); + ACE_OS::exit (1); + } + + for(;;) + { + int curcmd, curcmdsn; + int i; + int single_tag; + VideoPacket *p; + + if (curBlk != NULL) { + VDreclaimMsg(curBlk); + curBlk = NULL; + } + p = (VideoPacket*)vbuffer->VBgetMsg(); /* guarranteed to get a Packet */ + + // printPacket(p); + // fprintf(stderr, "VD: got frame %d\n", p->frame); + + curcmd = shared->cmd; + curcmdsn = shared->cmdsn; + if (p->cmdsn != shared->cmdsn) + { + /* + fprintf(stderr, "VD: frame not for current Cmd, discard it:p->cmdsn:%d,shared->cmdsn:%d\n", + p->cmdsn,shared->cmdsn); + printPacket(p); + */ + vbuffer->VBreclaimMsg((char*)p); + continue; + } + if (curcmd == CmdINIT) + { + /* free/allocate all PictImages, resize VDbuffer */ + curVidStream->future = curVidStream->past = curVidStream->current = NULL; + win_width = ((shared->horizontalSize + 15)>>4)<<4; + win_height = ((shared->verticalSize + 15)>>4)<<4; + for (i = 0; i < RING_BUF_SIZE; i++) + { + if (curVidStream->ring[i] != NULL) + DestroyPictImage(curVidStream->ring[i]); + curVidStream->ring[i] = + NewPictImage(win_width, win_height); + } + for (i = 0; i < 500; i ++) { + if (!VDbufEmpty()) usleep(1000); + else break; + } + if (!VDbufEmpty()) { + fprintf(stderr, "VD error<weired>: VDbuf can't become empty.\n"); + exit(1); + } + VDresizeBuf(shared->verticalSize, shared->horizontalSize); + } + else if (curcmd == CmdPLAY || curcmd == CmdSTEP) + { + /* to check if the packet can be decoded or not */ + if (p->future == -1) + { /* swap because the existing VD decoding algorithm refer to 'future' frame + to decode a P frame */ + int tmp = p->past; + p->past = p->future; + /* following is the bug found on 2-14-96, this may be the cause of decoding + P frames incorrectly, and showing corrupted messages, when previous I/P + frames are dropped. This happens frequently when the server is a remote one. + + p->future = p->past; + + */ + p->future = tmp; + + } + if ((p->future >= 0 && + (curVidStream->future == NULL || curVidStream->future->frame != p->future)) || + (p->past >= 0 && + (curVidStream->past == NULL || curVidStream->past->frame != p->past))) + { + /* + fprintf(stderr, + "VD: unable to decode packet -- future and/or past frame no available.\n"); + printPacket(p); + */ + if (curcmd == CmdSTEP && curcmdsn == shared->cmdsn) { + /* + Fprintf(stderr, "VD failed to decode f%d, USR1 to CTR for STEP\n", p->frame); + */ + char message[BUFSIZ]; + message [0]= DECODED; + int result = ACE_OS::write (vdsp[1],&message,BUFSIZ); + if (result == -1) + perror ("VD:Decode Notify"); + if (result == 0) + perror ("VD:Socket Closed"); + } +#ifdef STAT + else if (shared->collectStat && curcmd == CmdPLAY) + shared->stat.VDnoRef ++; +#endif + vbuffer->VBreclaimMsg((char*)p); + continue; + } + } + curBlk = VDgetBuf(); + + single_tag = 0; + /* to check if it's in time for PLAY, FF and FB */ + if (curcmd == CmdPLAY) + { + +#if 0 + /* checking against sendPattern seems irreasonable, because send-pattern of a less + frame-rate is not necessarily a subset of the one of a bigger frame-rate. + */ + /* check against sendPattern */ + if (p->frame - shared->firstGopFrames > 0) + { + int i = (p->frame - shared->firstGopFrames) % + (shared->patternSize * shared->sendPatternGops); + if (shared->sendPattern[i] == 0) + { + vbuffer->VBreclaimMsg((char*)p); +#ifdef STAT + if (shared->collectStat) + shared->stat.VDagainstSendPattern ++; +#endif + continue; + } + } +#endif + + if (vbuffer->VBcheckMsg() > 0) { /* a frame is to be dropped only if + there are more frames in VB */ + if (p->past >= 0) { /* 'B' */ + if (p->display <= shared->nextFrame) { +#ifdef STAT + if (shared->collectStat) + shared->stat.VDtooLateB ++; +#endif + goto frameTooLate; + } + } + else if (p->future >= 0) { /* 'P' */ + if (shared->lastIframeDecoded + shared->IframeGap <= shared->nextFrame) { +#ifdef STAT + if (shared->collectStat) + shared->stat.VDtooLateP ++; +#endif + goto frameTooLate; + } + } + else { /* 'I' */ + if (!shared->live) + { + if (p->display + shared->IframeGap <= shared->nextFrame) { +#ifdef STAT + if (shared->collectStat) + shared->stat.VDtooLateI ++; +#endif + frameTooLate: + if (shared->rtplay) /* too late, drop the frame */ + { + vbuffer->VBreclaimMsg((char*)p); + /* + Fprintf(stderr, "VD: frame %d too late, shared->nextFrame %d.\n", + p->frame, shared->nextFrame); + */ + continue; + } + } + } + else { /* live video */ + if (p->display < shared->nextFrame) { + vbuffer->VBreclaimMsg((char*)p); + /* + Fprintf(stderr, "VD live video frame %d too late, nextFrame=%d\n", + p->frame, shared->nextFrame); + */ + continue; + } + } + } + } + } + else if (curcmd == CmdFF) + { + if (p->gop < shared->nextGroup && VDcheckMsg() > 0) + { + /* + fprintf(stderr, "VD: a frame too late and dropped when FF.\n"); + printPacket(p); + */ + vbuffer->VBreclaimMsg((char*)p); + continue; + } + } + else if (curcmd == CmdFB) + { + if (p->gop > shared->nextGroup && VDcheckMsg() > 0) + { + /* + fprintf(stderr, "VD: a frame too late and dropped when FB.\n"); + printPacket(p); + */ + vbuffer->VBreclaimMsg((char*)p); + continue; + } + } + else + single_tag = 1; + + if (shared->videoFormat == VIDEO_JPEG || shared->videoFormat == VIDEO_SIF) { + int picsize = win_width * win_height; + unsigned char * l, *cr, *cb; + + if (shared->videoFormat == VIDEO_SIF) { + l = (unsigned char*)p + sizeof(*p); + cr = l + picsize; + cb = l + picsize + (picsize >> 2); + } + else { /* decode the JPEG frame */ + l = cr = cb = (unsigned char *)curBlk->data; + memcpy(l, (unsigned char*)p + sizeof(*p), p->dataBytes); + } + DoDitherImage(l, cr, cb, + (unsigned char *)curBlk->data, win_height, win_width); + curBlk->sh = p->sh; + curBlk->gop = p->gop; + curBlk->frame = p->frame; + curBlk->display = p->display; + curBlk->future = p->future; + curBlk->past = p->past; + VDputMsg(curBlk); + curBlk = NULL; + /* + Fprintf(stderr, "VD: SIF frame %d decoded.\n", p->frame); + */ + goto end_decode_loop; + } +#ifdef NeedByteOrderConversion + else { + unsigned int * ptr = (unsigned int *)((char*)p + sizeof(*p)); + /* the added two extra words to max_buf_length: one is for SHCODE, already + in right byte order, the second is for prevent calling of get_more_data(). + (which seem required for the UCB decoder used here ), this second word + contains value used by VB algorithm, and can't be changed elsewhere. + So they should not be swapped byte order. */ + for (i=0; i<((p->dataBytes + 11)>>2) - 2; i++) + { + *ptr = ntohl(*ptr); + ptr++; + } + } +#endif + + if (!mpegVidRsrc((char*)p)) /* successfully decoded */ + { + curPict = curVidStream->current; + + // fprintf(stderr, "VD successfully decodes a frame.\n"); + // printPacket(p); + + if (curcmd == CmdPLAY && shared->rtplay) + { + if ((curVidStream->picture.code_type == I_TYPE) || + (curVidStream->picture.code_type == P_TYPE)) + { + if (curVidStream->future == NULL) + { + curVidStream->future = curVidStream->current; + curVidStream->future->locked |= FUTURE_LOCK; + } + else + { + if (curVidStream->past != NULL) + { + curVidStream->past->locked &= ~PAST_LOCK; + } + else if (curcmd == CmdPLAY) { + /* this case should happen only at the begining of PLAY */ + DitherFrame(curVidStream->future, VDgetBuf()); + } + curVidStream->past = curVidStream->future; + curVidStream->past->locked &= ~FUTURE_LOCK; + curVidStream->past->locked |= PAST_LOCK; + curVidStream->future = curVidStream->current; + curVidStream->future->locked |= FUTURE_LOCK; + } + } + } + else if (curcmd == CmdSTEP || curcmd == CmdPLAY) /* !shared->rtplay */ + { + if ((curVidStream->picture.code_type == I_TYPE) || + (curVidStream->picture.code_type == P_TYPE)) + { + if (curVidStream->future == NULL) + { + curVidStream->future = curVidStream->current; + curVidStream->future->locked |= FUTURE_LOCK; + } + else + { + if (curVidStream->past != NULL) + { + curVidStream->past->locked &= ~PAST_LOCK; + } + curVidStream->past = curVidStream->future; + curVidStream->past->locked &= ~FUTURE_LOCK; + curVidStream->past->locked |= PAST_LOCK; + curVidStream->future = curVidStream->current; + curVidStream->future->locked |= FUTURE_LOCK; + curPict = curVidStream->past; + } + } + } + else /* only I-frame for all other Cmds */ + { + if (curVidStream->future != NULL) { + curVidStream->future->locked &= ~FUTURE_LOCK; + curVidStream->future = NULL; + } + if (curVidStream->past != NULL) + { + curVidStream->past->locked &= ~PAST_LOCK; + curVidStream->past = NULL; + } + /* + curVidStream->future = curVidStream->current; + curVidStream->future->locked |= FUTURE_LOCK; + */ + } + + if (p->past == -1 && p->future == -1) + shared->lastIframeDecoded = p->frame; + +#ifdef STAT + if (shared->collectStat && p->cmd != CmdREF) + { + int val = curPict->frame; + shared->stat.VDframesDecoded[val>>3] |= 1 << (val % 8); + shared->stat.VDlastFrameDecoded = val; + } +#endif + /* + if (single_tag && p->cmd != CmdREF) + { + fprintf(stderr, "VD: display %d for single.\n", curPict->display); + } + */ + /* + Fprintf(stderr, "p->cmd %d, p->cmdsn %d, shared->cmdsn %d\n", + p->cmd, p->cmdsn, shared->cmdsn); + */ + if (p->cmd != CmdREF && curcmdsn == shared->cmdsn) { + DitherFrame(curPict, curBlk); + curBlk = NULL; + } + } + else /* decoding failed */ + { + + fprintf(stderr, "VD error -- tried but failed decoding the packet.\n"); + printPacket(p); + } + + end_decode_loop: + + /* signal CTR for singlular operation: STEP, POSITION, INIT */ + if (single_tag && p->cmd != CmdREF && curcmdsn == shared->cmdsn) + { + + fprintf(stderr, "VD decoded f%d, USR1 to CTR\n", p->frame); + char message[BUFSIZ]; + message[0]= DECODED; + int result = ACE_OS::write (vdsp[1],&message,BUFSIZ); + if (result == -1) + perror ("VD:Decode Notify"); + if (result == 0) + perror ("VD:Socket Closed"); + } + vbuffer->VBreclaimMsg((char*)p); + } +} + + +static void InitDitherEnv(void) +{ + lum_values = (int *) ACE_OS::malloc(LUM_RANGE*sizeof(int)); + cr_values = (int *) ACE_OS::malloc(CR_RANGE*sizeof(int)); + cb_values = (int *) ACE_OS::malloc(CB_RANGE*sizeof(int)); + init_tables(); + + while (!shared->pixelValid) { + usleep(10000); + } + ACE_OS::memcpy (pixel, shared->pixel, 256); + + switch (ditherType) { + + case HYBRID_DITHER: + + InitColor(); + InitHybridDither(); + break; + + case HYBRID2_DITHER: + InitColor(); + InitHybridErrorDither(); + break; + + case FS4_DITHER: + InitColor(); + InitFS4Dither(); + break; + + case FS2_DITHER: + InitColor(); + InitFS2Dither(); + break; + + case FS2FAST_DITHER: + InitColor(); + InitFS2FastDither(); + break; + + case Twox2_DITHER: + InitColor(); + Init2x2Dither(); + PostInit2x2Dither(); + break; + + case GRAY_DITHER: + break; + + case FULL_COLOR_DITHER: + InitColorDither(); + break; + + case ORDERED_DITHER: + InitColor(); + InitOrderedDither(); + break; + + case MONO_DITHER: + case MONO_THRESHOLD: + break; + + case ORDERED2_DITHER: + InitColor(); + InitOrdered2Dither(); + break; + } +} + +/* + *-------------------------------------------------------------- + * + * DoDitherImage -- + * + * Called when image needs to be dithered. Selects correct + * dither routine based on info in ditherType. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void DoDitherImage(unsigned char *l, unsigned char *Cr, unsigned char *Cb, + unsigned char *disp, int h, int w) +{ + + switch(ditherType) { + case HYBRID_DITHER: + HybridDitherImage(l, Cr, Cb, disp, h, w); + break; + + case HYBRID2_DITHER: + HybridErrorDitherImage(l, Cr, Cb, disp, h, w); + break; + + case FS2FAST_DITHER: + FS2FastDitherImage(l, Cr, Cb, disp, h, w); + break; + + case FS2_DITHER: + FS2DitherImage(l, Cr, Cb, disp, h, w); + break; + + case FS4_DITHER: + FS4DitherImage(l, Cr, Cb, disp, h, w); + break; + + case Twox2_DITHER: + Twox2DitherImage(l, Cr, Cb, disp, h, w); + break; + + case FULL_COLOR_DITHER: + ColorDitherImage(l, Cr, Cb, disp, h, w); + break; + + case GRAY_DITHER: + GrayDitherImage(l, Cr, Cb, disp, h, w); + break; + + case NO_DITHER: + break; + + case ORDERED_DITHER: + OrderedDitherImage(l, Cr, Cb, disp, h, w); + break; + + case MONO_DITHER: + MonoDitherImage(l, Cr, Cb, disp, h, w); + break; + + case MONO_THRESHOLD: + MonoThresholdImage(l, Cr, Cb, disp, h, w); + break; + + case ORDERED2_DITHER: + Ordered2DitherImage(l, Cr, Cb, disp, h, w); + break; + + case MBORDERED_DITHER: + MBOrderedDitherImage(l, Cr, Cb, disp, h, w); + break; + } +} + +static void DitherFrame(PictImage * pict, FrameBlock *frame) +{ + DoDitherImage((unsigned char *)pict->luminance, + (unsigned char *)pict->Cr, (unsigned char *)pict->Cb, + (unsigned char *)frame->data, win_height, win_width); + frame->sh = pict->sh; + frame->gop = pict->gop; + frame->frame = pict->frame; + frame->display = pict->display; + frame->future = pict->future; + frame->past = pict->past; + VDputMsg(frame); +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.cpp new file mode 100644 index 00000000000..07c106b63a6 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.cpp @@ -0,0 +1,3762 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* + * This file contains C code that implements + * the video decoder model. + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> + +#ifndef MIPS +#include <sys/time.h> +#else +#include <sys/types.h> +#include <sys/system.h> +#endif + +#include "include/common.h" +#include "decoders.h" +#include "video.h" +#include "util.h" +#include "proto.h" +#include "global.h" +#include "ui.h" + +ACE_RCSID(mpeg_client, video, "$Id$") + +/* Declarations of functions. */ +static void ReconIMBlock(VidStream *vid_stream, int bnum); +static void ReconPMBlock(VidStream *vid_stream, int bnum, + int recon_right_for, int recon_down_for, int zflag); +static void ReconBMBlock(VidStream *vid_stream, + int bnum, int recon_right_back, + int recon_down_back, int zflag); +static void ReconBiMBlock(VidStream *vid_stream, int bnum, int recon_right_for, + int recon_down_for, int recon_right_back, + int recon_down_back, int zflag); +static void ReconSkippedBlock(unsigned char *source, unsigned char *dest, + int row, int col, int row_size, int right, int down, + int right_half, int down_half, int width); +static int ParseSeqHead(VidStream *vid_stream); +static int ParseGOP(VidStream *vid_stream); +static int ParsePicture(VidStream *vid_stream,TimeStamp time_stamp); +static int ParseSlice(VidStream *vid_stream); +static int ParseMacroBlock(VidStream *vid_stream); +static void ProcessSkippedPFrameMBlocks(VidStream *vid_stream); +static void ProcessSkippedBFrameMBlocks(VidStream *vid_stream); + +extern int ditherType; +char *ditherFlags; + +/* Macro for returning 1 if num is positive, -1 if negative, 0 if 0. */ + +#define Sign(num) ((num > 0) ? 1 : ((num == 0) ? 0 : -1)) + +/* Declare global pointer to vid stream used for current decoding. */ + +VidStream *curVidStream = NULL; + +/* Set up array for fast conversion from zig zag order to row/column + coordinates. +*/ + +int zigzag[64][2] = { + 0, 0, 1, 0, 0, 1, 0, 2, 1, 1, 2, 0, 3, 0, 2, 1, 1, 2, 0, 3, 0, 4, 1, 3, + 2, 2, 3, 1, 4, 0, 5, 0, 4, 1, 3, 2, 2, 3, 1, 4, 0, 5, 0, 6, 1, 5, 2, 4, + 3, 3, 4, 2, 5, 1, 6, 0, 7, 0, 6, 1, 5, 2, 4, 3, 3, 4, 2, 5, 1, 6, 0, 7, + 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, 2, 7, 1, 7, 2, 6, 3, 5, 4, 4, 5, 3, 6, + 2, 7, 3, 7, 4, 6, 5, 5, 6, 4, 7, 3, 7, 4, 6, 5, 5, 6, 4, 7, 5, 7, 6, 6, +7, 5, 7, 6, 6, 7, 7, 7}; +/* Array mapping zigzag to array pointer offset. */ + +int zigzag_direct[64] = { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, + 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, + 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, +58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63}; +/* Set up array for fast conversion from row/column coordinates to + zig zag order. +*/ + +int scan[8][8] = { + {0, 1, 5, 6, 14, 15, 27, 28}, + {2, 4, 7, 13, 16, 26, 29, 42}, + {3, 8, 12, 17, 25, 30, 41, 43}, + {9, 11, 18, 24, 31, 40, 44, 53}, + {10, 19, 23, 32, 39, 45, 52, 54}, + {20, 22, 33, 38, 46, 51, 55, 60}, + {21, 34, 37, 47, 50, 56, 59, 61}, +{35, 36, 48, 49, 57, 58, 62, 63}}; +/* Initialize P and B skip flags. */ + +static int No_P_Flag = 0; +static int No_B_Flag = 0; + +/* Max lum, chrom indices for illegal block checking. */ + +static int lmaxx; +static int lmaxy; +static int cmaxx; +static int cmaxy; + +/* + * We use a lookup table to make sure values stay in the 0..255 range. + * Since this is cropping (ie, x = (x < 0)?0:(x>255)?255:x; ), wee call this + * table the "crop table". + * MAX_NEG_CROP is the maximum neg/pos value we can handle. + */ + +#define MAX_NEG_CROP 384 +#define NUM_CROP_ENTRIES (256+2*MAX_NEG_CROP) +#define assertCrop(x) assert(((x) >= -MAX_NEG_CROP) && \ + ((x) <= 256+MAX_NEG_CROP)) +static unsigned char cropTbl[NUM_CROP_ENTRIES]; + +/* + The following accounts for time and size spent in various parsing acitivites + if ANALYSIS has been defined. +*/ + +#ifdef ANALYSIS + + +unsigned int bitCount = 0; + +int showmb_flag = 0; +int showEachFlag = 0; + +typedef struct { + int frametype; + unsigned int totsize; + unsigned int number; + unsigned int i_mbsize; + unsigned int p_mbsize; + unsigned int b_mbsize; + unsigned int bi_mbsize; + unsigned int i_mbnum; + unsigned int p_mbnum; + unsigned int b_mbnum; + unsigned int bi_mbnum; + unsigned int i_mbcbp[64]; + unsigned int p_mbcbp[64]; + unsigned int b_mbcbp[64]; + unsigned int bi_mbcbp[64]; + unsigned int i_mbcoeff[64]; + unsigned int p_mbcoeff[64]; + unsigned int b_mbcoeff[64]; + unsigned int bi_mbcoeff[64]; + double tottime; +} Statval; + +Statval stat_a[4]; +unsigned int pictureSizeCount; +unsigned int mbSizeCount; +unsigned int *mbCBPPtr, *mbCoeffPtr, *mbSizePtr; +unsigned int cacheHit[8][8]; +unsigned int cacheMiss[8][8]; + +static void +init_stat_struct(astat) + Statval *astat; +{ + int j; + + astat->frametype = 0; + astat->totsize = 0; + astat->number = 0; + astat->i_mbsize = 0; + astat->p_mbsize = 0; + astat->b_mbsize = 0; + astat->bi_mbsize = 0; + astat->i_mbnum = 0; + astat->p_mbnum = 0; + astat->b_mbnum = 0; + astat->bi_mbnum = 0; + + for (j = 0; j < 64; j++) { + + astat->i_mbcbp[j] = 0; + astat->p_mbcbp[j] = 0; + astat->b_mbcbp[j] = 0; + astat->bi_mbcbp[j] = 0; + astat->i_mbcoeff[j] = 0; + astat->p_mbcoeff[j] = 0; + astat->b_mbcoeff[j] = 0; + astat->bi_mbcoeff[j] = 0; + } + astat->tottime = 0.0; +} + +void +init_stats() +{ + int i, j; + + for (i = 0; i < 4; i++) { + init_stat_struct(&(stat_a[i])); + stat_a[i].frametype = i; + } + + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + cacheHit[i][j] = 0; + cacheMiss[i][j] = 0; + } + } + + bitCount = 0; +} + +static void +PrintOneStat() +{ + int i; + + printf("\n"); + switch (stat_a[0].frametype) { + case I_TYPE: + printf("I FRAME\n"); + break; + case P_TYPE: + printf("P FRAME\n"); + break; + case B_TYPE: + printf("B FRAME\n"); + break; + } + + printf("Size: %d bytes + %d bits\n", stat_a[0].totsize / 8, stat_a[0].totsize % 8); + if (stat_a[0].i_mbnum > 0) { + printf("\tI Macro Block Stats:\n"); + printf("\t%d I Macroblocks\n", stat_a[0].i_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[0].i_mbsize / (8 * stat_a[0].i_mbnum), + (stat_a[0].i_mbsize * stat_a[0].i_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].i_mbcbp[i], + stat_a[0].i_mbcbp[i + 1], stat_a[0].i_mbcbp[i + 2], stat_a[0].i_mbcbp[i + 3], + stat_a[0].i_mbcbp[i + 4], stat_a[0].i_mbcbp[i + 5], stat_a[0].i_mbcbp[i + 6], + stat_a[0].i_mbcbp[i + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].i_mbcoeff[i], + stat_a[0].i_mbcoeff[i + 1], stat_a[0].i_mbcoeff[i + 2], + stat_a[0].i_mbcoeff[i + 3], stat_a[0].i_mbcoeff[i + 4], + stat_a[0].i_mbcoeff[i + 5], stat_a[0].i_mbcoeff[i + 6], + stat_a[0].i_mbcoeff[i + 7]); + } + } + if (stat_a[0].p_mbnum > 0) { + printf("\tP Macro Block Stats:\n"); + printf("\t%d P Macroblocks\n", stat_a[0].p_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[0].p_mbsize / (8 * stat_a[0].p_mbnum), + (stat_a[0].p_mbsize / stat_a[0].p_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].p_mbcbp[i], + stat_a[0].p_mbcbp[i + 1], stat_a[0].p_mbcbp[i + 2], stat_a[0].p_mbcbp[i + 3], + stat_a[0].p_mbcbp[i + 4], stat_a[0].p_mbcbp[i + 5], stat_a[0].p_mbcbp[i + 6], + stat_a[0].p_mbcbp[i + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].p_mbcoeff[i], + stat_a[0].p_mbcoeff[i + 1], stat_a[0].p_mbcoeff[i + 2], + stat_a[0].p_mbcoeff[i + 3], stat_a[0].p_mbcoeff[i + 4], + stat_a[0].p_mbcoeff[i + 5], stat_a[0].p_mbcoeff[i + 6], + stat_a[0].p_mbcoeff[i + 7]); + } + } + if (stat_a[0].b_mbnum > 0) { + printf("\tB Macro Block Stats:\n"); + printf("\t%d B Macroblocks\n", stat_a[0].b_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[0].b_mbsize / (8 * stat_a[0].b_mbnum), + (stat_a[0].b_mbsize / stat_a[0].b_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].b_mbcbp[i], + stat_a[0].b_mbcbp[i + 1], stat_a[0].b_mbcbp[i + 2], stat_a[0].b_mbcbp[i + 3], + stat_a[0].b_mbcbp[i + 4], stat_a[0].b_mbcbp[i + 5], stat_a[0].b_mbcbp[i + 6], + stat_a[0].b_mbcbp[i + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].b_mbcoeff[i], + stat_a[0].b_mbcoeff[i + 1], stat_a[0].b_mbcoeff[i + 2], + stat_a[0].b_mbcoeff[i + 3], stat_a[0].b_mbcoeff[i + 4], + stat_a[0].b_mbcoeff[i + 5], stat_a[0].b_mbcoeff[i + 6], + stat_a[0].b_mbcoeff[i + 7]); + } + } + if (stat_a[0].bi_mbnum > 0) { + printf("\tBi Macro Block Stats:\n"); + printf("\t%d Bi Macroblocks\n", stat_a[0].bi_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[0].bi_mbsize / (8 * stat_a[0].bi_mbnum), + (stat_a[0].bi_mbsize * stat_a[0].bi_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].bi_mbcbp[i], + stat_a[0].bi_mbcbp[i + 1], stat_a[0].bi_mbcbp[i + 2], stat_a[0].bi_mbcbp[i + 3], + stat_a[0].bi_mbcbp[i + 4], stat_a[0].bi_mbcbp[i + 5], stat_a[0].bi_mbcbp[i + 6], + stat_a[0].bi_mbcbp[i + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (i = 0; i < 64; i += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[0].bi_mbcoeff[i], + stat_a[0].bi_mbcoeff[i + 1], stat_a[0].bi_mbcoeff[i + 2], + stat_a[0].bi_mbcoeff[i + 3], stat_a[0].bi_mbcoeff[i + 4], + stat_a[0].bi_mbcoeff[i + 5], stat_a[0].bi_mbcoeff[i + 6], + stat_a[0].bi_mbcoeff[i + 7]); + } + } + printf("\nTime to Decode: %g secs.\n", stat_a[0].tottime); + printf("****************\n"); +} + +void +PrintAllStats() +{ + int i, j; + unsigned int supertot, supernum; + double supertime; + + printf("\n"); + printf("General Info: \n"); + printf("Width: %d\nHeight: %d\n", curVidStream->mb_width * 16, curVidStream->mb_height * 16); + + for (i = 1; i < 4; i++) { + + if (stat_a[i].number == 0) + continue; + + switch (i) { + case 1: + printf("I FRAMES\n"); + break; + case 2: + printf("P FRAMES\n"); + break; + case 3: + printf("B FRAMES\n"); + break; + } + + printf("Number: %d\n", stat_a[i].number); + printf("Avg. Size: %d bytes + %d bits\n", + stat_a[i].totsize / (8 * stat_a[i].number), (stat_a[i].totsize / stat_a[i].number) % 8); + if (stat_a[i].i_mbnum > 0) { + printf("\tI Macro Block Stats:\n"); + printf("\t%d I Macroblocks\n", stat_a[i].i_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[i].i_mbsize / (8 * stat_a[i].i_mbnum), + (stat_a[i].i_mbsize / stat_a[i].i_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].i_mbcbp[j], + stat_a[i].i_mbcbp[j + 1], stat_a[i].i_mbcbp[j + 2], stat_a[i].i_mbcbp[j + 3], + stat_a[i].i_mbcbp[j + 4], stat_a[i].i_mbcbp[j + 5], stat_a[i].i_mbcbp[j + 6], + stat_a[i].i_mbcbp[j + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].i_mbcoeff[j], + stat_a[i].i_mbcoeff[j + 1], stat_a[i].i_mbcoeff[j + 2], + stat_a[i].i_mbcoeff[j + 3], stat_a[i].i_mbcoeff[j + 4], + stat_a[i].i_mbcoeff[j + 5], stat_a[i].i_mbcoeff[j + 6], + stat_a[i].i_mbcoeff[j + 7]); + } + } + if (stat_a[i].p_mbnum > 0) { + printf("\tP Macro Block Stats:\n"); + printf("\t%d P Macroblocks\n", stat_a[i].p_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[i].p_mbsize / (8 * stat_a[i].p_mbnum), + (stat_a[i].p_mbsize / stat_a[i].p_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].p_mbcbp[j], + stat_a[i].p_mbcbp[j + 1], stat_a[i].p_mbcbp[j + 2], stat_a[i].p_mbcbp[j + 3], + stat_a[i].p_mbcbp[j + 4], stat_a[i].p_mbcbp[j + 5], stat_a[i].p_mbcbp[j + 6], + stat_a[i].p_mbcbp[j + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].p_mbcoeff[j], + stat_a[i].p_mbcoeff[j + 1], stat_a[i].p_mbcoeff[j + 2], + stat_a[i].p_mbcoeff[j + 3], stat_a[i].p_mbcoeff[j + 4], + stat_a[i].p_mbcoeff[j + 5], stat_a[i].p_mbcoeff[j + 6], + stat_a[i].p_mbcoeff[j + 7]); + } + } + if (stat_a[i].b_mbnum > 0) { + printf("\tB Macro Block Stats:\n"); + printf("\t%d B Macroblocks\n", stat_a[i].b_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[i].b_mbsize / (8 * stat_a[i].b_mbnum), + (stat_a[i].b_mbsize * stat_a[i].b_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].b_mbcbp[j], + stat_a[i].b_mbcbp[j + 1], stat_a[i].b_mbcbp[j + 2], stat_a[i].b_mbcbp[j + 3], + stat_a[i].b_mbcbp[j + 4], stat_a[i].b_mbcbp[j + 5], stat_a[i].b_mbcbp[j + 6], + stat_a[i].b_mbcbp[j + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].b_mbcoeff[j], + stat_a[i].b_mbcoeff[j + 1], stat_a[i].b_mbcoeff[j + 2], + stat_a[i].b_mbcoeff[j + 3], stat_a[i].b_mbcoeff[j + 4], + stat_a[i].b_mbcoeff[j + 5], stat_a[i].b_mbcoeff[j + 6], + stat_a[i].b_mbcoeff[j + 7]); + } + } + if (stat_a[i].bi_mbnum > 0) { + printf("\tBi Macro Block Stats:\n"); + printf("\t%d Bi Macroblocks\n", stat_a[i].bi_mbnum); + printf("\tAvg. Size: %d bytes + %d bits\n", + stat_a[i].bi_mbsize / (8 * stat_a[i].bi_mbnum), + (stat_a[i].bi_mbsize * stat_a[i].bi_mbnum) % 8); + printf("\t\tCoded Block Pattern Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].bi_mbcbp[j], + stat_a[i].bi_mbcbp[j + 1], stat_a[i].bi_mbcbp[j + 2], stat_a[i].bi_mbcbp[j + 3], + stat_a[i].bi_mbcbp[j + 4], stat_a[i].bi_mbcbp[j + 5], stat_a[i].bi_mbcbp[j + 6], + stat_a[i].bi_mbcbp[j + 7]); + } + printf("\n\t\tNumber of Coefficients/Block Histogram:\n"); + for (j = 0; j < 64; j += 8) { + printf("\t%.6d %.6d %.6d %.6d %.6d %.6d %.6d %.6d\n", stat_a[i].bi_mbcoeff[j], + stat_a[i].bi_mbcoeff[j + 1], stat_a[i].bi_mbcoeff[j + 2], + stat_a[i].bi_mbcoeff[j + 3], stat_a[i].bi_mbcoeff[j + 4], + stat_a[i].bi_mbcoeff[j + 5], stat_a[i].bi_mbcoeff[j + 6], + stat_a[i].bi_mbcoeff[j + 7]); + } + } + printf("\nAvg. Time to Decode: %f secs.\n", + (stat_a[i].tottime / ((double) stat_a[i].number))); + printf("\n"); + printf("*************************\n\n"); + } + + supertot = stat_a[1].totsize + stat_a[2].totsize + stat_a[3].totsize; + supernum = stat_a[1].number + stat_a[2].number + stat_a[3].number; + supertime = stat_a[1].tottime + stat_a[2].tottime + stat_a[3].tottime; + + printf("Total Number of Frames: %d\n", supernum); + printf("Avg Frame Size: %d bytes %d bits\n", + supertot / (8 * supernum), (supertot / supernum) % 8); + printf("Total Time Decoding: %g secs.\n", supertime); + printf("Avg Decoding Time/Frame: %g secs.\n", supertime / ((double) supernum)); + printf("Avg Decoding Frames/Sec: %g secs.\n", ((double) supernum) / supertime); + printf("\n"); + + printf("Cache Hits/Miss\n"); + for (i = 0; i < 8; i++) { + printf("%.6d/%.6d\t%.6d/%.6d\t%.6d/%.6d\t%.6d/%.6d\n", + cacheHit[i][0], cacheMiss[i][0], cacheHit[i][1], cacheMiss[i][1], + cacheHit[i][2], cacheMiss[i][2], cacheHit[i][3], cacheMiss[i][3]); + printf("%.6d/%.6d\t%.6d/%.6d\t%.6d/%.6d\t%.6d/%.6d\n", + cacheHit[i][4], cacheMiss[i][4], cacheHit[i][5], cacheMiss[i][5], + cacheHit[i][6], cacheMiss[i][6], cacheHit[i][7], cacheMiss[i][7]); + } + +} + +static void +CollectStats() +{ + int i, j; + + i = stat_a[0].frametype; + + stat_a[i].totsize += stat_a[0].totsize; + stat_a[i].number += stat_a[0].number; + stat_a[i].i_mbsize += stat_a[0].i_mbsize; + stat_a[i].p_mbsize += stat_a[0].p_mbsize; + stat_a[i].b_mbsize += stat_a[0].b_mbsize; + stat_a[i].bi_mbsize += stat_a[0].bi_mbsize; + stat_a[i].i_mbnum += stat_a[0].i_mbnum; + stat_a[i].p_mbnum += stat_a[0].p_mbnum; + stat_a[i].b_mbnum += stat_a[0].b_mbnum; + stat_a[i].bi_mbnum += stat_a[0].bi_mbnum; + + for (j = 0; j < 64; j++) { + + stat_a[i].i_mbcbp[j] += stat_a[0].i_mbcbp[j]; + stat_a[i].p_mbcbp[j] += stat_a[0].p_mbcbp[j]; + stat_a[i].b_mbcbp[j] += stat_a[0].b_mbcbp[j]; + stat_a[i].bi_mbcbp[j] += stat_a[0].bi_mbcbp[j]; + stat_a[i].i_mbcoeff[j] += stat_a[0].i_mbcoeff[j]; + stat_a[i].p_mbcoeff[j] += stat_a[0].p_mbcoeff[j]; + stat_a[i].b_mbcoeff[j] += stat_a[0].b_mbcoeff[j]; + stat_a[i].bi_mbcoeff[j] += stat_a[0].bi_mbcoeff[j]; + } + + stat_a[i].tottime += stat_a[0].tottime; + + init_stat_struct(&(stat_a[0])); +} + +static unsigned int +bitCountRead() +{ + return bitCount; +} + +static void +StartTime() +{ + stat_a[0].tottime = ReadSysClock(); +} + +static void +EndTime() +{ + stat_a[0].tottime = ReadSysClock() - stat_a[0].tottime; +} +#endif + +double realTimeStart; +int totNumFrames = 0; + +double +ReadSysClock() +{ + struct timeval tv; + (void) gettimeofday(&tv, (struct timezone *)NULL); + return (tv.tv_sec + tv.tv_usec / 1000000.0); +} + +void +PrintTimeInfo() +{ + double spent; + + spent = ReadSysClock() - realTimeStart; + + if (!quietFlag) { + printf("\nReal Time Spent (After Initializations): %f secs.\n", spent); + printf("Avg. Frames/Sec: %f\n", ((double) totNumFrames) / spent); +/* + print_delta(); +*/ + } +} + + + +/* + *-------------------------------------------------------------- + * + * NewVidStream -- + * + * Allocates and initializes a VidStream structure. Takes + * as parameter requested size for buffer length. + * + * Results: + * A pointer to the new VidStream structure. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +VidStream * NewVidStream(void) +{ + int i, j; + VidStream *new_stream; + static unsigned char default_intra_matrix[64] = { + 8, 16, 19, 22, 26, 27, 29, 34, + 16, 16, 22, 24, 27, 29, 34, 37, + 19, 22, 26, 27, 29, 34, 34, 38, + 22, 22, 26, 27, 29, 34, 37, 40, + 22, 26, 27, 29, 32, 35, 40, 48, + 26, 27, 29, 32, 35, 40, 48, 58, + 26, 27, 29, 34, 38, 46, 56, 69, + 27, 29, 35, 38, 46, 56, 69, 83}; + + /* Allocate memory for new structure. */ + + new_stream = (VidStream *) ACE_OS::malloc(sizeof(VidStream)); + + /* Initialize pointers to extension and user data. */ + + new_stream->group.ext_data = new_stream->group.user_data = + new_stream->picture.extra_info = new_stream->picture.user_data = + new_stream->picture.ext_data = new_stream->slice.extra_info = + new_stream->ext_data = new_stream->user_data = NULL; + + /* Copy default intra matrix. */ + + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + new_stream->intra_quant_matrix[j][i] = default_intra_matrix[i * 8 + j]; + } + } + + /* Initialize crop table. */ + + for (i = (-MAX_NEG_CROP); i < NUM_CROP_ENTRIES - MAX_NEG_CROP; i++) { + if (i <= 0) { + cropTbl[i + MAX_NEG_CROP] = 0; + } else if (i >= 255) { + cropTbl[i + MAX_NEG_CROP] = 255; + } else { + cropTbl[i + MAX_NEG_CROP] = i; + } + } + + /* Initialize non intra quantization matrix. */ + + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + new_stream->non_intra_quant_matrix[j][i] = 16; + } + } + + /* Initialize pointers to image spaces. */ + + new_stream->current = new_stream->past = new_stream->future = NULL; + for (i = 0; i < RING_BUF_SIZE; i++) { + new_stream->ring[i] = NULL; + } + + + /* Initialize bitstream i/o fields. */ + + new_stream->max_buf_length = 0; + new_stream->bit_offset = 0; + new_stream->buf_length = 0; + new_stream->buffer = new_stream->buf_start = NULL; + + + /* Return structure. */ + + return new_stream; +} + + + +/* + *-------------------------------------------------------------- + * + * DestroyVidStream -- + * + * Deallocates a VidStream structure. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +DestroyVidStream(VidStream *astream) +{ + int i; + + if (astream->ext_data != NULL) + ACE_OS::free (astream->ext_data); + + if (astream->user_data != NULL) + ACE_OS::free (astream->user_data); + + if (astream->group.ext_data != NULL) + ACE_OS::free (astream->group.ext_data); + + if (astream->group.user_data != NULL) + ACE_OS::free (astream->group.user_data); + + if (astream->picture.extra_info != NULL) + ACE_OS::free (astream->picture.extra_info); + + if (astream->picture.ext_data != NULL) + ACE_OS::free (astream->picture.ext_data); + + if (astream->picture.user_data != NULL) + ACE_OS::free (astream->picture.user_data); + + if (astream->slice.extra_info != NULL) + ACE_OS::free (astream->slice.extra_info); + + if (astream->buf_start != NULL) + ACE_OS::free (astream->buf_start); + + for (i = 0; i < RING_BUF_SIZE; i++) { + if (astream->ring[i] != NULL) { + DestroyPictImage(astream->ring[i]); + astream->ring[i] = NULL; + } + } + + ACE_OS::free ((char *) astream); +} + + + + +/* + *-------------------------------------------------------------- + * + * NewPictImage -- + * + * Allocates and initializes a PictImage structure. + * The width and height of the image space are passed in + * as parameters. + * + * Results: + * A pointer to the new PictImage structure. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +PictImage * +NewPictImage(unsigned int width, unsigned int height) +{ + PictImage *new_pi; + + /* Allocate memory space for new structure. */ + + new_pi = (PictImage *) ACE_OS::malloc(sizeof(PictImage)); + new_pi->luminance = (unsigned char *) ACE_OS::malloc(width * height); + new_pi->Cr = (unsigned char *) ACE_OS::malloc(width * height / 4); + new_pi->Cb = (unsigned char *) ACE_OS::malloc(width * height / 4); + + /* Reset locked flag. */ + + new_pi->locked = 0; + + /* Return pointer to new structure. */ + + return new_pi; +} + + + +/* + *-------------------------------------------------------------- + * + * DestroyPictImage -- + * + * Deallocates a PictImage structure. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ +void +DestroyPictImage(PictImage *apictimage) +{ + if (apictimage->luminance != NULL) { + ACE_OS::free (apictimage->luminance); + } + if (apictimage->Cr != NULL) { + ACE_OS::free (apictimage->Cr); + } + if (apictimage->Cb != NULL) { + ACE_OS::free (apictimage->Cb); + } + ACE_OS::free (apictimage); +} + + + +/* + *-------------------------------------------------------------- + * + * mpegVidRsrc -- + * + * Parses bit stream until a picture is decoded + * + * Results: + * 0 - successfully decoded a frame, -1 - failed + * + * Side effects: + * Bit stream is irreversibly parsed. + * + *-------------------------------------------------------------- + */ +int mpegVidRsrc(char *packet) +{ + TimeStamp time_stamp = 0; + VidStream *vid_stream = curVidStream; + unsigned int data; + int i, status; + VideoPacket *p = (VideoPacket *) packet; + + /* initialize buffer info and allocate ring item for current frame */ + (curVidStream->buf_start) = (curVidStream->buffer) = + (unsigned int *)(packet + sizeof(*p)); + curVidStream->max_buf_length = curVidStream->buf_length = + (p->dataBytes + 11)>>2; + curVidStream->bit_offset = 0; + + i = 0; + while (curVidStream->ring[i]->locked != 0) + if (++i >= RING_BUF_SIZE) { + ACE_OS::perror ("VD fatal error. Ring buffer full."); + ACE_OS::exit (1); + } + curVidStream->current = curVidStream->ring[i]; + curVidStream->current->sh = p->sh; + curVidStream->current->gop = p->gop; + curVidStream->current->frame = p->frame; + curVidStream->current->display = p->display; + curVidStream->current->future = p->future; + curVidStream->current->past = p->past; + + bitOffset = curVidStream->bit_offset; +#ifdef UTIL2 + curBits = *curVidStream->buffer << bitOffset; +#else + curBits = *curVidStream->buffer; +#endif + bufLength = curVidStream->buf_length; + bitBuffer = curVidStream->buffer; + + /* + * If called for the INIT command, find start code, make sure it is a + * sequence start code. + */ + + if (shared->cmd == CmdINIT) { + next_start_code(); + show_bits32(data); + if (data != SEQ_START_CODE) { + fprintf(stderr, "VD error: This is not first packet of the an MPEG stream, data %u.", data); + DestroyVidStream(curVidStream); + ACE_OS::exit (1); + } + } + /* Get next 32 bits (size of start codes). */ + + show_bits32(data); + + /* Process according to start code */ + + switch (data) + { + case SEQ_END_CODE: + + /* Display last frame. */ + /* + fprintf(stderr, "VD: SEQ_END_CODE decoded.\n"); + */ + if (vid_stream->future != NULL) + { + vid_stream->current = vid_stream->future; + return 0; + } + else + { + fprintf(stderr, "VD error: no more picture for SEQ_END_CODE\n"); + return -1; + } + + case SEQ_START_CODE: + + /* Sequence start code. Parse sequence header. */ + + if (ParseSeqHead(vid_stream) != PARSE_OK) + { + fprintf(stderr, "VD error on decoding SequenceHeader.\n"); + return -1; + } + + /* + * modify vid_stream after sequence start code so that application above can use + * info in header. + */ + + vid_stream->buffer = bitBuffer; + vid_stream->buf_length = bufLength; + vid_stream->bit_offset = bitOffset; + vid_stream->shid = ((VideoPacket *)packet)->sh; + + case GOP_START_CODE: + + /* Group of Pictures start code. Parse gop header. */ + + if (ParseGOP(vid_stream) != PARSE_OK) + { + fprintf(stderr, "VD error on decoding GOP\n"); + return -1; + } + + vid_stream->gopid = ((VideoPacket *)packet)->gop; + + case PICTURE_START_CODE: + + /* Picture start code. Parse picture header and first slice header. */ + + if (vid_stream->gopid != ((VideoPacket *)packet)->gop || + vid_stream->shid != ((VideoPacket *)packet)->sh) + { + shared->needHeader = 1; + /* + fprintf(stderr, "VD error: SeqHeader and/or GOP not available for the picture"); + */ + return -1; + } + + if (ParsePicture(vid_stream, time_stamp) != PARSE_OK) + { + /* + fprintf(stderr, "VD error on parsing Picture header\n"); + */ + return -1; + } + /* parse all the following slices */ + for (;;) + { + if (ParseSlice(vid_stream) != PARSE_OK) + { + fprintf(stderr, "VD error on decoding a Slice header.\n"); + return -1; + } + /* Parse all following macroblocks. */ + for (;;) + { + int res; + /* Check to see if actually a startcode and not a macroblock. */ + if (!next_bits(23, 0x00000000)) + { + /* Not start code. Parse Macroblock. */ + if ((res = ParseMacroBlock(vid_stream)) != PARSE_OK) + { + fprintf(stderr, "VD error on parsing a MacroBlock, res = %d\n", res); + return -1; + } + } + else + { + /* Not macroblock, actually start code. Get start code. */ + next_start_code(); + show_bits32(data); + + /* If start code is outside range of slice start codes, frame is + complete, display frame, otherwise another slice */ + if ((data < SLICE_MIN_START_CODE) || (data > SLICE_MAX_START_CODE)) + return 0; + else + break; + } + } + } + break; + default: + fprintf(stderr, "VD error: fail to clasify the packet.\n"); + return -1; + } + fprintf(stderr, "VD get wired.\n"); + return -1; +} + + +/* + *-------------------------------------------------------------- + * + * ParseSeqHead -- + * + * Assumes bit stream is at the begining of the sequence + * header start code. Parses off the sequence header. + * + * Results: + * Fills the vid_stream structure with values derived and + * decoded from the sequence header. Allocates the pict image + * structures based on the dimensions of the image space + * found in the sequence header. + * + * Side effects: + * Bit stream irreversibly parsed off. + * + *-------------------------------------------------------------- + */ + +static int +ParseSeqHead(VidStream *vid_stream) +{ + + unsigned int data; + int i; + + /* Flush off sequence start code. */ + + flush_bits32; + + /* Get horizontal size of image space. */ + + get_bits12(data); + vid_stream->h_size = data; + + /* Get vertical size of image space. */ + + get_bits12(data); + vid_stream->v_size = data; + + /* Calculate macroblock width and height of image space. */ + + vid_stream->mb_width = (vid_stream->h_size + 15) / 16; + vid_stream->mb_height = (vid_stream->v_size + 15) / 16; + + /* If dither type is MBORDERED allocate ditherFlags. */ + + if (ditherType == MBORDERED_DITHER) { + ditherFlags = (char *) ACE_OS::malloc(vid_stream->mb_width*vid_stream->mb_height); + } + + /* Initialize lmaxx, lmaxy, cmaxx, cmaxy. */ + + lmaxx = vid_stream->mb_width*16-1; + lmaxy = vid_stream->mb_height*16-1; + cmaxx = vid_stream->mb_width*8-1; + cmaxy = vid_stream->mb_height*8-1; + + /* Parse of aspect ratio code. */ + + get_bits4(data); + vid_stream->aspect_ratio = (unsigned char) data; + + /* Parse off picture rate code. */ + + get_bits4(data); + vid_stream->picture_rate = (unsigned char) data; + + /* Parse off bit rate. */ + + get_bits18(data); + vid_stream->bit_rate = data; + + /* Flush marker bit. */ + + flush_bits(1); + + /* Parse off vbv buffer size. */ + + get_bits10(data); + vid_stream->vbv_buffer_size = data; + + /* Parse off contrained parameter flag. */ + + get_bits1(data); + if (data) { + vid_stream->const_param_flag = TRUE; + } else + vid_stream->const_param_flag = FALSE; + + /* + * If intra_quant_matrix_flag set, parse off intra quant matrix values. + */ + + get_bits1(data); + if (data) { + for (i = 0; i < 64; i++) { + get_bits8(data); + + vid_stream->intra_quant_matrix[zigzag[i][1]][zigzag[i][0]] = + (unsigned char) data; + } + } + /* + * If non intra quant matrix flag set, parse off non intra quant matrix + * values. + */ + + get_bits1(data); + if (data) { + for (i = 0; i < 64; i++) { + get_bits8(data); + + vid_stream->non_intra_quant_matrix[zigzag[i][1]][zigzag[i][0]] = + (unsigned char) data; + } + } + /* Go to next start code. */ + + next_start_code(); + + /* + * If next start code is extension start code, parse off extension data. + */ + + if (next_bits(32, EXT_START_CODE)) { + flush_bits32; + if (vid_stream->ext_data != NULL) { + ACE_OS::free (vid_stream->ext_data); + vid_stream->ext_data = NULL; + } + vid_stream->ext_data = get_ext_data(); + } + /* If next start code is user start code, parse off user data. */ + + if (next_bits(32, USER_START_CODE)) { + flush_bits32; + if (vid_stream->user_data != NULL) { + ACE_OS::free (vid_stream->user_data); + vid_stream->user_data = NULL; + } + vid_stream->user_data = get_ext_data(); + } + return PARSE_OK; +} + + + +/* + *-------------------------------------------------------------- + * + * ParseGOP -- + * + * Parses of group of pictures header from bit stream + * associated with vid_stream. + * + * Results: + * Values in gop header placed into video stream structure. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +static int +ParseGOP(VidStream *vid_stream) +{ + unsigned int data; + + /* Flush group of pictures start code. WWWWWWOOOOOOOSSSSSSHHHHH!!! */ + + flush_bits32; + + /* Parse off drop frame flag. */ + + get_bits1(data); + if (data) { + vid_stream->group.drop_flag = TRUE; + } else + vid_stream->group.drop_flag = FALSE; + + /* Parse off hour component of time code. */ + + get_bits5(data); + vid_stream->group.tc_hours = data; + + /* Parse off minute component of time code. */ + + get_bits6(data); + vid_stream->group.tc_minutes = data; + + /* Flush marker bit. */ + + flush_bits(1); + + /* Parse off second component of time code. */ + + get_bits6(data); + vid_stream->group.tc_seconds = data; + + /* Parse off picture count component of time code. */ + + get_bits6(data); + vid_stream->group.tc_pictures = data; + /* + Fprintf(stderr, "GOP time_code:%d:%02d:%02d-%02d\n", + vid_stream->group.tc_hours, + vid_stream->group.tc_minutes, + vid_stream->group.tc_seconds, + vid_stream->group.tc_pictures); + */ + /* Parse off closed gop and broken link flags. */ + + get_bits2(data); + if (data > 1) { + vid_stream->group.closed_gop = TRUE; + if (data > 2) { + vid_stream->group.broken_link = TRUE; + } else + vid_stream->group.broken_link = FALSE; + } else { + vid_stream->group.closed_gop = FALSE; + if (data) { + vid_stream->group.broken_link = TRUE; + } else + vid_stream->group.broken_link = FALSE; + } + + /* Goto next start code. */ + + next_start_code(); + + /* If next start code is extension data, parse off extension data. */ + + if (next_bits(32, EXT_START_CODE)) { + flush_bits32; + if (vid_stream->group.ext_data != NULL) { + ACE_OS::free (vid_stream->group.ext_data); + vid_stream->group.ext_data = NULL; + } + vid_stream->group.ext_data = get_ext_data(); + } + /* If next start code is user data, parse off user data. */ + + if (next_bits(32, USER_START_CODE)) { + flush_bits32; + if (vid_stream->group.user_data != NULL) { + ACE_OS::free (vid_stream->group.user_data); + vid_stream->group.user_data = NULL; + } + vid_stream->group.user_data = get_ext_data(); + } + return PARSE_OK; +} + + + +/* + *-------------------------------------------------------------- + * + * ParsePicture -- + * + * Parses picture header. Marks picture to be presented + * at particular time given a time stamp. + * + * Results: + * Values from picture header put into video stream structure. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +static int +ParsePicture(VidStream *vid_stream,TimeStamp time_stamp) +{ + unsigned int data; + int i; + + /* Flush header start code. */ + flush_bits32; + + /* Parse off temporal reference. */ + get_bits10(data); + vid_stream->picture.temp_ref = data; + /* + Fprintf(stderr, "Pic temp_ref %d\n", vid_stream->picture.temp_ref); + */ + /* Parse of picture type. */ + get_bits3(data); + vid_stream->picture.code_type = data; + + if ((vid_stream->picture.code_type == B_TYPE) && + (No_B_Flag || + (vid_stream->past == NULL) || + (vid_stream->future == NULL))) + return SKIP_PICTURE; + + if ((vid_stream->picture.code_type == P_TYPE) && + (No_P_Flag || (vid_stream->future == NULL))) + return SKIP_PICTURE; + + /* Parse off vbv buffer delay value. */ + get_bits16(data); + vid_stream->picture.vbv_delay = data; + + /* If P or B type frame... */ + + if ((vid_stream->picture.code_type == 2) || (vid_stream->picture.code_type == 3)) { + + /* Parse off forward vector full pixel flag. */ + get_bits1(data); + if (data) + vid_stream->picture.full_pel_forw_vector = TRUE; + else + vid_stream->picture.full_pel_forw_vector = FALSE; + + /* Parse of forw_r_code. */ + get_bits3(data); + + /* Decode forw_r_code into forw_r_size and forw_f. */ + + vid_stream->picture.forw_r_size = data - 1; + vid_stream->picture.forw_f = (1 << vid_stream->picture.forw_r_size); + } + /* If B type frame... */ + + if (vid_stream->picture.code_type == 3) { + + /* Parse off back vector full pixel flag. */ + get_bits1(data); + if (data) + vid_stream->picture.full_pel_back_vector = TRUE; + else + vid_stream->picture.full_pel_back_vector = FALSE; + + /* Parse off back_r_code. */ + get_bits3(data); + + /* Decode back_r_code into back_r_size and back_f. */ + + vid_stream->picture.back_r_size = data - 1; + vid_stream->picture.back_f = (1 << vid_stream->picture.back_r_size); + } + /* Get extra bit picture info. */ + + if (vid_stream->picture.extra_info != NULL) { + ACE_OS::free (vid_stream->picture.extra_info); + vid_stream->picture.extra_info = NULL; + } + vid_stream->picture.extra_info = get_extra_bit_info(); + + /* Goto next start code. */ + next_start_code(); + + /* If start code is extension start code, parse off extension data. */ + + if (next_bits(32, EXT_START_CODE)) { + flush_bits32; + + if (vid_stream->picture.ext_data != NULL) { + ACE_OS::free (vid_stream->picture.ext_data); + vid_stream->picture.ext_data = NULL; + } + vid_stream->picture.ext_data = get_ext_data(); + } + /* If start code is user start code, parse off user data. */ + + if (next_bits(32, USER_START_CODE)) { + flush_bits32; + + if (vid_stream->picture.user_data != NULL) { + ACE_OS::free (vid_stream->picture.user_data); + vid_stream->picture.user_data = NULL; + } + vid_stream->picture.user_data = get_ext_data(); + } + + /* Reset past macroblock address field. */ + + vid_stream->mblock.past_mb_addr = -1; + + return PARSE_OK; +} + +/* + *-------------------------------------------------------------- + * + * ParseSlice -- + * + * Parses off slice header. + * + * Results: + * Values found in slice header put into video stream structure. + * + * Side effects: + * Bit stream irreversibly parsed. + * + *-------------------------------------------------------------- + */ + +static int +ParseSlice(VidStream *vid_stream) +{ + unsigned int data; + + /* Flush slice start code. */ + + flush_bits(24); + + /* Parse off slice vertical position. */ + + get_bits8(data); + vid_stream->slice.vert_pos = data; + + /* Parse off quantization scale. */ + + get_bits5(data); + vid_stream->slice.quant_scale = data; + + /* Parse off extra bit slice info. */ + + if (vid_stream->slice.extra_info != NULL) { + ACE_OS::free (vid_stream->slice.extra_info); + vid_stream->slice.extra_info = NULL; + } + vid_stream->slice.extra_info = get_extra_bit_info(); + + /* Reset past intrablock address. */ + + vid_stream->mblock.past_intra_addr = -2; + + /* Reset previous recon motion vectors. */ + + vid_stream->mblock.recon_right_for_prev = 0; + vid_stream->mblock.recon_down_for_prev = 0; + vid_stream->mblock.recon_right_back_prev = 0; + vid_stream->mblock.recon_down_back_prev = 0; + + /* Reset macroblock address. */ + + vid_stream->mblock.mb_address = ((vid_stream->slice.vert_pos - 1) * + vid_stream->mb_width) - 1; + + /* Reset past dct dc y, cr, and cb values. */ + + vid_stream->block.dct_dc_y_past = 1024; + vid_stream->block.dct_dc_cr_past = 1024; + vid_stream->block.dct_dc_cb_past = 1024; + + return PARSE_OK; +} + + + +/* + *-------------------------------------------------------------- + * + * ParseMacroBlock -- + * + * Parseoff macroblock. Reconstructs DCT values. Applies + * inverse DCT, reconstructs motion vectors, calculates and + * set pixel values for macroblock in current pict image + * structure. + * + * Results: + * Here's where everything really happens. Welcome to the + * heart of darkness. + * + * Side effects: + * Bit stream irreversibly parsed off. + * + *-------------------------------------------------------------- + */ + +static int +ParseMacroBlock(VidStream *vid_stream) +{ + int addr_incr; + unsigned int data; + int mask, i, recon_right_for, recon_down_for, recon_right_back, + recon_down_back; + int zero_block_flag; + BOOLEAN mb_quant, mb_motion_forw, mb_motion_back, mb_pattern; + int no_dith_flag = 0; + +#ifdef ANALYSIS + mbSizeCount = bitCountRead(); +#endif + + /* + * Parse off macroblock address increment and add to macroblock address. + */ + do { + DecodeMBAddrInc(addr_incr); + if (addr_incr == MB_ESCAPE) { + vid_stream->mblock.mb_address += 33; + addr_incr = MB_STUFFING; + } + } while (addr_incr == MB_STUFFING); + vid_stream->mblock.mb_address += addr_incr; + + if (vid_stream->mblock.mb_address > ((vid_stream->mb_height) * (vid_stream->mb_width) - 1)) + { + fprintf(stderr, "mblock.mb_address-%d, mb_height-%d, mb_width-%d, addr_incr-%d\n", + vid_stream->mblock.mb_address, vid_stream->mb_height, vid_stream->mb_width, addr_incr); + return SKIP_TO_START_CODE; + } + + /* + * If macroblocks have been skipped, process skipped macroblocks. + */ + + if (vid_stream->mblock.mb_address - vid_stream->mblock.past_mb_addr > 1) { + if (vid_stream->picture.code_type == P_TYPE) + ProcessSkippedPFrameMBlocks(vid_stream); + else if (vid_stream->picture.code_type == B_TYPE) + ProcessSkippedBFrameMBlocks(vid_stream); + } + /* Set past macroblock address to current macroblock address. */ + vid_stream->mblock.past_mb_addr = vid_stream->mblock.mb_address; + + /* Based on picture type decode macroblock type. */ + switch (vid_stream->picture.code_type) { + case I_TYPE: + DecodeMBTypeI(mb_quant, mb_motion_forw, mb_motion_back, mb_pattern, + vid_stream->mblock.mb_intra); + break; + + case P_TYPE: + DecodeMBTypeP(mb_quant, mb_motion_forw, mb_motion_back, mb_pattern, + vid_stream->mblock.mb_intra); + break; + + case B_TYPE: + DecodeMBTypeB(mb_quant, mb_motion_forw, mb_motion_back, mb_pattern, + vid_stream->mblock.mb_intra); + break; + } + + /* If quantization flag set, parse off new quantization scale. */ + + if (mb_quant == TRUE) { + get_bits5(data); + vid_stream->slice.quant_scale = data; + } + /* If forward motion vectors exist... */ + if (mb_motion_forw == TRUE) { + + /* Parse off and decode horizontal forward motion vector. */ + DecodeMotionVectors(vid_stream->mblock.motion_h_forw_code); + + /* If horiz. forward r data exists, parse off. */ + + if ((vid_stream->picture.forw_f != 1) && + (vid_stream->mblock.motion_h_forw_code != 0)) { + get_bitsn(vid_stream->picture.forw_r_size, data); + vid_stream->mblock.motion_h_forw_r = data; + } + /* Parse off and decode vertical forward motion vector. */ + DecodeMotionVectors(vid_stream->mblock.motion_v_forw_code); + + /* If vert. forw. r data exists, parse off. */ + + if ((vid_stream->picture.forw_f != 1) && + (vid_stream->mblock.motion_v_forw_code != 0)) { + get_bitsn(vid_stream->picture.forw_r_size, data); + vid_stream->mblock.motion_v_forw_r = data; + } + } + /* If back motion vectors exist... */ + if (mb_motion_back == TRUE) { + + /* Parse off and decode horiz. back motion vector. */ + DecodeMotionVectors(vid_stream->mblock.motion_h_back_code); + + /* If horiz. back r data exists, parse off. */ + + if ((vid_stream->picture.back_f != 1) && + (vid_stream->mblock.motion_h_back_code != 0)) { + get_bitsn(vid_stream->picture.back_r_size, data); + vid_stream->mblock.motion_h_back_r = data; + } + /* Parse off and decode vert. back motion vector. */ + DecodeMotionVectors(vid_stream->mblock.motion_v_back_code); + + /* If vert. back r data exists, parse off. */ + + if ((vid_stream->picture.back_f != 1) && + (vid_stream->mblock.motion_v_back_code != 0)) { + get_bitsn(vid_stream->picture.back_r_size, data); + vid_stream->mblock.motion_v_back_r = data; + } + } +#ifdef ANALYSIS + if (vid_stream->mblock.mb_intra) { + stat_a[0].i_mbnum++; + mbCBPPtr = stat_a[0].i_mbcbp; + mbCoeffPtr = stat_a[0].i_mbcoeff; + mbSizePtr = &(stat_a[0].i_mbsize); + } else if (mb_motion_back && mb_motion_forw) { + stat_a[0].bi_mbnum++; + mbCBPPtr = stat_a[0].bi_mbcbp; + mbCoeffPtr = stat_a[0].bi_mbcoeff; + mbSizePtr = &(stat_a[0].bi_mbsize); + } else if (mb_motion_back) { + stat_a[0].b_mbnum++; + mbCBPPtr = stat_a[0].b_mbcbp; + mbCoeffPtr = stat_a[0].b_mbcoeff; + mbSizePtr = &(stat_a[0].b_mbsize); + } else { + stat_a[0].p_mbnum++; + mbCBPPtr = stat_a[0].p_mbcbp; + mbCoeffPtr = stat_a[0].p_mbcoeff; + mbSizePtr = &(stat_a[0].p_mbsize); + } +#endif + + /* If mblock pattern flag set, parse and decode CBP (code block pattern). */ + if (mb_pattern == TRUE) { + DecodeCBP(vid_stream->mblock.cbp); + } + /* Otherwise, set CBP to zero. */ + else + vid_stream->mblock.cbp = 0; + + +#ifdef ANALYSIS + mbCBPPtr[vid_stream->mblock.cbp]++; +#endif + + /* Reconstruct motion vectors depending on picture type. */ + if (vid_stream->picture.code_type == P_TYPE) { + + /* + * If no forw motion vectors, reset previous and current vectors to 0. + */ + + if (!mb_motion_forw) { + recon_right_for = 0; + recon_down_for = 0; + vid_stream->mblock.recon_right_for_prev = 0; + vid_stream->mblock.recon_down_for_prev = 0; + } + /* + * Otherwise, compute new forw motion vectors. Reset previous vectors to + * current vectors. + */ + + else { + ComputeForwVector(&recon_right_for, &recon_down_for); + } + } + if (vid_stream->picture.code_type == B_TYPE) { + + /* Reset prev. and current vectors to zero if mblock is intracoded. */ + + if (vid_stream->mblock.mb_intra) { + vid_stream->mblock.recon_right_for_prev = 0; + vid_stream->mblock.recon_down_for_prev = 0; + vid_stream->mblock.recon_right_back_prev = 0; + vid_stream->mblock.recon_down_back_prev = 0; + } else { + + /* If no forw vectors, current vectors equal prev. vectors. */ + + if (!mb_motion_forw) { + recon_right_for = vid_stream->mblock.recon_right_for_prev; + recon_down_for = vid_stream->mblock.recon_down_for_prev; + } + /* + * Otherwise compute forw. vectors. Reset prev vectors to new values. + */ + + else { + ComputeForwVector(&recon_right_for, &recon_down_for); + } + + /* If no back vectors, set back vectors to prev back vectors. */ + + if (!mb_motion_back) { + recon_right_back = vid_stream->mblock.recon_right_back_prev; + recon_down_back = vid_stream->mblock.recon_down_back_prev; + } + /* Otherwise compute new vectors and reset prev. back vectors. */ + + else { + ComputeBackVector(&recon_right_back, &recon_down_back); + } + + /* + * Store vector existance flags in structure for possible skipped + * macroblocks to follow. + */ + + vid_stream->mblock.bpict_past_forw = mb_motion_forw; + vid_stream->mblock.bpict_past_back = mb_motion_back; + } + } + + /* For each possible block in macroblock. */ + if (ditherType == GRAY_DITHER || + ditherType == MONO_DITHER || + ditherType == MONO_THRESHOLD) { + for (mask = 32, i = 0; i < 4; mask >>= 1, i++) { + + /* If block exists... */ + if ((vid_stream->mblock.mb_intra) || (vid_stream->mblock.cbp & mask)) { + zero_block_flag = 0; + ParseReconBlock(i); + } else { + zero_block_flag = 1; + } + + /* If macroblock is intra coded... */ + if (vid_stream->mblock.mb_intra) { + ReconIMBlock(vid_stream, i); + } else if (mb_motion_forw && mb_motion_back) { + ReconBiMBlock(vid_stream, i, recon_right_for, recon_down_for, + recon_right_back, recon_down_back, zero_block_flag); + } else if (mb_motion_forw || (vid_stream->picture.code_type == P_TYPE)) { + ReconPMBlock(vid_stream, i, recon_right_for, recon_down_for, + zero_block_flag); + } else if (mb_motion_back) { + ReconBMBlock(vid_stream, i, recon_right_back, recon_down_back, + zero_block_flag); + } + } + /* Kill the Chrominace blocks... */ + if ((vid_stream->mblock.mb_intra) || (vid_stream->mblock.cbp & 0x2)) { + ParseAwayBlock(4); + } + if ((vid_stream->mblock.mb_intra) || (vid_stream->mblock.cbp & 0x1)) { + ParseAwayBlock(5); + } + } else { + if ((ditherType == MBORDERED_DITHER) && + (vid_stream->mblock.cbp == 0) && + (vid_stream->picture.code_type == 3) && + (!vid_stream->mblock.mb_intra) && + (!(mb_motion_forw && mb_motion_back))) { + /* + MBOrderedDitherDisplayCopy(vid_stream, vid_stream->mblock.mb_address, + mb_motion_forw, recon_right_for, recon_down_for, + mb_motion_back, recon_right_back, recon_down_back, + vid_stream->past->display, vid_stream->future->display); + ditherFlags[vid_stream->mblock.mb_address] = 0; + no_dith_flag = 1; + */ + } + else { + for (mask = 32, i = 0; i < 6; mask >>= 1, i++) { + + /* If block exists... */ + if ((vid_stream->mblock.mb_intra) || (vid_stream->mblock.cbp & mask)) { + zero_block_flag = 0; + ParseReconBlock(i); + } else { + zero_block_flag = 1; + } + + /* If macroblock is intra coded... */ + if (vid_stream->mblock.mb_intra) { + ReconIMBlock(vid_stream, i); + } else if (mb_motion_forw && mb_motion_back) { + ReconBiMBlock(vid_stream, i, recon_right_for, recon_down_for, + recon_right_back, recon_down_back, zero_block_flag); + } else if (mb_motion_forw || (vid_stream->picture.code_type == P_TYPE)) { + ReconPMBlock(vid_stream, i, recon_right_for, recon_down_for, + zero_block_flag); + } else if (mb_motion_back) { + ReconBMBlock(vid_stream, i, recon_right_back, recon_down_back, + zero_block_flag); + } + } + } + } + + if ((ditherType == MBORDERED_DITHER) && (!no_dith_flag)) { + if ((vid_stream->picture.code_type == 2) && + (vid_stream->mblock.cbp == 0) && + (!vid_stream->mblock.mb_intra)) { + /* + MBOrderedDitherDisplayCopy(vid_stream, vid_stream->mblock.mb_address, + 1, recon_right_for, recon_down_for, + 0, 0, 0, + vid_stream->future->display, + (unsigned char *) NULL); + ditherFlags[vid_stream->mblock.mb_address] = 0; + */ + } + else { + ditherFlags[vid_stream->mblock.mb_address] = 1; + } + } + + + /* If D Type picture, flush marker bit. */ + if (vid_stream->picture.code_type == 4) + flush_bits(1); + + /* If macroblock was intracoded, set macroblock past intra address. */ + if (vid_stream->mblock.mb_intra) + vid_stream->mblock.past_intra_addr = + vid_stream->mblock.mb_address; + +#ifdef ANALYSIS + *mbSizePtr += bitCountRead() - mbSizeCount; +#endif + return PARSE_OK; +} + + + +/* + *-------------------------------------------------------------- + * + * ReconIMBlock -- + * + * Reconstructs intra coded macroblock. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ReconIMBlock(VidStream *vid_stream, int bnum) +{ + int mb_row, mb_col, row, col, row_size, rr; + unsigned char *dest; + + /* Calculate macroblock row and column from address. */ + + mb_row = vid_stream->mblock.mb_address / vid_stream->mb_width; + mb_col = vid_stream->mblock.mb_address % vid_stream->mb_width; + + + /* If block is luminance block... */ + + if (bnum < 4) { + + /* Calculate row and col values for upper left pixel of block. */ + + row = mb_row * 16; + col = mb_col * 16; + if (bnum > 1) + row += 8; + if (bnum % 2) + col += 8; + + /* Set dest to luminance plane of current pict image. */ + + dest = vid_stream->current->luminance; + + /* Establish row size. */ + + row_size = vid_stream->mb_width * 16; + } + /* Otherwise if block is Cr block... */ + + else if (bnum == 4) { + + /* Set dest to Cr plane of current pict image. */ + + dest = vid_stream->current->Cr; + + /* Establish row size. */ + + row_size = vid_stream->mb_width * 8; + + /* Calculate row,col for upper left pixel of block. */ + + row = mb_row * 8; + col = mb_col * 8; + } + /* Otherwise block is Cb block, and ... */ + + else { + + /* Set dest to Cb plane of current pict image. */ + + dest = vid_stream->current->Cb; + + /* Establish row size. */ + + row_size = vid_stream->mb_width * 8; + + /* Calculate row,col for upper left pixel value of block. */ + + row = mb_row * 8; + col = mb_col * 8; + } + + /* + * For each pixel in block, set to cropped reconstructed value from inverse + * dct. + */ + { + short *sp = &vid_stream->block.dct_recon[0][0]; + unsigned char *cm = cropTbl + MAX_NEG_CROP; + dest += row * row_size + col; + for (rr = 0; rr < 4; rr++, sp += 16, dest += row_size) { + dest[0] = cm[sp[0]]; + assertCrop(sp[0]); + dest[1] = cm[sp[1]]; + assertCrop(sp[1]); + dest[2] = cm[sp[2]]; + assertCrop(sp[2]); + dest[3] = cm[sp[3]]; + assertCrop(sp[3]); + dest[4] = cm[sp[4]]; + assertCrop(sp[4]); + dest[5] = cm[sp[5]]; + assertCrop(sp[5]); + dest[6] = cm[sp[6]]; + assertCrop(sp[6]); + dest[7] = cm[sp[7]]; + assertCrop(sp[7]); + + dest += row_size; + dest[0] = cm[sp[8]]; + assertCrop(sp[8]); + dest[1] = cm[sp[9]]; + assertCrop(sp[9]); + dest[2] = cm[sp[10]]; + assertCrop(sp[10]); + dest[3] = cm[sp[11]]; + assertCrop(sp[11]); + dest[4] = cm[sp[12]]; + assertCrop(sp[12]); + dest[5] = cm[sp[13]]; + assertCrop(sp[13]); + dest[6] = cm[sp[14]]; + assertCrop(sp[14]); + dest[7] = cm[sp[15]]; + assertCrop(sp[15]); + } + } +} + + + +/* + *-------------------------------------------------------------- + * + * ReconPMBlock -- + * + * Reconstructs forward predicted macroblocks. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ReconPMBlock(VidStream *vid_stream, int bnum, + int recon_right_for, int recon_down_for, int zflag) +{ + int mb_row, mb_col, row, col, row_size, rr; + unsigned char *dest, *past; + static int right_for, down_for, right_half_for, down_half_for; + unsigned char *rindex1, *rindex2; + unsigned char *index; + short int *blockvals; + +#ifdef LOOSE_MPEG + int maxx, maxy; + int illegalBlock = 0; + int row_start, row_end, rfirst, rlast, col_start, col_end, cfirst, clast; +#endif + + /* Calculate macroblock row and column from address. */ + + mb_row = vid_stream->mblock.mb_address / vid_stream->mb_width; + mb_col = vid_stream->mblock.mb_address % vid_stream->mb_width; + + if (bnum < 4) { + + /* Calculate right_for, down_for motion vectors. */ + + right_for = recon_right_for >> 1; + down_for = recon_down_for >> 1; + right_half_for = recon_right_for & 0x1; + down_half_for = recon_down_for & 0x1; + + /* Set dest to luminance plane of current pict image. */ + + dest = vid_stream->current->luminance; + + if (vid_stream->picture.code_type == B_TYPE) { + if (vid_stream->past != NULL) + past = vid_stream->past->luminance; + } else { + + /* Set predicitive frame to current future frame. */ + + if (vid_stream->future != NULL) + past = vid_stream->future->luminance; + } + + /* Establish row size. */ + + row_size = vid_stream->mb_width << 4; + + /* Calculate row,col of upper left pixel in block. */ + + row = mb_row << 4; + col = mb_col << 4; + if (bnum > 1) + row += 8; + if (bnum % 2) + col += 8; + +#ifdef LOOSE_MPEG + /* Check for block illegality. */ + + maxx = lmaxx; maxy = lmaxy; + + if (row + down_for + 7 > maxy) illegalBlock |= 0x4; + else if (row + down_for < 0) illegalBlock |= 0x1; + + if (col + right_for + 7 > maxx) illegalBlock |= 0x2; + else if (col + right_for < 0) illegalBlock |= 0x8; + +#endif + } + /* Otherwise, block is NOT luminance block, ... */ + + else { + + /* Construct motion vectors. */ + + recon_right_for /= 2; + recon_down_for /= 2; + right_for = recon_right_for >> 1; + down_for = recon_down_for >> 1; + right_half_for = recon_right_for & 0x1; + down_half_for = recon_down_for & 0x1; + + /* Establish row size. */ + + row_size = vid_stream->mb_width << 3; + + /* Calculate row,col of upper left pixel in block. */ + + row = mb_row << 3; + col = mb_col << 3; + +#ifdef LOOSE_MPEG + /* Check for block illegality. */ + + maxx = cmaxx; maxy = cmaxy; + + if (row + down_for + 7 > maxy) illegalBlock |= 0x4; + else if (row + down_for < 0) illegalBlock |= 0x1; + + if (col + right_for + 7 > maxx) illegalBlock |= 0x2; + else if (col + right_for < 0) illegalBlock |= 0x8; + +#endif + + /* If block is Cr block... */ + + if (bnum == 4) { + + /* Set dest to Cr plane of current pict image. */ + + dest = vid_stream->current->Cr; + + if (vid_stream->picture.code_type == B_TYPE) { + + if (vid_stream->past != NULL) + past = vid_stream->past->Cr; + } else { + if (vid_stream->future != NULL) + past = vid_stream->future->Cr; + } + } + /* Otherwise, block is Cb block... */ + + else { + + /* Set dest to Cb plane of current pict image. */ + + dest = vid_stream->current->Cb; + + if (vid_stream->picture.code_type == B_TYPE) { + if (vid_stream->past != NULL) + past = vid_stream->past->Cb; + } else { + if (vid_stream->future != NULL) + past = vid_stream->future->Cb; + } + } + } + + /* For each pixel in block... */ + +#ifdef LOOSE_MPEG + + if (illegalBlock) { + if (illegalBlock & 0x1) { + row_start = 0; + row_end = row+down_for+8; + rfirst = rlast = 8 - row_end; + } + else if (illegalBlock & 0x4) { + row_start = row + down_for; + row_end = maxy+1; + rlast = row_end - row_start - 1; + rfirst = 0; + } + else { + row_start = row+down_for; + row_end = row_start+8; + rfirst = 0; + } + + if (illegalBlock & 0x8) { + col_start = 0; + col_end = col + right_for + 8; + cfirst = clast = 8 - col_end; + } + else if (illegalBlock & 0x2) { + col_start = col + right_for; + col_end = maxx + 1; + clast = col_end - col_start - 1; + cfirst = 0; + } + else { + col_start = col + right_for; + col_end = col_start + 8; + cfirst = 0; + } + + for (rr = row_start; rr < row_end; rr++) { + rindex1 = past + (rr * row_size) + col_start; + index = dest + ((row + rfirst) * row_size) + col + cfirst; + for (cc = col_start; cc < col_end; cc++) { + *index++ = *rindex1++; + } + } + + if (illegalBlock & 0x1) { + for (rr = rlast -1; rr >=0; rr--) { + index = dest + ((row + rr) * row_size) + col; + rindex1 = dest + ((row + rlast) * row_size) + col; + for (cc = 0; cc < 8; cc ++) { + *index++ = *rindex1++; + } + } + } + else if (illegalBlock & 0x4) { + for (rr = rlast+1; rr < 8; rr++) { + index = dest + ((row + rr) * row_size) + col; + rindex1 = dest + ((row + rlast) * row_size) + col; + for (cc = 0; cc < 8; cc ++) { + *index++ = *rindex1++; + } + } + } + + if (illegalBlock & 0x2) { + for (cc = clast+1; cc < 8; cc++) { + index = dest + (row * row_size) + (col + cc); + rindex1 = dest + (row * row_size) + (col + clast); + for (rr = 0; rr < 8; rr++) { + *index = *rindex1; + index += row_size; + rindex1 += row_size; + } + } + } + else if (illegalBlock & 0x8) { + for (cc = clast-1; cc >= 0; cc--) { + index = dest + (row * row_size) + (col + cc); + rindex1 = dest + (row * row_size) + (col + clast); + for (rr = 0; rr < 8; rr++) { + *index = *rindex1; + index += row_size; + rindex1 += row_size; + } + } + } + + if (!zflag) { + for (rr = 0; rr < 8; rr++) { + index = dest + (row*row_size) + col; + blockvals = &(vid_stream->block.dct_recon[rr][0]); + index[0] += blockvals[0]; + index[1] += blockvals[1]; + index[2] += blockvals[2]; + index[3] += blockvals[3]; + index[4] += blockvals[4]; + index[5] += blockvals[5]; + index[6] += blockvals[6]; + index[7] += blockvals[7]; + } + } + } + else { + +#endif + + index = dest + (row * row_size) + col; + rindex1 = past + (row + down_for) * row_size + col + right_for; + + blockvals = &(vid_stream->block.dct_recon[0][0]); + + /* + * Calculate predictive pixel value based on motion vectors and copy to + * dest plane. + */ + + if ((!down_half_for) && (!right_half_for)) { + unsigned char *cm = cropTbl + MAX_NEG_CROP; + if (!zflag) + for (rr = 0; rr < 4; rr++) { + index[0] = cm[(int) rindex1[0] + (int) blockvals[0]]; + index[1] = cm[(int) rindex1[1] + (int) blockvals[1]]; + index[2] = cm[(int) rindex1[2] + (int) blockvals[2]]; + index[3] = cm[(int) rindex1[3] + (int) blockvals[3]]; + index[4] = cm[(int) rindex1[4] + (int) blockvals[4]]; + index[5] = cm[(int) rindex1[5] + (int) blockvals[5]]; + index[6] = cm[(int) rindex1[6] + (int) blockvals[6]]; + index[7] = cm[(int) rindex1[7] + (int) blockvals[7]]; + index += row_size; + rindex1 += row_size; + + index[0] = cm[(int) rindex1[0] + (int) blockvals[8]]; + index[1] = cm[(int) rindex1[1] + (int) blockvals[9]]; + index[2] = cm[(int) rindex1[2] + (int) blockvals[10]]; + index[3] = cm[(int) rindex1[3] + (int) blockvals[11]]; + index[4] = cm[(int) rindex1[4] + (int) blockvals[12]]; + index[5] = cm[(int) rindex1[5] + (int) blockvals[13]]; + index[6] = cm[(int) rindex1[6] + (int) blockvals[14]]; + index[7] = cm[(int) rindex1[7] + (int) blockvals[15]]; + blockvals += 16; + index += row_size; + rindex1 += row_size; + } + else { + if (right_for & 0x1) { + /* No alignment, use bye copy */ + for (rr = 0; rr < 4; rr++) { + index[0] = rindex1[0]; + index[1] = rindex1[1]; + index[2] = rindex1[2]; + index[3] = rindex1[3]; + index[4] = rindex1[4]; + index[5] = rindex1[5]; + index[6] = rindex1[6]; + index[7] = rindex1[7]; + index += row_size; + rindex1 += row_size; + + index[0] = rindex1[0]; + index[1] = rindex1[1]; + index[2] = rindex1[2]; + index[3] = rindex1[3]; + index[4] = rindex1[4]; + index[5] = rindex1[5]; + index[6] = rindex1[6]; + index[7] = rindex1[7]; + index += row_size; + rindex1 += row_size; + } + } else if (right_for & 0x2) { + /* Half-word bit aligned, use 16 bit copy */ + short *src = (short *)rindex1; + short *dest = (short *)index; + row_size >>= 1; + for (rr = 0; rr < 4; rr++) { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_size; + src += row_size; + + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_size; + src += row_size; + } + } else { + /* Word aligned, use 32 bit copy */ + int *src = (int *)rindex1; + int *dest = (int *)index; + row_size >>= 2; + for (rr = 0; rr < 4; rr++) { + dest[0] = src[0]; + dest[1] = src[1]; + dest += row_size; + src += row_size; + + dest[0] = src[0]; + dest[1] = src[1]; + dest += row_size; + src += row_size; + } + } + } + } else { + unsigned char *cm = cropTbl + MAX_NEG_CROP; + rindex2 = rindex1 + right_half_for + (down_half_for * row_size); + if (!zflag) + for (rr = 0; rr < 4; rr++) { + index[0] = cm[((int) (rindex1[0] + rindex2[0]) >> 1) + blockvals[0]]; + index[1] = cm[((int) (rindex1[1] + rindex2[1]) >> 1) + blockvals[1]]; + index[2] = cm[((int) (rindex1[2] + rindex2[2]) >> 1) + blockvals[2]]; + index[3] = cm[((int) (rindex1[3] + rindex2[3]) >> 1) + blockvals[3]]; + index[4] = cm[((int) (rindex1[4] + rindex2[4]) >> 1) + blockvals[4]]; + index[5] = cm[((int) (rindex1[5] + rindex2[5]) >> 1) + blockvals[5]]; + index[6] = cm[((int) (rindex1[6] + rindex2[6]) >> 1) + blockvals[6]]; + index[7] = cm[((int) (rindex1[7] + rindex2[7]) >> 1) + blockvals[7]]; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + + index[0] = cm[((int) (rindex1[0] + rindex2[0]) >> 1) + blockvals[8]]; + index[1] = cm[((int) (rindex1[1] + rindex2[1]) >> 1) + blockvals[9]]; + index[2] = cm[((int) (rindex1[2] + rindex2[2]) >> 1) + blockvals[10]]; + index[3] = cm[((int) (rindex1[3] + rindex2[3]) >> 1) + blockvals[11]]; + index[4] = cm[((int) (rindex1[4] + rindex2[4]) >> 1) + blockvals[12]]; + index[5] = cm[((int) (rindex1[5] + rindex2[5]) >> 1) + blockvals[13]]; + index[6] = cm[((int) (rindex1[6] + rindex2[6]) >> 1) + blockvals[14]]; + index[7] = cm[((int) (rindex1[7] + rindex2[7]) >> 1) + blockvals[15]]; + blockvals += 16; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + } + else + for (rr = 0; rr < 4; rr++) { + index[0] = (int) (rindex1[0] + rindex2[0]) >> 1; + index[1] = (int) (rindex1[1] + rindex2[1]) >> 1; + index[2] = (int) (rindex1[2] + rindex2[2]) >> 1; + index[3] = (int) (rindex1[3] + rindex2[3]) >> 1; + index[4] = (int) (rindex1[4] + rindex2[4]) >> 1; + index[5] = (int) (rindex1[5] + rindex2[5]) >> 1; + index[6] = (int) (rindex1[6] + rindex2[6]) >> 1; + index[7] = (int) (rindex1[7] + rindex2[7]) >> 1; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + + index[0] = (int) (rindex1[0] + rindex2[0]) >> 1; + index[1] = (int) (rindex1[1] + rindex2[1]) >> 1; + index[2] = (int) (rindex1[2] + rindex2[2]) >> 1; + index[3] = (int) (rindex1[3] + rindex2[3]) >> 1; + index[4] = (int) (rindex1[4] + rindex2[4]) >> 1; + index[5] = (int) (rindex1[5] + rindex2[5]) >> 1; + index[6] = (int) (rindex1[6] + rindex2[6]) >> 1; + index[7] = (int) (rindex1[7] + rindex2[7]) >> 1; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + } + } + +#ifdef LOOSE_MPEG + } +#endif +} + + +/* + *-------------------------------------------------------------- + * + * ReconBMBlock -- + * + * Reconstructs back predicted macroblocks. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ReconBMBlock(VidStream *vid_stream, + int bnum, int recon_right_back, int recon_down_back, int zflag) +{ + int mb_row, mb_col, row, col, row_size, rr; + unsigned char *dest, *future; + int right_back, down_back, right_half_back, down_half_back; + unsigned char *rindex1, *rindex2; + unsigned char *index; + short int *blockvals; + +#ifdef LOOSE_MPEG + int illegalBlock = 0; + int maxx, maxy; + int row_start, row_end, rlast, rfirst, col_start, col_end, clast, cfirst; +#endif + + /* Calculate macroblock row and column from address. */ + + mb_row = vid_stream->mblock.mb_address / vid_stream->mb_width; + mb_col = vid_stream->mblock.mb_address % vid_stream->mb_width; + + /* If block is luminance block... */ + + if (bnum < 4) { + + /* Calculate right_back, down_bakc motion vectors. */ + + right_back = recon_right_back >> 1; + down_back = recon_down_back >> 1; + right_half_back = recon_right_back & 0x1; + down_half_back = recon_down_back & 0x1; + + /* Set dest to luminance plane of current pict image. */ + + dest = vid_stream->current->luminance; + + /* + * If future frame exists, set future to luminance plane of future frame. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->luminance; + + /* Establish row size. */ + + row_size = vid_stream->mb_width << 4; + + /* Calculate row,col of upper left pixel in block. */ + + row = mb_row << 4; + col = mb_col << 4; + if (bnum > 1) + row += 8; + if (bnum % 2) + col += 8; + +#ifdef LOOSE_MPEG + + /* Check for block illegality. */ + + maxx = lmaxx; maxy = lmaxy; + + if (row + down_back + 7 > maxy) illegalBlock |= 0x4; + else if (row + down_back < 0) illegalBlock |= 0x1; + + if (col + right_back + 7 > maxx) illegalBlock |= 0x2; + else if (col + right_back < 0) illegalBlock |= 0x8; + +#endif + + } + /* Otherwise, block is NOT luminance block, ... */ + + else { + + /* Construct motion vectors. */ + + recon_right_back /= 2; + recon_down_back /= 2; + right_back = recon_right_back >> 1; + down_back = recon_down_back >> 1; + right_half_back = recon_right_back & 0x1; + down_half_back = recon_down_back & 0x1; + + /* Establish row size. */ + + row_size = vid_stream->mb_width << 3; + + /* Calculate row,col of upper left pixel in block. */ + + row = mb_row << 3; + col = mb_col << 3; + +#ifdef LOOSE_MPEG + + /* Check for block illegality. */ + + maxx = cmaxx; maxy = cmaxy; + + if (row + down_back + 7 > maxy) illegalBlock |= 0x4; + else if (row + down_back < 0) illegalBlock |= 0x1; + + if (col + right_back + 7 > maxx) illegalBlock |= 0x2; + else if (col + right_back < 0) illegalBlock |= 0x8; + +#endif + + /* If block is Cr block... */ + + if (bnum == 4) { + + /* Set dest to Cr plane of current pict image. */ + + dest = vid_stream->current->Cr; + + /* + * If future frame exists, set future to Cr plane of future image. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->Cr; + } + /* Otherwise, block is Cb block... */ + + else { + + /* Set dest to Cb plane of current pict image. */ + + dest = vid_stream->current->Cb; + + /* + * If future frame exists, set future to Cb plane of future frame. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->Cb; + } + } + + /* For each pixel in block do... */ + +#ifdef LOOSE_MPEG + + if (illegalBlock) { + if (illegalBlock & 0x1) { + row_start = 0; + row_end = row+down_back+8; + rfirst = rlast = 8 - row_end; + } + else if (illegalBlock & 0x4) { + row_start = row + down_back; + row_end = maxy+1; + rlast = row_end - row_start - 1; + rfirst = 0; + } + else { + row_start = row+down_back; + row_end = row_start+8; + rfirst = 0; + } + + if (illegalBlock & 0x8) { + col_start = 0; + col_end = col + right_back + 8; + cfirst = clast = 8 - col_end; + } + else if (illegalBlock & 0x2) { + col_start = col + right_back; + col_end = maxx + 1; + clast = col_end - col_start - 1; + cfirst = 0; + } + else { + col_start = col + right_back; + col_end = col_start + 8; + cfirst = 0; + } + + for (rr = row_start; rr < row_end; rr++) { + rindex1 = future + (rr * row_size) + col_start; + index = dest + ((row + rfirst) * row_size) + col + cfirst; + for (cc = col_start; cc < col_end; cc++) { + *index++ = *rindex1++; + } + } + + if (illegalBlock & 0x1) { + for (rr = rlast -1; rr >=0; rr--) { + index = dest + ((row + rr) * row_size) + col; + rindex1 = dest + ((row + rlast) * row_size) + col; + for (cc = 0; cc < 8; cc ++) { + *index++ = *rindex1++; + } + } + } + else if (illegalBlock & 0x4) { + for (rr = rlast+1; rr < 8; rr++) { + index = dest + ((row + rr) * row_size) + col; + rindex1 = dest + ((row + rlast) * row_size) + col; + for (cc = 0; cc < 8; cc ++) { + *index++ = *rindex1++; + } + } + } + + if (illegalBlock & 0x2) { + for (cc = clast+1; cc < 8; cc++) { + index = dest + (row * row_size) + (col + cc); + rindex1 = dest + (row * row_size) + (col + clast); + for (rr = 0; rr < 8; rr++) { + *index = *rindex1; + index += row_size; + rindex1 += row_size; + } + } + } + else if (illegalBlock & 0x8) { + for (cc = clast-1; cc >= 0; cc--) { + index = dest + (row * row_size) + (col + cc); + rindex1 = dest + (row * row_size) + (col + clast); + for (rr = 0; rr < 8; rr++) { + *index = *rindex1; + index += row_size; + rindex1 += row_size; + } + } + } + + if (!zflag) { + for (rr = 0; rr < 8; rr++) { + index = dest + (row*row_size) + col; + blockvals = &(vid_stream->block.dct_recon[rr][0]); + index[0] += blockvals[0]; + index[1] += blockvals[1]; + index[2] += blockvals[2]; + index[3] += blockvals[3]; + index[4] += blockvals[4]; + index[5] += blockvals[5]; + index[6] += blockvals[6]; + index[7] += blockvals[7]; + } + } + } + else { + +#endif + + index = dest + (row * row_size) + col; + rindex1 = future + (row + down_back) * row_size + col + right_back; + + blockvals = &(vid_stream->block.dct_recon[0][0]); + + if ((!right_half_back) && (!down_half_back)) { + unsigned char *cm = cropTbl + MAX_NEG_CROP; + if (!zflag) + for (rr = 0; rr < 4; rr++) { + index[0] = cm[(int) rindex1[0] + (int) blockvals[0]]; + index[1] = cm[(int) rindex1[1] + (int) blockvals[1]]; + index[2] = cm[(int) rindex1[2] + (int) blockvals[2]]; + index[3] = cm[(int) rindex1[3] + (int) blockvals[3]]; + index[4] = cm[(int) rindex1[4] + (int) blockvals[4]]; + index[5] = cm[(int) rindex1[5] + (int) blockvals[5]]; + index[6] = cm[(int) rindex1[6] + (int) blockvals[6]]; + index[7] = cm[(int) rindex1[7] + (int) blockvals[7]]; + index += row_size; + rindex1 += row_size; + + index[0] = cm[(int) rindex1[0] + (int) blockvals[8]]; + index[1] = cm[(int) rindex1[1] + (int) blockvals[9]]; + index[2] = cm[(int) rindex1[2] + (int) blockvals[10]]; + index[3] = cm[(int) rindex1[3] + (int) blockvals[11]]; + index[4] = cm[(int) rindex1[4] + (int) blockvals[12]]; + index[5] = cm[(int) rindex1[5] + (int) blockvals[13]]; + index[6] = cm[(int) rindex1[6] + (int) blockvals[14]]; + index[7] = cm[(int) rindex1[7] + (int) blockvals[15]]; + blockvals += 16; + index += row_size; + rindex1 += row_size; + } + else { + if (right_back & 0x1) { + /* No alignment, use bye copy */ + for (rr = 0; rr < 4; rr++) { + index[0] = rindex1[0]; + index[1] = rindex1[1]; + index[2] = rindex1[2]; + index[3] = rindex1[3]; + index[4] = rindex1[4]; + index[5] = rindex1[5]; + index[6] = rindex1[6]; + index[7] = rindex1[7]; + index += row_size; + rindex1 += row_size; + + index[0] = rindex1[0]; + index[1] = rindex1[1]; + index[2] = rindex1[2]; + index[3] = rindex1[3]; + index[4] = rindex1[4]; + index[5] = rindex1[5]; + index[6] = rindex1[6]; + index[7] = rindex1[7]; + index += row_size; + rindex1 += row_size; + } + } else if (right_back & 0x2) { + /* Half-word bit aligned, use 16 bit copy */ + short *src = (short *)rindex1; + short *dest = (short *)index; + row_size >>= 1; + for (rr = 0; rr < 4; rr++) { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_size; + src += row_size; + + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_size; + src += row_size; + } + } else { + /* Word aligned, use 32 bit copy */ + int *src = (int *)rindex1; + int *dest = (int *)index; + row_size >>= 2; + for (rr = 0; rr < 4; rr++) { + dest[0] = src[0]; + dest[1] = src[1]; + dest += row_size; + src += row_size; + + dest[0] = src[0]; + dest[1] = src[1]; + dest += row_size; + src += row_size; + } + } + } + } else { + unsigned char *cm = cropTbl + MAX_NEG_CROP; + rindex2 = rindex1 + right_half_back + (down_half_back * row_size); + if (!zflag) + for (rr = 0; rr < 4; rr++) { + index[0] = cm[((int) (rindex1[0] + rindex2[0]) >> 1) + blockvals[0]]; + index[1] = cm[((int) (rindex1[1] + rindex2[1]) >> 1) + blockvals[1]]; + index[2] = cm[((int) (rindex1[2] + rindex2[2]) >> 1) + blockvals[2]]; + index[3] = cm[((int) (rindex1[3] + rindex2[3]) >> 1) + blockvals[3]]; + index[4] = cm[((int) (rindex1[4] + rindex2[4]) >> 1) + blockvals[4]]; + index[5] = cm[((int) (rindex1[5] + rindex2[5]) >> 1) + blockvals[5]]; + index[6] = cm[((int) (rindex1[6] + rindex2[6]) >> 1) + blockvals[6]]; + index[7] = cm[((int) (rindex1[7] + rindex2[7]) >> 1) + blockvals[7]]; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + + index[0] = cm[((int) (rindex1[0] + rindex2[0]) >> 1) + blockvals[8]]; + index[1] = cm[((int) (rindex1[1] + rindex2[1]) >> 1) + blockvals[9]]; + index[2] = cm[((int) (rindex1[2] + rindex2[2]) >> 1) + blockvals[10]]; + index[3] = cm[((int) (rindex1[3] + rindex2[3]) >> 1) + blockvals[11]]; + index[4] = cm[((int) (rindex1[4] + rindex2[4]) >> 1) + blockvals[12]]; + index[5] = cm[((int) (rindex1[5] + rindex2[5]) >> 1) + blockvals[13]]; + index[6] = cm[((int) (rindex1[6] + rindex2[6]) >> 1) + blockvals[14]]; + index[7] = cm[((int) (rindex1[7] + rindex2[7]) >> 1) + blockvals[15]]; + blockvals += 16; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + } + else + for (rr = 0; rr < 4; rr++) { + index[0] = (int) (rindex1[0] + rindex2[0]) >> 1; + index[1] = (int) (rindex1[1] + rindex2[1]) >> 1; + index[2] = (int) (rindex1[2] + rindex2[2]) >> 1; + index[3] = (int) (rindex1[3] + rindex2[3]) >> 1; + index[4] = (int) (rindex1[4] + rindex2[4]) >> 1; + index[5] = (int) (rindex1[5] + rindex2[5]) >> 1; + index[6] = (int) (rindex1[6] + rindex2[6]) >> 1; + index[7] = (int) (rindex1[7] + rindex2[7]) >> 1; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + + index[0] = (int) (rindex1[0] + rindex2[0]) >> 1; + index[1] = (int) (rindex1[1] + rindex2[1]) >> 1; + index[2] = (int) (rindex1[2] + rindex2[2]) >> 1; + index[3] = (int) (rindex1[3] + rindex2[3]) >> 1; + index[4] = (int) (rindex1[4] + rindex2[4]) >> 1; + index[5] = (int) (rindex1[5] + rindex2[5]) >> 1; + index[6] = (int) (rindex1[6] + rindex2[6]) >> 1; + index[7] = (int) (rindex1[7] + rindex2[7]) >> 1; + index += row_size; + rindex1 += row_size; + rindex2 += row_size; + } + } + +#ifdef LOOSE_MPEG + } +#endif + +} + + +/* + *-------------------------------------------------------------- + * + * ReconBiMBlock -- + * + * Reconstructs bidirectionally predicted macroblocks. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ReconBiMBlock(VidStream *vid_stream, int bnum, int recon_right_for, + int recon_down_for, int recon_right_back, + int recon_down_back, int zflag) +{ + int mb_row, mb_col, row, col, row_size, rr; + unsigned char *dest, *past, *future; + int right_for, down_for, right_half_for, down_half_for; + int right_back, down_back, right_half_back, down_half_back; + unsigned char *index, *rindex1, *bindex1; + short int *blockvals; + int forw_row_start, back_row_start, forw_col_start, back_col_start; + +#ifdef LOOSE_MPEG + int illegal_forw = 0; + int illegal_back = 0; +#endif + + /* Calculate macroblock row and column from address. */ + + mb_row = vid_stream->mblock.mb_address / vid_stream->mb_width; + mb_col = vid_stream->mblock.mb_address % vid_stream->mb_width; + + /* If block is luminance block... */ + + if (bnum < 4) { + + /* + * Calculate right_for, down_for, right_half_for, down_half_for, + * right_back, down_bakc, right_half_back, and down_half_back, motion + * vectors. + */ + + right_for = recon_right_for >> 1; + down_for = recon_down_for >> 1; + right_half_for = recon_right_for & 0x1; + down_half_for = recon_down_for & 0x1; + + right_back = recon_right_back >> 1; + down_back = recon_down_back >> 1; + right_half_back = recon_right_back & 0x1; + down_half_back = recon_down_back & 0x1; + + /* Set dest to luminance plane of current pict image. */ + + dest = vid_stream->current->luminance; + + /* If past frame exists, set past to luminance plane of past frame. */ + + if (vid_stream->past != NULL) + past = vid_stream->past->luminance; + + /* + * If future frame exists, set future to luminance plane of future frame. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->luminance; + + /* Establish row size. */ + + row_size = (vid_stream->mb_width << 4); + + /* Calculate row,col of upper left pixel in block. */ + + row = (mb_row << 4); + col = (mb_col << 4); + if (bnum > 1) + row += 8; + if (bnum & 0x01) + col += 8; + + forw_col_start = col + right_for; + forw_row_start = row + down_for; + + back_col_start = col + right_back; + back_row_start = row + down_back; + +#ifdef LOOSE_MPEG + + /* Check for illegal pred. blocks. */ + + + if (forw_col_start+8 > lmaxx) illegal_forw = 1; + else if (forw_col_start < 0) illegal_forw = 1; + + if (forw_row_start+8 > lmaxy) illegal_forw = 1; + else if (forw_row_start < 0) illegal_forw = 1; + + if (back_col_start+8 > lmaxx) illegal_back = 1; + else if (back_col_start < 0) illegal_back = 1; + + if (back_row_start+8 > lmaxy) illegal_back = 1; + else if (back_row_start < 0) illegal_back = 1; + +#endif + + } + /* Otherwise, block is NOT luminance block, ... */ + + else { + + /* Construct motion vectors. */ + + recon_right_for /= 2; + recon_down_for /= 2; + right_for = recon_right_for >> 1; + down_for = recon_down_for >> 1; + right_half_for = recon_right_for & 0x1; + down_half_for = recon_down_for & 0x1; + + recon_right_back /= 2; + recon_down_back /= 2; + right_back = recon_right_back >> 1; + down_back = recon_down_back >> 1; + right_half_back = recon_right_back & 0x1; + down_half_back = recon_down_back & 0x1; + + /* Establish row size. */ + + row_size = (vid_stream->mb_width << 3); + + /* Calculate row,col of upper left pixel in block. */ + + row = (mb_row << 3); + col = (mb_col << 3); + + forw_col_start = col + right_for; + forw_row_start = row + down_for; + + back_col_start = col + right_back; + back_row_start = row + down_back; + +#ifdef LOOSE_MPEG + + /* Check for illegal pred. blocks. */ + + if (forw_col_start+8 > cmaxx) illegal_forw = 1; + else if (forw_col_start < 0) illegal_forw = 1; + + if (forw_row_start+8 > cmaxy) illegal_forw = 1; + else if (forw_row_start < 0) illegal_forw = 1; + + if (back_col_start+8 > cmaxx) illegal_back = 1; + else if (back_col_start < 0) illegal_back = 1; + + if (back_row_start+8 > cmaxy) illegal_back = 1; + else if (back_row_start < 0) illegal_back = 1; + +#endif + + /* If block is Cr block... */ + + if (bnum == 4) { + + /* Set dest to Cr plane of current pict image. */ + + dest = vid_stream->current->Cr; + + /* If past frame exists, set past to Cr plane of past image. */ + + if (vid_stream->past != NULL) + past = vid_stream->past->Cr; + + /* + * If future frame exists, set future to Cr plane of future image. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->Cr; + } + /* Otherwise, block is Cb block... */ + + else { + + /* Set dest to Cb plane of current pict image. */ + + dest = vid_stream->current->Cb; + + /* If past frame exists, set past to Cb plane of past frame. */ + + if (vid_stream->past != NULL) + past = vid_stream->past->Cb; + + /* + * If future frame exists, set future to Cb plane of future frame. + */ + + if (vid_stream->future != NULL) + future = vid_stream->future->Cb; + } + } + + /* For each pixel in block... */ + + index = dest + (row * row_size) + col; + +#ifdef LOOSE_MPEG + if (illegal_forw) + rindex1 = future + back_row_start * row_size + back_col_start; + else +#endif + rindex1 = past + forw_row_start * row_size + forw_col_start; + +#ifdef LOOSE_MPEG + if (illegal_back) + bindex1 = past + forw_row_start * row_size + forw_col_start; + else +#endif + bindex1 = future + back_row_start * row_size + back_col_start; + + blockvals = (short int *) &(vid_stream->block.dct_recon[0][0]); + + { + unsigned char *cm = cropTbl + MAX_NEG_CROP; + if (!zflag) + for (rr = 0; rr < 4; rr++) { + index[0] = cm[((int) (rindex1[0] + bindex1[0]) >> 1) + blockvals[0]]; + index[1] = cm[((int) (rindex1[1] + bindex1[1]) >> 1) + blockvals[1]]; + index[2] = cm[((int) (rindex1[2] + bindex1[2]) >> 1) + blockvals[2]]; + index[3] = cm[((int) (rindex1[3] + bindex1[3]) >> 1) + blockvals[3]]; + index[4] = cm[((int) (rindex1[4] + bindex1[4]) >> 1) + blockvals[4]]; + index[5] = cm[((int) (rindex1[5] + bindex1[5]) >> 1) + blockvals[5]]; + index[6] = cm[((int) (rindex1[6] + bindex1[6]) >> 1) + blockvals[6]]; + index[7] = cm[((int) (rindex1[7] + bindex1[7]) >> 1) + blockvals[7]]; + index += row_size; + rindex1 += row_size; + bindex1 += row_size; + + index[0] = cm[((int) (rindex1[0] + bindex1[0]) >> 1) + blockvals[8]]; + index[1] = cm[((int) (rindex1[1] + bindex1[1]) >> 1) + blockvals[9]]; + index[2] = cm[((int) (rindex1[2] + bindex1[2]) >> 1) + blockvals[10]]; + index[3] = cm[((int) (rindex1[3] + bindex1[3]) >> 1) + blockvals[11]]; + index[4] = cm[((int) (rindex1[4] + bindex1[4]) >> 1) + blockvals[12]]; + index[5] = cm[((int) (rindex1[5] + bindex1[5]) >> 1) + blockvals[13]]; + index[6] = cm[((int) (rindex1[6] + bindex1[6]) >> 1) + blockvals[14]]; + index[7] = cm[((int) (rindex1[7] + bindex1[7]) >> 1) + blockvals[15]]; + blockvals += 16; + index += row_size; + rindex1 += row_size; + bindex1 += row_size; + } + + else + for (rr = 0; rr < 4; rr++) { + index[0] = (int) (rindex1[0] + bindex1[0]) >> 1; + index[1] = (int) (rindex1[1] + bindex1[1]) >> 1; + index[2] = (int) (rindex1[2] + bindex1[2]) >> 1; + index[3] = (int) (rindex1[3] + bindex1[3]) >> 1; + index[4] = (int) (rindex1[4] + bindex1[4]) >> 1; + index[5] = (int) (rindex1[5] + bindex1[5]) >> 1; + index[6] = (int) (rindex1[6] + bindex1[6]) >> 1; + index[7] = (int) (rindex1[7] + bindex1[7]) >> 1; + index += row_size; + rindex1 += row_size; + bindex1 += row_size; + + index[0] = (int) (rindex1[0] + bindex1[0]) >> 1; + index[1] = (int) (rindex1[1] + bindex1[1]) >> 1; + index[2] = (int) (rindex1[2] + bindex1[2]) >> 1; + index[3] = (int) (rindex1[3] + bindex1[3]) >> 1; + index[4] = (int) (rindex1[4] + bindex1[4]) >> 1; + index[5] = (int) (rindex1[5] + bindex1[5]) >> 1; + index[6] = (int) (rindex1[6] + bindex1[6]) >> 1; + index[7] = (int) (rindex1[7] + bindex1[7]) >> 1; + index += row_size; + rindex1 += row_size; + bindex1 += row_size; + } + } +} + +/* + *-------------------------------------------------------------- + * + * ProcessSkippedPFrameMBlocks -- + * + * Processes skipped macroblocks in P frames. + * + * Results: + * Calculates pixel values for luminance, Cr, and Cb planes + * in current pict image for skipped macroblocks. + * + * Side effects: + * Pixel values in pict image changed. + * + *-------------------------------------------------------------- + */ + +static void +ProcessSkippedPFrameMBlocks(VidStream *vid_stream) +{ + int row_size, half_row, mb_row, mb_col, row, col, rr; + int addr, row_incr, half_row_incr, crow, ccol; + int *dest, *src, *dest1, *src1; + + /* Calculate row sizes for luminance and Cr/Cb macroblock areas. */ + + row_size = vid_stream->mb_width << 4; + half_row = (row_size >> 1); + row_incr = row_size >> 2; + half_row_incr = half_row >> 2; + + /* For each skipped macroblock, do... */ + + for (addr = vid_stream->mblock.past_mb_addr + 1; + addr < vid_stream->mblock.mb_address; addr++) { + + /* Calculate macroblock row and col. */ + + mb_row = addr / vid_stream->mb_width; + mb_col = addr % vid_stream->mb_width; + + /* Calculate upper left pixel row,col for luminance plane. */ + + row = mb_row << 4; + col = mb_col << 4; + + + /* For each row in macroblock luminance plane... */ + + dest = (int *)(vid_stream->current->luminance + (row * row_size) + col); + src = (int *)(vid_stream->future->luminance + (row * row_size) + col); + + for (rr = 0; rr < 8; rr++) { + + /* Copy pixel values from last I or P picture. */ + + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_incr; + src += row_incr; + + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_incr; + src += row_incr; + } + + /* + * Divide row,col to get upper left pixel of macroblock in Cr and Cb + * planes. + */ + + crow = row >> 1; + ccol = col >> 1; + + /* For each row in Cr, and Cb planes... */ + + dest = (int *)(vid_stream->current->Cr + (crow * half_row) + ccol); + src = (int *)(vid_stream->future->Cr + (crow * half_row) + ccol); + dest1 = (int *)(vid_stream->current->Cb + (crow * half_row) + ccol); + src1 = (int *)(vid_stream->future->Cb + (crow * half_row) + ccol); + + for (rr = 0; rr < 4; rr++) { + + /* Copy pixel values from last I or P picture. */ + + dest[0] = src[0]; + dest[1] = src[1]; + + dest1[0] = src1[0]; + dest1[1] = src1[1]; + + dest += half_row_incr; + src += half_row_incr; + dest1 += half_row_incr; + src1 += half_row_incr; + + dest[0] = src[0]; + dest[1] = src[1]; + + dest1[0] = src1[0]; + dest1[1] = src1[1]; + + dest += half_row_incr; + src += half_row_incr; + dest1 += half_row_incr; + src1 += half_row_incr; + } + + if (ditherType == MBORDERED_DITHER) { + /* + MBOrderedDitherDisplayCopy(vid_stream, addr, + 1, 0, 0, 0, 0, 0, + vid_stream->future->display, + (unsigned char *) NULL); + ditherFlags[addr] = 0; + */ + } + } + + vid_stream->mblock.recon_right_for_prev = 0; + vid_stream->mblock.recon_down_for_prev = 0; +} + + + + +/* + *-------------------------------------------------------------- + * + * ProcessSkippedBFrameMBlocks -- + * + * Processes skipped macroblocks in B frames. + * + * Results: + * Calculates pixel values for luminance, Cr, and Cb planes + * in current pict image for skipped macroblocks. + * + * Side effects: + * Pixel values in pict image changed. + * + *-------------------------------------------------------------- + */ + +static void +ProcessSkippedBFrameMBlocks(VidStream *vid_stream) +{ + int row_size, half_row, mb_row, mb_col, row, col, rr; + int right_half_for, down_half_for, c_right_half_for, c_down_half_for; + int right_half_back, down_half_back, c_right_half_back, c_down_half_back; + int addr, right_for, down_for; + int recon_right_for, recon_down_for; + int recon_right_back, recon_down_back; + int right_back, down_back; + int c_right_for, c_down_for; + int c_right_back, c_down_back; + unsigned char forw_lum[256]; + unsigned char forw_cr[64], forw_cb[64]; + unsigned char back_lum[256], back_cr[64], back_cb[64]; + int row_incr, half_row_incr; + int ccol, crow; + + /* Calculate row sizes for luminance and Cr/Cb macroblock areas. */ + + row_size = vid_stream->mb_width << 4; + half_row = (row_size >> 1); + row_incr = row_size >> 2; + half_row_incr = half_row >> 2; + + /* Establish motion vector codes based on full pixel flag. */ + + if (vid_stream->picture.full_pel_forw_vector) { + recon_right_for = vid_stream->mblock.recon_right_for_prev << 1; + recon_down_for = vid_stream->mblock.recon_down_for_prev << 1; + } else { + recon_right_for = vid_stream->mblock.recon_right_for_prev; + recon_down_for = vid_stream->mblock.recon_down_for_prev; + } + + if (vid_stream->picture.full_pel_back_vector) { + recon_right_back = vid_stream->mblock.recon_right_back_prev << 1; + recon_down_back = vid_stream->mblock.recon_down_back_prev << 1; + } else { + recon_right_back = vid_stream->mblock.recon_right_back_prev; + recon_down_back = vid_stream->mblock.recon_down_back_prev; + } + + + /* If only one motion vector, do display copy, else do full + calculation. + */ + + if (ditherType == MBORDERED_DITHER) { + if (vid_stream->mblock.bpict_past_forw && + !vid_stream->mblock.bpict_past_back) { + for (addr = vid_stream->mblock.past_mb_addr+1; + addr < vid_stream->mblock.mb_address; addr++) { + /* + MBOrderedDitherDisplayCopy(vid_stream, addr, + 1, recon_right_for, recon_down_for, + 0, 0, 0, vid_stream->past->display, + vid_stream->future->display); + ditherFlags[addr] = 0; + */ + } + return; + } + if (vid_stream->mblock.bpict_past_back && + !vid_stream->mblock.bpict_past_forw) { + for (addr = vid_stream->mblock.past_mb_addr+1; + addr < vid_stream->mblock.mb_address; addr++) { + /* + MBOrderedDitherDisplayCopy(vid_stream, addr, + 0, 0, 0, + 1, recon_right_back, recon_down_back, + vid_stream->past->display, vid_stream->future->display); + ditherFlags[addr] = 0; + */ + } + return; + } + } + + /* Calculate motion vectors. */ + + if (vid_stream->mblock.bpict_past_forw) { + right_for = recon_right_for >> 1; + down_for = recon_down_for >> 1; + right_half_for = recon_right_for & 0x1; + down_half_for = recon_down_for & 0x1; + + recon_right_for /= 2; + recon_down_for /= 2; + c_right_for = recon_right_for >> 1; + c_down_for = recon_down_for >> 1; + c_right_half_for = recon_right_for & 0x1; + c_down_half_for = recon_down_for & 0x1; + + } + if (vid_stream->mblock.bpict_past_back) { + right_back = recon_right_back >> 1; + down_back = recon_down_back >> 1; + right_half_back = recon_right_back & 0x1; + down_half_back = recon_down_back & 0x1; + + recon_right_back /= 2; + recon_down_back /= 2; + c_right_back = recon_right_back >> 1; + c_down_back = recon_down_back >> 1; + c_right_half_back = recon_right_back & 0x1; + c_down_half_back = recon_down_back & 0x1; + + } + /* For each skipped macroblock, do... */ + + for (addr = vid_stream->mblock.past_mb_addr + 1; + addr < vid_stream->mblock.mb_address; addr++) { + + /* Calculate macroblock row and col. */ + + mb_row = addr / vid_stream->mb_width; + mb_col = addr % vid_stream->mb_width; + + /* Calculate upper left pixel row,col for luminance plane. */ + + row = mb_row << 4; + col = mb_col << 4; + crow = row / 2; + ccol = col / 2; + + /* If forward predicted, calculate prediction values. */ + + if (vid_stream->mblock.bpict_past_forw) { + + ReconSkippedBlock(vid_stream->past->luminance, forw_lum, + row, col, row_size, right_for, down_for, + right_half_for, down_half_for, 16); + ReconSkippedBlock(vid_stream->past->Cr, forw_cr, crow, + ccol, half_row, + c_right_for, c_down_for, c_right_half_for, c_down_half_for, 8); + ReconSkippedBlock(vid_stream->past->Cb, forw_cb, crow, + ccol, half_row, + c_right_for, c_down_for, c_right_half_for, c_down_half_for, 8); + } + /* If back predicted, calculate prediction values. */ + + if (vid_stream->mblock.bpict_past_back) { + ReconSkippedBlock(vid_stream->future->luminance, back_lum, + row, col, row_size, right_back, down_back, + right_half_back, down_half_back, 16); + ReconSkippedBlock(vid_stream->future->Cr, back_cr, crow, + ccol, half_row, + c_right_back, c_down_back, + c_right_half_back, c_down_half_back, 8); + ReconSkippedBlock(vid_stream->future->Cb, back_cb, crow, + ccol, half_row, + c_right_back, c_down_back, + c_right_half_back, c_down_half_back, 8); + } + if (vid_stream->mblock.bpict_past_forw && + !vid_stream->mblock.bpict_past_back) { + + int *dest, *dest1; + int *src, *src1; + dest = (int *)(vid_stream->current->luminance + (row * row_size) + col); + src = (int *)forw_lum; + + for (rr = 0; rr < 16; rr++) { + + /* ACE_OS::memcpy (dest, forw_lum+(rr<<4), 16); */ + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_incr; + src += 4; + } + + dest = (int *)(vid_stream->current->Cr + (crow * half_row) + ccol); + dest1 = (int *)(vid_stream->current->Cb + (crow * half_row) + ccol); + src = (int *)forw_cr; + src1 = (int *)forw_cb; + + for (rr = 0; rr < 8; rr++) { + /* + * ACE_OS::memcpy (dest, forw_cr+(rr<<3), 8); ACE_OS::memcpy (dest1, forw_cb+(rr<<3), + * 8); + */ + + dest[0] = src[0]; + dest[1] = src[1]; + + dest1[0] = src1[0]; + dest1[1] = src1[1]; + + dest += half_row_incr; + dest1 += half_row_incr; + src += 2; + src1 += 2; + } + } else if (vid_stream->mblock.bpict_past_back && + !vid_stream->mblock.bpict_past_forw) { + + int *src, *src1; + int *dest, *dest1; + dest = (int *)(vid_stream->current->luminance + (row * row_size) + col); + src = (int *)back_lum; + + for (rr = 0; rr < 16; rr++) { + dest[0] = src[0]; + dest[1] = src[1]; + dest[2] = src[2]; + dest[3] = src[3]; + dest += row_incr; + src += 4; + } + + + dest = (int *)(vid_stream->current->Cr + (crow * half_row) + ccol); + dest1 = (int *)(vid_stream->current->Cb + (crow * half_row) + ccol); + src = (int *)back_cr; + src1 = (int *)back_cb; + + for (rr = 0; rr < 8; rr++) { + /* + * ACE_OS::memcpy (dest, back_cr+(rr<<3), 8); ACE_OS::memcpy (dest1, back_cb+(rr<<3), + * 8); + */ + + dest[0] = src[0]; + dest[1] = src[1]; + + dest1[0] = src1[0]; + dest1[1] = src1[1]; + + dest += half_row_incr; + dest1 += half_row_incr; + src += 2; + src1 += 2; + } + } else { + + unsigned char *src1, *src2, *src1a, *src2a; + unsigned char *dest, *dest1; + dest = vid_stream->current->luminance + (row * row_size) + col; + src1 = forw_lum; + src2 = back_lum; + + for (rr = 0; rr < 16; rr++) { + dest[0] = (int) (src1[0] + src2[0]) >> 1; + dest[1] = (int) (src1[1] + src2[1]) >> 1; + dest[2] = (int) (src1[2] + src2[2]) >> 1; + dest[3] = (int) (src1[3] + src2[3]) >> 1; + dest[4] = (int) (src1[4] + src2[4]) >> 1; + dest[5] = (int) (src1[5] + src2[5]) >> 1; + dest[6] = (int) (src1[6] + src2[6]) >> 1; + dest[7] = (int) (src1[7] + src2[7]) >> 1; + dest[8] = (int) (src1[8] + src2[8]) >> 1; + dest[9] = (int) (src1[9] + src2[9]) >> 1; + dest[10] = (int) (src1[10] + src2[10]) >> 1; + dest[11] = (int) (src1[11] + src2[11]) >> 1; + dest[12] = (int) (src1[12] + src2[12]) >> 1; + dest[13] = (int) (src1[13] + src2[13]) >> 1; + dest[14] = (int) (src1[14] + src2[14]) >> 1; + dest[15] = (int) (src1[15] + src2[15]) >> 1; + dest += row_size; + src1 += 16; + src2 += 16; + } + + + dest = vid_stream->current->Cr + (crow * half_row) + ccol; + dest1 = vid_stream->current->Cb + (crow * half_row) + ccol; + src1 = forw_cr; + src2 = back_cr; + src1a = forw_cb; + src2a = back_cb; + + for (rr = 0; rr < 8; rr++) { + dest[0] = (int) (src1[0] + src2[0]) >> 1; + dest[1] = (int) (src1[1] + src2[1]) >> 1; + dest[2] = (int) (src1[2] + src2[2]) >> 1; + dest[3] = (int) (src1[3] + src2[3]) >> 1; + dest[4] = (int) (src1[4] + src2[4]) >> 1; + dest[5] = (int) (src1[5] + src2[5]) >> 1; + dest[6] = (int) (src1[6] + src2[6]) >> 1; + dest[7] = (int) (src1[7] + src2[7]) >> 1; + dest += half_row; + src1 += 8; + src2 += 8; + + dest1[0] = (int) (src1a[0] + src2a[0]) >> 1; + dest1[1] = (int) (src1a[1] + src2a[1]) >> 1; + dest1[2] = (int) (src1a[2] + src2a[2]) >> 1; + dest1[3] = (int) (src1a[3] + src2a[3]) >> 1; + dest1[4] = (int) (src1a[4] + src2a[4]) >> 1; + dest1[5] = (int) (src1a[5] + src2a[5]) >> 1; + dest1[6] = (int) (src1a[6] + src2a[6]) >> 1; + dest1[7] = (int) (src1a[7] + src2a[7]) >> 1; + dest1 += half_row; + src1a += 8; + src2a += 8; + } + } + + if (ditherType == MBORDERED_DITHER) { + ditherFlags[addr] = 1; + } + } +} + + + + +/* + *-------------------------------------------------------------- + * + * ReconSkippedBlock -- + * + * Reconstructs predictive block for skipped macroblocks + * in B Frames. + * + * Results: + * No return values. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ReconSkippedBlock(unsigned char *source, unsigned char *dest, + int row, int col, int row_size, int right, int down, + int right_half, int down_half, int width) +{ + int rr; + unsigned char *source2; + + source += ((row + down) * row_size) + col + right; + + if (width == 16) { + if ((!right_half) && (!down_half)) { + if (right & 0x1) { + /* No alignment, use bye copy */ + for (rr = 0; rr < 16; rr++) { + dest[0] = source[0]; + dest[1] = source[1]; + dest[2] = source[2]; + dest[3] = source[3]; + dest[4] = source[4]; + dest[5] = source[5]; + dest[6] = source[6]; + dest[7] = source[7]; + dest[8] = source[8]; + dest[9] = source[9]; + dest[10] = source[10]; + dest[11] = source[11]; + dest[12] = source[12]; + dest[13] = source[13]; + dest[14] = source[14]; + dest[15] = source[15]; + dest += 16; + source += row_size; + } + } else if (right & 0x2) { + /* Half-word bit aligned, use 16 bit copy */ + short *src = (short *)source; + short *d = (short *)dest; + row_size >>= 1; + for (rr = 0; rr < 16; rr++) { + d[0] = src[0]; + d[1] = src[1]; + d[2] = src[2]; + d[3] = src[3]; + d[4] = src[4]; + d[5] = src[5]; + d[6] = src[6]; + d[7] = src[7]; + d += 8; + src += row_size; + } + } else { + /* Word aligned, use 32 bit copy */ + int *src = (int *)source; + int *d = (int *)dest; + row_size >>= 2; + for (rr = 0; rr < 16; rr++) { + d[0] = src[0]; + d[1] = src[1]; + d[2] = src[2]; + d[3] = src[3]; + d += 4; + src += row_size; + } + } + } else { + source2 = source + right_half + (row_size * down_half); + for (rr = 0; rr < width; rr++) { + dest[0] = (int) (source[0] + source2[0]) >> 1; + dest[1] = (int) (source[1] + source2[1]) >> 1; + dest[2] = (int) (source[2] + source2[2]) >> 1; + dest[3] = (int) (source[3] + source2[3]) >> 1; + dest[4] = (int) (source[4] + source2[4]) >> 1; + dest[5] = (int) (source[5] + source2[5]) >> 1; + dest[6] = (int) (source[6] + source2[6]) >> 1; + dest[7] = (int) (source[7] + source2[7]) >> 1; + dest[8] = (int) (source[8] + source2[8]) >> 1; + dest[9] = (int) (source[9] + source2[9]) >> 1; + dest[10] = (int) (source[10] + source2[10]) >> 1; + dest[11] = (int) (source[11] + source2[11]) >> 1; + dest[12] = (int) (source[12] + source2[12]) >> 1; + dest[13] = (int) (source[13] + source2[13]) >> 1; + dest[14] = (int) (source[14] + source2[14]) >> 1; + dest[15] = (int) (source[15] + source2[15]) >> 1; + dest += width; + source += row_size; + source2 += row_size; + } + } + } else { /* (width == 8) */ + assert(width == 8); + if ((!right_half) && (!down_half)) { + if (right & 0x1) { + for (rr = 0; rr < width; rr++) { + dest[0] = source[0]; + dest[1] = source[1]; + dest[2] = source[2]; + dest[3] = source[3]; + dest[4] = source[4]; + dest[5] = source[5]; + dest[6] = source[6]; + dest[7] = source[7]; + dest += 8; + source += row_size; + } + } else if (right & 0x02) { + short *d = (short *)dest; + short *src = (short *)source; + row_size >>= 1; + for (rr = 0; rr < width; rr++) { + d[0] = src[0]; + d[1] = src[1]; + d[2] = src[2]; + d[3] = src[3]; + d += 4; + src += row_size; + } + } else { + int *d = (int *)dest; + int *src = (int *)source; + row_size >>= 2; + for (rr = 0; rr < width; rr++) { + d[0] = src[0]; + d[1] = src[1]; + d += 2; + src += row_size; + } + } + } else { + source2 = source + right_half + (row_size * down_half); + for (rr = 0; rr < width; rr++) { + dest[0] = (int) (source[0] + source2[0]) >> 1; + dest[1] = (int) (source[1] + source2[1]) >> 1; + dest[2] = (int) (source[2] + source2[2]) >> 1; + dest[3] = (int) (source[3] + source2[3]) >> 1; + dest[4] = (int) (source[4] + source2[4]) >> 1; + dest[5] = (int) (source[5] + source2[5]) >> 1; + dest[6] = (int) (source[6] + source2[6]) >> 1; + dest[7] = (int) (source[7] + source2[7]) >> 1; + dest += width; + source += row_size; + source2 += row_size; + } + } + } +} + +/* + *-------------------------------------------------------------- + * + * ToggleBFlag -- + * + * Called to set no b frame processing flag. + * + * Results: + * No_B_Flag flag is toggled from present value to opposite value. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +ToggleBFlag() +{ + if (No_B_Flag) { + No_B_Flag = 0; + } else + No_B_Flag = 1; +} + + + + +/* + *-------------------------------------------------------------- + * + * TogglePFlag -- + * + * Called to set no p frame processing flag. + * + * Results: + * No_P_Flag flag is toggled from present value to opposite value. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +TogglePFlag() +{ + if (No_P_Flag) { + No_P_Flag = 0; + } else + No_P_Flag = 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.h new file mode 100644 index 00000000000..9e2a9336f14 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/video.h @@ -0,0 +1,285 @@ +/* $Id$ */ +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ +#include <stdio.h> +#include <setjmp.h> + +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#ifdef SH_MEM +#include <sys/ipc.h> +#include <sys/shm.h> +#include <X11/extensions/XShm.h> +#endif + +/* X11/xmd.h correctly defines INT32, etc */ +#ifndef XMD_H +typedef int INT32; +typedef short INT16; +typedef char INT8; +#endif +typedef unsigned int UINT32; +typedef unsigned short UINT16; +typedef unsigned char UINT8; + +/* Define Parsing error codes. */ + +#define SKIP_PICTURE -10 +#define SKIP_TO_START_CODE -1 +#define PARSE_OK 1 + +/* Define BOOLEAN, TRUE, and FALSE. */ + +#define BOOLEAN int +#define TRUE 1 + +#define FALSE 0 + +/* Set ring buffer size. */ + +#define RING_BUF_SIZE 5 + +/* Macros for picture code type. */ + +#define I_TYPE 1 +#define P_TYPE 2 +#define B_TYPE 3 + +/* Start codes. */ + +#define SEQ_END_CODE 0x000001b7 +#define SEQ_START_CODE 0x000001b3 +#define GOP_START_CODE 0x000001b8 +#define PICTURE_START_CODE 0x00000100 +#define SLICE_MIN_START_CODE 0x00000101 +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 + +/* Number of macroblocks to process in one call to mpegVidRsrc. */ + +#define MB_QUANTUM 100 + +/* Macros used with macroblock address decoding. */ + +#define MB_STUFFING 34 +#define MB_ESCAPE 35 + +/* Lock flags for pict images. */ + +#define DISPLAY_LOCK 0x01 +#define PAST_LOCK 0x02 +#define FUTURE_LOCK 0x04 + +#define HYBRID_DITHER 0 +#define HYBRID2_DITHER 1 +#define FS4_DITHER 2 +#define FS2_DITHER 3 +#define FS2FAST_DITHER 4 +#define Twox2_DITHER 5 +#define GRAY_DITHER 6 +#define FULL_COLOR_DITHER 7 +#define NO_DITHER 8 +#define ORDERED_DITHER 9 +#define MONO_DITHER 10 +#define MONO_THRESHOLD 11 +#define ORDERED2_DITHER 12 +#define MBORDERED_DITHER 13 + +/* External declaration of row,col to zig zag conversion matrix. */ + +extern int scan[][8]; + +/* Temporary definition of time stamp structure. */ + +typedef int TimeStamp; + +/* Structure with reconstructed pixel values. */ + +typedef struct pict_image { + int sh, gop, frame, display, future, past; + int locked; /* lock flag. */ + unsigned char *luminance; /* Luminance plane. */ + unsigned char *Cr; /* Cr plane. */ + unsigned char *Cb; /* Cb plane. */ +} PictImage; + +/* Group of pictures structure. */ + +typedef struct GoP { + BOOLEAN drop_flag; /* Flag indicating dropped frame. */ + unsigned int tc_hours; /* Hour component of time code. */ + unsigned int tc_minutes; /* Minute component of time code. */ + unsigned int tc_seconds; /* Second component of time code. */ + unsigned int tc_pictures; /* Picture counter of time code. */ + BOOLEAN closed_gop; /* Indicates no pred. vectors to + previous group of pictures. */ + BOOLEAN broken_link; /* B frame unable to be decoded. */ + char *ext_data; /* Extension data. */ + char *user_data; /* User data. */ +} GoP; + +/* Picture structure. */ + +typedef struct pict { + unsigned int temp_ref; /* Temporal reference. */ + unsigned int code_type; /* Frame type: P, B, I */ + unsigned int vbv_delay; /* Buffer delay. */ + BOOLEAN full_pel_forw_vector; /* Forw. vectors specified in full + pixel values flag. */ + unsigned int forw_r_size; /* Used for vector decoding. */ + unsigned int forw_f; /* Used for vector decoding. */ + BOOLEAN full_pel_back_vector; /* Back vectors specified in full + pixel values flag. */ + unsigned int back_r_size; /* Used in decoding. */ + unsigned int back_f; /* Used in decoding. */ + char *extra_info; /* Extra bit picture info. */ + char *ext_data; /* Extension data. */ + char *user_data; /* User data. */ +} Pict; + +/* Slice structure. */ + +typedef struct slice { + unsigned int vert_pos; /* Vertical position of slice. */ + unsigned int quant_scale; /* Quantization scale. */ + char *extra_info; /* Extra bit slice info. */ +} Slice; + +/* Macroblock structure. */ + +typedef struct macroblock { + int mb_address; /* Macroblock address. */ + int past_mb_addr; /* Previous mblock address. */ + int motion_h_forw_code; /* Forw. horiz. motion vector code. */ + unsigned int motion_h_forw_r; /* Used in decoding vectors. */ + int motion_v_forw_code; /* Forw. vert. motion vector code. */ + unsigned int motion_v_forw_r; /* Used in decdoinge vectors. */ + int motion_h_back_code; /* Back horiz. motion vector code. */ + unsigned int motion_h_back_r; /* Used in decoding vectors. */ + int motion_v_back_code; /* Back vert. motion vector code. */ + unsigned int motion_v_back_r; /* Used in decoding vectors. */ + unsigned int cbp; /* Coded block pattern. */ + BOOLEAN mb_intra; /* Intracoded mblock flag. */ + BOOLEAN bpict_past_forw; /* Past B frame forw. vector flag. */ + BOOLEAN bpict_past_back; /* Past B frame back vector flag. */ + int past_intra_addr; /* Addr of last intracoded mblock. */ + int recon_right_for_prev; /* Past right forw. vector. */ + int recon_down_for_prev; /* Past down forw. vector. */ + int recon_right_back_prev; /* Past right back vector. */ + int recon_down_back_prev; /* Past down back vector. */ +} Macroblock; + +/* Block structure. */ + +typedef struct { + short int dct_recon[8][8]; /* Reconstructed dct coeff matrix. */ + short int dct_dc_y_past; /* Past lum. dc dct coefficient. */ + short int dct_dc_cr_past; /* Past cr dc dct coefficient. */ + short int dct_dc_cb_past; /* Past cb dc dct coefficient. */ +} Block; + +/* Video stream structure. */ + +typedef struct vid_stream { + int shid; /* id of latest sequence header */ + unsigned int h_size; /* Horiz. size in pixels. */ + unsigned int v_size; /* Vert. size in pixels. */ + unsigned int mb_height; /* Vert. size in mblocks. */ + unsigned int mb_width; /* Horiz. size in mblocks. */ + unsigned char aspect_ratio; /* Code for aspect ratio. */ + unsigned char picture_rate; /* Code for picture rate. */ + unsigned int bit_rate; /* Bit rate. */ + unsigned int vbv_buffer_size; /* Minimum buffer size. */ + BOOLEAN const_param_flag; /* Contrained parameter flag. */ + unsigned char intra_quant_matrix[8][8]; /* Quantization matrix for + intracoded frames. */ + unsigned char non_intra_quant_matrix[8][8]; /* Quanitization matrix for + non intracoded frames. */ + char *ext_data; /* Extension data. */ + char *user_data; /* User data. */ + int gopid; /* id of latest group id */ + GoP group; /* Current group of pict. */ + Pict picture; /* Current picture. */ + Slice slice; /* Current slice. */ + Macroblock mblock; /* Current macroblock. */ + Block block; /* Current block. */ + int state; /* State of decoding. */ + int bit_offset; /* Bit offset in stream. */ + unsigned int *buffer; /* Pointer to next byte in + buffer. */ + int buf_length; /* Length of remaining buffer.*/ + unsigned int *buf_start; /* Pointer to buffer start. */ + int max_buf_length; /* Max lenght of buffer. */ + PictImage *past; /* Past predictive frame. */ + PictImage *future; /* Future predictive frame. */ + PictImage *current; /* Current frame. */ + PictImage *ring[RING_BUF_SIZE]; /* Ring buffer of frames. */ +} VidStream; + +/* Declaration of global pointer to current video stream. */ + +extern VidStream *curVidStream; + +/* Declarataion of global display pointer. */ +extern Display *display; + +/* Shared memory flag. */ +extern int shmemFlag; + +/* Quiet mode flag. */ +extern int quietFlag; + +/* Dither flags external declaration. */ +extern char *ditherFlags; + +/* Definition of Contant integer scale factor. */ + +#define CONST_BITS 13 + +/* Misc DCT definitions */ +#define DCTSIZE 8 /* The basic DCT block is 8x8 samples */ +#define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */ + +#define GLOBAL /* a function referenced thru EXTERNs */ + +typedef short DCTELEM; +typedef DCTELEM DCTBLOCK[DCTSIZE2]; + + +#ifdef SH_MEM +extern int gXErrorFlag; +#endif + +extern double realTimeStart; +extern int totNumFrames; +extern int loopFlag; +extern int noDisplayFlag; +extern jmp_buf env; + +#ifdef ANALYSIS +extern unsigned int bitCount; +extern int showEachFlag; +extern unsigned int cacheHit[8][8]; +extern unsigned int cacheMiss[8][8]; +#endif + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vp.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vp.cpp new file mode 100644 index 00000000000..1ebdcf57beb --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_client/vp.cpp @@ -0,0 +1,924 @@ +/* $Id$ */ + +/* + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose, without fee, and without written agreement is + * hereby granted, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT + * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF + * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +// FUZZ: disable check_for_math_include + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include <stdlib.h> +/* +#include <sys/types.h> +#include <sys/socket.h> +*/ +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#ifdef SH_MEM /* this is already defined in video.h */ +#include <sys/ipc.h> +#include <sys/shm.h> +#include <X11/extensions/XShm.h> +#endif + +#include "include/common.h" +#include "newproto.h" +#include "global.h" +#include "dither.h" +#include "video.h" + +#include <math.h> +#include "proto.h" +#include "ui.h" + +ACE_RCSID(mpeg_client, vp, "$Id$") + +/* Declaration of global variable to hold dither info. */ + +extern int ditherType; + +/* Structures used by the X server. */ + +extern Display *display; +extern Colormap cmap; + +static int cmdSocket = -1; +static int win_width, win_height; +static Window window; +static GC gc; + +static int usingShm = 0; +#ifdef SH_MEM +static XShmSegmentInfo shminfo; /* Segment info. */ +#endif +static XImage *ximage = NULL; + + +/* + *-------------------------------------------------------------- + * + * InitColor -- + * + * Initialized lum, cr, and cb quantized range value arrays. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void +InitColor() +{ + int i; + + for (i=0; i<LUM_RANGE; i++) { + lum_values[i] = ((i * 256) / (LUM_RANGE)) + (256/(LUM_RANGE*2)); + } + + for (i=0; i<CR_RANGE; i++) { + cr_values[i] = ((i * 256) / (CR_RANGE)) + (256/(CR_RANGE*2)); + } + + for (i=0; i<CB_RANGE; i++) { + cb_values[i] = ((i * 256) / (CB_RANGE)) + (256/(CB_RANGE*2)); + } + +} + + +/* + *-------------------------------------------------------------- + * + * ConvertColor -- + * + * Given a l, cr, cb tuple, converts it to r,g,b. + * + * Results: + * r,g,b values returned in pointers passed as parameters. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +static void +ConvertColor(unsigned char l, unsigned char cr, unsigned char cb, + unsigned char *r, unsigned char *g, unsigned char *b) +{ + double fl, fcr, fcb, fr, fg, fb; + + fl = (double) l; + fcr = ((double) cr) - 128.0; + fcb = ((double) cb) - 128.0; + + + fr = fl + (1.40200 * fcb); + fg = fl - (0.71414 * fcb) - (0.34414 * fcr); + fb = fl + (1.77200 * fcr); + + if (fr < 0.0) fr = 0.0; + else if (fr > 255.0) fr = 255.0; + + if (fg < 0.0) fg = 0.0; + else if (fg > 255.0) fg = 255.0; + + if (fb < 0.0) fb = 0.0; + else if (fb > 255.0) fb = 255.0; + + *r = (unsigned char) fr; + *g = (unsigned char) fg; + *b = (unsigned char) fb; + +} + +#ifdef SH_MEM + +int gXErrorFlag = 0; + +int HandleXError(Display * dpy, XErrorEvent * event) +{ + gXErrorFlag = 1; + return 0; +} + +void InstallXErrorHandler() +{ + int HandleXError(Display *,XErrorEvent *); + + XSetErrorHandler(HandleXError); + XFlush(display); +} + +void DeInstallXErrorHandler() +{ + XSetErrorHandler(NULL); + XFlush(display); +} +#endif + +/* + *-------------------------------------------------------------- + * + * MakeWindow -- + * + * Create X Window for image display + * + * Results: + * Read the code. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +#ifdef SH_MEM +int CompletionType = -1; +#endif + +// int XShmGetEventBase (Display*); + +static void +MakeWindow(void) +{ + + XSizeHints hint; + unsigned int fg, bg; + char *hello = "MPEG Play"; + int screen; + + if (ditherType == NO_DITHER) return; +/* + UICreate(); +*/ + +#ifdef SH_MEM + if (shmemFlag && display != NULL) + { + if (!XShmQueryExtension(display)) + { + shmemFlag = 0; + fprintf(stderr, "VP: Shared memory not supported, Reverting to normal Xlib.\n"); + } + else + { + shmemFlag = 1; + /* + fprintf(stderr, "VP: try using shared mem, but STOPPED temporarily.\n"); + shmemFlag = 0; + */ + } + } + else if (shmemFlag) + { + fprintf(stderr, "VP unexpected: display is NULL.\n"); + ACE_OS::exit (1); + } + if(shmemFlag) + CompletionType = /*XShmGetEventBase(display) +*/ ShmCompletion; +#endif + + screen = DefaultScreen (display); + + /* Fill in hint structure */ + + hint.x = 0; + hint.y = 0; + hint.width = 150; + hint.height = 150; + hint.flags = PPosition | PSize; + + /* Get some colors */ + + bg = WhitePixel (display, screen); + fg = BlackPixel (display, screen); + + /* Make the window */ + + if (ditherType == FULL_COLOR_DITHER) { + window = CreateFullColorWindow (display, hint.x, hint.y, hint.width, hint.height); + if (window == 0) { + fprintf (stderr, "-color option only valid on full color display\n"); + exit (-1); + } + } else if (ditherType == MONO_DITHER || ditherType == MONO_THRESHOLD) { + window = XCreateSimpleWindow (display, + MonitorWindow(), + hint.x, hint.y, + hint.width, hint.height, + 4, fg, bg); + UISetwin(window); + } else { + XVisualInfo vinfo; + + if (!XMatchVisualInfo (display, screen, 8, PseudoColor, + &vinfo)) { + + if (!XMatchVisualInfo(display, screen, 8, GrayScale, + &vinfo)) { + fprintf(stderr, "It seems you have a true-color/mono monitor,\n"); + fprintf(stderr, "please try 'vcr -dither color' or 'vcr -dither mono'\n"); + exit(-1); + } + } + + window = XCreateSimpleWindow (display, + MonitorWindow(), + hint.x, hint.y, + hint.width, hint.height, + 4, fg, bg); + UISetwin(window); + } + + XSelectInput(display, window, StructureNotifyMask); + + /* Tell other applications about this window */ + + XSetStandardProperties (display, window, hello, hello, None, NULL, 0, &hint); + + /* Map window. */ + + XMapWindow(display, window); + + /* Wait for map. */ + while(1) { + XEvent xev; + + XNextEvent(display, &xev); + if(xev.type == MapNotify && xev.xmap.event == window) + break; + } + XSelectInput(display, window, NoEventMask); +} + + +/* + *-------------------------------------------------------------- + * + * InitDisplay -- + * + * Initialized display, sets up colormap, etc. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + + +static char window_name[64]; +#include <string.h> + +void InitDisplay(char *name) +{ + + int ncolors = LUM_RANGE*CB_RANGE*CR_RANGE; + XColor xcolor; + int i, lum_num, cr_num, cb_num; + unsigned char r, g, b; + Colormap dcmap; + + if (ditherType == NO_DITHER) return; + + strcpy(window_name, name); + + MakeWindow(); + + gc = XCreateGC(display, window, 0, 0); + + dcmap = cmap = XDefaultColormap(display, DefaultScreen(display)); + + xcolor.flags = DoRed | DoGreen | DoBlue; + + retry_alloc_colors: + for (i=0; i<ncolors; i++) { + + lum_num = (i / (CR_RANGE*CB_RANGE))%LUM_RANGE; + cr_num = (i / CB_RANGE)%CR_RANGE; + cb_num = i % CB_RANGE; + + ConvertColor(lum_values[lum_num], cr_values[cr_num], cb_values[cb_num], &r, &g, &b); + + xcolor.red = r * 256; + xcolor.green = g * 256; + xcolor.blue = b * 256; + + if(XAllocColor(display, cmap, &xcolor) == 0 && cmap == dcmap) { + int j; + unsigned long tmp_pixel; + XWindowAttributes xwa; + + Fprintf(stderr, "Using private colormap.\n"); + + /* Free colors. */ + for(j = 0; j < i; j ++) { + tmp_pixel = pixel[j]; + XFreeColors(display, cmap, &tmp_pixel, 1, 0); + } + + XGetWindowAttributes(display, window, &xwa); + cmap = XCreateColormap(display, window, xwa.visual, AllocNone); + XSetWindowColormap(display, window, cmap); + UISetColormap(); + + goto retry_alloc_colors; + } + pixel[i] = xcolor.pixel; + } + + /* + Fprintf(stderr, "Pixel values allocated for colormap:"); + for (i = 0; i < ncolors; i++) { + if (!(i % 20)) Fprintf(stderr, "\n"); + Fprintf(stderr, "%3d ", pixel[i]); + } + */ + + ximage = NULL; +} + + +/* + *-------------------------------------------------------------- + * + * InitGrayDisplay -- + * + * Initialized display for gray scale dither. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +#define NUM_COLORS 128 + +void InitGrayDisplay(char *name) +{ + int ncolors = NUM_COLORS; + XColor xcolor; + int i; + Colormap dcmap; + + MakeWindow(); + + gc = XCreateGC(display, window, 0, 0); + + dcmap = cmap = XDefaultColormap(display, DefaultScreen(display)); + + xcolor.flags = DoRed | DoGreen | DoBlue; + + retry_alloc_grays: + for (i=0; i<ncolors; i++) { + + xcolor.red = (i*2) * 256; + xcolor.green = (i*2) * 256; + xcolor.blue = (i*2) * 256; + + if(XAllocColor(display, cmap, &xcolor) == 0 && cmap == dcmap) { + int j; + unsigned long tmp_pixel; + XWindowAttributes xwa; + + Fprintf(stderr, "Using private colormap.\n"); + + /* Free colors. */ + for(j = 0; j < i; j ++) { + tmp_pixel = pixel[j*2]; + XFreeColors(display, cmap, &tmp_pixel, 1, 0); + } + + XGetWindowAttributes(display, window, &xwa); + cmap = XCreateColormap(display, window, xwa.visual, AllocNone); + XSetWindowColormap(display, window, cmap); + UISetColormap(); + + goto retry_alloc_grays; + } + pixel[(i*2)] = xcolor.pixel; + pixel[(i*2)+1] = xcolor.pixel; + } + + ximage = NULL; +} + + +/* + *-------------------------------------------------------------- + * + * InitMonoDisplay -- + * + * Initialized display for monochrome dither. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void InitMonoDisplay(char *name) +{ + XGCValues xgcv; + + MakeWindow(); + + xgcv.background = BlackPixel(display, DefaultScreen(display)); + xgcv.foreground = WhitePixel(display, DefaultScreen(display)); + + gc = XCreateGC(display, window, GCForeground | GCBackground, &xgcv); + + ximage = NULL; +} + + +/* + *-------------------------------------------------------------- + * + * InitColorDisplay -- + * + * Initialized display for full color output. + * + * Results: + * None. + * + * Side effects: + * None. + * + *-------------------------------------------------------------- + */ + +void InitColorDisplay(char *name) +{ + + MakeWindow(); + + gc = XCreateGC(display, window, 0, 0); + ximage = NULL; +} + + +static void ClearWindow(void) +{ + int size; + char * data; + if ((ditherType == Twox2_DITHER) || (ditherType == FULL_COLOR_DITHER)) + size = win_width * win_height * 4; + else + size = win_width * win_height; + data = (char *)ACE_OS::malloc(size); + if (data != NULL) { + memset(data, 0, size); + ximage->data = data; + XPutImage(display, window, gc, ximage, 0, 0, 0, 0, + ximage->width, ximage->height); + XFlush(display); + ximage->data = NULL; + ACE_OS::free (data); + } +} + + +void VPresizeWindow(int h, int w) +{ + int i; + char dummy; + Visual *fc_visual; + int depth; + static int ph = 0; + static int pw = 0; + + if (ph == h && pw == w) { + ClearWindow(); + return; + } + ph = h; + pw = w; + + /* Excerpt from man page of XDestroyImage(3X11): + Note that when the image is created using XCreateImage(), + XGetImage(), or XSubImage(), the destroy procedure that the + XDestroyImage function call frees both the image structure + and the data pointed to by the image structure. */ + if (ximage != NULL) ximage->data = NULL; + + if (ditherType == NO_DITHER) return; + + win_width = ((w + 15)>>4)<<4; + win_height = ((h + 15)>>4)<<4; + + i = (ditherType == Twox2_DITHER) ? 2 : 1; + XResizeWindow(display, window, w*i, h*i); + UIMinsize(w*i, h*i); + + /* ximage allocate/resize */ + +#ifdef SH_MEM + if (shmemFlag && display != NULL) + { + InstallXErrorHandler(); + } +#endif + + if (ximage != NULL) + { +#ifdef SH_MEM + if (shmemFlag && usingShm == 1) + { + XDestroyImage(ximage); + ximage = NULL; + } + else +#endif + { + XDestroyImage(ximage); + ximage = NULL; + } + } +#ifdef SH_MEM + if (shmemFlag) + { + /* + Visual *fc_visual; + int depth; + Visual *FindFullColorVisual(); + */ + usingShm = 1; + + if (ditherType == Twox2_DITHER) + { + ximage = XShmCreateImage(display, None, 8, ZPixmap, NULL, + &(shminfo), win_width * 2, win_height * 2); + } + else if (ditherType == FULL_COLOR_DITHER) + { + fc_visual = FindFullColorVisual(display, &depth); + ximage = XShmCreateImage(display, fc_visual, depth, ZPixmap, + NULL, &(shminfo), win_width, win_height); + } + else if (ditherType == MONO_DITHER || ditherType == MONO_THRESHOLD) + { + ximage = XShmCreateImage(display, None, 1, XYBitmap, + NULL, &(shminfo), win_width, win_height); + } + else + { + ximage = XShmCreateImage(display, None, 8, ZPixmap, NULL, + &(shminfo), win_width, win_height); + } + if (ximage == NULL) + { + fprintf(stderr, "Shared memory error, disabling.\n"); + goto shmemerror; + } + + if (gXErrorFlag) + { + XDestroyImage(ximage); + ximage = NULL; + fprintf(stderr, "Shared memory error, disabling.\n"); + gXErrorFlag = 0; + goto shmemerror; + } + } + else +#endif + { +shmemerror: + + usingShm = 0; + + if (ditherType == Twox2_DITHER) + { + ximage = XCreateImage(display, None, 8, ZPixmap, 0, &dummy, + win_width * 2, + win_height * 2, 8, 0); + } + else if (ditherType == FULL_COLOR_DITHER) + { + fc_visual = FindFullColorVisual(display, &depth); + ximage = XCreateImage (display, fc_visual, depth, ZPixmap, + 0, &dummy, win_width, + win_height, 32, 0); + } + else if (ditherType == MONO_DITHER || ditherType == MONO_THRESHOLD) + { + ximage = XCreateImage (display, None, 1, XYBitmap, 0, &dummy, + win_width, + win_height, 8, 0); + ximage->byte_order = MSBFirst; + ximage->bitmap_bit_order = MSBFirst; + } + else + { + ximage = XCreateImage(display, None, 8, ZPixmap, 0, &dummy, + win_width, + win_height, 8, 0); + } + if (ximage == NULL) + { + ACE_OS::perror ("VP error: fails to XCreateImage ximage"); + ACE_OS::exit (1); + } + } +#ifdef SH_MEM + if (shmemFlag && display != NULL) + { + DeInstallXErrorHandler(); + } +#endif + ximage->data = NULL; + /* + fprintf(stderr, "win_width %d, win_height %d, times %d\n", + win_width, win_height, win_width * win_height); + */ + ClearWindow(); + /* + fprintf(stderr, "VP window resized as width-%d, height-%d.\n", w, h); + */ +} + +/* parameter 'position' is for VPcontinuous command only */ +void VPcommand(int cmd, char * ptr) +{ + FrameBlock *buf = (FrameBlock *)ptr; + /* + fprintf(stderr, "VP get cmd %d.\n", cmd); + */ + switch (cmd) + { + case CmdVPdisplayFrame: + if (shared->cmd != CmdSTOP) { + shared->currentGroup = buf->gop; + shared->currentFrame = buf->frame; + shared->currentDisplay = buf->display; + ximage->data = (char *)buf->data; + VPexpose(); + } + VDreclaimMsg(buf); + return; + + case CmdVPinitScreen: + + VPresizeWindow(shared->verticalSize, shared->horizontalSize); + return; + + case CmdVPclearScreen: + + ClearWindow(); + /* + fprintf(stderr, "VP screen cleaned for audio-only case.\n"); + */ + break; + + default: /* all unknown cmds shall be processed by UI */ + + break; + } +} + +void VPexpose(void) +{ + if (ximage == NULL) { + return; + } + else if (ximage->data == NULL) { + return; + } +#ifdef SH_MEM + if (shmemFlag && usingShm) + { + XShmPutImage(display, window, gc, ximage, 0, 0, 0, 0, + ximage->width, ximage->height, True); + XFlush(display); + while(1) + { + XEvent xev; + + XNextEvent(display, &xev); + if(xev.type == CompletionType) + break; + } + } + else +#endif + { + XPutImage(display, window, gc, ximage, 0, 0, 0, 0, + ximage->width, ximage->height); + XFlush(display); + } +} + +static void DisplayInitialization(void) +{ +/* + printf("to initialize display.\n"); +*/ + switch (ditherType) { + + case HYBRID_DITHER: + + InitColor(); + InitDisplay(displayName); + break; + + case HYBRID2_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case FS4_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case FS2_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case FS2FAST_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case Twox2_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case GRAY_DITHER: + InitGrayDisplay(displayName); + break; + + case FULL_COLOR_DITHER: + InitColorDisplay(displayName); + break; + + case NO_DITHER: + shmemFlag = 0; + break; + + case ORDERED_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case MONO_DITHER: + case MONO_THRESHOLD: + InitMonoDisplay(displayName); + break; + + case ORDERED2_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + case MBORDERED_DITHER: + InitColor(); + InitDisplay(displayName); + break; + + } +/* + printf("finished init display.\n"); +*/ +} + +void VPinitWindow(Widget shell, Window monitorWindow, int cmdSock) +{ + cmdSocket = cmdSock; + lum_values = (int *) ACE_OS::malloc(LUM_RANGE*sizeof(int)); + cr_values = (int *) ACE_OS::malloc(CR_RANGE*sizeof(int)); + cb_values = (int *) ACE_OS::malloc(CB_RANGE*sizeof(int)); + + DisplayInitialization(); + ACE_OS::memcpy (shared->pixel, pixel, 256); + shared->pixelValid = 1; + + ACE_OS::free (lum_values); + ACE_OS::free (cr_values); + ACE_OS::free (cb_values); +#ifdef SH_MEM + if (shmemFlag && display != NULL) + { + InstallXErrorHandler(); + + shminfo.shmid = shared->VDbufId; + shminfo.shmaddr = shared->VDbufAddr; + shminfo.readOnly = False; + XShmAttach(display, &(shminfo)); + XSync(display, False); + + if (gXErrorFlag) + { + Fprintf(stderr, "Shared memory error, disabling.\n"); + gXErrorFlag = 0; + shmemFlag = 0; + } + DeInstallXErrorHandler(); + } +#endif + + remove_shmem_id(shared->VDbufId); + VPresizeWindow(150, 200); +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile new file mode 100644 index 00000000000..fb8cf125e12 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile @@ -0,0 +1,421 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +MAKEFILE = Makefile +LIBNAME = libmpeg_mib +LIB2 = $(LIBNAME).a +SHLIB2 = $(LIBNAME).$(SOEXT) + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +FILES= mibButton \ + mibDrawArea \ + mibFrame \ + mibLabel \ + mibList \ + mibMenu \ + mibRadioBox \ + mibScale \ + mibScrollBar \ + mibTextBig \ + mibTextBox \ + mibToggle \ + mibload \ + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + LIB = $(LIB2) + SHLIB = $(SHLIB2) +else + override INSTALL = +endif # ! AV + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +LDFLAGS += $(PLATFORM_X11_LDFLAGS) +LDLIBS += -lXm -lXt -lXext -lSM -lICE -lX11 +CPPFLAGS += -DSH_MEM -DNDEBUG $(PLATFORM_X11_CPPFLAGS) + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/mibButton.o .obj/mibButton.so .shobj/mibButton.o .shobj/mibButton.so: mibButton.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibDrawArea.o .obj/mibDrawArea.so .shobj/mibDrawArea.o .shobj/mibDrawArea.so: mibDrawArea.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibFrame.o .obj/mibFrame.so .shobj/mibFrame.o .shobj/mibFrame.so: mibFrame.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibLabel.o .obj/mibLabel.so .shobj/mibLabel.o .shobj/mibLabel.so: mibLabel.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibList.o .obj/mibList.so .shobj/mibList.o .shobj/mibList.so: mibList.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibMenu.o .obj/mibMenu.so .shobj/mibMenu.o .shobj/mibMenu.so: mibMenu.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibRadioBox.o .obj/mibRadioBox.so .shobj/mibRadioBox.o .shobj/mibRadioBox.so: mibRadioBox.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibScale.o .obj/mibScale.so .shobj/mibScale.o .shobj/mibScale.so: mibScale.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibScrollBar.o .obj/mibScrollBar.so .shobj/mibScrollBar.o .shobj/mibScrollBar.so: mibScrollBar.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibTextBig.o .obj/mibTextBig.so .shobj/mibTextBig.o .shobj/mibTextBig.so: mibTextBig.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibTextBox.o .obj/mibTextBox.so .shobj/mibTextBox.o .shobj/mibTextBox.so: mibTextBox.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibToggle.o .obj/mibToggle.so .shobj/mibToggle.o .shobj/mibToggle.so: mibToggle.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +.obj/mibload.o .obj/mibload.so .shobj/mibload.o .shobj/mibload.so: mibload.cpp mibload.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + mibwidgets.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile.am new file mode 100644 index 00000000000..5f8b621bfdd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/Makefile.am @@ -0,0 +1,48 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- +## mpeg/source/mpeg_mib directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_LTLIBRARIES = libmpeg_mib + +libmpeg_mib_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +libmpeg_mib_SOURCES = \ + mibButton.cpp \ + mibDrawArea.cpp \ + mibFrame.cpp \ + mibLabel.cpp \ + mibList.cpp \ + mibMenu.cpp \ + mibRadioBox.cpp \ + mibScale.cpp \ + mibScrollBar.cpp \ + mibTextBig.cpp \ + mibTextBox.cpp \ + mibToggle.cpp \ + mibload.cpp + +noinst_HEADERS = \ + mibload.h \ + mibwidgets.h + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibButton.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibButton.cpp new file mode 100644 index 00000000000..74193bc62db --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibButton.cpp @@ -0,0 +1,176 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibButton, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for Button */ +/*****************************************************************************/ + +mib_Widget *mib_create_Button(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Button *myres; + // unsigned char *label_text; + XmString label_text; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + myres = (mib_Button *)ACE_OS::malloc(sizeof(mib_Button)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(7); + sprintf(temp->mib_class,"Button"); + temp->mib_class_num = MIB_BUTTON; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + + if (mib_fill == WDEFAULT) + { + myres->label = (char *)ACE_OS::malloc(strlen(label)+1); + strcpy(myres->label,label); + } + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + label_text = XmStringCreateLtoR(label, XmSTRING_DEFAULT_CHARSET); + + XtSetArg (args[n], XmNlabelString, label_text); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + temp->me = XtCreateManagedWidget(name, xmPushButtonWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WDEFAULT) + { + XmStringFree(label_text); + } + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_Button(mib_Widget *thisw) +{ + mib_Button *temp = (mib_Button *)thisw->myres; + + ACE_OS::free(temp->label); + ACE_OS::free(temp); +} + +void mib_save_Button(mib_Widget *thisw, FILE *fout) +{ + mib_Button *temp = (mib_Button *)thisw->myres; + + fprintf(fout,"label: \\\"%s\\\"\\n\\\n", temp->label); +} + +void mib_code_gen_Button(mib_Widget *thisw, FILE *fout) +{ +} + +int mib_load_Button(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_Button *myres; + // unsigned char *label_text; + XmString label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[20]; + int n, got_line, vallen; + + myres = (mib_Button *)thisw->myres; + + got_line = mib_read_line(fin, res, val); + if (!got_line) + return 0; + + if (!strcmp(res,"label")) + { + vallen =ACE_OS::strlen (val); + if (vallen < 2) + return 0; + val[vallen-1] = '\0'; + myres->label = (char *)ACE_OS::malloc(vallen-1); + sprintf(myres->label,"%s",&(val[1])); + + label_text = XmStringCreateLtoR(myres->label, XmSTRING_DEFAULT_CHARSET); + + n = 0; + XtSetArg (args[n], XmNlabelString, label_text); n++; + XtSetValues(thisw->me, args, n); + + XmStringFree(label_text); + + } + else + return 0; + + got_line = mib_read_line(fin, res, val); + if (!got_line) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibDrawArea.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibDrawArea.cpp new file mode 100644 index 00000000000..c8d7c0ce62b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibDrawArea.cpp @@ -0,0 +1,120 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibDrawArea, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for DrawingArea */ +/*****************************************************************************/ + +mib_Widget *mib_create_DrawingArea(mib_Widget *parent, char *name, char * /* label */, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_DrawingArea *myres; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + myres = (mib_DrawingArea *)ACE_OS::malloc(sizeof(mib_DrawingArea)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(12); + sprintf(temp->mib_class,"DrawingArea"); + temp->mib_class_num = MIB_DRAWINGAREA; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->nothing = 0; + + /* create Xt widget */ + + + n = 0; + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNbackground, WhitePixel(dpy, DefaultScreen(dpy))); n++; + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + temp->me = XtCreateManagedWidget(name, xmDrawingAreaWidgetClass, + temp->parent->me, args, n); + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_DrawingArea(mib_Widget *thisw) +{ + mib_DrawingArea *temp = (mib_DrawingArea *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_DrawingArea(mib_Widget *thisw, FILE *fout) +{ +} + +int mib_load_DrawingArea(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibFrame.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibFrame.cpp new file mode 100644 index 00000000000..0323daba556 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibFrame.cpp @@ -0,0 +1,182 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibFrame, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for Frames */ +/*****************************************************************************/ + +mib_Widget *mib_create_Frame(mib_Widget *parent, char *name, char *frame_type, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Frame *myres; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_Frame *)ACE_OS::malloc(sizeof(mib_Frame)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(6); + sprintf(temp->mib_class,"Frame"); + temp->mib_class_num = MIB_FRAME; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->shadowtype = 0; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + + if (mib_fill == WDEFAULT) + if (!strcmp("InFrame",frame_type)) + { + XtSetArg (args[n], XmNshadowType, XmSHADOW_IN); n++; + } + else + if (!strcmp("OutFrame",frame_type)) + { + XtSetArg (args[n], XmNshadowType, XmSHADOW_OUT); n++; + myres->shadowtype = 1; + } + else + if (!strcmp("EtchedInFrame",frame_type)) + { + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_IN); n++; + myres->shadowtype = 2; + } + else + if (!strcmp("EtchedOutFrame",frame_type)) + { + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_OUT); n++; + myres->shadowtype = 3; + } + + temp->me = XtCreateManagedWidget(name, xmFrameWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_Frame(mib_Widget *thisw) +{ + mib_Frame *temp = (mib_Frame *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_Frame(mib_Widget *thisw, FILE *fout) +{ + mib_Frame *temp = (mib_Frame *)thisw->myres; + + fprintf(fout,"shadowtype: %d\\n\\\n", temp->shadowtype); +} + +int mib_load_Frame(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_Frame *myres; + unsigned char *label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[5]; + int n; + + myres = (mib_Frame *)thisw->myres; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"shadowtype")) + { + sscanf(val,"%d",&(myres->shadowtype)); + + n = 0; + switch (myres->shadowtype) { + case 0: + XtSetArg (args[n], XmNshadowType, XmSHADOW_IN); n++; + break; + case 1: + XtSetArg (args[n], XmNshadowType, XmSHADOW_OUT); n++; + break; + case 2: + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_IN); n++; + break; + case 3: + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_OUT); n++; + break; + default: + break; + } + XtSetValues(thisw->me, args, n); + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibLabel.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibLabel.cpp new file mode 100644 index 00000000000..5746937ccad --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibLabel.cpp @@ -0,0 +1,168 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibLabel, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for Label */ +/*****************************************************************************/ + +mib_Widget *mib_create_Label(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Label *myres; + //unsigned char *label_text; + XmString label_text; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_Label *)ACE_OS::malloc(sizeof(mib_Label)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(6); + sprintf(temp->mib_class,"Label"); + temp->mib_class_num = MIB_LABEL; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + + if (mib_fill == WDEFAULT) + { + myres->label = (char *)ACE_OS::malloc(strlen(label)+1); + strcpy(myres->label,label); + } + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + label_text = XmStringCreateLtoR(label, XmSTRING_DEFAULT_CHARSET); + + XtSetArg (args[n], XmNlabelString, label_text); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + temp->me = XtCreateManagedWidget(name, xmLabelWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WDEFAULT) + XmStringFree(label_text); + + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_Label(mib_Widget *thisw) +{ + mib_Label *temp = (mib_Label *)thisw->myres; + + ACE_OS::free(temp->label); + ACE_OS::free(temp); +} + +void mib_save_Label(mib_Widget *thisw, FILE *fout) +{ + mib_Label *temp = (mib_Label *)thisw->myres; + + fprintf(fout,"label: \\\"%s\\\"\\n\\\n", temp->label); +} + +int mib_load_Label(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_Label *myres; + // unsigned char *label_text; + XmString label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[5]; + int n, vallen; + + myres = (mib_Label *)thisw->myres; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"label")) + { + vallen =ACE_OS::strlen (val); + if (vallen < 2) + return 0; + val[vallen-1] = '\0'; + myres->label = (char *)ACE_OS::malloc(vallen-1); + sprintf(myres->label,"%s",&(val[1])); + label_text = XmStringCreateLtoR(myres->label, XmSTRING_DEFAULT_CHARSET); + + n = 0; + XtSetArg (args[n], XmNlabelString, label_text); n++; + XtSetValues(thisw->me, args, n); + + XmStringFree(label_text); + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibList.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibList.cpp new file mode 100644 index 00000000000..16252137352 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibList.cpp @@ -0,0 +1,167 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibList, "$Id$") + +extern Display *dpy; +extern GC mib_gc; +static Widget real_list; + +/* Code for Lists */ +/*****************************************************************************/ + +mib_Widget *mib_create_List(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_List *myres; + Widget wtemp; + // unsigned char *label_text; + XmString label_text; + char ttext[30]; + Arg args[20]; + String myname; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_List *)ACE_OS::malloc(sizeof(mib_List)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(5); + sprintf(temp->mib_class,"List"); + temp->mib_class_num = MIB_LIST; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy); n++; + } + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_IN); n++; + + temp->me = XtCreateManagedWidget(name, xmFrameWidgetClass, + temp->parent->me, args, n); + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; + + if (mib_fill == WEMPTY) + { + XtSetArg (args[n], XmNlistSizePolicy, XmCONSTANT); n++; + } + + wtemp = XmCreateScrolledList(temp->me, name, args, n); + myres->real_list = wtemp; + real_list = wtemp; + + XtManageChild(wtemp); + + if (mib_fill != WEMPTY) + real_list = NULL; + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + label_text = XmStringCreateLtoR("Simple", XmSTRING_DEFAULT_CHARSET); + XmListAddItem(wtemp, label_text, 0); + XmStringFree(label_text); + label_text = XmStringCreateLtoR("List", XmSTRING_DEFAULT_CHARSET); + XmListAddItem(wtemp, label_text, 0); + XmStringFree(label_text); + for (n=0;n<200;n++) + { + sprintf(ttext,"Item %d ",n); + label_text = XmStringCreateLtoR(ttext, XmSTRING_DEFAULT_CHARSET); + XmListAddItem(wtemp, label_text, 0); + XmStringFree(label_text); + } + + mib_apply_eventhandlers(temp->me, temp); + mib_apply_eventhandlers(wtemp, temp); + } + + return temp; +} + +void mib_delete_List(mib_Widget *thisw) +{ + mib_List *temp = (mib_List *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_List(mib_Widget *thisw, FILE *fout) +{ +} + +int mib_load_List(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + + + if (real_list) + thisw->me = real_list; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibMenu.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibMenu.cpp new file mode 100644 index 00000000000..ae5d4490305 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibMenu.cpp @@ -0,0 +1,250 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibMenu, "$Id$") + +extern Display *dpy; +extern GC mib_gc; +static int delhandler; /* delay adding event handler until menu + is actually created */ + +/* Code for Menu */ +/*****************************************************************************/ + +mib_Widget *mib_create_Menu(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Menu *myres; + Widget wtemp; + char label_temp[50]; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_Menu *)ACE_OS::malloc(sizeof(mib_Menu)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(8); + sprintf(temp->mib_class,"Menu"); + temp->mib_class_num = MIB_MENU; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 0; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->numitems = 0; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + } + XtSetArg (args[n], XmNrubberPositioning, False); n++; + + temp->me = XtCreateManagedWidget(name, xmRowColumnWidgetClass, + temp->parent->me, args, n); + + n = 0; + + delhandler = 1; + if (mib_fill == WDEFAULT) + { + delhandler = 0; + myres->numitems = 3; + myres->my_menu = (MenuItem *)ACE_OS::malloc(sizeof(MenuItem) * (myres->numitems+1)); + myres->items = (Widget *)ACE_OS::malloc(sizeof(Widget) * myres->numitems); + sprintf(label_temp, "Item 1"); + myres->my_menu[0].label = (char *)ACE_OS::malloc(strlen(label_temp)+1); + strcpy(myres->my_menu[0].label,label_temp); + myres->my_menu[0].wclass = &xmPushButtonGadgetClass; + myres->my_menu[0].mnemonic = '1'; + myres->my_menu[0].accelerator = NULL; + myres->my_menu[0].accel_text = NULL; + myres->my_menu[0].accel_text = NULL; + myres->my_menu[0].callback = NULL; + myres->my_menu[0].callback_data = NULL; + myres->my_menu[0].subitems = (struct _menu_item *)1; + + sprintf(label_temp, "Item 2"); + myres->my_menu[1].label = (char *)ACE_OS::malloc(strlen(label_temp)+1); + strcpy(myres->my_menu[1].label,label_temp); + myres->my_menu[1].wclass = &xmPushButtonGadgetClass; + myres->my_menu[1].mnemonic = '2'; + myres->my_menu[1].accelerator = NULL; + myres->my_menu[1].accel_text = NULL; + myres->my_menu[1].accel_text = NULL; + myres->my_menu[1].callback = NULL; + myres->my_menu[1].callback_data = NULL; + myres->my_menu[1].subitems = (struct _menu_item *)1; + + sprintf(label_temp, "Item 3"); + myres->my_menu[2].label = (char *)ACE_OS::malloc(strlen(label_temp)+1); + strcpy(myres->my_menu[2].label,label_temp); + myres->my_menu[2].wclass = &xmPushButtonGadgetClass; + myres->my_menu[2].mnemonic = '2'; + myres->my_menu[2].accelerator = NULL; + myres->my_menu[2].accel_text = NULL; + myres->my_menu[2].accel_text = NULL; + myres->my_menu[2].callback = NULL; + myres->my_menu[2].callback_data = NULL; + myres->my_menu[2].subitems = (struct _menu_item *)1; + + myres->my_menu[3].label = NULL; + + wtemp = BuildMenu(temp->me, XmMENU_OPTION, NULL, 'M', myres->my_menu); + XtManageChild(wtemp); + } + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + + /* default menu */ + + if (!delhandler) + { + mib_apply_eventhandlers(wtemp, temp); + mib_apply_eventhandlers(temp->me, temp); + } + } + + if (mib_fill == WEMPTY) + delhandler = 0; + + return temp; +} + +void mib_delete_Menu(mib_Widget *thisw) +{ + mib_Menu *temp = (mib_Menu *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_Menu(mib_Widget *thisw, FILE *fout) +{ + mib_Menu *temp = (mib_Menu *)thisw->myres; + int count; + + fprintf(fout, "numitems: %d\\n\\\n", temp->numitems); + + for (count=0; count < temp->numitems; count++) + { + fprintf(fout, "item: \\\"%s\\\"\\n\\\n", temp->my_menu[count].label); + } + +} + +int mib_load_Menu(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + int count, vallen; + Widget wtemp; + mib_Menu *myres = (mib_Menu *)thisw->myres; + + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res, "numitems")) + { + myres->numitems = 0; + sscanf(val, "%d", &(myres->numitems)); + if (!(myres->numitems)) + return 0; + + myres->my_menu = (MenuItem *)ACE_OS::malloc(sizeof(MenuItem) * (myres->numitems+1)); + myres->items = (Widget *)ACE_OS::malloc(sizeof(Widget) * myres->numitems); + for (count = 0; count < myres->numitems; count++) + { + if (!mib_read_line(fin, res, val)) + return 0; + vallen =ACE_OS::strlen (val); + if (vallen < 2) + return 0; + val[vallen-1] = '\0'; + myres->my_menu[count].label = (char *)ACE_OS::malloc(vallen-1); + sprintf(myres->my_menu[count].label, "%s", &(val[1])); + myres->my_menu[count].wclass = &xmPushButtonGadgetClass; + myres->my_menu[count].mnemonic = NULL; + myres->my_menu[count].accelerator = NULL; + myres->my_menu[count].accel_text = NULL; + myres->my_menu[count].accel_text = NULL; + myres->my_menu[count].callback = NULL; + myres->my_menu[count].callback_data = NULL; + myres->my_menu[count].subitems = (struct _menu_item *)1; + } + myres->my_menu[myres->numitems].label = NULL; + + wtemp = BuildMenu(thisw->me, XmMENU_OPTION, NULL, NULL, myres->my_menu); + XtManageChild(wtemp); + + if (delhandler) + { + mib_apply_eventhandlers(wtemp, thisw); + mib_apply_eventhandlers(thisw->me, thisw); + } + else + thisw->me = wtemp; + + for (count = 0; count < myres->numitems; count++) + { + /* thisw hack extracts the widget for each item in the menu + for possible use by the programmer */ + myres->items[count] = (Widget)(myres->my_menu[count].subitems); + } + + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibRadioBox.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibRadioBox.cpp new file mode 100644 index 00000000000..a341abf2667 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibRadioBox.cpp @@ -0,0 +1,210 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibRadioBox, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for RadioBox */ +/*****************************************************************************/ + +mib_Widget *mib_create_RadioBox(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_RadioBox *myres; + Widget wtemp; + unsigned char *label_text; + char label_temp[50]; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_RadioBox *)ACE_OS::malloc(sizeof(mib_RadioBox)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(9); + sprintf(temp->mib_class,"RadioBox"); + temp->mib_class_num = MIB_RADIOBOX; + + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 0; + + /* initialize private resources */ + + temp->myres = (void *)myres; + + myres->numlabel = 0; + + if (mib_fill == WDEFAULT) + { + myres->numlabel = 2; + myres->labels = (char **)ACE_OS::malloc(10); + myres->buttons = (Widget *)ACE_OS::malloc(sizeof(Widget) * myres->numlabel); + sprintf(label_temp, "Radio 1"); + myres->labels[0] = (char *)ACE_OS::malloc(strlen(label_temp)+1); + strcpy(myres->labels[0],label_temp); + sprintf(label_temp, "Radio 2"); + myres->labels[1] = (char *)ACE_OS::malloc(strlen(label_temp)+1); + strcpy(myres->labels[1],label_temp); + } + + + /* create Xt widget */ + + n = 0; + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + temp->me = XmCreateRadioBox(temp->parent->me, "Radio", args, n); + wtemp = temp->me; + + + if (mib_fill == WDEFAULT) + { + n = 0; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + XtCreateManagedWidget("Radio 1", xmToggleButtonGadgetClass, + wtemp, args, n); + + n = 0; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + XtCreateManagedWidget("Radio 2", xmToggleButtonGadgetClass, + wtemp, args, n); + } + + + XtManageChild(wtemp); + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_RadioBox(mib_Widget *thisw) +{ + mib_RadioBox *temp = (mib_RadioBox *)thisw->myres; + int count; + + for (count=0; count < temp->numlabel; count++) + ACE_OS::free(temp->labels[count]); + + ACE_OS::free(temp); +} + +void mib_save_RadioBox(mib_Widget *thisw, FILE *fout) +{ + mib_RadioBox *temp = (mib_RadioBox *)thisw->myres; + int count; + + fprintf(fout,"numlabel: %d\\n\\\n", temp->numlabel); + + for (count=0; count < temp->numlabel; count++) + { + fprintf(fout,"label: \\\"%s\\\"\\n\\\n", temp->labels[count]); + } +} + +int mib_load_RadioBox(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + int count, vallen, n; + Arg args[5]; + mib_RadioBox *myres; + + myres = (mib_RadioBox *)thisw->myres; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"numlabel")) + { + myres->numlabel = 0; + sscanf(val,"%d",&(myres->numlabel)); + if (!(myres->numlabel)) + return 0; + + myres->labels = (char **)ACE_OS::malloc((myres->numlabel+1)*4); + myres->buttons = (Widget *)ACE_OS::malloc(sizeof(Widget)*(myres->numlabel)); + for (count=0; count < myres->numlabel; count++) + { + if (!mib_read_line(fin, res, val)) + return 0; + vallen =ACE_OS::strlen (val); + if (vallen < 2) + return 0; + val[vallen-1] = '\0'; + myres->labels[count] = (char *)ACE_OS::malloc(vallen-1); + sprintf(myres->labels[count],"%s",&(val[1])); + + n = 0; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + myres->buttons[count] = XtCreateManagedWidget(myres->labels[count], + xmToggleButtonGadgetClass, thisw->me, args, n); + + } + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScale.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScale.cpp new file mode 100644 index 00000000000..68a4d125c58 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScale.cpp @@ -0,0 +1,204 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibScale, "$Id$") + +extern Display *dpy; +extern GC mib_gc; +static int scaleflag; + +/* Code for Scale */ +/*****************************************************************************/ + +mib_Widget *mib_create_Scale(mib_Widget *parent, char *name, char *orient, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Scale *myres; + Arg args[20]; + int n; + + + scaleflag = 0; + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_Scale *)ACE_OS::malloc(sizeof(mib_Scale)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(10); + sprintf(temp->mib_class,"Scale"); + temp->mib_class_num = MIB_SCALE; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->orientation = 0; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + + + if (mib_fill == WDEFAULT) + if (!strcmp("VertScale",orient)) + { + XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; + } + else + if (!strcmp("HorzScale",orient)) + { + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + myres->orientation = 1; + } + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNshowArrows, False); n++; + XtSetArg (args[n], XmNsliderSize, 30); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + temp->me = XtCreateManagedWidget(name, xmScrollBarWidgetClass, + temp->parent->me, args, n); + else + temp->me = XtCreateManagedWidget(name, xmScaleWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WEMPTY) + scaleflag = 1; + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_Scale(mib_Widget *thisw) +{ + mib_Scale *temp = (mib_Scale *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_Scale(mib_Widget *thisw, FILE *fout) +{ + mib_Scale *temp = (mib_Scale *)thisw->myres; + + fprintf(fout,"orientation: %d\\n\\\n", temp->orientation); +} + +int mib_load_Scale(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_Scale *myres; + unsigned char *label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[5]; + int n; + Dimension myht,mywd; + + + myres = (mib_Scale *)thisw->myres; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"orientation")) + { + sscanf(val,"%d",&(myres->orientation)); + + n = 0; + if (scaleflag) + { + if (!myres->orientation) + { + XtSetArg (args[n], XmNscaleWidth, thisw->width); n++; + } + else + { + XtSetArg (args[n], XmNscaleWidth, thisw->height); n++; + } + + XtSetValues(thisw->me, args, n); + + } + + n = 0; + switch (myres->orientation) { + case 0: + XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; + break; + case 1: + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + break; + default: + break; + } + XtSetValues(thisw->me, args, n); + + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScrollBar.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScrollBar.cpp new file mode 100644 index 00000000000..168f86ae391 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibScrollBar.cpp @@ -0,0 +1,164 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibScrollBar, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for ScrollBars */ +/*****************************************************************************/ + +mib_Widget *mib_create_ScrollBar(mib_Widget *parent, char *name, char *orient, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_ScrollBar *myres; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_ScrollBar *)ACE_OS::malloc(sizeof(mib_ScrollBar)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(10); + sprintf(temp->mib_class,"ScrollBar"); + temp->mib_class_num = MIB_SCROLLBAR; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->orientation = 0; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + + if (mib_fill == WDEFAULT) + if (!strcmp("VertScrollBar",orient)) + { + XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; + } + else + if (!strcmp("HorzScrollBar",orient)) + { + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + myres->orientation = 1; + } + + temp->me = XtCreateManagedWidget(name, xmScrollBarWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_ScrollBar(mib_Widget *thisw) +{ + mib_ScrollBar *temp = (mib_ScrollBar *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_ScrollBar(mib_Widget *thisw, FILE *fout) +{ + mib_ScrollBar *temp = (mib_ScrollBar *)thisw->myres; + + fprintf(fout,"orientation: %d\\n\\\n", temp->orientation); +} + +int mib_load_ScrollBar(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_ScrollBar *myres; + unsigned char *label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[5]; + int n; + + myres = (mib_ScrollBar *)thisw->myres; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"orientation")) + { + sscanf(val,"%d",&(myres->orientation)); + + n = 0; + switch (myres->orientation) { + case 0: + XtSetArg (args[n], XmNorientation, XmVERTICAL); n++; + break; + case 1: + XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; + break; + default: + break; + } + XtSetValues(thisw->me, args, n); + } + else + return 0; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBig.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBig.cpp new file mode 100644 index 00000000000..26a085371cd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBig.cpp @@ -0,0 +1,147 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibTextBig, "$Id$") + +extern Display *dpy; +extern GC mib_gc; +static Widget real_text; + +/* Code of TextBig */ +/*****************************************************************************/ + +mib_Widget *mib_create_TextBig(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_TextBig *myres; + Widget wtemp; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_TextBig *)ACE_OS::malloc(sizeof(mib_TextBig)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(8); + sprintf(temp->mib_class,"TextBig"); + temp->mib_class_num = MIB_TEXTBIG; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->nothing = 0; + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + } + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNshadowType, XmSHADOW_ETCHED_IN); n++; + + temp->me = XtCreateManagedWidget(name, xmFrameWidgetClass, + temp->parent->me, args, n); + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + XtSetArg (args[n], XmNrows, 200); n++; + XtSetArg (args[n], XmNcolumns, 200); n++; + } + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNeditMode, XmMULTI_LINE_EDIT); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + wtemp = XmCreateScrolledText(temp->me, name, args, n); + real_text = wtemp; + + XtManageChild(wtemp); + + if (mib_fill != WEMPTY) + real_text = NULL; + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + XmTextSetString(wtemp,"Big Text Field\nwith Scrollbars\n\n\n\n\n\n\n "); + + mib_apply_eventhandlers(wtemp, temp); + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_TextBig(mib_Widget *thisw) +{ + mib_TextBig *temp = (mib_TextBig *)thisw->myres; + + ACE_OS::free(temp); +} + +void mib_save_TextBig(mib_Widget *thisw, FILE *fout) +{ +} + +int mib_load_TextBig(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + + if (real_text) + thisw->me = real_text; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBox.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBox.cpp new file mode 100644 index 00000000000..bee0af42fef --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibTextBox.cpp @@ -0,0 +1,133 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibTextBox, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for TextBox */ +/*****************************************************************************/ + +mib_Widget *mib_create_TextBox(mib_Widget *parent, char *name, char *contents, + int posx, int posy, int width, int height, + int mib_fill) +{ + mib_Widget *temp; + mib_TextBox *myres; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + myres = (mib_TextBox *)ACE_OS::malloc(sizeof(mib_TextBox)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(8); + sprintf(temp->mib_class,"TextBox"); + temp->mib_class_num = MIB_TEXTBOX; + temp->width = width; + temp->height = height; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 1; + + /* initialize private resources */ + + temp->myres = (void *)myres; + myres->init_contents = NULL; + + if (mib_fill == WDEFAULT) + { + if (contents != NULL) + { + myres->init_contents = (char *)ACE_OS::malloc(strlen(contents)+1); + strcpy(myres->init_contents, contents); + } + } + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + } + + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + + temp->me = XtCreateManagedWidget(name, xmTextFieldWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + XmTextFieldSetString(temp->me, "Text Field"); + + } + + return temp; +} + +void mib_delete_TextBox(mib_Widget *thisw) +{ + mib_TextBox *temp = (mib_TextBox *)thisw->myres; + + if (temp->init_contents != NULL) + ACE_OS::free(temp->init_contents); +} + +void mib_save_TextBox(mib_Widget *thisw, FILE *fout) +{ +} + +int mib_load_TextBox(mib_Widget *thisw, mib_Buffer *fin) +{ + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + + if (!mib_read_line(fin, res, val)) + return 0; + + if (!strcmp(res,"EndWidget.")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibToggle.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibToggle.cpp new file mode 100644 index 00000000000..b8470e9d2f3 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibToggle.cpp @@ -0,0 +1,194 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibToggle, "$Id$") + +extern Display *dpy; +extern GC mib_gc; + +/* Code for Toggle */ +/*****************************************************************************/ + +mib_Widget *mib_create_Toggle(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill) +{ + mib_Widget *temp; + mib_Toggle *myres; + // unsigned char *label_text; + XmString label_text; + Arg args[20]; + int n; + + /* create the new widget and add it to the tree */ + + temp = mib_new_mib_Widget(); + if (mib_fill == WDEFAULT) + mib_add_backward(temp, parent); + else + mib_add_mib_Widget(temp, parent); + + myres = (mib_Toggle *)ACE_OS::malloc(sizeof(mib_Toggle)); + + /* initialize public resources */ + + if (mib_fill == WDEFAULT) + { + temp->name = (char *)ACE_OS::malloc(strlen(name)+1); + strcpy(temp->name,name); + } + temp->mib_class = (char *)ACE_OS::malloc(7); + sprintf(temp->mib_class,"Toggle"); + temp->mib_class_num = MIB_TOGGLE; + temp->width = 0 /*width*/; + temp->height = 0 /*height*/; + temp->topOffset = posy; + temp->leftOffset = posx; + temp->bottomOffset = 0; + temp->rightOffset = 0; + temp->topAttachment = 1; + temp->leftAttachment = 1; + temp->bottomAttachment = 0; + temp->rightAttachment = 0; + + temp->mib_allowresize = 0; + + /* initialize private resources */ + + temp->myres = (void *)myres; + + myres->isize = 0; + if (mib_fill == WDEFAULT) + { + myres->label = (char *)ACE_OS::malloc(strlen(label)+1); + strcpy(myres->label,label); + } + + /* create Xt widget */ + + n = 0; + + if (mib_fill == WDEFAULT) + { + label_text = XmStringCreateLtoR(label, XmSTRING_DEFAULT_CHARSET); + + XtSetArg (args[n], XmNlabelString, label_text); n++; + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, posx);n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, posy);n++; +/* XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++;*/ + } + + XtSetArg (args[n], XmNwidth, width); n++; + XtSetArg (args[n], XmNheight, height); n++; + XtSetArg (args[n], XmNspacing, 4); n++; + XtSetArg (args[n], XmNhighlightThickness, 0); n++; + XtSetArg (args[n], XmNrubberPositioning, False); n++; + XtSetArg (args[n], XmNindicatorType, XmN_OF_MANY); + + temp->me = XtCreateManagedWidget(name, xmToggleButtonWidgetClass, + temp->parent->me, args, n); + + if (mib_fill == WDEFAULT) + { + XmStringFree(label_text); + } + + if (mib_fill == WEDIT || mib_fill == WDEFAULT) + { + mib_apply_eventhandlers(temp->me, temp); + } + + return temp; +} + +void mib_delete_Toggle(mib_Widget *thisw) +{ + mib_Toggle *temp = (mib_Toggle *)thisw->myres; + + ACE_OS::free(temp->label); + ACE_OS::free(temp); +} + +void mib_save_Toggle(mib_Widget *thisw, FILE *fout) +{ + mib_Toggle *temp = (mib_Toggle *)thisw->myres; + + fprintf(fout,"label: \\\"%s\\\"\\n\\\n", temp->label); + fprintf(fout,"indicatorSize: %d\\n\\\n", temp->isize); +} + +int mib_load_Toggle(mib_Widget *thisw, mib_Buffer *fin) +{ + mib_Toggle *myres; + // unsigned char *label_text; + XmString label_text; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + Arg args[20]; + int n, got_line, vallen; + + myres = (mib_Toggle *)thisw->myres; + + got_line = mib_read_line(fin, res, val); + if (!got_line) + return 0; + + if (!strcmp(res,"label")) + { + vallen =ACE_OS::strlen (val); + if (vallen < 2) + return 0; + val[vallen-1] = '\0'; + myres->label = (char *)ACE_OS::malloc(vallen-1); + sprintf(myres->label,"%s",&(val[1])); + + label_text = XmStringCreateLtoR(myres->label, XmSTRING_DEFAULT_CHARSET); + + n = 0; + XtSetArg (args[n], XmNlabelString, label_text); n++; + thisw->width = 0; + thisw->height = 0; + XtSetArg (args[n], XmNwidth, thisw->width); n++; + XtSetArg (args[n], XmNheight, thisw->height); n++; + XtSetValues(thisw->me, args, n); + XmStringFree(label_text); + + } + else + return 0; + + got_line = mib_read_line(fin, res, val); + if (!got_line) + return 0; + + if (!strcmp(res, "indicatorSize")) + { + sscanf(val, "%d", &(myres->isize)); + if (myres->isize) + XtVaSetValues(thisw->me, XmNindicatorSize, (Dimension)myres->isize, + XmNmarginBottom, 0, XmNmarginTop, 0, XmNmarginLeft, 0, + XmNmarginRight, 0, XmNspacing, 0, NULL); + got_line = mib_read_line(fin, res, val); + if (!got_line) + return 0; + } + + if (ACE_OS::strcmp (res,"EndWidget")) + return 0; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.cpp new file mode 100644 index 00000000000..7319899863e --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.cpp @@ -0,0 +1,804 @@ +/* $Id$ */ + +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with thisw file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "mibload.h" +#include <stdlib.h> +#include "mibwidgets.h" + +ACE_RCSID(mpeg_mib, mibload, "$Id$") + +mib_Widget *mib_root_Widget; +Display *dpy; +GC mib_gc; +static struct _mib_event_handle_funcs { +#ifdef __cplusplus + void (*mib_pick_mib_Widget)( Widget, XtPointer, + XEvent *, Boolean * ); + void (*mib_move_mib_Widget)( Widget, XtPointer, + XEvent *, Boolean *); + void (*mib_unpick_mib_Widget)( Widget, XtPointer, + XEvent *, Boolean * ); +#else + void (*mib_pick_mib_Widget)(/* Widget, XtPointer, + XButtonPressedEvent *, Boolean * */); + void (*mib_move_mib_Widget)(/* Widget, XtPointer, + XPointerMovedEvent *, Boolean * */); + void (*mib_unpick_mib_Widget)(/* Widget, XtPointer, + XButtonReleasedEvent *, Boolean * */); +#endif +} mib_events; + +mib_widget_funcs mwfuncs[] = +{ + { NULL, NULL, NULL, NULL, NULL }, + { "TextBox", mib_create_TextBox, mib_delete_TextBox, + mib_save_TextBox, mib_load_TextBox}, + { "Button", mib_create_Button, mib_delete_Button, + mib_save_Button, mib_load_Button}, + { "Toggle", mib_create_Toggle, mib_delete_Toggle, + mib_save_Toggle, mib_load_Toggle}, + { "RadioBox", mib_create_RadioBox, mib_delete_RadioBox, + mib_save_RadioBox, mib_load_RadioBox}, + { "DrawingArea", mib_create_DrawingArea, mib_delete_DrawingArea, + mib_save_DrawingArea, mib_load_DrawingArea}, + { "Label", mib_create_Label, mib_delete_Label, + mib_save_Label, mib_load_Label}, + { "Frame", mib_create_Frame, mib_delete_Frame, + mib_save_Frame, mib_load_Frame}, + { "ScrollBar", mib_create_ScrollBar, mib_delete_ScrollBar, + mib_save_ScrollBar, mib_load_ScrollBar}, + { "TextBig", mib_create_TextBig, mib_delete_TextBig, + mib_save_TextBig, mib_load_TextBig}, + { "List", mib_create_List, mib_delete_List, + mib_save_List, mib_load_List}, + { "Scale", mib_create_Scale, mib_delete_Scale, + mib_save_Scale, mib_load_Scale}, + { "Menu", mib_create_Menu, mib_delete_Menu, + mib_save_Menu, mib_load_Menu}, + { NULL, NULL, NULL, NULL, NULL }, +}; + +/*****************************************************************************/ + +void mib_add_mib_Widget(mib_Widget *thisw, mib_Widget *parent) +{ + mib_Widget *tmp; + + if (parent->child == NULL) + { + parent->child = thisw; + thisw->prev = parent; + thisw->parent = parent; + thisw->sibling = NULL; + thisw->child = NULL; + } + else + { + tmp = parent->child; + while (tmp->sibling != NULL) + tmp = tmp->sibling; + tmp->sibling = thisw; + thisw->prev = tmp; + thisw->parent = parent; + thisw->sibling = NULL; + thisw->child = NULL; + } +} + +/*****************************************************************************/ + +void mib_add_backward(mib_Widget *thisw, mib_Widget *parent) +{ + mib_Widget *tmp; + + if (parent->child == NULL) + { + parent->child = thisw; + thisw->prev = parent; + thisw->parent = parent; + thisw->sibling = NULL; + thisw->child = NULL; + } + else + { + tmp = parent->child; + parent->child = thisw; + thisw->prev = parent; + thisw->parent = parent; + thisw->sibling = tmp; + thisw->child = NULL; + tmp->prev = thisw; + } +} + +/*****************************************************************************/ + +void mib_remove_mib_Widget(mib_Widget *thisw) +{ + int count; + mib_Widget *pnt; + + XtVaSetValues(mib_root_Widget->me, XmNresizePolicy, XmRESIZE_NONE, NULL); + XtDestroyWidget(thisw->me); + + while (thisw->child != NULL) + mib_remove_mib_Widget(thisw->child); + + if (thisw->parent == thisw) + { + mib_clear_myres(thisw); + return; + } + + if (thisw->prev == thisw->parent) + { + thisw->parent->child = thisw->sibling; + if (thisw->sibling != NULL) + thisw->sibling->prev = thisw->parent; + } + else + { + thisw->prev->sibling = thisw->sibling; + if (thisw->sibling != NULL) + thisw->sibling->prev = thisw->prev; + } + + mib_clear_myres(thisw); +} + +/*****************************************************************************/ + +void mib_clear_myres(mib_Widget *thisw) +{ + ACE_OS::free(thisw->mib_class); + ACE_OS::free(thisw->name); + + if ((thisw->mib_class_num < 1) || (thisw->mib_class_num > MI_NUMCLASSES)) + return; + + mwfuncs[thisw->mib_class_num].mib_delete(thisw); + ACE_OS::free(thisw); +} + +/*****************************************************************************/ + +mib_Widget *mib_new_mib_Widget() +{ + mib_Widget *thisw; + thisw = (mib_Widget *)ACE_OS::malloc(sizeof(mib_Widget)); + thisw->me = NULL; + thisw->mib_class_num = MIB_NULL; + thisw->mib_selected = 0; + thisw->mib_resizing = 0; + thisw->myres = NULL; + thisw->parent = NULL; + thisw->sibling = NULL; + thisw->prev = NULL; + thisw->child = NULL; + thisw->width = 0; + thisw->height = 0; + thisw->topAttachment = 0; + thisw->bottomAttachment = 0; + thisw->leftAttachment = 0; + thisw->rightAttachment = 0; + thisw->topOffset = 0; + thisw->bottomOffset = 0; + thisw->leftOffset = 0; + thisw->rightOffset = 0; + + return thisw; +} + +/*****************************************************************************/ + +mib_Widget *mib_find_name(mib_Widget *temp, char *name) +{ + mib_Widget *child = temp->child; + mib_Widget *ret = NULL; + + if (!strcmp(temp->name, name)) + return temp; + + if (child != NULL) + if (ret = mib_find_name(child, name)) + return ret; + + child = temp->sibling; + if (child != NULL) + if (ret = mib_find_name(child, name)) + return ret; + + return NULL; +} + +/*****************************************************************************/ + +Widget +BuildMenu(Widget parent, int menu_type, char *menu_title, char menu_mnemonic, + MenuItem *items) +{ + Widget menu, cascade, widget; + int i; + XmString str; + + if (menu_type == XmMENU_PULLDOWN || menu_type == XmMENU_OPTION) + menu = XmCreatePulldownMenu(parent, "_pulldown", NULL, 0); + else if (menu_type == XmMENU_POPUP) + menu = XmCreatePopupMenu(parent, "_popup", NULL, 0); + else { + XtWarning("Invalid menu type passed to BuildMenu()"); + return NULL; + } + + /* Pulldown menus require a cascade button to be made */ + if (menu_type == XmMENU_PULLDOWN) { + str = XmStringCreateSimple(menu_title); + cascade = XtVaCreateManagedWidget(menu_title, + xmCascadeButtonGadgetClass, parent, + XmNsubMenuId, menu, + XmNlabelString, str, + XmNmnemonic, menu_mnemonic, + NULL); + XmStringFree(str); + } else if (menu_type == XmMENU_OPTION) { + /* Option menus are a special case, but not hard to handle */ + Arg args[2]; + str = XmStringCreateSimple(menu_title); + XtSetArg(args[0], XmNsubMenuId, menu); + XtSetArg(args[1], XmNlabelString, str); + /* This really isn't a cascade, but thisw is the widget handle + * we're going to return at the end of the function. + */ + cascade = XmCreateOptionMenu(parent, menu_title, args, 2); + XmStringFree(str); + } + + /* Now add the menu items */ + for (i = 0; items[i].label != NULL; i++) { + /* If subitems exist, create the pull-right menu by calling thisw + * function recursively. Since the function returns a cascade + * button, the widget returned is used.. + */ + if (items[i].subitems) + if (menu_type == XmMENU_OPTION) { + widget = XtVaCreateManagedWidget(items[i].label, + *items[i].wclass, menu, NULL); + items[i].subitems = (struct _menu_item *) widget; + /* daeron mod (tm) :-) ... we now use thisw to pass back each + widget we create to the mibMenu functions so that it can + be stored as part of the mibMenu structure */ + + /* XtWarning("You can't have submenus from option menu items."); + continue;*/ + } else + widget = BuildMenu(menu, XmMENU_PULLDOWN, + items[i].label, items[i].mnemonic, items[i].subitems); + else + { + widget = XtVaCreateManagedWidget(items[i].label, + *items[i].wclass, menu, + NULL); + /* ditto here from above ... - Daeron mod (tm) */ + items[i].subitems = (struct _menu_item *) widget; + } + + /* Whether the item is a real item or a cascade button with a + * menu, it can still have a mnemonic. + */ + if (items[i].mnemonic) + XtVaSetValues(widget, XmNmnemonic, items[i].mnemonic, NULL); + + /* any item can have an accelerator, except cascade menus. But, + * we don't worry about that; we know better in our declarations. + */ + if (items[i].accelerator) { + str = XmStringCreateSimple(items[i].accel_text); + XtVaSetValues(widget, + XmNaccelerator, items[i].accelerator, + XmNacceleratorText, str, + NULL); + XmStringFree(str); + } + + if (items[i].callback) + XtAddCallback(widget, + (items[i].wclass == &xmToggleButtonWidgetClass || + items[i].wclass == &xmToggleButtonGadgetClass)? + XmNvalueChangedCallback : /* ToggleButton class */ + XmNactivateCallback, /* PushButton class */ + items[i].callback, items[i].callback_data); + } + + /* for popup menus, just return the menu; pulldown menus, return + * the cascade button; option menus, return the thing returned + * from XmCreateOptionMenu(). This isn't a menu, or a cascade button! + */ + return menu_type == XmMENU_POPUP? menu : cascade; +} + +/*****************************************************************************/ + +mib_Widget *mib_load_interface(Widget parent, char *from, int file_type) +{ + mib_Buffer thiswfile; + mib_Widget *thisw; + FILE *infile; + char *instring; + char ch; + + thiswfile.buf_type = file_type; + + dpy = XtDisplay(parent); + + if ((file_type == MI_FROMFILE) || (file_type == MI_EDITFROMFILE)) + { + if (!(infile = fopen(from,"r"))) + return NULL; + + ch = '\0'; + while ((ch != '\n')&&(!feof(infile))) /* throw away first line */ + ch = (char)fgetc(infile); + + thiswfile.buffer = (void *)infile; + thiswfile.point = 0; + + if (!mib_load_Root(parent, &thisw, &thiswfile)) + { + /* delete thisw */ + return NULL; + } + else + { + fclose(infile); + return thisw; + } + } + else + if ((file_type == MI_FROMSTRING) || (file_type == MI_EDITFROMSTRING)) + { + instring = from; + if (instring == NULL) + return NULL; + + thiswfile.buffer = (void *)instring; + thiswfile.buflen =ACE_OS::strlen (instring); + thiswfile.point = 0; + + if (!mib_load_Root(parent, &thisw, &thiswfile)) + { + /* delete thisw */ + return NULL; + } + else + return thisw; + } + else + return NULL; + +} + +/*****************************************************************************/ + +int mib_load_mib_class(mib_Widget **thisw, mib_Widget *parent, char *name, + char *iname, mib_Buffer *fin ) +{ + int namelen, editstate, count, set; + + if ((fin->buf_type == MI_EDITFROMFILE) || + (fin->buf_type == MI_EDITFROMSTRING)) + editstate = WEDIT; + else + editstate = WEMPTY; + + namelen =ACE_OS::strlen (name); + if (namelen < 2) + return 0; + + name[namelen-1] = '\0'; + name[0] = ' '; + + count = 1; + + while (mwfuncs[count].name) + { + if (!strcmp(&(name[1]), mwfuncs[count].name)) + { + *thisw = mwfuncs[count].mib_create(parent, iname, NULL, 0, 0, 0, 0, + editstate); + return 1; + } + count++; + } + + (*thisw)->parent = (*thisw); + return 1; +} + +/*****************************************************************************/ + +mib_Widget *mib_load_public(mib_Widget *root, mib_Widget *thisw, mib_Buffer *fin) +{ + int got_line, done; + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + char valcp[MI_MAXSTRLEN]; + Arg args[20]; + int mynum, n; + + got_line = 1; + done = 0; + + /* thisw loop reads basic info about Widget */ + while (got_line && (!done)) + { + got_line = mib_read_line(fin, res, val); + if (!strcmp(res,"Ref")) + sscanf(val, "%d", &mynum); + else + if (!strcmp(res,"Widget")) + { + strcpy(valcp,val); + done = 1; + } + } + + done = 0; + + while (got_line && (!done)) + { + got_line = mib_read_line(fin, res, val); + if (!strcmp(res, "Children")) + n = 0; + else + if (!strcmp(res, "Parent")) /* don't support complete widget tree yet */ + n = 0; + else + if (!strcmp(res,"Public-")) + n = 0; + else + if (!strcmp(res,"Name")) + { + val[strlen(val)-1] = '\0'; + mib_load_mib_class(&thisw, root, valcp, &(val[1]), fin); + thisw->name = (char *)ACE_OS::malloc(strlen(val)); + sprintf(thisw->name,"%s",&(val[1])); + thisw->mib_mynum = mynum; + done = 1; + } + else + return 0; + } + + if (!got_line) + return NULL; + + done = 0; + + /* second loop reads public info */ + while (got_line && (!done)) + { + got_line = mib_read_line(fin, res, val); + if (!strcmp(res,"Xmwidth")) + sscanf(val,"%d",&(thisw->width)); + else + if (!strcmp(res,"Xmheight")) + sscanf(val,"%d",&(thisw->height)); + else + if (!strcmp(res,"XmtopAttachment")) + sscanf(val,"%d",&(thisw->topAttachment)); + else + if (!strcmp(res,"XmbottomAttachment")) + sscanf(val,"%d",&(thisw->bottomAttachment)); + else + if (!strcmp(res,"XmleftAttachment")) + sscanf(val,"%d",&(thisw->leftAttachment)); + else + if (!strcmp(res,"XmrightAttachment")) + sscanf(val,"%d",&(thisw->rightAttachment)); + else + if (!strcmp(res,"XmtopOffset")) + sscanf(val,"%d",&(thisw->topOffset)); + else + if (!strcmp(res,"XmbottomOffset")) + sscanf(val,"%d",&(thisw->bottomOffset)); + else + if (!strcmp(res,"XmleftOffset")) + sscanf(val,"%d",&(thisw->leftOffset)); + else + if (!strcmp(res,"XmrightOffset")) + sscanf(val,"%d",&(thisw->rightOffset)); + else + if (!strcmp(res,"Private-")) + done = 1; + } + + n = 0; + if ((fin->buf_type == MI_EDITFROMFILE) || + (fin->buf_type == MI_EDITFROMSTRING)) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, thisw->leftOffset); n++; + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, thisw->topOffset); n++; + if (thisw == root) + { + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightOffset, thisw->rightOffset); n++; + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, thisw->bottomOffset); n++; + } + } + else + { + if (thisw->leftAttachment) + { + XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNleftOffset, thisw->leftOffset);n++; + } + if (thisw->topAttachment) + { + XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNtopOffset, thisw->topOffset);n++; + } + if (thisw->bottomAttachment) + { + XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNbottomOffset, thisw->bottomOffset);n++; + } + if (thisw->rightAttachment) + { + XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; + XtSetArg (args[n], XmNrightOffset, thisw->rightOffset);n++; + } + } + + XtSetArg (args[n], XmNwidth, thisw->width); n++; + XtSetArg (args[n], XmNheight, thisw->height); n++; + + XtSetValues(thisw->me, args, n); + + return thisw; +} + +/*****************************************************************************/ + +int mib_load_private(mib_Widget *thisw, mib_Buffer *fin) +{ + + if (thisw->mib_class_num == MIB_NULL) + return 1; + + if ((thisw->mib_class_num < 1) || (thisw->mib_class_num > MI_NUMCLASSES)) + return 0; + + mwfuncs[thisw->mib_class_num].mib_load(thisw, fin); + + return 1; +} + +/*****************************************************************************/ + +int mib_load_Root(Widget parent, mib_Widget **thisw, mib_Buffer *fin) +{ + + char res[MI_MAXSTRLEN]; + char val[MI_MAXSTRLEN]; + char name[MI_MAXSTRLEN]; + int num_widgets, count, n, got_line; + Arg args[20]; + XGCValues gcvals; + XtGCMask val_mask; + mib_Widget *temp; + + got_line = mib_read_line(fin, res, val); + if (!strcmp(res,"TotalWidgets")) + sscanf(val, "%d", &num_widgets); + else + return 0; + + (*thisw) = mib_new_mib_Widget(); + (*thisw)->mib_class = (char*)ACE_OS::malloc(9); + sprintf((*thisw)->mib_class,"RootForm"); + +/* (*thisw)->me = XmCreateForm(parent, "MainForm", args, 0); */ + + (*thisw)->me = parent; + + if (!mib_load_public((*thisw), (*thisw), fin)) + return 0; + + /* we don't expect any private resources for the root widget */ + + got_line = mib_read_line(fin, res, val); + if (ACE_OS::strcmp (res,"EndWidget.")) + return 0; + +/* XtManageChild((*thisw)->me); +*/ + XtVaSetValues((*thisw)->me, XmNresizePolicy, XmRESIZE_NONE, NULL); + + count = num_widgets - 1; + while (count > 0) + { + + if (!(temp = mib_load_public((*thisw), temp, fin))) + { + /* delete temp */ + return 0; + } + + if (!mib_load_private(temp,fin)) + { + /* delete temp */ + return 0; + } + count--; + + } + + mib_reset_size((*thisw)); + + XtVaSetValues((*thisw)->me, XmNresizePolicy, XmRESIZE_ANY, NULL); + + val_mask = (long)0; + mib_gc = XtGetGC((*thisw)->me, val_mask, &gcvals); + + return 1; +} + +/*****************************************************************************/ + +int mib_read_line(mib_Buffer *bufin, char *res, char *val) +{ + FILE *fin; + char *strin; + char ch; + int count, mark; + char inbuf[MI_MAXSTRLEN]; + + if ((bufin->buf_type == MI_FROMFILE) || (bufin->buf_type == MI_EDITFROMFILE)) + { + fin = (FILE *)bufin->buffer; + ch = '\0'; + count = 0; + mark = 0; + while ((ch != '\n')&&(!feof(fin))&&(count<MI_MAXSTRLEN)) + { + ch = (char)fgetc(fin); + if ((mark == 0) && (ch == ':')) + mark = count; + if ((ch != '\\')&&(ch != '\n')) + { + inbuf[count] = ch; + count++; + } + } + if (feof(fin)) + return 0; + inbuf[count] = '\0'; + if (count > 0) + { + if (inbuf[count-1] == 'n') + inbuf[count-1] = '\0'; + } + else + return 0; + + } + else + if ((bufin->buf_type == MI_FROMSTRING) || + (bufin->buf_type == MI_EDITFROMSTRING)) + { + strin = (char *)bufin->buffer; + count = bufin->point; + mark = 0; + + if (count >= bufin->buflen) + return 0; + + while ((strin[count] != '\n') && (count < bufin->buflen)) + { + if ((mark == 0) && (strin[count] == ':')) + mark = count; + count++; + } + + strin[count] = '\0'; + if (count >= bufin->buflen) + return 0; + sprintf(inbuf,"%s",&(strin[bufin->point])); + strin[count] = '\n'; + if (mark != 0) + mark -= bufin->point; + bufin->point = count+1; + } + else + return 0; + + if (mark == 0) + { + sprintf(res,"%s",inbuf); + sprintf(val,"\0"); + } + else + { + inbuf[mark] = '\0'; + sprintf(res,"%s",inbuf); + inbuf[mark] = ' '; + if ((int)(strlen(inbuf)-mark) > 1) + sprintf(val,"%s",&(inbuf[mark+2])); + else + sprintf(val,"\0"); + } + + return 1; +} + +/*****************************************************************************/ + +void mib_reset_size(mib_Widget *temp) +{ + Arg args[5]; + int n; + + mib_Widget *child = temp->child; + + if (temp->mib_class_num != MIB_NULL) + { + n = 0; + XtSetArg (args[n], XmNwidth, temp->width); n++; + XtSetArg (args[n], XmNheight, temp->height); n++; + + XtSetValues(temp->me, args, n); + } + + if (child != NULL) + mib_reset_size(child); + + child = temp->sibling; + if (child != NULL) + mib_reset_size(child); +} + +/*****************************************************************************/ + +#ifdef __cplusplus +void mib_set_eventhandlers(void a(Widget, XtPointer, + XEvent *, Boolean * ), + void b( Widget, XtPointer, + XEvent *, Boolean* ), + void c(Widget, XtPointer, + XEvent *, Boolean *) + ) +#else +void mib_set_eventhandlers(void * a, void * b, void * c) +#endif +{ + mib_events.mib_pick_mib_Widget = a; + mib_events.mib_move_mib_Widget = b; + mib_events.mib_unpick_mib_Widget = c; +} + +/*****************************************************************************/ + +void mib_apply_eventhandlers(Widget thisw, mib_Widget *actual) +{ + XtAddEventHandler(thisw, ButtonPressMask, FALSE, + mib_events.mib_pick_mib_Widget, (XtPointer)actual); + XtAddEventHandler(thisw, Button3MotionMask, FALSE, + mib_events.mib_move_mib_Widget, (XtPointer)actual); + XtAddEventHandler(thisw, ButtonReleaseMask, FALSE, + mib_events.mib_unpick_mib_Widget, (XtPointer)actual); + +} + +/*****************************************************************************/ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.h new file mode 100644 index 00000000000..877fc65c66f --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibload.h @@ -0,0 +1,172 @@ +/* $Id$ */ +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with this file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +#include "ace/OS.h" +#include <stdio.h> +#include <X11/Intrinsic.h> +#include <X11/Shell.h> +#include <Xm/Xm.h> +#include <Xm/Text.h> +#include <Xm/TextF.h> +#include <Xm/RowColumn.h> +#include <Xm/MainW.h> +#include <Xm/Label.h> +#include <Xm/PushB.h> +#include <Xm/PushBG.h> +#include <Xm/ToggleB.h> +#include <Xm/ToggleBG.h> +#include <Xm/DrawingA.h> +#include <Xm/CascadeBG.h> +#include <Xm/SeparatoG.h> +#include <Xm/Frame.h> +#include <Xm/BulletinB.h> +#include <Xm/Scale.h> +#include <Xm/ScrollBar.h> +#include <Xm/Form.h> +#include <Xm/List.h> +#include <Xm/FileSB.h> +#include <Xm/AtomMgr.h> +#include <Xm/Protocols.h> +#include <Xm/MwmUtil.h> + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +/* Structure of mib_Widget */ +/*****************************************************************************/ + +typedef struct _mib_Widget { + char *mib_class; /* name of mib class (Button, TextBox, etc..)*/ + int mib_class_num; /* class number for ez reference :) */ + int mib_mynum; /* numbering for storage format */ + Widget me; /* Xt widget */ + int mib_selected; /* is selected */ + int mib_resizing; /* is resizing 1, or being moved 0 */ + int mib_resizetype;/* 1 = upper left, 2 = upper, 3 = ... */ + int mib_allowresize; /* can this widget be resized ? */ + + int clkx, clky; /* where user clicked */ + + void *myres; /* my resources (different for each widget) */ + + char *name; /* reference name of this widget */ + int width, height; /* width and height */ + + int topAttachment, bottomAttachment, leftAttachment, rightAttachment; + /* attachments 1=attached 0=not-attached */ + + int topOffset, bottomOffset, leftOffset, rightOffset; + /* offsets if attached */ + + struct _mib_Widget *parent; /* pointer to parent */ + struct _mib_Widget *sibling; /* remaining linked list of sibling widgets */ + struct _mib_Widget *prev; /* previous sibling or parent */ + struct _mib_Widget *child; /* linked list of children widgets */ +} mib_Widget; + +/* mib_Buffer structure */ +/*****************************************************************************/ + +typedef struct _mib_Buffer { + void *buffer; /* pointer to either a file or a char string */ + int buf_type; /* type of buffer (defined above) */ + int point; /* pointer for string */ + int buflen; /* length of string buffer */ +} mib_Buffer; + +/* mib_Widget functions */ +/*****************************************************************************/ + +void mib_add_mib_Widget(mib_Widget *, mib_Widget *); +void mib_add_backward(mib_Widget *, mib_Widget *); +void mib_remove_mib_Widget(mib_Widget *); +void mib_clear_myres(mib_Widget *); +#ifdef __cplusplus +mib_Widget *mib_new_mib_Widget(); +#else +mib_Widget *mib_new_mib_Widget(); +#endif +mib_Widget *mib_find_name(mib_Widget *, char *); +mib_Widget *mib_load_interface(Widget, char *, int); +int mib_count_all(mib_Widget *, int); +int mib_load_Root(Widget, mib_Widget **, mib_Buffer *); +mib_Widget *mib_load_public(mib_Widget *, mib_Widget *, mib_Buffer *); +int mib_load_mib_class(mib_Widget **, mib_Widget *, char *, char *, + mib_Buffer *); +int mib_load_private(mib_Widget *, mib_Buffer *); +void mib_reset_size(mib_Widget *); +int mib_read_line(mib_Buffer *, char *, char *); +#ifdef __cplusplus +void mib_set_eventhandlers(void (a)(...), void (b)(...), void (c)(...)); +#else +void mib_set_eventhandlers(void *, void *, void *); +#endif +void mib_apply_eventhandlers(Widget, mib_Widget *); + +/* supporting functions and structures */ +/*****************************************************************************/ + +typedef struct _menu_item { + char *label; + WidgetClass *wclass; + char mnemonic; + char *accelerator; + char *accel_text; +#ifdef __cplusplus + void (*callback)(Widget,void*,void*); +#else + void (*callback)(); +#endif + XtPointer callback_data; + struct _menu_item *subitems; +} MenuItem; + +Widget BuildMenu(Widget, int, char *, char, MenuItem *); + +/* mib class numbers */ + +#define MIB_NULL 0 +#define MIB_TEXTBOX 1 +#define MIB_BUTTON 2 +#define MIB_TOGGLE 3 +#define MIB_RADIOBOX 4 +#define MIB_DRAWINGAREA 5 +#define MIB_LABEL 6 +#define MIB_FRAME 7 +#define MIB_SCROLLBAR 8 +#define MIB_TEXTBIG 9 +#define MIB_LIST 10 +#define MIB_SCALE 11 +#define MIB_MENU 12 + +/* number of classes */ +#define MI_NUMCLASSES 12 + +/* for specifying creation of a widget with + default private values, no values at all (empty), + or no values and editable */ + +#define WDEFAULT 1 +#define WEMPTY 2 +#define WEDIT 3 + +/* for specifing whether we are loading an + interface from a file or from a string and whether it + is editable :) */ + +#define MI_FROMFILE 1 +#define MI_EDITFROMFILE 2 +#define MI_FROMSTRING 3 +#define MI_EDITFROMSTRING 4 + +#define MI_MAXSTRLEN 200 /* maximum string length */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibwidgets.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibwidgets.h new file mode 100644 index 00000000000..5d38ec199b8 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_mib/mibwidgets.h @@ -0,0 +1,225 @@ +/* $Id$ */ +/* Copyright (c) 1994 The Geometry Center; University of Minnesota + 1300 South Second Street; Minneapolis, MN 55454, USA; + +This file is free software; you can redistribute it and/or modify it only +under the the terms of the GNU GENERAL PUBLIC LICENSE which should be +included along with this file. This software may be obtained via anonymous +ftp from geom.umn.edu; email: software@geom.umn.edu. */ + +/* Author: Daeron Meyer */ + +/* Structure of mib_TextBox */ +/*****************************************************************************/ + +typedef struct _mib_TextBox { + char *init_contents; /* initial text contents */ + +} mib_TextBox; + +/* mib_TextBox functions */ +/*****************************************************************************/ +mib_Widget *mib_create_TextBox(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_TextBox(mib_Widget *); +void mib_save_TextBox(mib_Widget *, FILE *); +int mib_load_TextBox(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_Button */ +/*****************************************************************************/ + +typedef struct _mib_Button { + char *label; /* label on button */ + +} mib_Button; + +/* mib_Button functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Button(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Button(mib_Widget *); +void mib_save_Button(mib_Widget *, FILE *); +int mib_load_Button(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_Toggle */ +/*****************************************************************************/ + +typedef struct _mib_Toggle { + char *label; /* label on toggle */ + int isize; + +} mib_Toggle; + +/* mib_Toggle functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Toggle(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Toggle(mib_Widget *); +void mib_save_Toggle(mib_Widget *, FILE *); +int mib_load_Toggle(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_RadioBox */ +/*****************************************************************************/ +typedef struct _mib_RadioBox { + char **labels; /* array of labels */ + int numlabel; /* number of labels */ + Widget *buttons; /* pointers to each button */ + +} mib_RadioBox; + +/* mib_RadioBox functions */ + +/*****************************************************************************/ +mib_Widget *mib_create_RadioBox(mib_Widget *, char *, char*, int, int, int, + int, int); +void mib_delete_RadioBox(mib_Widget *); +void mib_save_RadioBox(mib_Widget *, FILE *); +int mib_load_RadioBox(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_DrawingArea */ +/*****************************************************************************/ +typedef struct _mib_DrawingArea { + int nothing; /* couldn't think of anything yet */ + +} mib_DrawingArea; + +/* mib_DrawingArea functions */ +/*****************************************************************************/ +mib_Widget *mib_create_DrawingArea(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_DrawingArea(mib_Widget *); +void mib_save_DrawingArea(mib_Widget *, FILE *); +int mib_load_DrawingArea(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_Label */ +/*****************************************************************************/ +typedef struct _mib_Label { + char *label; /* text in label */ + +} mib_Label; + +/* mib_Label functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Label(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Label(mib_Widget *); +void mib_save_Label(mib_Widget *, FILE *); +int mib_load_Label(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_Frame */ +/*****************************************************************************/ +typedef struct _mib_Frame { + int shadowtype; /* 0 = in, 1 = out, 2 = etched_in, 3 = etched_out */ + +} mib_Frame; + +/* mib_Frame functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Frame(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Frame(mib_Widget *); +void mib_save_Frame(mib_Widget *, FILE *); +int mib_load_Frame(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_ScrollBar */ +/*****************************************************************************/ +typedef struct _mib_ScrollBar { + int orientation; + +} mib_ScrollBar; + +/* mib_ScrollBar functions */ +/*****************************************************************************/ +mib_Widget *mib_create_ScrollBar(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_ScrollBar(mib_Widget *); +void mib_save_ScrollBar(mib_Widget *, FILE *); +int mib_load_ScrollBar(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_TextBig */ +/*****************************************************************************/ +typedef struct _mib_TextBig { + int nothing; /* couldn't think of anything yet */ + +} mib_TextBig; + +/* mib_TextBig functions */ +/*****************************************************************************/ +mib_Widget *mib_create_TextBig(mib_Widget *, char *, char *, int, int, int, int, int); +void mib_delete_TextBig(mib_Widget *); +void mib_save_TextBig(mib_Widget *, FILE *); +int mib_load_TextBig(mib_Widget *, mib_Buffer *); + + +/* Structure of mib_List */ +/*****************************************************************************/ +typedef struct _mib_List { + Widget real_list; + +} mib_List; + +/* mib_List functions */ +/*****************************************************************************/ +mib_Widget *mib_create_List(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_List(mib_Widget *); +void mib_save_List(mib_Widget *, FILE *); +int mib_load_List(mib_Widget *, mib_Buffer *); + +/* Structure of mib_Scale */ +/*****************************************************************************/ +typedef struct _mib_Scale { + int orientation; + +} mib_Scale; + +/* mib_Scale functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Scale(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Scale(mib_Widget *); +void mib_save_Scale(mib_Widget *, FILE *); +int mib_load_Scale(mib_Widget *, mib_Buffer *); + +/* Structure of mib_Menu */ +/*****************************************************************************/ +typedef struct _mib_Menu { + int numitems; /* number of items in menu*/ + MenuItem *my_menu; /* array of menu items */ + Widget *items; /* pointers to each item */ + +} mib_Menu; + +/* mib_Menu functions */ +/*****************************************************************************/ +mib_Widget *mib_create_Menu(mib_Widget *, char *, char *, int, int, int, + int, int); +void mib_delete_Menu(mib_Widget *); +void mib_save_Menu(mib_Widget *, FILE *); +int mib_load_Menu(mib_Widget *, mib_Buffer *); + +/*****************************************************************************/ + +typedef struct _mib_widget_funcs { + char *name; +#ifdef __cplusplus + mib_Widget *(*mib_create)(mib_Widget *parent, char *name, char *label, + int posx, int posy, int width, int height, int mib_fill); + void (*mib_delete)(mib_Widget *thisw); + void (*mib_save)(mib_Widget *thisw, FILE *fout); + int (*mib_load)(mib_Widget *thisw, mib_Buffer *fin); +#else + mib_Widget *(*mib_create)(); + void (*mib_delete)(); + void (*mib_save)(); + int (*mib_load)(); +#endif +} mib_widget_funcs; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.cpp new file mode 100644 index 00000000000..431c582cc2b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.cpp @@ -0,0 +1,167 @@ +// $Id$ + +#include "ace/OS.h" +#include "Audio_Control_State.h" +#include "Audio_Control_i.h" + +ACE_RCSID(mpeg_server, Audio_Control_State, "$Id$") + +Audio_Control_State::Audio_Control_State (void) + :audio_global_ (AUDIO_GLOBAL::instance ()), + audio_control_i_ (AUDIO_CONTROL_I::instance ()) +{ +} + +Audio_Control_State::Audio_States +Audio_Control_State::get_state (void) +{ + return this->state_; +} + +void +Audio_Control_State::set_state (Audio_States state) +{ + this->state_ = state; +} + +CORBA::Boolean +Audio_Control_State::play (const Audio_Control::PLAYPara & para, + CORBA::Long_out ats) +{ + return 0; +} + +CORBA::Boolean +Audio_Control_State::speed (const Audio_Control::SPEEDPara & para) +{ + return 0; +} + +CORBA::Boolean +Audio_Control_State::stop (CORBA::Long cmdsn) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_State::stop ()\n")); + return 1; +} + +void +Audio_Control_State::close (void) +{ + return; +} + +Audio_Control_Waiting_State::Audio_Control_Waiting_State (void) +{ + this->state_ = AUDIO_WAITING; + this->audio_global_->state = Audio_Global::AUDIO_WAITING; +} + +CORBA::Boolean +Audio_Control_Waiting_State::play (const Audio_Control::PLAYPara & para, + CORBA::Long_out ats) +{ + int result; + + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_Waiting_State::play ()\n")); + this->audio_global_->cmd = CmdPLAY; + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) play_audio () called \n")); + + this->audio_global_->nextsample = para.nextSample; + this->audio_global_->cmdsn = para.sn; + this->audio_global_->sps = para.samplesPerSecond; + this->audio_global_->spslimit = para.spslimit; + this->audio_global_->spp = para.samplesPerPacket; + this->audio_global_->addSamples = para.ABsamples / 2; + if (this->audio_global_->spp * this->audio_global_->audioPara.bytesPerSample > this->audio_global_->databuf_size) { + this->audio_global_->spp = this->audio_global_->databuf_size / this->audio_global_->audioPara.bytesPerSample; + } + /* + SFprintf(stderr, "AS got CmdPLAY: sps %d\n", sps); + */ + + fprintf(stderr, "AS: nextSample = %d for PLAY.\n", para.nextSample); + + + this->audio_global_->upp = (int)(1000000.0 / ((double)(this->audio_global_->sps) / (double)(this->audio_global_->spp))); + this->audio_global_->nextTime = get_usec(); + + ats = this->audio_global_->nextTime; // out parameter. + if (this->audio_global_->live_source) { + StartPlayLiveAudio(); + } + + this->audio_global_->hasdata = 1; + this->audio_global_->packets = 0; + + this->audio_global_->send_audio (); + + this->audio_global_->state = Audio_Global::AUDIO_PLAY; + this->audio_control_i_->change_state (AUDIO_CONTROL_PLAY_STATE::instance ()); + return 1; +} + +void +Audio_Control_Waiting_State::close (void) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_Waiting_State::close ()\n")); + this->audio_global_->cmd = CmdCLOSE; + ACE_DEBUG ((LM_DEBUG,"(%P|%t) A session closed\n")); + TAO_ORB_Core_instance ()->orb ()->shutdown (); + return ; +} + +Audio_Control_Play_State::Audio_Control_Play_State (void) +{ + this->state_ = AUDIO_PLAY; +} + +CORBA::Boolean +Audio_Control_Play_State::speed (const Audio_Control::SPEEDPara & para) +{ + this->audio_global_->sps = para.samplesPerSecond; + this->audio_global_->spslimit = para.spslimit; + this->audio_global_->spp = para.samplesPerPacket; + if (this->audio_global_->spp * this->audio_global_->audioPara.bytesPerSample > this->audio_global_->databuf_size) { + this->audio_global_->spp = this->audio_global_->databuf_size / this->audio_global_->audioPara.bytesPerSample; + } + this->audio_global_->delta_sps = 0; /* reset compensation value */ + this->audio_global_->upp = (int)(1000000.0 / ((double)(this->audio_global_->sps) / (double)(this->audio_global_->spp))); + /* + SFprintf(stderr, "AS got CmdSPEED: sps %d\n", sps); + */ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_Play_State::speed ()\n")); + return 1; +} + +CORBA::Boolean +Audio_Control_Play_State::stop (CORBA::Long cmdsn) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_Play_State::stop ()\n")); + if (this->audio_global_->live_source) { + StopPlayLiveAudio(); + } + this->audio_global_->state = Audio_Global::AUDIO_WAITING; + this->audio_control_i_->change_state (AUDIO_CONTROL_WAITING_STATE::instance ()); + return 1; +} + +void +Audio_Control_Play_State::close (void) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Control_Play_State::close ()\n")); + if (this->audio_global_->live_source) { + StopPlayLiveAudio(); + } + // shutdown the ORB + TAO_ORB_Core_instance ()->orb ()->shutdown (); + return; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Audio_Control_Play_State, TAO_SYNCH_MUTEX>; +template class ACE_Singleton<Audio_Control_Waiting_State, TAO_SYNCH_MUTEX>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Audio_Control_Play_State, TAO_SYNCH_MUTEX> +#pragma instantiate ACE_Singleton<Audio_Control_Waiting_State, TAO_SYNCH_MUTEX> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.h new file mode 100644 index 00000000000..173f8897e98 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_State.h @@ -0,0 +1,84 @@ +/* _*_ C++ _*_ */ +// $Id$ + +#ifndef _MPEG_AUDIO_CONTROL_STATE_H +#define _MPEG_AUDIO_CONTROL_STATE_H + +#include "ace/Singleton.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "mpeg_shared/Audio_ControlS.h" +#include "Globals.h" + +class Audio_Control_i; + +class Audio_Control_State +{ +public: + Audio_Control_State (void); + // constructor + + enum Audio_States + { + AUDIO_WAITING =0, + AUDIO_PLAY =1 + }; + + Audio_States get_state (void); + // returns the current state. + + void set_state (Audio_States state); + // sets the state. + + virtual CORBA::Boolean play (const Audio_Control::PLAYPara & para, + CORBA::Long_out ats) ; + + virtual CORBA::Boolean speed (const Audio_Control::SPEEDPara & para) ; + + virtual CORBA::Boolean stop (CORBA::Long cmdsn) ; + + virtual void close (void) ; +protected: + Audio_States state_; + // The state + + Audio_Global *audio_global_; + // Pointer to the global. + Audio_Control_i *audio_control_i_; +}; + + +class Audio_Control_Waiting_State : public virtual Audio_Control_State +{ +public: + Audio_Control_Waiting_State (void); + // Default constructor. + + virtual CORBA::Boolean play (const Audio_Control::PLAYPara ¶, + CORBA::Long_out ats); + + virtual void close (void); +}; + +class Audio_Control_Play_State: public virtual Audio_Control_State +{ +public: + Audio_Control_Play_State (void); + // Default constructor + + virtual CORBA::Boolean speed (const Audio_Control::SPEEDPara & para); + + virtual CORBA::Boolean stop (CORBA::Long cmdsn); + + virtual void close (void); +}; + +typedef ACE_Singleton <Audio_Control_Waiting_State, TAO_SYNCH_MUTEX> + AUDIO_CONTROL_WAITING_STATE; +typedef ACE_Singleton <Audio_Control_Play_State, TAO_SYNCH_MUTEX> + AUDIO_CONTROL_PLAY_STATE; + +#endif /*_MPEG_AUDIO_CONTROL_STATE_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.cpp new file mode 100644 index 00000000000..c5476e5b874 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.cpp @@ -0,0 +1,291 @@ +// $Id$ + +#include "ace/OS.h" +#include "Audio_Control_State.h" +#include "Audio_Control_i.h" + +ACE_RCSID(mpeg_server, Audio_Control_i, "$Id$") + +Audio_Control_i::Audio_Control_i (void) + :audio_global_ (AUDIO_GLOBAL::instance ()), + reactor_ (TAO_ORB_Core_instance ()->reactor ()) +{ +} + +int +Audio_Control_i::create_handlers (void) +{ + ACE_NEW_RETURN (this->data_handler_, + Audio_Data_Handler (this->audio_global_->audioSocket, + this->audio_global_), + -1); + + ACE_NEW_RETURN (this->sig_handler_, + Audio_Sig_Handler (this->audio_global_), + -1); + return 0; +} + +CORBA::Boolean +Audio_Control_i::init_audio (const Audio_Control::INITaudioPara & para, + Audio_Control::INITaudioReply_out reply, + CORBA::Environment &env) + ACE_THROW_SPEC(( CORBA::SystemException )) +{ + int result; + int failureType; /* 0 - can't open file, 1 - can't open live source */ + + int i = 0; + for (i=0 ; i< para.audiofile.length (); i++) + this->audio_global_->audioFile[i] = para.audiofile [i]; + this->audio_global_->audioFile [i] = 0; + + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || para.version != VERSION) + return 0; // failure + + ACE_OS::memcpy (&(this->audio_global_->audioPara), ¶.para, sizeof(this->audio_global_->audioPara)); + /* + fprintf(stderr, "Client Audio para: encode %d, ch %d, sps %d, bps %d.\n", + para.para.encodeType, para.para.channels, + para.para.samplesPerSecond, para.para.bytesPerSample); + */ + { + int len =ACE_OS::strlen (this->audio_global_->audioFile); + if (strncasecmp("LiveAudio", this->audio_global_->audioFile, 9) && + strcasecmp(".au", this->audio_global_->audioFile+len-3)) + { +// ACE_ERROR_RETURN ((LM_ERROR, +// "(%p|%t) Audio_Control_i::init_audio () failed\n"), +// 0); + cerr << "init_audio failed in line " << __LINE__ << endl; + return 0; + + } + } + + ACE_DEBUG ((LM_DEBUG, "(%P|%t)Audio file %s got.\n", this->audio_global_->audioFile)); + + + if (!strncasecmp("LiveAudio", this->audio_global_->audioFile, 9)) + { + // May need to be uncommented for live audio. + // this->audio_global_->fd = OpenLiveAudio(&(para.para)); + if (this->audio_global_->fd == -1) { + failureType = 1; + goto failure; + } + this->audio_global_->fileSize =0x7fffffff; + this->audio_global_->totalSamples = this->audio_global_->fileSize / this->audio_global_->audioPara.bytesPerSample; + this->audio_global_->live_source = 1; + } + else + { + LeaveLiveAudio(); + this->audio_global_->fd = open(this->audio_global_->audioFile, O_RDONLY); + if (this->audio_global_->fd == -1) + { + ACE_ERROR ((LM_ERROR, "AS error on opening audio file %s,%p", this->audio_global_->audioFile)); + failureType = 0; + goto failure; + } + + /* Try to get this->audio_global_->audioFile format this->audio_global_->audioPara here */ + + /* figure out this->audio_global_->totalSamples */ + this->audio_global_->fileSize = lseek(this->audio_global_->fd, 0L, SEEK_END); + lseek(this->audio_global_->fd, 0L, SEEK_SET); + this->audio_global_->totalSamples = this->audio_global_->fileSize / this->audio_global_->audioPara.bytesPerSample; + + fprintf(stderr, "Total Samples=%d in audio file %ss.\n", this->audio_global_->totalSamples, this->audio_global_->audioFile); + + } + + reply.para.encodeType = this->audio_global_->audioPara.encodeType; + reply.para.channels = this->audio_global_->audioPara.channels; + reply.para.samplesPerSecond = this->audio_global_->audioPara.samplesPerSecond; + reply.para.bytesPerSample = this->audio_global_->audioPara.bytesPerSample; + reply.totalSamples = this->audio_global_->totalSamples; + + reply.live = this->audio_global_->live_source; + reply.format = AUDIO_RAW; + + return 1; + failure: + { + + fprintf(stderr, "AS error: failed initializing audio file.\n"); + + return 0; + } + +} + + +CORBA::Boolean +Audio_Control_i::play (const Audio_Control::PLAYPara & para, + CORBA::Long_out ats, + CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException )) + +{ + return this->state_->play (para,ats); +} + +CORBA::Boolean +Audio_Control_i::speed (const Audio_Control::SPEEDPara & para, + CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException )) + +{ + return this->state_->speed (para); +} + +CORBA::Boolean +Audio_Control_i::stop (CORBA::Long cmdsn, + CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->stop (cmdsn); +} + +CORBA::Boolean +Audio_Control_i::set_peer (char *&peer, + CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + char* peer_addr_str = new char [BUFSIZ]; + ACE_OS::strcpy (peer_addr_str,peer); + ACE_OS::strtok_r (peer_addr_str, "=", &peer_addr_str); + + char *delim = ACE_OS::strchr (peer_addr_str, ';'); + + *delim = ':'; + + /* + char peer_addr [BUFSIZ]; + + ACE_OS::sprintf (peer_addr, + "%s:%s", + ACE_OS::strtok (peer_addr_str, ";"), + ACE_OS::strtok (0, ";") + ); + + */ + + ACE_INET_Addr client_data_addr (peer_addr_str); + // Data (UDP) Address of the client. + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) set_peer called: %s,%s,%d\n", + peer, + client_data_addr.get_host_addr (), + client_data_addr.get_port_number ())); + + + if (this->dgram_.open (client_data_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) UDP open failed: %p\n"), + -1); + + ACE_INET_Addr server_data_addr; + // Data (UDP) Address of this server. + + if (this->dgram_.get_local_addr + (server_data_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) UDP get_local_addr failed: %p\n"), + -1); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Audio_Server: My UDP port number is %d\n", + server_data_addr.get_port_number ())); + + this->audio_global_->audioSocket = this->dgram_.get_handle (); + this->create_handlers () ; // very important. + if (this->register_handlers () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Audio_Control_i::set_peer: register_handlers failed\n"), + -1); + + ACE_DEBUG ((LM_DEBUG,"(%P|%t) set_peer: server port = %d\n",server_data_addr.get_port_number ())); + ACE_NEW_RETURN (peer, + char [BUFSIZ], + 0); + server_data_addr.set (server_data_addr.get_port_number (), + server_data_addr.get_host_name ()); + server_data_addr.addr_to_string (peer, + BUFSIZ); + + + return 1; +} + +void +Audio_Control_i::close (CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + this->state_->close (); + return; +} + +int +Audio_Control_i::register_handlers (void) +{ + int result; + + // change the state of audio control to be waiting state + this->change_state (AUDIO_CONTROL_WAITING_STATE::instance ()); + + // Register the event handlers with the Reactor + // first the data handler, i.e. UDP + result = this->reactor_->register_handler (this->data_handler_, + ACE_Event_Handler::READ_MASK); + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for data_handler failed\n"), + -1); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) registered this->audio_global_->fd for data handler = (%d)\n", + this->data_handler_->get_handle ())); + + // finally, the signal handler, for periodic transmission + // of packets + result = this->sig_handler_->register_handler (); + + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for sig_handler" + "failed!\n"), + -1); + + return 0; +} + +void +Audio_Control_i::change_state (Audio_Control_State *state) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Audio_Control_i::Changing to state %d\n", + state->get_state ())); + this->state_ = state; +} + +// Returns the current state object . +Audio_Control_State * +Audio_Control_i::get_state (void) +{ + return this->state_; +} + +Audio_Control_i::~Audio_Control_i () +{ + delete this->data_handler_; + delete this->sig_handler_; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Audio_Control_i, ACE_Null_Mutex>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Audio_Control_i, ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.h new file mode 100644 index 00000000000..28723bab228 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.h @@ -0,0 +1,86 @@ +/* _*_ C++ _*_ */ +//$Id$ + +#ifndef _AV_AUDIO_CONTROL_H +#define _AV_AUDIO_CONTROL_H + +#include "mpeg_shared/Audio_ControlS.h" +#include "Globals.h" +#include "Audio_Server.h" + +class Audio_Control_State; + +class Audio_Control_i + :public virtual POA_Audio_Control +{ +public: + Audio_Control_i (void); + // Default Constructor + + ~Audio_Control_i (void); + // Default destructor + + int create_handlers (void); + // creates the data and sig handlers. + + virtual CORBA::Boolean init_audio ( + const Audio_Control::INITaudioPara & para, + Audio_Control::INITaudioReply_out reply_para, + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + virtual CORBA::Boolean play ( + const Audio_Control::PLAYPara & para, + CORBA::Long_out ats, + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + virtual CORBA::Boolean speed ( + const Audio_Control::SPEEDPara & para, + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + virtual CORBA::Boolean stop ( + CORBA::Long cmdsn, + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + virtual CORBA::Boolean set_peer ( + char *&peer, + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + virtual void close ( + CORBA::Environment &_tao_environment + ) + ACE_THROW_SPEC (( CORBA::SystemException )); + + void change_state (Audio_Control_State *state); + // Changes the state of the Audio Control object. + + Audio_Control_State *get_state (void); + // gets the state. +private: + int register_handlers (void); + + ACE_Reactor *reactor_; + + Audio_Control_State *state_; + + Audio_Data_Handler *data_handler_; + + Audio_Sig_Handler *sig_handler_; + + ACE_SOCK_CODgram dgram_; + + Audio_Global *audio_global_; +}; + +typedef ACE_Singleton <Audio_Control_i,ACE_Null_Mutex> AUDIO_CONTROL_I; + +#endif /*_AV_AUDIO_CONTROL_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.cpp new file mode 100644 index 00000000000..54d583d254a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.cpp @@ -0,0 +1,314 @@ +// $Id$ + +#include "ace/OS.h" +#include "Audio_Server.h" +#include "Audio_Control_i.h" +#include "Audio_Control_State.h" + +ACE_RCSID(mpeg_server, Audio_Server, "$Id$") + +//---------------------------------------- +// Audio_Sig_Handler methods. + +Audio_Sig_Handler::Audio_Sig_Handler (Audio_Global *audio_global) + :audio_global_ (audio_global) +{ +} + +int +Audio_Sig_Handler::register_handler (void) +{ + // Assign the Sig_Handler a dummy I/O descriptor. Note that even + // though we open this file "Write Only" we still need to use the + // ACE_Event_Handler::NULL_MASK when registering this with the + // ACE_Reactor (see below). + this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); + ACE_ASSERT (this->handle_ != -1); + + // Register signal handler object. Note that NULL_MASK is used to + // keep the ACE_Reactor from calling us back on the "/dev/null" + // descriptor. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this, ACE_Event_Handler::NULL_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + + // Create a sigset_t corresponding to the signals we want to catch. + ACE_Sig_Set sig_set; + + // sig_set.sig_add (SIGINT); + // sig_set.sig_add (SIGQUIT); + sig_set.sig_add (SIGALRM); + + // Register the signal handler object to catch the signals. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler (sig_set, + this) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + return 0; +} +// Called by the ACE_Reactor to extract the fd. + +ACE_HANDLE +Audio_Sig_Handler::get_handle (void) const +{ + return this->handle_; +} + +int +Audio_Sig_Handler::handle_input (ACE_HANDLE) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n")); + return 0; +} + +int +Audio_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n")); + return 0; +} + +// This method handles all the signals that are being caught by this +// object. In our simple example, we are simply catching SIGALRM, +// SIGINT, and SIGQUIT. Anything else is logged and ignored. +// +// There are several advantages to using this approach. First, +// the behavior triggered by the signal is handled in the main event +// loop, rather than in the signal handler. Second, the ACE_Reactor's +// signal handling mechanism eliminates the need to use global signal +// handler functions and data. + +int +Audio_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) +{ + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum)); + + switch (signum) + { + case SIGALRM: + if (this->audio_global_->state == Audio_Global::AUDIO_PLAY) + this->audio_global_->send_audio ();// honor the signal only if you're in play state. + break; + default: + ACE_DEBUG ((LM_DEBUG, + "(%t) %S: not handled, returning to program\n", + signum)); + break; + } + // ACE_DEBUG ((LM_DEBUG,"returning from handle_signal")); + return 0; +} + +//---------------------------------------------- +// Audio_Data_Handler methods + +Audio_Data_Handler::Audio_Data_Handler (ACE_HANDLE data_fd, + Audio_Global *audio_global) + :data_fd_ (data_fd), + audio_global_ (audio_global) +{ +} + +ACE_HANDLE +Audio_Data_Handler::get_handle (void) const +{ + return this->data_fd_; +} + +int +Audio_Data_Handler::handle_input (ACE_HANDLE fd) +{ + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Data_Handler::handle_input ()\n")); + int bytes, len; + for (;;) { + if (this->audio_global_->conn_tag >= 0) { + len = wait_read_bytes(this->audio_global_->audioSocket, (char *)this->audio_global_->fbpara, sizeof(*(this->audio_global_->fbpara))); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read1 FB"); + return(-1); + } + } + else { /* discard mode packet stream, read the whole packet */ + len = ::read(this->audio_global_->audioSocket, (char *)this->audio_global_->fbpara, FBBUF_SIZE); + } + if (len == -1) { + if (errno == EINTR) continue; /* interrupt */ + else { + if (errno != EPIPE && errno != ECONNRESET)ACE_OS::perror ("AS failed to ACE_OS::read () fbmsg header"); + break; + } + } + break; + } + //~~ check for end of file. + if (len == 0) + { + ACE_DEBUG ((LM_DEBUG,"(%P|%t)End of file while reading feedback packedt\n")); + TAO_ORB_Core_instance ()->reactor ()->end_event_loop (); + return 0; + } + + if (len < sizeof(*this->audio_global_->fbpara)) { + if (len > 0) fprintf(stderr, + "AS warn ACE_OS::read () len %dB < sizeof(*this->audio_global_->fbpara) %dB\n", + len, sizeof(*this->audio_global_->fbpara)); + // continue; + // simulate the continue ?? + this->audio_global_->send_audio (); + } +#ifdef NeedByteOrderConversion + this->audio_global_->fbpara->type = ntohl(this->audio_global_->fbpara->type); +#endif + bytes = (this->audio_global_->fbpara->type > 0) ? + sizeof(APdescriptor) * (this->audio_global_->fbpara->type - 1) : + 0; + if (bytes > 0) { + if (this->audio_global_->conn_tag >= 0) { /* not discard mode packet stream, + read the rest of packet */ + len = wait_read_bytes(this->audio_global_->audioSocket, + ((char *)this->audio_global_->fbpara) + sizeof(*this->audio_global_->fbpara), + bytes); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read2 FB"); + return(-1); + } + len += sizeof(*this->audio_global_->fbpara); + } + } + bytes += sizeof(*this->audio_global_->fbpara); + if (len < bytes) { + if (len > 0) fprintf(stderr, + "AS only read partial FBpacket, %dB out of %dB.\n", + len, bytes); + // continue; + this->audio_global_->send_audio (); + } + if (this->audio_global_->live_source) { /* ignore all feedback messags for live source */ + // continue; + this->audio_global_->send_audio (); + } + +#ifdef NeedByteOrderConversion + this->audio_global_->fbpara->cmdsn = ntohl(this->audio_global_->fbpara->cmdsn); +#endif + if (len != sizeof(*this->audio_global_->fbpara) + + (this->audio_global_->fbpara->type ? (this->audio_global_->fbpara->type -1) * sizeof(APdescriptor) : 0)) { + /* unknown message, discard */ + SFprintf(stderr, "AS Unkown fb msg: len = %d, type = %d\n", + len, this->audio_global_->fbpara->type); + // continue; + this->audio_global_->send_audio (); + } + if (this->audio_global_->fbpara->cmdsn != this->audio_global_->cmdsn) { /* discard the outdated message */ + // continue; + this->audio_global_->send_audio (); + } +#ifdef NeedByteOrderConversion + { + int i, * ptr = (int *)this->audio_global_->fbpara + 2; + for (i = 0; i < (len >> 2) - 2; i++) *ptr = ntohl(*ptr); + } +#endif + if (this->audio_global_->fbpara->type == 0) { /* feedback message */ + /* + SFprintf(stderr, "AS got fbmsg: addsamples %d, addsps %d\n", + this->audio_global_->fbpara->data.fb.addSamples, this->audio_global_->fbpara->data.fb.addsps); + */ + this->audio_global_->addSamples += this->audio_global_->fbpara->data.fb.addSamples; + if (this->audio_global_->fbpara->data.fb.addsps) { + this->audio_global_->delta_sps += this->audio_global_->fbpara->data.fb.addsps; + this->audio_global_->upp = (int)(1000000.0 / ((double)(this->audio_global_->sps + this->audio_global_->delta_sps) / (double)this->audio_global_->spp)); + } + } + else { /* resend requests */ + APdescriptor * req = &(this->audio_global_->fbpara->data.ap); + int i; + /* + SFprintf(stderr, "AS got %d resend reqs\n", this->audio_global_->fbpara->type); + */ + for (i = 0; i < this->audio_global_->fbpara->type; i ++) { + this->audio_global_->ResendPacket(req->firstSample, req->samples); + req ++; + } + } + // send a audio frame.?? + this->audio_global_->send_audio (); + return 0; +} + +// Audio_Server_StreamEndPoint methods. + +int +Audio_Server_StreamEndPoint::handle_open (void) +{ + return 0; +} + +int +Audio_Server_StreamEndPoint::handle_close (void) +{ + // called when streamendpoint is being destructed + return 0; +} + +int +Audio_Server_StreamEndPoint::handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +int +Audio_Server_StreamEndPoint::handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +int +Audio_Server_StreamEndPoint::handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +CORBA::Boolean +Audio_Server_StreamEndPoint::handle_connection_requested (AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Server_StreamEndPoint::handle_connection_requested:() %s \n", + the_spec[0])); + + char *server_string; + + server_string = CORBA::string_dup ((const char *) the_spec [0]); + CORBA::Boolean result; + result = AUDIO_CONTROL_I::instance ()->set_peer (server_string,env); + // Get media control from my vdev and call set_peer on that. + + char server_addr [BUFSIZ]; + + ACE_OS::sprintf (server_addr, + "%s=%s", + "TCP", + server_string); + + TAO_Reverse_FlowSpec_Entry server_entry ("audio", + "OUT", + "MIME:audio/au", + "TCP", + server_addr); + + the_spec.length (1); + the_spec [0]=server_entry.entry_to_string (); + + return result; +} + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h new file mode 100644 index 00000000000..17afff26e58 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h @@ -0,0 +1,121 @@ +/* -*- C++ -*- */ +//$Id$ + +#ifndef _AUDIO_SERVER_H +#define _AUDIO_SERVER_H + +#include <sys/types.h> +#include <netdb.h> +#include <string.h> +#include <stdlib.h> + +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <arpa/inet.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <time.h> +#include <sys/time.h> +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include "include/common.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "server_proto.h" + +#include "ace/SOCK_CODgram.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/SOCK_Stream.h" +#include "tao/PortableServer/ORB_Manager.h" +#include "mpeg_shared/Audio_ControlS.h" +#include "orbsvcs/CosNamingC.h" +#include "Globals.h" + +class Audio_Sig_Handler + : public virtual ACE_Event_Handler +{ + // = TITLE + // Defines the signal handler for the audio process. +public: + Audio_Sig_Handler (Audio_Global *audio_global); + // Constructor. + + virtual ACE_HANDLE get_handle (void) const; + + int register_handler (void); + // this will register this sig_handler + // with the reactor for SIGALRM + + virtual int shutdown (ACE_HANDLE, + ACE_Reactor_Mask); + + virtual int handle_input (ACE_HANDLE); + + virtual int handle_signal (ACE_HANDLE signum, + siginfo_t * = 0, + ucontext_t* = 0); +private: + ACE_HANDLE handle_; + // my handle + Audio_Global *audio_global_; +}; + +class Audio_Data_Handler : public virtual ACE_Event_Handler +{ +public: + Audio_Data_Handler (ACE_HANDLE data_fd, + Audio_Global *audio_global); + + // Constructor + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // Called when data shows up. + + virtual ACE_HANDLE get_handle (void) const; + // Get the handle used by this event handler + +private: + ACE_HANDLE data_fd_; + Audio_Global *audio_global_; +}; + +// The stream endpoint +class Audio_Server_StreamEndPoint : + public virtual TAO_Server_StreamEndPoint +{ +public: + virtual int handle_open (void) ; + // called when streamendpoint is instantiated + + virtual int handle_close (void) ; + // called when streamendpoint is being destructed + + virtual int handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + virtual int handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + + virtual int handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + +private: + ACE_SOCK_CODgram dgram_; +}; + +#endif /*_AUDIO_SERVER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.cpp new file mode 100644 index 00000000000..7f792d32392 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.cpp @@ -0,0 +1,2958 @@ +// $Id$ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include "Globals.h" + +ACE_RCSID(mpeg_server, Globals, "$Id$") + +int Mpeg_Global::parentpid = -1; +int Mpeg_Global::listenSocketIn = -1; +int Mpeg_Global::listenSocketUn = -1; +struct linger Mpeg_Global::linger = {1,1}; +int Mpeg_Global::live_audio = 0; +int Mpeg_Global::live_video = 0; /* 0 - no, 1 - to open, 2 - opened */ +int Mpeg_Global::drift_ppm = 0; /* clock drift in ppm */ +int Mpeg_Global::session_limit = SESSION_NUM; +int Mpeg_Global::session_num = 0; +int Mpeg_Global::rttag = 0; + +int Video_Timer_Global::timerHeader = 0; +int Video_Timer_Global::timerGroup = 0; +int Video_Timer_Global::timerFrame = 0; +int Video_Timer_Global::timerOn = 0; +int Video_Timer_Global::timerAdjust = 0; +int Video_Timer_Global::preTimerVal = 0; + +// Initialize the nasty int's, doubles and their friends. + +Video_Global::Video_Global (void) +{ + data_host = 0; + live_source = 0; + video_format = 0; + + pkts_sent = 0; + start_time = 0; + + conn_tag = -1; + + normalExit = 1; + + serviceSocket = 0; + videoSocket = -1; + + ACE_OS::memset (videoFile, + 0, + PATH_SIZE); + fp = 0; + + needHeader = 0; + + lastRef [0] = lastRef [1] = 0; + + lastRefPtr = 0; + currentUPF = 0; + addedUPF = 0; + addedSignals = 0; + VStimeAdvance = 0; + fps = 0; /* current frames-per-second: playback speed */ + frameRateLimit = 0; + + packet = 0; + packetBufSize = 0; + msgsn = 0; + packetsn = 0; + msgsize = 0; + + precmd = 0; + cmd = 0; + cmdsn = 0; + nextFrame = 0; + nextGroup = 0; + firstPatternSize = 0; + firstSendPattern = 0; + sendPatternGops = 0; + ACE_OS::memset (sendPattern, + 0, + PATTERN_SIZE); + +#ifdef STAT + framesSent = 0; +#endif /* STAT */ + + fileSize = 0; + maxS = 0; + maxG = 0; + maxI = 0; + maxP = 0; + maxB = 0; + minS = 0x7fffffff; + minG = 0x7fffffff; + minI = 0x7fffffff; + minP = 0x7fffffff; + minB = 0x7fffffff; + + numS = 0; + numG = 0; + numF = 0; + numI = 0; + numP = 0; + numB = 0; + + averageFrameSize = 0; + horizontalSize = 0; + verticalSize = 0; + pelAspectRatio = 0; + pictureRate = 0; + vbvBufferSize = 0; + firstGopFrames = 0; + patternSize = 0; + + ACE_OS::memset (pattern, + 0, + PATTERN_SIZE); + + // struct pointers + systemHeader = 0; + + gopTable = 0; + + frameTable = 0; + + // playvideo local vars + + preGroup = -1; + preHeader = -1; + preFrame = -1; + + fast_preGroup = -1; + fast_preHeader= -1; +} + +int +Video_Global::FBread (char *buf, int size) +{ + int res; + + while ((res = (this->conn_tag >= 0 ? wait_read_bytes (this->videoSocket, buf, size) : + read (this->videoSocket, buf, size))) == -1) + { + if (errno == EINTR) {errno = 0; continue; } + if (errno == EPIPE || errno == ECONNRESET) exit (0); + perror ("VS reads Feedback this->packet"); + return -1; + } + + if (res < size) + { + if (res) + // @@ Can you please convert the printfs() and perrors to use + // the appropriate ACE_DEBUG and ACE_ERROR macros? + fprintf (stderr, "VS warn: FBread () res %dB < size %dB\n", res, size); + return -1; + } + return 0; +} + +// send a given this->packet pointed by 'this->packet' to the network. + +int +Video_Global::first_packet_send_to_network (int timeToUse) +{ + int count = 0; + VideoMessage * msghd = (VideoMessage *) (((char *) this->packet) - sizeof (VideoMessage)); + int sent = 0; + int packetSize = ntohl (this->packet->dataBytes); + + msghd->packetsn = htonl (this->packetsn ++); + msghd->packetSize = htonl (packetSize + sizeof (* this->packet)); + + fprintf (stderr, "VS to send FIRST pkt %d of size %d.\n", + ntohl (msghd->packetsn), ntohl (msghd->packetSize)); + + + { + VideoMessage * msg = NULL; + int size = packetSize + sizeof (* this->packet); /* msghd->this->packetSize */ + int offset = 0; + int targetTime; + + if (size > this->msgsize) + { + if (!timeToUse) + { + timeToUse = (this->msgsize + sizeof (*msg) + 28) * 2; + /* + set the max network as 500KB. + 28 - UDP header size + */ + /* + fprintf (stderr, "computed timeToUse %d. ", timeToUse); + */ + } + else + { + timeToUse = (timeToUse * 7) >> 3; + /* + fprintf (stderr, "preset timeToUse %d.", timeToUse); + */ + timeToUse /= (size + this->msgsize - 1) / this->msgsize; + timeToUse = min (timeToUse, (this->msgsize + sizeof (*msg) + 28) * 100); + /* limit min network bandwidth = 10K */ + } + + } + while (size > 0) + { + int segsize, sentsize; + int resent = 0; + + if (msg == NULL) + { /* first message for current this->packet + */ + count = 0; + msg = msghd; + targetTime = get_usec (); + } + else { +#if 0 + /* the select () is not precise enough for being used here*/ + int sleepTime; + targetTime += timeToUse; + sleepTime = get_duration (get_usec (), targetTime); + if (sleepTime >= 5000) { /* resolution of timer is 10,000 usec */ + usleep (sleepTime); /* not first message, wait for a while */ + } +#endif + /* + count ++; + if (! (count % 10)) usleep (10000); + */ + msg = (VideoMessage *) ((char *)msg + this->msgsize); + memcpy ((char *)msg, (char *)msghd, sizeof (* msg)); + } + + msg->msgsn = htonl (this->msgsn++); + msg->msgOffset = htonl (offset); + msg->msgSize = htonl (min (size, this->msgsize)); + // send the header seperately first + segsize = sizeof (*msg); + // ACE_DEBUG ((LM_DEBUG, + // "(%P|%t) Sending the header, of size %d\n", + // segsize)); + + while (write (this->videoSocket, + (char *)msg, + segsize) == -1) + { + if (errno == EINTR) + continue; + if (errno == ENOBUFS) { + if (resent) { + perror ("Warning, pkt discarded because"); + sent = -1; + break; + } + else { + resent = 1; + perror ("VS to sleep 5ms"); + usleep (5000); + continue; + } + } + if (errno != EPIPE) { + fprintf (stderr, "VS error on send this->packet %d of size %d ", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + perror (""); + } + exit (errno != EPIPE); + } + + + // segsize = min (size, this->msgsize)+sizeof (*msg); + segsize = min (size, this->msgsize); + + if (this->conn_tag != 0) { /* this->packet stream */ + // cerr << "vs sending " << segsize << " on fd = " << this->videoSocket << endl; + // ACE_DEBUG ((LM_DEBUG,"packetsn = %d,msgsn = %d\n", + // msg->packetsn,msg->msgsn)); + + while ((sentsize = write (this->videoSocket, + (char *)msg + sizeof (*msg), + segsize)) == -1) { + if (errno == EINTR) + continue; + if (errno == ENOBUFS) { + if (resent) { + perror ("Warning, pkt discarded because"); + sent = -1; + break; + } + else { + resent = 1; + perror ("VS to sleep 5ms"); + usleep (5000); + continue; + } + } + if (errno != EPIPE) { + fprintf (stderr, "VS error on send this->packet %d of size %d ", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + perror (""); + } + exit (errno != EPIPE); + } + } + else { + sentsize = wait_write_bytes (this->videoSocket, (char *)msg, segsize); + if (sentsize == -1) { + if (errno != EPIPE) { + fprintf (stderr, "VS error on send this->packet %d of size %d ", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + perror (""); + } + exit (errno != EPIPE); + } + } + if (sentsize < segsize) { + SFprintf (stderr, "VS warning: message size %dB, sent only %dB\n", + segsize, sentsize); + } + if (sent == -1) + break; + /* + fprintf (stderr, "VS: message %d of size %d sent.\n", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + */ + size -= this->msgsize; + offset += this->msgsize; + } + } + + fprintf (stderr, "sent = %d\n", sent); + + if (!sent) this->pkts_sent ++; + return sent; +} + +/* + * send a this->packet with given this->systemHeader (optional), gop (optional) and frame. + * + * sh - system header id, if -1, then no system header will be sent. + * otherwise, only when frame == 0, the given system header will be sent. + * gop - group of pictures, gop header will be sent when frame == 0 + * (first I frame ); + * frame - frame to be sent, offset internal to given gop. + */ + +/* returns: 0 - this->packet sent, -1 - this->packet not sent (failed) */ + +int +Video_Global::SendPacket (int shtag, + int gop, + int frame, + int timeToUse, + int first_time) +/* frame maybe out of range (PLAY, STEP), in this case, END_SEQ is sent + to force display of last frame in VD */ +{ + char * buf = ((char *) this->packet) + sizeof (VideoPacket); + int f = this->gopTable[gop].previousFrames + frame; + int sh = this->gopTable[gop].systemHeader; + /* + SFprintf (stderr, "VS to send this->packet gop-%d, frame-%d.\n", gop, frame); + */ + + this->packet->currentUPF = ntohl (this->currentUPF); + + if (frame >= this->gopTable[gop].totalFrames) + { + this->packet->cmd = htonl (this->cmd); + this->packet->cmdsn = htonl (this->cmdsn); + this->packet->sh = htonl (sh); + this->packet->gop = htonl (gop); + this->packet->frame = htonl (this->numF); + this->packet->display = htonl (this->numF-1); + this->packet->future = htonl ((unsigned)-1); + this->packet->past = htonl ((unsigned)-1); + this->packet->dataBytes = htonl (4); + * (int*) ((char*)this->packet + sizeof (*this->packet)) = htonl (SEQ_END_CODE); + + return send_to_network (timeToUse); + } + + if (frame) + shtag = 0; + else if (this->needHeader) + { + shtag = 1; + this->needHeader = 0; + } + + this->packet->cmd = htonl (this->cmd); + this->packet->cmdsn = htonl (this->cmdsn); + this->packet->sh = htonl (sh); + this->packet->gop = htonl (gop); + this->packet->frame = htonl (f); + if (this->frameTable[f].type == 'B') + { + int pre1 = -1, pre2 = -1, i = f; + while (i>0) + if (this->frameTable[--i].type != 'B') + { + pre1 = i; + break; + } + while (i>0) + if (this->frameTable[--i].type != 'B') + { + pre2 = i; + break; + } + if (pre2 == -1) + { + /* + fprintf (stderr, + "frame %d-%d (%d) is a B without past ref, no to be sent.\n", + gop, frame, f); + */ + return -1; + } + if (pre1 != this->lastRef[this->lastRefPtr] || + pre2 != this->lastRef[1 - this->lastRefPtr]) + { + /* + fprintf (stderr, + "send of B frame %d gaveup for past %d/future %d ref not sent.\n", + f, pre2, pre1); + */ + return -1; + } + this->packet->display = htonl (f); + this->packet->future = htonl (pre1); + this->packet->past = htonl (pre2); + } + else + { + int next = f; + int pre = f; + + while (next < this->numF && this->frameTable[++next].type == 'B'); + while (pre > 0 && this->frameTable[--pre].type == 'B'); + if (this->frameTable[f].type == 'P' && pre != this->lastRef[this->lastRefPtr]) + { + /* + fprintf (stderr, + "send of P frame %d gaveup for past ref %d not sent.\n", + f, pre); + fprintf (stderr, "ref0=%d, ref1=%d, ptr=%d.\n", + this->lastRef[0], this->lastRef[1], this->lastRefPtr); + */ + return -1; + } + this->packet->display = htonl (next); + this->packet->future = htonl ((unsigned)-1); + this->packet->past = htonl (this->frameTable[f].type == 'P' ? pre : (unsigned)-1); + } + { + char * ptr = buf; + int size = 0, offset = 0, i; + if (shtag) /* send system header */ + { + size = this->systemHeader[sh].size; + FileRead (this->systemHeader[sh].offset, ptr, size); + ptr += size; + } + if (!frame) /* send gop header */ + { + size = this->gopTable[gop].headerSize; + FileRead (this->gopTable[gop].offset, ptr, size); + ptr += size; + } + size = this->frameTable[f].size; + for (i=this->gopTable[gop].previousFrames; i<f; i++) + offset += this->frameTable[i].size; + FileRead ((this->gopTable[gop].firstIoffset + offset), ptr, size); + ptr += size; + this->packet->dataBytes = htonl (ptr - buf); + } + + { + int sent; + if (first_time == 1) + { + // ACE_DEBUG ((LM_DEBUG, + // "(%P|%t) Sending first frame to client\n")); + sent = first_packet_send_to_network (timeToUse); + } + else + sent = send_to_network (timeToUse); + if (!sent) + { + /* + fprintf (stderr, "%c%d\n", this->frameTable[f].type, f); + fprintf (stderr, "%c frame %d sent.\n", this->frameTable[f].type, f); + */ + if (this->frameTable[f].type != 'B') + { + this->lastRefPtr = 1 - this->lastRefPtr; + this->lastRef[this->lastRefPtr] = f; + } + } + return sent; + } +} + +int +Video_Global::CmdRead (char *buf, int psize) +{ + int res = wait_read_bytes (this->serviceSocket, + buf, + psize); + if (res == 0) return (1); + if (res == -1) { + fprintf (stderr, "VS error on read this->cmdSocket, size %d", psize); + perror (""); + return (-1); + } + return 0; +} + +int +Video_Global::CmdWrite (char *buf, int size) +{ + int res = wait_write_bytes (this->serviceSocket, buf, size); + if (res == -1) { + if (errno != EPIPE) perror ("VS writes to this->serviceSocket"); + return (-1); + } + return 0; +} + +int +Video_Global::PLAYliveVideo (PLAYpara * para) +{ + int doscale; + int count; + int first_frame; + int frame = para->nextFrame; + int nfds = (this->serviceSocket > this->videoSocket ? this->serviceSocket : this->videoSocket) + 1; + fd_set read_mask; + struct timeval tval = {0, 0}; + double ratio; + int result; + + this->currentUPF = (int) (1000000.0 / this->fps); /* ignore para.usecPerFrame */ + if (this->frameRateLimit < this->fps) { + doscale = 1; + ratio = min (this->frameRateLimit, this->fps) / this->fps; + first_frame = frame; + count = 0; + /* + fprintf (stderr, "doscale %d, this->frameRateLimit %5.2f, this->fps %5.2f, ratio %5.2f\n", + doscale, this->frameRateLimit, this->fps, ratio); + */ + } + else doscale = 0; + StartPlayLiveVideo (); + + for (;;) { + + if (doscale) { + for (;;) { + if ((int) ((frame - first_frame) * ratio + 0.5) < count) frame ++; + else break; + } + count ++; + } + SendPicture (&frame); + frame ++; + + FD_ZERO (&read_mask); + FD_SET (this->serviceSocket, &read_mask); + FD_SET (this->videoSocket, &read_mask); + + // @@ Is this code actually used anymore, i.e., do we need to + // ACE-ify it? + +#ifdef _HPUX_SOURCE + if (select (nfds, (int *)&read_mask, NULL, NULL, &tval) == -1) +#else + if (select (nfds, &read_mask, NULL, NULL, &tval) == -1) +#endif + { + if (errno == EINTR) + continue; + perror ("Error - VS select between service and video sockets"); + StopPlayLiveVideo (); + exit (1); + + } + if (FD_ISSET (this->serviceSocket, &read_mask)) /* stop */ + { + u_char tmp; + result = CmdRead ((char *)&tmp, 1); + if (result != 0) + return result; + if (tmp == CmdCLOSE) { + StopPlayLiveVideo (); + exit (0); + } + else if (tmp == CmdSTOP) { + this->cmd = tmp; + /* + fprintf (stderr, "VS: this->CmdSTOP. . .\n"); + */ + result = CmdRead ((char *)&this->cmdsn, sizeof (int)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + this->cmdsn = ntohl (this->cmdsn); +#endif + StopPlayLiveVideo (); + break; + } + else if (tmp == CmdSPEED) + { + SPEEDpara speed_para; + /* + fprintf (stderr, "VS: this->CmdSPEED. . .\n"); + */ + result = CmdRead ((char *)&speed_para, sizeof (speed_para)); + if (result != 0) + return result; + /* ignore this thing for live video */ + } + else + { + fprintf (stderr, "VS error (live): this->cmd=%d while expect STOP/SPEED.\n", tmp); + this->normalExit = 0; + StopPlayLiveVideo (); + exit (1); + } + } + if (FD_ISSET (this->videoSocket, &read_mask)) /* feedback, only for frame rate + adjustment */ + { + VideoFeedBackPara fb_para; + if (FBread ((char *)&fb_para, sizeof (fb_para)) == -1 || + ntohl (fb_para.cmdsn) != this->cmdsn) { + /* + SFprintf (stderr, "VS warning: a FB this->packet discarded.\n"); + */ + return 0; + } +#ifdef NeedByteOrderConversion + fb_para.frameRateLimit1000 = ntohl (fb_para.frameRateLimit1000); +#endif + this->frameRateLimit = fb_para.frameRateLimit1000 / 1000.0; + if (this->frameRateLimit < this->fps) { + doscale = 1; + ratio = min (this->frameRateLimit, this->fps) / this->fps; + first_frame = frame; + count = 0; + /* + fprintf (stderr, "doscale %d, this->frameRateLimit %5.2f, this->fps %5.2f, ratio %5.2f\n", + doscale, this->frameRateLimit, this->fps, ratio); + */ + } + else doscale = 0; + } + } + return 0; +} + +void +Video_Global::ComputeFirstSendPattern (float limit) +{ + char * buf = this->firstSendPattern; + int len = this->firstPatternSize; + char * pat = (char *)ACE_OS::malloc (len); + int f; + + if (pat == NULL) { + fprintf (stderr, "VS error on allocating %d bytes for computing first SP", len); + perror (""); + exit (1); + } + for (f = 0; f < len; f ++) { + pat[f] = this->frameTable[f].type; + } + memset (buf, 0, len); + + if (limit <= 0) + limit = 1.0; + + f = (int) ((double)len * + ((double)limit / (1000000.0 / (double)this->currentUPF)) + 0.5); + /* rounded to integer, instead of truncated */ + if (f >= len) + f = len; + else if (f <= 1) + f = 1; + + ComputeSendPattern (pat, buf, len, f); + + /* + f = len - f; + fprintf (stderr, "FirstSendPattern (%d frames dropped): ", f); + { + int i; + for (i = 0; i < len; i ++) + fputc (buf[i] ? pat[i] : '-', stderr); + } + fputc ('\n', stderr); + */ + free (pat); +} + +int +Video_Global::FrameToGroup (int * frame) +{ + int f = * frame; + int i = 0; + while (i < this->numG && this->gopTable[i].previousFrames <= f) i++; + i --; + * frame = f - this->gopTable[i].previousFrames; + return i; +} + +int +Video_Global::SendReferences (int group, int frame) +{ + u_char orgcmd; + int i, base; + int pregroup; + int result; + + if (group < 0 || group >= this->numG) return 0; + if (frame <= 0 || frame >= this->gopTable[group].totalFrames) return 0; + + orgcmd = this->cmd; + this->cmd = CmdREF; + + if (group > 0) { + pregroup = 1; + base = this->gopTable[group].previousFrames; + for (i = 0; i <= frame; i ++) { + if (this->frameTable[i + base].type == 'P') { + pregroup = 0; + break; + } + } + } + else pregroup = 0; + + if (pregroup) { /* reference frame can be in previous group */ + pregroup = group -1; + base = this->gopTable[pregroup].previousFrames; + for (i = 0; i < this->gopTable[pregroup].totalFrames; i ++) { + if (this->frameTable[i + base].type != 'B') { + /* + SFprintf (stderr, "REF group%d, frame%d\n", pregroup, i); + */ + result = SendPacket (i == 0, pregroup, i, 0); + if (result != 0) + return result; + } + } + } + + base = this->gopTable[group].previousFrames; + for (i = 0; i < frame; i ++) { + if (this->frameTable[i + base].type != 'B') { + /* + SFprintf (stderr, "REF group%d, frame%d\n", group, i); + */ + SendPacket (i == 0, group, i, 0); + } + } + this->cmd = orgcmd; +} + +int +Video_Global::GetFeedBack () +{ + VideoFeedBackPara para; + struct itimerval val; + int timerUsec; + + if (FBread ((char *)¶, sizeof (para)) == -1 || + ntohl (para.cmdsn) != this->cmdsn) { + /* + SFprintf (stderr, "VS warning: a FB this->packet discarded.\n"); + */ + return -1; + } +#ifdef NeedByteOrderConversion + para.needHeader = ntohl (para.needHeader); + para.addUsecPerFrame = ntohl (para.addUsecPerFrame); + para.addFrames = ntohl (para.addFrames); + para.sendPatternGops = ntohl (para.sendPatternGops); + para.frameRateLimit1000 = ntohl (para.frameRateLimit1000); +#endif + this->frameRateLimit = para.frameRateLimit1000 / 1000.0; + this->sendPatternGops = para.sendPatternGops; + + if (!Video_Timer_Global::timerOn) return 0; + + this->needHeader = para.needHeader; + memcpy (this->sendPattern, para.sendPattern, PATTERN_SIZE); + if (para.addFrames <= 0 || Video_Timer_Global::timerAdjust < MAX_TIMER_ADJUST) + { + Video_Timer_Global::timerAdjust += para.addFrames * SPEEDUP_INV_SCALE; + Video_Timer_Global::TimerSpeed (); + } + else /* drastic compensation for big gap */ + this->addedSignals += para.addFrames; + if (para.addUsecPerFrame) { + this->addedUPF += para.addUsecPerFrame; + Video_Timer_Global::TimerSpeed (); + } + /* + SFprintf (stderr, "VS fb: addf %d, addupf %d\n", + para.addFrames, para.addUsecPerFrame); + */ + + return 0; +} + +int +Video_Global::SendPicture (int * frame) +{ + int size; + char * buf = ((char *) this->packet) + sizeof (VideoPacket); + /* + SFprintf (stderr, "VS to send picture %d.\n", *frame); + */ + + size = ReadLiveVideoPicture (frame, buf, this->packetBufSize); + + this->packet->currentUPF = ntohl (this->currentUPF); + this->packet->cmd = htonl (this->cmd); + this->packet->cmdsn = htonl (this->cmdsn); + this->packet->sh = this->packet->gop = this->packet->frame = this->packet->display = htonl (*frame); + this->packet->future = htonl ((unsigned)-1); + this->packet->past = htonl ((unsigned)-1); + + this->packet->dataBytes = htonl (size); + + return send_to_network (this->currentUPF); +} + +int +Video_Global::ReadInfoFromFile (void) +{ + int fd = -1, i; + int fnlen = strlen (this->videoFile); + + strcpy (&this->videoFile[fnlen], ".Info"); + fd = open (this->videoFile, O_RDONLY); + if (fd == -1) + { + fprintf (stderr, "Reminder: VS fails to open %s for read, ", this->videoFile); + perror ("try create one"); + goto fail_ReadInfoFromFile; + } + read_int (fd, &i); + if (i != this->fileSize) + { + fprintf (stderr, "Warning: this->fileSize in Info: %d not the same as actual %d.\n", + i, this->fileSize); + goto fail_ReadInfoFromFile; + } + + read_int (fd, &this->maxS); + read_int (fd, &this->maxG); + read_int (fd, &this->maxI); + read_int (fd, &this->maxP); + read_int (fd, &this->maxB); + read_int (fd, &this->minS); + read_int (fd, &this->minG); + read_int (fd, &this->minI); + read_int (fd, &this->minP); + read_int (fd, &this->minB); + read_int (fd, &this->numS); + read_int (fd, &this->numG); + read_int (fd, &this->numF); + read_int (fd, &this->numI); + read_int (fd, &this->numP); + read_int (fd, &this->numB); + read_int (fd, &this->averageFrameSize); + read_int (fd, &this->horizontalSize); + read_int (fd, &this->verticalSize); + read_int (fd, &this->pelAspectRatio); + read_int (fd, &this->pictureRate); + read_int (fd, &this->vbvBufferSize); + read_int (fd, &this->patternSize); + + memset (this->pattern, 0, PATTERN_SIZE); + read_bytes (fd, this->pattern, this->patternSize); +#ifdef STAT + this->framesSent = (char *)ACE_OS::malloc ((this->numF + 7)>>3); + if (this->framesSent == NULL) + { + fprintf (stderr, "Error: VS fails to alloc mem for this->framesSent for %d frames", this->numF); + perror (""); + exit (1); + } +#endif + this->systemHeader = (struct Video_Global::SystemHeader *)ACE_OS::malloc (sizeof (struct Video_Global::SystemHeader) * this->numS); + if (this->systemHeader == NULL) + { + perror ("Error: VS error on ACE_OS::malloc this->SystemHeader"); + exit (1); + } + this->gopTable = (struct Video_Global::GopTable *)ACE_OS::malloc (sizeof (struct Video_Global::GopTable) * this->numG); + if (this->gopTable == NULL) + { + perror ("Error: VS error on ACE_OS::malloc GopHeader"); + exit (1); + } + this->frameTable = (struct Video_Global::FrameTable *)ACE_OS::malloc (sizeof (Video_Global::FrameTable) * this->numF); + if (this->frameTable == NULL) + { + perror ("Error: VS error on ACE_OS::malloc this->frameTable"); + exit (1); + } + this->packetBufSize = this->maxS + this->maxG + max (this->maxI, max (this->maxP, this->maxB)); + this->packet = (VideoPacket *)ACE_OS::malloc (sizeof (VideoMessage) + sizeof (VideoPacket) + + this->packetBufSize); + if (this->packet == NULL) + { + perror ("Error: VS error on ACE_OS::malloc this->packet buffer"); + exit (1); + } + this->packet = (VideoPacket *) ((char *)this->packet + sizeof (VideoMessage)); + + for (i = 0; i < this->numS; i ++) + { + read_int (fd, (int *)&this->systemHeader[i].offset); + read_int (fd, &this->systemHeader[i].size); + } + for (i = 0; i < this->numG; i ++) + { + read_int (fd, &this->gopTable[i].systemHeader); + read_int (fd, (int *)&this->gopTable[i].offset); + read_int (fd, &this->gopTable[i].headerSize); + read_int (fd, &this->gopTable[i].size); + read_int (fd, &this->gopTable[i].totalFrames); + read_int (fd, &this->gopTable[i].previousFrames); + read_int (fd, (int *)&this->gopTable[i].firstIoffset); + } + for (i = 0; i < this->numF; i ++) + { + read_byte (fd, &this->frameTable[i].type); + read_short (fd, (short *)&this->frameTable[i].size); + } + + close (fd); + /* + fprintf (stderr, "Read Info from %s\n", this->videoFile); + */ + this->videoFile[fnlen] = 0; + return 0; +fail_ReadInfoFromFile: + if (fd >= 0) + close (fd); + this->videoFile[fnlen] = 0; + /* + fprintf (stderr, "To scan Info from %s\n", this->videoFile); + */ + return -1; +} + +void +Video_Global::WriteInfoToFile (void) +{ + int fd = -1, i; + int fnlen = strlen (this->videoFile); + + strcpy (&this->videoFile[fnlen], ".Info"); + fd = open (this->videoFile, O_WRONLY | O_CREAT, 0444); + if (fd == -1) + { + fprintf (stderr, "VS fails to open %s for write", this->videoFile); + perror (""); + goto fail_WriteInfoToFile; + } + write_int (fd, this->fileSize); + write_int (fd, this->maxS); + write_int (fd, this->maxG); + write_int (fd, this->maxI); + write_int (fd, this->maxP); + write_int (fd, this->maxB); + write_int (fd, this->minS); + write_int (fd, this->minG); + write_int (fd, this->minI); + write_int (fd, this->minP); + write_int (fd, this->minB); + write_int (fd, this->numS); + write_int (fd, this->numG); + write_int (fd, this->numF); + write_int (fd, this->numI); + write_int (fd, this->numP); + write_int (fd, this->numB); + write_int (fd, this->averageFrameSize); + write_int (fd, this->horizontalSize); + write_int (fd, this->verticalSize); + write_int (fd, this->pelAspectRatio); + write_int (fd, this->pictureRate); + write_int (fd, this->vbvBufferSize); + write_int (fd, this->patternSize); + + write_bytes (fd, this->pattern, this->patternSize); + + for (i = 0; i < this->numS; i ++) + { + write_int (fd, this->systemHeader[i].offset); + write_int (fd, this->systemHeader[i].size); + } + for (i = 0; i < this->numG; i ++) + { + write_int (fd, this->gopTable[i].systemHeader); + write_int (fd, this->gopTable[i].offset); + write_int (fd, this->gopTable[i].headerSize); + write_int (fd, this->gopTable[i].size); + write_int (fd, this->gopTable[i].totalFrames); + write_int (fd, this->gopTable[i].previousFrames); + write_int (fd, this->gopTable[i].firstIoffset); + } + for (i = 0; i < this->numF; i ++) + { + write_byte (fd, this->frameTable[i].type); + write_short (fd, this->frameTable[i].size); + } + + close (fd); + this->videoFile[fnlen] = 0; + return; +fail_WriteInfoToFile: + if (fd >= 0) + close (fd); + this->videoFile[fnlen] = 0; + return; +} + +int +Video_Global::init_MPEG1_video_file (void) +{ + u_char nb; + int state = 0; + u_long fileptr = 0; + u_long i, j, k; + int shptr, gopptr, ftptr; + int inpic = 0; + u_long picptr = 0; + int pictype = 0; + int first = 0; + int failureType = 0; + + this->fp = fopen (this->videoFile, "r"); + if (this->fp == NULL) + { + fprintf (stderr, "error on opening video file %s", this->videoFile); + perror (""); + return 2; + } + if (fseek (this->fp, 0, 2) == -1) + { + fprintf (stderr, "File %s not seekable", this->videoFile); + perror (""); + return 3; + } + this->fileSize = ftell (this->fp); + + fseek (this->fp, 0, 0); + + if (ReadInfoFromFile ()) + { + for (;;) + { + nextByte; + if (state >= 0 && nb == 0x00) + state ++; + else if (state >= 2 && nb == 0x01) + state = -1; + else if (state == -1) + { + if (!first) first ++; + else if (first == 1) first ++; + + switch (nb) + { + case 0xb7: /* seq_end_code */ + goto exit_phase1; + break; + case 0xb3: /* seq_start_code */ + if (first == 1) first = 3; + if (first != 3) + { + fprintf (stderr, "VS error: given file is not in MPEG format.\n"); + return 4; + } + this->numS ++; + break; + case 0xb8: /* gop_start_code */ + this->numG ++; + break; + case 0x00: /* picture_start_code */ + nextByte; + nextByte; + nb &= 0x38; + if (nb == 0x08) + { + this->numI ++; + if (this->numG == 2) + this->pattern[this->patternSize++] = 'I'; + } + else if (nb == 0x10) + { + this->numP ++; + if (this->numG == 2) + this->pattern[this->patternSize++] = 'P'; + } + else if (nb == 0x18) + { + this->numB ++; + if (this->numG == 2) + this->pattern[this->patternSize++] = 'B'; + } + /* + else + fprintf (stderr, "VS error: unkonw picture type %d\n", nb); + */ + break; + default: + break; + } + state = 0; + } + else + state = 0; + } + exit_phase1: + + if (first != 3) + { + fprintf (stderr, "VS error: given file \"%s\" is not of MPEG format.\n", this->videoFile); + return 4; + } + + this->pattern[this->patternSize] = 0; + memset (this->sendPattern, 1, PATTERN_SIZE); + + this->numF = this->numI + this->numP + this->numB; + this->averageFrameSize = fileptr / (unsigned)this->numF; + /* + fprintf (stderr, "Pass one finished, total bytes read: %u, average frame size %d\n", + fileptr, this->averageFrameSize); + fprintf (stderr, "this->numS-%d, this->numG-%d, this->numF-%d, this->numI-%d, this->numP-%d, this->numB-%d\n", + this->numS, this->numG, this->numI, this->numI, this->numP, this->numB); + fprintf (stderr, "this->Pattern detected: %s\n", this->pattern); + */ + if (this->numF > MAX_FRAMES) + { + fprintf (stderr, "VS error: this->Number of frames (%d) is bigger than MAX_FRAMES (%d).\n\ +you need to update the constant definition in common.h and recompile.\n", + this->numF, MAX_FRAMES); + return 5; + } + +#ifdef STAT + this->framesSent = (char *)ACE_OS::malloc ((this->numF + 7)>>3); + if (this->framesSent == NULL) + { + fprintf (stderr, "VS fails to alloc mem for this->framesSent for %d frames", this->numF); + perror (""); + return 6; + } +#endif + + this->systemHeader = (struct Video_Global::SystemHeader *)ACE_OS::malloc (sizeof (struct Video_Global::SystemHeader) * this->numS); + if (this->systemHeader == NULL) + { + perror ("VS error on ACE_OS::malloc this->SystemHeader"); + return 7; + } + this->gopTable = (struct Video_Global::GopTable *)ACE_OS::malloc (sizeof (struct Video_Global::GopTable) * this->numG); + if (this->gopTable == NULL) + { + perror ("VS error on ACE_OS::malloc GopHeader"); + return 8; + } + this->frameTable = (struct Video_Global::FrameTable *)ACE_OS::malloc (sizeof (Video_Global::FrameTable) * this->numF); + if (this->frameTable == NULL) + { + perror ("VS error on ACE_OS::malloc this->frameTable"); + return 9; + } + + rewind (this->fp); + fileptr = 0; + state = 0; + inpic = 0; + shptr = -1; + gopptr = -1; + ftptr = 0; + + for (;;) + { + nextByte; + if (state >= 0 && nb == 0x00) + state ++; + else if (state >= 2 && nb == 0x01) + state = -1; + else if (state == -1) + { + switch (nb) + { + case 0xb7: /* seq_end_code */ + if (gopptr >= 0 && this->gopTable[gopptr].size == 0) + this->gopTable[gopptr].size = fileptr - this->gopTable[gopptr].offset - 4; + computePicSize; + goto exit_phase2; + break; + case 0xb3: /* seq_start_code */ + if (gopptr >= 0 && this->gopTable[gopptr].size == 0) + this->gopTable[gopptr].size = fileptr - this->gopTable[gopptr].offset - 4; + computePicSize; + shptr ++; + this->systemHeader[shptr].offset = fileptr - 4; + this->systemHeader[shptr].size = 0; + break; + case 0xb8: /* gop_start_code */ + if (this->systemHeader[shptr].size == 0) + this->systemHeader[shptr].size =fileptr - this->systemHeader[shptr].offset - 4; + if (gopptr >= 0 && this->gopTable[gopptr].size == 0) + this->gopTable[gopptr].size = fileptr - this->gopTable[gopptr].offset - 4; + computePicSize; + gopptr ++; + this->gopTable[gopptr].systemHeader = shptr; + this->gopTable[gopptr].offset = fileptr - 4; + this->gopTable[gopptr].headerSize = 0; + this->gopTable[gopptr].size = 0; + this->gopTable[gopptr].totalFrames = 0; + this->gopTable[gopptr].previousFrames = gopptr ? + (this->gopTable[gopptr - 1].totalFrames + this->gopTable[gopptr - 1].previousFrames) : 0; + + break; + case 0x00: /* picture_start_code */ + if (this->gopTable[gopptr].headerSize == 0) + { + this->gopTable[gopptr].headerSize = fileptr - this->gopTable[gopptr].offset - 4; + this->gopTable[gopptr].firstIoffset = fileptr - 4; + } + this->gopTable[gopptr].totalFrames ++; + computePicSize; + picptr = fileptr - 4; + nextByte; + nextByte; + nb &= 0x38; + if (nb == 0x08) + { + pictype = 'I'; + inpic = 1; + } + else if (nb == 0x10) + { + pictype = 'P'; + inpic = 1; + } + else if (nb == 0x18) + { + pictype = 'B'; + inpic = 1; + } + break; + default: + + break; + } + state = 0; + } + else + state = 0; + } + + exit_phase2: + for (shptr = 0; shptr<this->numS; shptr++) + { + this->maxS = max (this->maxS, this->systemHeader[shptr].size); + this->minS = min (this->minS, this->systemHeader[shptr].size); + } + for (gopptr = 0; gopptr<this->numG; gopptr++) + { + this->maxG = max (this->maxG, this->gopTable[gopptr].headerSize); + this->minG = min (this->minG, this->gopTable[gopptr].headerSize); + } + this->packetBufSize = this->maxS + this->maxG + max (this->maxI, max (this->maxP, this->maxB)); + this->packet = (VideoPacket *)ACE_OS::malloc (sizeof (VideoMessage) + sizeof (VideoPacket) + + this->packetBufSize); + if (this->packet == NULL) + { + perror ("VS error on ACE_OS::malloc this->packet buffer"); + return 10; + } + this->packet = (VideoPacket *) ((char *)this->packet + sizeof (VideoMessage)); + /* + fprintf (stderr, "Pass 2 finished.\n"); + fprintf (stderr, "this->maxS-%d, this->maxG-%d, this->maxI-%d, this->maxP-%d, this->maxB-%d.\n", this->maxS, this->maxG, this->maxI, this->maxP, this->maxB); + fprintf (stderr, "this->minS-%d, this->minG-%d, this->minI-%d, this->minP-%d, this->minB-%d.\n", this->minS, this->minG, this->minI, this->minP, this->minB); + */ + /* + { + int i; + + fprintf (stderr, "id: offset size -- system header table:\n"); + for (i=0; i<this->numS; i++) + fprintf (stderr, "%-3d %-9u %d\n", i, this->systemHeader[i].offset, this->systemHeader[i].size); + fprintf (stderr, + "id: header offset hdsize totSize frames preframs Ioffset Isize -- GOP\n"); + for (i=0; i<this->numG; i++) + { + fprintf (stderr, "%-4d %-8d %-8u %-8d %-8d %-8d %-8d %-8u %d\n", + i, + this->gopTable[i].systemHeader, + this->gopTable[i].offset, + this->gopTable[i].headerSize, + this->gopTable[i].size, + this->gopTable[i].totalFrames, + this->gopTable[i].previousFrames, + this->gopTable[i].firstIoffset, + this->frameTable[this->gopTable[i].previousFrames].size + ); + } + + fprintf (stderr, "\nframe information:"); + for (i=0; i<this->numF; i++) + fprintf (stderr, "%c%c%-8d", (i%10 ? '\0' : '\n'), this->frameTable[i].type, this->frameTable[i].size); + fprintf (stderr, "\n"); + + } + */ + fseek (this->fp, this->systemHeader[0].offset+4, 0); + nextByte; + this->horizontalSize = ((int)nb <<4) & 0xff0; + nextByte; + this->horizontalSize |= (nb >>4) & 0x0f; + this->verticalSize = ((int)nb <<8) & 0xf00; + nextByte; + this->verticalSize |= (int)nb & 0xff; + nextByte; + this->pelAspectRatio = ((int)nb >> 4) & 0x0f; + this->pictureRate = (int)nb & 0x0f; + nextByte; + nextByte; + nextByte; + this->vbvBufferSize = ((int)nb << 5) & 0x3e0; + nextByte; + this->vbvBufferSize |= ((int)nb >>3) & 0x1f; + /* + fprintf (stderr, "SysHeader info: hsize-%d, vsize-%d, pelAspect-%d, rate-%d, vbv-%d.\n", + this->horizontalSize, this->verticalSize, this->pelAspectRatio, this->pictureRate, this->vbvBufferSize); + */ + WriteInfoToFile (); + } +#if 0 + { + int i, j = 20; + + for (i = this->numG - 1;; i --) { + if (this->gopTable[i].offset < 4235260) { + fprintf (stderr, "group %d: offset %ld\n", i, this->gopTable[i].offset); + if (j -- == 0) break; + } + } + /* + for (i = 0; i < this->numG; i ++) { + if (this->gopTable[i].previousFrames > 1800) { + fprintf (stderr, "group %d: offset %ld pre-frames %d\n", + i, this->gopTable[i].offset, this->gopTable[i].previousFrames); + break; + } + } + */ + } +#endif + { + this->firstPatternSize = this->gopTable[0].totalFrames; + this->firstSendPattern = (char *)ACE_OS::malloc (this->firstPatternSize); + if (this->firstSendPattern == NULL) + { + fprintf (stderr, "VS failed to allocate firstSendPattern for %d frames", + this->firstPatternSize); + perror (""); + return 11; + } + } + this->firstGopFrames = this->gopTable[0].totalFrames; + return 0; +} +int +Video_Global::play_send (int debug) +{ + // ACE_DEBUG ((LM_DEBUG,"play_send: sending the frame \n")); + int curGroup = Video_Timer_Global::timerGroup; + int curFrame = Video_Timer_Global::timerFrame; + int curHeader = Video_Timer_Global::timerHeader; + char * sp; + + if (this->preGroup != curGroup || + curFrame != this->preFrame) + { + int sendStatus = -1; + int frameStep = 1; + if (debug) + cerr << " curgroup = " << curGroup << endl ; + if (curGroup == 0) + { + + int i = curFrame + 1; + while (i < this->firstPatternSize && + !this->firstSendPattern[i]) + { + frameStep ++; + i++; + } + } + else /* (curGroup > 0) */ + { + int i = curFrame + 1; + sp = this->sendPattern + ((curGroup - 1) % this->sendPatternGops) * this->patternSize; + while (i < this->patternSize && !sp[i]) + { + frameStep ++; + i++; + } + } + if (curGroup == 0) + { + if (debug) + cerr << "first : " << + this->firstSendPattern[curFrame] << endl; + if (this->firstSendPattern[curFrame]) + sendStatus = 0; + else /* (!firstSendPattern[curFrame]) */ + { + int i = curFrame - 1; + while (i > 0 && !this->firstSendPattern[i]) + i--; + if (i > this->preFrame) + /* the frame (curGroup, i) hasn't been sent yet */ + { + sendStatus = 0; + curFrame = i; + } + else + sendStatus = -1; + if (debug) + cerr << "SendStatus = " << sendStatus << endl; + } + } + else if (sp[curFrame]) /* curGroup > 0 */ + sendStatus = 0; + else /* (!sp[curFrame]) */ + { + int i = curFrame - 1; + while (i > 0 && !sp[i]) + i--; + if (curGroup == this->preGroup && i > this->preFrame) + /* the frame (curGroup, i) hasn't been sent yet */ + { + sendStatus = 0; + curFrame = i; + } + else + sendStatus = -1; + } + if (!sendStatus) + { + // Send the current video frame, calls send_to_network which + // fragments and sends via blocking write . + sendStatus = this->SendPacket (this->preHeader != curHeader, + curGroup, curFrame, + (this->currentUPF + this->addedUPF) * frameStep); + if (sendStatus == -1) + return -1; + if (!sendStatus) + { + this->preHeader = curHeader; + this->preGroup = curGroup; + this->preFrame = curFrame; +#ifdef STAT + if (this->play_para.collectStat) + { + int f = this->gopTable[curGroup].previousFrames + curFrame; + this->framesSent[f>>3] |= (1 << (f % 8)); + } +#endif + } + } + } + return 0; +} + +int +Video_Global::fast_play_send (void) +{ + if (this->fast_preGroup != Video_Timer_Global::timerGroup) + { + int result; + result = this->SendPacket (this->fast_preHeader != Video_Timer_Global::timerHeader, Video_Timer_Global::timerGroup, 0, + this->fast_para.usecPerFrame * this->patternSize >> 2); + if (result == -1) + return -1; + this->fast_preHeader = Video_Timer_Global::timerHeader; + this->fast_preGroup = Video_Timer_Global::timerGroup; + } + return 0; +} + +int +Video_Global::position (void) +{ + int result; + POSITIONpara pos_para; + /* + fprintf (stderr, "POSITION . . .\n"); + */ + result = CmdRead ((char *)&pos_para, sizeof (pos_para)); + if (result != 0) + return result; + + if (this->live_source) return 0; + +#ifdef NeedByteOrderConversion + pos_para.nextGroup = ntohl (pos_para.nextGroup); + pos_para.sn = ntohl (pos_para.sn); +#endif + + CheckGroupRange (pos_para.nextGroup); + this->cmdsn = pos_para.sn; + result = SendPacket (this->numS>1 || pos_para.nextGroup == 0, pos_para.nextGroup, 0, 0); + return result; +} + +int +Video_Global::step_video () +{ + int group; + STEPpara step_para; + int tag = 0; + int result; + + result = CmdRead ((char *)&step_para, sizeof (step_para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + step_para.sn = ntohl (step_para.sn); + step_para.nextFrame = ntohl (step_para.nextFrame); +#endif + + this->cmdsn = step_para.sn; + + if (!this->live_source) { + if (step_para.nextFrame >= this->numF) /* send SEQ_END */ + { + tag = 1; + step_para.nextFrame --; + } + /* + fprintf (stderr, "STEP . . .frame-%d\n", step_para.nextFrame); + */ + CheckFrameRange (step_para.nextFrame); + group = FrameToGroup (&step_para.nextFrame); + if (this->precmd != CmdSTEP && !tag ) { + result = SendReferences (group, step_para.nextFrame); + if (result < 0 ) + return result; + } + } + if (this->live_source) StartPlayLiveVideo (); + + if (this->live_source) { + SendPicture (&step_para.nextFrame); + } + else if (this->video_format == VIDEO_MPEG1) { + SendPacket (this->numS>1, group, tag ? this->numF : step_para.nextFrame, 0); + } + else { + fprintf (stderr, "VS: wierd1\n"); + } + + if (this->live_source) StopPlayLiveVideo (); + return 0; +} + +int +Video_Global::fast_forward (void) +{ + // return this->init_fast_play () + return 0; +} + +int +Video_Global::fast_backward (void) +{ +// return this->init_fast_play (); + return 0; +} + +int +Video_Global::stat_stream (void) +{ + int i, j = 0; + for (i = 0; i < this->numF; i++) + { + short size = htons (this->frameTable[i].size); + char type = this->frameTable[i].type; + if (i == this->gopTable[j].previousFrames) + { + type = tolower (type); + j ++; + } + CmdWrite ((char *)&type, 1); + CmdWrite ((char *)&size, 2); + } + return 0; +} + +int +Video_Global::stat_sent (void) +{ +#ifdef STAT + CmdWrite ((char *)this->framesSent, (this->numF + 7) / 8); +#else + int i; + char zeroByte = 0; + for (i = 0; i < (this->numF + 7) / 8; i++) + CmdWrite ((char *)&zeroByte, 1); +#endif + return 0; +} + +int +Video_Global::init_play (Video_Control::PLAYpara para, + CORBA::Long_out vts) +{ + // ~~ why do we need the play_para in Video_Global , why can't just use + // the para that's passed. + int result; + + ACE_DEBUG ((LM_DEBUG, + " (%P|%t) Video_Global::init_play ()")); + + // this gets the parameters for the play command + // result = this->CmdRead ((char *)&this->play_para, sizeof (this->play_para)); + // if (result != 0) + // return result; + + // Assign the passed play + this->play_para = para ; +#ifdef NeedByteOrderConversion +// this->play_para.sn = ntohl (this->play_para.sn); +// this->play_para.nextFrame = ntohl (this->play_para.nextFrame); +// this->play_para.usecPerFrame = ntohl (this->play_para.usecPerFrame); +// this->play_para.framesPerSecond = ntohl (this->play_para.framesPerSecond); +// this->play_para.frameRateLimit1000 = ntohl (this->play_para.frameRateLimit1000); +// this->play_para.collectStat = ntohl (this->play_para.collectStat); +// this->play_para.sendPatternGops = ntohl (this->play_para.sendPatternGops); +// this->play_para.VStimeAdvance = ntohl (this->play_para.VStimeAdvance); + + this->play_para.sn = ntohl (play_para.sn); + this->play_para.nextFrame = ntohl (para.nextFrame); + this->play_para.usecPerFrame = ntohl (para.usecPerFrame); + this->play_para.framesPerSecond = ntohl (para.framesPerSecond); + this->play_para.frameRateLimit1000 = ntohl (para.frameRateLimit1000); + this->play_para.collectStat = ntohl (para.collectStat); + this->play_para.sendPatternGops = ntohl (para.sendPatternGops); + this->play_para.VStimeAdvance = ntohl (para.VStimeAdvance); +#endif + +// this->frameRateLimit = this->play_para.frameRateLimit1000 / 1000.0; +// this->cmdsn = this->play_para.sn; +// this->currentUPF = this->play_para.usecPerFrame; +// this->VStimeAdvance = this->play_para.VStimeAdvance; + + this->frameRateLimit = para.frameRateLimit1000 / 1000.0; + this->cmdsn = para.sn; + this->currentUPF = para.usecPerFrame; + this->VStimeAdvance = play_para.VStimeAdvance; + + vts = get_usec (); + // cerr << "vts is " << vts << endl; + // begin evil code + // { + // int vts = get_usec (); + // this->CmdWrite ((char *)&ts, sizeof (int)); + // } + // end evil code + + if (this->live_source || this->video_format != VIDEO_MPEG1) { + PLAYpara live_play_para; // xxx hack to compile the code + if (this->live_source) + this->PLAYliveVideo (&live_play_para); + return 0; + } + + fprintf (stderr, "this->VStimeAdvance from client: %d\n", this->VStimeAdvance); + + this->sendPatternGops = this->play_para.sendPatternGops; + ComputeFirstSendPattern (this->frameRateLimit); +#ifdef STAT + if (this->play_para.collectStat) + memset (this->framesSent, 0, (this->numF + 7)>>3); +#endif + CheckFrameRange (para.nextFrame); + Video_Timer_Global::timerFrame = para.nextFrame; + Video_Timer_Global::timerGroup = FrameToGroup (&Video_Timer_Global::timerFrame); + Video_Timer_Global::timerHeader = this->gopTable[Video_Timer_Global::timerGroup].systemHeader; + // memcpy (this->sendPattern, this->play_para.sendPattern, PATTERN_SIZE); + // Do a sequence copy.. + + for (int i=0; i<PATTERN_SIZE ; i++) + this->sendPattern[i] = this->play_para.sendPattern[i]; + result = SendReferences (Video_Timer_Global::timerGroup, Video_Timer_Global::timerFrame); + if (result < 0) + return result; + Video_Timer_Global::StartTimer (); + + // Sends the first frame of the video... not true anymore since the + // user can position the stream anywhere and then call play. + result = play_send (0); + return 0; +} + +CORBA::Boolean +Video_Global::init_fast_play (const Video_Control::FFpara &ff_para ) +{ + // save the parameters for future reference + this->fast_para = ff_para; + int result; + + // result = CmdRead ((char *)&this->ff_para, sizeof (this->ff_para)); + // if (result != 0) + // return result; + + if (this->live_source) return 0; + + this->VStimeAdvance = ff_para.VStimeAdvance; + /* + fprintf (stderr, "this->VStimeAdvance from client: %d\n", this->VStimeAdvance); + */ + CheckGroupRange (ff_para.nextGroup); + this->cmdsn = ff_para.sn; + Video_Timer_Global::timerGroup = ff_para.nextGroup; + Video_Timer_Global::timerFrame = 0; + Video_Timer_Global::timerHeader = this->gopTable[Video_Timer_Global::timerGroup].systemHeader; + this->currentUPF = ff_para.usecPerFrame; + Video_Timer_Global::StartTimer (); + + fast_play_send (); + return 0; +} + +int +Video_Global::init_video (void) +{ + INITvideoPara para; + int failureType = 0; + int result; + /* + fprintf (stderr, "VS about to read Para.\n"); + */ + result = CmdRead ((char *)¶, sizeof (para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl (para.sn); + para.version = ntohl (para.version); + para.nameLength = ntohl (para.nameLength); +#endif + if (para.nameLength>0) + { + result = CmdRead (this->videoFile, para.nameLength); + if (result != 0) + return result; + } + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || para.version != VERSION) { + char errmsg[128]; + this->cmd = CmdFAIL; + CmdWrite ((char *)&this->cmd, 1); + if (Mpeg_Global::session_num > Mpeg_Global::session_limit) { + sprintf (errmsg, + "Too many sessions being serviced, please try again later.\n"); + } + else { + sprintf (errmsg, "Version # not match, VS %d.%02d, Client %d.%02d", + VERSION / 100, VERSION % 100, + para.version / 100, para.version % 100); + } + write_string (this->serviceSocket, errmsg); + exit (0); + } + this->cmdsn = para.sn; + /* + fprintf (stderr, "MPEG file %s got.\n", this->videoFile); + */ + this->videoFile[para.nameLength] = 0; + + if (!strncasecmp ("LiveVideo", this->videoFile, 9)) { + if (OpenLiveVideo (&this->video_format, &this->horizontalSize, + &this->verticalSize, &this->averageFrameSize, + &this->fps, &this->pelAspectRatio) == -1) { + failureType = 100; + goto failure; + } + if (this->video_format == VIDEO_MPEG2) { + failureType = 101; + goto failure; + } + this->live_source = 1; + + this->fileSize =0x7fffffff; + this->maxS = this->maxG = this->maxI = this->maxP = this->maxB = this->minS = this->minG = this->minI = this->minP = this->minB = 1; + this->numS = this->numG = this->numF = this->numI = 0x7fffffff; + this->numP = this->numB = 0; + this->vbvBufferSize = 1; + this->firstGopFrames = 1; + this->patternSize = 1; + this->pattern[0] = 'I'; + this->pattern[1] = 0; + this->packetBufSize = this->verticalSize * this->horizontalSize * 3; + this->packet = (VideoPacket *)ACE_OS::malloc (sizeof (VideoMessage) + sizeof (VideoPacket) + + this->packetBufSize); + if (this->packet == NULL) + { + perror ("Error: VS error on ACE_OS::malloc this->packet buffer"); + exit (1); + } + this->packet = (VideoPacket *) ((char *)this->packet + sizeof (VideoMessage)); + + } + else { + static double pictureRateTable[] = {23.976, 24, 25, 29.97, 30, 50, 59.94, 60}; + + this->video_format = VIDEO_MPEG1; + failureType = init_MPEG1_video_file (); + if (failureType) goto failure; + this->fps = pictureRateTable[this->pictureRate - 1]; + } + + { + INITvideoReply reply; + + reply.totalHeaders = htonl (this->numS); + reply.totalGroups = htonl (this->numG); + reply.totalFrames = htonl (this->numF); + reply.sizeIFrame = htonl (this->maxI); + reply.sizePFrame = htonl (this->maxP); + reply.sizeBFrame = htonl (this->maxB); + reply.sizeSystemHeader = htonl (this->maxS); + reply.sizeGop = htonl (this->maxG); + reply.averageFrameSize = htonl (this->averageFrameSize); + reply.verticalSize = htonl (this->verticalSize); + reply.horizontalSize = htonl (this->horizontalSize); + reply.pelAspectRatio = htonl (this->pelAspectRatio); + reply.pictureRate1000 = htonl ((int) (this->fps * 1000)); + reply.vbvBufferSize = htonl (this->vbvBufferSize); + reply.firstGopFrames = htonl (this->firstGopFrames); + reply.patternSize = htonl (this->patternSize); + strncpy (reply.pattern, this->pattern, PATTERN_SIZE); + + reply.live = htonl (this->live_source); + reply.format = htonl (this->video_format); + + CmdWrite ((char *)&this->cmd, 1); + + CmdWrite ((char *)&reply, sizeof (reply)); + + /* write the first SH, GOP and IFrame to this->serviceSocket (TCP), + using code for SendPacket () */ + { + int tmpSocket = this->videoSocket; + + if (this->live_source) StartPlayLiveVideo (); + + this->videoSocket = this->serviceSocket; + + if (this->live_source) { + int frame = 0; + SendPicture (&frame); + } + else if (this->video_format == VIDEO_MPEG1) { + SendPacket (1, 0, 0, 0); + } + else { + fprintf (stderr, "VS: this->video_format %d not supported.\n", + this->video_format); + } + this->videoSocket = tmpSocket; + + if (this->live_source) StopPlayLiveVideo (); + } + + return 0; + + } +failure: + { + char * msg; + char errmsg[64]; + this->cmd = CmdFAIL; + sprintf (errmsg, "VS failed to alloc internal buf (type %d)", failureType); + CmdWrite ((char *)&this->cmd, 1); + msg = failureType == 1 ? (char *)"not a complete MPEG stream" : + failureType == 2 ? (char *)"can't open MPEG file" : + failureType == 3 ? (char *)"MPEG file is not seekable" : + failureType == 4 ? (char *)"not an MPEG stream" : + failureType == 5 ? + (char *)"too many frames in MPEG file, need change MAX_FRAMES and recompile VS" : + failureType == 100 ? (char *)"failed to connect to live video source" : + failureType == 101 ? (char *)"live MPEG2 not supported" : + errmsg; + write_string (this->serviceSocket, msg); + exit (0); + } +} + +//-------------------------------------------------------- +// Video_Timer_Global methods +void +Video_Timer_Global::StartTimer (void) +{ + VIDEO_SINGLETON::instance ()->addedUPF = 0; + VIDEO_SINGLETON::instance ()->addedSignals = 0; + timerAdjust = (VIDEO_SINGLETON::instance ()->VStimeAdvance * SPEEDUP_INV_SCALE) / VIDEO_SINGLETON::instance ()->currentUPF; + /* + SFprintf (stderr, "VS StartTimer (): fast-start frames %d\n", + timerAdjust / SPEEDUP_INV_SCALE); + */ + TimerSpeed (); + // setsignal (SIGALRM, timerHandler); + timerOn = 1; + preTimerVal = get_usec (); + /* + fprintf (stderr, "VS: timer started at %d upf.\n", VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF); + */ +} + +void +Video_Timer_Global::StopTimer (void) +{ + struct itimerval val; + // ## I have to incorporate this logic into the changed code + // setsignal (SIGALRM, SIG_IGN); + val.it_interval.tv_sec = val.it_value.tv_sec = 0; + val.it_interval.tv_usec = val.it_value.tv_usec = 0; + setitimer (ITIMER_REAL, &val, NULL); + timerOn = 0; + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Timer_Global::StopTimer: timer stopped\n")); +} + +void +Video_Timer_Global::TimerSpeed (void) +{ + struct itimerval val; + int usec = VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF; + if (Mpeg_Global::drift_ppm) { + /* + int drift = (double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0; + SFprintf (stderr, "Mpeg_Global::drift_ppm %d, usec %d, drift %d, new usec %d\n", + Mpeg_Global::drift_ppm, usec, drift, usec - drift); + */ + usec -= (int) ((double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0); + } + if (timerAdjust > 1) + usec = (int) (((double)usec * (double) (SPEEDUP_INV_SCALE - 1)) / + (double)SPEEDUP_INV_SCALE); + val.it_interval.tv_sec = val.it_value.tv_sec = usec / 1000000; + val.it_interval.tv_usec = val.it_value.tv_usec = usec % 1000000; + setitimer (ITIMER_REAL, &val, NULL); + /* + SFprintf (stderr, + "VS TimerSpeed () at %s speed, timerAdjust %d VIDEO_SINGLETON::instance ()->addedSignals %d.\n", + (timerAdjust > 1) ? "higher" : "normal", timerAdjust, VIDEO_SINGLETON::instance ()->addedSignals); + */ + +} + +void +Video_Timer_Global::TimerProcessing (void) +{ + /* + fprintf (stderr, "VS: timerHandler...\n"); + */ + if (!timerOn) { + return; + } + if (timerAdjust < 0) + { + timerAdjust += SPEEDUP_INV_SCALE; + return; + } + if (timerAdjust >0) + { + if ((--timerAdjust) == 0) + TimerSpeed (); + } + if (VIDEO_SINGLETON::instance ()->cmd == CmdPLAY) + { + if (timerGroup == VIDEO_SINGLETON::instance ()->numG - 1 && timerFrame >= VIDEO_SINGLETON::instance ()->gopTable[timerGroup].totalFrames - 1) + { + timerFrame ++; /* force sending of END_SEQ when PLAY VIDEO_SINGLETON::instance ()->cmd */ + StopTimer (); + return; + } + else + { + timerFrame ++; + if (timerFrame >= VIDEO_SINGLETON::instance ()->gopTable[timerGroup].totalFrames) + { + timerGroup ++; + timerFrame = 0; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + } + } + else { + if (VIDEO_SINGLETON::instance ()->cmd == CmdFF) { + if (timerGroup == VIDEO_SINGLETON::instance ()->numG - 1) { + StopTimer (); + return; + } + timerGroup ++; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + else { + if (timerGroup == 0) { + StopTimer (); + return; + } + timerGroup --; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + } + +} + +void +Video_Timer_Global::timerHandler (int sig) +{ + // ACE_DEBUG ((LM_DEBUG, + // "Video_Timer_Global::timerHandler\n")); + + int val2, val3; + int usec = VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF; + + if (Mpeg_Global::drift_ppm) { + usec -= (int) ((double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0); + } + + if (timerAdjust > 1) + usec = (int) (((double)usec * (double) (SPEEDUP_INV_SCALE - 1)) / + (double)SPEEDUP_INV_SCALE); + val3 = get_duration (preTimerVal, (val2 = get_usec ())); + /* + if (val3 >= usec<< 1)) + fprintf (stderr, "Slower: %d out of VIDEO_SINGLETON::instance ()->currentUPF %d.\n", + val3, usec); + else + fprintf (stderr, "+\n"); + */ + preTimerVal = val2; + if (val3 < 0 || val3 > 100000000) + val3 = usec; + val2 = (val3 + (usec>>1)) / usec; + if (val2 < 0) val2 = 0; + if (val2) { + TimerProcessing (); + val2 --; + } + VIDEO_SINGLETON::instance ()->addedSignals += val2; + + if (VIDEO_SINGLETON::instance ()->addedSignals) { + val2 = timerAdjust; + if (timerAdjust < MAX_TIMER_ADJUST) { + timerAdjust += VIDEO_SINGLETON::instance ()->addedSignals * SPEEDUP_INV_SCALE; + if (val2 < SPEEDUP_INV_SCALE) { + TimerSpeed (); + } + } + else { + /* + fprintf (stderr, "VS timerAdjust %d, VIDEO_SINGLETON::instance ()->addedSignals %d, timerFrame %d\n", + timerAdjust, VIDEO_SINGLETON::instance ()->addedSignals, timerFrame); + */ + for (val3 = 0; val3 < VIDEO_SINGLETON::instance ()->addedSignals; val3 ++) + TimerProcessing (); + } + VIDEO_SINGLETON::instance ()->addedSignals = 0; + } +} + +// send the first packet, given by packet pointed by +// 'this->packet' to the network. +int +Video_Global::send_to_network (int timeToUse) +{ + int count = 0; + VideoMessage * msghd = (VideoMessage *) (((char *) this->packet) - sizeof (VideoMessage)); + int sent = 0; + int packetSize = ntohl (this->packet->dataBytes); + + msghd->packetsn = htonl (this->packetsn ++); + msghd->packetSize = htonl (packetSize + sizeof (* this->packet)); + + // fprintf (stderr, "VS to send pkt %d of size %d.\n", + // ntohl (msghd->packetsn), ntohl (msghd->packetSize)); + + + { + VideoMessage * msg = NULL; + int size = packetSize + sizeof (* this->packet); /* msghd->this->packetSize */ + int offset = 0; + int targetTime; + + if (size > this->msgsize) + { + if (!timeToUse) + { + timeToUse = (this->msgsize + sizeof (*msg) + 28) * 2; + /* + set the max network as 500KB. + 28 - UDP header size + */ + /* + fprintf (stderr, "computed timeToUse %d. ", timeToUse); + */ + } + else + { + timeToUse = (timeToUse * 7) >> 3; + /* + fprintf (stderr, "preset timeToUse %d.", timeToUse); + */ + timeToUse /= (size + this->msgsize - 1) / this->msgsize; + timeToUse = min (timeToUse, (this->msgsize + sizeof (*msg) + 28) * 100); + /* limit min network bandwidth = 10K */ + } + + } + while (size > 0) + { + int segsize, sentsize; + int resent = 0; + + if (msg == NULL) { /* first message for current this->packet */ + count = 0; + msg = msghd; + targetTime = get_usec (); + } + else { +#if 0 + /* the select () is not precise enough for being used here*/ + int sleepTime; + targetTime += timeToUse; + sleepTime = get_duration (get_usec (), targetTime); + if (sleepTime >= 5000) { /* resolution of timer is 10,000 usec */ + usleep (sleepTime); /* not first message, wait for a while */ + } +#endif + /* + count ++; + if (! (count % 10)) usleep (10000); + */ + msg = (VideoMessage *) ((char *)msg + this->msgsize); + memcpy ((char *)msg, (char *)msghd, sizeof (* msg)); + } + msg->msgsn = htonl (this->msgsn++); + msg->msgOffset = htonl (offset); + msg->msgSize = htonl (min (size, this->msgsize)); + + segsize = min (size, this->msgsize)+sizeof (*msg); + if (this->conn_tag != 0) { /* this->packet stream */ + // cerr << "sending " << segsize << " on fd = " << this->videoSocket << endl; + while ((sentsize = write (this->videoSocket, (char *)msg, segsize)) == -1) { + if (errno == EINTR) + continue; + if (errno == ENOBUFS) { + if (resent) { + perror ("Warning, pkt discarded because"); + sent = -1; + break; + } + else { + resent = 1; + perror ("VS to sleep 5ms"); + usleep (5000); + continue; + } + } + if (errno != EPIPE) { + fprintf (stderr, "VS error on send this->packet %d of size %d ", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + perror (""); + } + exit (errno != EPIPE); + } + } + else { + sentsize = wait_write_bytes (this->videoSocket, (char *)msg, segsize); + if (sentsize == -1) { + if (errno != EPIPE) { + fprintf (stderr, "VS error on send this->packet %d of size %d ", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + perror (""); + } + exit (errno != EPIPE); + } + } + if (sentsize < segsize) { + SFprintf (stderr, "VS warning: message size %dB, sent only %dB\n", + segsize, sentsize); + } + if (sent == -1) + break; + /* + fprintf (stderr, "VS: message %d of size %d sent.\n", + this->msgsn-1, min (size, this->msgsize)+sizeof (*msg)); + */ + size -= this->msgsize; + offset += this->msgsize; + } + } + /* + fprintf (stderr, "sent = %d\n", sent); + */ + if (!sent) this->pkts_sent ++; + return sent; +} + + +Audio_Global::Audio_Global (void) + :state (AUDIO_WAITING), + addSamples (0), + nextTime (0), + upp (0), + delta_sps (0), + bytes_sent (0), + start_time (0), + conn_tag (0), + serviceSocket (-1), + audioSocket (-1), + fd (0), + totalSamples (0), + fileSize (0), + cmd (0), + live_source (0), + databuf_size (0), + cmdsn (0), + nextsample (0), + sps (0), + spslimit (0), + spp (0), + pktbuf (0), + fbpara (0) +{ +} + +int +Audio_Global::CmdRead(char *buf, int psize) +{ + int res = wait_read_bytes(serviceSocket, buf, psize); + if (res == 0) return (1); + if (res == -1) { + fprintf(stderr, "AS error on read cmdSocket, size %d", psize); + ACE_OS::perror (""); + return (-1); + } + return 0; +} + +void +Audio_Global::CmdWrite(char *buf, int size) +{ + int res = wait_write_bytes(serviceSocket, buf, size); + if (res == -1) { + if (errno != EPIPE)ACE_OS::perror ("AS writes to serviceSocket"); + ACE_OS::exit (errno != EPIPE); + } +} + +int +Audio_Global::INITaudio(void) +{ + int result; + int failureType; /* 0 - can't open file, 1 - can't open live source */ + INITaudioPara para; + + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.version = ntohl(para.version); + para.nameLength = ntohl(para.nameLength); + para.para.encodeType = ntohl(para.para.encodeType); + para.para.channels = ntohl(para.para.channels); + para.para.samplesPerSecond = ntohl(para.para.samplesPerSecond); + para.para.bytesPerSample = ntohl(para.para.bytesPerSample); +#endif + if (para.nameLength>0) + result = CmdRead(audioFile, para.nameLength); + if (result != 0) + return result; + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || para.version != VERSION) { + char errmsg[128]; + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + if (Mpeg_Global::session_num > Mpeg_Global::session_limit) { + sprintf(errmsg, + "Too many sessions being serviced, please try again later.\n"); + } + else { + sprintf(errmsg, "Version # not match, AS %d.%02d, Client %d.%02d", + VERSION / 100, VERSION % 100, + para.version / 100, para.version % 100); + } + write_string(serviceSocket, errmsg); + return(1); + } + ACE_OS::memcpy (&audioPara, ¶.para, sizeof(audioPara)); + /* + fprintf(stderr, "Client Audio para: encode %d, ch %d, sps %d, bps %d.\n", + para.para.encodeType, para.para.channels, + para.para.samplesPerSecond, para.para.bytesPerSample); + */ + audioFile[para.nameLength] = 0; + { + int len =ACE_OS::strlen (audioFile); + if (strncasecmp("LiveAudio", audioFile, 9) && + strcasecmp(".au", audioFile+len-3)) { + char errmsg[128]; + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + sprintf(errmsg, "%s without suffix .au", audioFile); + write_string(serviceSocket, errmsg); + return(1); + } + } + /* + fprintf(stderr, "Audio file %s got.\n", audioFile); + */ + + if (!strncasecmp("LiveAudio", audioFile, 9)) { + fd = OpenLiveAudio(&(para.para)); + if (fd == -1) { + failureType = 1; + goto failure; + } + fileSize =0x7fffffff; + totalSamples = fileSize / audioPara.bytesPerSample; + live_source = 1; + } + else { + LeaveLiveAudio(); + fd = open(audioFile, O_RDONLY); + if (fd == -1) + { + fprintf(stderr, "AS error on opening audio file %s", audioFile); + ACE_OS::perror (""); + failureType = 0; + goto failure; + } + + /* Try to get audioFile format audioPara here */ + + /* figure out totalsamples */ + fileSize = lseek(fd, 0L, SEEK_END); + lseek(fd, 0L, SEEK_SET); + totalSamples = fileSize / audioPara.bytesPerSample; + /* + fprintf(stderr, "Total Samples=%d in audio file %ss.\n", totalSamples, audioFile); + */ + } + { + INITaudioReply reply; + + reply.para.encodeType = htonl(audioPara.encodeType); + reply.para.channels = htonl(audioPara.channels); + reply.para.samplesPerSecond = htonl(audioPara.samplesPerSecond); + reply.para.bytesPerSample = htonl(audioPara.bytesPerSample); + reply.totalSamples = htonl(totalSamples); + + reply.live = htonl(live_source); + reply.format = htonl(AUDIO_RAW); + + CmdWrite((char *)&cmd, 1); + CmdWrite((char *)&reply, sizeof(reply)); + } + return 0; + + failure: + { + /* + fprintf(stderr, "AS error: failed initializing audio file.\n"); + */ + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + write_string(serviceSocket, + failureType == 0 ? (char *)"Failed to open audio file for read." : + (char *)"Failed to connect to live audio source."); + return(1); + } +} + +/* send a packet of audio samples to audioSocket + returns: 0 - no more data from audio file: EOF reached; + 1 - More data is available from the audio file */ +int +Audio_Global::send_packet (int firstSample, int samples) +{ + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) send_packet called\n")); + long offset = firstSample * audioPara.bytesPerSample; + int size = samples * audioPara.bytesPerSample; + char * buf = (char *)pktbuf + sizeof(*pktbuf); + int len; + int resent = 0; + int segsize, sentsize; + + if (live_source) { + len = ReadLiveAudioSamples(buf, samples); + len *= audioPara.bytesPerSample; + } + else { + lseek(fd, offset, SEEK_SET); + while ((len = ACE_OS::read (fd, buf, size)) == -1) { + if (errno == EINTR) + continue; /* interrupted */ + ACE_OS::perror ("AS error on read audio file"); + return(-1); + } + if (len < audioPara.bytesPerSample) { + return 0; + } + } + + samples = len / audioPara.bytesPerSample; + len = samples * audioPara.bytesPerSample; + bytes_sent += len; + pktbuf->firstSample = htonl(firstSample); + pktbuf->samples = htonl(samples); + pktbuf->actualSamples = htonl(samples); + pktbuf->dataBytes = htonl(len); + if (spslimit < sps) { /* interpolation needed */ + SFprintf(stderr, "AS audio sample interpolation not available yet.\n"); + } + segsize = sizeof(*pktbuf) + len; + if (conn_tag != 0) { + while ((sentsize = ACE_OS::write (audioSocket, (char *)pktbuf, segsize)) == -1) { + if (errno == EINTR) /* interrupted */ + continue; + if (errno == ENOBUFS) { + if (resent) { + ACE_OS::perror ("AS Warning, pkt discarded because"); + break; + } + else { + resent = 1; + usleep(5000); + continue; + } + } + if (errno != EPIPE) { + fprintf(stderr, "AS error on send audio packet %d(%d):", + firstSample, samples); + perror(""); + } + ACE_OS::exit ((errno != EPIPE)); + } + } + else { + sentsize = wait_write_bytes(audioSocket, (char *)pktbuf, segsize); + if (sentsize == -1) { + if (errno != EPIPE) { + fprintf(stderr, "AS error on send audio packet %d(%d):", + firstSample, samples); + perror(""); + } + ACE_OS::exit ((errno != EPIPE)); + } + } + if (sentsize < segsize) { + SFprintf(stderr, "AS warning: message size %dB, sent only %dB\n", + segsize, sentsize); + } + /* + SFprintf(stderr, "AS sent audio packet %d(%d).\n", + firstSample, samples); + */ + return (len < size ? 0 : 1); +} + +/* send a packet of audio samples to audioSocket + returns: 0 - no more data from audio file: EOF reached; + 1 - More data is available from the audio file */ +int +Audio_Global::SendPacket (void) +{ + int moredata; + pktbuf->cmdsn = htonl(cmdsn); + pktbuf->resend = htonl(0); + pktbuf->samplesPerSecond = htonl(sps); + moredata = send_packet(nextsample, spp); + if (moredata) + { + nextsample += spp; + } + return moredata; +} + +void +Audio_Global::ResendPacket (int firstsample, int samples) +{ + pktbuf->cmdsn = htonl(cmdsn); + pktbuf->resend = htonl(1); + pktbuf->samplesPerSecond = htonl(sps); + while (samples > 0) { + int size = samples < spp ? samples : spp; + send_packet(firstsample, size); + firstsample += size; + samples -= size; + if (samples > 0) { + usleep(10000); + } + } +} + +#if 0 +int +Audio_Global::PLAYaudio(void) +{ + int hasdata = 1; + int addSamples; + int packets = 0; + unsigned nextTime; + int upp; /* micro-seconds per packet */ + int delta_sps = 0; /* compensation for sps from feedback msgs */ + int nfds = (serviceSocket > audioSocket ? serviceSocket : audioSocket) + 1; + int result; + /* + fprintf(stderr, "PLAY . . .\n"); + */ + { + PLAYaudioPara para; + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextSample = ntohl(para.nextSample); + para.samplesPerSecond = ntohl(para.samplesPerSecond); + para.samplesPerPacket = ntohl(para.samplesPerPacket); + para.ABsamples = ntohl(para.ABsamples); + para.spslimit = ntohl(para.spslimit); +#endif + nextsample = para.nextSample; + cmdsn = para.sn; + sps = para.samplesPerSecond; + spslimit = para.spslimit; + spp = para.samplesPerPacket; + addSamples = para.ABsamples / 2; + if (spp * audioPara.bytesPerSample > databuf_size) { + spp = databuf_size / audioPara.bytesPerSample; + } + /* + SFprintf(stderr, "AS got CmdPLAY: sps %d\n", sps); + */ + } + /* + fprintf(stderr, "AS: nextSampe=%d for PLAY.\n", para.nextSample); + */ + + upp = (int)(1000000.0 / ((double)sps / (double)spp)); + nextTime = get_usec(); + + CmdWrite((char *)&nextTime, sizeof(int)); + + if (live_source) { + StartPlayLiveAudio(); + } + + for (;;) + { + fd_set read_mask, write_mask; + struct timeval tval; + unsigned curTime = get_usec(); + + if (hasdata) { + if (addSamples < - spp) { /* slow down by not sending packets */ + nextTime += upp; + addSamples += spp; + } + else { + int need_sleep = 0; + while (nextTime <= curTime && hasdata) { + if (need_sleep) usleep(5000); + hasdata = SendPacket(); + need_sleep = 1; + packets ++; + nextTime += upp; + if (addSamples > 0 && packets % SPEEDUP_SCALE == 0) { + addSamples -= spp; + usleep(5000); + hasdata = SendPacket(); + packets ++; + } + } + } + } + curTime = nextTime - curTime; + if (curTime > 5000000) curTime = 5000000; /* limit on 5 second weit time + in case error happens */ + tval.tv_sec = curTime / 1000000; + tval.tv_usec = curTime % 1000000; + FD_ZERO(&read_mask); + FD_SET(serviceSocket, &read_mask); + FD_SET(audioSocket, &read_mask); +#ifdef _HPUX_SOURCE + if (select(nfds, (int *)&read_mask, NULL, NULL, hasdata ? &tval : NULL) == -1) +#else + if (select(nfds, &read_mask, NULL, NULL, hasdata ? &tval : NULL) == -1) +#endif + { + if (errno == EINTR) + continue; + ACE_OS::perror ("AS error on select reading or writing"); + return(-1); + } + if (FD_ISSET(serviceSocket, &read_mask)){ /* STOP, SPEED, or CLOSE*/ + unsigned char tmp; + result = CmdRead((char *)&tmp, 1); + if (result != 0) + return result; + switch (tmp) + { + case CmdSPEED: + { + SPEEDaudioPara para; + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.samplesPerSecond = ntohl(para.samplesPerSecond); + para.samplesPerPacket = ntohl(para.samplesPerPacket); + para.spslimit = ntohl(para.spslimit); +#endif + sps = para.samplesPerSecond; + spslimit = para.spslimit; + spp = para.samplesPerPacket; + if (spp * audioPara.bytesPerSample > databuf_size) { + spp = databuf_size / audioPara.bytesPerSample; + } + delta_sps = 0; /* reset compensation value */ + upp = (int)(1000000.0 / ((double)sps / (double)spp)); + /* + SFprintf(stderr, "AS got CmdSPEED: sps %d\n", sps); + */ + } + break; + case CmdSTOP: + { + int val; + cmd = tmp; + /* + fprintf(stderr, "AS: CmdSTOP. . .\n"); + */ + result = CmdRead((char *)&val, sizeof(int)); + if (result != 0) + return result; + /* + CmdWrite(AUDIO_STOP_PATTERN,ACE_OS::strlen (AUDIO_STOP_PATTERN)); + */ + if (live_source) { + StopPlayLiveAudio(); + } + return 0; /* return from PLAYaudio() */ + } + case CmdCLOSE: + if (live_source) { + StopPlayLiveAudio(); + } + return(1); /* The whole AS session terminates */ + default: + if (live_source) { + StopPlayLiveAudio(); + } + fprintf(stderr, "AS error: cmd=%d while expects STOP/SPEED/CLOSE.\n", tmp); + return(-1); + } + } + + if (FD_ISSET(audioSocket, &read_mask)){ /* Feedback packet */ + int bytes, len; + for (;;) { + if (conn_tag >= 0) { + len = wait_read_bytes(audioSocket, (char *)fbpara, sizeof(*fbpara)); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read1 FB"); + return(-1); + } + } + else { /* discard mode packet stream, read the whole packet */ + len = ACE_OS::read (audioSocket, (char *)fbpara, FBBUF_SIZE); + } + if (len == -1) { + if (errno == EINTR) continue; /* interrupt */ + else { + if (errno != EPIPE && errno != ECONNRESET)ACE_OS::perror ("AS failed to ACE_OS::read () fbmsg header"); + break; + } + } + break; + } + if (len < sizeof(*fbpara)) { + if (len > 0) fprintf(stderr, + "AS warn ACE_OS::read () len %dB < sizeof(*fbpara) %dB\n", + len, sizeof(*fbpara)); + continue; + } +#ifdef NeedByteOrderConversion + fbpara->type = ntohl(fbpara->type); +#endif + bytes = (fbpara->type > 0) ? + sizeof(APdescriptor) * (fbpara->type - 1) : + 0; + if (bytes > 0) { + if (conn_tag >= 0) { /* not discard mode packet stream, + read the rest of packet */ + len = wait_read_bytes(audioSocket, + ((char *)fbpara) + sizeof(*fbpara), + bytes); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read2 FB"); + return(-1); + } + len += sizeof(*fbpara); + } + } + bytes += sizeof(*fbpara); + if (len < bytes) { + if (len > 0) fprintf(stderr, + "AS only read partial FBpacket, %dB out of %dB.\n", + len, bytes); + continue; + } + if (live_source) { /* ignore all feedback messags for live source */ + continue; + } + +#ifdef NeedByteOrderConversion + fbpara->cmdsn = ntohl(fbpara->cmdsn); +#endif + if (len != sizeof(*fbpara) + + (fbpara->type ? (fbpara->type -1) * sizeof(APdescriptor) : 0)) { + /* unknown message, discard */ + SFprintf(stderr, "AS Unkown fb msg: len = %d, type = %d\n", + len, fbpara->type); + continue; + } + if (fbpara->cmdsn != cmdsn) { /* discard the outdated message */ + continue; + } +#ifdef NeedByteOrderConversion + { + int i, * ptr = (int *)fbpara + 2; + for (i = 0; i < (len >> 2) - 2; i++) *ptr = ntohl(*ptr); + } +#endif + if (fbpara->type == 0) { /* feedback message */ + /* + SFprintf(stderr, "AS got fbmsg: addsamples %d, addsps %d\n", + fbpara->data.fb.addSamples, fbpara->data.fb.addsps); + */ + addSamples += fbpara->data.fb.addSamples; + if (fbpara->data.fb.addsps) { + delta_sps += fbpara->data.fb.addsps; + upp = (int)(1000000.0 / ((double)(sps + delta_sps) / (double)spp)); + } + } + else { /* resend requests */ + APdescriptor * req = &(fbpara->data.ap); + int i; + /* + SFprintf(stderr, "AS got %d resend reqs\n", fbpara->type); + */ + for (i = 0; i < fbpara->type; i ++) { + ResendPacket(req->firstSample, req->samples); + req ++; + } + } + } + } +} +#endif + +// our version of play audio. +int +Audio_Global::play_audio(void) +{ + int result; + + ACE_DEBUG ((LM_DEBUG,"(%P|%t) play_audio () called \n")); + + { + PLAYaudioPara para; + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextSample = ntohl(para.nextSample); + para.samplesPerSecond = ntohl(para.samplesPerSecond); + para.samplesPerPacket = ntohl(para.samplesPerPacket); + para.ABsamples = ntohl(para.ABsamples); + para.spslimit = ntohl(para.spslimit); +#endif + nextsample = para.nextSample; + cmdsn = para.sn; + sps = para.samplesPerSecond; + spslimit = para.spslimit; + spp = para.samplesPerPacket; + addSamples = para.ABsamples / 2; + if (spp * audioPara.bytesPerSample > databuf_size) { + spp = databuf_size / audioPara.bytesPerSample; + } + /* + SFprintf(stderr, "AS got CmdPLAY: sps %d\n", sps); + */ + } + /* + fprintf(stderr, "AS: nextSampe=%d for PLAY.\n", para.nextSample); + */ + + upp = (int)(1000000.0 / ((double)sps / (double)spp)); + nextTime = get_usec(); + + CmdWrite((char *)&nextTime, sizeof(int)); + if (live_source) { + StartPlayLiveAudio(); + } + this->send_audio (); +} + +int +Audio_Global::send_audio (void) +{ + unsigned curTime = get_usec(); + + if (hasdata) { + if (addSamples < - spp) { /* slow down by not sending packets */ + /* ACE_DEBUG ((LM_DEBUG,"(%P|%t) slow down by not sending\n")); */ + nextTime += upp; + addSamples += spp; + } + else { + /* ACE_DEBUG ((LM_DEBUG,"(%P|%t) sending." + "nexttime = %d, curTime = %d, hasdata = %d\n", + nextTime, curTime, hasdata)); */ + int need_sleep = 0; + while ( (nextTime <= curTime) && (hasdata)) { + if (need_sleep) usleep(5000); + hasdata = SendPacket(); + need_sleep = 1; + packets ++; + nextTime += upp; + if (addSamples > 0 && packets % SPEEDUP_SCALE == 0) { + addSamples -= spp; + usleep(5000); + hasdata = SendPacket(); + packets ++; + } + } + } + } + curTime = nextTime - curTime; + if (curTime > 5000000) curTime = 5000000; /* limit on 5 second weit time + in case error happens */ + tval.tv_sec = curTime / 1000000; + tval.tv_usec = curTime % 1000000; + + if (hasdata) + { + // schedule a sigalrm to simulate select timeout. + ACE_Time_Value tv (tval); + ACE_OS::ualarm (tv,0); + } + return 0; +} + + +void +Audio_Global::on_exit_routine(void) +{ + struct sockaddr_in peeraddr_in; + int size = sizeof(peeraddr_in); + + /* + fprintf(stderr, "An AS session terminated\n"); + */ + if (ACE_OS::getpeername(serviceSocket, + (struct sockaddr *)&peeraddr_in, &size) == 0 && + peeraddr_in.sin_family == AF_INET) { + if (strncmp(inet_ntoa(peeraddr_in.sin_addr), "129.95.50", 9)) { + struct hostent *hp; + time_t val =ACE_OS::time (NULL); + char * buf = ACE_OS::ctime (&start_time); + + hp = ACE_OS::gethostbyaddr((char *)&(peeraddr_in.sin_addr), 4, AF_INET); + buf[strlen(buf)-1] = 0; + printf("%s: %s %3dm%02ds %dB %s\n", + buf, + hp == NULL ? inet_ntoa(peeraddr_in.sin_addr) : hp->h_name, + (val - start_time) / 60, (val - start_time) % 60, + bytes_sent, audioFile); + } + } + ComCloseConn(serviceSocket); + ComCloseConn(audioSocket); +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Video_Global, TAO_SYNCH_MUTEX>; +template class ACE_Singleton<Audio_Global, TAO_SYNCH_MUTEX>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Video_Global, TAO_SYNCH_MUTEX> +#pragma instantiate ACE_Singleton<Audio_Global, TAO_SYNCH_MUTEX> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h new file mode 100644 index 00000000000..9eba48df67d --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h @@ -0,0 +1,399 @@ +/* -*- C++ -*- */ +// $Id$ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#ifndef MPEG_GLOBAL_H +#define MPEG_GLOBAL_H + +#include "ace/SOCK_CODgram.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// Global symbols, these need to become enums eventually. + +#define SESSION_NUM 4 +#define CONN_INET 1 +#define CONN_UNIX 2 +#define CONN_ATM 3 + +#define SERVER_FDTABLE_SIZE 50 +#define CLIENT_FDTABLE_SIZE 10 + +#define STATE_PENDING 1 +#define STATE_CONTROL 2 +#define STATE_DATA 3 +#define STATE_SINGLE 4 + +#define min(a, b) ((a) > (b) ? (b) : (a)) +#define max(a, b) ((a) > (b) ? (a) : (b)) + +/* Start codes. */ + +#define READ_BLOCK_SIZE 512 +#define MAX_TIMER_ADJUST (100 * SPEEDUP_INV_SCALE) + +#define SEQ_END_CODE 0x000001b7 +#define SEQ_START_CODE 0x000001b3 +#define GOP_START_CODE 0x000001b8 +#define PICTURE_START_CODE 0x00000100 +#define SLICE_MIN_START_CODE 0x00000101 +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 + +// Global definitions +#define nextByte {int val; fileptr ++; \ + if ((val = getc(VIDEO_SINGLETON::instance ()->fp)) == EOF) \ + {\ + perror("Crossed EOF or error while scanning"); \ + return 1; \ + } nb = val;} + +#define computePicSize \ + if (inpic) \ + { \ + if (pictype == 'I') \ + { \ + VIDEO_SINGLETON::instance ()->maxI = max(VIDEO_SINGLETON::instance ()->maxI, (int)(fileptr - picptr - 4)); \ + VIDEO_SINGLETON::instance ()->minI = min(VIDEO_SINGLETON::instance ()->minI, (int)(fileptr - picptr - 4)); \ + } \ + else if (pictype == 'P') \ + { \ + VIDEO_SINGLETON::instance ()->maxP = max(VIDEO_SINGLETON::instance ()->maxP, (int)(fileptr - picptr - 4)); \ + VIDEO_SINGLETON::instance ()->minP = min(VIDEO_SINGLETON::instance ()->minP, (int)(fileptr - picptr - 4)); \ + } \ + else \ + { \ + VIDEO_SINGLETON::instance ()->maxB = max(VIDEO_SINGLETON::instance ()->maxB, (int)(fileptr - picptr - 4)); \ + VIDEO_SINGLETON::instance ()->minB = min(VIDEO_SINGLETON::instance ()->minB, (int)(fileptr - picptr - 4)); \ + } \ + VIDEO_SINGLETON::instance ()->frameTable[ftptr].type = pictype; \ + VIDEO_SINGLETON::instance ()->frameTable[ftptr++].size = (int)(fileptr - picptr - 4); \ + inpic = 0; \ + } + + +#define FileRead(position, buf, size) \ + { \ + if (fseek(VIDEO_SINGLETON::instance ()->fp, (position), 0) == -1) \ + { \ + perror("VS error on fseek VideoFile"); \ + return (-1); \ + } \ + while (fread((buf), (size), 1, VIDEO_SINGLETON::instance ()->fp) == 0) \ + { if (errno == EINTR) { errno = 0; continue;}\ + perror("VS error on fread VideoFile"); \ + return (-1); \ + } \ + } + +#define CheckFrameRange(pnextFrame) \ +{ if ((pnextFrame) < 0 || (pnextFrame) >= VIDEO_SINGLETON::instance ()->numF) \ + { fprintf(stderr, "VS: %d.VIDEO_SINGLETON::instance ()->nextFrame(%d) out of range (%d).\n", VIDEO_SINGLETON::instance ()->cmd, (pnextFrame), VIDEO_SINGLETON::instance ()->numF); \ + return 0; } } + +#define CheckGroupRange(pnextGroup) \ +{ if ((pnextGroup) < 0 || (pnextGroup) >= VIDEO_SINGLETON::instance ()->numG) \ + { fprintf(stderr, "VS: %d.VIDEO_SINGLETON::instance ()->nextGroup(%d) out of range (%d).\n", VIDEO_SINGLETON::instance ()->cmd, (pnextGroup), VIDEO_SINGLETON::instance ()->numG); \ + return 0; } } + +#include "ace/Singleton.h" +#include "include/common.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "mpeg_shared/sendpt.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_server/Video_Server.h" +#include "mpeg_shared/Video_ControlS.h" +#include "mpeg_shared/Audio_ControlS.h" + +class Mpeg_Global +{ +public: + static int parentpid; + + static int listenSocketIn; + static int listenSocketUn; + + static struct linger linger; + + static int live_audio; + static int live_video; /* 0 - no, 1 - to open, 2 - opened */ + + static int drift_ppm; /* clock drift in ppm */ + + static int session_limit; + static int session_num; + static int rttag; +}; + +class Video_Global +{ +public: + Video_Global (); + + ACE_SOCK_CODgram dgram; + // the UDP data socket + + char *data_host; + // name of the host to bind to. + int live_source; + int video_format; + + int pkts_sent; + time_t start_time; + + int conn_tag; + + int normalExit; + + int serviceSocket; + int videoSocket; + + char videoFile[PATH_SIZE]; + FILE *fp; + int needHeader; + int lastRef[2]; + int lastRefPtr; + int currentUPF; + int addedUPF; + int addedSignals; + int VStimeAdvance; + double fps; /* current frames-per-second: playback speed */ + double frameRateLimit; + + VideoPacket * packet; + int packetBufSize; + int msgsn; + int packetsn; + int msgsize; + + unsigned char precmd; + unsigned char cmd; + int cmdsn; + int nextFrame; + int nextGroup; + int firstPatternSize; + char *firstSendPattern; + int sendPatternGops; + char sendPattern [PATTERN_SIZE]; + +#ifdef STAT + char * framesSent; +#endif + + int fileSize; + int maxS; + int maxG; + int maxI; + int maxP; + int maxB; + int minS; + int minG; + int minI; + int minP; + int minB; + int numS; + int numG; + int numF; + int numI; + int numP; + int numB; + int averageFrameSize; + int horizontalSize; + int verticalSize; + int pelAspectRatio; + int pictureRate; + int vbvBufferSize; + int firstGopFrames; + int patternSize; + char pattern [PATTERN_SIZE]; + + struct SystemHeader + { + long offset; + int size; + } * systemHeader; + + struct GopTable + { + int systemHeader; + long offset; + int headerSize; + int size; + int totalFrames; + int previousFrames; + long firstIoffset; + } * gopTable; + + struct FrameTable + { + char type; + unsigned short size; + } * frameTable; + + int preGroup; + int preHeader; + int preFrame; + + // fast video play locals + Video_Control::FFpara fast_para; + Video_Control::PLAYpara play_para; + int fast_preGroup; + int fast_preHeader; + + // globals functions + int CmdRead (char *buf, int psize); + int CmdWrite (char *buf, int size); + int SendPacket (int shtag, + int gop, + int frame, + int timeToUse, + int first_time = 0); + int FBread (char *buf, int size); + int PLAYliveVideo (PLAYpara * para); + void ComputeFirstSendPattern (float limit); + int FrameToGroup (int * frame); + int SendReferences (int group, int frame); + int send_to_network (int timeToUse); + int first_packet_send_to_network (int timeToUse); + int GetFeedBack (void); + int SendPicture (int *frame); + int ReadInfoFromFile (void); + void WriteInfoToFile (void); + int init_MPEG1_video_file (void); + int play_send (int debug=0); + int fast_play_send (void); + int position (void); + int step_video (void); + int fast_forward (void); + int fast_backward (void); + int stat_stream (void); + int stat_sent (void); + int init_play (Video_Control::PLAYpara para, + CORBA::Long_out vts); + CORBA::Boolean init_fast_play (const Video_Control::FFpara ¶); + int init_video (void); +}; + +typedef ACE_Singleton <Video_Global, TAO_SYNCH_MUTEX> VIDEO_SINGLETON; + +class Video_Timer_Global +// A class that holds the static timer variables defined in the middle +// of vs.cpp +{ +public: + static int timerHeader; + static int timerGroup; + static int timerFrame; + static int timerOn ; + static int timerAdjust ; + static int preTimerVal ; + static void StartTimer (void); + static void StopTimer(void); + static void TimerSpeed(void); + static void TimerProcessing(void); + static void timerHandler (int sig); +}; + +#define DATABUF_SIZE 500 + +#define SPEEDUP_SCALE 5 +#define MAX_RESEND_REQS 10 +#define FBBUF_SIZE (sizeof(AudioFeedBackPara) + \ + (MAX_RESEND_REQS - 1) * sizeof(APdescriptor)) + + + + class Audio_Global + { + public: + Audio_Global (void); + // Default constructor. + int CmdRead(char *buf, int psize); + void CmdWrite(char *buf, int size); + int INITaudio(void); + int send_packet(int firstSample, int samples); + int SendPacket(void); + void ResendPacket(int firstsample, int samples); + int PLAYaudio(void); + int play_audio (void); + int send_audio (void); + void on_exit_routine(void); + + public: + + char *data_host; + enum audio_state {AUDIO_WAITING = 0,AUDIO_PLAY =1}; + + audio_state state; + // The state of the audio server. + + // playaudio members + int packets; + int hasdata; + struct timeval tval; + + int addSamples; + unsigned nextTime; + int upp; /* micro-seconds per packet */ + int delta_sps ; + // The members previously in PLAY audio. + + int bytes_sent ; + time_t start_time; + + int conn_tag; + + int serviceSocket; + int audioSocket ; + + char audioFile[PATH_SIZE]; + int fd; + Audio_Control::AudioParameter audioPara; + int totalSamples; + int fileSize; + unsigned char cmd; + int live_source ; + + int databuf_size; + int cmdsn; + int nextsample; + int sps; /* audio play speed given by the client: samples per second */ + int spslimit; + int spp; /* samples per packet */ + AudioPacket * pktbuf ; + AudioFeedBackPara * fbpara ; + }; + +typedef ACE_Singleton <Audio_Global,TAO_SYNCH_MUTEX> AUDIO_GLOBAL; + + +#endif /* define MPEG_GLOBAL_H */ + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile new file mode 100644 index 00000000000..30f620b5f09 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile @@ -0,0 +1,4294 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +MAKEFILE = Makefile +LIBNAME = libmpeg_server +LIB2 = $(LIBNAME).a +SHLIB2 = $(LIBNAME).$(SOEXT) + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +FILES= as las lvs vs Globals Video_Server Video_Control_State Video_Control_i Audio_Server Audio_Control_State Audio_Control_i + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) + + +LDLIBS += -lTAO_AV -lTAO_CosNaming -lTAO +MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source +CPPFLAGS += -I$(MPEG_ROOT) + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + LIB = $(LIB2) + SHLIB = $(SHLIB2) +else + override INSTALL = +endif # ! AV + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +CPPFLAGS += -DSH_MEM $(PLATFORM_X11_CPPFLAGS) + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/as.o .obj/as.so .shobj/as.o .shobj/as.so: as.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + server_proto.h Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i + +.obj/las.o .obj/las.so .shobj/las.o .shobj/las.so: las.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + server_proto.h Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i + +.obj/lvs.o .obj/lvs.so .shobj/lvs.o .shobj/lvs.so: lvs.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + server_proto.h Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i + +.obj/vs.o .obj/vs.so .shobj/vs.o .shobj/vs.so: vs.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + server_proto.h Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i + +.obj/Globals.o .obj/Globals.so .shobj/Globals.o .shobj/Globals.so: Globals.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i + +.obj/Video_Server.o .obj/Video_Server.so .shobj/Video_Server.o .shobj/Video_Server.so: Video_Server.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp + +.obj/Video_Control_State.o .obj/Video_Control_State.so .shobj/Video_Control_State.o .shobj/Video_Control_State.so: Video_Control_State.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Video_Control_State.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + Video_Server.h + +.obj/Video_Control_i.o .obj/Video_Control_i.so .shobj/Video_Control_i.o .shobj/Video_Control_i.so: Video_Control_i.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp + +.obj/Audio_Server.o .obj/Audio_Server.so .shobj/Audio_Server.o .shobj/Audio_Server.so: Audio_Server.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Audio_Server.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + server_proto.h Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + Audio_Control_i.h Audio_Control_State.h + +.obj/Audio_Control_State.o .obj/Audio_Control_State.so .shobj/Audio_Control_State.o .shobj/Audio_Control_State.so: Audio_Control_State.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Audio_Control_State.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + Audio_Control_i.h Audio_Server.h server_proto.h + +.obj/Audio_Control_i.o .obj/Audio_Control_i.so .shobj/Audio_Control_i.o .shobj/Audio_Control_i.so: Audio_Control_i.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + Audio_Control_State.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + Audio_Control_i.h Audio_Server.h server_proto.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile.am new file mode 100644 index 00000000000..34b5e2dd2ca --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Makefile.am @@ -0,0 +1,52 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- +## mpeg/source/mpeg_server directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_LTLIBRARIES = libmpeg_server + +libmpeg_server_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +libmpeg_server_SOURCES = \ + Audio_Control_State.cpp \ + Audio_Control_i.cpp \ + Audio_Server.cpp \ + Globals.cpp \ + Video_Control_State.cpp \ + Video_Control_i.cpp \ + Video_Server.cpp \ + as.cpp \ + las.cpp \ + lvs.cpp \ + vs.cpp + +noinst_HEADERS = \ + Audio_Control_State.h \ + Audio_Control_i.h \ + Audio_Server.h \ + Globals.h \ + Video_Control_State.h \ + Video_Control_i.h \ + Video_Server.h \ + server_proto.h + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.cpp new file mode 100644 index 00000000000..72141455745 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.cpp @@ -0,0 +1,498 @@ +// $Id$ + +#include "ace/OS.h" +#include "Video_Control_State.h" +#include "Video_Server.h" + +ACE_RCSID(mpeg_server, Video_Control_State, "$Id$") + +Video_Control_State::Video_Control_State () + : vci_ (VIDEO_CONTROL_I::instance ()) +{ +} + +Video_Control_State::Video_States +Video_Control_State::get_state (void) +{ + return this->state_; +} + +CORBA::Boolean +Video_Control_State::init_video (const Video_Control::INITvideoPara &init_para, + Video_Control::INITvideoReply_out reply) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Video_Control_State::init_video called\n")); + int failureType = 0; + // This is independent of the state and hence we implement it here + + // video file string + for (int i=0;i<init_para.videofile.length (); i++) + VIDEO_SINGLETON::instance ()->videoFile[i] = init_para.videofile[i]; + + VIDEO_SINGLETON::instance ()->videoFile [init_para.videofile.length ()] = 0; + + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || init_para.version != VERSION) { + return 0; + // ~~ We should be throwing exceptions here. + } + VIDEO_SINGLETON::instance ()->cmdsn = init_para.sn; + /* + fprintf (stderr, "MPEG file %s got.\n", VIDEO_SINGLETON::instance ()->videoFile); + */ + if (!strncasecmp ("LiveVideo", VIDEO_SINGLETON::instance ()->videoFile, 9)) { + if (OpenLiveVideo (&VIDEO_SINGLETON::instance ()->video_format, &VIDEO_SINGLETON::instance ()->horizontalSize, + &VIDEO_SINGLETON::instance ()->verticalSize, &VIDEO_SINGLETON::instance ()->averageFrameSize, + &VIDEO_SINGLETON::instance ()->fps, &VIDEO_SINGLETON::instance ()->pelAspectRatio) == -1) { + failureType = 100; + return 0; + } + if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG2) { + failureType = 101; + return 0; + } + VIDEO_SINGLETON::instance ()->live_source = 1; + + VIDEO_SINGLETON::instance ()->fileSize =0x7fffffff; + VIDEO_SINGLETON::instance ()->maxS = VIDEO_SINGLETON::instance ()->maxG = VIDEO_SINGLETON::instance ()->maxI = VIDEO_SINGLETON::instance ()->maxP = VIDEO_SINGLETON::instance ()->maxB = VIDEO_SINGLETON::instance ()->minS = VIDEO_SINGLETON::instance ()->minG = VIDEO_SINGLETON::instance ()->minI = VIDEO_SINGLETON::instance ()->minP = VIDEO_SINGLETON::instance ()->minB = 1; + VIDEO_SINGLETON::instance ()->numS = VIDEO_SINGLETON::instance ()->numG = VIDEO_SINGLETON::instance ()->numF = VIDEO_SINGLETON::instance ()->numI = 0x7fffffff; + VIDEO_SINGLETON::instance ()->numP = VIDEO_SINGLETON::instance ()->numB = 0; + VIDEO_SINGLETON::instance ()->vbvBufferSize = 1; + VIDEO_SINGLETON::instance ()->firstGopFrames = 1; + VIDEO_SINGLETON::instance ()->patternSize = 1; + VIDEO_SINGLETON::instance ()->pattern[0] = 'I'; + VIDEO_SINGLETON::instance ()->pattern[1] = 0; + VIDEO_SINGLETON::instance ()->packetBufSize = VIDEO_SINGLETON::instance ()->verticalSize * VIDEO_SINGLETON::instance ()->horizontalSize * 3; + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)ACE_OS::malloc (sizeof (VideoMessage) + sizeof (VideoPacket) + + VIDEO_SINGLETON::instance ()->packetBufSize); + if (VIDEO_SINGLETON::instance ()->packet == NULL) + { + perror ("Error: VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->packet buffer"); + exit (1); + } + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *) ((char *)VIDEO_SINGLETON::instance ()->packet + sizeof (VideoMessage)); + + } + else { + static double pictureRateTable[] = {23.976, 24, 25, 29.97, 30, 50, 59.94, 60}; + + VIDEO_SINGLETON::instance ()->video_format = VIDEO_MPEG1; + failureType = VIDEO_SINGLETON::instance ()->init_MPEG1_video_file (); + if (failureType) + return 0; + VIDEO_SINGLETON::instance ()->fps = pictureRateTable[VIDEO_SINGLETON::instance ()->pictureRate - 1]; + } + + // Set the Reply parameter values + ACE_NEW_RETURN (reply, + Video_Control::INITvideoReply, + 0); + + reply->totalHeaders = VIDEO_SINGLETON::instance ()->numS; + reply->totalGroups = VIDEO_SINGLETON::instance ()->numG; + reply->totalFrames = VIDEO_SINGLETON::instance ()->numF; + reply->sizeIFrame = VIDEO_SINGLETON::instance ()->maxI; + reply->sizePFrame = VIDEO_SINGLETON::instance ()->maxP; + reply->sizeBFrame = VIDEO_SINGLETON::instance ()->maxB; + reply->sizeSystemHeader = VIDEO_SINGLETON::instance ()->maxS; + reply->sizeGop = VIDEO_SINGLETON::instance ()->maxG; + reply->averageFrameSize = VIDEO_SINGLETON::instance ()->averageFrameSize; + reply->verticalSize = VIDEO_SINGLETON::instance ()->verticalSize; + reply->horizontalSize = VIDEO_SINGLETON::instance ()->horizontalSize; + reply->pelAspectRatio = VIDEO_SINGLETON::instance ()->pelAspectRatio; + reply->pictureRate1000 = (int) (VIDEO_SINGLETON::instance ()->fps * 1000); + reply->vbvBufferSize = VIDEO_SINGLETON::instance ()->vbvBufferSize; + reply->firstGopFrames = VIDEO_SINGLETON::instance ()->firstGopFrames; + + reply->pattern.length (VIDEO_SINGLETON::instance ()->patternSize); + + int i = 0; + + // copy the sequence of char.. + for ( i = 0; i < VIDEO_SINGLETON::instance ()->patternSize; i++) + reply->pattern [i] = VIDEO_SINGLETON::instance ()->pattern [i]; + + reply->live = VIDEO_SINGLETON::instance ()->live_source; + reply->format = VIDEO_SINGLETON::instance ()->video_format; + + /* write the first SH, GOP and IFrame to VIDEO_SINGLETON::instance ()->serviceSocket (TCP), + using code for SendPacket () */ + { + + // ~~ He sends the first frame thru the connected TCP socket, + // we replace it to send thru the UDP data socket instead!! + if (VIDEO_SINGLETON::instance ()->live_source) StartPlayLiveVideo (); + + if (VIDEO_SINGLETON::instance ()->live_source) { + int frame = 0; + VIDEO_SINGLETON::instance ()->SendPicture (&frame); + } + else if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG1) { + VIDEO_SINGLETON::instance ()->SendPacket (1, 0, 0, 0, 1); // + // make the first_time flag = 1, so that the packet gets sent + // correctly using UDP + } + else { + fprintf (stderr, "VS: VIDEO_SINGLETON::instance ()->video_format %d not supported.\n", + VIDEO_SINGLETON::instance ()->video_format); + } + if (VIDEO_SINGLETON::instance ()->live_source) StopPlayLiveVideo (); + } + return 1; +} + + +CORBA::Boolean +Video_Control_State::stat_stream (CORBA::Char_out ch, + CORBA::Long_out size) + +{ + return 0; +} + + +void +Video_Control_State::close (void) +{ + return; +} + + +CORBA::Boolean +Video_Control_State::stat_sent (void) +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::fast_forward (const Video_Control::FFpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::fast_backward (const Video_Control::FFpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::step (const Video_Control::STEPpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::position (const Video_Control::POSITIONpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::speed (const Video_Control::SPEEDpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_State::stop (CORBA::Long cmdsn) + +{ + return 0; +} + +// ---------------------------------------------------------------------- + +Video_Control_Waiting_State::Video_Control_Waiting_State (void) +{ + //%% + this->state_ = VIDEO_WAITING; +} + +CORBA::Boolean +Video_Control_Waiting_State::stat_stream (CORBA::Char_out ch, + CORBA::Long_out size) + +{ + return 0; +} + +void +Video_Control_Waiting_State::close (void) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Waiting_State::close \n")); + VIDEO_SINGLETON::instance ()->normalExit = 1; + TAO_ORB_Core_instance ()->reactor ()->end_event_loop (); + return ; +} + + +CORBA::Boolean +Video_Control_Waiting_State::stat_sent (void) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Waiting_State::stat_sent \n")); + return 0; +} + +// We are in the waiting state - and the client sent us +// the command fast-forward. +CORBA::Boolean +Video_Control_Waiting_State::fast_forward (const Video_Control::FFpara ¶) + +{ + // Many guys in legacy code depend on this variable. + VIDEO_SINGLETON::instance ()-> cmd = CmdFF; + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_Waiting_State::fast_forward () called\n")); + VIDEO_SINGLETON::instance ()->init_fast_play (para); + this->vci_->change_state (VIDEO_CONTROL_FAST_FORWARD_STATE::instance ()); + return 1; +} + + +// We are in the waiting state - and the client sent us +// the command fast-backward. +CORBA::Boolean +Video_Control_Waiting_State::fast_backward (const Video_Control::FFpara ¶) + +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_Waiting_State::fast_backward () called\n")); + // Many guys in legacy code depend on this variable. + VIDEO_SINGLETON::instance ()-> cmd = CmdFB; + VIDEO_SINGLETON::instance ()->init_fast_play (para); + this->vci_->change_state (VIDEO_CONTROL_FAST_BACKWARD_STATE::instance ()); + return 1; +} + + +CORBA::Boolean +Video_Control_Waiting_State::step (const Video_Control::STEPpara ¶) + +{ + Video_Control::STEPpara step_para = para; + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_Waiting_State::step () called\n")); + + int group; + int tag = 0; + int result; + + VIDEO_SINGLETON::instance ()->cmdsn = step_para.sn; + + if (!VIDEO_SINGLETON::instance ()-> live_source) { + if (step_para.nextFrame >= VIDEO_SINGLETON::instance ()->numF) /* send SEQ_END */ + { + tag = 1; + step_para.nextFrame --; + } + /* + fprintf (stderr, "STEP . . .frame-%d\n", step_para.this->nextFrame); + */ + CheckFrameRange (step_para.nextFrame); + group = VIDEO_SINGLETON::instance ()->FrameToGroup (&step_para.nextFrame); + if (VIDEO_SINGLETON::instance ()-> precmd != CmdSTEP && !tag ) { + result = VIDEO_SINGLETON::instance ()->SendReferences (group, step_para.nextFrame); + if (result < 0 ) + return 0; + } + } + if (VIDEO_SINGLETON::instance ()->live_source) + StartPlayLiveVideo (); + + if (VIDEO_SINGLETON::instance ()->live_source) { + VIDEO_SINGLETON::instance ()->SendPicture (&step_para.nextFrame); + } + else if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG1) { + VIDEO_SINGLETON::instance ()->SendPacket (VIDEO_SINGLETON::instance ()->numS>1, group, tag ? VIDEO_SINGLETON::instance ()->numF : step_para.nextFrame, 0); + } + else { + fprintf (stderr, "VS: wierd1\n"); + } + + if (VIDEO_SINGLETON::instance ()->live_source) StopPlayLiveVideo (); + return 1; +} + + +CORBA::Boolean +Video_Control_Waiting_State::play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts) + +{ + // Many guys in legacy code depend on this variable. + VIDEO_SINGLETON::instance ()-> cmd = CmdPLAY; + //ACE_DEBUG ((LM_DEBUG, + // "(%P|%t)Video_Control_Waiting_State::play () called \n")); + VIDEO_SINGLETON::instance ()->init_play (para, + vts); + // cerr << "vts is " << vts << endl; + this->vci_->change_state (VIDEO_CONTROL_PLAY_STATE::instance ()); + return 1; +} + + +CORBA::Boolean +Video_Control_Waiting_State::position (const Video_Control::POSITIONpara &pos_para) + +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_Waiting_State::position () called \n")); + + if (VIDEO_SINGLETON::instance ()->live_source) + return 1; + + CheckGroupRange (pos_para.nextGroup); + VIDEO_SINGLETON::instance ()-> cmd = CmdPOSITION; + VIDEO_SINGLETON::instance ()-> cmdsn = pos_para.sn; + + int result = VIDEO_SINGLETON::instance ()->SendPacket + (VIDEO_SINGLETON::instance () ->numS > 1 + || pos_para.nextGroup == 0, + pos_para.nextGroup, 0, 0); + + return 1; +} + + +CORBA::Boolean +Video_Control_Waiting_State::speed (const Video_Control::SPEEDpara ¶) + +{ + return 0; +} + + +CORBA::Boolean +Video_Control_Waiting_State::stop (CORBA::Long cmdsn) + +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Waiting_State::stop ()\n")); + VIDEO_SINGLETON::instance ()->cmd = CmdSTOP; + VIDEO_SINGLETON::instance ()->cmdsn = cmdsn; + Video_Timer_Global::StopTimer(); + this->vci_->change_state (VIDEO_CONTROL_WAITING_STATE::instance ()); + return 1; +} + +// Video_Control_Play_State methods + +Video_Control_Play_State::Video_Control_Play_State (void) +{ + this->state_ = VIDEO_PLAY; +} + +CORBA::Boolean +Video_Control_Play_State::stop (CORBA::Long cmdsn) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Play_State::stop ()\n")); + VIDEO_SINGLETON::instance ()->cmd = CmdSTOP; + VIDEO_SINGLETON::instance ()->cmdsn = cmdsn; + Video_Timer_Global::StopTimer(); + this->vci_->change_state (VIDEO_CONTROL_WAITING_STATE::instance ()); + return 1; +} + + +CORBA::Boolean +Video_Control_Play_State::speed (const Video_Control::SPEEDpara ¶) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Play_State::speed ()\n")); + VIDEO_SINGLETON::instance ()->frameRateLimit = para.frameRateLimit1000 / 1000.0; + VIDEO_SINGLETON::instance ()->sendPatternGops = para.sendPatternGops; + VIDEO_SINGLETON::instance ()->currentUPF = para.usecPerFrame; + VIDEO_SINGLETON::instance ()->addedUPF = 0; + + for (int i=0; i<para.sendPattern.length (); i++) + VIDEO_SINGLETON::instance ()->sendPattern [i] = para.sendPattern [i]; + // ACE_OS::memcpy (VIDEO_SINGLETON::instance ()->sendPattern, para.sendPattern, PATTERN_SIZE); + + Video_Timer_Global::TimerSpeed (); + VIDEO_SINGLETON::instance ()->play_send (); + return 1; +} + + +Video_Control_Fast_Forward_State::Video_Control_Fast_Forward_State (void) +{ + this->state_ = VIDEO_FAST_FORWARD; +} + +CORBA::Boolean +Video_Control_Fast_Forward_State::stop (CORBA::Long cmdsn) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Fast_Forward_State::stop ()\n")); + VIDEO_SINGLETON::instance ()->cmd = CmdSTOP; + VIDEO_SINGLETON::instance ()->cmdsn = cmdsn; + Video_Timer_Global::StopTimer(); + this->vci_->change_state (VIDEO_CONTROL_WAITING_STATE::instance ()); + return 1; +} + +void +Video_Control_Fast_Forward_State::close (void) +{ + return; +} + +// ---------------------------------------------------------------------- + +Video_Control_Fast_Backward_State::Video_Control_Fast_Backward_State (void) +{ + this->state_ = VIDEO_FAST_BACKWARD; +} + +CORBA::Boolean +Video_Control_Fast_Backward_State::stop (CORBA::Long cmdsn) +{ + ACE_DEBUG ((LM_DEBUG, + "Video_Control_Fast_Backward_State::stop ()\n")); + VIDEO_SINGLETON::instance ()->cmd = CmdSTOP; + VIDEO_SINGLETON::instance ()->cmdsn = cmdsn; + Video_Timer_Global::StopTimer(); + this->vci_->change_state (VIDEO_CONTROL_WAITING_STATE::instance ()); + return 1; +} + +void +Video_Control_Fast_Backward_State::close (void) +{ + return; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Video_Control_Play_State, TAO_SYNCH_MUTEX>; +template class ACE_Singleton<Video_Control_Fast_Forward_State, TAO_SYNCH_MUTEX>; +template class ACE_Singleton<Video_Control_Fast_Backward_State, TAO_SYNCH_MUTEX>; +template class ACE_Singleton<Video_Control_Waiting_State, TAO_SYNCH_MUTEX>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Video_Control_Fast_Backward_State, TAO_SYNCH_MUTEX> +#pragma instantiate ACE_Singleton<Video_Control_Play_State, TAO_SYNCH_MUTEX> +#pragma instantiate ACE_Singleton<Video_Control_Fast_Forward_State, TAO_SYNCH_MUTEX> +#pragma instantiate ACE_Singleton<Video_Control_Waiting_State, TAO_SYNCH_MUTEX> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h new file mode 100644 index 00000000000..389d1a68230 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h @@ -0,0 +1,189 @@ +/* -*- C++ -*- */ + +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#ifndef MPEG_VIDEO_CONTROL_STATE_H +#define MPEG_VIDEO_CONTROL_STATE_H + +#include "ace/Singleton.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "mpeg_shared/Video_ControlS.h" +#include "mpeg_server/Video_Control_i.h" + +class Video_Control_i; + +class Video_Control_State +{ + // = TITLE + // Defines an abstract class that is used to implement the state + // pattern for the video control. + // + // = DESCRIPTION + // The various states of the video control are defined by the + // Video_States enum. They can be implemented by subclassing from + // this class and overriding the handle_input method. +public: + Video_Control_State (void); + // constructor + + enum Video_States + { + VIDEO_WAITING, + VIDEO_PLAY = 1, + VIDEO_FAST_FORWARD = 2, + VIDEO_FAST_BACKWARD = 3 + }; + + Video_States get_state (void); + // returns the current state + + void set_state (Video_States state); + // sets the state + + virtual CORBA::Boolean init_video (const Video_Control::INITvideoPara ¶, + Video_Control::INITvideoReply_out reply) ; + + virtual CORBA::Boolean stat_stream (CORBA::Char_out ch, + CORBA::Long_out size); + + virtual void close (void); + + virtual CORBA::Boolean stat_sent (void); + + virtual CORBA::Boolean fast_forward (const Video_Control::FFpara ¶) ; + + virtual CORBA::Boolean fast_backward (const Video_Control::FFpara ¶) ; + + virtual CORBA::Boolean step (const Video_Control::STEPpara ¶) ; + + virtual CORBA::Boolean play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts) ; + + virtual CORBA::Boolean position (const Video_Control::POSITIONpara ¶) ; + + virtual CORBA::Boolean speed (const Video_Control::SPEEDpara ¶) ; + + virtual CORBA::Boolean stop (CORBA::Long cmdsn) ; + +protected: + Video_States state_; + // State of this object + + Video_Control_i *vci_; + +}; + +class Video_Control_Waiting_State : public virtual Video_Control_State +{ + // = TITLE + // Defines a class that implements the waiting state of the video + // control state pattern. +public: + Video_Control_Waiting_State (void); + // Default constructor, sets the state to WAITING + + virtual CORBA::Boolean stat_stream (CORBA::Char_out ch, + CORBA::Long_out size); + + virtual void close (void); + + virtual CORBA::Boolean stat_sent (void); + + virtual CORBA::Boolean fast_forward (const Video_Control::FFpara ¶); + + virtual CORBA::Boolean fast_backward (const Video_Control::FFpara ¶); + + virtual CORBA::Boolean step (const Video_Control::STEPpara ¶); + + + virtual CORBA::Boolean play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts); + + virtual CORBA::Boolean position (const Video_Control::POSITIONpara ¶); + + virtual CORBA::Boolean speed (const Video_Control::SPEEDpara ¶); + + virtual CORBA::Boolean stop (CORBA::Long cmdsn); +}; + +class Video_Control_Play_State : public virtual Video_Control_State +{ + // = TITLE + // Defines a class that implements the playing state of the video + // control state pattern. +public: + Video_Control_Play_State (void); + // Default constructor, sets the state to VIDEO_PLAY + + virtual CORBA::Boolean stop (CORBA::Long cmdsn); + + virtual CORBA::Boolean speed (const Video_Control::SPEEDpara ¶); +}; + +class Video_Control_Fast_Forward_State : public virtual Video_Control_State +{ + // = TITLE + // Defines a class that implements the fast_forward state of the video + // control state pattern. +public: + Video_Control_Fast_Forward_State (void); + // Default constructor, sets the state to VIDEO_FAST_FORWARD + + void close (void); + + CORBA::Boolean stop (CORBA::Long cmdsn); +}; + +class Video_Control_Fast_Backward_State : public virtual Video_Control_State +{ + // = TITLE + // Defines a class that implements the fast_backward state of the video + // control state pattern. +public: + Video_Control_Fast_Backward_State (void); + // Default constructor, sets the state to VIDEO_FAST_BACKWARD + + void close (void); + + CORBA::Boolean stop (CORBA::Long cmdsn); +}; + +typedef ACE_Singleton <Video_Control_Waiting_State, TAO_SYNCH_MUTEX> + VIDEO_CONTROL_WAITING_STATE; +typedef ACE_Singleton <Video_Control_Play_State, TAO_SYNCH_MUTEX> + VIDEO_CONTROL_PLAY_STATE; +typedef ACE_Singleton <Video_Control_Fast_Forward_State, TAO_SYNCH_MUTEX> + VIDEO_CONTROL_FAST_FORWARD_STATE; +typedef ACE_Singleton <Video_Control_Fast_Backward_State, TAO_SYNCH_MUTEX> + VIDEO_CONTROL_FAST_BACKWARD_STATE; + +#endif /* MPEG_VIDEO_SERVER_STATE_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.cpp new file mode 100644 index 00000000000..584116d958b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.cpp @@ -0,0 +1,315 @@ +// $Id$ + +#include "ace/OS.h" +#include "Video_Control_i.h" +#include "mpeg_server/Video_Server.h" + +ACE_RCSID(mpeg_server, Video_Control_i, "$Id$") + +Video_Control_i::Video_Control_i () + : reactor_ (TAO_ORB_Core_instance ()->reactor ()), + state_ (0), + data_handler_ (0), + sig_handler_ (0) +{ +} + +int +Video_Control_i::create_handlers (void) +{ + ACE_NEW_RETURN (this->data_handler_, + Video_Data_Handler, + -1); + + ACE_NEW_RETURN (this->sig_handler_, + Video_Sig_Handler, + -1); + return 0; +} +CORBA::Boolean +Video_Control_i::init_video (const Video_Control::INITvideoPara ¶, + Video_Control::INITvideoReply_out reply, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_i::init_video () called\n")); + + CORBA::Boolean result = this->state_->init_video (para, + reply); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Video_Control_State::init_video returned %d\n", result)); + return result; + +} + + +CORBA::Boolean +Video_Control_i::stat_stream (CORBA::Char_out ch, + CORBA::Long_out size, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return 0; +} + + +void +Video_Control_i::close (CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_i::close:" + "shutting down the ORB\n")); + + TAO_ORB_Core_instance ()-> orb ()-> shutdown (); + return; +} + + +CORBA::Boolean +Video_Control_i::stat_sent (CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return 0; +} + + +CORBA::Boolean +Video_Control_i::fast_forward (const Video_Control::FFpara ¶, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->fast_forward (para); +} + + +CORBA::Boolean +Video_Control_i::fast_backward (const Video_Control::FFpara ¶, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->fast_backward (para); +} + + +CORBA::Boolean +Video_Control_i::step (const Video_Control::STEPpara ¶, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->step (para); +} + + +// this gets called by the client, when it wants +// to start playback +CORBA::Boolean +Video_Control_i::play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->play (para, + vts); +} + + +CORBA::Boolean +Video_Control_i::position (const Video_Control::POSITIONpara ¶, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->position (para); +} + + +CORBA::Boolean +Video_Control_i::speed (const Video_Control::SPEEDpara ¶, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_i::speed () called\n")); + return this->state_->speed (para); +} + + +CORBA::Boolean +Video_Control_i::stop (CORBA::Long cmdsn, + CORBA::Environment& env) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return this->state_->stop (cmdsn); +} + +CORBA::Boolean +Video_Control_i::set_peer (char * &peer, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + + + char *peer_addr_str = new char[BUFSIZ]; + ACE_OS::strcpy (peer_addr_str,peer); + ACE_OS::strtok_r (peer_addr_str, "=", &peer_addr_str); + + + char *delim = ACE_OS::strchr (peer_addr_str, ';'); + + *delim = ':'; + + /* + char peer_addr [BUFSIZ]; + + + ACE_OS::sprintf (peer_addr, + "%s:%s", + ACE_OS::strtok (peer_addr_str, ";"), + ACE_OS::strtok (0, ";") + ); + */ + + ACE_INET_Addr client_data_addr (peer_addr_str); + // Data (UDP) Address of the client. + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) set_peer called: %s,%s,%d\n", + peer, + client_data_addr.get_host_addr (), + client_data_addr.get_port_number ())); + + char temp_addr [BUFSIZ]; + if (VIDEO_SINGLETON::instance ()->data_host != 0) + ACE_OS::sprintf (temp_addr,"%s:%d",VIDEO_SINGLETON::instance ()->data_host,0); + else + ACE_OS::sprintf (temp_addr,":%d",0); + + if (VIDEO_SINGLETON::instance ()->dgram.open (client_data_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) UDP open failed: %p\n"), + 0); + + // set the socket buffer sizes to 64k. + int sndbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + int rcvbufsize = ACE_DEFAULT_MAX_SOCKET_BUFSIZ; + + if (VIDEO_SINGLETON::instance ()->dgram.set_option (SOL_SOCKET, + SO_SNDBUF, + (void *) &sndbufsize, + sizeof (sndbufsize)) == -1 + && errno != ENOTSUP) + return 0; + else if (VIDEO_SINGLETON::instance ()->dgram.set_option (SOL_SOCKET, + SO_RCVBUF, + (void *) &rcvbufsize, + sizeof (rcvbufsize)) == -1 + && errno != ENOTSUP) + return 0; + + + ACE_INET_Addr server_data_addr; + // Data (UDP) Address of this server. + + if (VIDEO_SINGLETON::instance ()-> dgram.get_local_addr + (server_data_addr) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) UDP get_local_addr failed: %p\n"), + 0); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Server: My UDP port number is %d\n", + server_data_addr.get_port_number ())); + + if (this->register_handlers () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Video_Control_i::set_peer: register_handlers failed\n"), + 0); + + VIDEO_SINGLETON::instance ()->videoSocket = VIDEO_SINGLETON::instance ()->dgram.get_handle (); + + ACE_DEBUG ((LM_DEBUG,"(%P|%t) set_peer: server port = %d\n",server_data_addr.get_port_number ())); + ACE_NEW_RETURN (peer, + char [BUFSIZ], + 0); + // hack to set the ip address correctly. + server_data_addr.set (server_data_addr.get_port_number (), + server_data_addr.get_host_name ()); + server_data_addr.addr_to_string (peer, + BUFSIZ); + + return 1; +} + +int +Video_Control_i::register_handlers (void) +{ + int result; + + + // create the handlers + + if (this->create_handlers () == -1) + return -1; + + this->change_state (VIDEO_CONTROL_WAITING_STATE::instance ()); + // sets the state to waiting. + + // Register the event handlers with the Reactor + // first the data handler, i.e. UDP + result = this->reactor_->register_handler (this->data_handler_, + ACE_Event_Handler::READ_MASK); + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for data_handler failed\n"), + -1); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) registered fd for data handler = (%d)\n", + this->data_handler_->get_handle ())); + + // finally, the signal handler, for periodic transmission + // of packets + result = this->sig_handler_->register_handler (); + + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) register_handler for sig_handler" + "failed!\n"), + -1); + + return 0; +} + +// Changes the state of the video control handler from the current +// state to the state represented by the argument. +void +Video_Control_i::change_state (Video_Control_State *state) +{ + ACE_DEBUG ((LM_DEBUG, "Process ID for CHANGE STATE %d", getpid ())); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Video_Control_i::Changing to state %d\n", + state->get_state ())); + this->state_ = state; +} + +// Returns the current state object . +Video_Control_State * +Video_Control_i::get_state (void) +{ + ACE_DEBUG ((LM_DEBUG, "Process ID for GET STATE %d", getpid ())); + return this->state_; +} + + +Video_Control_i::~Video_Control_i () +{ + delete this->data_handler_; + delete this->sig_handler_; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<Video_Control_i, ACE_Null_Mutex>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<Video_Control_i, ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h new file mode 100644 index 00000000000..55b782a0e97 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h @@ -0,0 +1,97 @@ +/* -*- C++ -*- */ +// $Id$ + +#ifndef AV_VIDEO_CONTROL_H +#define AV_VIDEO_CONTROL_H + +#include "mpeg_shared/Video_ControlS.h" +#include "Video_Server.h" + +class Video_Data_Handler; +class Video_Sig_Handler; +class Video_Control_State; + +class Video_Control_i + : public virtual POA_Video_Control +{ +public: + Video_Control_i (); + // constructor + + int create_handlers (void); + // creates the data and signal handlers + + virtual CORBA::Boolean init_video (const Video_Control::INITvideoPara ¶, + Video_Control::INITvideoReply_out reply, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean stat_stream (CORBA::Char_out ch, + CORBA::Long_out size, + CORBA::Environment &_tao_environment); + + virtual void close (CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean stat_sent (CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean fast_forward (const Video_Control::FFpara ¶, + CORBA::Environment &_tao_environment + ); + + virtual CORBA::Boolean fast_backward (const Video_Control::FFpara ¶, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean step (const Video_Control::STEPpara ¶, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean play (const Video_Control::PLAYpara ¶, + CORBA::Long_out vts, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean position (const Video_Control::POSITIONpara ¶, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean speed (const Video_Control::SPEEDpara ¶, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean stop (CORBA::Long cmdsn, + CORBA::Environment &_tao_environment); + + virtual CORBA::Boolean set_peer (char * &peer, + CORBA::Environment &_tao_environment); + // called by the client to inform us about it's ip and + // udp address. + + void change_state (Video_Control_State *state); + // Used to change the state + + Video_Control_State *get_state (void); + // Accessor for the state_ + + virtual ~Video_Control_i (void); + // Destructor + +protected: + int register_handlers (void); + // called by set_peer to install the data_handler and + // the sig_handler + + ACE_Reactor *reactor_; + // The Reactor + + Video_Control_State *state_; + // State pattern - pointer to abstract State object + + Video_Data_Handler *data_handler_; + // Data Socket Event Handler + + Video_Sig_Handler *sig_handler_; + // signal handler for SIGALRM to periodically send the video frames + // to the client + +}; + +// Video_Control_i instance singleton. +// %% +typedef ACE_Singleton <Video_Control_i, ACE_Null_Mutex> VIDEO_CONTROL_I; + +#endif /* if !defined (AV_VIDEO_CONTROL_H) */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.cpp new file mode 100644 index 00000000000..a971de7916d --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.cpp @@ -0,0 +1,272 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include "Video_Server.h" +#include "orbsvcs/CosNamingC.h" + +ACE_RCSID(mpeg_server, Video_Server, "$Id$") + +// Video_Sig_Handler methods +// handles the timeout SIGALRM signal +Video_Sig_Handler::Video_Sig_Handler () + : vci_ (VIDEO_CONTROL_I::instance ()) +{ +} + +int +Video_Sig_Handler::register_handler (void) +{ + // Assign the Sig_Handler a dummy I/O descriptor. Note that even + // though we open this file "Write Only" we still need to use the + // ACE_Event_Handler::NULL_MASK when registering this with the + // ACE_Reactor (see below). + this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); + ACE_ASSERT (this->handle_ != -1); + + // Register signal handler object. Note that NULL_MASK is used to + // keep the ACE_Reactor from calling us back on the "/dev/null" + // descriptor. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this, ACE_Event_Handler::NULL_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + + // Create a sigset_t corresponding to the signals we want to catch. + ACE_Sig_Set sig_set; + + // sig_set.sig_add (SIGINT); + // sig_set.sig_add (SIGQUIT); + sig_set.sig_add (SIGALRM); + + // Register the signal handler object to catch the signals. + if (TAO_ORB_Core_instance ()->reactor ()->register_handler (sig_set, + this) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + return 0; +} +// Called by the ACE_Reactor to extract the fd. + +ACE_HANDLE +Video_Sig_Handler::get_handle (void) const +{ + return this->handle_; +} + +int +Video_Sig_Handler::handle_input (ACE_HANDLE) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n")); + return 0; +} + +int +Video_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n")); + return 0; +} + +// This method handles all the signals that are being caught by this +// object. In our simple example, we are simply catching SIGALRM, +// SIGINT, and SIGQUIT. Anything else is logged and ignored. +// +// There are several advantages to using this approach. First, +// the behavior triggered by the signal is handled in the main event +// loop, rather than in the signal handler. Second, the ACE_Reactor's +// signal handling mechanism eliminates the need to use global signal +// handler functions and data. + +int +Video_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) received signal %S\n", signum)); + + switch (signum) + { + case SIGALRM: + // Handle the timeout + Video_Timer_Global::timerHandler (SIGALRM); + // send the frame + // cerr << "current state = " << this->vci_->get_state ()->get_state (); + switch (this->vci_->get_state ()->get_state ()) + { + case Video_Control_State::VIDEO_PLAY: + VIDEO_SINGLETON::instance ()->play_send (); + break; + case Video_Control_State::VIDEO_FAST_FORWARD: + // this handles the forward play case! + VIDEO_SINGLETON::instance ()->fast_play_send (); + break; + case Video_Control_State::VIDEO_FAST_BACKWARD: + // this handles the backward play case! + VIDEO_SINGLETON::instance ()->fast_play_send (); + break; + default: + break; + } + break; + default: + ACE_DEBUG ((LM_DEBUG, + "(%t) %S: not handled, returning to program\n", + signum)); + break; + } + // ACE_DEBUG ((LM_DEBUG,"returning from handle_signal")); + return 0; +} + +// Video_Data_Handler methods + +Video_Data_Handler::Video_Data_Handler () + : vci_ (VIDEO_CONTROL_I::instance ()) +{ +} + +ACE_HANDLE +Video_Data_Handler::get_handle (void) const +{ + return VIDEO_SINGLETON::instance ()->dgram.get_handle (); +} + +int +Video_Data_Handler::handle_input (ACE_HANDLE handle) +{ + // fprintf (stderr,"Video_Data_Handler::handle_input ()\n"); + + switch (this->vci_->get_state ()->get_state ()) + { + case Video_Control_State::VIDEO_PLAY: + VIDEO_SINGLETON::instance ()->GetFeedBack (); + // if (VIDEO_SINGLETON::instance ()->GetFeedBack () == -1) +// { +// ACE_DEBUG ((LM_DEBUG, "(%P|%t) Error reading feedback. Ending the reactor event loop\n")); +// TAO_ORB_Core_instance ()-> orb ()->shutdown (); +// return -1; +// } + if (VIDEO_SINGLETON::instance ()->play_send () == -1) + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Error sending packets. Ending the reactor event loop\n")); + // TAO_ORB_Core_instance ()-> orb ()->shutdown (); + // return -1; + } + // simulating the for loop in playvideo () in vs.cpp + break; + case Video_Control_State::VIDEO_FAST_FORWARD: + case Video_Control_State::VIDEO_FAST_BACKWARD: + VIDEO_SINGLETON::instance ()->GetFeedBack (); + if (VIDEO_SINGLETON::instance ()->fast_play_send () == -1) + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Error sending packets. Ending the reactor event loop\n")); + // TAO_ORB_Core_instance ()-> orb ()->shutdown (); + // return -1; + } + // simulating the for loop in fast_play + break; + } + return 0; +} + +// Video_Control_Handler methods + +// Video_Server_StreamEndPoint methods. + +int +Video_Server_StreamEndPoint::handle_open (void) +{ + return 0; +} + +int +Video_Server_StreamEndPoint::handle_close (void) +{ + // called when streamendpoint is being destructed + return 0; +} + +int +Video_Server_StreamEndPoint::handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +int +Video_Server_StreamEndPoint::handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +int +Video_Server_StreamEndPoint::handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + return 0; +} + +CORBA::Boolean +Video_Server_StreamEndPoint::handle_connection_requested (AVStreams::flowSpec &the_spec, + CORBA::Environment &env) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_Server_StreamEndPoint::handle_connection_requested:() \n")); + + char *server_string; + + server_string = CORBA::string_dup ((const char *) the_spec [0]); + ACE_DEBUG ((LM_DEBUG, server_string)); + CORBA::Boolean result; + result = VIDEO_CONTROL_I::instance ()->set_peer (server_string,env); + // Get media control from my vdev and call set_peer on that. + + char server_addr [BUFSIZ]; + + ACE_OS::sprintf (server_addr, + "%s=%s", + "UDP", + server_string); + + TAO_Reverse_FlowSpec_Entry server_entry ("video", + "OUT", + "MIME:video/mpeg", + "UDP", + server_addr); + + ACE_DEBUG ((LM_DEBUG,"\nServer Entry = %s\n", server_entry.entry_to_string ())); + + the_spec.length (1); + + the_spec [0]= server_entry.entry_to_string (); + ACE_DEBUG ((LM_DEBUG,"\nThe Spec = %s\n", the_spec [0].in ())); + + return result; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h new file mode 100644 index 00000000000..82e501650c8 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h @@ -0,0 +1,152 @@ +/* -*- C++ -*- */ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#ifndef MPEG_VIDEO_SERVER_H +#define MPEG_VIDEO_SERVER_H + +#include "ace/Reactor.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Event_Handler.h" + +#include "tao/PortableServer/ORB_Manager.h" +#include "include/common.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/sendpt.h" +#include "mpeg_shared/Video_ControlS.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_server/Video_Control_State.h" +#include "mpeg_server/Globals.h" +#include "mpeg_server/Video_Control_i.h" +#include "orbsvcs/AV/AVStreams_i.h" + +class Video_Control_i; + +class Video_Sig_Handler + : public virtual ACE_Event_Handler +{ + // = TITLE + // Defines a video signal handler class which registers itself with the + // default ACE_Reactor::instance () . Handles the + // SIGALRM signal. + // + // = DESCRIPTION + // This class contains a pointer to a Video_Control_Handler + // instance and decides the signal action depending on its state. + // An object of this class is used to periodically send the video + // frames to the client using the Video_Timer_Global class. +public: + Video_Sig_Handler (); + + virtual ACE_HANDLE get_handle (void) const; + + int register_handler (void); + // this will register this sig_handler + // with the reactor for SIGALRM + + virtual int shutdown (ACE_HANDLE, + ACE_Reactor_Mask); + + virtual int handle_input (ACE_HANDLE); + + virtual int handle_signal (ACE_HANDLE signum, + siginfo_t * = 0, + ucontext_t* = 0); +private: + ACE_HANDLE handle_; + // my handle + + Video_Control_i *vci_; + // Pointer to the Video_Control_i for accessing + // the current state of the server. +}; + +class Video_Data_Handler : public virtual ACE_Event_Handler +{ + + // = TITLE + // Defines a event handler for video data using a datagram i.e UDP + // socket. + // + // = DESCRIPTION + // This takes a pointer to a Video_Control_Handler instance and + // reacts differently to the events based on the + // video_control_handler's state. +public: + Video_Data_Handler (); + // Constructor + + virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); + // Called when data shows up. + + virtual ACE_HANDLE get_handle (void) const; + // Get the handle used by this event handler + +private: + Video_Control_i *vci_; + +}; + +// The stream endpoint +class Video_Server_StreamEndPoint : + public virtual TAO_Server_StreamEndPoint +{ +public: + virtual int handle_open (void) ; + // called when streamendpoint is instantiated + + virtual int handle_close (void) ; + // called when streamendpoint is being destructed + + virtual int handle_stop (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + virtual int handle_start (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + + virtual int handle_destroy (const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + // Application needs to define this + + virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec, + CORBA::Environment &env) ; + +private: + ACE_SOCK_CODgram dgram_; + +}; + +#endif /* MPEG_VIDEO_SERVER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/as.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/as.cpp new file mode 100644 index 00000000000..2662e61f93e --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/as.cpp @@ -0,0 +1,709 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include "include/common.h" +#include <sys/types.h> +#include <netdb.h> +#include <string.h> +#include <stdlib.h> + +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <arpa/inet.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <unistd.h> +#include <time.h> +#include <sys/time.h> +#include <stdio.h> +#include <errno.h> +#include <signal.h> +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "server_proto.h" + +ACE_RCSID(mpeg_server, as, "$Id$") + +//extern int Mpeg_Global::session_limit, Mpeg_Global::session_num; + +static int bytes_sent = 0; +static time_t start_time; + +static int conn_tag; + +static int serviceSocket; +static int audioSocket = -1; + +static char audioFile[PATH_SIZE]; +static int fd; +static AudioParameter audioPara; +static int totalSamples; +static int fileSize; +static unsigned char cmd; +static int live_source = 0; + +static int CmdRead(char *buf, int psize) +{ + int res = wait_read_bytes(serviceSocket, buf, psize); + if (res == 0) return (1); + if (res == -1) { + fprintf(stderr, "AS error on read cmdSocket, size %d", psize); + ACE_OS::perror (""); + return (-1); + } + return 0; +} + +static void CmdWrite(char *buf, int size) +{ + int res = wait_write_bytes(serviceSocket, buf, size); + if (res == -1) { + if (errno != EPIPE)ACE_OS::perror ("AS writes to serviceSocket"); + ACE_OS::exit (errno != EPIPE); + } +} + +static int INITaudio(void) +{ + int result; + int failureType; /* 0 - can't open file, 1 - can't open live source */ + INITaudioPara para; + + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.version = ntohl(para.version); + para.nameLength = ntohl(para.nameLength); + para.para.encodeType = ntohl(para.para.encodeType); + para.para.channels = ntohl(para.para.channels); + para.para.samplesPerSecond = ntohl(para.para.samplesPerSecond); + para.para.bytesPerSample = ntohl(para.para.bytesPerSample); +#endif + if (para.nameLength>0) + result = CmdRead(audioFile, para.nameLength); + if (result != 0) + return result; + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || para.version != VERSION) { + char errmsg[128]; + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + if (Mpeg_Global::session_num > Mpeg_Global::session_limit) { + sprintf(errmsg, + "Too many sessions being serviced, please try again later.\n"); + } + else { + sprintf(errmsg, "Version # not match, AS %d.%02d, Client %d.%02d", + VERSION / 100, VERSION % 100, + para.version / 100, para.version % 100); + } + write_string(serviceSocket, errmsg); + return(1); + } + ACE_OS::memcpy (&audioPara, ¶.para, sizeof(audioPara)); + /* + fprintf(stderr, "Client Audio para: encode %d, ch %d, sps %d, bps %d.\n", + para.para.encodeType, para.para.channels, + para.para.samplesPerSecond, para.para.bytesPerSample); + */ + audioFile[para.nameLength] = 0; + { + int len =ACE_OS::strlen (audioFile); + if (strncasecmp("LiveAudio", audioFile, 9) && + strcasecmp(".au", audioFile+len-3)) { + char errmsg[128]; + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + sprintf(errmsg, "%s without suffix .au", audioFile); + write_string(serviceSocket, errmsg); + return(1); + } + } + /* + fprintf(stderr, "Audio file %s got.\n", audioFile); + */ + + if (!strncasecmp("LiveAudio", audioFile, 9)) { + fd = OpenLiveAudio(&(para.para)); + if (fd == -1) { + failureType = 1; + goto failure; + } + fileSize =0x7fffffff; + totalSamples = fileSize / audioPara.bytesPerSample; + live_source = 1; + } + else { + LeaveLiveAudio(); + fd = open(audioFile, O_RDONLY); + if (fd == -1) + { + fprintf(stderr, "AS error on opening audio file %s", audioFile); + ACE_OS::perror (""); + failureType = 0; + goto failure; + } + + /* Try to get audioFile format audioPara here */ + + /* figure out totalsamples */ + fileSize = lseek(fd, 0L, SEEK_END); + lseek(fd, 0L, SEEK_SET); + totalSamples = fileSize / audioPara.bytesPerSample; + /* + fprintf(stderr, "Total Samples=%d in audio file %ss.\n", totalSamples, audioFile); + */ + } + { + INITaudioReply reply; + + reply.para.encodeType = htonl(audioPara.encodeType); + reply.para.channels = htonl(audioPara.channels); + reply.para.samplesPerSecond = htonl(audioPara.samplesPerSecond); + reply.para.bytesPerSample = htonl(audioPara.bytesPerSample); + reply.totalSamples = htonl(totalSamples); + + reply.live = htonl(live_source); + reply.format = htonl(AUDIO_RAW); + + CmdWrite((char *)&cmd, 1); + CmdWrite((char *)&reply, sizeof(reply)); + } + return 0; + + failure: + { + /* + fprintf(stderr, "AS error: failed initializing audio file.\n"); + */ + cmd = CmdFAIL; + CmdWrite((char *)&cmd, 1); + write_string(serviceSocket, + failureType == 0 ? (char *)"Failed to open audio file for read.": + (char *)"Failed to connect to live audio source."); + return(1); + } +} + +#define DATABUF_SIZE 500 + +static int databuf_size; +static int cmdsn; +static int nextsample; +static int sps; /* audio play speed given by the client: samples per second */ +static int spslimit; +static int spp; /* samples per packet */ +static AudioPacket * pktbuf = NULL; + +/* send a packet of audio samples to audioSocket + returns: 0 - no more data from audio file: EOF reached; + 1 - More data is available from the audio file */ +static int send_packet(int firstSample, int samples) +{ + long offset = firstSample * audioPara.bytesPerSample; + int size = samples * audioPara.bytesPerSample; + char * buf = (char *)pktbuf + sizeof(*pktbuf); + int len; + int resent = 0; + int segsize, sentsize; + + if (live_source) { + len = ReadLiveAudioSamples(buf, samples); + len *= audioPara.bytesPerSample; + } + else { + lseek(fd, offset, SEEK_SET); + while ((len = ACE_OS::read (fd, buf, size)) == -1) { + if (errno == EINTR) + continue; /* interrupted */ + ACE_OS::perror ("AS error on read audio file"); + return(-1); + } + if (len < audioPara.bytesPerSample) { + return 0; + } + } + + samples = len / audioPara.bytesPerSample; + len = samples * audioPara.bytesPerSample; + bytes_sent += len; + pktbuf->firstSample = htonl(firstSample); + pktbuf->samples = htonl(samples); + pktbuf->actualSamples = htonl(samples); + pktbuf->dataBytes = htonl(len); + if (spslimit < sps) { /* interpolation needed */ + SFprintf(stderr, "AS audio sample interpolation not available yet.\n"); + } + segsize = sizeof(*pktbuf) + len; + if (conn_tag != 0) { + while ((sentsize = ACE_OS::write (audioSocket, (char *)pktbuf, segsize)) == -1) { + if (errno == EINTR) /* interrupted */ + continue; + if (errno == ENOBUFS) { + if (resent) { + ACE_OS::perror ("AS Warning, pkt discarded because"); + break; + } + else { + resent = 1; + usleep(5000); + continue; + } + } + if (errno != EPIPE) { + fprintf(stderr, "AS error on send audio packet %d(%d):", + firstSample, samples); + perror(""); + } + ACE_OS::exit ((errno != EPIPE)); + } + } + else { + sentsize = wait_write_bytes(audioSocket, (char *)pktbuf, segsize); + if (sentsize == -1) { + if (errno != EPIPE) { + fprintf(stderr, "AS error on send audio packet %d(%d):", + firstSample, samples); + perror(""); + } + ACE_OS::exit ((errno != EPIPE)); + } + } + if (sentsize < segsize) { + SFprintf(stderr, "AS warning: message size %dB, sent only %dB\n", + segsize, sentsize); + } + /* + SFprintf(stderr, "AS sent audio packet %d(%d).\n", + firstSample, samples); + */ + return (len < size ? 0 : 1); +} + +/* send a packet of audio samples to audioSocket + returns: 0 - no more data from audio file: EOF reached; + 1 - More data is available from the audio file */ +static int SendPacket(void) +{ + int moredata; + pktbuf->cmdsn = htonl(cmdsn); + pktbuf->resend = htonl(0); + pktbuf->samplesPerSecond = htonl(sps); + moredata = send_packet(nextsample, spp); + if (moredata) { + nextsample += spp; + } + return moredata; +} + +static void ResendPacket(int firstsample, int samples) +{ + pktbuf->cmdsn = htonl(cmdsn); + pktbuf->resend = htonl(1); + pktbuf->samplesPerSecond = htonl(sps); + while (samples > 0) { + int size = samples < spp ? samples : spp; + send_packet(firstsample, size); + firstsample += size; + samples -= size; + if (samples > 0) { + usleep(10000); + } + } +} + +#define SPEEDUP_SCALE 5 +#define MAX_RESEND_REQS 10 +#define FBBUF_SIZE (sizeof(AudioFeedBackPara) + \ + (MAX_RESEND_REQS - 1) * sizeof(APdescriptor)) + +static AudioFeedBackPara * fbpara = NULL; + +static int PLAYaudio(void) +{ + int hasdata = 1; + int addSamples; + int packets = 0; + unsigned nextTime; + int upp; /* micro-seconds per packet */ + int delta_sps = 0; /* compensation for sps from feedback msgs */ + int nfds = (serviceSocket > audioSocket ? serviceSocket : audioSocket) + 1; + int result; + /* + fprintf(stderr, "PLAY . . .\n"); + */ + { + PLAYaudioPara para; + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextSample = ntohl(para.nextSample); + para.samplesPerSecond = ntohl(para.samplesPerSecond); + para.samplesPerPacket = ntohl(para.samplesPerPacket); + para.ABsamples = ntohl(para.ABsamples); + para.spslimit = ntohl(para.spslimit); +#endif + nextsample = para.nextSample; + cmdsn = para.sn; + sps = para.samplesPerSecond; + spslimit = para.spslimit; + spp = para.samplesPerPacket; + addSamples = para.ABsamples / 2; + if (spp * audioPara.bytesPerSample > databuf_size) { + spp = databuf_size / audioPara.bytesPerSample; + } + /* + SFprintf(stderr, "AS got CmdPLAY: sps %d\n", sps); + */ + } + /* + fprintf(stderr, "AS: nextSampe=%d for PLAY.\n", para.nextSample); + */ + + upp = (int)(1000000.0 / ((double)sps / (double)spp)); + nextTime = get_usec(); + + CmdWrite((char *)&nextTime, sizeof(int)); + + if (live_source) { + StartPlayLiveAudio(); + } + + for (;;) + { + fd_set read_mask, write_mask; + struct timeval tval; + unsigned curTime = get_usec(); + + if (hasdata) { + if (addSamples < - spp) { /* slow down by not sending packets */ + nextTime += upp; + addSamples += spp; + } + else { + int need_sleep = 0; + while (nextTime <= curTime && hasdata) { + if (need_sleep) usleep(5000); + hasdata = SendPacket(); + need_sleep = 1; + packets ++; + nextTime += upp; + if (addSamples > 0 && packets % SPEEDUP_SCALE == 0) { + addSamples -= spp; + usleep(5000); + hasdata = SendPacket(); + packets ++; + } + } + } + } + curTime = nextTime - curTime; + if (curTime > 5000000) curTime = 5000000; /* limit on 5 second weit time + in case error happens */ + tval.tv_sec = curTime / 1000000; + tval.tv_usec = curTime % 1000000; + FD_ZERO(&read_mask); + FD_SET(serviceSocket, &read_mask); + FD_SET(audioSocket, &read_mask); +#ifdef _HPUX_SOURCE + if (select(nfds, (int *)&read_mask, NULL, NULL, hasdata ? &tval : NULL) == -1) +#else + if (select(nfds, &read_mask, NULL, NULL, hasdata ? &tval : NULL) == -1) +#endif + { + if (errno == EINTR) + continue; + ACE_OS::perror ("AS error on select reading or writing"); + return(-1); + } + if (FD_ISSET(serviceSocket, &read_mask)){ /* STOP, SPEED, or CLOSE*/ + unsigned char tmp; + result = CmdRead((char *)&tmp, 1); + if (result != 0) + return result; + switch (tmp) + { + case CmdSPEED: + { + SPEEDaudioPara para; + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.samplesPerSecond = ntohl(para.samplesPerSecond); + para.samplesPerPacket = ntohl(para.samplesPerPacket); + para.spslimit = ntohl(para.spslimit); +#endif + sps = para.samplesPerSecond; + spslimit = para.spslimit; + spp = para.samplesPerPacket; + if (spp * audioPara.bytesPerSample > databuf_size) { + spp = databuf_size / audioPara.bytesPerSample; + } + delta_sps = 0; /* reset compensation value */ + upp = (int)(1000000.0 / ((double)sps / (double)spp)); + /* + SFprintf(stderr, "AS got CmdSPEED: sps %d\n", sps); + */ + } + break; + case CmdSTOP: + { + int val; + cmd = tmp; + /* + fprintf(stderr, "AS: CmdSTOP. . .\n"); + */ + result = CmdRead((char *)&val, sizeof(int)); + if (result != 0) + return result; + /* + CmdWrite(AUDIO_STOP_PATTERN,ACE_OS::strlen (AUDIO_STOP_PATTERN)); + */ + if (live_source) { + StopPlayLiveAudio(); + } + return 0; /* return from PLAYaudio() */ + } + case CmdCLOSE: + if (live_source) { + StopPlayLiveAudio(); + } + return(1); /* The whole AS session terminates */ + default: + if (live_source) { + StopPlayLiveAudio(); + } + fprintf(stderr, "AS error: cmd=%d while expects STOP/SPEED/CLOSE.\n", tmp); + return(-1); + } + } + + if (FD_ISSET(audioSocket, &read_mask)){ /* Feedback packet */ + int bytes, len; + for (;;) { + if (conn_tag >= 0) { + len = wait_read_bytes(audioSocket, (char *)fbpara, sizeof(*fbpara)); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read1 FB"); + return(-1); + } + } + else { /* discard mode packet stream, read the whole packet */ + len = ACE_OS::read (audioSocket, (char *)fbpara, FBBUF_SIZE); + } + if (len == -1) { + if (errno == EINTR) continue; /* interrupt */ + else { + if (errno != EPIPE && errno != ECONNRESET)ACE_OS::perror ("AS failed to ACE_OS::read () fbmsg header"); + break; + } + } + break; + } + if (len < sizeof(*fbpara)) { + if (len > 0) fprintf(stderr, + "AS warn ACE_OS::read () len %dB < sizeof(*fbpara) %dB\n", + len, sizeof(*fbpara)); + continue; + } +#ifdef NeedByteOrderConversion + fbpara->type = ntohl(fbpara->type); +#endif + bytes = (fbpara->type > 0) ? + sizeof(APdescriptor) * (fbpara->type - 1) : + 0; + if (bytes > 0) { + if (conn_tag >= 0) { /* not discard mode packet stream, + read the rest of packet */ + len = wait_read_bytes(audioSocket, + ((char *)fbpara) + sizeof(*fbpara), + bytes); + if (len == 0) return(1); /* connection broken */ + else if (len < 0) { /* unexpected error */ + ACE_OS::perror ("AS read2 FB"); + return(-1); + } + len += sizeof(*fbpara); + } + } + bytes += sizeof(*fbpara); + if (len < bytes) { + if (len > 0) fprintf(stderr, + "AS only read partial FBpacket, %dB out of %dB.\n", + len, bytes); + continue; + } + if (live_source) { /* ignore all feedback messags for live source */ + continue; + } + +#ifdef NeedByteOrderConversion + fbpara->cmdsn = ntohl(fbpara->cmdsn); +#endif + if (len != sizeof(*fbpara) + + (fbpara->type ? (fbpara->type -1) * sizeof(APdescriptor) : 0)) { + /* unknown message, discard */ + SFprintf(stderr, "AS Unkown fb msg: len = %d, type = %d\n", + len, fbpara->type); + continue; + } + if (fbpara->cmdsn != cmdsn) { /* discard the outdated message */ + continue; + } +#ifdef NeedByteOrderConversion + { + int i, * ptr = (int *)fbpara + 2; + for (i = 0; i < (len >> 2) - 2; i++) *ptr = ntohl(*ptr); + } +#endif + if (fbpara->type == 0) { /* feedback message */ + /* + SFprintf(stderr, "AS got fbmsg: addsamples %d, addsps %d\n", + fbpara->data.fb.addSamples, fbpara->data.fb.addsps); + */ + addSamples += fbpara->data.fb.addSamples; + if (fbpara->data.fb.addsps) { + delta_sps += fbpara->data.fb.addsps; + upp = (int)(1000000.0 / ((double)(sps + delta_sps) / (double)spp)); + } + } + else { /* resend requests */ + APdescriptor * req = &(fbpara->data.ap); + int i; + /* + SFprintf(stderr, "AS got %d resend reqs\n", fbpara->type); + */ + for (i = 0; i < fbpara->type; i ++) { + ResendPacket(req->firstSample, req->samples); + req ++; + } + } + } + } +} + +static void on_exit_routine(void) +{ + struct sockaddr_in peeraddr_in; + int size = sizeof(peeraddr_in); + + /* + fprintf(stderr, "An AS session terminated\n"); + */ + if (ACE_OS::getpeername(serviceSocket, + (struct sockaddr *)&peeraddr_in, &size) == 0 && + peeraddr_in.sin_family == AF_INET) { + if (strncmp(inet_ntoa(peeraddr_in.sin_addr), "129.95.50", 9)) { + struct hostent *hp; + time_t val =ACE_OS::time (NULL); + char * buf = ACE_OS::ctime (&start_time); + + hp = ACE_OS::gethostbyaddr((char *)&(peeraddr_in.sin_addr), 4, AF_INET); + buf[strlen(buf)-1] = 0; + printf("%s: %s %3dm%02ds %dB %s\n", + buf, + hp == NULL ? inet_ntoa(peeraddr_in.sin_addr) : hp->h_name, + (val - start_time) / 60, (val - start_time) % 60, + bytes_sent, audioFile); + } + } + ComCloseConn(serviceSocket); + ComCloseConn(audioSocket); +} + +int AudioServer(int ctr_fd, int data_fd, int rttag, int max_pkt_size) +{ + int result; + + serviceSocket = ctr_fd; + audioSocket = data_fd; + conn_tag = max_pkt_size; + + if (max_pkt_size < 0) max_pkt_size = -max_pkt_size; + else if (max_pkt_size == 0) max_pkt_size = 1024 * 1024; + + start_time =ACE_OS::time (NULL); + + atexit(on_exit_routine); + + result = INITaudio(); + + if (result != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) AudioServer: "), + result); + + fbpara = (AudioFeedBackPara *)ACE_OS::malloc(FBBUF_SIZE); + if (fbpara == NULL) { + ACE_OS::perror ("AS failed to allocate mem for fbpara"); + return (-1); + } + + databuf_size = max_pkt_size - sizeof(*pktbuf); + if (databuf_size > DATABUF_SIZE) databuf_size = DATABUF_SIZE; + + pktbuf = (AudioPacket *)ACE_OS::malloc(sizeof(*pktbuf) + databuf_size); + if (pktbuf == NULL) { + ACE_OS::perror ("AS failed to allocate mem for pktbuf"); + return(-1); + } + + for (;;) + { + /* + fprintf(stderr, "AS: waiting for a new command...\n"); + */ + result = CmdRead((char *)&cmd, 1); + if (result != 0) + return result; + switch (cmd) + { + case CmdPLAY: + result = PLAYaudio(); + if (result != 0) + return result; + break; + case CmdCLOSE: + /* + fprintf(stderr, "a session closed.\n"); + */ + return(0); + break; + default: + fprintf(stderr, "audio channel command %d not recoganizeable\n", cmd); + break; + } + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/las.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/las.cpp new file mode 100644 index 00000000000..ebe60992d6a --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/las.cpp @@ -0,0 +1,255 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#if 1 + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <sys/types.h> +#include <unistd.h> +#include <time.h> +#include <signal.h> +#include <sys/time.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#include "include/common.h" +#include "server_proto.h" + +ACE_RCSID(mpeg_server, las, "$Id$") + +#ifdef LIVE_AUDIO + +#include <AF/AFlib.h> +#include <AF/AFUtils.h> + +static AFAudioConn *aud; +static AC ac; +static AFSetACAttributes attributes; +static int bps; +static int nextSample; +static audioActive = 0; + +/* + * Find a suitable default device + * Returns -1 if no suitable device can be found. + */ +static int FindDefaultDevice(AFAudioConn *aud) +{ + AFDeviceDescriptor *audioDevice; + int i; + for(i=0; i<ANumberOfAudioDevices(aud); i++) + { + audioDevice = AAudioDeviceDescriptor(aud, i); + if(audioDevice->inputsFromPhone == 0 && audioDevice->outputsToPhone == 0) + return i; + } + return -1; +} +#endif + + +int OpenLiveAudio(AudioParameter * ap) +{ +#ifndef LIVE_AUDIO + return -1; +#else + int device; + int gain; + unsigned int channels; + int endianflag = 0; + + if (!audioActive) return -1; + + device = -1; + attributes.rec_gain = 0; + attributes.type = UNKNOWN_ENCODETYPE; + + if ( (aud = AFOpenAudioConn(NULL)) == NULL) + { + fprintf(stderr, "SA error: fails to open default AF connection.\n"); + return -1; + } + + /* set up audio context, find sample size and sample rate + At this time, we only support default setings */ + device = FindDefaultDevice(aud); + attributes.type = aud->devices[device].playBufType; + ac = AFCreateAC(aud, device, + ACRecordGain | ACEncodingType | endianflag, + &attributes); + if (ac == NULL) + { + ACE_OS::perror ("AS error: failed to create ac"); + AFCloseAudioConn(aud); + return -1; + } + if (attributes.type == ap->encodeType) { + bps = ap->bytesPerSample; + return 0; + } + else { + fprintf(stderr, "AS error: encodeType %d, client encodeType %d\n", + attributes.type, ap->encodeType); + return -1; + } +#endif +} + +void StartPlayLiveAudio(void) +{ +#ifndef LIVE_AUDIO + return; +#else + nextSample = AFGetTime(ac); + SFprintf(stderr, "LAS nextSample %d\n", nextSample); + return; +#endif +} + +void StopPlayLiveAudio(void) +{ +#ifndef LIVE_AUDIO + return; +#else + return; +#endif +} + +int ReadLiveAudioSamples(char * buf, int samples) +{ +#ifndef LIVE_AUDIO + return 0; +#else + /* + SFprintf(stderr, "LAS to read %d bytes\n", samples * bps); + */ + AFRecordSamples(ac, nextSample, samples * bps, (unsigned char *)buf, ABlock); + nextSample += samples; + /* + SFprintf(stderr, "LAS read live %d samples\n", samples); + */ + return samples; +#endif +} + +#endif + +#if 0 + +/* Following is a version using /dev/audio directly, since /dev/audio can't be + shared by different sessions, at most one session can be served. */ + +#include <stdio.h> +#include <errno.h> +/* +#include <sys/types.h> +#include <sys/socket.h> +*/ +#include <fcntl.h> +#include <sys/types.h> +#include <sys/file.h> +#include <sys/ioctl.h> +#include <sys/stat.h> +#include <sys/filio.h> +#include <sys/stropts.h> + +#include <time.h> +#include <signal.h> +#include <sys/time.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +ACE_RCSID(mpeg_server, las, "$Id$") + +static int sunfd1; +static int bps; +static int nextSample; + + +int OpenLiveAudio(AudioParameter * ap) +{ + if (!audioActive) return -1; + + if ((sunfd1 = open("/dev/audio", O_RDONLY, 0)) < 0) { + fprintf(stderr, "dda can't open /dev/audio, errno message \" %d \"\n", + errno); + return -1; + } + bps = ap->bytesPerSample; + ioctl(sunfd1, I_FLUSH, FLUSHR); + return 0; +} + +void StartPlayLiveAudio(void) +{ + ioctl(sunfd1, I_FLUSH, FLUSHR); +} + +void StopPlayLiveAudio(void) +{ +} + +int ReadLiveAudioSamples(char * buf, int samples) +{ + int bytes = samples * bps; + int len = ACE_OS::read (sunfd1, buf, bytes); + if (len != bytes) { + fprintf(stderr, "ReadLive: need %d samples (%dB), read %dB\n", + samples, bytes, len); + return len / bps; + } + return samples; +} + +#endif + +int InitLiveAudio(int argc, char ** argv) +{ +#ifndef LIVE_AUDIO + return -1; +#else + + audioActive = 1; + + fprintf(stderr, "LAS initialized.\n"); + return 0; +#endif +} + +void ExitLiveAudio(void) +{ + return; +} + +void LeaveLiveAudio(void) +{ + return; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/lvs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/lvs.cpp new file mode 100644 index 00000000000..0fe4cf2d5cd --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/lvs.cpp @@ -0,0 +1,414 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> + +#include <sys/types.h> +#include <sys/socket.h> +#include <unistd.h> +#include <stdlib.h> + +#include <time.h> +#include <signal.h> +#include <sys/time.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Intrinsic.h> + +#include "include/common.h" +#include "mpeg_shared/routine.h" +#include "server_proto.h" + +ACE_RCSID(mpeg_server, lvs, "$Id$") + +#ifdef LIVE_VIDEO +#include "lvs_shared.h" + +LvsSharedData * shared = NULL; +static int lvspid = -1; /* -1: no lvs, 0 - lvs child, >0 - vs proc */ +static int prefid = -1, first_fid, first_frame; +static int curbuf; + +#define PID_FILE "~/.vcr/lvsPid" +#define QUALITY_FILE "~/.vcr/lvsQuality" + +static int count = 0; +static unsigned session_time; + +static int curpid = 0; + +static void on_exit_routine(void) +{ + char buf[256]; + if (getpid() != curpid) return; + get_full_path(PID_FILE, buf, 256); + ACE_OS::unlink (buf); +} + +static void register_pid(void) +{ + char buf[256]; + FILE *fp; + get_full_path(PID_FILE, buf, 256); + fp = fopen(buf, "w"); + fprintf(fp, "%d -- pid of current VS process\n",ACE_OS::getpid ()); + fclose(fp); +} + +static void set_quality_level(void) +{ + char buf[256]; + FILE *fp; + int qos = -1; + get_full_path(QUALITY_FILE, buf, 256); + fp = fopen(buf, "r"); + if (fp == NULL) return; + + fscanf(fp, "%d", &qos); + fclose(fp); + if (qos >= 0 && qos <= 100) { + shared->qos_val = qos; + } +} + +static void hup_handler(int status) +{ + setsignal(SIGHUP, SIG_IGN); + if (getpid() != curpid) return; + set_quality_level(); + setsignal(SIGHUP, hup_handler); +} + +#endif + +int InitLiveVideo(int argc, char ** argv) /* -1 -- failed, 0 - succ */ +{ +#ifndef LIVE_VIDEO + return -1; +#else +/* +#define BUFSIZE 768 * 576 * 3 / 8 +#define BUFSIZE 640 * 480 * 3 / 2 +*/ +#define BUFSIZE 1024 * 1024 + + char * buf = creat_shared_mem(BUFSIZE); + int sid = creat_semaphore(); + int susid = creat_semaphore(); + + enter_cs(susid); + + shared = (LvsSharedData *)buf; + shared->sid = sid; + shared->susid = susid; + shared->initState = 0; + shared->bufDataBytes = BUFSIZE - sizeof(*shared); + shared->buf = (LvsBuffer *)((char *)shared + sizeof(*shared)); + + register_pid(); + set_quality_level(); + + /* all other fields to be initialized by LVS process */ + + while ((lvspid = ACE_OS::fork ()) == -1); + + if (lvspid == 0) { /* child process, reading from camera */ + LiveVideoProcess(argc, argv); + ACE_OS::exit (1); + } + + while (shared->initState == 0) usleep(100000); /* wait for SunVideo to init */ + + if (shared->initState == -1) { + fprintf(stderr, "LVS error: init of child process failed\n"); + ACE_OS::kill (lvspid, SIGINT); + remove_shared_mem(buf); + remove_semaphore(sid); + remove_semaphore(susid); + lvspid = -1; + return -1; + } + else { + + fprintf(stderr, "LVS initialized.\n"); + + curpid =ACE_OS::getpid (); + + atexit(on_exit_routine); + + setsignal(SIGHUP, hup_handler); + + return 0; + } +#endif +} + +void LeaveLiveVideo(void) +{ +#ifndef LIVE_VIDEO + return; +#else + if (lvspid == -1) return; + remove_shared_mem((char *)shared); + shared = NULL; +#endif +} + +void ExitLiveVideo(void) +{ +#ifndef LIVE_VIDEO + return; +#else + if (lvspid == -1) return; + ACE_OS::kill (lvspid, SIGINT); + remove_semaphore(shared->sid); + remove_semaphore(shared->susid); + remove_shared_mem((char *)shared); + lvspid = -1; + shared = NULL; +#endif +} + +int OpenLiveVideo(int * format, + int * width, int * height, + int * averageFrameSize, + double * fps, + int * pelAspectRatio /* MPEG1 encoding used here */ + ) /* -1 -- failed, 0 - succ */ +{ +#ifndef LIVE_VIDEO + return -1; +#else + if (lvspid == -1) return -1; + *format = shared->format; + *width = shared->width; + *height = shared->height; + *averageFrameSize = shared->averageFrameSize; + *fps = shared->fps; + *pelAspectRatio = shared->pelAspectRatio; + + fprintf(stderr, "LVS session %d opened.\n",ACE_OS::getpid ()); + + return 0; +#endif +} + +void StartPlayLiveVideo(void) +{ +#ifndef LIVE_VIDEO + return; +#else + if (lvspid == -1) return; + + count = 0; + session_time = get_msec(); + + enter_cs(shared->sid); + + prefid = -1; + first_fid = -1; + first_frame = -1; + + if (shared->activeSessions <= 0) shared->activeSessions = 1; + else shared->activeSessions ++; + + leave_cs(shared->sid); + + while (shared->curbuf <= shared->wait_curbuf) { + /* + fprintf(stderr, "curbuf %d, wait_curbuf %d\n", + shared->curbuf, shared->wait_curbuf); + */ + usleep(10000); + } + + fprintf(stderr, "LVS session %d started\n",ACE_OS::getpid ()); + + return; +#endif +} + +void StopPlayLiveVideo(void) +{ +#ifndef LIVE_VIDEO + return; +#else + if (lvspid == -1) return; + enter_cs(shared->sid); + shared->activeSessions --; + leave_cs(shared->sid); + + fprintf(stderr, "LVS session %d stopped, at %5.2f fps.\n",ACE_OS::getpid (), + ((double)count * 1000.0) / get_duration(session_time, get_msec())); + + return; +#endif +} + +#if 1 +int ReadLiveVideoPicture(int * frame, char * buf, int size) /* ret # bytes */ +{ +#ifndef LIVE_VIDEO + return 0; +#else + int pframe = * frame; + int ssize; + int bufptr; + + if (lvspid == -1) return 0; + + if (first_frame == -1) { /* first frame in current session */ + curbuf = shared->curbuf - 1; + bufptr = curbuf % shared->bufnum; + enter_cs(shared->sid); + } + else { + int bufnum = shared->bufnum < 3 ? shared->bufnum : 3; + do { + curbuf ++; + if (curbuf <= shared->curbuf - bufnum) { + /* + fprintf(stderr, "LVS session %d skipped %d buffers\n", + getpid(), shared->curbuf - bufnum + 1 - curbuf); + */ + curbuf = shared->curbuf - bufnum + 1; + } + bufptr = curbuf % shared->bufnum; + while (shared->buf[bufptr].fid <= prefid) { + /* + fprintf(stderr, + "LVS session %d wait: curbuf %d, shared->curbuf %d, prefid %d, shared->fid %d\n", + getpid(), curbuf, shared->curbuf, prefid, shared->buf[bufptr].fid); + */ + enter_cs(shared->sid); + shared->suscount ++; + leave_cs(shared->sid); + enter_cs(shared->susid); + } + } while (pframe > first_frame + (shared->buf[bufptr].fid - first_fid)); + + enter_cs(shared->sid); + /* + fprintf(stderr, "pframe %d, aframe %d\n", + pframe, first_frame + (shared->buf[bufptr].fid - first_fid)); + */ + } + shared->buf[bufptr].refcnt ++; + leave_cs(shared->sid); + + ssize = shared->buf[bufptr].size; + + ssize = (ssize < size ? ssize : size); + ACE_OS::memcpy (buf, shared->buf[bufptr].data, ssize); + + enter_cs(shared->sid); + + shared->buf[bufptr].refcnt --; + prefid = shared->buf[bufptr].fid; + if (first_frame == -1) { + first_fid = prefid; + first_frame = * frame; + } + else { + * frame = first_frame + (prefid - first_fid); + } + leave_cs(shared->sid); + /* + fprintf(stderr, + "LVS session %d read curbuf %d fid %d, frame %d size %d (ffid %d, fframe %d)\n", + ACE_OS::getpid (), curbuf, prefid, *frame, ssize, first_fid, first_frame); + */ + /* + fprintf(stderr, "LVS read fid %d, frame %d\n", prefid, *frame); + */ + count ++; + return ssize; +#endif +} +#endif + +#if 0 +/* following version is for testing the speed of the vcr path, excluding the + xil stuff */ + +static long start_time; + +int ReadLiveVideoPicture(int * frame, char * buf, int size) /* ret # bytes */ +{ +#ifndef LIVE_VIDEO + return 0; +#else + int pframe = * frame; + int ssize; + char * sbuf; + if (lvspid == -1) return 0; + + loop_begin: + /* + enter_cs(shared->sid); + */ + if (first_frame == -1) { + first_frame = *frame; + first_fid = shared->fid; + start_time = get_msec(); + } + else { + int f = first_frame + ((double)get_duration(start_time, get_msec()) / + ((double)1000.0 / (double)shared->fps)); + if (f < *frame) { + + leave_cs(shared->sid); + /* + fprintf(stderr, "f=%d < *frame=%d\n", f, *frame); + */ + usleep(10000); + goto loop_begin; + } + *frame = f; + } + + prefid = shared->fid; + sbuf = shared->buf[shared->curbuf].data; + ssize = shared->buf[shared->curbuf].size; + + ssize = (ssize < size ? ssize : size); + ACE_OS::memcpy (buf, sbuf, ssize); + /* + leave_cs(shared->sid); + */ + /* + fprintf(stderr, "LVS read fid %d, frame %d size %d (ffid %d, fframe %d)\n", + shared->fid, *frame, ssize, first_fid, first_frame); + */ + count ++; + return ssize; +#endif +} +#endif + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h new file mode 100644 index 00000000000..2076b2921c5 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h @@ -0,0 +1,63 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#include "Globals.h" + +/* las.c */ +int InitLiveAudio(int argc, char ** argv); /* -1 -- failed, 0 - succ */ +void LeaveLiveAudio(void); + /* each child forked not doing live audio should call this */ +void ExitLiveAudio(void); +int OpenLiveAudio(AudioParameter * ap); /* -1 -- failed, 0 - succ */ +void StartPlayLiveAudio(void); +void StopPlayLiveAudio(void); +int ReadLiveAudioSamples(char * buf, int samples); /* ret # samples */ + +/* lvs.c */ + +int InitLiveVideo(int argc, char ** argv); /* -1 -- failed, 0 - succ */ +void LeaveLiveVideo(void); + /* each child forked not doing live video should call this */ +void ExitLiveVideo(void); +int OpenLiveVideo(int * format, + int * width, int * height, + int * averageFrameSize, + double * fps, + int * pelAspactRatio /* MPEG1 encoding used here */ + ); /* -1 -- failed, 0 - succ */ +void StartPlayLiveVideo(void); +void StopPlayLiveVideo(void); +int ReadLiveVideoPicture(int * frame, char * buf, int size); /* ret # bytes */ + +/*from camera driver definitions */ + +int LiveVideoProcess(int argc, char ** argv); + +/* as.c */ +int AudioServer(int ctr_fd, int data_fd, int rttag, int max_pkt_size); + +/* vs.c */ +int VideoServer(int ctr_fd, int data_fd, int rttag, int max_pkt_size); diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/vs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/vs.cpp new file mode 100644 index 00000000000..e5bb9db7ad3 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/vs.cpp @@ -0,0 +1,2152 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" + +#include "include/common.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/com.h" +#include "mpeg_shared/sendpt.h" +#include "server_proto.h" +#include "Globals.h" + +ACE_RCSID(mpeg_server, vs, "$Id$") + +// %% Move all these functions to the VIDEO_SINGLETON class and remove +// zombie code like VideoServer ()... +static int CmdRead(char *buf, int psize) +{ + int res = wait_read_bytes (VIDEO_SINGLETON::instance ()->serviceSocket, + buf, + psize); + if (res == 0) return(1); + if (res == -1) { + fprintf(stderr, "VS error on read VIDEO_SINGLETON::instance ()->cmdSocket, size %d", psize); + ACE_OS::perror (""); + return(-1); + } + return 0; +} + +static void CmdWrite(char *buf, int size) +{ + int res = wait_write_bytes(VIDEO_SINGLETON::instance ()->serviceSocket, buf, size); + if (res == -1) { + if (errno != EPIPE)ACE_OS::perror ("VS writes to VIDEO_SINGLETON::instance ()->serviceSocket"); + ACE_OS::exit (errno != EPIPE); + } +} + +int FBread(char * buf, int size) +{ int res; + while ((res = (VIDEO_SINGLETON::instance ()->conn_tag >= 0 ? wait_read_bytes(VIDEO_SINGLETON::instance ()->videoSocket, buf, size) : + ACE_OS::read (VIDEO_SINGLETON::instance ()->videoSocket, buf, size))) == -1) + { + if (errno == EINTR) {errno = 0; continue; } + if (errno == EPIPE || errno == ECONNRESET) ACE_OS::exit (0); + ACE_OS::perror ("VS reads Feedback VIDEO_SINGLETON::instance ()->packet"); + return -1; + } + if (res < size) { + if (res) fprintf(stderr, "VS warn: FBread() res %dB < size %dB\n", res, size); + return -1; + } + return 0; +} + + +/* send a given VIDEO_SINGLETON::instance ()->packet pointed by 'VIDEO_SINGLETON::instance ()->packet' to the network */ + +int send_to_network(int timeToUse) +{ + int count = 0; + VideoMessage * msghd = (VideoMessage *)(((char *)VIDEO_SINGLETON::instance ()->packet) - sizeof(VideoMessage)); + int sent = 0; + int packetSize = ntohl(VIDEO_SINGLETON::instance ()->packet->dataBytes); + + msghd->packetsn = htonl(VIDEO_SINGLETON::instance ()->packetsn ++); + msghd->packetSize = htonl(packetSize + sizeof(* VIDEO_SINGLETON::instance ()->packet)); + /* + fprintf(stderr, "VS to send pkt %d of size %d.\n", + ntohl(msghd->VIDEO_SINGLETON::instance ()->packetsn), ntohl(msghd->VIDEO_SINGLETON::instance ()->packetSize)); + */ + { + VideoMessage * msg = NULL; + int size = packetSize + sizeof(* VIDEO_SINGLETON::instance ()->packet); /* msghd->VIDEO_SINGLETON::instance ()->packetSize */ + int offset = 0; + int targetTime; + + if (size > VIDEO_SINGLETON::instance ()->msgsize) + { + + if (!timeToUse) + { + timeToUse = (VIDEO_SINGLETON::instance ()->msgsize + sizeof(*msg) + 28) * 2; + /* + set the max network as 500KB. + 28 - UDP header size + */ + /* + fprintf(stderr, "computed timeToUse %d. ", timeToUse); + */ + } + else + { + timeToUse = (timeToUse * 7) >> 3; + /* + fprintf(stderr, "preset timeToUse %d.", timeToUse); + */ + timeToUse /= (size + VIDEO_SINGLETON::instance ()->msgsize - 1) / VIDEO_SINGLETON::instance ()->msgsize; + timeToUse = min(timeToUse, (VIDEO_SINGLETON::instance ()->msgsize + sizeof(*msg) + 28) * 100); + /* limit min network bandwidth = 10K */ + } + + } + while (size > 0) + { + int segsize, sentsize; + int resent = 0; + + if (msg == NULL) { /* first message for current VIDEO_SINGLETON::instance ()->packet */ + count = 0; + msg = msghd; + targetTime = get_usec(); + } + else { +#if 0 + /* the select() is not precise enough for being used here*/ + int sleepTime; + targetTime += timeToUse; + sleepTime = get_duration(get_usec(), targetTime); + if (sleepTime >= 5000) { /* resolution of timer is 10,000 usec */ + usleep(sleepTime); /* not first message, wait for a while */ + } +#endif + /* + count ++; + if (!(count % 10)) usleep(10000); + */ + msg = (VideoMessage *)((char *)msg + VIDEO_SINGLETON::instance ()->msgsize); + memcpy((char *)msg, (char *)msghd, sizeof(* msg)); + } + msg->msgsn = htonl(VIDEO_SINGLETON::instance ()->msgsn++); + msg->msgOffset = htonl(offset); + msg->msgSize = htonl(min(size, VIDEO_SINGLETON::instance ()->msgsize)); + + segsize = min(size, VIDEO_SINGLETON::instance ()->msgsize)+sizeof(*msg); + if (VIDEO_SINGLETON::instance ()->conn_tag != 0) { /* VIDEO_SINGLETON::instance ()->packet stream */ + while ((sentsize = ACE_OS::write (VIDEO_SINGLETON::instance ()->videoSocket, (char *)msg, segsize)) == -1) { + if (errno == EINTR) + continue; + if (errno == ENOBUFS) { + if (resent) { + ACE_OS::perror ("Warning, pkt discarded because"); + sent = -1; + break; + } + else { + resent = 1; + ACE_OS::perror ("VS to sleep 5ms"); + usleep(5000); + continue; + } + } + if (errno != EPIPE) { + fprintf(stderr, "VS error on send VIDEO_SINGLETON::instance ()->packet %d of size %d ", + VIDEO_SINGLETON::instance ()->msgsn-1, min(size, VIDEO_SINGLETON::instance ()->msgsize)+sizeof(*msg)); + ACE_OS::perror (""); + } + ACE_OS::exit (errno != EPIPE); + } + } + else { + sentsize = wait_write_bytes(VIDEO_SINGLETON::instance ()->videoSocket, (char *)msg, segsize); + if (sentsize == -1) { + if (errno != EPIPE) { + fprintf(stderr, "VS error on send VIDEO_SINGLETON::instance ()->packet %d of size %d ", + VIDEO_SINGLETON::instance ()->msgsn-1, min(size, VIDEO_SINGLETON::instance ()->msgsize)+sizeof(*msg)); + ACE_OS::perror (""); + } + ACE_OS::exit (errno != EPIPE); + } + } + if (sentsize < segsize) { + SFprintf(stderr, "VS warning: message size %dB, sent only %dB\n", + segsize, sentsize); + } + if (sent == -1) + break; + /* + fprintf(stderr, "VS: message %d of size %d sent.\n", + VIDEO_SINGLETON::instance ()->msgsn-1, min(size, VIDEO_SINGLETON::instance ()->msgsize)+sizeof(*msg)); + */ + size -= VIDEO_SINGLETON::instance ()->msgsize; + offset += VIDEO_SINGLETON::instance ()->msgsize; + } + } + /* + fprintf(stderr, "sent = %d\n", sent); + */ + if (!sent) VIDEO_SINGLETON::instance ()->pkts_sent ++; + return sent; +} + +/* + * send a VIDEO_SINGLETON::instance ()->packet with given VIDEO_SINGLETON::instance ()->systemHeader (optional), gop (optional) and frame. + * + * sh - system header id, if -1, then no system header will be sent. + * otherwise, only when frame == 0, the given system header will be sent. + * gop - group of pictures, gop header will be sent when frame == 0 + * (first I frame ); + * frame - frame to be sent, offset internal to given gop. + */ + +/* returns: 0 - VIDEO_SINGLETON::instance ()->packet sent, -1 - VIDEO_SINGLETON::instance ()->packet not sent (failed) */ +static int SendPacket(int shtag, int gop, int frame, int timeToUse) +/* frame maybe out of range (PLAY, STEP), in this case, END_SEQ is sent + to force display of last frame in VD */ +{ + char * buf = ((char *) VIDEO_SINGLETON::instance ()->packet) + sizeof(VideoPacket); + int f = VIDEO_SINGLETON::instance ()->gopTable[gop].previousFrames + frame; + int sh = VIDEO_SINGLETON::instance ()->gopTable[gop].systemHeader; + /* + SFprintf(stderr, "VS to send VIDEO_SINGLETON::instance ()->packet gop-%d, frame-%d.\n", gop, frame); + */ + + VIDEO_SINGLETON::instance ()->packet->currentUPF = ntohl(VIDEO_SINGLETON::instance ()->currentUPF); + + if (frame >= VIDEO_SINGLETON::instance ()->gopTable[gop].totalFrames) + { + VIDEO_SINGLETON::instance ()->packet->cmd = htonl(VIDEO_SINGLETON::instance ()->cmd); + VIDEO_SINGLETON::instance ()->packet->cmdsn = htonl(VIDEO_SINGLETON::instance ()->cmdsn); + VIDEO_SINGLETON::instance ()->packet->sh = htonl(sh); + VIDEO_SINGLETON::instance ()->packet->gop = htonl(gop); + VIDEO_SINGLETON::instance ()->packet->frame = htonl(VIDEO_SINGLETON::instance ()->numF); + VIDEO_SINGLETON::instance ()->packet->display = htonl(VIDEO_SINGLETON::instance ()->numF-1); + VIDEO_SINGLETON::instance ()->packet->future = htonl((unsigned)-1); + VIDEO_SINGLETON::instance ()->packet->past = htonl((unsigned)-1); + VIDEO_SINGLETON::instance ()->packet->dataBytes = htonl(4); + *(int*)((char*)VIDEO_SINGLETON::instance ()->packet + sizeof(*VIDEO_SINGLETON::instance ()->packet)) = htonl(SEQ_END_CODE); + + return send_to_network(timeToUse); + } + + if (frame) + shtag = 0; + else if (VIDEO_SINGLETON::instance ()->needHeader) + { + shtag = 1; + VIDEO_SINGLETON::instance ()->needHeader = 0; + } + + VIDEO_SINGLETON::instance ()->packet->cmd = htonl(VIDEO_SINGLETON::instance ()->cmd); + VIDEO_SINGLETON::instance ()->packet->cmdsn = htonl(VIDEO_SINGLETON::instance ()->cmdsn); + VIDEO_SINGLETON::instance ()->packet->sh = htonl(sh); + VIDEO_SINGLETON::instance ()->packet->gop = htonl(gop); + VIDEO_SINGLETON::instance ()->packet->frame = htonl(f); + if (VIDEO_SINGLETON::instance ()->frameTable[f].type == 'B') + { + int pre1 = -1, pre2 = -1, i = f; + while (i>0) + if (VIDEO_SINGLETON::instance ()->frameTable[--i].type != 'B') + { + pre1 = i; + break; + } + while (i>0) + if (VIDEO_SINGLETON::instance ()->frameTable[--i].type != 'B') + { + pre2 = i; + break; + } + if (pre2 == -1) + { + /* + fprintf(stderr, + "frame %d-%d (%d) is a B without past ref, no to be sent.\n", + gop, frame, f); + */ + return -1; + } + if (pre1 != VIDEO_SINGLETON::instance ()->lastRef[VIDEO_SINGLETON::instance ()->lastRefPtr] || + pre2 != VIDEO_SINGLETON::instance ()->lastRef[1 - VIDEO_SINGLETON::instance ()->lastRefPtr]) + { + /* + fprintf(stderr, + "send of B frame %d gaveup for past %d/future %d ref not sent.\n", + f, pre2, pre1); + */ + return -1; + } + VIDEO_SINGLETON::instance ()->packet->display = htonl(f); + VIDEO_SINGLETON::instance ()->packet->future = htonl(pre1); + VIDEO_SINGLETON::instance ()->packet->past = htonl(pre2); + } + else + { + int next = f; + int pre = f; + + while (next < VIDEO_SINGLETON::instance ()->numF && VIDEO_SINGLETON::instance ()->frameTable[++next].type == 'B'); + while (pre > 0 && VIDEO_SINGLETON::instance ()->frameTable[--pre].type == 'B'); + if (VIDEO_SINGLETON::instance ()->frameTable[f].type == 'P' && pre != VIDEO_SINGLETON::instance ()->lastRef[VIDEO_SINGLETON::instance ()->lastRefPtr]) + { + /* + fprintf(stderr, + "send of P frame %d gaveup for past ref %d not sent.\n", + f, pre); + fprintf(stderr, "ref0=%d, ref1=%d, ptr=%d.\n", + VIDEO_SINGLETON::instance ()->lastRef[0], VIDEO_SINGLETON::instance ()->lastRef[1], VIDEO_SINGLETON::instance ()->lastRefPtr); + */ + return -1; + } + VIDEO_SINGLETON::instance ()->packet->display = htonl(next); + VIDEO_SINGLETON::instance ()->packet->future = htonl((unsigned)-1); + VIDEO_SINGLETON::instance ()->packet->past = htonl(VIDEO_SINGLETON::instance ()->frameTable[f].type == 'P' ? pre : (unsigned)-1); + } + { + char * ptr = buf; + int size = 0, offset = 0, i; + if (shtag) /* send system header */ + { + size = VIDEO_SINGLETON::instance ()->systemHeader[sh].size; + FileRead(VIDEO_SINGLETON::instance ()->systemHeader[sh].offset, ptr, size); + ptr += size; + } + if (!frame) /* send gop header */ + { + size = VIDEO_SINGLETON::instance ()->gopTable[gop].headerSize; + FileRead(VIDEO_SINGLETON::instance ()->gopTable[gop].offset, ptr, size); + ptr += size; + } + size = VIDEO_SINGLETON::instance ()->frameTable[f].size; + for (i=VIDEO_SINGLETON::instance ()->gopTable[gop].previousFrames; i<f; i++) + offset += VIDEO_SINGLETON::instance ()->frameTable[i].size; + FileRead((VIDEO_SINGLETON::instance ()->gopTable[gop].firstIoffset + offset), ptr, size); + ptr += size; + VIDEO_SINGLETON::instance ()->packet->dataBytes = htonl(ptr - buf); + } + + { + int sent = send_to_network(timeToUse); + if (!sent) + { + /* + fprintf(stderr, "%c%d\n", VIDEO_SINGLETON::instance ()->frameTable[f].type, f); + fprintf(stderr, "%c frame %d sent.\n", VIDEO_SINGLETON::instance ()->frameTable[f].type, f); + */ + if (VIDEO_SINGLETON::instance ()->frameTable[f].type != 'B') + { + VIDEO_SINGLETON::instance ()->lastRefPtr = 1 - VIDEO_SINGLETON::instance ()->lastRefPtr; + VIDEO_SINGLETON::instance ()->lastRef[VIDEO_SINGLETON::instance ()->lastRefPtr] = f; + } + } + return sent; + } +} + + +int SendReferences(int group, int frame) +{ + unsigned char orgcmd; + int i, base; + int pregroup; + int result; + + if (group < 0 || group >= VIDEO_SINGLETON::instance ()->numG) return 0; + if (frame <= 0 || frame >= VIDEO_SINGLETON::instance ()->gopTable[group].totalFrames) return 0; + + orgcmd = VIDEO_SINGLETON::instance ()->cmd; + VIDEO_SINGLETON::instance ()->cmd = CmdREF; + + if (group > 0) { + pregroup = 1; + base = VIDEO_SINGLETON::instance ()->gopTable[group].previousFrames; + for (i = 0; i <= frame; i ++) { + if (VIDEO_SINGLETON::instance ()->frameTable[i + base].type == 'P') { + pregroup = 0; + break; + } + } + } + else pregroup = 0; + + if (pregroup) { /* reference frame can be in previous group */ + pregroup = group -1; + base = VIDEO_SINGLETON::instance ()->gopTable[pregroup].previousFrames; + for (i = 0; i < VIDEO_SINGLETON::instance ()->gopTable[pregroup].totalFrames; i ++) { + if (VIDEO_SINGLETON::instance ()->frameTable[i + base].type != 'B') { + /* + SFprintf(stderr, "REF group%d, frame%d\n", pregroup, i); + */ + result = SendPacket(i == 0, pregroup, i, 0); + if (result != 0) + return result; + } + } + } + + base = VIDEO_SINGLETON::instance ()->gopTable[group].previousFrames; + for (i = 0; i < frame; i ++) { + if (VIDEO_SINGLETON::instance ()->frameTable[i + base].type != 'B') { + /* + SFprintf(stderr, "REF group%d, frame%d\n", group, i); + */ + SendPacket(i == 0, group, i, 0); + } + } + VIDEO_SINGLETON::instance ()->cmd = orgcmd; +} + +int SendPicture(int * frame) +{ + int size; + char * buf = ((char *) VIDEO_SINGLETON::instance ()->packet) + sizeof(VideoPacket); + /* + SFprintf(stderr, "VS to send picture %d.\n", *frame); + */ + + size = ReadLiveVideoPicture(frame, buf, VIDEO_SINGLETON::instance ()->packetBufSize); + + VIDEO_SINGLETON::instance ()->packet->currentUPF = ntohl(VIDEO_SINGLETON::instance ()->currentUPF); + VIDEO_SINGLETON::instance ()->packet->cmd = htonl(VIDEO_SINGLETON::instance ()->cmd); + VIDEO_SINGLETON::instance ()->packet->cmdsn = htonl(VIDEO_SINGLETON::instance ()->cmdsn); + VIDEO_SINGLETON::instance ()->packet->sh = VIDEO_SINGLETON::instance ()->packet->gop = VIDEO_SINGLETON::instance ()->packet->frame = VIDEO_SINGLETON::instance ()->packet->display = htonl(*frame); + VIDEO_SINGLETON::instance ()->packet->future = htonl((unsigned)-1); + VIDEO_SINGLETON::instance ()->packet->past = htonl((unsigned)-1); + + VIDEO_SINGLETON::instance ()->packet->dataBytes = htonl(size); + + return send_to_network(VIDEO_SINGLETON::instance ()->currentUPF); +} + +static int ReadInfoFromFile(void) +{ + int fd = -1, i; + int fnlen =ACE_OS::strlen (VIDEO_SINGLETON::instance ()->videoFile); + + strcpy(&VIDEO_SINGLETON::instance ()->videoFile[fnlen], ".Info"); + fd = open(VIDEO_SINGLETON::instance ()->videoFile, O_RDONLY); + if (fd == -1) + { + fprintf(stderr, "Reminder: VS fails to open %s for read, ", VIDEO_SINGLETON::instance ()->videoFile); + ACE_OS::perror ("try create one"); + goto fail_ReadInfoFromFile; + } + read_int(fd, &i); + if (i != VIDEO_SINGLETON::instance ()->fileSize) + { + fprintf(stderr, "Warning: VIDEO_SINGLETON::instance ()->fileSize in Info: %d not the same as actual %d.\n", + i, VIDEO_SINGLETON::instance ()->fileSize); + goto fail_ReadInfoFromFile; + } + + read_int(fd, &VIDEO_SINGLETON::instance ()->maxS); + read_int(fd, &VIDEO_SINGLETON::instance ()->maxG); + read_int(fd, &VIDEO_SINGLETON::instance ()->maxI); + read_int(fd, &VIDEO_SINGLETON::instance ()->maxP); + read_int(fd, &VIDEO_SINGLETON::instance ()->maxB); + read_int(fd, &VIDEO_SINGLETON::instance ()->minS); + read_int(fd, &VIDEO_SINGLETON::instance ()->minG); + read_int(fd, &VIDEO_SINGLETON::instance ()->minI); + read_int(fd, &VIDEO_SINGLETON::instance ()->minP); + read_int(fd, &VIDEO_SINGLETON::instance ()->minB); + read_int(fd, &VIDEO_SINGLETON::instance ()->numS); + read_int(fd, &VIDEO_SINGLETON::instance ()->numG); + read_int(fd, &VIDEO_SINGLETON::instance ()->numF); + read_int(fd, &VIDEO_SINGLETON::instance ()->numI); + read_int(fd, &VIDEO_SINGLETON::instance ()->numP); + read_int(fd, &VIDEO_SINGLETON::instance ()->numB); + read_int(fd, &VIDEO_SINGLETON::instance ()->averageFrameSize); + read_int(fd, &VIDEO_SINGLETON::instance ()->horizontalSize); + read_int(fd, &VIDEO_SINGLETON::instance ()->verticalSize); + read_int(fd, &VIDEO_SINGLETON::instance ()->pelAspectRatio); + read_int(fd, &VIDEO_SINGLETON::instance ()->pictureRate); + read_int(fd, &VIDEO_SINGLETON::instance ()->vbvBufferSize); + read_int(fd, &VIDEO_SINGLETON::instance ()->patternSize); + + memset(VIDEO_SINGLETON::instance ()->pattern, 0, PATTERN_SIZE); + read_bytes(fd, VIDEO_SINGLETON::instance ()->pattern, VIDEO_SINGLETON::instance ()->patternSize); +#ifdef STAT + VIDEO_SINGLETON::instance ()->framesSent = (char *)ACE_OS::malloc((VIDEO_SINGLETON::instance ()->numF + 7)>>3); + if (VIDEO_SINGLETON::instance ()->framesSent == NULL) + { + fprintf(stderr, "Error: VS fails to alloc mem for VIDEO_SINGLETON::instance ()->framesSent for %d frames", VIDEO_SINGLETON::instance ()->numF); + ACE_OS::perror (""); + ACE_OS::exit (1); + } +#endif + VIDEO_SINGLETON::instance ()->systemHeader = (struct Video_Global::SystemHeader *)ACE_OS::malloc(sizeof(struct Video_Global::SystemHeader) * VIDEO_SINGLETON::instance ()->numS); + if (VIDEO_SINGLETON::instance ()->systemHeader == NULL) + { + ACE_OS::perror ("Error: VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->SystemHeader"); + ACE_OS::exit (1); + } + VIDEO_SINGLETON::instance ()->gopTable = (struct Video_Global::GopTable *)ACE_OS::malloc(sizeof(struct Video_Global::GopTable) * VIDEO_SINGLETON::instance ()->numG); + if (VIDEO_SINGLETON::instance ()->gopTable == NULL) + { + ACE_OS::perror ("Error: VS error on ACE_OS::malloc GopHeader"); + ACE_OS::exit (1); + } + VIDEO_SINGLETON::instance ()->frameTable = (struct Video_Global::FrameTable *)ACE_OS::malloc(sizeof(Video_Global::FrameTable) * VIDEO_SINGLETON::instance ()->numF); + if (VIDEO_SINGLETON::instance ()->frameTable == NULL) + { + ACE_OS::perror ("Error: VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->frameTable"); + ACE_OS::exit (1); + } + VIDEO_SINGLETON::instance ()->packetBufSize = VIDEO_SINGLETON::instance ()->maxS + VIDEO_SINGLETON::instance ()->maxG + max(VIDEO_SINGLETON::instance ()->maxI, max(VIDEO_SINGLETON::instance ()->maxP, VIDEO_SINGLETON::instance ()->maxB)); + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)ACE_OS::malloc(sizeof(VideoMessage) + sizeof(VideoPacket) + + VIDEO_SINGLETON::instance ()->packetBufSize); + if (VIDEO_SINGLETON::instance ()->packet == NULL) + { + ACE_OS::perror ("Error: VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->packet buffer"); + ACE_OS::exit (1); + } + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)((char *)VIDEO_SINGLETON::instance ()->packet + sizeof(VideoMessage)); + + for (i = 0; i < VIDEO_SINGLETON::instance ()->numS; i ++) + { + read_int(fd, (int *)&VIDEO_SINGLETON::instance ()->systemHeader[i].offset); + read_int(fd, &VIDEO_SINGLETON::instance ()->systemHeader[i].size); + } + for (i = 0; i < VIDEO_SINGLETON::instance ()->numG; i ++) + { + read_int(fd, &VIDEO_SINGLETON::instance ()->gopTable[i].systemHeader); + read_int(fd, (int *)&VIDEO_SINGLETON::instance ()->gopTable[i].offset); + read_int(fd, &VIDEO_SINGLETON::instance ()->gopTable[i].headerSize); + read_int(fd, &VIDEO_SINGLETON::instance ()->gopTable[i].size); + read_int(fd, &VIDEO_SINGLETON::instance ()->gopTable[i].totalFrames); + read_int(fd, &VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames); + read_int(fd, (int *)&VIDEO_SINGLETON::instance ()->gopTable[i].firstIoffset); + } + for (i = 0; i < VIDEO_SINGLETON::instance ()->numF; i ++) + { + read_byte(fd, &VIDEO_SINGLETON::instance ()->frameTable[i].type); + read_short(fd, (short *)&VIDEO_SINGLETON::instance ()->frameTable[i].size); + } + + ACE_OS::close (fd); + /* + fprintf(stderr, "Read Info from %s\n", VIDEO_SINGLETON::instance ()->videoFile); + */ + VIDEO_SINGLETON::instance ()->videoFile[fnlen] = 0; + return 0; + fail_ReadInfoFromFile: + if (fd >= 0) + ACE_OS::close (fd); + VIDEO_SINGLETON::instance ()->videoFile[fnlen] = 0; + /* + fprintf(stderr, "To scan Info from %s\n", VIDEO_SINGLETON::instance ()->videoFile); + */ + return -1; +} + +static void WriteInfoToFile(void) +{ + int fd = -1, i; + int fnlen =ACE_OS::strlen (VIDEO_SINGLETON::instance ()->videoFile); + + strcpy(&VIDEO_SINGLETON::instance ()->videoFile[fnlen], ".Info"); + fd = open(VIDEO_SINGLETON::instance ()->videoFile, O_WRONLY | O_CREAT, 0444); + if (fd == -1) + { + fprintf(stderr, "VS fails to open %s for write", VIDEO_SINGLETON::instance ()->videoFile); + ACE_OS::perror (""); + goto fail_WriteInfoToFile; + } + write_int(fd, VIDEO_SINGLETON::instance ()->fileSize); + write_int(fd, VIDEO_SINGLETON::instance ()->maxS); + write_int(fd, VIDEO_SINGLETON::instance ()->maxG); + write_int(fd, VIDEO_SINGLETON::instance ()->maxI); + write_int(fd, VIDEO_SINGLETON::instance ()->maxP); + write_int(fd, VIDEO_SINGLETON::instance ()->maxB); + write_int(fd, VIDEO_SINGLETON::instance ()->minS); + write_int(fd, VIDEO_SINGLETON::instance ()->minG); + write_int(fd, VIDEO_SINGLETON::instance ()->minI); + write_int(fd, VIDEO_SINGLETON::instance ()->minP); + write_int(fd, VIDEO_SINGLETON::instance ()->minB); + write_int(fd, VIDEO_SINGLETON::instance ()->numS); + write_int(fd, VIDEO_SINGLETON::instance ()->numG); + write_int(fd, VIDEO_SINGLETON::instance ()->numF); + write_int(fd, VIDEO_SINGLETON::instance ()->numI); + write_int(fd, VIDEO_SINGLETON::instance ()->numP); + write_int(fd, VIDEO_SINGLETON::instance ()->numB); + write_int(fd, VIDEO_SINGLETON::instance ()->averageFrameSize); + write_int(fd, VIDEO_SINGLETON::instance ()->horizontalSize); + write_int(fd, VIDEO_SINGLETON::instance ()->verticalSize); + write_int(fd, VIDEO_SINGLETON::instance ()->pelAspectRatio); + write_int(fd, VIDEO_SINGLETON::instance ()->pictureRate); + write_int(fd, VIDEO_SINGLETON::instance ()->vbvBufferSize); + write_int(fd, VIDEO_SINGLETON::instance ()->patternSize); + + write_bytes(fd, VIDEO_SINGLETON::instance ()->pattern, VIDEO_SINGLETON::instance ()->patternSize); + + for (i = 0; i < VIDEO_SINGLETON::instance ()->numS; i ++) + { + write_int(fd, VIDEO_SINGLETON::instance ()->systemHeader[i].offset); + write_int(fd, VIDEO_SINGLETON::instance ()->systemHeader[i].size); + } + for (i = 0; i < VIDEO_SINGLETON::instance ()->numG; i ++) + { + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].systemHeader); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].offset); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].headerSize); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].size); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].totalFrames); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames); + write_int(fd, VIDEO_SINGLETON::instance ()->gopTable[i].firstIoffset); + } + for (i = 0; i < VIDEO_SINGLETON::instance ()->numF; i ++) + { + write_byte(fd, VIDEO_SINGLETON::instance ()->frameTable[i].type); + write_short(fd, VIDEO_SINGLETON::instance ()->frameTable[i].size); + } + + ACE_OS::close (fd); + VIDEO_SINGLETON::instance ()->videoFile[fnlen] = 0; + return; + fail_WriteInfoToFile: + if (fd >= 0) + ACE_OS::close (fd); + VIDEO_SINGLETON::instance ()->videoFile[fnlen] = 0; + return; +} + +static int init_MPEG1_video_file(void) +{ + unsigned char nb; + int state = 0; + unsigned long fileptr = 0; + //unsigned long i, j, k; + int shptr, gopptr, ftptr; + int inpic = 0; + unsigned long picptr = 0; + int pictype = 0; + int first = 0; + int failureType = 0; + + VIDEO_SINGLETON::instance ()->fp = fopen(VIDEO_SINGLETON::instance ()->videoFile, "r"); + if (VIDEO_SINGLETON::instance ()->fp == NULL) + { + fprintf(stderr, "error on opening video file %s", VIDEO_SINGLETON::instance ()->videoFile); + ACE_OS::perror (""); + return 2; + } + if (fseek(VIDEO_SINGLETON::instance ()->fp, 0, 2) == -1) + { + fprintf(stderr, "File %s not seekable", VIDEO_SINGLETON::instance ()->videoFile); + ACE_OS::perror (""); + return 3; + } + VIDEO_SINGLETON::instance ()->fileSize = ftell(VIDEO_SINGLETON::instance ()->fp); + + fseek(VIDEO_SINGLETON::instance ()->fp, 0, 0); + + if (ReadInfoFromFile()) + { + for (;;) + { + nextByte; + if (state >= 0 && nb == 0x00) + state ++; + else if (state >= 2 && nb == 0x01) + state = -1; + else if (state == -1) + { + if (!first) first ++; + else if (first == 1) first ++; + + switch (nb) + { + case 0xb7: /* seq_end_code */ + goto exit_phase1; + break; + case 0xb3: /* seq_start_code */ + if (first == 1) first = 3; + if (first != 3) + { + fprintf(stderr, "VS error: given file is not in MPEG format.\n"); + return 4; + } + VIDEO_SINGLETON::instance ()->numS ++; + break; + case 0xb8: /* gop_start_code */ + VIDEO_SINGLETON::instance ()->numG ++; + break; + case 0x00: /* picture_start_code */ + nextByte; + nextByte; + nb &= 0x38; + if (nb == 0x08) + { + VIDEO_SINGLETON::instance ()->numI ++; + if (VIDEO_SINGLETON::instance ()->numG == 2) + VIDEO_SINGLETON::instance ()->pattern[VIDEO_SINGLETON::instance ()->patternSize++] = 'I'; + } + else if (nb == 0x10) + { + VIDEO_SINGLETON::instance ()->numP ++; + if (VIDEO_SINGLETON::instance ()->numG == 2) + VIDEO_SINGLETON::instance ()->pattern[VIDEO_SINGLETON::instance ()->patternSize++] = 'P'; + } + else if (nb == 0x18) + { + VIDEO_SINGLETON::instance ()->numB ++; + if (VIDEO_SINGLETON::instance ()->numG == 2) + VIDEO_SINGLETON::instance ()->pattern[VIDEO_SINGLETON::instance ()->patternSize++] = 'B'; + } + /* + else + fprintf(stderr, "VS error: unkonw picture type %d\n", nb); + */ + break; + default: + break; + } + state = 0; + } + else + state = 0; + } + exit_phase1: + + if (first != 3) + { + fprintf(stderr, "VS error: given file \"%s\" is not of MPEG format.\n", VIDEO_SINGLETON::instance ()->videoFile); + return 4; + } + + VIDEO_SINGLETON::instance ()->pattern[VIDEO_SINGLETON::instance ()->patternSize] = 0; + memset(VIDEO_SINGLETON::instance ()->sendPattern, 1, PATTERN_SIZE); + + VIDEO_SINGLETON::instance ()->numF = VIDEO_SINGLETON::instance ()->numI + VIDEO_SINGLETON::instance ()->numP + VIDEO_SINGLETON::instance ()->numB; + VIDEO_SINGLETON::instance ()->averageFrameSize = fileptr / (unsigned)VIDEO_SINGLETON::instance ()->numF; + /* + fprintf(stderr, "Pass one finished, total bytes read: %u, average frame size %d\n", + fileptr, VIDEO_SINGLETON::instance ()->averageFrameSize); + fprintf(stderr, "VIDEO_SINGLETON::instance ()->numS-%d, VIDEO_SINGLETON::instance ()->numG-%d, VIDEO_SINGLETON::instance ()->numF-%d, VIDEO_SINGLETON::instance ()->numI-%d, VIDEO_SINGLETON::instance ()->numP-%d, VIDEO_SINGLETON::instance ()->numB-%d\n", + VIDEO_SINGLETON::instance ()->numS, VIDEO_SINGLETON::instance ()->numG, VIDEO_SINGLETON::instance ()->numI, VIDEO_SINGLETON::instance ()->numI, VIDEO_SINGLETON::instance ()->numP, VIDEO_SINGLETON::instance ()->numB); + fprintf(stderr, "VIDEO_SINGLETON::Instance ()->Pattern detected: %s\n", VIDEO_SINGLETON::instance ()->pattern); + */ + if (VIDEO_SINGLETON::instance ()->numF > MAX_FRAMES) + { + fprintf(stderr, "VS error: VIDEO_SINGLETON::instance ()->Number of frames (%d) is bigger than MAX_FRAMES (%d).\n\ + you need to update the constant definition in common.h and recompile.\n", + VIDEO_SINGLETON::instance ()->numF, MAX_FRAMES); + return 5; + } + +#ifdef STAT + VIDEO_SINGLETON::instance ()->framesSent = (char *)ACE_OS::malloc((VIDEO_SINGLETON::instance ()->numF + 7)>>3); + if (VIDEO_SINGLETON::instance ()->framesSent == NULL) + { + fprintf(stderr, "VS fails to alloc mem for VIDEO_SINGLETON::instance ()->framesSent for %d frames", VIDEO_SINGLETON::instance ()->numF); + ACE_OS::perror (""); + return 6; + } +#endif + + VIDEO_SINGLETON::instance ()->systemHeader = (struct Video_Global::SystemHeader *)ACE_OS::malloc(sizeof(struct Video_Global::SystemHeader) * VIDEO_SINGLETON::instance ()->numS); + if (VIDEO_SINGLETON::instance ()->systemHeader == NULL) + { + ACE_OS::perror ("VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->SystemHeader"); + return 7; + } + VIDEO_SINGLETON::instance ()->gopTable = (struct Video_Global::GopTable *)ACE_OS::malloc(sizeof(struct Video_Global::GopTable) * VIDEO_SINGLETON::instance ()->numG); + if (VIDEO_SINGLETON::instance ()->gopTable == NULL) + { + ACE_OS::perror ("VS error on ACE_OS::malloc GopHeader"); + return 8; + } + VIDEO_SINGLETON::instance ()->frameTable = (struct Video_Global::FrameTable *)ACE_OS::malloc(sizeof(Video_Global::FrameTable) * VIDEO_SINGLETON::instance ()->numF); + if (VIDEO_SINGLETON::instance ()->frameTable == NULL) + { + ACE_OS::perror ("VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->frameTable"); + return 9; + } + + rewind(VIDEO_SINGLETON::instance ()->fp); + fileptr = 0; + state = 0; + inpic = 0; + shptr = -1; + gopptr = -1; + ftptr = 0; + + for (;;) + { + nextByte; + if (state >= 0 && nb == 0x00) + state ++; + else if (state >= 2 && nb == 0x01) + state = -1; + else if (state == -1) + { + switch (nb) + { + case 0xb7: /* seq_end_code */ + if (gopptr >= 0 && VIDEO_SINGLETON::instance ()->gopTable[gopptr].size == 0) + VIDEO_SINGLETON::instance ()->gopTable[gopptr].size = fileptr - VIDEO_SINGLETON::instance ()->gopTable[gopptr].offset - 4; + computePicSize; + goto exit_phase2; + break; + case 0xb3: /* seq_start_code */ + if (gopptr >= 0 && VIDEO_SINGLETON::instance ()->gopTable[gopptr].size == 0) + VIDEO_SINGLETON::instance ()->gopTable[gopptr].size = fileptr - VIDEO_SINGLETON::instance ()->gopTable[gopptr].offset - 4; + computePicSize; + shptr ++; + VIDEO_SINGLETON::instance ()->systemHeader[shptr].offset = fileptr - 4; + VIDEO_SINGLETON::instance ()->systemHeader[shptr].size = 0; + break; + case 0xb8: /* gop_start_code */ + if (VIDEO_SINGLETON::instance ()->systemHeader[shptr].size == 0) + VIDEO_SINGLETON::instance ()->systemHeader[shptr].size =fileptr - VIDEO_SINGLETON::instance ()->systemHeader[shptr].offset - 4; + if (gopptr >= 0 && VIDEO_SINGLETON::instance ()->gopTable[gopptr].size == 0) + VIDEO_SINGLETON::instance ()->gopTable[gopptr].size = fileptr - VIDEO_SINGLETON::instance ()->gopTable[gopptr].offset - 4; + computePicSize; + gopptr ++; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].systemHeader = shptr; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].offset = fileptr - 4; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].headerSize = 0; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].size = 0; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].totalFrames = 0; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].previousFrames = gopptr ? + (VIDEO_SINGLETON::instance ()->gopTable[gopptr - 1].totalFrames + VIDEO_SINGLETON::instance ()->gopTable[gopptr - 1].previousFrames) : 0; + + break; + case 0x00: /* picture_start_code */ + if (VIDEO_SINGLETON::instance ()->gopTable[gopptr].headerSize == 0) + { + VIDEO_SINGLETON::instance ()->gopTable[gopptr].headerSize = fileptr - VIDEO_SINGLETON::instance ()->gopTable[gopptr].offset - 4; + VIDEO_SINGLETON::instance ()->gopTable[gopptr].firstIoffset = fileptr - 4; + } + VIDEO_SINGLETON::instance ()->gopTable[gopptr].totalFrames ++; + computePicSize; + picptr = fileptr - 4; + nextByte; + nextByte; + nb &= 0x38; + if (nb == 0x08) + { + pictype = 'I'; + inpic = 1; + } + else if (nb == 0x10) + { + pictype = 'P'; + inpic = 1; + } + else if (nb == 0x18) + { + pictype = 'B'; + inpic = 1; + } + break; + default: + + break; + } + state = 0; + } + else + state = 0; + } + + exit_phase2: + for (shptr = 0; shptr<VIDEO_SINGLETON::instance ()->numS; shptr++) + { + VIDEO_SINGLETON::instance ()->maxS = max(VIDEO_SINGLETON::instance ()->maxS, VIDEO_SINGLETON::instance ()->systemHeader[shptr].size); + VIDEO_SINGLETON::instance ()->minS = min(VIDEO_SINGLETON::instance ()->minS, VIDEO_SINGLETON::instance ()->systemHeader[shptr].size); + } + for (gopptr = 0; gopptr<VIDEO_SINGLETON::instance ()->numG; gopptr++) + { + VIDEO_SINGLETON::instance ()->maxG = max(VIDEO_SINGLETON::instance ()->maxG, VIDEO_SINGLETON::instance ()->gopTable[gopptr].headerSize); + VIDEO_SINGLETON::instance ()->minG = min(VIDEO_SINGLETON::instance ()->minG, VIDEO_SINGLETON::instance ()->gopTable[gopptr].headerSize); + } + VIDEO_SINGLETON::instance ()->packetBufSize = VIDEO_SINGLETON::instance ()->maxS + VIDEO_SINGLETON::instance ()->maxG + max(VIDEO_SINGLETON::instance ()->maxI, max(VIDEO_SINGLETON::instance ()->maxP, VIDEO_SINGLETON::instance ()->maxB)); + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)ACE_OS::malloc(sizeof(VideoMessage) + sizeof(VideoPacket) + + VIDEO_SINGLETON::instance ()->packetBufSize); + if (VIDEO_SINGLETON::instance ()->packet == NULL) + { + ACE_OS::perror ("VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->packet buffer"); + return 10; + } + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)((char *)VIDEO_SINGLETON::instance ()->packet + sizeof(VideoMessage)); + /* + fprintf(stderr, "Pass 2 finished.\n"); + fprintf(stderr, "VIDEO_SINGLETON::instance ()->maxS-%d, VIDEO_SINGLETON::instance ()->maxG-%d, VIDEO_SINGLETON::instance ()->maxI-%d, VIDEO_SINGLETON::instance ()->maxP-%d, VIDEO_SINGLETON::instance ()->maxB-%d.\n", VIDEO_SINGLETON::instance ()->maxS, VIDEO_SINGLETON::instance ()->maxG, VIDEO_SINGLETON::instance ()->maxI, VIDEO_SINGLETON::instance ()->maxP, VIDEO_SINGLETON::instance ()->maxB); + fprintf(stderr, "VIDEO_SINGLETON::instance ()->minS-%d, VIDEO_SINGLETON::instance ()->minG-%d, VIDEO_SINGLETON::instance ()->minI-%d, VIDEO_SINGLETON::instance ()->minP-%d, VIDEO_SINGLETON::instance ()->minB-%d.\n", VIDEO_SINGLETON::instance ()->minS, VIDEO_SINGLETON::instance ()->minG, VIDEO_SINGLETON::instance ()->minI, VIDEO_SINGLETON::instance ()->minP, VIDEO_SINGLETON::instance ()->minB); + */ + /* + { + int i; + + fprintf(stderr, "id: offset size -- system header table:\n"); + for (i=0; i<VIDEO_SINGLETON::instance ()->numS; i++) + fprintf(stderr, "%-3d %-9u %d\n", i, VIDEO_SINGLETON::instance ()->systemHeader[i].offset, VIDEO_SINGLETON::instance ()->systemHeader[i].size); + fprintf(stderr, + "id: header offset hdsize totSize frames preframs Ioffset Isize -- GOP\n"); + for (i=0; i<VIDEO_SINGLETON::instance ()->numG; i++) + { + fprintf(stderr, "%-4d %-8d %-8u %-8d %-8d %-8d %-8d %-8u %d\n", + i, + VIDEO_SINGLETON::instance ()->gopTable[i].VIDEO_SINGLETON::instance ()->systemHeader, + VIDEO_SINGLETON::instance ()->gopTable[i].offset, + VIDEO_SINGLETON::instance ()->gopTable[i].headerSize, + VIDEO_SINGLETON::instance ()->gopTable[i].size, + VIDEO_SINGLETON::instance ()->gopTable[i].totalFrames, + VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames, + VIDEO_SINGLETON::instance ()->gopTable[i].firstIoffset, + VIDEO_SINGLETON::instance ()->frameTable[VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames].size + ); + } + + fprintf(stderr, "\nframe information:"); + for (i=0; i<VIDEO_SINGLETON::instance ()->numF; i++) + fprintf(stderr, "%c%c%-8d", (i%10 ? '\0' : '\n'), VIDEO_SINGLETON::instance ()->frameTable[i].type, VIDEO_SINGLETON::instance ()->frameTable[i].size); + fprintf(stderr, "\n"); + + } + */ + fseek(VIDEO_SINGLETON::instance ()->fp, VIDEO_SINGLETON::instance ()->systemHeader[0].offset+4, 0); + nextByte; + VIDEO_SINGLETON::instance ()->horizontalSize = ((int)nb <<4) & 0xff0; + nextByte; + VIDEO_SINGLETON::instance ()->horizontalSize |= (nb >>4) & 0x0f; + VIDEO_SINGLETON::instance ()->verticalSize = ((int)nb <<8) & 0xf00; + nextByte; + VIDEO_SINGLETON::instance ()->verticalSize |= (int)nb & 0xff; + nextByte; + VIDEO_SINGLETON::instance ()->pelAspectRatio = ((int)nb >> 4) & 0x0f; + VIDEO_SINGLETON::instance ()->pictureRate = (int)nb & 0x0f; + nextByte; + nextByte; + nextByte; + VIDEO_SINGLETON::instance ()->vbvBufferSize = ((int)nb << 5) & 0x3e0; + nextByte; + VIDEO_SINGLETON::instance ()->vbvBufferSize |= ((int)nb >>3) & 0x1f; + /* + fprintf(stderr, "SysHeader info: hsize-%d, vsize-%d, pelAspect-%d, rate-%d, vbv-%d.\n", + VIDEO_SINGLETON::instance ()->horizontalSize, VIDEO_SINGLETON::instance ()->verticalSize, VIDEO_SINGLETON::instance ()->pelAspectRatio, VIDEO_SINGLETON::instance ()->pictureRate, VIDEO_SINGLETON::instance ()->vbvBufferSize); + */ + WriteInfoToFile(); + } +#if 0 + { + int i, j = 20; + + for (i = VIDEO_SINGLETON::instance ()->numG - 1;; i --) { + if (VIDEO_SINGLETON::instance ()->gopTable[i].offset < 4235260) { + fprintf(stderr, "group %d: offset %ld\n", i, VIDEO_SINGLETON::instance ()->gopTable[i].offset); + if (j -- == 0) break; + } + } + /* + for (i = 0; i < VIDEO_SINGLETON::instance ()->numG; i ++) { + if (VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames > 1800) { + fprintf(stderr, "group %d: offset %ld pre-frames %d\n", + i, VIDEO_SINGLETON::instance ()->gopTable[i].offset, VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames); + break; + } + } + */ + } +#endif + { + VIDEO_SINGLETON::instance ()->firstPatternSize = VIDEO_SINGLETON::instance ()->gopTable[0].totalFrames; + VIDEO_SINGLETON::instance ()->firstSendPattern = (char *)ACE_OS::malloc(VIDEO_SINGLETON::instance ()->firstPatternSize); + if (VIDEO_SINGLETON::instance ()->firstSendPattern == NULL) + { + fprintf(stderr, "VS failed to allocate VIDEO_SINGLETON::instance ()->firstVIDEO_SINGLETON::instance ()->SendVIDEO_SINGLETON::Instance ()->Pattern for %d frames", + VIDEO_SINGLETON::instance ()->firstPatternSize); + ACE_OS::perror (""); + return 11; + } + } + VIDEO_SINGLETON::instance ()->firstGopFrames = VIDEO_SINGLETON::instance ()->gopTable[0].totalFrames; + return 0; +} + + int INITvideo(void) +{ + INITvideoPara para; + int failureType = 0; + int result; + /* + fprintf(stderr, "VS about to read Para.\n"); + */ + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.version = ntohl(para.version); + para.nameLength = ntohl(para.nameLength); +#endif + if (para.nameLength>0) + { + result = CmdRead(VIDEO_SINGLETON::instance ()->videoFile, para.nameLength); + if (result != 0) + return result; + } + if (Mpeg_Global::session_num > Mpeg_Global::session_limit || para.version != VERSION) { + char errmsg[128]; + VIDEO_SINGLETON::instance ()->cmd = CmdFAIL; + CmdWrite((char *)&VIDEO_SINGLETON::instance ()->cmd, 1); + if (Mpeg_Global::session_num > Mpeg_Global::session_limit) { + sprintf(errmsg, + "Too many sessions being serviced, please try again later.\n"); + } + else { + sprintf(errmsg, "Version # not match, VS %d.%02d, Client %d.%02d", + VERSION / 100, VERSION % 100, + para.version / 100, para.version % 100); + } + write_string(VIDEO_SINGLETON::instance ()->serviceSocket, errmsg); + ACE_OS::exit (0); + } + VIDEO_SINGLETON::instance ()->cmdsn = para.sn; + /* + fprintf(stderr, "MPEG file %s got.\n", VIDEO_SINGLETON::instance ()->videoFile); + */ + VIDEO_SINGLETON::instance ()->videoFile[para.nameLength] = 0; + + if (!strncasecmp("LiveVideo", VIDEO_SINGLETON::instance ()->videoFile, 9)) { + if (OpenLiveVideo(&VIDEO_SINGLETON::instance ()->video_format, &VIDEO_SINGLETON::instance ()->horizontalSize, + &VIDEO_SINGLETON::instance ()->verticalSize, &VIDEO_SINGLETON::instance ()->averageFrameSize, + &VIDEO_SINGLETON::instance ()->fps, &VIDEO_SINGLETON::instance ()->pelAspectRatio) == -1) { + failureType = 100; + goto failure; + } + if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG2) { + failureType = 101; + goto failure; + } + VIDEO_SINGLETON::instance ()->live_source = 1; + + VIDEO_SINGLETON::instance ()->fileSize =0x7fffffff; + VIDEO_SINGLETON::instance ()->maxS = VIDEO_SINGLETON::instance ()->maxG = VIDEO_SINGLETON::instance ()->maxI = VIDEO_SINGLETON::instance ()->maxP = VIDEO_SINGLETON::instance ()->maxB = VIDEO_SINGLETON::instance ()->minS = VIDEO_SINGLETON::instance ()->minG = VIDEO_SINGLETON::instance ()->minI = VIDEO_SINGLETON::instance ()->minP = VIDEO_SINGLETON::instance ()->minB = 1; + VIDEO_SINGLETON::instance ()->numS = VIDEO_SINGLETON::instance ()->numG = VIDEO_SINGLETON::instance ()->numF = VIDEO_SINGLETON::instance ()->numI = 0x7fffffff; + VIDEO_SINGLETON::instance ()->numP = VIDEO_SINGLETON::instance ()->numB = 0; + VIDEO_SINGLETON::instance ()->vbvBufferSize = 1; + VIDEO_SINGLETON::instance ()->firstGopFrames = 1; + VIDEO_SINGLETON::instance ()->patternSize = 1; + VIDEO_SINGLETON::instance ()->pattern[0] = 'I'; + VIDEO_SINGLETON::instance ()->pattern[1] = 0; + VIDEO_SINGLETON::instance ()->packetBufSize = VIDEO_SINGLETON::instance ()->verticalSize * VIDEO_SINGLETON::instance ()->horizontalSize * 3; + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)ACE_OS::malloc(sizeof(VideoMessage) + sizeof(VideoPacket) + + VIDEO_SINGLETON::instance ()->packetBufSize); + if (VIDEO_SINGLETON::instance ()->packet == NULL) + { + ACE_OS::perror ("Error: VS error on ACE_OS::malloc VIDEO_SINGLETON::instance ()->packet buffer"); + ACE_OS::exit (1); + } + VIDEO_SINGLETON::instance ()->packet = (VideoPacket *)((char *)VIDEO_SINGLETON::instance ()->packet + sizeof(VideoMessage)); + + } + else { + static double pictureRateTable[] = {23.976, 24, 25, 29.97, 30, 50, 59.94, 60}; + + VIDEO_SINGLETON::instance ()->video_format = VIDEO_MPEG1; + failureType = init_MPEG1_video_file(); + if (failureType) goto failure; + VIDEO_SINGLETON::instance ()->fps = pictureRateTable[VIDEO_SINGLETON::instance ()->pictureRate - 1]; + } + + { + INITvideoReply reply; + + reply.totalHeaders = htonl(VIDEO_SINGLETON::instance ()->numS); + reply.totalGroups = htonl(VIDEO_SINGLETON::instance ()->numG); + reply.totalFrames = htonl(VIDEO_SINGLETON::instance ()->numF); + reply.sizeIFrame = htonl(VIDEO_SINGLETON::instance ()->maxI); + reply.sizePFrame = htonl(VIDEO_SINGLETON::instance ()->maxP); + reply.sizeBFrame = htonl(VIDEO_SINGLETON::instance ()->maxB); + reply.sizeSystemHeader = htonl(VIDEO_SINGLETON::instance ()->maxS); + reply.sizeGop = htonl(VIDEO_SINGLETON::instance ()->maxG); + reply.averageFrameSize = htonl(VIDEO_SINGLETON::instance ()->averageFrameSize); + reply.verticalSize = htonl(VIDEO_SINGLETON::instance ()->verticalSize); + reply.horizontalSize = htonl(VIDEO_SINGLETON::instance ()->horizontalSize); + reply.pelAspectRatio = htonl(VIDEO_SINGLETON::instance ()->pelAspectRatio); + reply.pictureRate1000 = htonl((int)(VIDEO_SINGLETON::instance ()->fps * 1000)); + reply.vbvBufferSize = htonl(VIDEO_SINGLETON::instance ()->vbvBufferSize); + reply.firstGopFrames = htonl(VIDEO_SINGLETON::instance ()->firstGopFrames); + reply.patternSize = htonl(VIDEO_SINGLETON::instance ()->patternSize); + strncpy(reply.pattern, VIDEO_SINGLETON::instance ()->pattern, PATTERN_SIZE); + + reply.live = htonl(VIDEO_SINGLETON::instance ()->live_source); + reply.format = htonl(VIDEO_SINGLETON::instance ()->video_format); + + CmdWrite((char *)&VIDEO_SINGLETON::instance ()->cmd, 1); + + CmdWrite((char *)&reply, sizeof(reply)); + + /* write the first SH, GOP and IFrame to VIDEO_SINGLETON::instance ()->serviceSocket (TCP), + using code for SendPacket() */ + { + int tmpSocket = VIDEO_SINGLETON::instance ()->videoSocket; + + if (VIDEO_SINGLETON::instance ()->live_source) StartPlayLiveVideo(); + + VIDEO_SINGLETON::instance ()->videoSocket = VIDEO_SINGLETON::instance ()->serviceSocket; + + if (VIDEO_SINGLETON::instance ()->live_source) { + int frame = 0; + SendPicture(&frame); + } + else if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG1) { + SendPacket(1, 0, 0, 0); + } + else { + fprintf(stderr, "VS: VIDEO_SINGLETON::instance ()->video_format %d not supported.\n", + VIDEO_SINGLETON::instance ()->video_format); + } + VIDEO_SINGLETON::instance ()->videoSocket = tmpSocket; + + if (VIDEO_SINGLETON::instance ()->live_source) StopPlayLiveVideo(); + } + + return 0; + + } + failure: + { + char * msg; + char errmsg[64]; + VIDEO_SINGLETON::instance ()->cmd = CmdFAIL; + sprintf(errmsg, "VS failed to alloc internal buf (type %d)", failureType); + CmdWrite((char *)&VIDEO_SINGLETON::instance ()->cmd, 1); + msg = failureType == 1 ? (char *)"not a complete MPEG stream" : + failureType == 2 ? (char *)"can't open MPEG file" : + failureType == 3 ? (char *)"MPEG file is not seekable" : + failureType == 4 ? (char *)"not an MPEG stream" : + failureType == 5 ? + (char *)"too many frames in MPEG file, need change MAX_FRAMES and recompile VS" : + failureType == 100 ? (char *)"failed to connect to live video source" : + failureType == 101 ? (char *)"live MPEG2 not supported" : + errmsg; + write_string(VIDEO_SINGLETON::instance ()->serviceSocket, msg); + ACE_OS::exit (0); + } +} + +#define CheckGroupRange(pnextGroup) \ +{ if ((pnextGroup) < 0 || (pnextGroup) >= VIDEO_SINGLETON::instance ()->numG) \ + { fprintf(stderr, "VS: %d.VIDEO_SINGLETON::instance ()->nextGroup(%d) out of range (%d).\n", VIDEO_SINGLETON::instance ()->cmd, (pnextGroup), VIDEO_SINGLETON::instance ()->numG); \ + return 0; } } + +#define CheckFrameRange(pnextFrame) \ +{ if ((pnextFrame) < 0 || (pnextFrame) >= VIDEO_SINGLETON::instance ()->numF) \ + { fprintf(stderr, "VS: %d.VIDEO_SINGLETON::instance ()->nextFrame(%d) out of range (%d).\n", VIDEO_SINGLETON::instance ()->cmd, (pnextFrame), VIDEO_SINGLETON::instance ()->numF); \ + return 0; } } + +int FrameToGroup(int * frame) +{ + int f = * frame; + int i = 0; + while (i < VIDEO_SINGLETON::instance ()->numG && VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames <= f) i++; + i --; + * frame = f - VIDEO_SINGLETON::instance ()->gopTable[i].previousFrames; + return i; +} + +static int POSITIONvideo() +{ + int result; + POSITIONpara para; + /* + fprintf(stderr, "POSITION . . .\n"); + */ + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; + + if (VIDEO_SINGLETON::instance ()->live_source) return 0; + +#ifdef NeedByteOrderConversion + para.nextGroup = ntohl(para.nextGroup); + para.sn = ntohl(para.sn); +#endif + + CheckGroupRange(para.nextGroup); + VIDEO_SINGLETON::instance ()->cmdsn = para.sn; + result = SendPacket(VIDEO_SINGLETON::instance ()->numS>1 || para.nextGroup == 0, para.nextGroup, 0, 0); + return result; +} + +static int STEPvideo() +{ + int group; + STEPpara para; + int tag = 0; + int result; + + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextFrame = ntohl(para.nextFrame); +#endif + + VIDEO_SINGLETON::instance ()->cmdsn = para.sn; + + if (!VIDEO_SINGLETON::instance ()->live_source) { + if (para.nextFrame >= VIDEO_SINGLETON::instance ()->numF) /* send SEQ_END */ + { + tag = 1; + para.nextFrame --; + } + /* + fprintf(stderr, "STEP . . .frame-%d\n", para.nextFrame); + */ + CheckFrameRange(para.nextFrame); + group = FrameToGroup(¶.nextFrame); + if (VIDEO_SINGLETON::instance ()->precmd != CmdSTEP && !tag ) { + result = SendReferences(group, para.nextFrame); + if (result < 0 ) + return result; + } + } + if (VIDEO_SINGLETON::instance ()->live_source) StartPlayLiveVideo(); + + if (VIDEO_SINGLETON::instance ()->live_source) { + SendPicture(¶.nextFrame); + } + else if (VIDEO_SINGLETON::instance ()->video_format == VIDEO_MPEG1) { + SendPacket(VIDEO_SINGLETON::instance ()->numS>1, group, tag ? VIDEO_SINGLETON::instance ()->numF : para.nextFrame, 0); + } + else { + fprintf(stderr, "VS: wierd1\n"); + } + + if (VIDEO_SINGLETON::instance ()->live_source) StopPlayLiveVideo(); + return 0; +} + +static int timerHeader, timerGroup, timerFrame; +static int timerOn = 0; +static int timerAdjust = 0; +static int preTimerVal = 0; +static void StopTimer(void); +static void TimerSpeed(void); +static void TimerProcessing(void); + +static void timerHandler(int sig) +{ + int val2, val3; + int usec = VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF; + + if (Mpeg_Global::drift_ppm) { + usec -= (int)((double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0); + } + + if (timerAdjust > 1) + usec = (int)(((double)usec * (double)(SPEEDUP_INV_SCALE - 1)) / + (double)SPEEDUP_INV_SCALE); + val3 = get_duration(preTimerVal, (val2 = get_usec())); + /* + if (val3 >= usec<< 1)) + fprintf(stderr, "Slower: %d out of VIDEO_SINGLETON::instance ()->currentUPF %d.\n", + val3, usec); + else + fprintf(stderr, "+\n"); + */ + preTimerVal = val2; + if (val3 < 0 || val3 > 100000000) + val3 = usec; + val2 = (val3 + (usec>>1)) / usec; + if (val2 < 0) val2 = 0; + if (val2) { + TimerProcessing(); + val2 --; + } + VIDEO_SINGLETON::instance ()->addedSignals += val2; + + if (VIDEO_SINGLETON::instance ()->addedSignals) { + val2 = timerAdjust; + if (timerAdjust < MAX_TIMER_ADJUST) { + timerAdjust += VIDEO_SINGLETON::instance ()->addedSignals * SPEEDUP_INV_SCALE; + if (val2 < SPEEDUP_INV_SCALE) { + TimerSpeed(); + } + } + else { + /* + fprintf(stderr, "VS timerAdjust %d, VIDEO_SINGLETON::instance ()->addedSignals %d, timerFrame %d\n", + timerAdjust, VIDEO_SINGLETON::instance ()->addedSignals, timerFrame); + */ + for (val3 = 0; val3 < VIDEO_SINGLETON::instance ()->addedSignals; val3 ++) + TimerProcessing(); + } + VIDEO_SINGLETON::instance ()->addedSignals = 0; + } +} + +static void TimerProcessing(void) +{ +/* + fprintf(stderr, "VS: timerHandler...\n"); +*/ + if (!timerOn) { + return; + } + if (timerAdjust < 0) + { + timerAdjust += SPEEDUP_INV_SCALE; + return; + } + if (timerAdjust >0) + { + if ((--timerAdjust) == 0) + TimerSpeed(); + } + if (VIDEO_SINGLETON::instance ()->cmd == CmdPLAY) + { + if (timerGroup == VIDEO_SINGLETON::instance ()->numG - 1 && timerFrame >= VIDEO_SINGLETON::instance ()->gopTable[timerGroup].totalFrames - 1) + { + timerFrame ++; /* force sending of END_SEQ when PLAY VIDEO_SINGLETON::instance ()->cmd */ + StopTimer(); + return; + } + else + { + timerFrame ++; + if (timerFrame >= VIDEO_SINGLETON::instance ()->gopTable[timerGroup].totalFrames) + { + timerGroup ++; + timerFrame = 0; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + } + } + else { + if (VIDEO_SINGLETON::instance ()->cmd == CmdFF) { + if (timerGroup == VIDEO_SINGLETON::instance ()->numG - 1) { + StopTimer(); + return; + } + timerGroup ++; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + else { + if (timerGroup == 0) { + StopTimer(); + return; + } + timerGroup --; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + } + } +} + +static void StartTimer(void) +{ + VIDEO_SINGLETON::instance ()->addedUPF = 0; + VIDEO_SINGLETON::instance ()->addedSignals = 0; + timerAdjust = (VIDEO_SINGLETON::instance ()->VStimeAdvance * SPEEDUP_INV_SCALE) / VIDEO_SINGLETON::instance ()->currentUPF; + /* + SFprintf(stderr, "VS StartTimer(): fast-start frames %d\n", + timerAdjust / SPEEDUP_INV_SCALE); + */ + TimerSpeed(); + setsignal(SIGALRM, timerHandler); + timerOn = 1; + preTimerVal = get_usec(); + /* + fprintf(stderr, "VS: timer started at %d upf.\n", VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF); + */ +} + +static void TimerSpeed(void) +{ + struct itimerval val; + int usec = VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF; + if (Mpeg_Global::drift_ppm) { + /* + int drift = (double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0; + SFprintf(stderr, "Mpeg_Global::drift_ppm %d, usec %d, drift %d, new usec %d\n", + Mpeg_Global::drift_ppm, usec, drift, usec - drift); + */ + usec -= (int)((double)usec * (double)Mpeg_Global::drift_ppm / 1000000.0); + } + if (timerAdjust > 1) + usec = (int)(((double)usec * (double)(SPEEDUP_INV_SCALE - 1)) / + (double)SPEEDUP_INV_SCALE); + val.it_interval.tv_sec = val.it_value.tv_sec = usec / 1000000; + val.it_interval.tv_usec = val.it_value.tv_usec = usec % 1000000; + setitimer(ITIMER_REAL, &val, NULL); + /* + SFprintf(stderr, + "VS TimerSpeed() at %s speed, timerAdjust %d VIDEO_SINGLETON::instance ()->addedSignals %d.\n", + (timerAdjust > 1) ? "higher" : "normal", timerAdjust, VIDEO_SINGLETON::instance ()->addedSignals); + */ +} + +static void StopTimer() +{ + struct itimerval val; + setsignal(SIGALRM, SIG_IGN); + val.it_interval.tv_sec = val.it_value.tv_sec = 0; + val.it_interval.tv_usec = val.it_value.tv_usec = 0; + setitimer(ITIMER_REAL, &val, NULL); + timerOn = 0; + /* + fprintf(stderr, "VS: timer stopped.\n"); + */ +} + +void GetFeedBack() +{ + VideoFeedBackPara para; + //struct itimerval val; + //int timerUsec; + + if (FBread((char *)¶, sizeof(para)) == -1 || + ntohl(para.cmdsn) != VIDEO_SINGLETON::instance ()->cmdsn) { + /* + SFprintf(stderr, "VS warning: a FB VIDEO_SINGLETON::instance ()->packet discarded.\n"); + */ + return; + } +#ifdef NeedByteOrderConversion + para.needHeader = ntohl(para.needHeader); + para.addUsecPerFrame = ntohl(para.addUsecPerFrame); + para.addFrames = ntohl(para.addFrames); + para.sendPatternGops = ntohl(para.sendPatternGops); + para.frameRateLimit1000 = ntohl(para.frameRateLimit1000); +#endif + VIDEO_SINGLETON::instance ()->frameRateLimit = para.frameRateLimit1000 / 1000.0; + VIDEO_SINGLETON::instance ()->sendPatternGops = para.sendPatternGops; + + if (!timerOn) return; + + VIDEO_SINGLETON::instance ()->needHeader = para.needHeader; + ACE_OS::memcpy (VIDEO_SINGLETON::instance ()->sendPattern, para.sendPattern, PATTERN_SIZE); + if (para.addFrames <= 0 || timerAdjust < MAX_TIMER_ADJUST) + { + timerAdjust += para.addFrames * SPEEDUP_INV_SCALE; + TimerSpeed(); + } + else /* drastic compensation for big gap */ + VIDEO_SINGLETON::instance ()->addedSignals += para.addFrames; + if (para.addUsecPerFrame) { + VIDEO_SINGLETON::instance ()->addedUPF += para.addUsecPerFrame; + TimerSpeed(); + } + /* + SFprintf(stderr, "VS fb: addf %d, addupf %d\n", + para.addFrames, para.addUsecPerFrame); + */ +} + +static int FastVideoPlay(void) +{ + int result; + FFpara para; + int preGroup = -1; + int preHeader = -1; + int nfds = (VIDEO_SINGLETON::instance ()->serviceSocket > VIDEO_SINGLETON::instance ()->videoSocket ? VIDEO_SINGLETON::instance ()->serviceSocket : VIDEO_SINGLETON::instance ()->videoSocket) + 1; + + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextGroup = ntohl(para.nextGroup); + para.usecPerFrame = ntohl(para.usecPerFrame); + para.framesPerSecond = ntohl(para.framesPerSecond); + para.VStimeAdvance = ntohl(para.VStimeAdvance); +#endif + + if (VIDEO_SINGLETON::instance ()->live_source) return 0; + + VIDEO_SINGLETON::instance ()->VStimeAdvance = para.VStimeAdvance; + /* + fprintf(stderr, "VIDEO_SINGLETON::instance ()->VStimeAdvance from client: %d\n", VIDEO_SINGLETON::instance ()->VStimeAdvance); + */ + CheckGroupRange(para.nextGroup); + VIDEO_SINGLETON::instance ()->cmdsn = para.sn; + timerGroup = para.nextGroup; + timerFrame = 0; + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + VIDEO_SINGLETON::instance ()->currentUPF = para.usecPerFrame; + StartTimer(); + + for (;;) + { + fd_set read_mask; +/* + fprintf(stderr, "VS: FF/FB - a loop begines. . .\n"); +*/ + if (preGroup != timerGroup) + { + SendPacket(preHeader != timerHeader, timerGroup, 0, + para.usecPerFrame * VIDEO_SINGLETON::instance ()->patternSize >> 2); + preHeader = timerHeader; + preGroup = timerGroup; + } + + FD_ZERO(&read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask); +#ifdef _HPUX_SOURCE + if (select(nfds, (int *)&read_mask, NULL, NULL, NULL) == -1) +#else + if (select(nfds, &read_mask, NULL, NULL, NULL) == -1) +#endif + { + if (errno == EINTR) + { + ACE_DEBUG ((LM_DEBUG, + "PLAYVIDEO:select EINTR signal \n")); + continue; + } + ACE_OS::perror ("Error - VS select between service and video sockets"); + ACE_OS::exit (1); + + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask)) /* stop */ + { + result = CmdRead((char *)&VIDEO_SINGLETON::instance ()->cmd, 1); + if (result != 0) + return result; + if (VIDEO_SINGLETON::instance ()->cmd == CmdCLOSE) { + exit(0); + } + else if (VIDEO_SINGLETON::instance ()->cmd != CmdSTOP) { + fprintf(stderr, "VS error: VIDEO_SINGLETON::instance ()->cmd=%d while STOP is expected.\n", VIDEO_SINGLETON::instance ()->cmd); + VIDEO_SINGLETON::instance ()->normalExit = 0; + exit(1); + } + result = CmdRead((char *)&VIDEO_SINGLETON::instance ()->cmdsn, sizeof(int)); + if (result != 0 ) + return result; +#ifdef NeedByteOrderConversion + VIDEO_SINGLETON::instance ()->cmdsn = ntohl(VIDEO_SINGLETON::instance ()->cmdsn); +#endif + StopTimer(); + break; + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask)) /* feedback, speed adjustment */ + { + ACE_DEBUG((LM_DEBUG, + "FastVideo Play:Data socket selected")); + GetFeedBack(); + } + ACE_DEBUG((LM_DEBUG, + "none of the sockets selected \n")); + } + return 0; +} + +static void FFvideo() +{ + /* + fprintf(stderr, "FF . . .\n"); + */ + FastVideoPlay(); +} + +static void FBvideo() +{ + /* + fprintf(stderr, "FB . . . \n"); + */ + FastVideoPlay(); +} + +void ComputeFirstSendPattern(float limit) +{ + char * buf = VIDEO_SINGLETON::instance ()->firstSendPattern; + int len = VIDEO_SINGLETON::instance ()->firstPatternSize; + char * pat = (char *)ACE_OS::malloc(len); + int f; + + if (pat == NULL) { + fprintf(stderr, "VS error on allocating %d bytes for computing first SP", len); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + for (f = 0; f < len; f ++) { + pat[f] = VIDEO_SINGLETON::instance ()->frameTable[f].type; + } + memset(buf, 0, len); + + if (limit <= 0) + limit = 1.0; + + f = (int)((double)len * + ((double)limit / (1000000.0 / (double)VIDEO_SINGLETON::instance ()->currentUPF)) + 0.5); + /* rounded to integer, instead of truncated */ + if (f >= len) + f = len; + else if (f <= 1) + f = 1; + + ComputeSendPattern(pat, buf, len, f); + + /* + f = len - f; + fprintf(stderr, "VIDEO_SINGLETON::instance ()->FirstVIDEO_SINGLETON::instance ()->SendVIDEO_SINGLETON::Instance ()->Pattern (%d frames dropped): ", f); + { + int i; + for (i = 0; i < len; i ++) + fputc(buf[i] ? pat[i] : '-', stderr); + } + fputc('\n', stderr); + */ + ACE_OS::free (pat); +} + + int PLAYliveVideo(PLAYpara * para) +{ + int doscale; + int count; + int first_frame; + int frame = para->nextFrame; + int nfds = (VIDEO_SINGLETON::instance ()->serviceSocket > VIDEO_SINGLETON::instance ()->videoSocket ? VIDEO_SINGLETON::instance ()->serviceSocket : VIDEO_SINGLETON::instance ()->videoSocket) + 1; + fd_set read_mask; + struct timeval tval = {0, 0}; + double ratio; + int result; + + VIDEO_SINGLETON::instance ()->currentUPF = (int)(1000000.0 / VIDEO_SINGLETON::instance ()->fps); /* ignore para.usecPerFrame */ + if (VIDEO_SINGLETON::instance ()->frameRateLimit < VIDEO_SINGLETON::instance ()->fps) { + doscale = 1; + ratio = min(VIDEO_SINGLETON::instance ()->frameRateLimit, VIDEO_SINGLETON::instance ()->fps) / VIDEO_SINGLETON::instance ()->fps; + first_frame = frame; + count = 0; + /* + fprintf(stderr, "doscale %d, VIDEO_SINGLETON::instance ()->frameRateLimit %5.2f, VIDEO_SINGLETON::instance ()->fps %5.2f, ratio %5.2f\n", + doscale, VIDEO_SINGLETON::instance ()->frameRateLimit, VIDEO_SINGLETON::instance ()->fps, ratio); + */ + } + else doscale = 0; + StartPlayLiveVideo(); + + for (;;) { + + if (doscale) { + for (;;) { + if ((int)((frame - first_frame) * ratio + 0.5) < count) frame ++; + else break; + } + count ++; + } + SendPicture(&frame); + frame ++; + + FD_ZERO(&read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask); +#ifdef _HPUX_SOURCE + if (select(nfds, (int *)&read_mask, NULL, NULL, &tval) == -1) +#else + if (select(nfds, &read_mask, NULL, NULL, &tval) == -1) +#endif + { + if (errno == EINTR) + continue; + ACE_OS::perror ("Error - VS select between service and video sockets"); + StopPlayLiveVideo(); + ACE_OS::exit (1); + + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask)) /* stop */ + { + unsigned char tmp; + result = CmdRead((char *)&tmp, 1); + if (result != 0) + return result; + if (tmp == CmdCLOSE) { + StopPlayLiveVideo(); + exit(0); + } + else if (tmp == CmdSTOP) { + VIDEO_SINGLETON::instance ()->cmd = tmp; + /* + fprintf(stderr, "VS: VIDEO_SINGLETON::Instance ()->CmdSTOP. . .\n"); + */ + result = CmdRead((char *)&VIDEO_SINGLETON::instance ()->cmdsn, sizeof(int)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + VIDEO_SINGLETON::instance ()->cmdsn = ntohl(VIDEO_SINGLETON::instance ()->cmdsn); +#endif + StopPlayLiveVideo(); + break; + } + else if (tmp == CmdSPEED) + { + SPEEDpara para; + /* + fprintf(stderr, "VS: VIDEO_SINGLETON::Instance ()->CmdSPEED. . .\n"); + */ + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; + /* ignore this thing for live video */ + } + else + { + fprintf(stderr, "VS error(live): VIDEO_SINGLETON::instance ()->cmd=%d while expect STOP/SPEED.\n", tmp); + VIDEO_SINGLETON::instance ()->normalExit = 0; + StopPlayLiveVideo(); + exit(1); + } + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask)) /* feedback, only for frame rate + adjustment */ + { + VideoFeedBackPara para; + if (FBread((char *)¶, sizeof(para)) == -1 || + ntohl(para.cmdsn) != VIDEO_SINGLETON::instance ()->cmdsn) { + /* + SFprintf(stderr, "VS warning: a FB VIDEO_SINGLETON::instance ()->packet discarded.\n"); + */ + return 0; + } +#ifdef NeedByteOrderConversion + para.frameRateLimit1000 = ntohl(para.frameRateLimit1000); +#endif + VIDEO_SINGLETON::instance ()->frameRateLimit = para.frameRateLimit1000 / 1000.0; + if (VIDEO_SINGLETON::instance ()->frameRateLimit < VIDEO_SINGLETON::instance ()->fps) { + doscale = 1; + ratio = min(VIDEO_SINGLETON::instance ()->frameRateLimit, VIDEO_SINGLETON::instance ()->fps) / VIDEO_SINGLETON::instance ()->fps; + first_frame = frame; + count = 0; + /* + fprintf(stderr, "doscale %d, VIDEO_SINGLETON::instance ()->frameRateLimit %5.2f, VIDEO_SINGLETON::instance ()->fps %5.2f, ratio %5.2f\n", + doscale, VIDEO_SINGLETON::instance ()->frameRateLimit, VIDEO_SINGLETON::instance ()->fps, ratio); + */ + } + else doscale = 0; + } + } + return 0; +} + +static int PLAYvideo() +{ + PLAYpara para; + int preGroup = -1; + int preHeader = -1; + int preFrame = -1; + int result; + + fprintf(stderr, "PLAY . . .\n"); + + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.nextFrame = ntohl(para.nextFrame); + para.usecPerFrame = ntohl(para.usecPerFrame); + para.framesPerSecond = ntohl(para.framesPerSecond); + para.frameRateLimit1000 = ntohl(para.frameRateLimit1000); + para.collectStat = ntohl(para.collectStat); + para.sendPatternGops = ntohl(para.sendPatternGops); + para.VStimeAdvance = ntohl(para.VStimeAdvance); +#endif + + VIDEO_SINGLETON::instance ()->frameRateLimit = para.frameRateLimit1000 / 1000.0; + VIDEO_SINGLETON::instance ()->cmdsn = para.sn; + VIDEO_SINGLETON::instance ()->currentUPF = para.usecPerFrame; + VIDEO_SINGLETON::instance ()->VStimeAdvance = para.VStimeAdvance; + + { + int ts = htonl(get_usec()); + CmdWrite((char *)&ts, sizeof(int)); + } + + if (VIDEO_SINGLETON::instance ()->live_source || VIDEO_SINGLETON::instance ()->video_format != VIDEO_MPEG1) { + if (VIDEO_SINGLETON::instance ()->live_source) + PLAYliveVideo (¶); + return 0; + } + + + fprintf(stderr, "VIDEO_SINGLETON::instance ()->VStimeAdvance from client: %d\n", VIDEO_SINGLETON::instance ()->VStimeAdvance); + + VIDEO_SINGLETON::instance ()->sendPatternGops = para.sendPatternGops; + ComputeFirstSendPattern(VIDEO_SINGLETON::instance ()->frameRateLimit); +#ifdef STAT + if (para.collectStat) + memset(VIDEO_SINGLETON::instance ()->framesSent, 0, (VIDEO_SINGLETON::instance ()->numF + 7)>>3); +#endif + CheckFrameRange(para.nextFrame); + timerFrame = para.nextFrame; + timerGroup = FrameToGroup(&timerFrame); + timerHeader = VIDEO_SINGLETON::instance ()->gopTable[timerGroup].systemHeader; + ACE_OS::memcpy (VIDEO_SINGLETON::instance ()->sendPattern, para.sendPattern, PATTERN_SIZE); + result = SendReferences(timerGroup, timerFrame); + if (result < 0) + return result; + StartTimer(); + + fprintf (stderr, "VS Going into the for loop\n"); + for (;;) + { + int curGroup = timerGroup; + int curFrame = timerFrame; + int curHeader = timerHeader; + char * sp; + fd_set read_mask; + int nfds = (VIDEO_SINGLETON::instance ()->serviceSocket > VIDEO_SINGLETON::instance ()->videoSocket ? VIDEO_SINGLETON::instance ()->serviceSocket : VIDEO_SINGLETON::instance ()->videoSocket) + 1; + + if (preGroup != curGroup || curFrame != preFrame) + { + int sendStatus = -1; + int frameStep = 1; + if (curGroup == 0) + { + int i = curFrame + 1; + while (i < VIDEO_SINGLETON::instance ()->firstPatternSize && !VIDEO_SINGLETON::instance ()->firstSendPattern[i]) + { + frameStep ++; + i++; + } + } + else /* (curGroup > 0) */ + { + int i = curFrame + 1; + sp = VIDEO_SINGLETON::instance ()->sendPattern + ((curGroup - 1) % VIDEO_SINGLETON::instance ()->sendPatternGops) * VIDEO_SINGLETON::instance ()->patternSize; + while (i < VIDEO_SINGLETON::instance ()->patternSize && !sp[i]) + { + frameStep ++; + i++; + } + } + if (curGroup == 0) + { + if (VIDEO_SINGLETON::instance ()->firstSendPattern[curFrame]) + sendStatus = 0; + else /* (!VIDEO_SINGLETON::instance ()->firstVIDEO_SINGLETON::instance ()->SendVIDEO_SINGLETON::Instance ()->Pattern[curFrame]) */ + { + int i = curFrame - 1; + while (i > 0 && !VIDEO_SINGLETON::instance ()->firstSendPattern[i]) + i--; + if (i > preFrame) + /* the frame (curGroup, i) hasn't been sent yet */ + { + sendStatus = 0; + curFrame = i; + } + else + sendStatus = -1; + } + } + else if (sp[curFrame]) /* curGroup > 0 */ + sendStatus = 0; + else /* (!sp[curFrame]) */ + { + int i = curFrame - 1; + while (i > 0 && !sp[i]) + i--; + if (curGroup == preGroup && i > preFrame) + /* the frame (curGroup, i) hasn't been sent yet */ + { + sendStatus = 0; + curFrame = i; + } + else + sendStatus = -1; + } + if (!sendStatus) + { + // Send the current video frame, calls send_to_network which + // fragments and sends via blocking write . + sendStatus = SendPacket(preHeader != curHeader, + curGroup, curFrame, + (VIDEO_SINGLETON::instance ()->currentUPF + VIDEO_SINGLETON::instance ()->addedUPF) * frameStep); + if (!sendStatus) + { + preHeader = curHeader; + preGroup = curGroup; + preFrame = curFrame; +#ifdef STAT + if (para.collectStat) + { + int f = VIDEO_SINGLETON::instance ()->gopTable[curGroup].previousFrames + curFrame; + VIDEO_SINGLETON::instance ()->framesSent[f>>3] |= (1 << (f % 8)); + } +#endif + } + } + } + + // Wait for a command on serviceSocket or Feedback on videoSocket (UDP) + FD_ZERO(&read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask); + FD_SET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask); +#ifdef _HPUX_SOURCE + if (select(nfds, (int *)&read_mask, NULL, NULL, NULL) == -1) +#else + if (select(nfds, &read_mask, NULL, NULL, NULL) == -1) +#endif + { + if (errno == EINTR) /* select() interrupted */ + { + ACE_DEBUG ((LM_DEBUG, + "PLAYVideo:Select interrupted coninuing..\n")); + continue; + } + ACE_OS::perror ("Error - VS select between service and video sockets"); + ACE_OS::exit (1); + + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->serviceSocket, &read_mask)) /* stop, speed change, loop swap */ + { + ACE_DEBUG ((LM_DEBUG, + "PLAYvideo:serviceSocket selected \n")); + unsigned char tmp; + result = CmdRead((char *)&tmp, 1); + if (result != 0) + return result; + + if (tmp == CmdCLOSE) { + exit(0); + } + else if (tmp == CmdSTOP) { + VIDEO_SINGLETON::instance ()->cmd = tmp; + /* + fprintf(stderr, "VS: VIDEO_SINGLETON::Instance ()->CmdSTOP. . .\n"); + */ + result = CmdRead((char *)&VIDEO_SINGLETON::instance ()->cmdsn, sizeof(int)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + VIDEO_SINGLETON::instance ()->cmdsn = ntohl(VIDEO_SINGLETON::instance ()->cmdsn); +#endif + StopTimer(); + break; + } + else if (tmp == CmdSPEED) + { + SPEEDpara para; + /* + fprintf(stderr, "VS: VIDEO_SINGLETON::Instance ()->CmdSPEED. . .\n"); + */ + result = CmdRead((char *)¶, sizeof(para)); + if (result != 0) + return result; +#ifdef NeedByteOrderConversion + para.sn = ntohl(para.sn); + para.usecPerFrame = ntohl(para.usecPerFrame); + para.framesPerSecond = ntohl(para.framesPerSecond); + para.sendPatternGops = ntohl(para.sendPatternGops); + para.frameRateLimit1000 = ntohl(para.frameRateLimit1000); +#endif + VIDEO_SINGLETON::instance ()->frameRateLimit = para.frameRateLimit1000 / 1000.0; + VIDEO_SINGLETON::instance ()->sendPatternGops = para.sendPatternGops; + VIDEO_SINGLETON::instance ()->currentUPF = para.usecPerFrame; + VIDEO_SINGLETON::instance ()->addedUPF = 0; + memcpy(VIDEO_SINGLETON::instance ()->sendPattern, para.sendPattern, PATTERN_SIZE); + TimerSpeed(); + } + else + { + fprintf(stderr, "VS error: VIDEO_SINGLETON::instance ()->cmd=%d while expect STOP/SPEED.\n", tmp); + VIDEO_SINGLETON::instance ()->normalExit = 0; + exit(1); + } + } + if (FD_ISSET(VIDEO_SINGLETON::instance ()->videoSocket, &read_mask)) /* feedBack, speed adjustment */ + { + ACE_DEBUG ((LM_DEBUG, + "PLAYVIDEO:Data SOCKET selected\n")); + GetFeedBack(); + } + ACE_DEBUG ((LM_DEBUG, + "PLAYVIDEO:none selected\n")); + } + return 0; +} + +#include <ctype.h> + +static void STATstream(void) +{ + int i, j = 0; + for (i = 0; i < VIDEO_SINGLETON::instance ()->numF; i++) + { + short size = htons(VIDEO_SINGLETON::instance ()->frameTable[i].size); + char type = VIDEO_SINGLETON::instance ()->frameTable[i].type; + if (i == VIDEO_SINGLETON::instance ()->gopTable[j].previousFrames) + { + type = tolower(type); + j ++; + } + CmdWrite((char *)&type, 1); + CmdWrite((char *)&size, 2); + } +} + +static void STATsent(void) +{ +#ifdef STAT + CmdWrite((char *)VIDEO_SINGLETON::instance ()->framesSent, (VIDEO_SINGLETON::instance ()->numF + 7) / 8); +#else + int i; + char zeroByte = 0; + for (i = 0; i < (VIDEO_SINGLETON::instance ()->numF + 7) / 8; i++) + CmdWrite((char *)&zeroByte, 1); +#endif +} + +static void on_exit_routine(void) +{ + struct sockaddr_in peeraddr_in; + int size = sizeof(peeraddr_in); + /* + if (!VIDEO_SINGLETON::instance ()->normalExit) { + fprintf(stderr, "VS exitting abnormally, dump core...\n"); + ACE_OS::kill (getpid(), SIGSEGV); + usleep(2000000); + } + */ + /* + fprintf(stderr, "A VS session terminated.\n"); + */ + if (ACE_OS::getpeername(VIDEO_SINGLETON::instance ()->serviceSocket, + (struct sockaddr *)&peeraddr_in, &size) == 0 && + peeraddr_in.sin_family == AF_INET) { + if (strncmp(inet_ntoa(peeraddr_in.sin_addr), "129.95.50", 9)) { + struct hostent *hp; + time_t val =ACE_OS::time (NULL); + char * buf = ACE_OS::ctime (&VIDEO_SINGLETON::instance ()->start_time); + + hp = ACE_OS::gethostbyaddr((char *)&(peeraddr_in.sin_addr), 4, AF_INET); + buf[strlen(buf)-1] = 0; + printf("%s: %s %3dm%02ds %dP %s\n", + buf, + hp == NULL ? inet_ntoa(peeraddr_in.sin_addr) : hp->h_name, + (val - VIDEO_SINGLETON::instance ()->start_time) / 60, (val - VIDEO_SINGLETON::instance ()->start_time) % 60, + VIDEO_SINGLETON::instance ()->pkts_sent, VIDEO_SINGLETON::instance ()->videoFile); + } + } + ComCloseConn(VIDEO_SINGLETON::instance ()->serviceSocket); + ComCloseConn(VIDEO_SINGLETON::instance ()->videoSocket); +} + +int VideoServer(int ctr_fd, int data_fd, int rttag, int max_pkt_size) +{ + int result; + + VIDEO_SINGLETON::instance ()->serviceSocket = ctr_fd; + VIDEO_SINGLETON::instance ()->videoSocket = data_fd; + VIDEO_SINGLETON::instance ()->conn_tag = max_pkt_size; + + if (max_pkt_size > 0) VIDEO_SINGLETON::instance ()->msgsize = max_pkt_size; + else if (max_pkt_size < 0) VIDEO_SINGLETON::instance ()->msgsize = - max_pkt_size; + else VIDEO_SINGLETON::instance ()->msgsize = 1024 * 1024; + /* + SFprintf(stderr, "VS VIDEO_SINGLETON::instance ()->msgsize = %d\n", VIDEO_SINGLETON::instance ()->msgsize); + */ + VIDEO_SINGLETON::instance ()->msgsize -= sizeof(VideoMessage); + + VIDEO_SINGLETON::instance ()->start_time =ACE_OS::time (NULL); + + atexit(on_exit_routine); + + VIDEO_SINGLETON::instance ()->lastRef[0] = VIDEO_SINGLETON::instance ()->lastRef[1] = -1; + VIDEO_SINGLETON::instance ()->lastRefPtr = 0; + + result = INITvideo(); + + if (result != 0) + return result; + + if (rttag) { + if (SetRTpriority("VS", 0) == -1) rttag = 0; + } + + for (;;) + { + + fprintf(stderr, "VS: waiting for a new command...\n"); + + VIDEO_SINGLETON::instance ()->precmd = VIDEO_SINGLETON::instance ()->cmd; + result = CmdRead((char *)&VIDEO_SINGLETON::instance ()->cmd, 1); + if (result != 0) + { + // cerr << result; + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) VideoServer "), + result); + } + fprintf(stderr, "VS got VIDEO_SINGLETON::instance ()->cmd %d\n", VIDEO_SINGLETON::instance ()->cmd); + + switch (VIDEO_SINGLETON::instance ()->cmd) + { + case CmdPOSITION: + case CmdPOSITIONrelease: + result = POSITIONvideo(); + if (result != 0) + return result; + break; + case CmdSTEP: + result = STEPvideo(); + if (result != 0) + return result; + break; + case CmdFF: + FFvideo(); + break; + case CmdFB: + FBvideo(); + break; + case CmdPLAY: + result = PLAYvideo(); + if (result != 0) + return result; + break; + case CmdCLOSE: + /* + fprintf(stderr, "a session closed.\n"); + VIDEO_SINGLETON::instance ()->normalExit =1; + */ + // ACE_OS::exit (0); + return 0; + break; + case CmdSTATstream: + STATstream(); + break; + case CmdSTATsent: + STATsent(); + break; + default: + fprintf(stderr, + "VS error: video channel command %d not known.\n", VIDEO_SINGLETON::instance ()->cmd); + VIDEO_SINGLETON::instance ()->normalExit = 0; + return -1; + break; + } + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_Control.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_Control.idl new file mode 100644 index 00000000000..0719e784c3b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_Control.idl @@ -0,0 +1,78 @@ +// -*- C++ -*- + +// $Id$ + +interface Audio_Control +{ + typedef sequence<char> my_seq_char; + + struct AudioParameter + { + long encodeType; + long channels; + long samplesPerSecond; + long bytesPerSample; + }; + + + /* CmdINITaudio parameter of fixed structure of 3 integers and a AudioPara, + replys with CmdINITaudio followed by reply or CmdFAIL followed by a string */ + struct INITaudioPara + { + long sn; + long version; + AudioParameter para; + long nameLength; + my_seq_char audiofile; + /* char audioFile[] */ + }; + + struct INITaudioReply + { + long live; + long format; + AudioParameter para; + long totalSamples; + }; + + + /* CmdPLAY parameter */ + struct PLAYPara + { + long sn; + long nextSample; + long samplesPerSecond; /* audio playback speed */ + long samplesPerPacket; /* Number of samples in a packet */ + long ABsamples; /* size of client VB buffer in samples */ + long spslimit; /* QoS parameter: sps supported by the audio channel */ + }; + + /* STOP followed only by SN */ + + /* CmdSPEED parameter */ + struct SPEEDPara + { + long sn; + long samplesPerSecond; + long samplesPerPacket; /* Number of samples in a packet */ + long spslimit; + }; + + boolean init_audio (in INITaudioPara para, + out INITaudioReply reply_para); + boolean play (in PLAYPara para, out long ats); + + boolean speed (in SPEEDPara para); + + boolean stop (in long cmdsn); + + oneway void close (); + + boolean set_peer (inout string peer); + // Initializes the server to communicate to the <peer>, which can be + // "ip-number:port-number" (e.g., "tango.cs.wustl.edu:1234" or + // "128.252.166.57:1234"). If there is no ':' in the <address> it + // is assumed to be a port number, with the IP address being + // INADDR_ANY. + // Server returns it's UDP data port number. +}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_Exporter.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_Exporter.idl new file mode 100644 index 00000000000..2cee7d3f2d5 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_Exporter.idl @@ -0,0 +1,8 @@ +// $Id$ +#include "CosPropertyService.idl" + +interface MMDevice_Exporter : CosPropertyService::PropertySet +{ + Object get_audio_mmdevice (); + Object get_video_mmdevice (); +}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile new file mode 100644 index 00000000000..093197bd6f3 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile @@ -0,0 +1,2775 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +MAKEFILE = Makefile +LIBNAME = libmpeg_shared +LIB2 = $(LIBNAME).a +SHLIB2 = $(LIBNAME).$(SOEXT) + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif + +IDL_FILES = Video_Control Audio_Control Receiver MMDevice_Exporter +IDL_SRC = $(addsuffix C.cpp, $(IDL_FILES)) \ + $(addsuffix S.cpp, $(IDL_FILES)) + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +override TAO_IDLFLAGS += -Ge 1 \ + -I$(TAO_ROOT)/orbsvcs/orbsvcs + +FILES = com fileio filters routine sendpt + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) $(IDL_SRC) + +CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT)/orbsvcs/orbsvcs + +MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source +CPPFLAGS += -I$(MPEG_ROOT) + +LDLIBS = -lTAO_AV -lTAO_CosNaming -lTAO + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + LIB = $(LIB2) + SHLIB = $(SHLIB2) +else + override INSTALL = +endif # ! AV + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +##LDFLAGS += -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs +CPPFLAGS += -DSH_MEM -DNDEBUG + +.PRECIOUS: $(foreach file, $(IDL_FILES), $(foreach ext, $(IDL_EXT), $(file)$(ext)))) + +realclean: clean + -$(RM) $(foreach file, $(IDL_FILES), $(foreach ext, $(IDL_EXT), $(file)$(ext))) + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/com.o .obj/com.so .shobj/com.o .shobj/com.so: com.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + fileio.h routine.h com.h + +.obj/fileio.o .obj/fileio.so .shobj/fileio.o .shobj/fileio.so: fileio.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + fileio.h + +.obj/filters.o .obj/filters.so .shobj/filters.o .shobj/filters.so: filters.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + filters.h + +.obj/routine.o .obj/routine.so .shobj/routine.o .shobj/routine.so: routine.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h + +.obj/sendpt.o .obj/sendpt.so .shobj/sendpt.o .shobj/sendpt.so: sendpt.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + sendpt.h + +.obj/Video_ControlC.o .obj/Video_ControlC.so .shobj/Video_ControlC.o .shobj/Video_ControlC.so: Video_ControlC.cpp Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Video_ControlC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.h \ + $(TAO_ROOT)/tao/Priority_Mapping.h \ + $(TAO_ROOT)/tao/Priority_Mapping.i \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.i \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.h \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/Audio_ControlC.o .obj/Audio_ControlC.so .shobj/Audio_ControlC.o .shobj/Audio_ControlC.so: Audio_ControlC.cpp Audio_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Audio_ControlC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.h \ + $(TAO_ROOT)/tao/Priority_Mapping.h \ + $(TAO_ROOT)/tao/Priority_Mapping.i \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.i \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.h \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/ReceiverC.o .obj/ReceiverC.so .shobj/ReceiverC.o .shobj/ReceiverC.so: ReceiverC.cpp ReceiverC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + ReceiverC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.h \ + $(TAO_ROOT)/tao/Priority_Mapping.h \ + $(TAO_ROOT)/tao/Priority_Mapping.i \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.i \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.h \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/MMDevice_ExporterC.o .obj/MMDevice_ExporterC.so .shobj/MMDevice_ExporterC.o .shobj/MMDevice_ExporterC.so: MMDevice_ExporterC.cpp MMDevice_ExporterC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + MMDevice_ExporterC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.h \ + $(TAO_ROOT)/tao/Priority_Mapping.h \ + $(TAO_ROOT)/tao/Priority_Mapping.i \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.i \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.h \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/Video_ControlS.o .obj/Video_ControlS.so .shobj/Video_ControlS.o .shobj/Video_ControlS.so: Video_ControlS.cpp Video_ControlS.h Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + Video_ControlS_T.h Video_ControlS_T.i Video_ControlS_T.cpp \ + Video_ControlS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/Audio_ControlS.o .obj/Audio_ControlS.so .shobj/Audio_ControlS.o .shobj/Audio_ControlS.so: Audio_ControlS.cpp Audio_ControlS.h Audio_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Audio_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + Audio_ControlS_T.h Audio_ControlS_T.i Audio_ControlS_T.cpp \ + Audio_ControlS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/ReceiverS.o .obj/ReceiverS.so .shobj/ReceiverS.o .shobj/ReceiverS.so: ReceiverS.cpp ReceiverS.h ReceiverC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + ReceiverC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + ReceiverS_T.h ReceiverS_T.i ReceiverS_T.cpp ReceiverS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/MMDevice_ExporterS.o .obj/MMDevice_ExporterS.so .shobj/MMDevice_ExporterS.o .shobj/MMDevice_ExporterS.so: MMDevice_ExporterS.cpp MMDevice_ExporterS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + MMDevice_ExporterC.h MMDevice_ExporterC.i MMDevice_ExporterS_T.h \ + MMDevice_ExporterS_T.i MMDevice_ExporterS_T.cpp MMDevice_ExporterS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile.am new file mode 100644 index 00000000000..77a59176d2b --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Makefile.am @@ -0,0 +1,85 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- +## mpeg/source/mpeg_shared directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_LTLIBRARIES = libmpeg_shared + +libmpeg_shared_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +libmpeg_shared_SOURCES = \ + com.cpp \ + fileio.cpp \ + filters.cpp \ + routine.cpp \ + sendpt.cpp \ + Video_ControlS.cpp \ + Video_ControlC.cpp \ + Audio_ControlS.cpp \ + Audio_ControlC.cpp \ + ReceiverS.cpp \ + ReceiverC.cpp \ + MMDevice_ExporterC.cpp \ + MMDevice_ExporterS.cpp + +noinst_HEADERS = \ + com.h \ + fileio.h \ + filters.h \ + routine.h \ + sendpt.h \ + Video_ControlS.h \ + Video_ControlC.h \ + Audio_ControlS.h \ + Audio_ControlC.h \ + ReceiverS.h \ + ReceiverC.h \ + MMDevice_ExporterC.h \ + MMDevice_ExporterS.h + +IDL_SOURCES = \ + Audio_Control.idl \ + MMDevice_Exporter.idl \ + Receiver.idl \ + Video_Control.idl + +BUILT_SOURCES = \ + Video_ControlS.cpp \ + Video_ControlS.h \ + Video_ControlC.cpp \ + Video_ControlC.h \ + Audio_ControlS.cpp \ + Audio_ControlS.h \ + Audio_ControlC.cpp \ + Audio_ControlC.h \ + ReceiverS.cpp \ + ReceiverS.h \ + ReceiverC.cpp \ + ReceiverC.h \ + MMDevice_ExporterC.cpp \ + MMDevice_ExporterC.h \ + MMDevice_ExporterS.cpp \ + MMDevice_ExporterS.h + +EXTRA_DIST = $(IDL_SOURCES) + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Receiver.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Receiver.idl new file mode 100644 index 00000000000..19589c057b2 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Receiver.idl @@ -0,0 +1,7 @@ +/* _*_C++_*_ */ + +// $Id$ +interface Receiver +{ + void push_mmdevice (in Object audio_mmdevice,in string audio_file,in Object video_mmdevice,in string video_file); +}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_Control.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_Control.idl new file mode 100644 index 00000000000..2c9a5ade7f2 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_Control.idl @@ -0,0 +1,112 @@ +// -*- C++ -*- + +// $Id$ + +interface Video_Control +{ + + typedef sequence <char> my_seq_char; + const long VIDEO_PATTERN_SIZE = 100; + struct INITvideoPara + { + long sn; + long version; + my_seq_char videofile; + }; + + struct INITvideoReply + { + long live; + long format; + + long totalHeaders; + long totalFrames; + long totalGroups; + long horizontalSize; + long verticalSize; + long pelAspectRatio; + long pictureRate1000; + long vbvBufferSize; + long sizeIFrame; + long sizePFrame; + long sizeBFrame; + long sizeSystemHeader; + long sizeGop; + long averageFrameSize; + long firstGopFrames; + my_seq_char pattern; + }; + + /* CmdPOSITION, CmdPOSITIONrelease: followed by following parameter */ + struct POSITIONpara + { + long sn; + long nextGroup; + }; + + /* CmdSTEP: followed by following parameter */ + struct STEPpara + { + long sn; + long nextFrame; + }; + + /* CmdFF, CmdFB: followed by following parameter */ + struct FFpara + { + long sn; + long nextGroup; + long usecPerFrame; + long framesPerSecond; + long VStimeAdvance; + }; + + typedef FFpara FBpara; + + /*CmdPLAY: followed by following parameter */ + struct PLAYpara + { + long sn; + long collectStat; + long nextFrame; + long usecPerFrame; + long framesPerSecond; + long frameRateLimit1000; + long VStimeAdvance; + long sendPatternGops; + my_seq_char sendPattern; + }; + + /* CmdSPEED: parameter */ + struct SPEEDpara + { + long sn; + long usecPerFrame; + long framesPerSecond; + long frameRateLimit1000; + long sendPatternGops; + my_seq_char sendPattern; + }; + + + boolean init_video (in INITvideoPara para, + out INITvideoReply reply_para); + boolean stat_stream (out char ch, out long size); + oneway void close (); + boolean stat_sent (); + boolean fast_forward (in FFpara para); + boolean fast_backward (in FFpara para); + boolean step (in STEPpara para); + boolean play (in PLAYpara para, out long vts); + boolean position (in POSITIONpara para); + boolean speed (in SPEEDpara para); + boolean stop (in long cmdsn); + + boolean set_peer (inout string peer); + // Initializes the server to communicate to the <peer>, which can be + // "ip-number:port-number" (e.g., "tango.cs.wustl.edu:1234" or + // "128.252.166.57:1234"). If there is no ':' in the <address> it + // is assumed to be a port number, with the IP address being + // INADDR_ANY. + // Server returns it's UDP data port number. +}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.cpp new file mode 100644 index 00000000000..6cc49c46643 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.cpp @@ -0,0 +1,2122 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +//#include "ace/OS.h" +#include "ace/Log_Msg.h" +#include "include/common.h" +#include "fileio.h" +#include "routine.h" +#include "com.h" + +#ifdef NATIVE_ATM +#include "atmcom.h" +#endif + +ACE_RCSID(mpeg_shared, com, "$Id$") + +#define CONN_INET 1 +#define CONN_UNIX 2 +#define CONN_ATM 3 + +#define SERVER_FDTABLE_SIZE 50 +#define CLIENT_FDTABLE_SIZE 10 + +#define STATE_PENDING 1 +#define STATE_CONTROL 2 +#define STATE_DATA 3 +#define STATE_SINGLE 4 + +static int inet_port; +static char * unix_port, * atm_port; + +static struct FdTable +{ + int fd; /* -1 -- free item, >=0 -- fd value */ + int type; + unsigned stime; /* setup time, in seconds */ + int state; +} * fdTable = NULL; +static int size = 0; + +int ComInitClient(int pinet_port, char * punix_port, char * patm_port) +{ + int i; + + inet_port = pinet_port; + unix_port = punix_port; + atm_port = patm_port; + if (size) { + fprintf(stderr, + "Error ComInitClient: pid %ld already done ComInitClient/Server\n", + ACE_OS::getpid ()); + return -1; + } + size = CLIENT_FDTABLE_SIZE; + fdTable = (struct FdTable *)ACE_OS::malloc(size * sizeof(*fdTable)); + if (fdTable == NULL) { + fprintf(stderr, + "Error ComInitClient: pid %ld failed to allocated fdTable space:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + for (i = 0; i < size; i ++) { + fdTable[i].fd = -1; + } +#ifdef NATIVE_ATM + return ATMinitClient(atm_port); +#else + return 0; +#endif +} + +void ComCloseClient(void) +{ + int i; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd >= 0) ComCloseConn(fdTable[i].fd); + } +#ifdef NATIVE_ATM + ATMcloseClient(); +#endif + return; +} + +int ComCloseFd(int fd) +{ + int i; + if (!size) { + fprintf(stderr, + "Error ComCloseFd: pid %ld not done ComInitClient/Server yet.\n", + ACE_OS::getpid ()); + return -1; + } + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == fd) break; + } + if (i < size) { + fdTable[i].fd = -1; + if (fdTable[i].type == CONN_ATM) { +#ifdef NATIVE_ATM + return ATMcloseFd(fd); +#else + fprintf(stderr, + "Error ComCloseFd: pid %ld CONN_ATM not supported.\n", + ACE_OS::getpid ()); + return -1; +#endif + } + else { + ACE_OS::close (fd); + } + return 0; + } + else { + fprintf(stderr, + "Error ComCloseFd: pid %ld can't find fd %d in table\n", + ACE_OS::getpid (), fd); + return -1; + } +} + +int ComCloseConn(int fd) +{ + int i; + if (!size) { + fprintf(stderr, + "Error ComCloseConn: pid %ld not done ComInitClient/Server yet.\n", + ACE_OS::getpid ()); + return -1; + } + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == fd) break; + } + if (i < size) { + fdTable[i].fd = -1; + if (fdTable[i].type == CONN_ATM) { +#ifdef NATIVE_ATM + return ATMcloseConn(fd); +#else + fprintf(stderr, + "Error ComCloseConn: pid %ld CONN_ATM not supported.\n", + ACE_OS::getpid ()); + return -1; +#endif + } + else { + ACE_OS::close (fd); + } + return 0; + } + else { + fprintf(stderr, + "Error ComCloseConn: pid %ld can't find fd %d in table\n", + ACE_OS::getpid (), fd); + return -1; + } +} + +int ComOpenConnPair(char * address, int *ctr_fd, int *data_fd, int *max_pkt_size) +{ + + // This is right now called only by the audio client. + // The protocol is slightly modified as after connecting we need to + // inform that we are a audio client so that it can fork a process. + int i; + int cfd, dfd = -1, csocktype, dsocktype; + int conn_tag = !(*max_pkt_size); + struct sockaddr_in addressIn; + struct sockaddr_un addressUn; + + if (!size) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld not done ComInitClient/Server yet.\n", + ACE_OS::getpid ()); + return -1; + } + + cfd = 0; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) cfd ++; + } + if (cfd < 2) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld no faTable entry for the pair", + ACE_OS::getpid ()); + return -1; + } + + /* tell the type of connections to establish: + If the server is on the same host, then UNIX socket is used */ + if (address[0] == 0) { + csocktype = CONN_UNIX; + dsocktype = CONN_UNIX; + } + else if (!strncasecmp(address, "atm:", 4)) { + address += 4; + csocktype = CONN_ATM; + dsocktype = CONN_ATM; + } + else if (!strncasecmp(address, "datm:", 5)) { + address += 5; + csocktype = CONN_INET; + dsocktype = CONN_ATM; + } + else { + csocktype = CONN_INET; + dsocktype = CONN_INET; + } + if (csocktype == CONN_INET || dsocktype == CONN_INET) { + struct hostent *hp; + char hostname[100]; + addressIn.sin_family = AF_INET; + if (!strncasecmp(address, "inet:", 5)) { + address += 5; + } + if (isascii(address[0]) && isdigit(address[0])) + addressIn.sin_addr.s_addr = inet_addr(address); + else { + if ((hp = gethostbyname(address)) == NULL) { /* No such host! */ + fprintf(stderr, + "Error ComOpenConnPair: pid %ld host %s can't be found:", + ACE_OS::getpid (), address); + perror(""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld host %s is not of INET type address.\n", + ACE_OS::getpid (), address); + return -1; + } + ACE_OS::memcpy ((char *)&addressIn.sin_addr.s_addr, (char *)hp->h_addr, + sizeof(addressIn.sin_addr.s_addr)); + /* + bcopy((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr)); + */ + } + if (get_hostname(hostname, 100)) { + fprintf(stderr, "Error ComOpenConnPair: pid %ld failed to get_hostname:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if ((hp = gethostbyname(hostname)) == NULL) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to its own IP address:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld own address is not INET type", + ACE_OS::getpid ()); + return -1; + } + + if (!memcmp((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr))) { + if (csocktype == CONN_INET) csocktype = CONN_UNIX; + if (dsocktype == CONN_INET) dsocktype = CONN_UNIX; + } + } + + /* build appropriate type of Connections to Server */ + if (csocktype == CONN_UNIX && dsocktype == CONN_UNIX) { + /* build UNIX connection to server */ + addressUn.sun_family = AF_UNIX; + strncpy(addressUn.sun_path, unix_port, + sizeof(struct sockaddr_un) - sizeof(short)); + cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open UNIX cfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + usleep(10000); /* this is for waiting for the uncaught signal mentioned + below */ + if (connect(cfd, (struct sockaddr *)&addressUn, sizeof(addressUn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn UNIX cfd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + i = -3; /* I don't understand why when connect() returns EINTR, the connection + is still built, and the other end can still get what written at + this end, 'i = -3' is a garbage to be written. */ + ACE_OS::write (cfd, &i, 4); + ACE_OS::close (cfd); + return -1; + } + if (time_write_int(cfd, -1) == -1 || time_read_int(cfd, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write -1 to UNIX cfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (cfd); + return -1; + } + + dfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open UNIX dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (cfd); + return -1; + } + usleep(10000); + if (connect(dfd, (struct sockaddr *)&addressUn, sizeof(addressUn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn UNIX dfd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + i = -3; + ACE_OS::write (dfd, &i, 4); + ACE_OS::close (cfd); + ACE_OS::close (dfd); + return -1; + } + if (time_write_int(dfd, i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (cfd) to UNIX dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (cfd); + ACE_OS::close (dfd); + return -1; + } + *max_pkt_size = 0; + } + else if (csocktype == CONN_INET && dsocktype == CONN_INET) { + /* build TCP connection to server */ + addressIn.sin_port = htons(inet_port); + cfd = socket(AF_INET, SOCK_STREAM, 0); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open TCP cfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + usleep(10000); + if (connect(cfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn TCP cfd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + i = -3; + ACE_OS::write (cfd, &i, 4); + ACE_OS::close (cfd); + return -1; + } + if (conn_tag) { /* create a second connection with server */ + if (time_write_int(cfd, -1) == -1 || time_read_int(cfd, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write -1 to TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + return -1; + } + dfd = socket(AF_INET, SOCK_STREAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open TCP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + return -1; + } + usleep(10000); + if (connect(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn TCP dfd to server:", + ACE_OS::getpid ()); + perror(""); + i = -3; + write(dfd, &i, 4); + close(cfd); + close(dfd); + return -1; + } + if (time_write_int(dfd, i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (cfd) to TCP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + *max_pkt_size = 0; + } + else { /* create a UDP socket for data */ + // Write a byte saying that we are a audio client. + + if (time_write_int(cfd,CmdINITaudio) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write -2 to TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + + dfd = socket(AF_INET, SOCK_DGRAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open UDP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + return -1; + } + memset((char *)&addressIn, 0, sizeof(addressIn)); + + i = sizeof(addressIn); + if (ACE_OS::getsockname(cfd, (struct sockaddr *)&addressIn, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to getsocketname on TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + + addressIn.sin_family = AF_INET; + addressIn.sin_port = 0; + if (bind(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to bind UDP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + if (time_write_int(cfd, -2) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write -2 to TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + + i = sizeof(addressIn); + if (ACE_OS::getsockname(dfd, (struct sockaddr *)&addressIn, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to getsocketname on UDP fd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + if (time_write_bytes(cfd, (char *)&addressIn.sin_port, sizeof(short)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (port) to TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + + fprintf(stderr, "ComOpenConnPair local UDP socket: addr - %s,%d, port - %u.\n", + inet_ntoa(addressIn.sin_addr), addressIn.sin_addr.s_addr,ntohs(addressIn.sin_port)); + + + fprintf(stderr, "ComOpenConnPair UDP port %d (should be > 0)\n", + ntohs(addressIn.sin_port)); + + + i = sizeof(addressIn); + if (ACE_OS::getsockname(cfd, (struct sockaddr *)&addressIn, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to getsocketname on TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + + if (time_write_bytes(cfd, (char *)&addressIn.sin_addr.s_addr, sizeof(int)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (IP addr) to TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + + fprintf(stderr, "ComOpenConnPair TCP cfd socket: addr - %s, port - %u.\n", + inet_ntoa(addressIn.sin_addr), ntohs(addressIn.sin_port)); + + if (time_read_bytes(cfd, (char *)&addressIn.sin_port, sizeof(short)) == -1 || + time_read_bytes(cfd, (char *)&addressIn.sin_addr.s_addr, sizeof(int)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to read (IP addr/port) from TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + usleep(10000); + if (connect(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed conn UDP dfd to peer:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + + fprintf(stderr, "ComOpenConnPair UDP dfd connects to host-%s (port %u)\n", + inet_ntoa(addressIn.sin_addr), + ntohs(addressIn.sin_port)); + +#ifndef LINUX + /* adjust the dfd REVBUF size */ + { + int len; + len = INET_SOCKET_BUFFER_SIZE + 100; + /* + if (setsockopt(dfd, SOL_SOCKET, SO_SNDBUF, (char *)&len, sizeof(len)) == -1) { + fprintf(stderr, + "Warning ComOpenConnPair: pid %ld failed to set UDP dfd-snd to size %d:", + ACE_OS::getpid (), len); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + } + */ + len = 65536; + while (setsockopt(dfd, SOL_SOCKET, SO_RCVBUF, (char *)&len, sizeof(len)) == -1) { + len -= 1024; + if (len < 8192) break; + /* + fprintf(stderr, + "Warning ComOpenConnPair: pid %ld failed to set UDP dfd-rcv to size %d:", + ACE_OS::getpid (), len); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + */ + } + if (getuid() == DEVELOPER_UID) + fprintf(stderr, "Set UDP dfd-rcv to %dB\n", len); + } +#endif + *max_pkt_size = - INET_SOCKET_BUFFER_SIZE; + /* UDP sockets on HP and SUN are discard mode */ + } + if (setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, + (const char *)&i, sizeof(i)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to setsockopt on TCP cfd with TCP_NODELAY:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + } + } + else if (dsocktype == CONN_ATM) { /* CONN_ATM */ +#ifdef NATIVE_ATM + if (csocktype == CONN_INET) { + /* build TCP connection to server */ + addressIn.sin_port = htons(inet_port); + cfd = socket(AF_INET, SOCK_STREAM, 0); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open TCP1 cfd:", + ACE_OS::getpid ()); + perror(""); + return -1; + } + usleep(10000); + if (connect(cfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn TCP1 cfd to server:", + ACE_OS::getpid ()); + perror(""); + i = -3; + write(cfd, &i, 4); + close(cfd); + return -1; + } + } + else if (csocktype == CONN_UNIX) { + /* build UNIX connection to server */ + addressUn.sun_family = AF_UNIX; + strncpy(addressUn.sun_path, unix_port, + sizeof(struct sockaddr_un) - sizeof(short)); + cfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open UNIX1 cfd:", + ACE_OS::getpid ()); + perror(""); + return -1; + } + usleep(10000); /* this is for waiting for the uncaught signal mentioned + below */ + if (connect(cfd, (struct sockaddr *)&addressUn, sizeof(addressUn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn UNIX1 cfd to server:", + ACE_OS::getpid ()); + perror(""); + i = -3; /* I don't understand why when select() returns EINTR, the connection + is still built, and the other end can still get what written at + this end, 'i = -3' is a garbage to be written. */ + write(cfd, &i, 4); + close(cfd); + return -1; + } + } + else { /* CONN_ATM */ + cfd = ATMopenConn(address, max_pkt_size); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open ATM cfd conn:", + ACE_OS::getpid ()); + perror(""); + return -1; + } + usleep(100000); /* be nice to buggy ATM driver */ + } + if (time_write_int(cfd, -1) == -1 || time_read_int(cfd, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write -1 to %s cfd:", + ACE_OS::getpid (), + (csocktype == CONN_UNIX) ? "UNIX1" : + (csocktype == CONN_INET) ? "INET1" : "ATM"); + ACE_OS::perror (""); + if (csocktype == CONN_ATM) ATMcloseConn(cfd); + else ACE_OS::close (cfd); + return -1; + } + + dfd = ATMopenConn(address, max_pkt_size); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open ATM dfd conn:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ATMcloseConn(cfd); + return -1; + } + usleep(100000); /* be nice to buggy ATM driver */ + if (time_write_int(dfd, i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (cfd) to ATM dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ATMcloseConn(cfd); + ATMcloseConn(dfd); + return -1; + } +#else + fprintf(stderr, + "Error ComOpenConnPair: pid %ld addresstype %d not supported\n", + ACE_OS::getpid (), dsocktype); + return -1; +#endif + } + for (i = 0; i < size; i ++) { /* guaranteed to succeed */ + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = cfd; + fdTable[i].type = csocktype; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_CONTROL; + } + else { + fprintf(stderr, "<Weird>Error ComOpenConnPair: no entry for cfd %d\n", cfd); + return -1; + } + for (; i < size; i ++) { + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = dfd; + fdTable[i].type = dsocktype; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_DATA; + } + else { + fprintf(stderr, "<Wierd>Error ComOpenConnPair: no entry for dfd %d\n", dfd); + return -1; + } + *ctr_fd = cfd; + *data_fd = dfd; + ACE_DEBUG ((LM_DEBUG,"(%P|%t)Returning from ComOpenConnpair\n")); + return 0; +} + +/* address format: [ATM:|INET:]real_address | "" + + "" -- UNIX socket, reliable byte stream + [INET:]real_address -- INET sockets, reliable control byte stream, and + *max_pkt_size == 0 : reliable data byte stream, or + != 0 : unreliable packet stream; + ATM:real_address -- ATM sockets, both data and control are + unreliable packet streams; + DATM:real_address -- INET/UNIX control reliable byte stream + and ATM unreliable byte stream; + + Communication between client and server: + + ctr_fd: client --> server server --> client + -2: conn-less INET Open udp sock, send addr in net byte order + <port, addr> <port(short), addr(long)> + -1: conn-orient Send value of fd, wait to be paired + cfd>=0: data sock Paired with cfd and return. + */ + +#if 0 +int VideoComOpenConnPair (char * address, + int *ctr_fd, + int *data_fd, + int *max_pkt_size) +{ + int i; + int cfd, dfd, csocktype, dsocktype; + int conn_tag = !(*max_pkt_size); + struct sockaddr_in addressIn; + struct sockaddr_un addressUn; + + ACE_DEBUG ((LM_DEBUG, + "%s %d\n", + __FILE__,__LINE__)); + + if (!size) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld not done ComInitClient/Server yet.\n", + ACE_OS::getpid ()); + return -1; + } + + cfd = 0; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) cfd ++; + } + if (cfd < 2) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld no faTable entry for the pair", + ACE_OS::getpid ()); + return -1; + } + + /* tell the type of connections to establish: + If the server is on the same host, then UNIX socket is used */ + if (address[0] == 0) { + csocktype = CONN_UNIX; + dsocktype = CONN_UNIX; + } + else if (!strncasecmp(address, "atm:", 4)) { + address += 4; + csocktype = CONN_ATM; + dsocktype = CONN_ATM; + } + else if (!strncasecmp(address, "datm:", 5)) { + address += 5; + csocktype = CONN_INET; + dsocktype = CONN_ATM; + } + else { + csocktype = CONN_INET; + dsocktype = CONN_INET; + } + if (csocktype == CONN_INET || dsocktype == CONN_INET) { + struct hostent *hp; + char hostname[100]; + addressIn.sin_family = AF_INET; + if (!strncasecmp(address, "inet:", 5)) { + address += 5; + } + if (isascii(address[0]) && isdigit(address[0])) + addressIn.sin_addr.s_addr = inet_addr(address); + else { + if ((hp = gethostbyname(address)) == NULL) { /* No such host! */ + fprintf(stderr, + "Error ComOpenConnPair: pid %ld host %s can't be found:", + ACE_OS::getpid (), address); + perror(""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld host %s is not of INET type address.\n", + ACE_OS::getpid (), address); + return -1; + } + ACE_OS::memcpy ((char *)&addressIn.sin_addr.s_addr, (char *)hp->h_addr, + sizeof(addressIn.sin_addr.s_addr)); + /* + bcopy((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr)); + */ + } + if (get_hostname(hostname, 100)) { + fprintf(stderr, "Error ComOpenConnPair: pid %ld failed to get_hostname:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if ((hp = gethostbyname(hostname)) == NULL) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to its own IP address:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld own address is not INET type", + ACE_OS::getpid ()); + return -1; + } + + if (!memcmp((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr))) { + if (csocktype == CONN_INET) csocktype = CONN_UNIX; + if (dsocktype == CONN_INET) dsocktype = CONN_UNIX; + } + } + + /* build appropriate type of Connections to Server */ + + if (csocktype == CONN_INET && dsocktype == CONN_INET) { + /* build TCP connection to server */ + addressIn.sin_port = htons(inet_port); + cfd = socket(AF_INET, SOCK_STREAM, 0); + if (cfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open TCP cfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + usleep(10000); + if (connect(cfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn TCP cfd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + i = -3; + ACE_OS::write (cfd, &i, 4); + ACE_OS::close (cfd); + return -1; + } +// if (conn_tag) { /* create a second connection with server */ +// if (time_write_int(cfd, -1) == -1 || time_read_int(cfd, &i) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write -1 to TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(cfd); +// return -1; +// } + dfd = socket(AF_INET, SOCK_STREAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open TCP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + return -1; + } + usleep(10000); + if (connect(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to conn TCP dfd to server:", + ACE_OS::getpid ()); + perror(""); + i = -3; + write(dfd, &i, 4); + close(cfd); + close(dfd); + return -1; + } + if (time_write_int(dfd, i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to write (cfd) to TCP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + close(dfd); + return -1; + } + *max_pkt_size = 0; + } + else { /* create a UDP socket for data */ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) ::VideoComOpenConnPair: making UDP connection\n")); + dfd = socket(AF_INET, SOCK_DGRAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to open UDP dfd:", + ACE_OS::getpid ()); + perror(""); + close(cfd); + return -1; + } + memset((char *)&addressIn, 0, sizeof(addressIn)); + + i = sizeof(addressIn); + if (ACE_OS::getsockname(cfd, (struct sockaddr *)&addressIn, &i) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to getsocketname on TCP cfd:", + ACE_OS::getpid ()); + perror(""); + close(dfd); + close(cfd); + return -1; + } + +// addressIn.sin_family = AF_INET; +// addressIn.sin_port = 0; +// if (bind(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to bind UDP dfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(cfd); +// close(dfd); +// return -1; +// } +// if (time_write_int(cfd, -2) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write -2 to TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(cfd); +// close(dfd); +// return -1; +// } + +// i = sizeof(addressIn); +// if (ACE_OS::getsockname(dfd, (struct sockaddr *)&addressIn, &i) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to getsocketname on UDP fd:", +// ACE_OS::getpid ()); +// perror(""); +// close(dfd); +// close(cfd); +// return -1; +// } +// if (time_write_bytes(cfd, (char *)&addressIn.sin_port, sizeof(short)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write (port) to TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(dfd); +// close(cfd); +// return -1; +// } + +// fprintf(stderr, "ComOpenConnPair local UDP socket: addr - %s, port - %u.\n", +// inet_ntoa(addressIn.sin_addr), ntohs(addressIn.sin_port)); + + +// fprintf(stderr, "ComOpenConnPair UDP port %d (should be > 0)\n", +// ntohs(addressIn.sin_port)); + +// /* +// i = sizeof(addressIn); +// if (ACE_OS::getsockname(cfd, (struct sockaddr *)&addressIn, &i) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to getsocketname on TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(dfd); +// close(cfd); +// return -1; +// } +// */ +// if (time_write_bytes(cfd, (char *)&addressIn.sin_addr.s_addr, sizeof(int)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write (IP addr) to TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(dfd); +// close(cfd); +// return -1; +// } + +// fprintf(stderr, "ComOpenConnPair TCP cfd socket: addr - %s, port - %u.\n", +// inet_ntoa(addressIn.sin_addr), ntohs(addressIn.sin_port)); + +// if (time_read_bytes(cfd, (char *)&addressIn.sin_port, sizeof(short)) == -1 || +// time_read_bytes(cfd, (char *)&addressIn.sin_addr.s_addr, sizeof(int)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to read (IP addr/port) from TCP cfd:", +// ACE_OS::getpid ()); +// perror(""); +// close(dfd); +// close(cfd); + // return -1; + // } + // usleep(10000); + // if (connect(dfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + // fprintf(stderr, + // "Error ComOpenConnPair: pid %ld failed conn UDP dfd to peer:", + // ACE_OS::getpid ()); + // perror(""); + // close(cfd); + // close(dfd); + // return -1; + // } + + fprintf(stderr, "ComOpenConnPair UDP dfd connects to host-%s (port %u)\n", + inet_ntoa(addressIn.sin_addr), + ntohs(addressIn.sin_port)); + +#ifndef LINUX + /* adjust the dfd REVBUF size */ + { + int len; + len = INET_SOCKET_BUFFER_SIZE + 100; + /* + if (setsockopt(dfd, SOL_SOCKET, SO_SNDBUF, (char *)&len, sizeof(len)) == -1) { + fprintf(stderr, + "Warning ComOpenConnPair: pid %ld failed to set UDP dfd-snd to size %d:", + ACE_OS::getpid (), len); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + } + */ + len = 65536; + while (setsockopt(dfd, SOL_SOCKET, SO_RCVBUF, (char *)&len, sizeof(len)) == -1) { + len -= 1024; + if (len < 8192) break; + /* + fprintf(stderr, + "Warning ComOpenConnPair: pid %ld failed to set UDP dfd-rcv to size %d:", + ACE_OS::getpid (), len); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + */ + } + if (getuid() == DEVELOPER_UID) + fprintf(stderr, "Set UDP dfd-rcv to %dB\n", len); + } +#endif + *max_pkt_size = - INET_SOCKET_BUFFER_SIZE; + /* UDP sockets on HP and SUN are discard mode */ + } + if (setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, + (const char *)&i, sizeof(i)) == -1) { + fprintf(stderr, + "Error ComOpenConnPair: pid %ld failed to setsockopt on TCP cfd with TCP_NODELAY:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (dfd); + ACE_OS::close (cfd); + return -1; + } + // } +// else if (dsocktype == CONN_ATM) { /* CONN_ATM */ +// #ifdef NATIVE_ATM +// if (csocktype == CONN_INET) { +// /* build TCP connection to server */ +// addressIn.sin_port = htons(inet_port); +// cfd = socket(AF_INET, SOCK_STREAM, 0); +// if (cfd == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to open TCP1 cfd:", +// ACE_OS::getpid ()); +// perror(""); +// return -1; +// } +// usleep(10000); +// if (connect(cfd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to conn TCP1 cfd to server:", +// ACE_OS::getpid ()); +// perror(""); +// i = -3; +// write(cfd, &i, 4); +// close(cfd); +// return -1; +// } +// } +// else if (csocktype == CONN_UNIX) { +// /* build UNIX connection to server */ +// addressUn.sun_family = AF_UNIX; +// strncpy(addressUn.sun_path, unix_port, +// sizeof(struct sockaddr_un) - sizeof(short)); +// cfd = socket(AF_UNIX, SOCK_STREAM, 0); +// if (cfd == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to open UNIX1 cfd:", +// ACE_OS::getpid ()); +// perror(""); +// return -1; +// } +// usleep(10000); /* this is for waiting for the uncaught signal mentioned +// below */ +// if (connect(cfd, (struct sockaddr *)&addressUn, sizeof(addressUn)) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to conn UNIX1 cfd to server:", +// ACE_OS::getpid ()); +// perror(""); +// i = -3; /* I don't understand why when select() returns EINTR, the connection +// is still built, and the other end can still get what written at +// this end, 'i = -3' is a garbage to be written. */ +// write(cfd, &i, 4); +// close(cfd); +// return -1; +// } +// } +// else { /* CONN_ATM */ +// cfd = ATMopenConn(address, max_pkt_size); +// if (cfd == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to open ATM cfd conn:", +// ACE_OS::getpid ()); +// perror(""); +// return -1; +// } +// usleep(100000); /* be nice to buggy ATM driver */ +// } +// if (time_write_int(cfd, -1) == -1 || time_read_int(cfd, &i) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write -1 to %s cfd:", +// ACE_OS::getpid (), +// (csocktype == CONN_UNIX) ? "UNIX1" : +// (csocktype == CONN_INET) ? "INET1" : "ATM"); +// ACE_OS::perror (""); +// if (csocktype == CONN_ATM) ATMcloseConn(cfd); +// else ACE_OS::close (cfd); +// return -1; +// } + +// dfd = ATMopenConn(address, max_pkt_size); +// if (dfd == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to open ATM dfd conn:", +// ACE_OS::getpid ()); +// ACE_OS::perror (""); +// ATMcloseConn(cfd); +// return -1; +// } +// usleep(100000); /* be nice to buggy ATM driver */ +// if (time_write_int(dfd, i) == -1) { +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld failed to write (cfd) to ATM dfd:", +// ACE_OS::getpid ()); +// ACE_OS::perror (""); +// ATMcloseConn(cfd); +// ATMcloseConn(dfd); +// return -1; +// } +// #else +// fprintf(stderr, +// "Error ComOpenConnPair: pid %ld addresstype %d not supported\n", +// ACE_OS::getpid (), dsocktype); +// return -1; +// #endif +// } + for (i = 0; i < size; i ++) { /* guaranteed to succeed */ + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = cfd; + fdTable[i].type = csocktype; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_CONTROL; + } + else { + fprintf(stderr, "<Weird>Error ComOpenConnPair: no entry for cfd %d\n", cfd); + return -1; + } + for (; i < size; i ++) { + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = dfd; + fdTable[i].type = dsocktype; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_DATA; + } + else { + fprintf(stderr, "<Wierd>Error ComOpenConnPair: no entry for dfd %d\n", dfd); + return -1; + } + *ctr_fd = cfd; + *data_fd = dfd; + return 0; +} +#endif + +/* returns: -1 -- failed, >=0 -- fd */ +int ComOpenConn(char * address, int *max_pkt_size) +{ + int i; + int fd, socktype; + struct sockaddr_in addressIn; + struct sockaddr_un addressUn; + + if (!size) { + fprintf(stderr, + "Error ComOpenConn: pid %ld not done ComInitClient/Server yet.\n", + ACE_OS::getpid ()); + return -1; + } + + fd = 0; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) fd ++; + } + if (fd < 1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld no faTable entry for the pair", + ACE_OS::getpid ()); + return -1; + } + + /* tell the type of connections to establish: + If the server is on the same host, then UNIX socket is used */ + if (address[0] == 0) { + socktype = CONN_UNIX; + } + else if (!strncasecmp(address, "atm:", 4)) { + address += 4; + socktype = CONN_ATM; + } + else if (!strncasecmp(address, "datm:", 5)) { + address += 5; + socktype = CONN_ATM; + } + else { + socktype = CONN_INET; + } + if (socktype == CONN_INET) { + struct hostent *hp; + char hostname[100]; + addressIn.sin_family = AF_INET; + if (!strncasecmp(address, "inet:", 5)) { + address += 5; + } + if (isascii(address[0]) && isdigit(address[0])) + addressIn.sin_addr.s_addr = inet_addr(address); + else { + if ((hp = gethostbyname(address)) == NULL) { /* No such host! */ + fprintf(stderr, + "Error ComOpenConn: pid %ld host %s can't be found:", + ACE_OS::getpid (), address); + perror(""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConn: pid %ld host %s is not of INET type address.\n", + ACE_OS::getpid (), address); + return -1; + } + ACE_OS::memcpy ((char *)&addressIn.sin_addr.s_addr, (char *)hp->h_addr, + sizeof(addressIn.sin_addr.s_addr)); + /* + bcopy((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr)); + */ + } + if (get_hostname(hostname, 100)) { + fprintf(stderr, "Error ComOpenConn: pid %ld failed to get_hostname:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if ((hp = gethostbyname(hostname)) == NULL) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to its own IP address:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (hp->h_addrtype != AF_INET) { + fprintf(stderr, + "Error ComOpenConn: pid %ld own address is not INET type", + ACE_OS::getpid ()); + return -1; + } + + if (!memcmp((char *)hp->h_addr, (char *)&addressIn.sin_addr.s_addr, + sizeof(addressIn.sin_addr.s_addr))) { + if (socktype == CONN_INET) socktype = CONN_UNIX; + } + } + + /* build appropriate type of Connections to Server */ + if (socktype == CONN_UNIX) { + /* build UNIX connection to server */ + addressUn.sun_family = AF_UNIX; + strncpy(addressUn.sun_path, unix_port, + sizeof(struct sockaddr_un) - sizeof(short)); + fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to open UNIX fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (connect(fd, (struct sockaddr *)&addressUn, sizeof(addressUn)) == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to conn UNIX fd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd); + return -1; + } + *max_pkt_size = 0; + } + else if (socktype == CONN_INET) { + /* build TCP connection to server */ + addressIn.sin_port = htons(inet_port); + fd = socket(AF_INET, SOCK_STREAM, 0); + if (fd == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to open TCP fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (connect(fd, (struct sockaddr *)&addressIn, sizeof(addressIn)) == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to conn TCP fd to server:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd); + return -1; + } + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, + (const char *)&i, sizeof(i)) == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to setsockopt on TCP fd with TCP_NODELAY:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd); + return -1; + } + *max_pkt_size = 0; + } + else if (socktype == CONN_ATM) { /* CONN_ATM */ +#ifdef NATIVE_ATM + /* CONN_ATM */ + fd = ATMopenConn(address, max_pkt_size); + if (fd == -1) { + fprintf(stderr, + "Error ComOpenConn: pid %ld failed to open ATM fd conn:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } +#else + fprintf(stderr, + "Error ComOpenConn: pid %ld addresstype %d not supported\n", + ACE_OS::getpid (), socktype); + return -1; +#endif + } + for (i = 0; i < size; i ++) { /* guaranteed to succeed */ + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = fd; + fdTable[i].type = socktype; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_SINGLE; + return fd; + } + else { + fprintf(stderr, "<Weird>Error ComOpenConn: no entry for fd %d\n", fd); + return -1; + } +} + + +static int fd_unix, fd_inet, fd_atm; /* for use in the server side */ + + +int ComInitServer(int pinet_port, char * punix_port, char * patm_port) +{ + int i; + + struct sockaddr_in myaddr_in; + struct sockaddr_un myaddr_un; + + inet_port = pinet_port; + unix_port = punix_port; + atm_port = patm_port; + + if (size) { + fprintf(stderr, + "Error ComInitServer: pid %ld already done ComInitServer/Server\n", + ACE_OS::getpid ()); + return -1; + } + size = CLIENT_FDTABLE_SIZE; + // create and initialize the File Descriptor Table + fdTable = (struct FdTable *)ACE_OS::malloc(size * sizeof(*fdTable)); + if (fdTable == NULL) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to allocated fdTable space:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + for (i = 0; i < size; i ++) { + fdTable[i].fd = -1; + } + // Set all the file descriptor for atm ,inet and unix to be -1 + fd_atm = fd_inet = fd_unix = -1; + + memset((char *)&myaddr_in, 0, sizeof(struct sockaddr_in)); + memset((char *)&myaddr_un, 0, sizeof(struct sockaddr_un)); + + myaddr_in.sin_family = AF_INET; + + myaddr_in.sin_addr.s_addr = htonl(INADDR_ANY); + myaddr_in.sin_port = htons((short)inet_port); + + /* setup INET listen socket */ + fd_inet = socket(AF_INET, SOCK_STREAM, 0); + if (fd_inet == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to open fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + goto open_fd_unix; + } + + i = 1; + if (setsockopt(fd_inet, SOL_SOCKET, SO_REUSEADDR, + (const char *)&i, sizeof(i)) == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to setsockopt fd_inet with REUSEADDR:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd_inet); + fd_inet = -1; + goto open_fd_unix; + } + + if (bind(fd_inet, (struct sockaddr *)&myaddr_in, sizeof(struct sockaddr_in)) == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to bind fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd_inet); + fd_inet = -1; + goto open_fd_unix; + } + if (listen(fd_inet, 2) == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to listen on fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd_inet); + fd_inet = -1; + goto open_fd_unix; + } + + open_fd_unix: + + myaddr_un.sun_family = AF_UNIX; + strncpy(myaddr_un.sun_path, unix_port, + (sizeof(struct sockaddr_un) - sizeof(short))); + fd_unix = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd_unix == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to open fd_unix:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + goto open_fd_atm; + } + if ((bind(fd_unix, (struct sockaddr *)&myaddr_un, + sizeof(struct sockaddr_un))) == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to bind fd_unix:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd_unix); + fd_unix = -1; + goto open_fd_atm; + } + if ((listen(fd_unix, 2)) == -1) { + fprintf(stderr, + "Error ComInitServer: pid %ld failed to liston on fd_unix:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::close (fd_unix); + fd_unix = -1; + goto open_fd_atm; + } + + open_fd_atm: + +#ifdef NATIVE_ATM + fd_atm = ATMinitServer(atm_port); +#endif + + if (fd_inet >= 0 || fd_unix >= 0 || fd_atm >= 0) return 0; + else return -1; +} + +void ComCloseListen(void) +{ + if (fd_atm >= 0) { +#ifdef NATIVE_ATM + /* fd_atm is not connected to a user_plane, ignore + ATMcloseFd(fd_atm); + */ + ACE_OS::close (fd_atm); + fd_atm = -1; +#else + fprintf(stderr, "Error ComCloseListen: CONN_ATM not supported.\n"); +#endif + } + if (fd_unix >= 0) { + ACE_OS::close (fd_unix); + fd_unix = -1; + } + if (fd_inet >= 0) { + ACE_OS::close (fd_inet); + fd_inet = -1; + } + return; +} + +void ComCloseServer(void) +{ + int i; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd >= 0) ComCloseConn(fdTable[i].fd); + } + if (fd_atm >= 0) { +#ifdef NATIVE_ATM + /* fd_atm not connected to a user-plane, igore it + ATMcloseConn(fd_atm); + */ + ACE_OS::close (fd_atm); + fd_atm = -1; +#else + fprintf(stderr, "Error ComCloseServer: CONN_ATM not supported.\n"); +#endif + } + if (fd_unix >= 0) { + ACE_OS::close (fd_unix); + fd_unix = -1; + ACE_OS::unlink (unix_port); + } + if (fd_inet >= 0) { + ACE_OS::close (fd_inet); + fd_inet = -1; + } +#ifdef NATIVE_ATM + ATMcloseServer(); +#endif + return; +} + +static int change_option(int fd) +{ + struct linger linger = {1, 1}; + int i = 1; + if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, + (const char *)&i, sizeof(i)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to setsockopt on fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + /* data socket also NODELAY */ + if (setsockopt(fd, SOL_SOCKET, SO_LINGER, (const char *)&linger, + sizeof(linger)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to linger on fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + return 0; +} + +int ComGetConnPair(int *ctr_fd, int *data_fd, int *max_pkt_size) +{ + int i; + int fd, fdType = -1; + int addrlen; + struct sockaddr_in peeraddr_in; + fd_set read_mask; + struct timeval tval; + int nfds; + + fd = 0; + addrlen = get_sec(); + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) { + fd ++; + } + else if (fdTable[i].type == STATE_PENDING && + get_duration(fdTable[i].stime, addrlen) > 10) { + fprintf(stderr, + "ComGetConnPair: pid %ld closed fd %d (PENDING >= 10 sec)\n", + ACE_OS::getpid (), fdTable[i].fd); + ComCloseConn(fdTable[i].fd); + fdTable[i].fd = -1; + fd ++; + } + } + if (fd < 2) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld no faTable entry for the pair", + ACE_OS::getpid ()); + return -1; + } + + FD_ZERO(&read_mask); + if (fd_inet >= 0) FD_SET(fd_inet, &read_mask); + if (fd_unix >= 0) FD_SET(fd_unix, &read_mask); + if (fd_atm >= 0) FD_SET(fd_atm, &read_mask); + + tval.tv_sec = 1; /* wait at most 1 second */ + tval.tv_usec = 0; + + + nfds = fd_inet; + if (fd_unix > nfds) nfds = fd_unix; + if (fd_atm > nfds) nfds = fd_atm; + // nfds now holds the highest numbered open file descriptor + nfds ++; // increment so that select can use o to nfds -1 no. of + // file descriptors. + errno = 0; + // fd is here used as the result of the select call +#ifdef _HPUX_SOURCE + if ((fd = select(nfds, (int *)&read_mask, NULL, NULL, &tval)) == -1) +#else + if ((fd = select(nfds, &read_mask, NULL, NULL, &tval)) == -1) +#endif + { + + if (errno == EINTR) return -1; + + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed on select():", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (fd == 0) return -1; /* time expire */ + + fd = -1; + // fd will be reused inside this code as the accepted socket. + if (fd == -1 && fd_unix >= 0 && FD_ISSET(fd_unix, &read_mask)) { + struct sockaddr_un peeraddr_un; + + fprintf(stderr, "Server to accept a UNIX connection.\n"); + + addrlen = sizeof(struct sockaddr_un); + fd = ACE_OS::accept(fd_unix, (struct sockaddr *)&peeraddr_un, &addrlen); + if (fd == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to accpet on fd_unix:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + } + else fdType = CONN_UNIX; + *max_pkt_size = 0; + } + // fd here is the result of the accept for unix if fd_unix is valid + // Hence if fd_unix is present then this won't be called if the + // accept for the fd_unix succeeds. + if (fd == -1 && fd_inet >= 0 && FD_ISSET(fd_inet, &read_mask)) { + + fprintf(stderr, "Server to accept a INET connection.\n"); + + addrlen = sizeof(struct sockaddr_in); + fd = ACE_OS::accept(fd_inet, (struct sockaddr *)&peeraddr_in, &addrlen); + if (fd == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to accpet on fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + } + else fdType = CONN_INET; + *max_pkt_size = 0; + } + if (fd == -1 && fd_atm >= 0 && FD_ISSET(fd_atm, &read_mask)) { +#ifdef NATIVE_ATM + fd = ATMaccept(fd_atm, max_pkt_size); + fdType = CONN_ATM; +#else + fprintf(stderr, + "Error ComGetConnPair: pid %ld CONN_ATM not supported.\n", + ACE_OS::getpid ()); +#endif + } + // fd = -1 implies accept failed in any of the active connections + // which came out of the select call. + if (fd == -1) return -1; + + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) break; + } + // Enter the accepted fd in the file descriptor Table + if (i < size) { + fdTable[i].fd = fd; + fdTable[i].type = fdType; + fdTable[i].stime = get_sec(); + } + else { + fprintf(stderr, "Weird\n"); + } + + // read the port number for the UDP socket of the client + if (time_read_int(fd, &nfds) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to read int from %s fd:", + ACE_OS::getpid (), + fdType == CONN_ATM ? "ATM" : + fdType == CONN_INET ? "INET" : "UNIX"); + ACE_OS::perror (""); + ComCloseConn(fd); + return -1; + } + fprintf (stderr, + " Received int nfds = %d \n", + nfds); + // nfds holds the int read in time_read_int + // if nfds is -1 then read int error. + fprintf(stderr, "ComGetConnPair got %s fd = %d with value %d\n", + fdType == CONN_ATM ? "ATM" : + fdType == CONN_INET ? "INET" : "UNIX", + fd, nfds); + + if (nfds >= 0) { /* can be paired and return */ + // This is the success case where you got a control fd and a data fd. + fdTable[i].state = STATE_DATA; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == nfds) break; + } + if (i < size && fdTable[i].state == STATE_PENDING) { + fdTable[i].state = STATE_CONTROL; + } + else { + if (i >= 0) fprintf(stderr, "<Weird> i %d\n", i); + ComCloseConn(fd); + return -1; + } + // ???? + *ctr_fd = fdTable[i].fd; + *data_fd = fd; + return 0; + } + else if (nfds == -1) { /* wait to be paired */ + fdTable[i].state = STATE_PENDING; + // fd is the inet or unix accepted socket. + // why is anyone writing the fd to the peer? + // looks like he is indicating an error to the client!! + // is this a hack ;-( + if (time_write_int(fd, fd) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to write (fd) to %s fd:", + ACE_OS::getpid (), + fdType == CONN_ATM ? "ATM" : + fdType == CONN_INET ? "INET" : "UNIX"); + ACE_OS::perror (""); + ComCloseConn(fd); + return -1; + } + if (fdType == CONN_INET && change_option(fd) == -1) { + ComCloseConn(fd); + } + return -1; + } + else if (nfds == -2) { /* inet case only, UDP data sock is requested */ + int dfd; + struct sockaddr_in * in = &(peeraddr_in); + + fdTable[i].state = STATE_CONTROL; + + if (fdType == CONN_INET && change_option(fd) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to change options of TCP cfd:", + ACE_OS::getpid ()); + ComCloseConn(fd); + return -1; + } + + dfd = socket(AF_INET, SOCK_DGRAM, 0); + if (dfd == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to open dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + return -1; + } + memset((char *)in, 0, sizeof(* in)); + + addrlen = sizeof(*in); + if (ACE_OS::getsockname(fd, (struct sockaddr *)in, &addrlen) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to getsockname of fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + + in->sin_family = AF_INET; + in->sin_port = 0; + /* + in->sin_addr.s_addr = htonl(INADDR_ANY); + */ + if (bind(dfd, (struct sockaddr *)in, sizeof(* in)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to bind dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + addrlen = sizeof(*in); + if (ACE_OS::getsockname(dfd, (struct sockaddr *)in, &addrlen) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to getsockname of dfd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + if (time_write_bytes(fd, (char *)&in->sin_port, sizeof(short)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to write (dfd.port) to fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + /* + addrlen = sizeof(*in); + if (getsockname(fd, (struct sockaddr *)in, &addrlen) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to getsockname of fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + */ + if (time_write_bytes(fd, (char *)&in->sin_addr.s_addr, sizeof(int)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to write (dfd.IPaddr) to fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + + fprintf(stderr, "ComGetConnPair local UDP socket: addr - %s, port - %u.\n", + inet_ntoa(in->sin_addr), ntohs(in->sin_port)); + + if (time_read_bytes(fd, (char *)&in->sin_port, sizeof(short)) == -1 || + time_read_bytes(fd, (char *)&in->sin_addr.s_addr, sizeof(int)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to read (port, IPaddr) from fd:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } + usleep(10000); + if (connect(dfd, (struct sockaddr *)in, sizeof(*in)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed conn UDP dfd to peer:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + ComCloseConn(fd); + ACE_OS::close (dfd); + return -1; + } +#if 0 + { + int len; + len = 65536; /* INET_SOCKET_BUFFER_SIZE + 100; */ + /* + if (setsockopt(dfd, SOL_SOCKET, SO_SNDBUF, (char *)&len, sizeof(len)) == -1) { + fprintf(stderr, + "Error ComGetConnPair: pid %ld failed to set UDP dfd-snd to size %d:", + ACE_OS::getpid (), len); + perror(""); + ComCloseConn(fd); + close(dfd); + return -1; + } + */ + len = 65536; + while (setsockopt(dfd, SOL_SOCKET, SO_RCVBUF, (char *)&len, sizeof(len)) == -1) { + len -= 1024; + if (len < 8192) break; + /* + fprintf(stderr, + "Warning ComGetConnPair: pid %ld failed to set UDP dfd-rcv to size %d:", + ACE_OS::getpid (), len); + perror(""); + ComCloseConn(fd); + close(dfd); + return -1; + */ + } + if (getuid() == DEVELOPER_UID) + fprintf(stderr,"Set UDP dfd-rcv to %dB\n", len); + } +#endif + // Most common return case where the server creates a UDP socket , + // writes the port and ip addr and also gets the client's UDP + // endpoint . + *max_pkt_size = - INET_SOCKET_BUFFER_SIZE; /* UDP sockets on HP and SUN + are known to be discard mode */ + + fprintf(stderr, "ComGetConnPair UDP dfd connects to host-%s (port %u)\n", + inet_ntoa(in->sin_addr), ntohs(in->sin_port)); + + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = dfd; + fdTable[i].type = CONN_INET; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_DATA; + + *ctr_fd = fd; + *data_fd = dfd; + return 0; + } + else { + fprintf(stderr, "ComGetConnPair <Weird>: no space left\n"); + return -1; + } + } + else { + fprintf(stderr, + "Error ComGetConnPair: pid %ld get invalid value %d from fd\n", + ACE_OS::getpid (), nfds); + ComCloseConn(fd); + } + return -1; +} + +/* returns: -1 -- failed, >= 0 -- fd */ +int ComGetConn(int *max_pkt_size) +{ + int i; + int fd, fdType = -1; + int addrlen; + fd_set read_mask; + struct timeval tval; + int nfds; + + fd = 0; + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) { + fd ++; + } + } + if (fd < 1) { + fprintf(stderr, + "Error ComGetConn: pid %ld no faTable entry for the pair", + ACE_OS::getpid ()); + return -1; + } + + FD_ZERO(&read_mask); + if (fd_inet >= 0) FD_SET(fd_inet, &read_mask); + if (fd_unix >= 0) FD_SET(fd_unix, &read_mask); + if (fd_atm >= 0) FD_SET(fd_atm, &read_mask); + + tval.tv_sec = 1; /* wait at most 1 second */ + tval.tv_usec = 0; + + nfds = fd_inet; + if (fd_unix > nfds) nfds = fd_unix; + if (fd_atm > nfds) nfds = fd_atm; + nfds ++; + errno = 0; +#ifdef _HPUX_SOURCE + if ((fd = select(nfds, (int *)&read_mask, NULL, NULL, &tval)) == -1) +#else + if ((fd = select(nfds, &read_mask, NULL, NULL, &tval)) == -1) +#endif + { + + if (errno == EINTR) return -1; + + fprintf(stderr, + "Error ComGetConn: pid %ld failed on select():", + ACE_OS::getpid ()); + ACE_OS::perror (""); + return -1; + } + if (fd == 0) return -1; /* time expire */ + + fd = -1; + + if (fd == -1 && fd_unix >= 0 && FD_ISSET(fd_unix, &read_mask)) { + struct sockaddr_un peeraddr_un; + + fprintf(stderr, "Server to accept a UNIX connection.\n"); + + addrlen = sizeof(struct sockaddr_un); + fd = ACE_OS::accept(fd_unix, (struct sockaddr *)&peeraddr_un, &addrlen); + if (fd == -1) { + fprintf(stderr, + "Error ComGetConn: pid %ld failed to accpet on fd_unix:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + } + else fdType = CONN_UNIX; + *max_pkt_size = 0; + } + if (fd == -1 && fd_inet >= 0 && FD_ISSET(fd_inet, &read_mask)) { + struct sockaddr_in peeraddr_in; + + fprintf(stderr, "Server to accept a INET connection.\n"); + + addrlen = sizeof(struct sockaddr_in); + fd = ACE_OS::accept(fd_inet, (struct sockaddr *)&peeraddr_in, &addrlen); + if (fd == -1) { + fprintf(stderr, + "Error ComGetConn: pid %ld failed to accpet on fd_inet:", + ACE_OS::getpid ()); + ACE_OS::perror (""); + } + else fdType = CONN_INET; + *max_pkt_size = 0; + } + if (fd == -1 && fd_atm >= 0 && FD_ISSET(fd_atm, &read_mask)) { +#ifdef NATIVE_ATM + fd = ATMaccept(fd_atm, max_pkt_size); + fdType = CONN_ATM; +#else + fprintf(stderr, + "Error ComGetConn: pid %ld CONN_ATM not supported.\n", + ACE_OS::getpid ()); +#endif + } + if (fd == -1) return -1; + + for (i = 0; i < size; i ++) { + if (fdTable[i].fd == -1) break; + } + if (i < size) { + fdTable[i].fd = fd; + fdTable[i].type = fdType; + fdTable[i].stime = get_sec(); + fdTable[i].state = STATE_SINGLE; + return fd; + } + else { + fprintf(stderr, "Weird\n"); + ComCloseConn(fd); + return -1; + } +} + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h new file mode 100644 index 00000000000..cf97b4b1796 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h @@ -0,0 +1,112 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* +Some assumptions about the streams created in this file: + + PACKET STREAM: + + * send(), recv() may not work, we can only use + read()/write(). + + * write(): either send the whole packet, or send nothing + + * read(): read() will read the minimun of the + requested number of bytes and current packet size. + read() can read part of a packet, but it + will not read cross packet boundaris + + There are two modes: non-discard and dicard. If a packets is + not read all its bytes, the remaining bytes will be + or not be discarded. + + This is indicated by if (*max_pkt_size) is positive + (non-discard) or negative (discard) + + BYTE_STREAM: reliable + + * write(): might write only part of requested bytes + each time. (this is the case in SunOS4) + + * read(): might read less than requested bytes. + (this is the case in SunOS4). +*/ + +/* returns: -1 -- failed, 0 -- successful */ +int ComInitClient(int inet_port, char * unix_port, char * atm_port); + +void ComCloseClient(void); + +/* address format: [ATM:|INET:]real_address | "" + + "" -- UNIX socket, reliable byte stream + [INET:]real_address -- INET sockets, reliable control byte stream, and + *max_pkt_size == 0 : reliable data byte stream, or + != 0 : unreliable packet stream; + ATM:real_address -- ATM sockets, both data and control are + unreliable packet streams; + DATM:real_address -- INET/UNIX control reliable byte stream + and ATM unreliable byte stream; + + returns: -1 -- failed, 0 -- successful + *ctr_fd -- control connection file descriptor + *data_fd -- data connection file descriptor + *max_pkt_size -- == 0 : reliable BYTE_STREAM + > 0 : unreliable non-discard PACKET STREAM + with given maximum packet size (bytes); + < 0 : unreliable discard PACKET STREAM + with given maximum packet size (bytes); + + It is suggested that if a BYTE_STREAM is not known to be discarded, + than it is safer to indicate it as discard. + */ +int ComOpenConnPair(char * address, int *ctr_fd, int *data_fd, int *max_pkt_size); +int VideoComOpenConnPair(char * address, int *ctr_fd, int *data_fd, int *max_pkt_size); + + +/* returns: -1 -- failed, >=0 -- fd */ +int ComOpenConn(char * address, int *max_pkt_size); + +/* returns: -1 -- failed, 0 -- successful */ +int ComCloseFd(int fd); + +/* returns: -1 -- failed, 0 -- successful */ +int ComCloseConn(int fd); + +/* returns: -1 -- failed, 0 -- successful */ +int ComInitServer(int inet_port, char * unix_port, char * atm_port); + +void ComCloseListen(void); + +void ComCloseServer(void); + +/* returns: -1 -- failed, 0 -- successful + *max_pkt_size is used only for returning value +*/ +int ComGetConnPair(int *ctr_fd, int *data_fd, int *max_pkt_size); + +/* returns: -1 -- failed, >= 0 -- fd */ +int ComGetConn(int *max_pkt_size); + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.cpp new file mode 100644 index 00000000000..760fbd7f3a3 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.cpp @@ -0,0 +1,410 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <pwd.h> +#include <grp.h> +#include <time.h> +#include <sys/time.h> +#include <unistd.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <netinet/in.h> +#include "routine.h" +#include "fileio.h" + +ACE_RCSID(mpeg_shared, fileio, "$Id$") + +/* + Statfile(filename, sb) + input: filename - path name of a directory entry; + output: sb - StatBuf structure of the given directory entry; + returns: 0 - successful, -1 - failed, with errno indicating error + */ +int StatFile(char *filename, struct StatBuf * sb) +{ + struct stat statbuf; + struct passwd *pw; + struct group *grp; + + if (stat(filename, &statbuf) == -1) + return -1; + + sb->mode = statbuf.st_mode; + sb->size = statbuf.st_size; + + strcpy(sb->ctime, ACE_OS::ctime (&(statbuf.st_ctime))); + sb->ctime[strlen(sb->ctime)-1] = 0; /* remove CR */ + + if ((pw = getpwuid(statbuf.st_uid)) == NULL) + sprintf(sb->uid, "%-10ld", statbuf.st_uid); + else + strncpy(sb->uid, pw->pw_name, 32); + + if ((grp = getgrgid(statbuf.st_gid)) == NULL) + sprintf(sb->gid, "%-10ld", statbuf.st_gid); + else + strncpy(sb->gid, grp->gr_name, 32); +} + +/* + read_bytes(s, buf, size) + input: s - socket to read from + buf - address of a buffer for the read + size - number of bytes to read + output: non + action: try read given number of bytes, all errors are reported, and + cause program to exit. +*/ +void read_bytes(int s, char * buf, int size) +{ + int val, remain = size; + char * ptr = buf; + + if (size == 0) return; + + for (;;) + { + val = ACE_OS::read (s, ptr, remain); + + if (val == -1 && (errno == EINTR || errno == EAGAIN | errno == EWOULDBLOCK)) + { /* interrupted or need to wait, try again */ + if (errno == EAGAIN | errno == EWOULDBLOCK) usleep(10000); + errno = 0; + continue; + } + if (val == -1) + { + ACE_OS::perror ("Error -- Read from socket"); + ACE_OS::exit (1); + } + if (val == 0) /* EOF encountered */ + { + fprintf(stderr, "Error -- EOF reached while trying to read %d bytes.\n", size); + ACE_OS::exit (1); + } + ptr += val; + remain -= val; + if (remain < 0) /* weird thing is happening */ + { + fprintf(stderr, "Error: read too much from socket, %d out of %d bytes.\n", + size-remain, size); + ACE_OS::exit (1); + } + if (remain == 0) + break; + } +} + +int wait_read_bytes (int s, char *buf, int size) +{ + int val, remain = size; + char * ptr = buf; + + if (size == 0) return 1; + + for (;;) + { + val = ACE_OS::read (s, ptr, remain); + + if (val == -1 && (errno == EINTR || errno == EAGAIN | errno == EWOULDBLOCK)) + { /* interrupted or need to wait, try again */ + if (errno == EAGAIN | errno == EWOULDBLOCK) usleep(10000); + errno = 0; + continue; + } + if (val == -1) + { + /* + ACE_OS::perror ("Error -- wait_read from socket"); + */ + return -1; + } + if (val == 0) /* EOF encountered */ + { + /* + fprintf(stderr, "Warn pid %ld -- EOF on wait_read %d bytes.\n", + ACE_OS::getpid (), size); + */ + return 0; + } + ptr += val; + remain -= val; + if (remain < 0) /* weird thing is happening */ + { + fprintf(stderr, + "Error: weird, read too much from socket, %d out of %d bytes.\n", + size-remain, size); + return -1; + } + if (remain == 0) + break; + } + return size; +} + +#define WAIT_DURATION 5000000 + +int time_read_bytes(int s, char * buf, int size) +{ + int val, remain = size; + char * ptr = buf; + + int times = 0; + + if (size == 0) return 0; + + for (;;) { + fd_set read_mask; + struct timeval tval = {0, 0}; + + FD_ZERO(&read_mask); + FD_SET(s, &read_mask); +#ifdef _HPUX_SOURCE + if (select(s+1, (int *)&read_mask, NULL, NULL, &tval) <= 0) +#else + if (select(s+1, &read_mask, NULL, NULL, &tval) <= 0) +#endif + { + /* + if (get_duration(start, get_usec()) < WAIT_DURATION) { + usleep(10000); + continue; + } + */ + if (times < WAIT_DURATION / 10000) { + usleep(10000); + times ++; + continue; + } + else { + fprintf(stderr, "time_read_bytes() %d seconds expired\n", + WAIT_DURATION/1000000); + return -1; + } + } + + if (!(FD_ISSET(s, &read_mask))) continue; + + val = ACE_OS::read (s, ptr, 1); + + if (val == -1 && (errno == EINTR)) + { /* interrupted or need to wait, try again */ + errno = 0; + continue; + } + if (val == -1) + { + ACE_OS::perror ("Error -- time_read_bytes() from socket"); + return -1; + } + if (val == 0) /* EOF encountered */ + { + /* + fprintf(stderr, "Error -- EOF reached while trying to read %d bytes.\n", size); + */ + return -1; + /* 'continue' causes infinite loop if the pipe is closed by peer + continue; + */ + } + ptr += val; + remain -= val; + if (remain == 0) + return 0; + } +} + +/* + write_bytes(sock, data, len): + try write len byte of data to sock, report all errors by + warning message. +*/ +void write_bytes(int sock, char * data, int len) +{ + while (len > 0) { + int res = ACE_OS::write (sock, data, len); + if (res == -1) { + if (errno == EINTR || errno == EAGAIN) continue; + fprintf(stderr, "Error pid %ld",ACE_OS::getpid ()); + ACE_OS::perror (" -- failed to write all bytes to socket"); + ACE_OS::exit (1); + } + len -= res; + data += res; + } +} + +int time_write_bytes(int sock, char * data, int plen) +{ + int len = plen; + while (len > 0) { + int res = ACE_OS::write (sock, data, len); + if (res == -1) { + if (errno == EINTR || errno == EAGAIN) continue; + fprintf(stderr, "Error pid %ld",ACE_OS::getpid ()); + ACE_OS::perror (" -- failed to time_write all bytes to socket"); + return -1; + } + len -= res; + data += res; + } + return plen; +} + +int wait_write_bytes(int sock, char * data, int plen) +{ + int len = plen; + while (len > 0) { + int res = ACE_OS::write (sock, data, len); + if (res == -1) { + if (errno == EINTR || errno == EAGAIN) continue; + /* + fprintf(stderr, "Error pid %ld",ACE_OS::getpid ()); + ACE_OS::perror (" -- failed to wait_write all bytes to socket"); + */ + return -1; + } + len -= res; + data += res; + } + return plen; +} + +/* read_byte: + read one byte from sock to buffer data */ + +void read_byte(int sock, char * data) +{ + read_bytes(sock, data, 1); +} + +/* read_short: + read a short integer from socket sock to buffer data, + byte order conversion is also done. +*/ +void read_short(int sock, short * data) +{ + read_bytes(sock, (char *)data, sizeof(short)); + *data = ntohs(*data); +} + +/* read_int: + read a integer from socket sock to buffer data, + byte order conversion is also done */ + +void read_int(int sock, int * data) +{ + read_bytes(sock, (char *)data, sizeof(int)); + *data = ntohl(*data); +} + +int time_read_int(int sock, int * data) +{ + if (time_read_bytes(sock, (char *)data, sizeof(int)) == -1) { + return -1; + } + *data = ntohl(*data); + return 0; +} + +/* read a string. Returns the length of the string. + transfer through the socket. + but the string in buffer might have been truncated. + the returned string is '\0' terminated */ + +int read_string(int sock, char *data, int maxlen) +{ + int len; + read_int(sock, &len); + if (len == 0) + { + data[0] = 0; + return 0; + } + if (len < maxlen) + { + read_bytes(sock, data, len); + data[len] = 0; + } + else + { + int i; + char tmp; + read_bytes(sock, data, maxlen-1); + data[maxlen-1] = 0; + for (i = 0; i < len - maxlen + 1; i ++) /* discard extra data */ + read_byte(sock, &tmp); + } + return len; +} + + +/* write_byte: + write a byte to socket sock */ + +void write_byte(int sock, char data) +{ + write_bytes(sock, &data, 1); +} + +/* write_short: + byte order convert the short integer in data and write to socket sock */ + +void write_short(int sock, short data) +{ + short val = htons(data); + write_bytes(sock, (char *)&val, sizeof(short)); +} + +/* write_int: + byte order convert the integer in data and write to socket sock */ +void write_int(int sock, int data) +{ + int val = htonl(data); + write_bytes(sock, (char *)&val, sizeof(int)); +} + +int time_write_int(int sock, int data) +{ + int val = htonl(data); + return time_write_bytes(sock, (char *)&val, sizeof(int)); +} + +/* write a string in data to socket sock, the string is led by a length */ + +void write_string(int sock, char *data) +{ + int len =ACE_OS::strlen (data); + + write_int(sock, len); + write_bytes(sock, data, len); +} + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h new file mode 100644 index 00000000000..640037cbd5c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h @@ -0,0 +1,100 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* data structure used by StatFile() */ + +#ifndef _MPEG_FILE_IO_H +#define _MPEG_FILE_IO_H + +struct StatBuf +{ + unsigned short mode; + long size; + char uid[32]; + char gid[32]; + char ctime[32]; +}; + +/* protocol of functions defined in shared.c */ + +int StatFile(char *filename, struct StatBuf * sb); + + + +/* Following read...()'s would exit(1) if requested bytes can not be + read, and EOF or error other than EINTR, EAGAIN or EWOULDBLOCK is + encountered */ + +void read_bytes(int s, char * buf, int size); + +void read_byte(int sock, char * data); + +void read_short(int sock, short * data); + +void read_int(int sock, int * data); + +int read_string(int sock, char *data, int maxlen); /* returns the length of a stream */ + + +/* Following write...()'s would exit(1) if requested bytes can not + be written to socket because of error has happened*/ + +void write_bytes(int sock, char * data, int len); + +void write_byte(int sock, char data); + +void write_short(int sock, short data); + +void write_int(int sock, int data); + +void write_string(int sock, char *data); + + +/* following returns: 0 -- succ, -1 -- failed. + time_read*() will wait at most 5 seconds before they return */ + +int time_read_bytes(int s, char * buf, int size); + +int time_read_int(int sock, int * data); + +int time_write_bytes(int sock, char * data, int len); + +int time_write_int(int sock, int data); + + +/* Following read...()'s would return 0/-1 if requested bytes can not + be read, and EOF (return 0) or error (return -1) other than EINTR, + EAGAIN or EWOULDBLOCK is encountered */ + +int wait_read_bytes(int s, char *buf, int size); + + +/* Following write...()'s would return 0/-1 if requested bytes can not + be written and error (return -1) other than EINTR, EAGAIN or is + encountered */ + +int wait_write_bytes(int s, char *buf, int size); + +#endif /* _MPEG_FILE_IO_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.cpp new file mode 100644 index 00000000000..5a38571cf67 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.cpp @@ -0,0 +1,369 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include <stdio.h> +#include <limits.h> /* INT_MIN, INT_MAX are defined here */ +#include <errno.h> +#include <stdlib.h> +#include <string.h> +/* +#include <stdlib.h> +#include <sys/time.h> +#include <sys/types.h> +*/ +#include "filters.h" +#include "ace/OS.h" + +ACE_RCSID(mpeg_shared, filters, "$Id$") + +#define BUFSIZE 256 +#define maxval(a,b) ((a) > (b) ? (a) : (b)) +#define minval(a,b) ((a) < (b) ? (a) : (b)) + +static float FLOAT_MIN = (float)INT_MIN; + +AverageFilter * NewAverageFilter(int nsamples) +{ + AverageFilter * f; + f = (AverageFilter *) ACE_OS::malloc(sizeof(*f)); + if (f == NULL) + return NULL; + f->type = FILTER_AVERAGE; + f->nsamples = nsamples; + f->buf = (double *)ACE_OS::malloc(nsamples * sizeof(double)); + if (f->buf == NULL) { + ACE_OS::free(f); + return NULL; + } + f->count = 0; + f->ptr = 0; + f->sum = 0; + return f; +} + +AverageFilter * ResetAverageFilter(AverageFilter *f, int nsamples) +{ + if (f->nsamples != nsamples) { + ACE_OS::free(f->buf); + f->nsamples = nsamples; + f->buf = (double *)ACE_OS::malloc(nsamples * sizeof(double)); + if (f->buf == NULL) { + ACE_OS::free(f); + return NULL; + } + } + f->count = 0; + f->ptr = 0; + f->sum = 0; + return f; +} + +void FreeAverageFilter(AverageFilter * f) +{ + ACE_OS::free(f->buf); + ACE_OS::free(f); +} + +double DoAverageFilter(AverageFilter *f, double value) +{ + double oldval = f->buf[f->ptr]; + f->buf[f->ptr] = value; + f->ptr = (f->ptr + 1) % f->nsamples; + f->sum += value; + if (f->count >= f->nsamples) { + f->sum -= oldval; + } + else { + f->count ++; + } + return (double)(f->sum) / (double)f->count; +} + + +LowPassFilter * NewLowPassFilter(double Rvalue) +{ + LowPassFilter * f; + f = (LowPassFilter *)ACE_OS::malloc(sizeof(*f)); + if (f == NULL) { + return NULL; + } + if (Rvalue > 1.0) { + Rvalue = 1.0; + } + else if (Rvalue < 0.0) { + Rvalue = 0.0; + } + f->type = FILTER_LOWPASS; + f->count = 0; + f->maxcount = (int)(1.0 / maxval(Rvalue, 0.0001)); + f->R = Rvalue; + f->result = FLOAT_MIN; + return f; +} + +LowPassFilter * ResetLowPassFilter(LowPassFilter * f, double Rvalue) +{ + if (Rvalue > 1.0) { + Rvalue = 1.0; + } + else if (Rvalue < 0.0) { + Rvalue = 0.0; + } + f->count = 0; + f->maxcount = (int)(1.0 / maxval(Rvalue, 0.0001)); + f->R = Rvalue; + f->result = FLOAT_MIN; + return f; +} + +void FreeLowPassFilter(LowPassFilter * f) +{ + ACE_OS::free(f); +} + +double DoLowPassFilter(LowPassFilter * f, double value) +{ + if (f->count <= f->maxcount) { + if (!f->count) { + f->count ++; + return (f->result = value); + } + f->count ++; + return (f->result = (1.0 - (1.0/(double)f->count)) * f->result + + (1.0/(double)f->count) * value); + } + return (f->result = (1.0 - f->R) * f->result + f->R * value); +} + +MedianFilter * NewMedianFilter(int nsamples) +{ + int minv = 0, maxv = 1; + MedianFilter * f; + f = (MedianFilter *) ACE_OS::malloc(sizeof(*f)); + if (f == NULL) + return NULL; + f->type = FILTER_MEDIAN; + f->nsamples = nsamples; + f->max = maxval(maxv, minv); + f->min = minval(maxv, minv); + f->statsize = f->max - f->min + 1; + f->buf = (int *)ACE_OS::malloc(nsamples * sizeof(int)); + if (f->buf == NULL) { + ACE_OS::free(f); + return NULL; + } + f->stat = (int *)ACE_OS::malloc(f->statsize * sizeof(int)); + if (f->stat == NULL) { + ACE_OS::free(f->buf); + ACE_OS::free(f); + return NULL; + } + f->count = 0; + f->ptr = 0; + f->med = 0; + f->below = 0; + memset(f->stat, 0, f->statsize * sizeof(int)); + return f; +} + +MedianFilter * ResetMedianFilter(MedianFilter * f, int nsamples) +{ + if (f->nsamples != nsamples) { + ACE_OS::free(f->buf); + f->nsamples = nsamples; + f->buf = (int *)ACE_OS::malloc(nsamples * sizeof(int)); + if (f->buf == NULL) { + ACE_OS::free(f); + return NULL; + } + } + f->count = 0; + f->ptr = 0; + f->med = 0; + f->below = 0; + memset(f->stat, 0, f->statsize * sizeof(int)); + return f; +} + +void FreeMedianFilter(MedianFilter * f) +{ + ACE_OS::free(f->buf); + ACE_OS::free(f->stat); + ACE_OS::free(f); +} + +double DoMedianFilter(MedianFilter *f, double pvalue) +{ + int value = (int)pvalue; + int offset; + int oldval = f->buf[f->ptr]; + if (value > f->max) { + int * oldstat = f->stat; + int oldsize = f->statsize; + f->max = value + 10; + f->statsize = f->max - f->min + 1; + f->stat = (int *)ACE_OS::malloc(f->statsize * sizeof(int)); + if (f->stat == NULL) { + fprintf(stderr, "MedianFilter Failed to extend up stat to % items", + f->statsize); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + memset((char *)(f->stat) + sizeof(int) * oldsize, 0, + sizeof(int) * (f->statsize - oldsize)); + ACE_OS::memcpy (f->stat, oldstat, oldsize * sizeof(int)); + } + else if (value < f->min) { + int * oldstat = f->stat; + int oldsize = f->statsize; + f->min = value - 10; + f->statsize = f->max - f->min + 1; + f->stat = (int *)ACE_OS::malloc(f->statsize * sizeof(int)); + if (f->stat == NULL) { + fprintf(stderr, "MedianFilter Failed to extend down stat to % items", + f->statsize); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + memset(f->stat, 0, sizeof(int) * (f->statsize - oldsize)); + ACE_OS::memcpy ((char *)(f->stat) + sizeof(int) * (f->statsize - oldsize), + oldstat, sizeof(int) * oldsize); + f->med += f->statsize - oldsize; + } + f->buf[f->ptr] = value; + f->ptr = (f->ptr + 1) % f->nsamples; + offset = value - f->min; + if (offset < 0) { + offset = 0; + } + else if (offset >= f->statsize) { + offset = f->statsize - 1; + } + f->stat[offset] ++; + if (offset < f->med) { + f->below ++; + } + if (f->count >= f->nsamples) { + offset = oldval - f->min; + if (offset < 0) { + offset = 0; + } + else if (offset >= f->statsize) { + offset = f->statsize - 1; + } + f->stat[offset] --; + if (offset < f->med) { + f->below --; + } + } + else { + f->count ++; + } + oldval = f->count >> 1; + if (f->below > oldval) { + offset = f->med - 1; + while (offset >= 0 && (f->below - f->stat[offset]) > oldval) { + f->below -= f->stat[offset]; + offset --; + } + f->med = offset + 1; + } + else { + offset = f->med; + while (offset < f->statsize && (f->below + f->stat[offset]) <= oldval) { + f->below += f->stat[offset]; + offset ++; + } + f->med = offset; + } + return (double)(f->med + f->min); +} + +Filter * NewFilter(int type, int parameter) +{ + switch (type) { + case FILTER_LOWPASS: + return (Filter *)NewLowPassFilter(1.0/(double)parameter); + case FILTER_MEDIAN: + return (Filter *)NewMedianFilter(parameter); + case FILTER_AVERAGE: + return (Filter *)NewAverageFilter(parameter); + default: + break; + } + return NULL; +} + +Filter * ResetFilter(Filter * f, int parameter) +{ + switch (f->type) { + case FILTER_LOWPASS: + return (Filter *)ResetLowPassFilter((LowPassFilter *)f, 1.0/(double)parameter); + case FILTER_MEDIAN: + return (Filter *)ResetMedianFilter((MedianFilter *)f, parameter); + case FILTER_AVERAGE: + return (Filter *)ResetAverageFilter((AverageFilter *)f, parameter); + default: + break; + } + return NULL; +} + +void FreeFilter(Filter * f) +{ + switch (f->type) { + case FILTER_LOWPASS: + FreeLowPassFilter((LowPassFilter *)f); + break; + case FILTER_MEDIAN: + FreeMedianFilter((MedianFilter *)f); + break; + case FILTER_AVERAGE: + FreeAverageFilter((AverageFilter *)f); + break; + default: + break; + } +} + +double DoFilter(Filter *f, double value) +{ + switch (f->type) { + case FILTER_LOWPASS: + return DoLowPassFilter((LowPassFilter *)f, value); + break; + case FILTER_MEDIAN: + return DoMedianFilter((MedianFilter *)f, value); + break; + case FILTER_AVERAGE: + return DoAverageFilter((AverageFilter *)f, value); + break; + default: + break; + } + return FLOAT_MIN; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h new file mode 100644 index 00000000000..50950277478 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/filters.h @@ -0,0 +1,91 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ + +#if !defined (AV_FILTERS_H) +#define AV_FILTERS_H + +#define FILTER_LOWPASS 0 +#define FILTER_MEDIAN 1 +#define FILTER_AVERAGE 2 + +typedef struct MedianFilter { + int type; + int * buf; + int nsamples; + int count; + int ptr; + int * stat; + int statsize; + int max, min; + int med; /* median offset to stat */ + int below; /* total points below the med entry */ +} MedianFilter; + +typedef struct LowPassFilter { + int type; + int count; + int maxcount; + double R; + double result; +} LowPassFilter; + +typedef struct AverageFilter { + int type; + double * buf; + int nsamples; + int ptr; + double sum; + int count; +} AverageFilter; + +typedef union Filter { + int type; + MedianFilter m; + AverageFilter a; + LowPassFilter l; +} Filter; + +Filter * NewFilter(int type, int parameter); +Filter * ResetFilter(Filter * f, int parameter); +void FreeFilter(Filter * f); +double DoFilter(Filter *f, double value); + +MedianFilter * NewMedianFilter(int nsamples); +MedianFilter * ResetMedianFilter(MedianFilter * f, int nsamples); +void FreeMedianFilter(MedianFilter * f); +double DoMedianFilter(MedianFilter *f, double value); + +AverageFilter * NewAverageFilter(int nsamples); +AverageFilter * ResetAverageFilter(AverageFilter * f, int nsamples); +void FreeAverageFilter(AverageFilter * f); +double DoAverageFilter(AverageFilter *f, double value); + +LowPassFilter * NewLowPassFilter(double R); +LowPassFilter * ResetLowPassFilter(LowPassFilter * f, double R); +void FreeLowPassFilter(LowPassFilter * f); +double DoLowPassFilter(LowPassFilter *f, double value); + +#endif /* AV_FILTERS_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.cpp new file mode 100644 index 00000000000..993dce3058e --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.cpp @@ -0,0 +1,505 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include <stdio.h> +#include <errno.h> +#include <stdlib.h> +#include <time.h> +#include <unistd.h> +#include <limits.h> +#ifdef __svr4__ +#include <sys/systeminfo.h> +#endif +#ifdef _HPUX_SOURCE +#include <sys/rtprio.h> +#elif defined(__svr4__) +#include <sys/priocntl.h> +#include <sys/rtpriocntl.h> +#include <sys/tspriocntl.h> +#endif + +#include <sys/types.h> +#include <sys/ipc.h> +#include <sys/time.h> +#include <sys/resource.h> +#include <sys/sem.h> +#include <signal.h> +#include <sys/wait.h> +#include <sys/param.h> +#include <string.h> +#include "routine.h" + +ACE_RCSID(mpeg_shared, routine, "$Id$") + +#define TEST_TYPE 1 +#define SIGSETMASK 0 +#define stacksize 10000 +#define TIME_ROUND 4000 +#define BLOCK_NUM 5 +#define DELTA_MSEC 20 + +union semun sem_union; + +int get_hostname(char *name, int len) +{ +#ifdef __svr4__ + if (sysinfo(SI_HOSTNAME, name, len) == -1) return -1; + else return 0; +#else + return ACE_OS::hostname(name, len); +#endif +} + +long get_usec(void) +{ + struct timeval tp; + struct timezone tzp; + int err = gettimeofday(&tp, &tzp); + if (err) + { + return 0; + } + else { + /* + return ((long)1000000)*(tp.tv_sec%TIME_ROUND) + (tp.tv_usec); + */ + return ((long)1000000)*(tp.tv_sec) + (tp.tv_usec); + } +} + +long get_msec(void) +{ + struct timeval tp; + struct timezone tzp; + int err=gettimeofday(&tp, &tzp); + if (err) + { + return 0; + } + else + { + return ((long)1000)*(tp.tv_sec) + (tp.tv_usec / 1000); + } +} + +long get_sec(void) +{ + struct timeval tp; + struct timezone tzp; + int err=gettimeofday(&tp, &tzp); +if (err) + { + return 0; + } + else + { + return tp.tv_sec; + } +} + +/* returns the difference of the two usec time values */ + +long get_duration(long val1, long val2) +{ + /* + return val2>=val1 ? val2-val1 : (val2+TIME_ROUND-val1); + */ + return val2>=val1 ? val2-val1 : ((LONG_MAX - val1) + (val2 - LONG_MIN) + 1); +} + +void beep(void) +{ + fprintf(stderr, "\007"); +} + +#ifndef FreeBSD +#include <malloc.h> +#endif +#include <sys/shm.h> + +void remove_shmem_id(int id) +{ + ACE_OS::shmctl (id, IPC_RMID, NULL); +#if 0 + /* weird also on some sunOs4 machines */ + /* weird, HPUX always report error on this operation */ + if (errno) + { + fprintf(stderr, "shmctl shm_id:%d to IPC_RMID error:", id); + ACE_OS::perror (""); + } +#endif +} + +char * creat_shared_mem_id(int size, int * id) +{ + char * shm; + int shm_id; + + shm_id = ACE_OS::shmget (IPC_PRIVATE, size, IPC_CREAT | 0666); + if (shm_id == -1) + { + shm_id = ACE_OS::shmget (IPC_PRIVATE, 0, IPC_CREAT | 0666); + if (shm_id == -1) + { + ACE_OS::perror ("Shared MEM shmget1 error"); + ACE_OS::exit (1); + } + else + { + if (shmctl(shm_id, IPC_RMID, NULL) == -1) + { + ACE_OS::perror ("Shared MEM shmctl error"); + ACE_OS::exit (1); + } + shm_id = ACE_OS::shmget (IPC_PRIVATE, 0, IPC_CREAT | 0666); + if (shm_id == -1) + { + ACE_OS::perror ("Shared MEM shmget2 error"); + ACE_OS::exit (1); + } + } + } + shm = (char *)shmat(shm_id, (char *)0, 0); + if ((int)shm == -1) + { + ACE_OS::perror ("Shared MEM shmat error"); + ACE_OS::exit (1); + } + *id = shm_id; + return shm; +} + +char * creat_shared_mem(int size) +{ + int shm_id; + char * shm = creat_shared_mem_id(size, &shm_id); + remove_shmem_id(shm_id); + return shm; +} + +void remove_shared_mem(char *ptr) +{ + ACE_OS::shmdt (ptr); +} + +#define SEM_NUM 6 +static int semId = -1; +static int masterPid = -1; +static int nextSem = -1; + +void enter_cs(int semaphore_id) +{ + struct sembuf sop; + sop.sem_num = semaphore_id; + sop.sem_op = -1; + sop.sem_flg = 0; + while (ACE_OS::semop(semId, &sop, 1) == -1) + { + if (errno == EINTR) + continue; + fprintf(stderr, "semop(enter_cs) error: pid=%ld",ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::exit (1); + } +} + +void leave_cs(int semaphore_id) +{ + struct sembuf sop; + sop.sem_num = semaphore_id; + sop.sem_op = 1; + sop.sem_flg = 0; + while (ACE_OS::semop(semId, &sop, 1) == -1) + { + if (errno == EINTR) + continue; + fprintf(stderr, "semop(leave_cs) error, pid=%ld",ACE_OS::getpid ()); + ACE_OS::perror (""); + ACE_OS::exit (1); + } +} + +int creat_semaphore(void) +{ + int sem_val; + int semaphore_id; + if (semId == -1) { + semId = ACE_OS::semget (IPC_PRIVATE, SEM_NUM, IPC_CREAT | 0666); + if (semId == -1) { + ACE_OS::perror ("Semaphore semget error"); + ACE_OS::exit (1); + } + masterPid =ACE_OS::getpid (); + nextSem = 0; + } + else if (masterPid !=ACE_OS::getpid ()) { + fprintf(stderr, "Error: this creat_semaphore() assumes semaphores are allocated\n"); + fprintf(stderr, " only in single process %d, while current pid=%ld\n", + masterPid,ACE_OS::getpid ()); + ACE_OS::exit (1); + } + semaphore_id = nextSem ++; + if (semaphore_id >= SEM_NUM) { + fprintf(stderr, "Error: all of %d semaphores used up.\n", SEM_NUM); + ACE_OS::exit (1); + } + sem_val = ACE_OS::semctl (semId, semaphore_id, GETVAL, sem_union); +/* + fprintf(stderr, "Initial semaphore value: %d\n", sem_val); +*/ + if (sem_val == 0) + leave_cs(semaphore_id); + return semaphore_id; +} + +void delete_semaphore() +{ + if (masterPid ==ACE_OS::getpid () && semId >= 0) { + sem_union.val = 0; + ACE_OS::semctl (semId, 0, IPC_RMID, sem_union); + } else { + if (masterPid !=ACE_OS::getpid ()) + fprintf(stderr, "pid %ld not supposed to remove semId created by pid %d\n", + ACE_OS::getpid (), masterPid); + else + fprintf(stderr, "The semaphore has been deleted.\n"); + } + return; +} + +void remove_semaphore(int /* sid */) +{ + return; + // ACE_OS::semctl (semId, semaphore_id, IPC_RMID, 0); +} + +void remove_all_semaphores (void) +{ + sem_union.val = 0; + ACE_OS::semctl (semId,0, IPC_RMID, sem_union); + return; +} + +int get_semval(int sid) +{ + int val; + errno = 0; + sem_union.val = 0; + val = ACE_OS::semctl (semId, sid, GETVAL, sem_union); + if (val == -1) { + ACE_OS::perror ("getting value of a semaphore"); + ACE_OS::exit (1); + } + /* + if (val == 0) { + fprintf(stderr, "pid %ld to call ACE_OS::semctl (%d, 0, GETZCNT)\n",ACE_OS::getpid (), sid); + sem_union.val = 0; + val = ACE_OS::semctl (semId, 0, GETZCNT, 0); + if (val == -1) { + ACE_OS::perror ("getting semzcnt of a semaphore"); + ACE_OS::exit (1); + } + + fprintf(stderr, "pid %ld to call ACE_OS::semctl (%d, 0, GETNCNT)\n",ACE_OS::getpid (), sid); + usleep(10000000); + sem_union.val = 0; + val1 = ACE_OS::semctl (semId, sid, GETNCNT, sem_union); + if (val1 == -1) { + ACE_OS::perror ("getting semncnt of a semaphore"); + } + fprintf(stderr, "pid %ld to called ACE_OS::semctl (GETNCNT)\n",ACE_OS::getpid ()); + + fprintf(stderr, "Semval val %d, val1 %d\n", val, val1); + return (0-(val + val1)); + } + else + */ + return val; +} + +void get_full_path(char *filename, char * buffer, int bufsize) +{ + char path[MAXPATHLEN]; + + path[0] = 0; + + if (*filename == '/') + strncpy(path, filename, MAXPATHLEN); + else if (*filename == '~') + { + char * env = getenv("HOME"); + if (env != NULL) + { + strncpy(path, env, MAXPATHLEN); + strncat(path, filename+1, MAXPATHLEN -ACE_OS::strlen (path)); + } + else + strncpy(path, filename, MAXPATHLEN); + } + else /* from current dir */ + { + getcwd(path, MAXPATHLEN); + if (errno) + strncpy(path, filename, MAXPATHLEN); + else + { + path[MAXPATHLEN-4] = 0; + strcat(path, "/"); + strncat(path, filename, MAXPATHLEN -ACE_OS::strlen (path)); + } + } + path[MAXPATHLEN-1] = 0; + strncpy(buffer, path, bufsize); + buffer[bufsize-1] = 0; + /* + fprintf(stderr, "%s extended to %s\n", filename, buffer); + */ +} + +void setsignal(int sig, void (func)(int)) +{ +#ifdef _HPUX_SOURCE + struct sigvec sv; + + sv.sv_handler = func; + sv.sv_mask = 0; + sv.sv_flags = 0; + if (sigvector (sig, &sv, (struct sigvec *) NULL) == -1) { + fprintf(stderr, "sigvector(%d) error", sig); + ACE_OS::perror (""); + ACE_OS::exit (1); + } +#elif defined(__svr4__) || defined(IRIX) + if (sigset(sig, func) == SIG_ERR) { + fprintf(stderr, "sigset(%d,func) error", sig); + ACE_OS::perror (""); + ACE_OS::exit (1); + } +#elif defined(sun) || defined(FreeBSD) || defined(ULTRIX) || defined(__linux__) + { + struct sigaction act; + act.sa_handler = func; +#ifdef FreeBSD + act.sa_flags = SV_INTERRUPT; +#else + act.sa_flags =/* SA_INTERRUPT;*/ SA_RESTART; +#endif + // @@ Naga commented this line. + // act.sa_mask = 0; + if (!sigaction(sig, &act, NULL)) return; + fprintf(stderr, "sigaction(%d,...) error", sig); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + /* + if (signal(sig, func) == SIG_ERR) { + fprintf(stderr, "signal(%d,func) error", sig); + ACE_OS::perror (""); + ACE_OS::exit (1); + } + */ +#else + fprintf(stderr, + "Error: code for setsignal(%d,func) is missing in source/mpeg_shared/routine.cpp\n", + sig); + ACE_OS::exit (1); +#endif +} + +/* set to 'pri': 0 -lowest RT, higher value higher RT priority. -1 - Time Sharing. + For HPUX, 0 -> 127, 1 -> 127, ..., pri -> 127 - pri; + For Solaris, -> 0, 1 -> 1, pri -> pri; + + The function returns 0 on success, -1 on failure + */ +int SetRTpriority(char *msg, int pri) +{ + if (pri >= 0) { +#ifdef _HPUX_SOURCE + if (rtprio(0, 127 - pri) == -1) + { + fprintf(stderr, "%s fails to be set to RT priority %d", msg, 127 - pri); + ACE_OS::perror (""); + return -1; + } + return 0; +#elif defined(__svr4__) + pcinfo_t pci; + pcparms_t pcp; + rtparms_t * rtp = (rtparms_t *)pcp.pc_clparms; + strcpy(pci.pc_clname, "RT"); + if (priocntl(P_PID, P_MYID, PC_GETCID, (char *)&pci) == -1) { + fprintf(stderr, "%s priocntl(PC_GETCID) failed for RT pri %d", msg, pri); + ACE_OS::perror (""); + return -1; + } + pcp.pc_cid = pci.pc_cid; + rtp->rt_pri = pri; + rtp->rt_tqsecs = 0; + rtp->rt_tqnsecs = 10000000; /* 10 (ten) milliseconds */ + if (priocntl(P_PID, P_MYID, PC_SETPARMS, (char *)&pcp) == -1) { + fprintf(stderr, "%s priocntl(PC_SETPARMS) failed for RT pri %d", msg, pri); + ACE_OS::perror (""); + return -1; + } + return 0; +#else + fprintf(stderr, "%s warning: RT priority not available on this arch.\n", msg); + return -1; +#endif + } + else { /* set to TS priority */ +#ifdef _HPUX_SOURCE + if (rtprio(0, RTPRIO_RTOFF) == -1) { + fprintf(stderr, "%s fails to be set to RTPRIO_RTOFF", msg); + ACE_OS::perror (""); + return -1; + } + return 0; +#elif defined(__svr4__) + pcinfo_t pci; + pcparms_t pcp; + tsparms_t * tsp = (tsparms_t *)pcp.pc_clparms; + strcpy(pci.pc_clname, "TS"); + if (priocntl(P_PID, P_MYID, PC_GETCID, (char *)&pci) == -1) { + fprintf(stderr, "%s priocntl(PC_GETCID) failed for TS priority", msg); + ACE_OS::perror (""); + return -1; + } + pcp.pc_cid = pci.pc_cid; + tsp->ts_uprilim = 0; + tsp->ts_upri = 0; + if (priocntl(P_PID, P_MYID, PC_SETPARMS, (char *)&pcp) == -1) { + fprintf(stderr, "%s priocntl(PC_SETPARMS) failed for TS priority", msg); + ACE_OS::perror (""); + return -1; + } + return 0; +#endif + } +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h new file mode 100644 index 00000000000..3fc97ea524d --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h @@ -0,0 +1,55 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* routine.c */ +#ifndef _MPEG_ROUTINE_H +#define _MPEG_ROUTINE_H + +#include "include/common.h" + + + + +void beep(void); +int get_hostname(char *name, int len); +long get_usec(void); +long get_msec(void); +long get_sec(void); +long get_duration(long valstart, long valstop); +void remove_shmem_id(int id); +char * creat_shared_mem_id(int size, int * id); +char * creat_shared_mem(int size); +void remove_shared_mem(char *ptr); +void enter_cs(int semaphore_id); +void leave_cs(int semaphore_id); +int creat_semaphore(void); +void remove_semaphore(int sid); +void remove_all_semaphores (void); +int get_semval(int sid); +void get_full_path(char *filename, char * buffer, int bufsize); +void setsignal(int sig, void (func)(int)); +int SetRTpriority(char *msg, int pri); + +#endif /* _MPEG_ROUTINE_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.cpp new file mode 100644 index 00000000000..6a02d51f201 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.cpp @@ -0,0 +1,141 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" +#include <string.h> +#include "sendpt.h" + +ACE_RCSID(mpeg_shared, sendpt, "$Id$") + +/* parameters: + pat -- pattern + buf -- buffer for holding sendpattern computed; + len -- length of pattern and send pattern (number of frames); + f -- number of frames to send (represented by result send pattern); +*/ +void ComputeSendPattern(char * pat, char * buf, int len, int f) +{ + memset(buf, 0, len); + if (f >= len) + { + memset(buf, 1, len); + } + else if (f <= 1) + { + buf[0] = 1; + } + else + { + int i, is = 0, ps = 0, bs = 0; + + memset(buf, 1, len); + for (i = 0; i < len; i++) + { + if (pat[i] == 'I') + is ++; + else if (pat[i] == 'P') + ps ++; + else /* B frame */ + bs ++; + } + f = len - f; /* number of frames to drop */ + if (f < bs) /* drops only B frames */ + { + double scale = (double)bs / (double)f; + int ptr = 0, ptr1 = 0; + for (i = 0; i < len; i ++) + { + if (pat[i] == 'B') + { + if ( ptr == (int) ((double)ptr1 * scale + 0.5)) + { + buf[i] = 0; + ptr1 ++; + } + ptr ++; + } + } + goto endOfCompute; + } + + /* drop all B frames */ + for (i = 0; i < len; i ++) + if (pat[i] == 'B') + buf[i] = 0; + + if (f == bs) + goto endOfCompute; + + if (f > bs && f < bs + ps) /* drop also some P frames */ + { + int ptr = len - 1; + for (i = 0; i < is; i ++) + { + int j; + for (j = 0; j < (f - bs) / is; j ++) + { + while (pat[ptr] != 'P') ptr --; + buf[ptr] = 0; + ptr --; + } + while (pat[ptr] != 'I') ptr --; + } + ptr = len - 1; + for (i = 0; i < (f - bs) % is; i ++) + { + while (pat[ptr] != 'P' || buf[ptr] == 0) ptr --; + buf[ptr] = 0; + while (pat[ptr] != 'I') ptr --; + } + goto endOfCompute; + } + + /* drop all P frames */ + for (i = 0; i < len; i ++) + if (pat[i] == 'P') + buf[i] = 0; + + if (f > bs + ps) /* needs to drop some I frames */ + { + double scale = (double)is / (double)(f - bs - ps); + int ptr = 0, ptr1 = 0; + for (i = 0; i < len; i ++) + { + if (pat[i] == 'I') + { + if ( ptr == (int) ((double)ptr1 * scale + 0.5)) + { + buf[i] = 0; + ptr1 ++; + } + ptr ++; + } + } + goto endOfCompute; + } + } + endOfCompute:; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h new file mode 100644 index 00000000000..60935fae8ed --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h @@ -0,0 +1,39 @@ +/* $Id$ */ +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +/* parameters: + pat -- pattern + buf -- buffer for holding sendpattern computed; + len -- length of pattern and send pattern (number of frames); + f -- number of frames to send (represented by result send pattern); +*/ +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +void ComputeSendPattern(char * pat, char * buf, int len, int f); + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp new file mode 100644 index 00000000000..0394c3b5a1f --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.cpp @@ -0,0 +1,295 @@ +// $Id$ + +#include "Machine_Properties.h" + +#define RSTAT_CPUSTATES 4 +#define RSTAT_DK_NDRIVE 4 + + +ACE_RCSID(server, Machine_Properties, "$Id$") + +const int TAO_Machine_Properties::NUM_PROPERTIES = 10; + +const int DEFAULT_TIMEOUT_SEC = 1; +const int DEFAULT_TIMEOUT_USEC = 0; + +const char* TAO_Machine_Properties::PROP_NAMES[] = +{ + "CPU", + "Disk", + "Pages", + "Swaps", + "Packets", + "Errors", + "Context_Switches", + "Collisions", + "Interrupts", + "Load" +}; + +// XXX:hack to avoid CC errors. +// Redefine xdr_void. Always return true. +int xdr_void (XDR *,void *) +{ + return 1; +} + + +TAO_Machine_Properties::TAO_Machine_Properties (void) + : timeout_ (ACE_Time_Value (DEFAULT_TIMEOUT_SEC, DEFAULT_TIMEOUT_USEC)), + timestamp_ (0), + sample_time_ (0) +{ + this->init (); +} + + +TAO_Machine_Properties:: +TAO_Machine_Properties (const ACE_Time_Value& timeout) + : timeout_ (timeout), + timestamp_ (0), + sample_time_ (0) +{ + this->init (); +} + +void +TAO_Machine_Properties::init (void) +{ + /* + this->rstat_client_ = + ::clnt_create("localhost", RSTATPROG, RSTATVERS_TIME, "udp"); + + if (this->rstat_client_ == 0) + { + ACE_ERROR ((LM_ERROR, "(%P|%t) %s\n", + ::clnt_spcreateerror ("localhost"))); + } + + ::memset (&this->old_stats_, 0, sizeof (statstime)); + */ + this->retrieve_stats (); +} + +int +TAO_Machine_Properties::retrieve_stats (void) +{ + // initialize the handle everytime ?? + this->rstat_client_ = + ::clnt_create("localhost", RSTATPROG, RSTATVERS_TIME, "udp"); + + if (this->rstat_client_ == 0) + { + ACE_ERROR ((LM_ERROR, "(%P|%t) %s\n", + ::clnt_spcreateerror ("localhost"))); + } + + ::memset (&this->old_stats_, 0, sizeof (statstime)); + + // if (this->rstat_client_ == 0) + // return -1; + + static struct timeval timeout = {25, 0}; + u_int result; + if ((result =clnt_call (this->rstat_client_, + RSTATPROC_STATS, + (xdrproc_t) xdr_void (0,0), + 0, + (xdrproc_t) xdr_statstime, + (caddr_t) &this->stats_, + timeout)) != RPC_SUCCESS) + { + ACE_DEBUG ((LM_DEBUG,"rpc-error:%d\n",result)); + ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %s\n", + ::clnt_sperror (this->rstat_client_, "localhost")), -1); + } + else + ACE_DEBUG ((LM_DEBUG,"rpc client call worked\n")); + + this->sample_time_ = ACE_OS::gettimeofday () - this->timestamp_; + this->timestamp_ = ACE_OS::gettimeofday (); + return 0; +} + +CORBA::Any* +TAO_Machine_Properties::evalDP (const char* prop_name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& TAO_IN_ENV) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)) +{ + CORBA::Any* return_value; + + ACE_DEBUG ((LM_DEBUG, "Evaluating machine properties.\n")); + + ACE_NEW_RETURN (return_value, CORBA::Any, 0); + + if (ACE_OS::gettimeofday () - this->timestamp_ > this->timeout_) + { + if (this->retrieve_stats () == -1) + return return_value; + } + + CORBA::String_var prop_name_var (prop_name); + int elapsed_seconds = this->sample_time_.sec () + + (this->sample_time_.usec () > 500000) ? 1 : 0; + + if (ACE_OS::strcmp (prop_name, PROP_NAMES[CPU]) == 0) + this->compute_cpu (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[DISK]) == 0) + this->compute_disk (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[PAGES]) == 0) + this->compute_pages (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[SWAPS]) == 0) + this->compute_swaps (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[PACKETS]) == 0) + this->compute_packets (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[ERRORS]) == 0) + this->compute_errors (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[CONTEXT_SWITCHES]) == 0) + this->compute_context (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[COLLISIONS]) == 0) + this->compute_collisions (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[INTERRUPTS]) == 0) + this->compute_interrupts (*return_value, elapsed_seconds); + else if (ACE_OS::strcmp (prop_name, PROP_NAMES[LOAD]) == 0) + this->compute_load (*return_value, elapsed_seconds); + + ::memcpy (&this->old_stats_, &this->stats_, sizeof (statstime)); + + return return_value; +} + +void +TAO_Machine_Properties:: +export_properties (TAO_Property_Exporter& prop_exporter) +{ + ACE_DEBUG ((LM_ERROR, "Adding machine properties.\n")); + for (int i = 0; i < NUM_PROPERTIES; i++) + { + CORBA::Any extra_info; + const char* name = PROP_NAMES[i]; + const CORBA::TypeCode_ptr prop_type = CORBA::_tc_float; + + CosTradingDynamic::DynamicProp* dp_struct = + this->construct_dynamic_prop (name, prop_type, extra_info); + + prop_exporter.add_dynamic_property (name, dp_struct); + } +} + +int +TAO_Machine_Properties:: +define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset) const +{ + prop_seq.length (NUM_PROPERTIES + offset); + for (int j = prop_seq.length () - offset - 1, i = offset; j >= 0; j--, i++) + { + prop_seq[i].name = PROP_NAMES[i - offset]; + prop_seq[i].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_float); + prop_seq[i].mode = CosTradingRepos::ServiceTypeRepository::PROP_NORMAL; + } + + return NUM_PROPERTIES; +} + +void +TAO_Machine_Properties::compute_cpu (CORBA::Any& value, int elapsed_seconds) +{ + + // The first three cpu stats are for user, kernal, iowait + CORBA::Float used = 0.0; + for (int i = 0; i < RSTAT_CPUSTATES - 1; i++) + used += (this->stats_.cp_time[i] - this->old_stats_.cp_time[i]); + + // The last is the amount idle. + CORBA::ULong idle = + this->stats_.cp_time[RSTAT_CPUSTATES - 1] - + this->old_stats_.cp_time[RSTAT_CPUSTATES - 1]; + + // The CPU usage is the amount used over the total available. + value <<= (CORBA::Float) (((used) / (used + idle)) * 100.0); +} + +void +TAO_Machine_Properties::compute_disk (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float used = 0.0; + for (int i = 0; i < RSTAT_DK_NDRIVE; i++) + used += (this->stats_.dk_xfer[i] - this->old_stats_.dk_xfer[i]); + + value <<= (CORBA::Float)(used / (float) elapsed_seconds); +} + +void +TAO_Machine_Properties::compute_pages (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float pages = + (this->stats_.v_pgpgin - this->old_stats_.v_pgpgin) + + (this->stats_.v_pgpgout - this->old_stats_.v_pgpgout); + + value <<= (CORBA::Float) (pages / elapsed_seconds); +} + +void +TAO_Machine_Properties::compute_swaps (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float swaps = + (this->stats_.v_pswpin - this->old_stats_.v_pswpin) + + (this->stats_.v_pswpout - this->old_stats_.v_pswpout); + + value <<= (CORBA::Float) (swaps / elapsed_seconds); +} + +void +TAO_Machine_Properties::compute_packets (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float packets = + (this->stats_.if_ipackets - this->old_stats_.if_ipackets) + + (this->stats_.if_opackets - this->old_stats_.if_opackets); + + value <<= (CORBA::Float) (packets / elapsed_seconds); +} + +void +TAO_Machine_Properties::compute_errors (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float packets = + (this->stats_.if_ipackets - this->old_stats_.if_ipackets) + + (this->stats_.if_opackets - this->old_stats_.if_opackets); + + value <<= (CORBA::Float) (packets / elapsed_seconds); +} + +void +TAO_Machine_Properties:: +compute_context (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float switches = (this->stats_.v_swtch - this->old_stats_.v_swtch); + value <<= (CORBA::Float) (switches / elapsed_seconds); +} + +void +TAO_Machine_Properties:: +compute_collisions (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float cols = + (this->stats_.if_collisions - this->old_stats_.if_collisions); + value <<= (CORBA::Float) (cols / elapsed_seconds); +} + +void +TAO_Machine_Properties:: +compute_interrupts (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float intr = (this->stats_.v_intr - this->old_stats_.v_intr); + value <<= (CORBA::Float) (intr / elapsed_seconds); +} + +void +TAO_Machine_Properties::compute_load (CORBA::Any& value, int elapsed_seconds) +{ + CORBA::Float load = ((CORBA::Float) this->stats_.avenrun[0]) / FSCALE; + value <<= load; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h new file mode 100644 index 00000000000..b31e420ea90 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Machine_Properties.h @@ -0,0 +1,97 @@ +/* -*- C++ -*- */ + +// ============================================================================ +// $Id$ +// +// = FILENAME +// Machine_Properties.h +// +// = DESCRIPTION +// As a trading service dynamic property, retrieves machine +// statistics from the rstatd using Sun RPC. +// +// = AUTHORS +// Seth Widoff <sbw1@cs.wustl.edu> +// +// ============================================================================ + +#if (! defined TAO_MACHINE_PROPERTIES) +#define TAO_MACHINE_PROPERTIES + +#include "orbsvcs/Trader/Trader_Utils.h" +#include "Property_Exporter.h" + +//RPC related includes +#include <rpc/rpc.h> +#include <rpcsvc/rstat.h> + +class TAO_Machine_Properties : + public TAO_Dynamic_Property, + public TAO_Exportable +{ +public: + + enum PROP_TYPES + { + CPU, + DISK, + PAGES, + SWAPS, + PACKETS, + ERRORS, + CONTEXT_SWITCHES, + COLLISIONS, + INTERRUPTS, + LOAD + }; + + static const int NUM_PROPERTIES; + static const char* PROP_NAMES[]; + + TAO_Machine_Properties (void); + + TAO_Machine_Properties (const ACE_Time_Value& timeout); + + virtual CORBA::Any* evalDP (const char* name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& _env) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)); + // Return the value of a machine performance property whose name is + // contained in <extra_info>, which in essence is another + // demultiplexing key. + + virtual void export_properties (TAO_Property_Exporter& prop_exporter); + + virtual int define_properties + (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset = 0) const; + +private: + + void init (void); + + int retrieve_stats (void); + + void compute_cpu (CORBA::Any& value, int elapsed_time); + void compute_disk (CORBA::Any& value, int elapsed_time); + void compute_pages (CORBA::Any& value, int elapsed_time); + void compute_swaps (CORBA::Any& value, int elapsed_time); + void compute_packets (CORBA::Any& value, int elapsed_time); + void compute_errors (CORBA::Any& value, int elapsed_time); + void compute_context (CORBA::Any& value, int elapsed_time); + void compute_collisions (CORBA::Any& value, int elapsed_time); + void compute_interrupts (CORBA::Any& value, int elapsed_time); + void compute_load (CORBA::Any& value, int elapsed_time); + + const ACE_Time_Value timeout_; + ACE_Time_Value timestamp_; + ACE_Time_Value sample_time_; + + statstime stats_; + statstime old_stats_; + CLIENT* rstat_client_; + +}; + +#endif /* TAO_MACHINE_PROPERTIES */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile new file mode 100644 index 00000000000..38d67698a75 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile @@ -0,0 +1,3010 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +MAKEFILE = Makefile + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif + +AV_SERVER_OBJS = server.o +AV_AUGSERVER_OBJS = Video_RepositoryC.o augmented_server.o \ + Property_Exporter.o Machine_Properties.o \ + Video_Repository.o +AV_VS_OBJS = vs.o +AV_AS_OBJS = as.o +AV_VCRS_OBJS = vcrs.o + +# On non-Windows environment, we should at least define +# the export_include IDL flag. +override TAO_IDLFLAGS += -Ge 1\ + -I$(TAO_ROOT)/orbsvcs/orbsvcs + +IDL_FILES = Video_Repository +IDL_SRC = \ + $(addsuffix S.cpp, $(IDL_FILES)) \ + $(addsuffix C.cpp, $(IDL_FILES)) + +FILES = augmented_server server vs as \ + Property_Exporter Machine_Properties + +DEFS = $(addsuffix .h,$(FILES)) +LSRC = $(addsuffix .cpp,$(FILES)) $(IDL_SRC) + + +LDLIBS += -L$(ACE_ROOT)/ace -lmpeg_server -lmpeg_shared -lTAO_AV -lTAO_CosNaming -lTAO_CosProperty -lTAO_CosTrading -lTAO_PortableServer -lTAO -lrpcsvc + +MPEG_ROOT = $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source +CPPFLAGS += -I$(MPEG_ROOT) -I$(TAO_ROOT)/orbsvcs/orbsvcs -DTAO_ORBSVCS_HAS_Trader + +BIN2 = augmented_server server vs as vcrs + +#### If the TAO orbsvcs library wasn't built with sufficient components, +#### don't try to build here. +TAO_ORBSVCS := $(shell sh $(ACE_ROOT)/bin/ace_components --orbsvcs) +ifeq (AV,$(findstring AV,$(TAO_ORBSVCS))) + BIN = $(BIN2) +endif # AV + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#---------------------------------------------------------------------------- +# Local targets (and local hacks) +#---------------------------------------------------------------------------- + +CPPFLAGS += -DSH_MEM +CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/orbsvcs + +ifdef stat +CPPFLAGS += -DSTAT +endif + +server:$(addprefix $(VDIR),$(AV_SERVER_OBJS)) + $(LINK.cc) $(LDFAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +augmented_server:$(addprefix $(VDIR),$(AV_AUGSERVER_OBJS)) + $(LINK.cc) $(LDFAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +vs:$(addprefix $(VDIR),$(AV_VS_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +as:$(addprefix $(VDIR),$(AV_AS_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +vcrs:$(addprefix $(VDIR),$(AV_VCRS_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +.PRECIOUS: $(foreach file, $(IDL_FILES), $(foreach ext, $(IDL_EXT), $(file)$(ext)))) + +realclean: clean + -$(RM) $(foreach file, $(IDL_FILES), $(foreach ext, $(IDL_EXT), $(file)$(ext))) + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/augmented_server.o .obj/augmented_server.so .shobj/augmented_server.o .shobj/augmented_server.so: augmented_server.cpp augmented_server.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor_T.h \ + $(ACE_ROOT)/ace/Select_Reactor_Base.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor_Base.i \ + $(ACE_ROOT)/ace/Select_Reactor_T.cpp \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.cpp \ + $(ACE_ROOT)/ace/Select_Reactor_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/IOR_Multicast.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/svc_utils_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h \ + vs.h Property_Exporter.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader_Utils.h \ + Machine_Properties.h Video_Repository.h Video_RepositoryC.h \ + Video_RepositoryC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/MMDevice_ExporterS.i + +.obj/server.o .obj/server.so .shobj/server.o .shobj/server.so: server.cpp server.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor_T.h \ + $(ACE_ROOT)/ace/Select_Reactor_Base.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor_Base.i \ + $(ACE_ROOT)/ace/Select_Reactor_T.cpp \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.cpp \ + $(ACE_ROOT)/ace/Select_Reactor_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/IOR_Multicast.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/svc_utils_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h \ + vs.h + +.obj/vs.o .obj/vs.so .shobj/vs.o .shobj/vs.so: vs.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + vs.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor_T.h \ + $(ACE_ROOT)/ace/Select_Reactor_Base.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor_Base.i \ + $(ACE_ROOT)/ace/Select_Reactor_T.cpp \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.cpp \ + $(ACE_ROOT)/ace/Select_Reactor_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/IOR_Multicast.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/svc_utils_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i + +.obj/as.o .obj/as.so .shobj/as.o .shobj/as.so: as.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Server.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/include/common.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/fileio.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/routine.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/com.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/server_proto.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Globals.h \ + $(ACE_ROOT)/ace/SOCK_CODgram.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/SOCK_CODgram.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/sendpt.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Server.h \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ORB_Manager.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Video_ControlS.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_State.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Video_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i \ + $(ACE_ROOT)/ace/ATM_Addr.h \ + $(ACE_ROOT)/ace/ATM_Addr.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Process.h \ + $(ACE_ROOT)/ace/Process.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Process_Mutex.h \ + $(ACE_ROOT)/ace/Process_Mutex.inl \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/ace/Svc_Handler.cpp \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Connector.cpp \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.cpp \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AVStreamsS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/CosPropertyService_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/naming_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AV_Core.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp \ + $(TAO_ROOT)/tao/debug.h \ + $(ACE_ROOT)/ace/Process_Semaphore.h \ + $(ACE_ROOT)/ace/Process_Semaphore.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Null_MediaCtrlS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Transport.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/FlowSpec_Entry.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/AVStreams_i.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/AV/Flows_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlC.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.h \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS_T.cpp \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_shared/Audio_ControlS.i \ + as.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor_T.h \ + $(ACE_ROOT)/ace/Select_Reactor_Base.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor_Base.i \ + $(ACE_ROOT)/ace/Select_Reactor_T.cpp \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.cpp \ + $(ACE_ROOT)/ace/Select_Reactor_T.i \ + $(TAO_ROOT)/orbsvcs/tests/AVStreams/mpeg/source/mpeg_server/Audio_Control_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/IOR_Multicast.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/svc_utils_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Naming/Naming_Context_Interface.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i + +.obj/Property_Exporter.o .obj/Property_Exporter.so .shobj/Property_Exporter.o .shobj/Property_Exporter.so: Property_Exporter.cpp Property_Exporter.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(ACE_ROOT)/ace/pre.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader_Utils.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i + +.obj/Machine_Properties.o .obj/Machine_Properties.so .shobj/Machine_Properties.o .shobj/Machine_Properties.so: Machine_Properties.cpp Machine_Properties.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader_Utils.h \ + $(ACE_ROOT)/ace/pre.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Trader.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/Interpreter_Utils.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(TAO_ROOT)/tao/corba.h \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Trader/trading_export.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingReposS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS_T.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosTradingDynamicS.i \ + Property_Exporter.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Property/property_export.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosPropertyServiceC.i + +.obj/Video_RepositoryS.o .obj/Video_RepositoryS.so .shobj/Video_RepositoryS.o .shobj/Video_RepositoryS.so: Video_RepositoryS.cpp Video_RepositoryS.h \ + Video_RepositoryC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Video_RepositoryC.i \ + $(TAO_ROOT)/tao/PortableServer/PortableServer.h \ + $(TAO_ROOT)/tao/PortableServer/portableserver_export.h \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.h \ + $(TAO_ROOT)/tao/PortableServer/PortableServerC.i \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/PortableServer/RTPortableServerC.i \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.h \ + $(TAO_ROOT)/tao/Abstract_Servant_Base.h \ + $(TAO_ROOT)/tao/PortableServer/Servant_Base.i \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.h \ + $(TAO_ROOT)/tao/PortableServer/Collocated_Object.i \ + $(TAO_ROOT)/tao/PortableServer/ThruPOA_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/Direct_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.h \ + $(TAO_ROOT)/tao/PortableServer/ServerRequestInfo.inl \ + Video_RepositoryS_T.h Video_RepositoryS_T.i Video_RepositoryS_T.cpp \ + Video_RepositoryS.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.h \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/PortableServer/Key_Adapters.i \ + $(TAO_ROOT)/tao/PortableServer/poa_macros.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/PortableServer/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Object_Adapter.i \ + $(TAO_ROOT)/tao/PortableServer/Operation_Table.h \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Server_Request.h \ + $(TAO_ROOT)/tao/Tagged_Profile.h \ + $(TAO_ROOT)/tao/GIOPC.h \ + $(TAO_ROOT)/tao/GIOPC.i \ + $(TAO_ROOT)/tao/Tagged_Profile.i \ + $(TAO_ROOT)/tao/TAO_Server_Request.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +.obj/Video_RepositoryC.o .obj/Video_RepositoryC.so .shobj/Video_RepositoryC.o .shobj/Video_RepositoryC.so: Video_RepositoryC.cpp Video_RepositoryC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/svc_export.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Base.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Malloc_Allocator.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc_Allocator.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/CDR_Base.inl \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/varbase.h \ + $(TAO_ROOT)/tao/TAO_Export.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object_Proxy_Broker.h \ + $(TAO_ROOT)/tao/Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/LocalObject.h \ + $(TAO_ROOT)/tao/LocalObject.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/OctetSeqC.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/OctetSeqC.i \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/CORBA_String.h \ + $(TAO_ROOT)/tao/CORBA_String.inl \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/Encodable.h \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/BoundsC.h \ + $(TAO_ROOT)/tao/BoundsC.i \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/ClientRequestInfo.h \ + $(TAO_ROOT)/tao/PortableInterceptorC.h \ + $(TAO_ROOT)/tao/DynamicC.h \ + $(TAO_ROOT)/tao/DynamicC.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/Remote_Object_Proxy_Impl.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/PortableInterceptorC.i \ + $(TAO_ROOT)/tao/StringSeqC.h \ + $(TAO_ROOT)/tao/StringSeqC.i \ + $(TAO_ROOT)/tao/Service_Context.h \ + $(TAO_ROOT)/tao/Service_Context.inl \ + $(TAO_ROOT)/tao/ClientRequestInfo.inl \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/PortableInterceptor.h \ + $(TAO_ROOT)/tao/Interceptor_List.h \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(TAO_ROOT)/tao/Interceptor_List.inl \ + $(TAO_ROOT)/tao/PortableInterceptor.i \ + $(TAO_ROOT)/tao/BiDirPolicyC.h \ + $(TAO_ROOT)/tao/BiDirPolicyC.i \ + Video_RepositoryC.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/Profile.h \ + $(TAO_ROOT)/tao/Tagged_Components.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.h \ + $(TAO_ROOT)/tao/CONV_FRAMEC.i \ + $(TAO_ROOT)/tao/Tagged_Components.i \ + $(TAO_ROOT)/tao/GIOP_Message_State.h \ + $(TAO_ROOT)/tao/GIOP_Message_State.i \ + $(TAO_ROOT)/tao/Profile.i \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.h \ + $(TAO_ROOT)/tao/TAO_Singleton_Manager.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.h \ + $(TAO_ROOT)/tao/TAO_Singleton.inl \ + $(TAO_ROOT)/tao/TAO_Singleton.cpp \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(TAO_ROOT)/tao/Adapter.h \ + $(TAO_ROOT)/tao/Adapter.i \ + $(TAO_ROOT)/tao/PolicyFactory_Registry.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Test_and_Set.h \ + $(ACE_ROOT)/ace/Test_and_Set.i \ + $(ACE_ROOT)/ace/Test_and_Set.cpp \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Parser_Registry.h \ + $(TAO_ROOT)/tao/Parser_Registry.i \ + $(TAO_ROOT)/tao/Service_Callbacks.h \ + $(TAO_ROOT)/tao/Service_Callbacks.i \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.h \ + $(TAO_ROOT)/tao/Fault_Tolerance_Service.i \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(TAO_ROOT)/tao/Cache_Entries.h \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.h \ + $(TAO_ROOT)/tao/Endpoint.h \ + $(TAO_ROOT)/tao/Endpoint.i \ + $(TAO_ROOT)/tao/Transport_Descriptor_Interface.inl \ + $(TAO_ROOT)/tao/Cache_Entries.inl \ + $(TAO_ROOT)/tao/Transport_Cache_Manager.inl \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.h \ + $(TAO_ROOT)/tao/Cleanup_Func_Registry.inl \ + $(TAO_ROOT)/tao/Object_Ref_Table.h \ + $(TAO_ROOT)/tao/RT_Policy_i.h \ + $(TAO_ROOT)/tao/RTCORBAC.h \ + $(TAO_ROOT)/tao/RTCORBAC.i \ + $(TAO_ROOT)/tao/RT_Policy_i.i \ + $(TAO_ROOT)/tao/Protocols_Hooks.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Synch_Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/TAOC.h \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.h \ + $(TAO_ROOT)/tao/Priority_Mapping.h \ + $(TAO_ROOT)/tao/Priority_Mapping.i \ + $(TAO_ROOT)/tao/Priority_Mapping_Manager.i \ + $(TAO_ROOT)/tao/TAOC.i \ + $(TAO_ROOT)/tao/operation_details.h \ + $(TAO_ROOT)/tao/target_specification.h \ + $(TAO_ROOT)/tao/target_specification.i \ + $(TAO_ROOT)/tao/operation_details.i \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.h \ + $(TAO_ROOT)/tao/Invocation_Endpoint_Selectors.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/RequestInfo_Util.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am new file mode 100644 index 00000000000..1241d67df59 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Makefile.am @@ -0,0 +1,73 @@ +##--------------------------------------------------------------------------- +## $Id$ +## +## Makefile for TAO's AVStreams Tests -- mpeg/source/server directory +## +##--------------------------------------------------------------------------- + +## +## Process this file with automake to create Makefile.in +## + +## The number in AUTOMAKE_OPTIONS is the minimum required version automake +## needed to process this file. +AUTOMAKE_OPTIONS = 1.4 + +INCLUDES = -I$(top_builddir) -I$(top_srcdir) + +noinst_PROGRAMS = augmented_server server vs as + +augmented_server_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +augmented_server_SOURCES = \ + Video_RepositoryC.cpp \ + augmented_server.cpp \ + Property_Exporter.cpp \ + Machine_Properties.cpp \ + Video_Repository.cpp + +server_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +server_SOURCES = \ + server.cpp + +vs_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +vs_SOURCES = \ + vs.cpp + +as_LDADD = \ + $(top_builddir)/ace/libACE.la $(top_builddir)/TAO/tao/libTAO.la + +as_SOURCES = \ + as.cpp + +noinst_HEADERS = \ + Machine_Properties.h \ + Property_Exporter.h \ + Video_Repository.h \ + as.h \ + augmented_server.h \ + server.h \ + vs.h + +IDL_SOURCES = \ + Video_Repository.idl + +BUILT_SOURCES = \ + Video_RepositoryS.cpp + Video_RepositoryS.h + Video_RepositoryC.cpp + Video_RepositoryC.h + +EXTRA_DIST = $(IDL_SOURCES) + +## Clean up some additional files/directories possibly created during +## the configure script tests. +clean-local: + -rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core + -rm -rf ptrepository Templates.DB gcctemp.c gcctemp so_locations + diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp new file mode 100644 index 00000000000..fc8d534cb22 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.cpp @@ -0,0 +1,424 @@ +// $Id$ + +#include "Property_Exporter.h" + +ACE_RCSID(server, Property_Exporter, "$Id$") + +// ************************************************************* +// DP_Adapter +// ************************************************************* + +class DP_Adapter : public TAO_Dynamic_Property +// = TITLE +// This class links the a dynamic property in a Trading Service +// Offer with its value in a CosPropertyService::PropertySet. +{ +public: + + DP_Adapter (const char* prop_name, + CosPropertyService::PropertySet_ptr prop_set); + + ~DP_Adapter (void); + + virtual CORBA::Any* evalDP (const char* name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)); + // Call back to the Property Service interface. The Property + // Service reference is contained in the extra_info -- an + // Asynchronous Completion Token. + +private: + + const char* prop_name_; + CosPropertyService::PropertySet_var prop_set_; +}; + +DP_Adapter::DP_Adapter (const char* prop_name, + CosPropertyService::PropertySet_ptr prop_set) + : prop_name_ (prop_name), + prop_set_ (prop_set) +{ +} + +DP_Adapter::~DP_Adapter (void) +{ +} + +CORBA::Any* +DP_Adapter::evalDP (const char* name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)) +{ + ACE_TRY + { + CORBA::Any* return_value = + this->prop_set_->get_property_value (this->prop_name_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + return return_value; + } + ACE_CATCHANY + { + ACE_THROW_RETURN(CosTradingDynamic::DPEvalFailure + (this->prop_name_, returned_type, extra_info), 0); + } + ACE_ENDTRY; +} + +// ************************************************************* +// TAO_Property_Exporter +// ************************************************************* + +TAO_Property_Exporter:: +TAO_Property_Exporter (CosTrading::Lookup_var lookup_if, + CosPropertyService::PropertySet_ptr prop_set, + CORBA::ULong initial_size) + : increment_ (initial_size), + lookup_ (lookup_if), + prop_set_ (prop_set), + tprops_ (initial_size), + pprops_ (initial_size), + pcount_ (0), + tcount_ (0) +{ +} + +TAO_Property_Exporter::~TAO_Property_Exporter (void) +{ +} + +void +TAO_Property_Exporter::add_static_property (const char* name, + const CORBA::Any& value) +{ + CORBA::ULong plength = this->pprops_.length (), + tlength = this->tprops_.length (); + + if (tlength == this->tcount_) + this->tprops_.length (tlength + this->increment_); + + if (plength == this->pcount_) + this->pprops_.length (plength + this->increment_); + + // Add the value to the property service sequence. + this->tprops_[this->tcount_].name = name; + this->tprops_[this->tcount_].value = value; + this->tcount_++; + + // Add the value to the trading service sequence. + this->pprops_[this->pcount_].property_name = name; + this->pprops_[this->pcount_].property_value = value; + this->pcount_++; +} + + +void +TAO_Property_Exporter:: +add_dynamic_property (const char* name, + const CORBA::Any& value, + TAO_Dynamic_Property& dynamic_prop) +{ + // Add a property to the PropSet and a dynamic property to the + // Offer. Have the dynamic property connect to the PropSet accessor + // for that name. + DP_Adapter* dp_adapter; + ACE_NEW_RETURN (dp_adapter, DP_Adapter (name, this->prop_set_),); + + CORBA::ULong plength = this->pprops_.length (), + tlength = this->tprops_.length (); + + if (tlength == this->tcount_) + this->tprops_.length (tlength + this->increment_); + + if (plength == this->pcount_) + this->pprops_.length (plength + this->increment_); + + CORBA::Any extra_info; + + CosTradingDynamic::DynamicProp_var dp_struct = + dynamic_prop.construct_dynamic_prop (name, value.type (), extra_info); + + // Copy the dynamic property struct into the property value + this->tprops_[this->tcount_].name = name; + this->tprops_[this->tcount_].value <<= dp_struct.in (); + this->tcount_++; + + this->pprops_[this->pcount_].property_name = name; + this->pprops_[this->pcount_].property_value = value; + this->pcount_++; +} + +void +TAO_Property_Exporter:: +add_dynamic_property (const char* name, + CosTradingDynamic::DynamicProp& dp_struct) +{ + CORBA::ULong tlength = this->tprops_.length (); + + if (tlength == this->tcount_) + this->tprops_.length (tlength + this->increment_); + + this->tprops_[this->tcount_].name = name; + this->tprops_[this->tcount_].value <<= dp_struct; + this->tcount_++; +} + +void +TAO_Property_Exporter:: +add_dynamic_property (const char* name, + CosTradingDynamic::DynamicProp* dp_struct) +{ + CORBA::ULong tlength = this->tprops_.length (); + + if (tlength == this->tcount_) + this->tprops_.length (tlength + this->increment_); + + this->tprops_[this->tcount_].name = name; + this->tprops_[this->tcount_].value <<= dp_struct; + this->tcount_++; +} + + +CosTrading::OfferId +TAO_Property_Exporter::_cxx_export (const CORBA::Object_ptr object_ref, + const CosTrading::ServiceTypeName type, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::Register::InvalidObjectRef, + CosTrading::IllegalServiceType, + CosTrading::UnknownServiceType, + CosTrading::Register::InterfaceTypeMismatch, + CosTrading::IllegalPropertyName, + CosTrading::PropertyTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::MissingMandatoryProperty, + CosTrading::DuplicatePropertyName)) +{ + CosTrading::Register_var reg = this->lookup_->register_if (ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // Export the offer to the trader under the given type. + CosTrading::OfferId offer_id = 0; + this->tprops_.length (this->tcount_); + offer_id = reg->_cxx_export (object_ref, type, this->tprops_, ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + this->pprops_.length (this->pcount_); + this->prop_set_->define_properties (this->pprops_, ACE_TRY_ENV); + ACE_CHECK_RETURN (offer_id); + + return offer_id; +} + +CosTrading::OfferId +TAO_Property_Exporter::_cxx_export (const CORBA::Object_ptr object_ref, + const CosTrading::ServiceTypeName type, + const TRADING_REPOS::PropStructSeq& props, + const TRADING_REPOS::ServiceTypeNameSeq& stypes, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::IllegalServiceType, + TRADING_REPOS::ServiceTypeExists, + TRADING_REPOS::InterfaceTypeMismatch, + CosTrading::IllegalPropertyName, + CosTrading::DuplicatePropertyName, + TRADING_REPOS::ValueTypeRedefinition, + TRADING_REPOS::DuplicateServiceTypeName, + CosTrading::Register::InvalidObjectRef, + CosTrading::Register::InterfaceTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::MissingMandatoryProperty, + CosTrading::DuplicatePropertyName)) +{ + CosTrading::Register_var reg; + CosTrading::OfferId offer_id = 0; + + ACE_TRY + { + reg = this->lookup_->register_if (ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->pprops_.length (this->pcount_); + this->prop_set_->define_properties (this->pprops_, ACE_TRY_ENV); + ACE_TRY_CHECK; + + + + /***************** UTTER HACK: REMOVE WHEN EXCEPTIONS WORK! **** + CosTrading::TypeRepository_ptr obj = this->lookup_->type_repos (_env); + + ACE_DEBUG ((LM_DEBUG, "Attempting add_type.\n")); + CosTradingRepos::ServiceTypeRepository_var str = + + CosTradingRepos::ServiceTypeRepository::_narrow (obj, _env); + ACE_CHECK_RETURN (0); + + str->add_type (type, + + object_ref->_interface_repository_id (), + props, + stypes, + + _env); + ACE_CHECK_RETURN (0); + ***************** UTTER HACK: REMOVE WHEN EXCEPTIONS WORK! ****/ + + + // Attempt to export the offer. + ACE_DEBUG ((LM_DEBUG, "Attempting export.\n")); + this->tprops_.length (this->tcount_); + offer_id = reg->_cxx_export (object_ref, + type, + this->tprops_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCH (CosTrading::UnknownServiceType, excp) + { + + + cout<<"Within the UnknownServiceType exception"<<endl; + CosTrading::TypeRepository_ptr obj = this->lookup_->type_repos (ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + ACE_DEBUG ((LM_DEBUG, "Export failed. Attempting add_type.\n")); + CosTradingRepos::ServiceTypeRepository_var str = + CosTradingRepos::ServiceTypeRepository::_narrow (obj, ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // If the ServiceTypeName wasn't found, we'll have to add the + // type to the Service Type repository ourselves. + str->add_type (type, + object_ref->_interface_repository_id (), + props, + stypes, + ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // Now we'll try again to register the offer. + ACE_DEBUG ((LM_DEBUG, "Attempting export again.\n")); + + this->tprops_.length (this->tcount_); + offer_id = reg->_cxx_export (object_ref, + type, + this->tprops_, + ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + cout<<"It reached here"<<endl; + + } + /* + ACE_CATCHANY + { + // Sigh, all our efforts were for naight. + ACE_RE_THROW; + } + */ + ACE_ENDTRY; + + return offer_id; +} + +// ************************************************************* +// TAO_Property_Modifier +// ************************************************************* + +TAO_Property_Modifier:: +TAO_Property_Modifier (CosTrading::Lookup_var lookup_if, + CosPropertyService::PropertySet_ptr prop_set, + CORBA::ULong initial_size) + : increment_ (initial_size), + lookup_ (lookup_if), + prop_set_ (prop_set), + pdelete_ (initial_size), + pmodify_ (initial_size), + tdelete_ (initial_size), + tmodify_ (initial_size), + pdcount_ (0), + pmcount_ (0), + tdcount_ (0), + tmcount_ (0) +{ +} + +void +TAO_Property_Modifier::delete_property (const char* name) +{ + CORBA::ULong plength = this->pdelete_.length (), + tlength = this->tdelete_.length (); + + if (tlength == this->tdcount_) + this->tdelete_.length (tlength + this->increment_); + + if (plength == this->pdcount_) + this->pdelete_.length (plength + this->increment_); + + this->tdelete_[this->tdcount_] = name; + this->tdcount_++; + + this->pdelete_[this->pdcount_] = name; + this->pdcount_++; +} + +void +TAO_Property_Modifier::modify_property (const char* name, const CORBA::Any& value) +{ + CORBA::ULong plength = this->pmodify_.length (), + tlength = this->tmodify_.length (); + + if (tlength == this->tmcount_) + this->tmodify_.length (tlength + this->increment_); + + if (plength == this->pmcount_) + this->pmodify_.length (plength + this->increment_); + + this->tmodify_[this->tmcount_].name = name; + this->tmodify_[this->tmcount_].value = value; + this->tdcount_++; + + this->pmodify_[this->pmcount_].property_name = name; + this->pmodify_[this->pmcount_].property_value = value; + this->pdcount_++; +} + +void +TAO_Property_Modifier::commit (CosTrading::OfferId id, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::NotImplemented, + CosTrading::IllegalOfferId, + CosTrading::UnknownOfferId, + CosTrading::Register::ProxyOfferId, + CosTrading::IllegalPropertyName, + CosTrading::Register::UnknownPropertyName, + CosTrading::PropertyTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::Register::MandatoryProperty, + CosTrading::Register::ReadonlyProperty, + CosTrading::DuplicatePropertyName)) +{ + this->tdelete_.length (this->tdcount_); + this->tmodify_.length (this->tmcount_); + this->pdelete_.length (this->pdcount_); + this->pmodify_.length (this->pmcount_); + + CosTrading::Register_var reg = this->lookup_->register_if (ACE_TRY_ENV); + ACE_CHECK; + + reg->modify (id, this->tdelete_, this->tmodify_, ACE_TRY_ENV); + ACE_CHECK; + + this->prop_set_->define_properties (this->pmodify_, ACE_TRY_ENV); + ACE_CHECK; + + this->prop_set_->delete_properties (this->pdelete_, ACE_TRY_ENV); + ACE_CHECK; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h new file mode 100644 index 00000000000..9802ae350fe --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Property_Exporter.h @@ -0,0 +1,211 @@ +/* -*- C++ -*- */ + +// ======================================================================== +// $Id$ +// +// = LIBRARY +// TAO/orbsvcs/orbsvcs +// +// = FILENAME +// Property_Exporter.h +// +// = DESCRIPTION +// Allows a service to export properties to both a Property Set and +// a Trading Service simulatenously. +// +// = AUTHORS +// Seth Widoff <sbw1@cs.wustl.edu> +// +// ======================================================================== + +#ifndef TAO_PROPERTY_EXPORTER_H +#define TAO_PROPERTY_EXPORTER_H + +#include "orbsvcs/CosTradingC.h" +#include "orbsvcs/CosPropertyServiceC.h" +#include "orbsvcs/Trader/Trader_Utils.h" + +class TAO_Property_Exporter; + +class TAO_Exportable +// = DESCRIPTION +// Interface that allows property containers to export their +// properties to a TAO_Property_Exporter instance. +{ +public: + + virtual void + export_properties (TAO_Property_Exporter& prop_exporter) {} + // Insert exportable properties into the proper_exporter. + + virtual int define_properties + (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset = 0) const = 0; + // Append property definitions to the service type defintition + // sequence. The <offset> is the point at which the method can begin + // placing the PropStructures. define_properties returns the number + // of properties inserted from the offset. +}; + + +class TAO_Property_Exporter +// = TITLE +// Publish public properties of a servant to a +// CosPropertyService::PropSet instance and a Trading Service +// offer. +// +// Use this class in the following way: +// 1. Instantiate. +// 2. for (int i = 0; i < num_properties; i++) add_*_property (); +// 3. export () +{ + public: + + TAO_Property_Exporter (CosTrading::Lookup_var lookup_if, + CosPropertyService::PropertySet_ptr prop_set, + CORBA::ULong initial_size = 10); + + + ~TAO_Property_Exporter (void); + // Delete all Dynamic Property adapters + + void add_static_property (const char* name, + const CORBA::Any& value); + // Add a property to the Offer and the PropSet. + + void add_dynamic_property (const char* name, + const CORBA::Any& intial_value, + TAO_Dynamic_Property& dp); + // Add a property to the PropSet and a dynamic property to the + // Offer. Have the dynamic property connect to the PropSet accessor + // for that name. + + void add_dynamic_property (const char* name, + CosTradingDynamic::DynamicProp& dp_struct); + + void add_dynamic_property (const char* name, + CosTradingDynamic::DynamicProp* dp_struct); + + CosTrading::OfferId _cxx_export (const CORBA::Object_ptr object_ref, + const CosTrading::ServiceTypeName type, + CORBA::Environment& _env) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::Register::InvalidObjectRef, + CosTrading::IllegalServiceType, + CosTrading::UnknownServiceType, + CosTrading::Register::InterfaceTypeMismatch, + CosTrading::IllegalPropertyName, + CosTrading::PropertyTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::MissingMandatoryProperty, + CosTrading::DuplicatePropertyName)); + // Export the offer to the trader under the given type. + + typedef CosTradingRepos::ServiceTypeRepository TRADING_REPOS; + CosTrading::OfferId _cxx_export (const CORBA::Object_ptr object_ref, + const CosTrading::ServiceTypeName type, + const TRADING_REPOS::PropStructSeq& props, + const TRADING_REPOS::ServiceTypeNameSeq& stypes, + CORBA::Environment& _env) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::IllegalServiceType, + TRADING_REPOS::ServiceTypeExists, + TRADING_REPOS::InterfaceTypeMismatch, + CosTrading::IllegalPropertyName, + CosTrading::DuplicatePropertyName, + TRADING_REPOS::ValueTypeRedefinition, + TRADING_REPOS::DuplicateServiceTypeName, + CosTrading::Register::InvalidObjectRef, + CosTrading::Register::InterfaceTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::MissingMandatoryProperty, + CosTrading::DuplicatePropertyName)); + // Export the offer to the trader under the given type. Register the + // type with the current definition if the type can't be found in + // the service type repository. + +private: + + TAO_Property_Exporter (const TAO_Property_Exporter&); + void operator= (const TAO_Property_Exporter&); + // These don't make sense on this class. + + const int increment_; + + CosTrading::Lookup_var lookup_; + CosPropertyService::PropertySet_var prop_set_; + + CORBA::ULong pcount_, tcount_; + CosTrading::PropertySeq tprops_; + CosPropertyService::Properties pprops_; +}; + +class TAO_Property_Modifier +// = TITLE +// Modify or delete properties published in a PropSet instance or as +// an offer in a Trading Service instance. +// +// = DESCRIPTION +// This interface is primarily for properties registered as static +// with the trading service, yet periodically change. The change +// isn't frequent enough to warrant the constant overhead of dynamic +// properties, which can affect the server performance. +{ +public: + + TAO_Property_Modifier (CosTrading::Lookup_var lookup_if, + CosPropertyService::PropertySet_ptr prop_set, + CORBA::ULong initial_size = 10); + + // If no Lookup Interface is provided to the constructor, then + // resolve_initial_references ("TradingService") will be used. + + void delete_property (const char* name); + // Remove a property from the current prop_set/offer. + + void modify_property (const char* name, const CORBA::Any& value); + // Modify a property from the current prop_set/offer. + + void commit (CosTrading::OfferId id, CORBA::Environment& _env) + ACE_THROW_SPEC ((CORBA::SystemException, + CosPropertyService::MultipleExceptions, + CosTrading::NotImplemented, + CosTrading::IllegalOfferId, + CosTrading::UnknownOfferId, + CosTrading::Register::ProxyOfferId, + CosTrading::IllegalPropertyName, + CosTrading::Register::UnknownPropertyName, + CosTrading::PropertyTypeMismatch, + CosTrading::ReadonlyDynamicProperty, + CosTrading::Register::MandatoryProperty, + CosTrading::Register::ReadonlyProperty, + CosTrading::DuplicatePropertyName)); + // Commit your changes to the trading service. + + private: + + const int increment_; + + int pdcount_; + int pmcount_; + + int tdcount_; + int tmcount_; + + CosTrading::Lookup_var lookup_; + CosPropertyService::PropertySet_var prop_set_; + + CosPropertyService::PropertyNames pdelete_; + CosPropertyService::Properties pmodify_; + + CosTrading::PropertyNameSeq tdelete_; + CosTrading::PropertySeq tmodify_; + + TAO_Property_Modifier (const TAO_Property_Modifier&); + void operator= (const TAO_Property_Modifier&); + // These don't make sense on this class. +}; + +#endif /* TAO_PROPERTY_EXPORTER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp new file mode 100644 index 00000000000..a1b7cc86e5c --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.cpp @@ -0,0 +1,159 @@ +// $Id$ + +#include "Video_Repository.h" +#include "ace/Read_Buffer.h" + +ACE_RCSID(server, Video_Repository, "$Id$") + + +const char* TAO_Video_Repository::MOVIE_INFO = "Movie_Info"; + +TAO_Video_Repository::TAO_Video_Repository (const char* file_name) + : filename_ (file_name), + movie_info_ (0), + num_movies_ (0), + lastchanged_ (0) +{ + cout<<"The movie file is "<<filename_<<endl; +} + +TAO_Video_Repository::~TAO_Video_Repository (void) +{ + TAO_VR::Movie_Info::freebuf (this->movie_info_); +} + +CORBA::Any* +TAO_Video_Repository::evalDP (const char* name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& TAO_IN_ENV) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)) +{ + ACE_DEBUG ((LM_DEBUG,"TAO_Video_Repository::evalDP:%s\n",name)); + CORBA::Any* return_value = 0; + ACE_NEW_RETURN (return_value, CORBA::Any, 0); + + struct stat file_stat; + if (ACE_OS::stat (this->filename_, &file_stat) == 0) + { + if (this->lastchanged_ < file_stat.st_mtime) + { + FILE* file = ACE_OS::fopen (this->filename_, "r"); + + if (file != 0) + { + // Read the file into a buffer + ACE_Read_Buffer read_file (file, 1); + char* database = read_file.read (EOF, '\n', '%'); + + // Parse the file into a sequence and insert it into an + // Any (i.e., this->return_) + TAO_Video_Repository::parse_file (database, + read_file.replaced ()); + + ACE_Allocator* alloc = ACE_Allocator::instance (); + alloc->free (database); + + this->lastchanged_ = file_stat.st_mtime; + } + else cout<<"The movie_database.txt file does not exist"<<endl; + } + + TAO_VR::Movie_Info* movie_info = 0; + ACE_NEW_RETURN (movie_info, + TAO_VR::Movie_Info (this->num_movies_, + this->num_movies_, + this->movie_info_, + 0), + 0); + + (*return_value) <<= movie_info; + } + else + { + ACE_DEBUG ((LM_DEBUG,"TAO_Video_Repository::evalDP::stat failed\n")); + } + + return return_value; +} + +void +TAO_Video_Repository::parse_file (const char* database, int num_lines) +{ + const char* delim = "%"; + CORBA::ULong i = 0; + CORBA::Any* return_value = 0; + char* current = (char *) database; + + ACE_DEBUG ((LM_DEBUG, "Recomputing the movie stats.\n")); + + TAO_VR::Movie_Info::freebuf (this->movie_info_); + + this->movie_info_ = TAO_VR::Movie_Info::allocbuf (num_lines); + + if (this->movie_info_ != 0) + { + current = ACE_OS::strtok (current, "%"); + while (current != 0) + { + TAO_VR::Movie& movie = this->movie_info_[i]; + + movie.name_ = (const char*) current; + movie.audio_filename_ = (const char*) ACE_OS::strtok (0, delim); + movie.video_filename_ = (const char*) ACE_OS::strtok (0, delim); + movie.description_ = (const char*) ACE_OS::strtok (0, delim); + + ACE_DEBUG ((LM_DEBUG, + "Movie Name: %s\nFile Name: %s\nDescription: %s\n", + (const char *) movie.name_, + (const char *) movie.audio_filename_, + (const char *) movie.video_filename_, + (const char *) movie.description_)); + + // From the actual movie file, extract the techincal information. + TAO_Video_Repository:: + obtain_movie_info (movie.audio_filename_, movie); + + TAO_Video_Repository:: + obtain_movie_info (movie.video_filename_, movie); + + + current = ACE_OS::strtok (0, delim); + i++; + } + } + + this->num_movies_ = num_lines; +} + +void +TAO_Video_Repository:: +export_properties (TAO_Property_Exporter& prop_exporter) +{ + CORBA::Any extra_info; + + extra_info <<= MOVIE_INFO; + CosTradingDynamic::DynamicProp* dp_struct = + this->construct_dynamic_prop (MOVIE_INFO, + TAO_VR::_tc_Movie_Info, + extra_info); + + prop_exporter.add_dynamic_property (MOVIE_INFO, dp_struct); +} + +int +TAO_Video_Repository:: +define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset) const +{ + CORBA::ULong num_props = prop_seq.length (); + + if (num_props <= offset) + prop_seq.length (offset + 1); + + prop_seq[offset].name = MOVIE_INFO; + prop_seq[offset].value_type = CORBA::TypeCode::_duplicate (TAO_VR::_tc_Movie_Info); + prop_seq[offset].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY; + + return 1; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h new file mode 100644 index 00000000000..a872608c694 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.h @@ -0,0 +1,90 @@ +/* -*- C++ -*- */ + +// ============================================================================ +// $Id$ +// +// +// = FILENAME +// Video_Repository.h +// +// = DESCRIPTION +// As a trading service dynamic property, creates a sequence of +// structures, each structure describing a movie in the video +// repository. +// +// = AUTHORS +// Seth Widoff <sbw1@cs.wustl.edu> +// +// ============================================================================ + +#if (! defined TAO_VIDEO_REPOSITORY_H) +#define TAO_VIDEO_REPOSITORY_H + +#include "orbsvcs/Trader/Trader_Utils.h" + +#include "ace/OS.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Video_RepositoryC.h" +#include "Property_Exporter.h" + +class TAO_Video_Repository : + public TAO_Dynamic_Property, + public TAO_Exportable +// = DESCRIPTION +// When evalDP is invoked by the Dynamic Property Dispatcher, the +// TAO_Video_Repository parses the database file and creates a Movie +// Sequence, each structure of which describes a movie in the +// database. The evalDP then crams the sequence into a dynamically +// allocated Any, which it returns to the dispatcher. +// +// The format of the database file is the following: +// +// <file name>%<Movie Name>%<URL for description> +{ +public: + + static const char* MOVIE_INFO; + + TAO_Video_Repository (const char* filename); + // TAO_Video_Repository requires the pathname of the video + // repository database. + + ~TAO_Video_Repository (void); + + virtual CORBA::Any* evalDP (const char* name, + CORBA::TypeCode_ptr returned_type, + const CORBA::Any& extra_info, + CORBA::Environment& _env) + ACE_THROW_SPEC ((CosTradingDynamic::DPEvalFailure)); + + virtual void export_properties (TAO_Property_Exporter& prop_exporter); + + virtual int define_properties + (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offet = 0) const; + +private: + + void parse_file (const char* database, int num_lines); + + static void obtain_movie_info (const char* file_name, + TAO_VR::Movie& movie) {} + // Extract the techincal information from the actual MPEG file. + + TAO_Video_Repository (void) {} + TAO_Video_Repository& operator= (const TAO_Video_Repository& rep) + { return *this; } + // TAO_Video_Repository requires the path of the video repository + // database. + + const char* filename_; + TAO_VR::Movie* movie_info_; + int num_movies_; + time_t lastchanged_; +}; + +#endif /* TAO_VIDEO_REPOSITORY_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl new file mode 100644 index 00000000000..e7e93b2b7df --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/Video_Repository.idl @@ -0,0 +1,32 @@ +// ============================================================================ +// $Id$ +// +// = FILENAME +// Video_Repository.idl +// +// = DESCRIPTION +// Data Structures used by the Video_Repository to describe movies in +// the Video Repository. +// +// = AUTHORS +// Seth Widoff <sbw1@cs.wustl.edu> +// +// ============================================================================ + +module TAO_VR +{ + struct Movie + { + string name_; + string audio_filename_; + string video_filename_; + string description_; + // string movie_format_; + // unsigned long filesize_; + // unsigned long duration_; + // unsigned long framerate_; + // unsigned long framesize_; + }; + + typedef sequence<Movie> Movie_Info; +}; diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp new file mode 100644 index 00000000000..4105e5d2e9e --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.cpp @@ -0,0 +1,80 @@ +// $Id$ + +#include "ace/OS.h" +#include "mpeg_server/Audio_Server.h" +#include "as.h" + +ACE_RCSID(server, as, "$Id$") + +int +Audio_Child_Process::init (int argc, + char **argv) +{ + if (TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint,TAO_VDev,Audio_Control_i>::init (argc,argv) == -1) + return -1; + + int max_pkt_size = -INET_SOCKET_BUFFER_SIZE; + AUDIO_GLOBAL::instance ()->serviceSocket = -1; + + AUDIO_GLOBAL::instance ()->conn_tag = max_pkt_size; + + if (max_pkt_size < 0) + max_pkt_size = -max_pkt_size; + else if (max_pkt_size == 0) + max_pkt_size = 1024 * 1024; + + AUDIO_GLOBAL::instance ()->start_time =ACE_OS::time (NULL); + + AUDIO_GLOBAL::instance ()->fbpara = (AudioFeedBackPara *)ACE_OS::malloc(FBBUF_SIZE); + if (AUDIO_GLOBAL::instance ()->fbpara == NULL) { + ACE_OS::perror ("AS failed to allocate mem for fbpara"); + return (-1); + } + + AUDIO_GLOBAL::instance ()->databuf_size = max_pkt_size - sizeof(AudioPacket); + if (AUDIO_GLOBAL::instance ()->databuf_size > DATABUF_SIZE) + AUDIO_GLOBAL::instance ()->databuf_size = DATABUF_SIZE; + + AUDIO_GLOBAL::instance ()->pktbuf = (AudioPacket *)ACE_OS::malloc(sizeof(AudioPacket) + + AUDIO_GLOBAL::instance ()->databuf_size); + if (AUDIO_GLOBAL::instance ()->pktbuf == NULL) { + ACE_OS::perror ("AS failed to allocate mem for pktbuf"); + return(-1); + } +} + +int +Audio_Child_Process::make_mediactrl (Audio_Control_i *& media_ctrl) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_Child_Process::make_mediactrl ()\n")); + media_ctrl = AUDIO_CONTROL_I::instance (); + return 0; +} + + +int +main (int argc,char **argv) +{ + Audio_Child_Process audio_child; + + + if (audio_child.init (argc,argv) == -1) + return 1; +// while (1) +// { + int result = audio_child.run () ; +// if (errno == EINTR) +// continue; +// else +// break; +// } + return 0; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class TAO_AV_Child_Process<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>; +template class TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate TAO_AV_Child_Process<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i> +#pragma instantiate TAO_AV_Child_Process_B<Audio_Server_StreamEndPoint, TAO_VDev, Audio_Control_i> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h new file mode 100644 index 00000000000..754917b3a75 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/as.h @@ -0,0 +1,59 @@ +/* $Id$ */ + +// ============================================================================ +// +// = LIBRARY +// as +// +// = FILENAME +// as.h +// +// = DESCRIPTION +// @@ Please add a synopsis of this file. +// +// = AUTHORS +// Sumedh Mungee (sumedh@cs.wustl.edu) +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#ifndef TAO_AV_AS_H +#define TAO_AV_AS_H + +#include "ace/Get_Opt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Acceptor.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/INET_Addr.h" +#include "ace/SOCK_CODgram.h" +#include "ace/Select_Reactor.h" + +#include "include/common.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "mpeg_server/Audio_Control_i.h" +#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h" + +#include "mpeg_server/Audio_Server.h" +#include "orbsvcs/AV/AVStreams_i.h" + +class Audio_Child_Process + :public TAO_AV_Child_Process_B <Audio_Server_StreamEndPoint,TAO_VDev,Audio_Control_i> +{ +public: + int init (int argc, + char **argv); + // init the Video Singleton. + + int make_mediactrl (Audio_Control_i *&media_ctrl); +}; + + +#endif /* TAO_AV_AS_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp new file mode 100644 index 00000000000..f5f9c63b582 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.cpp @@ -0,0 +1,757 @@ +// $Id$ + +#include "augmented_server.h" +#include "ace/Process.h" + +ACE_RCSID(server, augmented_server, "$Id$") + +int AV_Server::done_; +pid_t AV_Server::current_pid_ = -1; + +const char* MMDevice_Exporter_i::NUMBER_OF_CONNECTIONS = "Number_Of_Connections"; +const char* MMDevice_Exporter_i::MAX_CONNECTIONS = "Max_Connections"; +const char* MMDevice_Exporter_i::SERVER_NAME = "Server_Name"; + +MMDevice_Exporter_i::MMDevice_Exporter_i () + : audio_mmdevice_ (0), + video_mmdevice_ (0), + connections_ (0), + max_connections_ (10) +{ +} + +CORBA::ULong +MMDevice_Exporter_i::connections (void) const +{ + return this->connections_; +} + +// CORBA::Object_ptr +// MMDevice_Exporter_i:: +// audio_mmdevice_reference_ (CORBA_Environment &ACE_TRY_ENV) +// { +// return this->audio_mmdevice_; +// } + +// CORBA::Object_ptr +// MMDevice_Exporter_i:: +// video_mmdevice_reference_ (CORBA_Environment &ACE_TRY_ENV) +// { +// return this->video_mmdevice_; +// } + + CORBA::Object_ptr +MMDevice_Exporter_i::get_audio_mmdevice (CORBA_Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return CORBA::Object::_duplicate (this->audio_mmdevice_); +} + +CORBA::Object_ptr +MMDevice_Exporter_i::get_video_mmdevice (CORBA_Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( CORBA::SystemException )) +{ + return CORBA::Object::_duplicate (this->video_mmdevice_); +} + +void +MMDevice_Exporter_i:: +export_properties (TAO_Property_Exporter& prop_exporter) +{ + CORBA::Any connections, max_connections, server_name; + + connections <<= (CORBA::ULong) this->connections_; + prop_exporter.add_static_property (NUMBER_OF_CONNECTIONS, connections); + + max_connections <<= (CORBA::ULong) this->max_connections_; + prop_exporter.add_static_property (MAX_CONNECTIONS, max_connections); + + char* hostname = ACE_OS::getenv ("HOST"); + server_name <<= hostname; + prop_exporter.add_static_property (SERVER_NAME, server_name); +} + +int +MMDevice_Exporter_i:: +define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset) const +{ + CORBA::ULong num_props = prop_seq.length (); + + if (num_props <= offset + 2) + prop_seq.length (offset + 3); + + prop_seq[offset].name = NUMBER_OF_CONNECTIONS; + prop_seq[offset].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong); + prop_seq[offset].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY; + prop_seq[offset + 1].name = MAX_CONNECTIONS; + prop_seq[offset + 1].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_ulong); + prop_seq[offset + 1].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY; + prop_seq[offset + 2].name = SERVER_NAME; + prop_seq[offset + 2].value_type = CORBA::TypeCode::_duplicate (CORBA::_tc_string); + prop_seq[offset + 2].mode = CosTradingRepos::ServiceTypeRepository::PROP_MANDATORY_READONLY; + + return 3; +} + +AV_Audio_MMDevice:: +AV_Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy) + :TAO_MMDevice (endpoint_strategy) + +{ +} + +AVStreams::StreamEndPoint_B_ptr +AV_Audio_MMDevice:: +create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) + ACE_THROW_SPEC (( + CORBA::SystemException, + AVStreams::streamOpFailed, + AVStreams::streamOpDenied, + AVStreams::notSupported, + AVStreams::QoSRequestFailed, + AVStreams::noSuchFlow + )) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_MMDevice::create_B called \n")); + AVStreams::StreamEndPoint_B_ptr stream_ptr; + stream_ptr = TAO_MMDevice::create_B (the_requester, + the_vdev, + the_qos, + met_qos, + named_vdev, + the_spec, + env); + + /* NOT CLEAR ABOUT THIS + if (stream_ptr != 0) + this->connections_; + */ + return stream_ptr; + +} + + +AV_Video_MMDevice:: +AV_Video_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy) + :TAO_MMDevice (endpoint_strategy) + +{ +} + +AVStreams::StreamEndPoint_B_ptr +AV_Video_MMDevice:: +create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) + ACE_THROW_SPEC (( + CORBA::SystemException, + AVStreams::streamOpFailed, + AVStreams::streamOpDenied, + AVStreams::notSupported, + AVStreams::QoSRequestFailed, + AVStreams::noSuchFlow + )) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_MMDevice::create_B called \n")); + AVStreams::StreamEndPoint_B_ptr stream_ptr; + stream_ptr = TAO_MMDevice::create_B (the_requester, + the_vdev, + the_qos, + met_qos, + named_vdev, + the_spec, + env); + /*NEED TO CHECK THIS + if (stream_ptr != 0) + this->connections_; + */ + return stream_ptr; +} + + +// AV_Server_Sig_Handler routines +AV_Server_Sig_Handler::AV_Server_Sig_Handler (const AV_Server& av_server) + : av_server_ (av_server) +{ +} + +int +AV_Server_Sig_Handler::register_handler (void) +{ + // Assign the Sig_Handler a dummy I/O descriptor. Note that even + // though we open this file "Write Only" we still need to use the + // ACE_Event_Handler::NULL_MASK when registering this with the + // ACE_Reactor (see below). + this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); + ACE_ASSERT (this->handle_ != -1); + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) sig_handler == %d\n",this->handle_)); + + // Register signal handler object. Note that NULL_MASK is used to + // keep the ACE_Reactor from calling us back on the "/dev/null" + // descriptor. + + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this, ACE_Event_Handler::NULL_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + + // handles these signals. + // this->sig_set.fill_set (); + this->sig_set.sig_add (SIGCHLD); + // this->sig_set.sig_add (SIGBUS); + this->sig_set.sig_add (SIGINT); + this->sig_set.sig_add (SIGTERM); + + // Register the signal handler object to catch the signals. if + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this->sig_set, this) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + return 0; +} + +// Called by the ACE_Reactor to extract the fd. +ACE_HANDLE +AV_Server_Sig_Handler::get_handle (void) const +{ + return this->handle_; +} + +int +AV_Server_Sig_Handler::handle_input (ACE_HANDLE) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n")); + return 0; +} + +int +AV_Server_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n")); + return 0; +} + +// This method handles all the signals that are being caught by this +// object. + +int +AV_Server_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) +{ + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum)); + + switch (signum) + { + case SIGCHLD: + // Handle the death of child signal. + this->clear_child (SIGCHLD); + break; + // case SIGBUS: + // Handle the Bus error signal + // exit (2); + case SIGINT: + // Handle the interrupt signal + case SIGTERM: + // Handle the process termination signal. + this->int_handler (signum); + break; + default: + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) %S: not handled, returning to program\n", signum)); + break; + } + return 0; +} + +// SIGCHLD handler +void +AV_Server_Sig_Handler::clear_child (int sig) +{ + int pid; + int status; + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) AV_Server: Reaping the children\n")); + // reap the children + while ((pid = ACE_OS::waitpid (-1, + &status, + WNOHANG)) > 0) + { + if (pid == AV_Server::current_pid_) + { + cerr << "The child currently being waited for has died\n"; + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) The child currently being waited for has died.\n")); + AV_Server::done_ = 1; + } + + // decrement the count of number of active children + Mpeg_Global::session_num --; + + if (status == 0) + continue; + + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) AV_Server: child %d (status %d)\n", pid, status)); + } + return; +} + +int +AV_Server_Sig_Handler::remove_names (void) +{ + ACE_TRY_NEW_ENV + { + /* + CORBA::Object_var naming_obj = TAO_ORB_Core_instance ()->orb ()->resolve_initial_references ("NameService", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (naming_obj.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to resolve the Name Service.\n"), + -1); + + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (naming_obj.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Unregister the video_mmdevice with the naming service. + + CosNaming::Name video_server_mmdevice_name (1); + video_server_mmdevice_name.length (1); + video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice"); + + // Register the video control object with the naming server. + naming_context->unbind (video_server_mmdevice_name, + ACE_TRY_ENV); + // Unregister the audio_mmdevice with the naming service. + + CosNaming::Name audio_server_mmdevice_name (1); + audio_server_mmdevice_name.length (1); + audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice"); + + // Register the audio control object with the naming server. + naming_context->unbind (audio_server_mmdevice_name, + ACE_TRY_ENV); + */ + this->av_server_.shutdown (); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "AV_Server_Sig_Handler::remove_names ()"); + return -1; + } + ACE_ENDTRY; + return 0; +} + +// ctrl-c, Bus error, interrupt sig handler +void +AV_Server_Sig_Handler::int_handler (int sig) +{ + // unbind the names from the naming service. + + this->remove_names (); + TAO_ORB_Core_instance ()->orb ()->shutdown (); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV server killed by signal %d\n", + sig)); +} + +AV_Server_Sig_Handler::~AV_Server_Sig_Handler (void) +{ + TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set); +} + +// AV_Server routines + +const char* AV_Server::MMDEVICE_SERVICE_TYPE = "MMDevice"; + + +// Default Constructor +AV_Server::AV_Server (void) + : video_rep_ ("movie_database.txt"), + signal_handler_ (*this), + video_process_strategy_ (&video_process_options_), + audio_process_strategy_ (&audio_process_options_) +{ + this->video_process_options_.command_line ("./vs -ORBobjrefstyle url"); + this->audio_process_options_.command_line ("./as -ORBobjrefstyle url"); +} + +// %% move to the destructor or sig handler +void +AV_Server::on_exit_routine (void) +{ + // %% what does the following do + if (Mpeg_Global::parentpid != ACE_OS::getpid ()) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Process is exiting\n")); + return; + } + + // %% what does the following do + if (Mpeg_Global::live_audio > 1) + ExitLiveAudio (); + if (Mpeg_Global::live_video > 1) + ExitLiveVideo (); + // ComCloseServer(); + + // Remove the elements from the Naming service. +} + + +// Parses the command line arguments +int +AV_Server::parse_args (int argc, + char **argv) +{ + ACE_Get_Opt get_opts (argc, argv, "rd:s:vamh"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'r': // real time flag + Mpeg_Global::rttag = 1; + break; + case 'd': // clock drift in ppm + Mpeg_Global::drift_ppm = ACE_OS::atoi (get_opts.optarg); + break; + case 's':// limit on number of sessions + Mpeg_Global::session_limit = ACE_OS::atoi (get_opts.optarg); + break; + case 'v':// live video flag + Mpeg_Global::live_video = 1; + break; + case 'a':// live audio flag + Mpeg_Global::live_audio = 1; + break; + case '?': + case 'h':// help flag + ACE_DEBUG ((LM_DEBUG, + "Usage: %s [-r ] [-m]\n" + " [-d#int(clock drift in ppm)]\n" + " [-s#int(limit on number of sessions)]\n" + " [-v] [-a] [-?] [-h]", + argv [0])); + return -1; + } + return 0; +} + + +// Initializes the mpeg server +int +AV_Server::init (int argc, + char **argv, + CORBA::Environment& ACE_TRY_ENV) +{ + int result; + + // Initialize the orb_manager + this->orb_manager_.init_child_poa (argc, + argv, + "child_poa", + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + CORBA::ORB_var orb = + this->orb_manager_.orb (); + + PortableServer::POA_var child_poa = + this->orb_manager_.child_poa (); + + result = this->parse_args (argc, argv); + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Error parsing arguments"), + -1); + + // Resolve the Naming service reference. + /* + CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (naming_obj.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to resolve the Name Service.\n"), + -1); + + this->naming_context_ = + CosNaming::NamingContext::_narrow (naming_obj.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + */ + + + ACE_NEW_RETURN (this->video_mmdevice_, + AV_Video_MMDevice (&this->video_process_strategy_), + -1); + + // Register the video mmdevice object with the ORB + this->orb_manager_.activate_under_child_poa ("Video_Server_MMDevice", + this->video_mmdevice_, + ACE_TRY_ENV); + // CORBA::String_var server_ior = this->orb_manager_.orb ()->object_to_string (mmdevice_reference, + // ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + /* + // Register the video_mmdevice with the naming service. + CosNaming::Name video_server_mmdevice_name (1); + video_server_mmdevice_name.length (1); + video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice"); + + // Register the video control object with the naming server. + this->naming_context_->bind (video_server_mmdevice_name, + this->video_mmdevice_->_this (env), + ACE_TRY_ENV); + + if (env.exception () != 0) + { + env.clear (); + this->naming_context_->rebind (video_server_mmdevice_name, + this->video_mmdevice_->_this (env), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + } + + */ + + ACE_NEW_RETURN (this->audio_mmdevice_, + AV_Audio_MMDevice (&this->audio_process_strategy_), + -1); + + // Register the audio mmdevice object with the ORB + this->orb_manager_.activate_under_child_poa ("Audio_Server_MMDevice", + this->audio_mmdevice_, + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + + CORBA::Object_ptr audio_object_ptr = this->audio_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + CORBA::Object_ptr video_object_ptr = this->video_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + ACE_NEW_RETURN (this->mmdevice_exporter_, + MMDevice_Exporter_i (), + -1); + + this->mmdevice_exporter_->audio_mmdevice_ = audio_object_ptr; + this->mmdevice_exporter_->video_mmdevice_ = video_object_ptr; + + // Register the audio mmdevice object with the ORB + this->orb_manager_.activate_under_child_poa ("MMDevice_Exporter", + this->mmdevice_exporter_, + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + /* + // Register the audio_mmdevice with the naming service. + + CosNaming::Name audio_server_mmdevice_name (1); + audio_server_mmdevice_name.length (1); + audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice"); + + // Register the audio control object with the naming server. + this->naming_context_->bind (audio_server_mmdevice_name, + this->audio_mmdevice_->_this (env), + ACE_TRY_ENV); + + if (env.exception () != 0) + { + env.clear (); + this->naming_context_->rebind (audio_server_mmdevice_name, + this->audio_mmdevice_->_this (env), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + } + + */ + // Invoke this once, passing in an object for each trading service + // service type. + + + result + = this->resolve_trader (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + if (result != -1) + { + // Invoke this for each offer. + this->export_properties (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + } + + // Register the various signal handlers with the reactor. + result = this->signal_handler_.register_handler (); + + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Error registering signal handler"), + -1); + + ::atexit (on_exit_routine); + return 0; +} + +// Runs the mpeg server +int +AV_Server::run (CORBA::Environment& ACE_TRY_ENV){ + int result; + // Run the ORB event loop + this->orb_manager_.run (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV_Server::run () " + "came out of the (ORB) " + "event loop %p\n", + "run_event_loop")); + return 0; + +} + +void +AV_Server::export_properties (CORBA::Environment& ACE_TRY_ENV) +{ + CORBA::Object_ptr mmdevice_object_ptr = this->mmdevice_exporter_->_this (ACE_TRY_ENV); + ACE_CHECK; + + CosPropertyService::PropertySet_ptr mmdevice_prop_set = + CosPropertyService::PropertySet::_narrow (mmdevice_object_ptr, ACE_TRY_ENV); + ACE_CHECK; + + // Instantiate the property exporter helper class. + TAO_Property_Exporter mmdevice_prop_exporter (this->trader_, mmdevice_prop_set); + + // Add properties to server description. + this->mmdevice_exporter_->export_properties (mmdevice_prop_exporter); + this->mach_props_.export_properties (mmdevice_prop_exporter); + this->video_rep_.export_properties (mmdevice_prop_exporter); + + CosTradingRepos::ServiceTypeRepository::ServiceTypeNameSeq mmdevice_super_types; + this->mmdevice_offer_id_ = + mmdevice_prop_exporter._cxx_export (mmdevice_object_ptr, + (CosTrading::ServiceTypeName) MMDEVICE_SERVICE_TYPE, + this->prop_seq_, + mmdevice_super_types, + ACE_TRY_ENV); + ACE_CHECK; + + + +} + +int +AV_Server::resolve_trader (CORBA::Environment& ACE_TRY_ENV) +{ + if (this->trader_.ptr () == 0) + { + // Bootstrap to the Lookup interface. + ACE_DEBUG ((LM_ERROR, "Bootstrap to the Lookup interface.\n")); + CORBA::Object_var trading_obj = + this->orb_manager_.orb ()->resolve_initial_references ("TradingService", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (trading_obj.in ())) + { + ACE_ERROR ((LM_ERROR, + " (%P|%t) Unable to bootstrap to the Trading Service.\n")); + return -1; + } + + // Narrow the lookup interface. + ACE_DEBUG ((LM_DEBUG, "Narrowing the lookup interface.\n")); + this->trader_ = CosTrading::Lookup::_narrow (trading_obj.in (), ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + // Add property definitions to the service type. + CORBA::ULong offset = this->mmdevice_exporter_->define_properties (this->prop_seq_); + // ACE_TRY_CHECK_RETURN (ACE_TRY_ENV,-1); + offset += this->mach_props_.define_properties (this->prop_seq_, offset); + this->video_rep_.define_properties (this->prop_seq_, offset); + } + ACE_DEBUG ((LM_DEBUG,"Trader IOR: %s\n", + this->orb_manager_.orb ()->object_to_string (this->trader_.in (),ACE_TRY_ENV))); + +} + +AV_Server::~AV_Server (void) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV_Server: Removing handlers from the Reactor\n")); + + if (this->video_mmdevice_ != 0) + delete this->video_mmdevice_; + if (this->audio_mmdevice_ != 0) + delete this->audio_mmdevice_; + +} + +void +AV_Server::shutdown (void) const +{ + ACE_TRY_NEW_ENV + { + if (this->trader_.ptr () != 0) + { + CosTrading::Register_var reg = this->trader_->register_if (ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Withdrawing offer...\n")); + reg->withdraw (this->mmdevice_offer_id_.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + ACE_DEBUG ((LM_DEBUG, "Failed to withdraw offer.")); + } + ACE_ENDTRY; +} + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + int return_value = + AV_SERVER::instance ()->init (argc, argv, ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (return_value != -1) + { + AV_SERVER::instance ()->run (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<AV_Server,ACE_Null_Mutex>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<AV_Server,ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h new file mode 100644 index 00000000000..b6bb9d260b8 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/augmented_server.h @@ -0,0 +1,320 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// server +// +// = FILENAME +// server.h +// +// = DESCRIPTION +// This defines the Audio/Video Server using TAO'S Audio/Video streaming service. +// +// = AUTHORS +// Sumedh Mungee (sumedh@cs.wustl.edu) +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#ifndef TAO_AV_SERVER_H +#define TAO_AV_SERVER_H + +#include "ace/Get_Opt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Acceptor.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/INET_Addr.h" +#include "ace/SOCK_CODgram.h" +#include "ace/Select_Reactor.h" + +#include "include/common.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "mpeg_server/Video_Control_i.h" +#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h" + +#if defined (NATIVE_ATM) +#include "atmcom.h" +#endif /* NATIVE_ATM */ + +#include "mpeg_server/Video_Server.h" +#include "mpeg_server/Audio_Server.h" +#include "orbsvcs/AV/AVStreams_i.h" +#include "orbsvcs/AV/Endpoint_Strategy.h" +#include "vs.h" + +#include "Property_Exporter.h" +#include "Machine_Properties.h" +#include "Video_Repository.h" + +#include "mpeg_shared/MMDevice_ExporterS.h" + + + +class AV_Audio_MMDevice + : public TAO_MMDevice +{ +public: + + static const char* NUMBER_OF_CONNECTIONS; + static const char* MAX_CONNECTIONS; + static const char* SERVER_NAME; + + AV_Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy); + // Default constructor + + virtual AVStreams::StreamEndPoint_B_ptr + create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) + ACE_THROW_SPEC (( + CORBA::SystemException, + AVStreams::streamOpFailed, + AVStreams::streamOpDenied, + AVStreams::notSupported, + AVStreams::QoSRequestFailed, + AVStreams::noSuchFlow + )); + // Called by StreamCtrl to create a "B" type streamandpoint and vdev + + +}; + +class AV_Video_MMDevice + : public TAO_MMDevice//, + // public TAO_Exportable +{ +public: + + AV_Video_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy); + // Default constructor + + virtual AVStreams::StreamEndPoint_B_ptr + create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) + ACE_THROW_SPEC (( + CORBA::SystemException, + AVStreams::streamOpFailed, + AVStreams::streamOpDenied, + AVStreams::notSupported, + AVStreams::QoSRequestFailed, + AVStreams::noSuchFlow + )); + // Called by StreamCtrl to create a "B" type streamandpoint and vdev + + +}; + +class MMDevice_Exporter_i + : public POA_MMDevice_Exporter, + public TAO_Exportable, + public TAO_PropertySet +{ +public: + CORBA_Object_ptr audio_mmdevice_; + CORBA_Object_ptr video_mmdevice_; + + static const char* NUMBER_OF_CONNECTIONS; + static const char* MAX_CONNECTIONS; + static const char* SERVER_NAME; + + MMDevice_Exporter_i(); + + CORBA::ULong connections (void) const; + // Retrieve the number of connections. + + // virtual CORBA::Object_ptr audio_mmdevice_reference_ (CORBA_Environment &_env = CORBA_Environment::default_environment ()); + + // virtual CORBA::Object_ptr video_mmdevice_reference_ (CORBA_Environment &_env = CORBA_Environment::default_environment ()); + + virtual CORBA::Object_ptr get_audio_mmdevice (CORBA_Environment &_env = CORBA_Environment::default_environment ()) + ACE_THROW_SPEC (( CORBA::SystemException )) ; + + virtual CORBA::Object_ptr get_video_mmdevice (CORBA_Environment &_env = CORBA_Environment::default_environment ()) + ACE_THROW_SPEC (( CORBA::SystemException )) ; + + virtual void export_properties (TAO_Property_Exporter& prop_exporter); + + virtual int define_properties (CosTradingRepos::ServiceTypeRepository::PropStructSeq& prop_seq, + CORBA::ULong offset = 0) const; +private: + + CORBA::ULong connections_; + // Number of active connections + + CORBA::ULong max_connections_; + +}; + +class AV_Server; + +class AV_Server_Sig_Handler + : public virtual ACE_Event_Handler +{ +public: + AV_Server_Sig_Handler (const AV_Server& av_server); + + virtual ACE_HANDLE get_handle (void) const; + + int register_handler (void); + // this will register this sig_handler + // with the reactor for SIGCHLD,SIGTERM,SIGINT + + virtual int shutdown (ACE_HANDLE, + ACE_Reactor_Mask); + + virtual int handle_input (ACE_HANDLE); + // handle input on the dummy handle. + + virtual int handle_signal (ACE_HANDLE signum, + siginfo_t * = 0, + ucontext_t* = 0); + // handles the SIGCHLD,SIGTERM,SIGINT for the parent process i.e + // the main thread.. + + void int_handler (int sig); + // Signal handler function for SIGTERM,SIGBUS,SIGINT + + int remove_names (void); + // Removes the audio server mmdevice and video server mmdevice from the naming service. + + void clear_child (int sig); + // Signal handler function for SIGCHLD + + ~AV_Server_Sig_Handler (void); + // Destructor + +private: + const AV_Server& av_server_; + + ACE_HANDLE handle_; + // dummy handle for the sig handler. + ACE_Sig_Set sig_set; +}; + +class AV_Server +{ + // = TITLE + // Defines a class that abstracts the functionality of a + // video and audio server. + // + // = DESCRIPTION + // Using the class is as simple as calling init () first and then + // run. It uses an acceptor with the default ACE_Reactor::instance (). +public: + + static const char* MMDEVICE_SERVICE_TYPE; + + AV_Server (void); + // constructor + + int init (int argc, + char **argv, + CORBA::Environment& env); + // Initialize the AV_Server + + int run (CORBA::Environment& env); + // Run the AV_Server + + void shutdown (void) const; + + static void on_exit_routine (void); + // Routine called when this process exits. + + static pid_t current_pid_; + // %% the pid the server is currently waiting on + + static int done_; + // %% the done flag, set by the signal handler + + ~AV_Server (void); + // Destructor + //private: +private: + int parse_args (int argcs, + char **argv); + // Parse the arguments. + + void export_properties (CORBA::Environment& _env); + + int resolve_trader (CORBA::Environment& _env); + + TAO_ORB_Manager orb_manager_; + // the TAO ORB manager. + + TAO_Machine_Properties mach_props_; + // Dynamic properties concerning the server's performance. + + TAO_Video_Repository video_rep_; + // Dynamic property that assesses the contents of the sever's video + // repository. + + CosTrading::Lookup_var trader_; + // Reference to the Lookup interface of the trading service. + + // CosTrading::OfferId_var audio_offer_id_; + // Server offer id. + + CosTrading::OfferId_var mmdevice_offer_id_; + // Server offer id. + + CosTradingRepos::ServiceTypeRepository::PropStructSeq prop_seq_; + // Service type definition. + + CosNaming::NamingContext_var naming_context_; + // The root naming context of the naming service + + AV_Server_Sig_Handler signal_handler_; + // Signal handler for SIGCHLD,SIGINT,SIGTERM,SIGBUS + + ACE_INET_Addr server_control_addr_; + // Control (TCP) Address of this server. + + ACE_Process_Options video_process_options_; + // The process options for the process to be spawned by the process strategy + + TAO_AV_Endpoint_Process_Strategy_B video_process_strategy_; + // The proces strategy for the video. + + // TAO_MMDevice *video_mmdevice_; + // The video server multimedia device + + ACE_Process_Options audio_process_options_; + // The process options for the process to be spawned by the process strategy + + TAO_AV_Endpoint_Process_Strategy_B audio_process_strategy_; + // The proces strategy for the audio. + + // TAO_MMDevice *audio_mmdevice_; + AV_Audio_MMDevice *audio_mmdevice_; + // The audio server multimedia device + + AV_Video_MMDevice *video_mmdevice_; + // The video server multimedia device + + MMDevice_Exporter_i *mmdevice_exporter_; +}; + + + +typedef ACE_Singleton<AV_Server,ACE_Null_Mutex> AV_SERVER; + +#endif /* TAO_AV_SERVER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp new file mode 100644 index 00000000000..41964e7a040 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.cpp @@ -0,0 +1,511 @@ +// $Id$ + +#include "server.h" +#include "ace/Process.h" + +ACE_RCSID(server, server, "$Id$") + +int AV_Server::done_; +pid_t AV_Server::current_pid_ = -1; + + +Audio_MMDevice::Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy) + :TAO_MMDevice (endpoint_strategy), + connections_ (0) +{ +} + +AVStreams::StreamEndPoint_B_ptr +Audio_MMDevice::create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC (( CORBA::SystemException, AVStreams::streamOpFailed, + AVStreams::streamOpDenied, AVStreams::notSupported, + AVStreams::QoSRequestFailed, AVStreams::noSuchFlow )) + +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Audio_MMDevice::create_B called \n")); + AVStreams::StreamEndPoint_B_ptr stream_ptr; + stream_ptr = TAO_MMDevice::create_B (the_requester, + the_vdev, + the_qos, + met_qos, + named_vdev, + the_spec, + ACE_TRY_ENV); + if (stream_ptr != 0) + this->connections_; + return stream_ptr; +} + +int +Audio_MMDevice::connections (void) +{ + return this->connections_; +} + +// AV_Server_Sig_Handler routines + +AV_Server_Sig_Handler::AV_Server_Sig_Handler (void) +{ +} + +int +AV_Server_Sig_Handler::register_handler (void) +{ + // Assign the Sig_Handler a dummy I/O descriptor. Note that even + // though we open this file "Write Only" we still need to use the + // ACE_Event_Handler::NULL_MASK when registering this with the + // ACE_Reactor (see below). + this->handle_ = ACE_OS::open (ACE_DEV_NULL, O_WRONLY); + ACE_ASSERT (this->handle_ != -1); + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) sig_handler == %d\n",this->handle_)); + + // Register signal handler object. Note that NULL_MASK is used to + // keep the ACE_Reactor from calling us back on the "/dev/null" + // descriptor. + + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this, ACE_Event_Handler::NULL_MASK) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + + // handles these signals. + // this->sig_set.fill_set (); + this->sig_set.sig_add (SIGCHLD); + this->sig_set.sig_add (SIGBUS); + this->sig_set.sig_add (SIGINT); + this->sig_set.sig_add (SIGTERM); + + // Register the signal handler object to catch the signals. if + if (TAO_ORB_Core_instance ()->reactor ()->register_handler + (this->sig_set, this) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "register_handler"), + -1); + return 0; +} + +// Called by the ACE_Reactor to extract the fd. +ACE_HANDLE +AV_Server_Sig_Handler::get_handle (void) const +{ + return this->handle_; +} + +int +AV_Server_Sig_Handler::handle_input (ACE_HANDLE) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) handling asynchonrous input...\n")); + return 0; +} + +int +AV_Server_Sig_Handler::shutdown (ACE_HANDLE, ACE_Reactor_Mask) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) closing down Sig_Handler...\n")); + return 0; +} + +// This method handles all the signals that are being caught by this +// object. + +int +AV_Server_Sig_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) +{ + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) received signal %S\n", signum)); + + switch (signum) + { + case SIGCHLD: + // Handle the death of child signal. + this->clear_child (SIGCHLD); + break; + case SIGBUS: + // Handle the Bus error signal + case SIGINT: + // Handle the interrupt signal + case SIGTERM: + // Handle the process termination signal. + this->int_handler (signum); + break; + default: + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) %S: not handled, returning to program\n", signum)); + break; + } + return 0; +} + +// SIGCHLD handler +void +AV_Server_Sig_Handler::clear_child (int sig) +{ + int pid; + int status; + + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) AV_Server: Reaping the children\n")); + // reap the children + while ((pid = ACE_OS::waitpid (-1, + &status, + WNOHANG)) > 0) + { + if (pid == AV_Server::current_pid_) + { + cerr << "The child currently being waited for has died\n"; + // ACE_DEBUG ((LM_DEBUG,"(%P|%t) The child currently being waited for has died.\n")); + AV_Server::done_ = 1; + } + + // decrement the count of number of active children + Mpeg_Global::session_num --; + + if (status == 0) + continue; + + // ACE_DEBUG ((LM_DEBUG, "(%P|%t) AV_Server: child %d (status %d)\n", pid, status)); + } + return; +} + +int +AV_Server_Sig_Handler::remove_names (void) +{ + ACE_TRY_NEW_ENV + { + CORBA::Object_var naming_obj = + TAO_ORB_Core_instance ()->orb ()->resolve_initial_references ("NameService", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (naming_obj.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to resolve the Name Service.\n"), + -1); + + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (naming_obj.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Unregister the video_mmdevice with the naming service. + + CosNaming::Name video_server_mmdevice_name (1); + video_server_mmdevice_name.length (1); + video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice"); + + // Register the video control object with the naming server. + naming_context->unbind (video_server_mmdevice_name, + ACE_TRY_ENV); + // Unregister the audio_mmdevice with the naming service. + + CosNaming::Name audio_server_mmdevice_name (1); + audio_server_mmdevice_name.length (1); + audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice"); + + // Register the audio control object with the naming server. + naming_context->unbind (audio_server_mmdevice_name, + ACE_TRY_ENV); + + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "AV_Server_Sig_Handler::remove_names ()"); + return -1; + } + ACE_ENDTRY; + return 0; +} + +// ctrl-c, Bus error, interrupt sig handler +void +AV_Server_Sig_Handler::int_handler (int sig) +{ + // unbind the names from the naming service. + + this->remove_names (); + TAO_ORB_Core_instance ()->orb ()->shutdown (); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV server killed by signal %d\n", + sig)); +} + +AV_Server_Sig_Handler::~AV_Server_Sig_Handler (void) +{ + // TAO_ORB_Core_instance ()->reactor ()->remove_handler (this->sig_set); +} + +// AV_Server routines + +// Default Constructor +AV_Server::AV_Server (void) + :video_process_strategy_ (&video_process_options_), + audio_process_strategy_ (&audio_process_options_) +{ + this->video_process_options_.command_line ("./vs -ORBobjrefstyle url"); + this->audio_process_options_.command_line ("./as -ORBobjrefstyle url"); +} + +// %% move to the destructor or sig handler +void +AV_Server::on_exit_routine (void) +{ + // %% what does the following do + if (Mpeg_Global::parentpid != ACE_OS::getpid ()) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Process is exiting\n")); + return; + } + + // %% what does the following do + if (Mpeg_Global::live_audio > 1) + ExitLiveAudio (); + if (Mpeg_Global::live_video > 1) + ExitLiveVideo (); + // ComCloseServer(); + + // Remove the elements from the Naming service. +} + + +// Parses the command line arguments +int +AV_Server::parse_args (int argc, + char **argv) +{ + ACE_Get_Opt get_opts (argc, argv, "rd:s:vamh"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'r': // real time flag + Mpeg_Global::rttag = 1; + break; + case 'd': // clock drift in ppm + Mpeg_Global::drift_ppm = ACE_OS::atoi (get_opts.optarg); + break; + case 's':// limit on number of sessions + Mpeg_Global::session_limit = ACE_OS::atoi (get_opts.optarg); + break; + case 'v':// live video flag + Mpeg_Global::live_video = 1; + break; + case 'a':// live audio flag + Mpeg_Global::live_audio = 1; + break; + case '?': + case 'h':// help flag + ACE_DEBUG ((LM_DEBUG, + "Usage: %s [-r ] [-m]\n" + " [-d#int(clock drift in ppm)]\n" + " [-s#int(limit on number of sessions)]\n" + " [-v] [-a] [-?] [-h]", + argv [0])); + return -1; + } + return 0; +} + + +// Initializes the mpeg server +int +AV_Server::init (int argc, + char **argv, + CORBA::Environment& ACE_TRY_ENV) +{ + int result; + + // Initialize the orb_manager + this->orb_manager_.init_child_poa (argc, + argv, + "child_poa", + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + CORBA::ORB_var orb = + this->orb_manager_.orb (); + + PortableServer::POA_var child_poa = + this->orb_manager_.child_poa (); + + result = this->parse_args (argc, argv); + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Error parsing arguments"), + -1); + + // Initialize the naming services + if (my_name_client_.init (this->orb_manager_.orb ()) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize " + "the TAO_Naming_Client. \n"), + -1); + + // Register the video mmdevice object with the ORB + ACE_NEW_RETURN (this->video_mmdevice_, + TAO_MMDevice (&this->video_process_strategy_), + -1); + + // create the video server mmdevice with the naming service pointer. + CORBA::String_var video_mmdevice_ior = this->orb_manager_.activate_under_child_poa ("Video_Server_MMDevice", + this->video_mmdevice_, + ACE_TRY_ENV); + ACE_DEBUG ((LM_DEBUG,"(%P|%t) video_mmdevice_ior is :%s\n",video_mmdevice_ior.in ())); + + ACE_CHECK_RETURN (-1); + + // Register the video_mmdevice with the naming service. + CosNaming::Name video_server_mmdevice_name (1); + video_server_mmdevice_name.length (1); + video_server_mmdevice_name [0].id = CORBA::string_dup ("Video_Server_MMDevice"); + + CORBA::Object_var video_mmdevice + = this->video_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + // Register the video control object with the naming server. + this->my_name_client_->bind (video_server_mmdevice_name, + video_mmdevice.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + if (ACE_TRY_ENV.exception () != 0) + { + ACE_TRY_ENV.clear (); + CORBA::Object_var video_mmdevice + = this->video_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + this->my_name_client_->rebind (video_server_mmdevice_name, + video_mmdevice.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + } + + + // Register the audio mmdevice object with the ORB + ACE_NEW_RETURN (this->audio_mmdevice_, + Audio_MMDevice (&this->audio_process_strategy_), + -1); + + // create the audio server mmdevice with the naming service pointer. + CORBA::String_var audio_mmdevice_ior = this->orb_manager_.activate_under_child_poa ("Audio_Server_MMDevice", + this->audio_mmdevice_, + ACE_TRY_ENV); + ACE_DEBUG ((LM_DEBUG,"Audio MMDevice ior is: %s\n",audio_mmdevice_ior.in ())); + ACE_CHECK_RETURN (-1); + + // Register the audio_mmdevice with the naming service. + + CosNaming::Name audio_server_mmdevice_name (1); + audio_server_mmdevice_name.length (1); + audio_server_mmdevice_name [0].id = CORBA::string_dup ("Audio_Server_MMDevice"); + + CORBA::Object_var audio_mmdevice + = this->audio_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + // Register the audio control object with the naming server. + this->my_name_client_->bind (audio_server_mmdevice_name, + audio_mmdevice.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + if (ACE_TRY_ENV.exception () != 0) + { + ACE_TRY_ENV.clear (); + + CORBA::Object_var audio_mmdevice + = this->audio_mmdevice_->_this (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + + this->my_name_client_->rebind (audio_server_mmdevice_name, + audio_mmdevice.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + } + + + + // Register the various signal handlers with the reactor. + result = this->signal_handler_.register_handler (); + + if (result < 0) + ACE_ERROR_RETURN ((LM_ERROR, + "(%P|%t) Error registering signal handler"), + -1); + + ::atexit (on_exit_routine); + return 0; +} + +// Runs the mpeg server +int +AV_Server::run (CORBA::Environment& ACE_TRY_ENV){ + int result; + // Run the ORB event loop +// while (1) +// { + this->orb_manager_.run (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); +// if (errno == EINTR) +// continue; +// else +// break; +// } + + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV_Server::run () " + "came out of the (ORB) " + "event loop %p\n", + "run_event_loop")); + return 0; + +} + +AV_Server::~AV_Server (void) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) AV_Server: Removing handlers from the Reactor\n")); + delete this->video_mmdevice_; + delete this->audio_mmdevice_; +} + +int +main (int argc, char **argv) +{ + ACE_TRY_NEW_ENV + { + int result + = AV_SERVER::instance ()->init (argc, argv, ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (result == -1) + return -1; + + AV_SERVER::instance ()->run (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<AV_Server,ACE_Null_Mutex>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Singleton<AV_Server,ACE_Null_Mutex> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h new file mode 100644 index 00000000000..922e79f68f0 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/server.h @@ -0,0 +1,200 @@ +/* -*- c++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// server +// +// = FILENAME +// server.h +// +// = DESCRIPTION +// This defines the Audio/Video Server using TAO'S Audio/Video streaming service. +// +// = AUTHORS +// Sumedh Mungee (sumedh@cs.wustl.edu) +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#ifndef TAO_AV_SERVER_H +#define TAO_AV_SERVER_H + +#include "ace/Get_Opt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Acceptor.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/INET_Addr.h" +#include "ace/SOCK_CODgram.h" +#include "ace/Select_Reactor.h" + +#include "include/common.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "mpeg_server/Video_Control_i.h" +#include "orbsvcs/Naming/Naming_Utils.h" + +#if defined (NATIVE_ATM) +#include "atmcom.h" +#endif /* NATIVE_ATM */ + +#include "mpeg_server/Video_Server.h" +#include "mpeg_server/Audio_Server.h" +#include "orbsvcs/AV/AVStreams_i.h" +#include "orbsvcs/AV/Endpoint_Strategy.h" +#include "vs.h" + +class Audio_MMDevice + :public TAO_MMDevice +{ +public: + Audio_MMDevice (TAO_AV_Endpoint_Process_Strategy *endpoint_strategy_); + // Default constructor + + virtual AVStreams::StreamEndPoint_B_ptr create_B (AVStreams::StreamCtrl_ptr the_requester, + AVStreams::VDev_out the_vdev, + AVStreams::streamQoS &the_qos, + CORBA::Boolean_out met_qos, + char *&named_vdev, + const AVStreams::flowSpec &the_spec, + CORBA::Environment &env) + ACE_THROW_SPEC (( CORBA::SystemException, AVStreams::streamOpFailed, + AVStreams::streamOpDenied, AVStreams::notSupported, + AVStreams::QoSRequestFailed, AVStreams::noSuchFlow )); + + // Called by StreamCtrl to create a "B" type streamandpoint and vdev + + int connections (void); +private: + int connections_; + // Number of active connections +}; + +class AV_Server_Sig_Handler + : public virtual ACE_Event_Handler +{ +public: + AV_Server_Sig_Handler (void); + + virtual ACE_HANDLE get_handle (void) const; + + int register_handler (void); + // this will register this sig_handler + // with the reactor for SIGCHLD,SIGTERM,SIGINT + + virtual int shutdown (ACE_HANDLE, + ACE_Reactor_Mask); + + virtual int handle_input (ACE_HANDLE); + // handle input on the dummy handle. + + virtual int handle_signal (ACE_HANDLE signum, + siginfo_t * = 0, + ucontext_t* = 0); + // handles the SIGCHLD,SIGTERM,SIGINT for the parent process i.e + // the main thread.. + + void int_handler (int sig); + // Signal handler function for SIGTERM,SIGBUS,SIGINT + + int remove_names (void); + // Removes the audio server mmdevice and video server mmdevice from the naming service. + + void clear_child (int sig); + // Signal handler function for SIGCHLD + + ~AV_Server_Sig_Handler (void); + // Destructor + +private: + ACE_HANDLE handle_; + // dummy handle for the sig handler. + ACE_Sig_Set sig_set; + + TAO_Naming_Client my_name_client_; + // Name_Client used for unregistering the audio and video + +}; + +class AV_Server +{ + // = TITLE + // Defines a class that abstracts the functionality of a + // video and audio server. + // + // = DESCRIPTION + // Using the class is as simple as calling init () first and then + // run. It uses an acceptor with the default ACE_Reactor::instance (). +public: + AV_Server (void); + // constructor + + int init (int argc, + char **argv, + CORBA::Environment& env); + // Initialize the AV_Server + + int run (CORBA::Environment& env); + // Run the AV_Server + + static void on_exit_routine (void); + // Routine called when this process exits. + + static pid_t current_pid_; + // %% the pid the server is currently waiting on + + static int done_; + // %% the done flag, set by the signal handler + + ~AV_Server (void); + // Destructor + //private: +private: + int parse_args (int argcs, + char **argv); + // Parse the arguments. + + TAO_ORB_Manager orb_manager_; + // the TAO ORB manager. + + TAO_Naming_Client my_name_client_; + // Name_Server used to bind audio and video controls + + AV_Server_Sig_Handler signal_handler_; + // Signal handler for SIGCHLD,SIGINT,SIGTERM,SIGBUS + + ACE_INET_Addr server_control_addr_; + // Control (TCP) Address of this server. + + ACE_Process_Options video_process_options_; + // The process options for the process to be spawned by the process strategy + + TAO_AV_Endpoint_Process_Strategy_B video_process_strategy_; + // The proces strategy for the video. + + TAO_MMDevice *video_mmdevice_; + // The video server multimedia device + + ACE_Process_Options audio_process_options_; + // The process options for the process to be spawned by the process strategy + + TAO_AV_Endpoint_Process_Strategy_B audio_process_strategy_; + // The proces strategy for the audio. + + // TAO_MMDevice *audio_mmdevice_; + Audio_MMDevice *audio_mmdevice_; + // The audio server multimedia device + +}; + +typedef ACE_Singleton<AV_Server,ACE_Null_Mutex> AV_SERVER; + +#endif /* TAO_AV_SERVER_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf new file mode 100644 index 00000000000..10de97f7b43 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/svc.conf @@ -0,0 +1,6 @@ +# $Id$ +# +static Resource_Factory "-ORBResources global" +static Client_Strategy_Factory "" +###static Server_Strategy_Factory "-ORBConcurrency reactive -ORBSystemidPolicyDemuxStrategy dynamic -ORBTableSize 128" +static Server_Strategy_Factory "-ORBConcurrency reactive -ORBSystemidPolicyDemuxStrategy dynamic -ORBTableSize 128" diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp new file mode 100644 index 00000000000..d060ae9d305 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vcrs.cpp @@ -0,0 +1,255 @@ +/* $Id$ */ + +/* Copyright (c) 1995 Oregon Graduate Institute of Science and Technology + * P.O.Box 91000-1000, Portland, OR 97291, USA; + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of O.G.I. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. O.G.I. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * O.G.I. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + * O.G.I. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author: Shanwei Cen + * Department of Computer Science and Engineering + * email: scen@cse.ogi.edu + */ +#include "ace/OS.h" + +#include "../include/common.h" +#include "../mpeg_shared/com.h" +#include "../mpeg_shared/routine.h" +#include "../mpeg_server/server_proto.h" + +ACE_RCSID(server, vcrs, "$Id$") + +#define SESSION_NUM 4 + +static int parentpid = -1; + +static int listenSocketIn = -1; +static int listenSocketUn = -1; + +static struct linger linger = {1,1}; + +static int live_audio = 0, live_video = 0; /* 0 - no, 1 - to open, 2 - opened */ + +int drift_ppm = 0; /* clock drift in ppm */ + +int session_limit = SESSION_NUM; +int session_num = 0; + +static void int_handler(int sig) +{ + /* + fprintf(stderr, "process %d killed by sig %d\n",ACE_OS::getpid (), sig); + */ + ACE_OS::exit (0); +} + +static void on_exit_routine(void) +{ + if (parentpid !=ACE_OS::getpid ()) { + /* + fprintf(stderr, "process %d exiting...\n",ACE_OS::getpid ()); + */ + return; + } + /* + fprintf(stderr, "deamon exiting . . .\n"); + */ + if (live_audio > 1) ExitLiveAudio(); + if (live_video > 1) ExitLiveVideo(); + ComCloseServer(); +} + +static void clear_child(int sig) +{ + int pid; + int status; + + while ((pid = ACE_OS::waitpid (-1, &status, WNOHANG)) > 0) + { + session_num --; + + if (status == 0) { + continue; + } + fprintf(stderr, "VCRS: child %d (status %d) ", pid, status); + if (WIFEXITED(status)) { + fprintf(stderr, "exited with status %d\n", WEXITSTATUS(status)); + } + else if (WIFSIGNALED(status)) { +#if defined(_HPUX_SOURCE) || defined(__svr4__) || defined(IRIX) + fprintf(stderr, "terminated at signal %d%s.\n", WTERMSIG(status), + WCOREDUMP(status) ? ", core dumped" : ""); +#else + fprintf(stderr, "terminated at signal %d.\n", WTERMSIG(status)); +#endif + } + else if (WIFSTOPPED(status)) { + fprintf(stderr, "stopped at signal %d\n", WSTOPSIG(status)); + } + + } +} + +int main(int argc, char *argv[]) +{ + int i, rttag = 0; + int addrlen; + + for (i = 1; i < argc; i++) { + if (!strcmp(argv[i], "-rt")) { + rttag = 1; + } + else if (!strcmp(argv[i], "-nrt")) { + rttag = 0; + } + else if (!strncmp(argv[i], "-d", 2)) { + sscanf(&argv[i][2], "%d", &drift_ppm); + } + else if (!strncmp(argv[i], "-s", 2)) { + sscanf(&argv[i][2], "%d", &session_limit); + if (session_limit < 1) + session_limit = SESSION_NUM; + } + else if (!strcmp(argv[i], "-lv")) { + live_video = 1; + } + else if (!strcmp(argv[i], "-la")) { + live_audio = 1; + } + else if (!strcmp(argv[i], "-rm")) { + ACE_OS::unlink (VCR_UNIX_PORT); + } + else if (!strncmp(argv[i], "-he", 3)) { + fprintf(stderr, "Usage: %s [-rt] [-nrt] [-rm]\n", argv[0]); + fprintf(stderr, " [-d#int(clock drift in ppm)]\n"); + fprintf(stderr, " [-s#int(limit on number of sessions)]\n"); + ACE_OS::exit (1); + } + } + if (drift_ppm) { + fprintf(stderr, "Clock set to drift at %d ppm (positive is faster and neg. slower)\n", + drift_ppm); + } + + setsignal(SIGCHLD, clear_child); + setsignal(SIGPIPE, SIG_IGN); + setsignal(SIGBUS, int_handler); + setsignal(SIGINT, int_handler); + setsignal(SIGTERM, int_handler); + setsignal(SIGALRM, SIG_IGN); + + parentpid =ACE_OS::getpid (); + + atexit(on_exit_routine); + + if (live_audio) { + if (InitLiveAudio(argc, argv) == -1) + live_audio = 0; + else + live_audio = 2; + } + + if (live_video) { + if (InitLiveVideo(argc, argv) == -1) + live_video = 0; + else + live_video = 2; + } + + ComInitServer(VCR_TCP_PORT, VCR_UNIX_PORT, VCR_ATM_PORT); + + /* + setpgrp(); + */ + { + char buf[100]; + sprintf(buf, "%s%s", LOG_DIR, "vcrsSession.log"); + if (freopen(buf, "a", stdout) == NULL) { + freopen("/dev/null", "w", stdout); + } + } + + for (;;) + { + int val; + unsigned char cmd; + int serverpid = -1; + int cfd, dfd; + int max_pkt_size; + + if (ComGetConnPair(&cfd, &dfd, &max_pkt_size) == -1) continue; + + if ((serverpid = ACE_OS::fork ()) == -1) + { + ACE_OS::perror ("VCRS error on creating service process"); + ACE_OS::exit (1); + } + session_num ++; + if (serverpid > 0) /* parent process for forking servers */ + { + ComCloseFd(cfd); + ComCloseFd(dfd); + continue; + } + else + { + if (session_num > session_limit) { + time_t t; + char *buf; + t =ACE_OS::time (NULL); + buf = ACE_OS::ctime (&t); + buf[strlen(buf) - 1] = 0; + fprintf(stderr, "VCRS: %s, session_limit %d, session_number %d\n", + buf, session_limit, session_num); + } + + if ((val = ACE_OS::read (cfd, &cmd, 1)) < 0) + { + ACE_OS::perror ("VCRS fails to read command from service socket"); + ACE_OS::exit (1); + } + if (val == 0) { + fprintf(stderr, "Remote client has closed connection.\n"); + ComCloseConn(cfd); + ComCloseConn(dfd); + /* continue; -- I don't know why I wrote this line? scen 5-12-96 */ + exit(0); + } + ComCloseListen(); + if (cmd == CmdINITvideo) + { + /* + fprintf(stderr, "Server forked a VideoServer process.\n"); + */ + if (live_audio) LeaveLiveAudio(); + VideoServer(cfd, dfd, rttag, max_pkt_size); + fprintf(stderr, "Weird: video server returned.\n"); + } + else + { + /* + fprintf(stderr, "Server forked a AudioServer process.\n"); + */ + if (live_video) LeaveLiveVideo(); + AudioServer(cfd, dfd, rttag, max_pkt_size); + fprintf(stderr, "Weird: audio server returned.\n"); + } + ACE_OS::exit (1); + } + } + return 0; +} diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp new file mode 100644 index 00000000000..13f4431dbb3 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.cpp @@ -0,0 +1,80 @@ +// $Id$ + +#include "mpeg_server/Video_Server.h" +#include "vs.h" + +ACE_RCSID(server, vs, "$Id$") + +int +Video_Child_Process::init (int argc, + char **argv) +{ + if (TAO_AV_Child_Process_B<Video_Server_StreamEndPoint,TAO_VDev,Video_Control_i>::init (argc,argv) == -1) + return -1; + + int max_pkt_size = -INET_SOCKET_BUFFER_SIZE; + VIDEO_SINGLETON::instance ()->serviceSocket = -1; + + VIDEO_SINGLETON::instance ()->conn_tag = max_pkt_size; + + if (max_pkt_size > 0) + VIDEO_SINGLETON::instance ()->msgsize + = max_pkt_size; + else + if (max_pkt_size < 0) + VIDEO_SINGLETON::instance ()->msgsize + = - max_pkt_size; + else + VIDEO_SINGLETON::instance ()->msgsize + = 1024 * 1024; + /* + SFprintf(stderr, "VS VIDEO_SINGLETON::instance ()->msgsize = %d\n", VIDEO_SINGLETON::instance ()->msgsize); + */ + VIDEO_SINGLETON::instance ()->msgsize -= sizeof(VideoMessage); + + VIDEO_SINGLETON::instance ()->start_time =ACE_OS::time (NULL); + + VIDEO_SINGLETON::instance ()->lastRef [0] + = VIDEO_SINGLETON::instance ()->lastRef[1] + = -1; + + VIDEO_SINGLETON::instance ()->lastRefPtr = 0; + return 1; +} + + +int +Video_Child_Process::make_mediactrl (Video_Control_i *& media_ctrl) +{ + ACE_DEBUG ((LM_DEBUG,"(%P|%t) Video_Child_Process::make_mediactrl ()\n")); + media_ctrl = VIDEO_CONTROL_I::instance (); + return 0; +} + +int +main (int argc, char **argv) +{ + Video_Child_Process video_child; + + if (video_child.init (argc,argv) == -1) + return 1; +// while (1) +// { + video_child.run (); +// if (errno == EINTR) +// continue; +// else +// break; +// } + + return 0; +} + + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class TAO_AV_Child_Process<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>; +template class TAO_AV_Child_Process_B<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate TAO_AV_Child_Process<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i> +#pragma instantiate TAO_AV_Child_Process_B<Video_Server_StreamEndPoint, TAO_VDev, Video_Control_i> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h new file mode 100644 index 00000000000..a8dc2a63f55 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/source/server/vs.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- */ +/* $Id$ */ + +// ============================================================================ +// +// = LIBRARY +// vs +// +// = FILENAME +// vs.h +// +// = DESCRIPTION +// @@ Please add a synopsis of this file. +// +// = AUTHORS +// Sumedh Mungee (sumedh@cs.wustl.edu) +// Nagarajan Surendran (naga@cs.wustl.edu) +// +// ============================================================================ + +#ifndef TAO_AV_VS_H +#define TAO_AV_VS_H + +#include "ace/Get_Opt.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/Acceptor.h" +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/INET_Addr.h" +#include "ace/SOCK_CODgram.h" +#include "ace/Select_Reactor.h" + +#include "include/common.h" +#include "mpeg_server/server_proto.h" +#include "mpeg_shared/fileio.h" +#include "mpeg_shared/routine.h" +#include "mpeg_shared/com.h" +#include "mpeg_server/Video_Control_i.h" +#include "orbsvcs/orbsvcs/Naming/Naming_Utils.h" + +#include "mpeg_server/Video_Server.h" +#include "orbsvcs/AV/AVStreams_i.h" + +class Video_Child_Process + :public TAO_AV_Child_Process_B <Video_Server_StreamEndPoint,TAO_VDev,Video_Control_i> +{ +public: + int init (int argc, + char **argv); + // init the Video Singleton. + + int make_mediactrl (Video_Control_i *&media_ctrl); +}; + + +#endif /* TAO_AV_VS_H */ diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/vcr.1 b/TAO/orbsvcs/tests/AVStreams/mpeg/vcr.1 new file mode 100644 index 00000000000..24e9688f674 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/vcr.1 @@ -0,0 +1,610 @@ +.\" Copyright (c) 1995 Oregon Graduate Institute +.TH vcr 1 "November 1995" "MPEG video audio player" + +.SH NAME +.B vcr vcrs +\- Distributed, real-time synchronized video audio player, version 2.0 +.SH SYNOPSIS + +.B vcrs +[ +.B \-rt +] [ +.B \-rm +] [ +.B \-s\fIsession_limit\fP +] [ +.B \-help +] + +.B vcr +[ +.B\-rt +] [ +.B \-shmem +] [ +.B \-rmsem +] +.ti +5n +[ +.BR \-dither " ordered\||\|ordered2\||\|fs4\||\|fs2\||\|fs2fast\||\|hybrid\||\| +.if n .ti +5n + hybrid2\||\|2x2\||\|gray\||\|color\||\|mono\||\|threshold +] +.if n .ti +5n +[ +.I X-window options +] +.if n .ti +5n +[ +.BR \-v " \fI[hostname:]video-filename\fP" +] +.if n .ti +5n +[ +.BR \-a " \fI[hostname:]audio-filename\fP" +] +.if n .ti +5n +[ +.BR \-p " \fImovie-file-name\fP" +] +.if n .ti +5n +[ +.BR \-l " \fImovie-list-file-name\fP" +] +.if n .ti +5n +[ +.BR \-quiet +] +.if n .ti +5n +[ +.BR \-help +] +.SH DESCRIPTION + +The player plays \fBMPEG\-1\fP video and \fB8\-bit mu\-law (Sun +Sparc)\fP audio. It supports +following \fBfour types\fP of playback: +.TP +\ \ \ \(bu +Plays both video and audio synchronously, in real-time mode. Video +frames, or even audio samples are dropped if needed. +.TP +\ \ \ \(bu +Plays video only, in real-time mode. Video frames are dropped if +needed. +.TP +\ \ \ \(bu +Plays video only, in best-effort mode, video frames are played as fast +as possible. +.TP +\ \ \ \(bu +Plays audio only, in real time mode. +.PP + +When video/audio is played in \fBreal-time\fP mode, play speed (defined in +terms of frames-per-second (fps) for video and samples-per-second (sps) +for audio) can be specified through a speed scale. If audio is played at a +speed other than the recording (normal) speed, samples are interpolated. + +When video is played in \fBbest-effort\fP mode, the player tries its +best to play video frame by frame, and not to drop frames. This mode +is not supported very well. Now and then some frames may be +dropped. Audio is disabled in this mode. + +As well as various types of playback, the player also supports other +common VCR functions such as fast forward, rewind, step +(forward), random positioning, etc.. + +The player is of \fBdistributed architecture\fP, with servers and +clients communicating across Internet. A \fBserver\fP resides on a +host, and services coming audio/video retrieval requests from clients. +A \fBclient\fP receives instructions from the user, makes connection +to servers, buffers incoming streams, decodes video frames, +interpolates audio samples, and outputs audio and video to +corresponding devices in a timely manner. A client can connect to +different servers for audio and video streams, and still plays them +synchronously. + + +.SH SERVER + +To start the server, type: + +.B vcrs +[ +.B \-rt +] [ +.B \-rm +] [ +.B \-s\fIsession_limit\fP +] [ +.B \-help +] + +One host can have a SINGLE server running, which responds to +connection requests from all clients to that host. Subsequent +invocation is terminated with an error message. + +\fBOptions\fP + +.IP "\fB-rt\fP" +On \fBhpux\fP, \fBsparc-sunos5.3\fP and \fBi86pc-solaris2.4\fP, if you +have real-time execution privilege, you can start the server with +the option \fB\-rt\fP to get better service. + +.IP "\fB-rm\fP" +With option \fB\-rm\fP, the server will try to remove socket names +left by previous crashed invocations before initialization. + +.IP "\fB-s\fIsession_limit\fP" + +With the option of \fB\-s\fP followed by a positive integer, e.g. +\fB-s2\fP, \fB-s4\fP or \fB-s10\fP, the number of sessions +serviced by the server at any time will be limited to be no more than +the given number. Both audio and video sessions are counted. The +default session number limit is \fB4\fI. + +.IP "\fB-help\fP" +This option tells the server to print all available options and then +quit. + +.PP + +In a video session, the server tries to find a +corresponding \fB.Info\fP file describing the structure of the MPEG +file of the session. If this fails, the server scans the MPEG file for +structure information and tries to create the \fB.Info\fP file. For +big MPEG files, this scanning process may take quite a few minutes +(some times even tens of minutes). If the \fB.Info\fP file is found, +the server simply reads structure information from it. + +.SH CLIENT + +The client program is available on \fBsun4\fP, \fBhpux\fP and +\fBi86pc-solaris2.4\fP. It needs a \fBMotif\fP environment, and +outputs audio to the default \fBAudioFile\fP server. If the client +fails to connect to the default AudioFile server, then the audio is +disabled. + +To start the client, type: + +.B vcr +[ +.B\-rt +] [ +.B \-shmem +] [ +.B \-rmsem +] +.ti +5n +[ +.BR \-dither " ordered\||\|ordered2\||\|fs4\||\|fs2\||\|fs2fast\||\|hybrid\||\| +.if n .ti +5n + hybrid2\||\|2x2\||\|gray\||\|color\||\|mono\||\|threshold +] +.if n .ti +5n +[ +.I X-window options +] +.if n .ti +5n +[ +.BR \-v " \fI[hostname:]video-filename\fP" +] +.if n .ti +5n +[ +.BR \-a " \fI[hostname:]audio-filename\fP" +] +.if n .ti +5n +[ +.BR \-p " \fImovie-file-name\fP" +] +.if n .ti +5n +[ +.BR \-l " \fImovie-list-file-name\fP" +] +.if n .ti +5n +[ +.BR \-quiet +] +.if n .ti +5n +[ +.BR \-help +] + +\fBOptions\fP + +.IP \fB-rt\fP +On \fBhpux\fP, and \fBi86pc-solaris2.4\fP, if you have real-time +execution privilege, with this option you may get better service. +.IP \fB-shmem\fP +With this option, the client tries to output video frames to the +X-server via shared memory instead of sockets. +.IP \fB-rmsem\fP +With this option, prior to initialization, the client tries to remove +\fBall\fP existing semaphore and shared memory ids you have access to. +\fBBe careful\fP, with this option, you also face the danger of +removing semaphores or shared memory ids being used by other programs, +as well as all the ones created by failed invocation of the player. See +\fBSemaphore ids and shared memory ids used up\fP in \fBKNOWN PROBLEMS\fP +section. +.IP "\fB-dither\fP ordered|ordered2|fs4|fs2|fs2fast|hybrid|" + hybrid2|2x2|gray|color|mono|threshold + +This option specifies the type of dithering performed on video frames +in order to be displayed on an X-window. The default is +\fIordered\fP. \fIcolor\fP only works with full color (24-bit) +displays. All others work with 8-bit color displays. \fImono\fP and +\fIthreshold\fP also work with mono displays. Different types of +dithering have different computational complexity and offer different +image quality. +.IP "\fIX-window options\fP" +All standard X-window Toolkit command line options are accepted +(see \fBX\fP(1)). +.IP "\fB-v\fP \fI[hostname:]video-filename\fP" +The very first program for the player can be specified in command line +with \fB-v\fP and/or \fB-a\fP options, for video and/or audio streams +respectively. + +This option specifies a video stream. If the \fIhostname\fP part is +given, the client tries to connect to a running server on the given +host, and plays the given file. If the hostname part is missing, the +client assumes there is a running server on the local host or tries to +fork one. and tries to connect to it. + +.IP "\fB-a\fP \fI[hostname:]audio-filename\fP" +This option specifies an audio stream of the very first program. +Only file names with suffix \fB.au\fP are accepted as audio files. +.IP "\fB-p\fP \fImovie-file-name\fP" +This option specifies a file specifying a movie to be played upon +client startup. A movies file contains \fBfive lines\fP lines: title, +video host name, video file path, audio host name, and audio file path. +.IP "\fB-l\fP \fImovie-list-file-name\fP" +This option specifies a movie list file to replace the default movie +list file \fI$(HOME)/.vcr/vcrPrograms\fP. A movie list file contains a +banner line, followed by a list of movies. +.IP "\fB-quiet\fP" +This option tells the client not to print any text message. This is +useful when the player is invoked from within a web browser. +.IP "\fB-help\fP" +This option tells the client to print all available options and quit. + +.PP + +\fBOperations\fP + +There are \fBtwelve buttons\fP and \fBfour scales\fP defined in the top-level window. +Buttons from left to right are: +.PP +.IP \fIExit\fP +Exits the client right away. +.IP \fIInfo\fP +Pops up a window containing information about the player. +.IP \fIPara\fP +Pops up a window with a list of parameters. Parameter values +can be viewed and modified through this window. +.IP \fIProg\fP +Pops up a window with a list of programs. You +can select a program from this list to play. +.IP \fIFile\fP +This is an alternative way to select programs. pressing this button +pops up a standard Motif file selection window. You can select +audio/video file on local host to play. The client assumes a running +server on local host, or tries to fork one. + +File names with suffix \fB.au\fP are accepted as audio, and file +names with suffices \fB.mpg\fP, or \fB.mpeg\fP (some or all letters in +the suffices can be upper-case ones) as MPEG video. Other types of +file names are rejected. + +Selection of a new program causes the current program to be discarded. +.IP \fILoop\fP +A toggle button. When pressed, the current program is played +repeatedly until stopped explicitly by the user, otherwise, playback stops when +program end is hit. This button has no effect on rewind and fast +forward. +.IP \fINorm\fP +Restores play speed to the normal (recording) speed. +.IP \fIRewind\fP +For video programs. Plays backward from the current position at a +speed given by the parameter \fI(Rewind frames-per-second)\fP. Only first +frames of MPEG picture groups (I-frames) are played. Audio is +disabled. +.IP \fIStop\fP +Stops active playback, fast forward or rewind. +.IP \fIFast-Forward\fP +For video programs. Plays forward from the current position at a speed +given by the parameter \fI(FF frames-per-second)\fP. Only first frames of MPEG +picture groups (I-frames) are played. Audio is disabled. +.IP \fIPlay\fP +Plays the program from the current position in one of the two modes, +depending on if video is involved and the value of an parameter \fI(Real +time(audio on)(tag))\fP: +.RS +.IP - +Best-effort mode, if the parameter is off (0), and video is involved. +.IP - +Real-time mode, otherwise. +.RE +.IP \fIStep\fP +Steps forward for one frame from the current position. +.PP +Clicking on buttons \fIRewind\fP, \fIFast-Forward\fP, \fIPlay\fP and +\fIStep\fP and dragging the \fIPlay-Speed\fP scale all stop current +active rewind, fast forward, or play. + +.B "Four scales \fP from left to right are:" + +.IP \fIBalance\fP +Currently not functional, because only mono audio is +supported. +.IP \fIVolume\fP +Audio volume. +.IP \fIPlay-Speed\fP +Specifies play speed for real-time mode playback. This scale is not +completely linear, with a special middle point (\fB50\fP). +.RS +.IP \fB50\fP +normal (recording) speed. +.IP "\fB[1 - 50)\fP" +linear speed value increase from zero to the normal speed. +.IP "\fB(50 - 100]\fP" +Linear speed value increase from the normal speed to the maximum +speed given by the parameter \fI(Video max frames-per-second)\fP when +video is involved in the current program, or \fI(Audio max +samples-per-second)\fP when only audio is involved. +.RE +This scale also defines the upper-limit of the best-effort playback +speed. +.IP \fIPosition\fP +This scale has multiple functionalities: +.RS +.IP - +Indicates the beginning position for rewind, fast forward and +playback. +.IP - +Shows the current position during rewind, fast forward, and playback. +.IP - +Random positioning: you can set the position by dragging the +slider. when video is involved, the first frame of the picture group +at the current position is displayed. +.RE +.PP +.B "Program list" + +.B Program list +is maintained through the \fBprogram list\fP window, which is popped up by +clicking the \fIProg\fP button in the main window. Currently only \fISelect\fP +and \fIDismiss\fP buttons are fully functional, and contents of a selected +program can be viewed (but not modified) by pressing the \fIModify\fP +button. To select a program, \fBhighlight\fP the desired item and +click \fISelect\fP. To modify the program list, edit the program file given +below. + +.B "Parameters" + +.B Parameters +are viewed and maintained through the parameter window, which is activated +by clicking the \fIPara\fP button in the main window. To update a parameter, +\fBhighlight\fP the item, enter the new value in the text window next +to the \fIUpdate\fP button, and press \fIUpdate\fP. Following parameters +are supported: + +.IP "\fIReal time (audio on)(tag)\fP" +Best-effort play mode when this parameter is 0 and video is involved +in the current program, otherwise real-time play mode. Default: 1, +range: 0, non-0. +.IP "\fIVideo max frames-per-second\fP" +For video programs, real-time mode play speed when speed scale has a +value of 100. Default: 60, range: > the normal speed. +.IP "\fIAudio max samples-per-second\fP" +For audio-only programs, play speed when speed scale has a value of +100. Default: 16000, range: > the normal speed. +.IP "\fIFF frames-per-second\fP" +Fast forward speed. Default: 150, range: > 0. +.IP "\fIRewind frames-per-second\fP" +Rewind speed. Default: 150, range: > 0. +.IP "\fIFeedback delay (msec)\fP" +Currently not used. +.IP "\fIAudio output mask\fP" +Currently not used. +.IP "\fIAudio_para.encodeType\fP" +Currently not used. +.IP "\fIAudio_para.channels\fP" +Currently not used. +.IP "\fIAudio_para.samplesPerSecond\fP" +Currently not used. +.IP "\fIAudio_para.bytesPerSamples\fP" +Currently not used. +.IP "\fIAudio timer interval (millisec)\fP" +For audio-only programs. Playback +timer interval in milliseconds. Playback of audio and video is +driven by a timer in the client. Default: 500, range: > 0. +.IP "\fIAudio buffered intervals\fP" +For audio-only programs. This number of timer intervals of audio +samples are to be buffered in the AudioFile server internal buffer. This +parameter and the previous one determine how many milliseconds of +audio samples are to be buffered in AudioFile. Buffering too +many samples reduces responsiveness, too few may degrade playback +quality. Default: 2, range: > 0. +.IP "\fIFrames per audio play\fP" +For audio+video programs, this parameter determines the ratio of the +audio timer interval over the video timer interval. Default: 4, +range: > 0. +.IP "\fIAudio forward (samples)\fP" +For audio+video programs, this number of samples of audio is +played ahead of video stream. This is supposed to compensate the +delay in AudioFile server. Default: 800, range: > 0. +.IP "\fIVS work-ahead (milli-seconds)\fP" +For video program, this number of milli-seconds the player tries to +keep the video server ahead of the client during playback, rewind and +fast forward. + +If the parameter \fISync effective\fP has a value of non-0, then this +parameter gives the initial value of the VS work-ahead time, and the +actual work ahead time is adjusted according to current network delay +jitter level. If a value less than the default is set, then the +default instead of the given one is used by the player. + +Default: 100, range: >= Default. + +.IP "\fIFrame rate limit (fps, float)\fP" +For video programs. In real-time play mode, if current play speed is +higher than the value of this parameter, then this +parameter defines the maximum frame rate the player tries to play. +Default: 60.0, range: >0. +.IP "\fICollect statistics(tag)\fP" +For video programs. If both the server and the client programs are compiled +with STAT defined, this tag indicates that, at the end of a playback +session, when \fIStop\fP button is pressed (or in loop-back mode when the +end of the program is reached) statistics is collected to file +stat.\fIn\fP in current directory (from which the client is +invoked). Default: 0, range: 0, non-0. +.IP "\fICollect video structure info(tag)\fP" +For video programs. If both the server and the client programs are compiled +with STAT defined, this tag indicates that, upon successful +initialization of a video stream, structure information of the MPEG +stream is collected to a file named struct.\fIn\fP in +current directory Default: 0, range: 0, non-0. +.IP "\fISync effective(tag)\fP" +For video programs, when set, server/client synchronization control is +effective during playback, rewind and fast forward. Default: 1, range: +0, non-0. +.IP "\fIQoS effective(tag)\fP" +For video programs, when set, automatic frame rate control is +effective during playback. Default: 1, range: 0, non-0. +.IP "\fIAudio offset(samples)\fP" +For audio+video programs. The player assumes that in a program, audio +and video are recorded strictly synchronously. But it is usually not +the case, and there is a certain amount of timing shift between audio +and video. This parameter specifies audio forward offset against video +in order to compensate the shift. Default: 0, range: integer +.IP "\fIFilter parameter(1/R or n-samples)\fP" +Parameter of the filters for client/server synchronization and frame rate +control. Default: 50, range: > 0. +.IP "\fIMax send pattern frames\fP" +This parameter sets the granularity of the frame rate control +algorithm. Default: 60, range: > 0. +.IP "\fIReliable byte-stream audio (tag)\fP" +In the case when the server is on a remote host, when this tag is set, +the client establishes a TCP connection to the server for shipping +audio samples, otherwise a UDP is used. The client always setup a TCP +connection to the server for control messages, no matter what value +the tag is. +.IP "\fIReliable byte-stream video (tag)\fP" +Similar effort as previous tag, but for video channel. +.IP "\fIVerbose message(tag)\fP" +If this tag is set, then verbose message is printed (provided that +command line option \fB-quiet\fP is not specified. Otherwise the +client will still print some, but less verbose message. +.PP +Parameter setting is for experienced user only. It is suggested that +you leave values of most parameters as default. If you like to change +some of them, be careful. It may make the player behave improperly. In +case you made some change, the player fails to work, and you are +unable to undo the change, delete the parameter file shown below and +restart the client. + +.SH FILES + +.IP "\fI($HOME)/.vcr/vcrPrograms\fP" +Program file. If this file is absent, it is created with a default +movie list of several basketball game sample movies in it. The movies +in the default movies list are maintained at CSE OGI. In a movie list +file, the first line is a banner. Following this line, each contiguous +four lines describe a movie: video host, MPEG file path, audio host, +audio file path. You may edit the movie list fileto include any movies +you like. + +.IP "\fI($HOME)/.vcr/vcrParameters\fP" +Parameter file. When absent, the system default parameter values +apply. Whenever you update a parameter, this parameter file is also +created or updated. + +.SH KNOWN PROBLEMS + +.B "The player stalls" +when or after playing audio program at very \fBlow speed\fP, or the +product of \fI(Audio timer interval)\fP and \fI(Audio buffered intervals)\fP +parameters \fBtoo large\fP, or \fI(Frames per audio play)\fP too +large. This is because the client tries to put too many audio +samples to AudioFile each time, blocking itself for output. + +In this version of the player, when an video+audio program is played, +some conditions are checked and low speed limit is enforced. You +are not able to set too low play speed (even if you set the speed +slider to 0 position). But the conditions might not be sufficient. + +.B "Play at too high speed\fP," +or \fI(Audio timer interval)\fP too small, or \fI(Video max +frames-per-second)\fP, \fI(FF frames-per-second)\fP, or \fI(Rewind +frames-per-second)\fP too high, presentation quality may be worse than +expected. This is because of the resolution limit of the UNIX interval +timer, which is about 10 milliseconds. + +.B "When Play speed jump from high to very low\fP," +a few seconds of worse-than-expected video presentation quality may be +experienced. Because at high speed, the video server usually drops +frames, and play speed changes, the player does not flush the video +pipeline. + +Various problems may be experienced if the \fBparameter\fP values are too +far from their default. The parameter values are seldomly guarded. + +.B "Audio doesn't work when played across the Internet\fP." +This is because audio is retrieved from the audio server to the +client via TCP, and the Internet TCP connection fails to provide +enough (e.g. 8KB/s) sustained bandwidth. In this case, all audio +samples would be too late showing up at the client, and thus are +dropped. + +.B "X shared memory problem\fP." +Parts of the user interface may not work correctly when the player +outputs to X-window via shared memory (with option \fB-shmem\fP). For +example, some of the buttons may not show up. Usually, the missing +buttons will show up by iconifying the user interface. + +.B "Core dump." +The player may core dump when playing a specific MPEG stream, at a +specific position. This may be because the parameters in the MPEG +stream is out of the ability of the decoder code. Upon core dump, you +may want to reproduce the problem, and recompile the player with +option -DNDEBUG, run the player again to see if any assertions fails. + +.B "Semaphore or shared memory ids used up\fP." +When this happens, an error shmget() or semget() is reported by the +player. This may happen if previous invocation(s) of the player have +exit abnormally causing core dump, and you try to run the player +again. Because semaphores and shared memory segments might not be +reclaimed when the player exits abnormally. You may run the client +with option \fB\-rmsem\fP to remove all existing semaphores and shared +memory ids accessable by you. See description of \fB\-rmsem\fP. If +\fB-rmsem\fP does not work, you may need to use tools like +\fBipcrm(1)\fP. + +.B "Undeleted UNIX socket pathes /tmp/vcrs*\fP" +Some UNIX socket names may remain in /tmp directory as "vcrs*", if the +server or the client has terminated abnormally. + +.SH BUG REPORT + +If you experience problems, look at the above KNOWN PROBLEM section +first. If the problem is not described, try to reproduce the problem, and +\fBreport bug\fP to \fBscen@cse.ogi.edu\fP. Thanks. + +.SH COPYRIGHT + +This software is covered by copyrights. It contains code contributed +by the author and several other parties. Please see the beginning of +source files and copyright file(s) in the root directory of the source +kit. + +.SH SEE ALSO + +.B "AF\fP(1), \fBX\fP(1)" + +.SH AUTHOR + + Shanwei Cen + Department of Computer Science and Engineering + Oregon Graduate Institute of Science and Technology + scen@cse.ogi.edu diff --git a/TAO/orbsvcs/tests/AVStreams/mpeg/vcrs.1 b/TAO/orbsvcs/tests/AVStreams/mpeg/vcrs.1 new file mode 100644 index 00000000000..a9769fc8944 --- /dev/null +++ b/TAO/orbsvcs/tests/AVStreams/mpeg/vcrs.1 @@ -0,0 +1 @@ +.so vcr.1 diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl index a29ad457d6c..0091d3c7100 100755 --- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl +++ b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl @@ -33,12 +33,13 @@ $giopliteflag = 0; for ($i = 0; $i <= $#ARGV; $i++) { if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") { - print "run_test [-h] [-n num] [-debug] [-verbose]\n"; + print "run_test [-h] [-n num] [-debug] [-orblite] [-verbose]\n"; print "\n"; print "-h -- prints this information\n"; print "-n num -- client uses <num> iterations\n"; print "-debug -- sets the debug flag for both client and " . "server\n"; + print "-orblite -- Use the lite version of the orb"; exit; } elsif ($ARGV[$i] eq "-debug") { @@ -49,6 +50,9 @@ for ($i = 0; $i <= $#ARGV; $i++) { $clflags .= " -n $ARGV[$i + 1] "; $i++; } + elsif ($ARGV[$i] eq "-orblite") { + $giopliteflag = 1; + } elsif ($ARGV[$i] eq "-verbose") { $quietflag = ""; } @@ -104,6 +108,12 @@ print STDERR "Running IDL_Cubit with the default ORB protocol.\n\n"; $SV->Arguments ($svflags . $svnsflags); $CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); +if ($giopliteflag) { + print STDERR "\nRunning IDL_Cubit with the a lite ORB protocol.\n\n"; + $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $iiop_lite_conf "); + $CL->Arguments ($CL->Arguments () . " -ORBSvcConf $iiop_lite_conf "); +} + run_test_helper (); if ($OSNAME ne "MSWin32") { @@ -113,6 +123,12 @@ if ($OSNAME ne "MSWin32") { $SV->Arguments ($svflags . $svnsflags . " -ORBEndpoint uiop:// "); $CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); + if ($giopliteflag) { + print STDERR "\nRunning IDL_Cubit with the a UIOP lite ORB protocol.\n\n"; + $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $uiop_lite_conf "); + $CL->Arguments ($CL->Arguments () . " -ORBSvcConf $uiop_lite_conf "); + } + run_test_helper (); } diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test_lite.pl b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test_lite.pl deleted file mode 100755 index 450db14fd79..00000000000 --- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test_lite.pl +++ /dev/null @@ -1,140 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -# The first three lines above let this script run without specifying the -# full path to perl, as long as it is in the user's PATH. -# Taken from perlrun man page. - -# Do not use environment variables here since not all platforms use ACE_ROOT -use lib "../../../../../bin"; -use PerlACE::Run_Test; -use English; - -$status = 0; - -$iorfile = PerlACE::LocalFile ("cubit.ior"); -$iiop_lite_conf = PerlACE::LocalFile ("iiop_lite.conf"); -$uiop_lite_conf = PerlACE::LocalFile ("uiop_lite.conf"); -#$server_shmiop_conf = PerlACE::LocalFile ("server_shmiop_lite.conf"); -#$client_shmiop_conf = PerlACE::LocalFile ("client_shmiop_lite.conf"); -$svnsflags = " -f $iorfile"; -$clnsflags = " -f $iorfile"; -$clflags = ""; -$svflags = ""; -$quietflag = " -q "; - - -############################################################################### -# Parse the arguments - -for ($i = 0; $i <= $#ARGV; $i++) { - if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") { - print "run_test [-h] [-n num] [-debug] [-verbose]\n"; - print "\n"; - print "-h -- prints this information\n"; - print "-n num -- client uses <num> iterations\n"; - print "-debug -- sets the debug flag for both client and " - . "server\n"; - exit; - } - elsif ($ARGV[$i] eq "-debug") { - $clflags .= " -d "; - $svflags .= " -d "; - } - elsif ($ARGV[$i] eq "-n") { - $clflags .= " -n $ARGV[$i + 1] "; - $i++; - } - elsif ($ARGV[$i] eq "-verbose") { - $quietflag = ""; - } - else { - print STDERR "ERROR: Unknown Option: ".$ARGV[$i]."\n"; - } -} - -$SV = new PerlACE::Process ("server"); -$CL = new PerlACE::Process ("client"); - -############################################################################### -# run_test_helper - -sub run_test_helper () -{ - $SV->Spawn (); - - if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); - exit 1; - } - - my $client = $CL->SpawnWaitKill (120); - my $server = $SV->WaitKill (30); - - unlink $iorfile; - - if ($server != 0) { - print STDERR "ERROR: server error status $server\n"; - $status = 1; - } - - if ($client != 0) { - print STDERR "ERROR: client error status $client\n"; - $status = 1; - } -} - -############################################################################### - -if (! (-x $SV->Executable () && -x $CL->Executable)) { - print STDERR "ERROR: server and/or client missing or not executable!\n"; - exit 1; -} - -unlink $iorfile; - -print STDERR "============================================================\n"; -print STDERR "Running IDL_Cubit with the IIOP Lite ORB protocol.\n\n"; - -$SV->Arguments ($svflags . $svnsflags); -$CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); - -$SV->Arguments ($SV->Arguments () . " -ORBSvcConf $iiop_lite_conf "); -$CL->Arguments ($CL->Arguments () . " -ORBSvcConf $iiop_lite_conf "); - -run_test_helper (); - -if ($OSNAME ne "MSWin32") { - print STDERR "============================================================\n"; - print STDERR "Running IDL_Cubit with the UIOP Lite protocol.\n\n"; - - $SV->Arguments ($svflags . $svnsflags . " -ORBEndpoint uiop:// "); - $CL->Arguments ($clflags . $clnsflags . $quietflag . " -x "); - - $SV->Arguments ($SV->Arguments () . " -ORBSvcConf $uiop_lite_conf "); - $CL->Arguments ($CL->Arguments () . " -ORBSvcConf $uiop_lite_conf "); - - run_test_helper (); -} - -# This portions needs to be enabled once we have an SHMIOP_Lite in -# place.. - -#print STDERR "============================================================\n"; -#print STDERR "Running IDL_Cubit with the SHMIOP Lite protocol.\n\n"; - -#$SV->Arguments ($svflags . $svnsflags -# . " -ORBEndpoint shmiop:// -ORBSvcconf $server_shmiop_conf "); -#$CL->Arguments ($clflags . $clnsflags . $quietflag . "-ORBSvcConf $client_shmiop_conf -x "); - -#run_test_helper (); - -# Clean up SHMIOP files -#PerlACE::check_n_cleanup_files ("server_shmiop_*"); - -exit $status; diff --git a/TAO/tao/Asynch_Queued_Message.cpp b/TAO/tao/Asynch_Queued_Message.cpp index 5fdafc28735..e33e3a97ccd 100644 --- a/TAO/tao/Asynch_Queued_Message.cpp +++ b/TAO/tao/Asynch_Queued_Message.cpp @@ -59,6 +59,8 @@ TAO_Asynch_Queued_Message::fill_iov (int iovcnt_max, void TAO_Asynch_Queued_Message::bytes_transferred (size_t &byte_count) { + this->state_changed_i (TAO_LF_Event::LFS_ACTIVE); + size_t remaining_bytes = this->size_ - this->offset_; if (byte_count > remaining_bytes) { @@ -68,6 +70,9 @@ TAO_Asynch_Queued_Message::bytes_transferred (size_t &byte_count) } this->offset_ += byte_count; byte_count = 0; + + if (this->all_data_sent ()) + this->state_changed (TAO_LF_Event::LFS_SUCCESS); } void diff --git a/TAO/tao/Asynch_Reply_Dispatcher.cpp b/TAO/tao/Asynch_Reply_Dispatcher.cpp index 5f4c0b7cb6c..774452bb50a 100644 --- a/TAO/tao/Asynch_Reply_Dispatcher.cpp +++ b/TAO/tao/Asynch_Reply_Dispatcher.cpp @@ -55,11 +55,6 @@ TAO_Asynch_Reply_Dispatcher_Base::dispatch_reply ( void -TAO_Asynch_Reply_Dispatcher_Base::dispatcher_bound (TAO_Transport *) -{ -} - -void TAO_Asynch_Reply_Dispatcher_Base::connection_closed (void) { } diff --git a/TAO/tao/Asynch_Reply_Dispatcher.h b/TAO/tao/Asynch_Reply_Dispatcher.h index f81c68a142b..14adf2eb533 100644 --- a/TAO/tao/Asynch_Reply_Dispatcher.h +++ b/TAO/tao/Asynch_Reply_Dispatcher.h @@ -50,8 +50,6 @@ public: // virtual TAO_GIOP_Message_State *message_state (void); - virtual void dispatcher_bound (TAO_Transport *t); - virtual void connection_closed (void); /// Inform that the reply timed out diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index 66ec38c3c69..049b1d15a49 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -17,15 +17,9 @@ ACE_RCSID(tao, Connection_Handler, "$Id$") TAO_Connection_Handler::TAO_Connection_Handler (TAO_ORB_Core *orb_core) :orb_core_ (orb_core), transport_ (0), - tss_resources_ (orb_core->get_tss_resources ()), - pending_upcalls_ (1), - pending_upcall_lock_ (0) - + tss_resources_ (orb_core->get_tss_resources ()) + //, is_registered_ (0) { - // @@todo: We need to have a distinct option/ method in the resource - // factory for this and TAO_Transport. - this->pending_upcall_lock_ = - this->orb_core_->resource_factory ()->create_cached_connection_lock (); } @@ -36,8 +30,6 @@ TAO_Connection_Handler::~TAO_Connection_Handler (void) this->orb_core_ = 0; this->tss_resources_ = 0; TAO_Transport::release (this->transport_); - - delete this->pending_upcall_lock_; } diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index f18c6c54ed1..ae74b4f8ad1 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -6,7 +6,7 @@ * * $Id$ * - * @author Balachandran Natarajan <bala@cs.wustl.edu> + * @author Balachandran Natarajan <bala@cs.wustl.edu> */ //============================================================================= @@ -101,17 +101,10 @@ protected: /// Object. int svc_i (void); - /// Increment and decrement the number of upcalls that have gone - /// through this handler. Returns the upcall count. The calls are - /// thread safe.. - int incr_pending_upcalls (void); - int decr_pending_upcalls (void); - - /// Query the upcall count - int pending_upcalls (void) const; private: + /// Pointer to the TAO_ORB_Core TAO_ORB_Core *orb_core_; @@ -121,15 +114,8 @@ private: /// Cached tss resources of the ORB that activated this object. TAO_ORB_Core_TSS_Resources *tss_resources_; - /// Count nested upcalls on this - /// svc_handler i.e., the connection can close during nested upcalls, - /// you should not delete the svc_handler until the stack unwinds - /// from the nested upcalls. - long pending_upcalls_; - - /// Lock for the <pending_upcalls_>. We can have more than one - /// thread trying to access. - ACE_Lock *pending_upcall_lock_; + /// Are we registered with the reactor? + // CORBA::Boolean is_registered_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Connection_Handler.inl b/TAO/tao/Connection_Handler.inl index 49ac55ad5b8..1be59aafb4b 100644 --- a/TAO/tao/Connection_Handler.inl +++ b/TAO/tao/Connection_Handler.inl @@ -10,6 +10,19 @@ TAO_Connection_Handler::TAO_Connection_Handler (void) { } +/*ACE_INLINE CORBA::Boolean +TAO_Connection_Handler::is_registered (void) +{ + return this->is_registered_; +} + +ACE_INLINE void +TAO_Connection_Handler::is_registered (CORBA::Boolean flag) +{ + this->is_registered_ = flag; +} +*/ + ACE_INLINE TAO_ORB_Core * TAO_Connection_Handler::orb_core (void) { @@ -27,32 +40,3 @@ TAO_Connection_Handler::transport (void) { return this->transport_; } - - -ACE_INLINE int -TAO_Connection_Handler::incr_pending_upcalls (void) -{ - ACE_GUARD_RETURN (ACE_Lock, - ace_mon, - *this->pending_upcall_lock_, -1); - - return ++this->pending_upcalls_; - - -} - -ACE_INLINE int -TAO_Connection_Handler::decr_pending_upcalls (void) -{ - ACE_GUARD_RETURN (ACE_Lock, - ace_mon, - *this->pending_upcall_lock_, -1); - - return --this->pending_upcalls_; -} - -ACE_INLINE int -TAO_Connection_Handler::pending_upcalls (void) const -{ - return this->pending_upcalls_; -} diff --git a/TAO/tao/Exclusive_TMS.cpp b/TAO/tao/Exclusive_TMS.cpp index c0c1e3d8755..95cd9d1bd09 100644 --- a/TAO/tao/Exclusive_TMS.cpp +++ b/TAO/tao/Exclusive_TMS.cpp @@ -43,8 +43,7 @@ TAO_Exclusive_TMS::bind_dispatcher (CORBA::ULong request_id, this->request_id_ = request_id; this->rd_ = rd; - return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, - rd); + return 0; } void diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index c0d831655f7..ab1336b0795 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -11,6 +11,7 @@ #include "TAO_Server_Request.h" #include "GIOP_Message_Locate_Header.h" #include "Transport.h" +#include "tao/LF_Strategy.h" #if !defined (__ACE_INLINE__) # include "GIOP_Message_Base.i" @@ -550,11 +551,10 @@ TAO_GIOP_Message_Base::process_request_message (TAO_Transport *transport, size_t wr_pos = qd->msg_block_->wr_ptr () - qd->msg_block_->base (); rd_pos += TAO_GIOP_MESSAGE_HEADER_LEN; - if (TAO_debug_level > 0) - this->dump_msg ("recv", - ACE_reinterpret_cast (u_char *, - qd->msg_block_->rd_ptr ()), - qd->msg_block_->length ()); + this->dump_msg ("recv", + ACE_reinterpret_cast (u_char *, + qd->msg_block_->rd_ptr ()), + qd->msg_block_->length ()); // Create a input CDR stream. @@ -612,11 +612,10 @@ TAO_GIOP_Message_Base::process_reply_message ( size_t wr_pos = qd->msg_block_->wr_ptr () - qd->msg_block_->base (); rd_pos += TAO_GIOP_MESSAGE_HEADER_LEN; - if (TAO_debug_level > 0) - this->dump_msg ("recv", - ACE_reinterpret_cast (u_char *, - qd->msg_block_->rd_ptr ()), - qd->msg_block_->length ()); + this->dump_msg ("recv", + ACE_reinterpret_cast (u_char *, + qd->msg_block_->rd_ptr ()), + qd->msg_block_->length ()); // Create a empty buffer on stack diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index de9e23e9e24..a44b57f15d9 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -10,7 +10,8 @@ #include "tao/GIOP_Message_Locate_Header.h" #include "tao/target_specification.h" #include "tao/Leader_Follower.h" -#include "Transport.h" +#include "tao/LF_Strategy.h" +#include "tao/Transport.h" #if !defined (__ACE_INLINE__) # include "tao/GIOP_Message_Lite.i" @@ -1095,10 +1096,6 @@ TAO_GIOP_Message_Lite::parse_reply (TAO_InputCDR &cdr, } } - // Steal the contents in to the reply CDR and loose ownership of the - // data block. - params.input_cdr_.exchange_data_blocks (cdr); - return 0; } @@ -1553,12 +1550,10 @@ TAO_GIOP_Message_Lite::dump_msg (const char *label, if (ptr[TAO_GIOP_LITE_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REQUEST || ptr[TAO_GIOP_LITE_MESSAGE_TYPE_OFFSET] == TAO_GIOP_REPLY) { - // We are not sure where the read pointer is pointing - // to. So, try to align teh pointer to a 4 byte boundary. - char *buf = ACE_ptr_align_binary (ptr + TAO_GIOP_LITE_HEADER_LEN, 4); - + // @@ Only works if ServiceContextList is empty.... id = ACE_reinterpret_cast (CORBA::ULong *, - (char * ) (buf)); + (char * ) (ptr)); + } // Print. @@ -1570,12 +1565,6 @@ TAO_GIOP_Message_Lite::dump_msg (const char *label, (byte_order == TAO_ENCAP_BYTE_ORDER) ? "my" : "other", message_name, *id)); - - if (TAO_debug_level >= 10) - ACE_HEX_DUMP ((LM_DEBUG, - (const char *) ptr, - len, - ACE_TEXT ("GIOP lite message"))); } } diff --git a/TAO/tao/GIOP_Message_State.cpp b/TAO/tao/GIOP_Message_State.cpp index 1dfe9bacf32..82ccec8d474 100644 --- a/TAO/tao/GIOP_Message_State.cpp +++ b/TAO/tao/GIOP_Message_State.cpp @@ -71,16 +71,9 @@ TAO_GIOP_Message_State::parse_message_header_i (ACE_Message_Block &incoming) // Get the message type this->message_type_ = buf[TAO_GIOP_MESSAGE_TYPE_OFFSET]; - // Get the size of the message.. this->get_payload_size (buf); -#if 0 - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) Message size is [%d] \n"), - this->message_size_)); -#endif - if (this->message_size_ == 0) { if (TAO_debug_level > 0) diff --git a/TAO/tao/IIOP_Connection_Handler.cpp b/TAO/tao/IIOP_Connection_Handler.cpp index 315aede9bf4..64031b78804 100644 --- a/TAO/tao/IIOP_Connection_Handler.cpp +++ b/TAO/tao/IIOP_Connection_Handler.cpp @@ -23,6 +23,7 @@ ACE_RCSID(tao, IIOP_Connection_Handler, "$Id$") TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (ACE_Thread_Manager *t) : TAO_IIOP_SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), + pending_upcalls_ (1), tcp_properties_ (0), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { @@ -36,17 +37,18 @@ TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (ACE_Thread_Manager *t) TAO_IIOP_Connection_Handler::TAO_IIOP_Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, + CORBA::Boolean /* flag*/, void *arg) : TAO_IIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), + pending_upcalls_ (1), tcp_properties_ (ACE_static_cast (TAO_IIOP_Properties *, arg)), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { TAO_IIOP_Transport* specific_transport = 0; ACE_NEW(specific_transport, - TAO_IIOP_Transport (this, orb_core, flag)); + TAO_IIOP_Transport (this, orb_core, 0)); // store this pointer (indirectly increment ref count) this->transport(specific_transport); @@ -204,9 +206,8 @@ TAO_IIOP_Connection_Handler::handle_close (ACE_HANDLE handle, handle, rm)); - long upcalls = this->decr_pending_upcalls (); - - if (upcalls <= 0) + --this->pending_upcalls_; + if (this->pending_upcalls_ <= 0) { if (this->transport ()->wait_strategy ()->is_registered ()) { @@ -330,7 +331,7 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE) { // Increase the reference count on the upcall that have passed us. - this->incr_pending_upcalls (); + this->pending_upcalls_++; this->resume_flag_ = TAO_RESUMES_CONNECTION_HANDLER; TAO_Resume_Handle resume_handle (this->orb_core (), @@ -339,7 +340,7 @@ TAO_IIOP_Connection_Handler::handle_input (ACE_HANDLE) int retval = this->transport ()->handle_input_i (resume_handle); // The upcall is done. Bump down the reference count - if (this->decr_pending_upcalls () <= 0) + if (--this->pending_upcalls_ <= 0) retval = -1; if (retval == -1) diff --git a/TAO/tao/IIOP_Connection_Handler.h b/TAO/tao/IIOP_Connection_Handler.h index 1f7d0dead44..aa8262e039b 100644 --- a/TAO/tao/IIOP_Connection_Handler.h +++ b/TAO/tao/IIOP_Connection_Handler.h @@ -138,6 +138,12 @@ protected: private: + /// Count nested upcalls on this + /// svc_handler i.e., the connection can close during nested upcalls, + /// you should not delete the svc_handler until the stack unwinds + /// from the nested upcalls. + long pending_upcalls_; + /// TCP configuration for this connection. TAO_IIOP_Properties *tcp_properties_; diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 2b63e7da11a..590de76032d 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -632,7 +632,7 @@ TAO_GIOP_Synch_Invocation::invoke_i (CORBA::Boolean is_locate_request, int reply_error = this->transport_->wait_strategy ()->wait (this->max_wait_time_, - this->rd_.reply_received ()); + this->rd_); if (TAO_debug_level > 0 && this->max_wait_time_ != 0) @@ -804,7 +804,7 @@ TAO_GIOP_Twoway_Invocation::start (CORBA_Environment &ACE_TRY_ENV) TAO_GIOP_Invocation::start (ACE_TRY_ENV); ACE_CHECK; - this->rd_.reply_received () = 0; + this->rd_.state_changed (TAO_LF_Event::LFS_ACTIVE); } // Send request, block until any reply comes back, and unmarshal reply @@ -984,7 +984,7 @@ TAO_GIOP_Locate_Request_Invocation::start (CORBA_Environment &ACE_TRY_ENV) this->transport_->generate_locate_request (this->target_spec_, this->op_details_, this->out_stream_); - this->rd_.reply_received () = 0; + this->rd_.state_changed (TAO_LF_Event::LFS_ACTIVE); } // Send request, block until any reply comes back. diff --git a/TAO/tao/LF_Event.cpp b/TAO/tao/LF_Event.cpp new file mode 100644 index 00000000000..3b03c0b59ad --- /dev/null +++ b/TAO/tao/LF_Event.cpp @@ -0,0 +1,104 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Event.h" +#include "tao/LF_Follower.h" +#include "tao/Leader_Follower.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Event.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Event, "$Id$") + +TAO_LF_Event::TAO_LF_Event (void) + : state_ (TAO_LF_Event::LFS_IDLE) + , follower_ (0) +{ +} + +TAO_LF_Event::~TAO_LF_Event (void) +{ +} + +void +TAO_LF_Event::state_changed (int new_state) +{ + if (this->follower_ == 0) + { + this->state_changed_i (new_state); + } + else + { + TAO_Leader_Follower &leader_follower = + this->follower_->leader_follower (); + + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, leader_follower.lock ()); + + this->state_changed_i (new_state); + + this->follower_->signal (); + } +} + +void +TAO_LF_Event::state_changed_i (int new_state) +{ + if (this->state_ == new_state) + return; + + // Validate the state change + if (this->state_ == TAO_LF_Event::LFS_IDLE) + { + // From the LFS_IDLE state we can only become active. + if (new_state == TAO_LF_Event::LFS_ACTIVE + || new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED) + this->state_ = new_state; + return; + } + else if (this->state_ == TAO_LF_Event::LFS_ACTIVE) + { + // From LFS_ACTIVE we can only move to a few states + if (new_state != TAO_LF_Event::LFS_IDLE) + { + if (new_state == TAO_LF_Event::LFS_CONNECTION_CLOSED) + { + this->state_ = TAO_LF_Event::LFS_FAILURE; + } + else + { + this->state_ = new_state; + } + } + return; + } + else if (this->state_ == TAO_LF_Event::LFS_SUCCESS + || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED) + { + // From the two states above we can go back to ACTIVE, as when a + // request is restarted. + if (new_state == TAO_LF_Event::LFS_ACTIVE) + { + this->state_ = new_state; + } + return; + } + else /* if (this->state_ == TAO_LF_Event::LFS_TIMEOUT || FAILURE ) */ + { + // Other states are final... + } +} + +int +TAO_LF_Event::successful (void) const +{ + return this->state_ == TAO_LF_Event::LFS_SUCCESS; +} + +int +TAO_LF_Event::error_detected (void) const +{ + return (this->state_ == TAO_LF_Event::LFS_FAILURE + || this->state_ == TAO_LF_Event::LFS_TIMEOUT + || this->state_ == TAO_LF_Event::LFS_CONNECTION_CLOSED); +} diff --git a/TAO/tao/LF_Event.h b/TAO/tao/LF_Event.h new file mode 100644 index 00000000000..a71dfa7bb89 --- /dev/null +++ b/TAO/tao/LF_Event.h @@ -0,0 +1,124 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Event.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_EVENT_H +#define TAO_LF_EVENT_H +#include "ace/pre.h" + +#include "corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Transport; +class TAO_LF_Follower; + +/** + * @class TAO_LF_Event + * + * @brief Use the Leader/Follower loop to wait for one specific event. + * + * The Leader/Follower event loop is used to wait for incoming + * responses, as well as to wait for all the data to be flushed. + * This class encapsulates this event loop. It uses Template Method to + * parametrize the 'waited for' predicate (i.e. reply received or + * message sent.) + * + * @todo Implementing the Leader/Followers loop in this class, as + * well as the callbacks to communicate that an event has completed + * leads to excessive coupling. A better design would use a separate + * class to signal the events, that would allow us to remove the + * Leader/Followers logic from the ORB. However, that requires other + * major changes and it somewhat complicates the design. + * + */ +class TAO_Export TAO_LF_Event +{ +public: + /// Constructor + TAO_LF_Event (void); + + /// Destructor + virtual ~TAO_LF_Event (void); + + /// Bind a follower + /** + * An event can be waited on by at most one follower thread, this + * method is used to bind the waiting thread to the event, in order + * to let the event signal any important state changes. + * + * @return -1 if the LF_Event is already bound, 0 otherwise + */ + int bind (TAO_LF_Follower *follower); + + /// Unbind the follower + int unbind (void); + + //@{ + /** @name State management + * + * A Leader/Followers event goes through several states during its + * lifetime. We use an enum to represent those states and state + * changes are validated according to the rules below. + * + */ + enum { + /// The event is created, initial state can only move to + /// LFS_ACTIVE + LFS_IDLE, + /// The event is active, can change to any of the following + /// states, each of them is a final state + LFS_ACTIVE, + /// The event has completed successfully + LFS_SUCCESS, + /// A failure has been detected while the event was active + LFS_FAILURE, + /// The event has timed out + LFS_TIMEOUT, + /// The connection was closed while the state was active + LFS_CONNECTION_CLOSED + }; + + /// Change the state + void state_changed (int new_state); + + /// Return 1 if the condition was satisfied successfully, 0 if it + /// has not + int successful (void) const; + + /// Return 1 if an error was detected while waiting for the + /// event + int error_detected (void) const; + //@} + + /// Check if we should keep waiting. + int keep_waiting (void); + +protected: + /// Validate the state change + void state_changed_i (int new_state); + +private: + /// The current state + int state_; + + /// The bound follower thread + TAO_LF_Follower *follower_; +}; + +#if defined (__ACE_INLINE__) +# include "LF_Event.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_EVENT_H */ diff --git a/TAO/tao/LF_Event.inl b/TAO/tao/LF_Event.inl new file mode 100644 index 00000000000..67b7083ad36 --- /dev/null +++ b/TAO/tao/LF_Event.inl @@ -0,0 +1,25 @@ +// $Id$ + +ACE_INLINE int +TAO_LF_Event::bind (TAO_LF_Follower *follower) +{ + if (this->follower_ != 0) + return -1; + this->follower_ = follower; + return 0; +} + +ACE_INLINE int +TAO_LF_Event::unbind (void) +{ + if (this->follower_ == 0) + return -1; + this->follower_ = 0; + return 0; +} + +ACE_INLINE int +TAO_LF_Event::keep_waiting (void) +{ + return (this->successful () == 0) && (this->error_detected () == 0); +} diff --git a/TAO/tao/LF_Event_Binder.cpp b/TAO/tao/LF_Event_Binder.cpp new file mode 100644 index 00000000000..afa12f4a5b3 --- /dev/null +++ b/TAO/tao/LF_Event_Binder.cpp @@ -0,0 +1,10 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Event_Binder.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Event_Binder.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Event_Binder, "$Id$") diff --git a/TAO/tao/LF_Event_Binder.h b/TAO/tao/LF_Event_Binder.h new file mode 100644 index 00000000000..1cc7a32afa5 --- /dev/null +++ b/TAO/tao/LF_Event_Binder.h @@ -0,0 +1,51 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Event_Binder.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_EVENT_BINDER_H +#define TAO_LF_EVENT_BINDER_H +#include "ace/pre.h" + +#include "tao/LF_Event.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_LF_Follower; + +/** + * @brief Implement an auto_ptr-like class for the TAO_LF_Followers + * allocated via a TAO_Leader_Follower set. + * + * The Leader/Follower set is a factory for TAO_LF_Follower objects + */ +class TAO_Export TAO_LF_Event_Binder +{ +public: + /// Constructor + TAO_LF_Event_Binder (TAO_LF_Event *event, + TAO_LF_Follower *folloer); + + /// Destructor + ~TAO_LF_Event_Binder (void); + +private: + /// Keep a reference to the leader follower + TAO_LF_Event *event_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Event_Binder.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_EVENT_BINDER_H */ diff --git a/TAO/tao/LF_Event_Binder.inl b/TAO/tao/LF_Event_Binder.inl new file mode 100644 index 00000000000..e674cb6e08b --- /dev/null +++ b/TAO/tao/LF_Event_Binder.inl @@ -0,0 +1,16 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Event_Binder::TAO_LF_Event_Binder (TAO_LF_Event *event, + TAO_LF_Follower *follower) + : event_ (event) +{ + this->event_->bind (follower); +} + + +ACE_INLINE +TAO_LF_Event_Binder::~TAO_LF_Event_Binder (void) +{ + this->event_->unbind (); +} diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.cpp b/TAO/tao/LF_Event_Loop_Thread_Helper.cpp new file mode 100644 index 00000000000..e2569345d13 --- /dev/null +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.cpp @@ -0,0 +1,10 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Event_Loop_Thread_Helper.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Event_Loop_Thread_Helper.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Event_Loop_Thread_Helper, "$Id$") diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.h b/TAO/tao/LF_Event_Loop_Thread_Helper.h new file mode 100644 index 00000000000..5edde3028b1 --- /dev/null +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.h @@ -0,0 +1,62 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Event_Loop_Thread_Helper.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_EVENT_LOOP_THREAD_HELPER_H +#define TAO_LF_EVENT_LOOP_THREAD_HELPER_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/LF_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @brief Helper class to enter and exit the Leader/Followers event + * loop. + * + * Uses the Guard idiom to enter and exit the Leader/Followers event + * loop. + */ +class TAO_Export TAO_LF_Event_Loop_Thread_Helper +{ +public: + /// Constructor + TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower, + TAO_LF_Strategy &lf_strategy, + ACE_Time_Value *max_wait_time); + + /// Destructor + ~TAO_LF_Event_Loop_Thread_Helper (void); + + /// Calls <set_event_loop_thread> on the leader/followers object. + int event_loop_return (void) const; + +private: + /// Reference to leader/followers object. + TAO_Leader_Follower &leader_follower_; + + /// The Leader/Follower Strategy used by this ORB. + TAO_LF_Strategy &lf_strategy_; + + /// Remembers the status returned while trying to enter the event + /// loop. + int event_loop_return_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Event_Loop_Thread_Helper.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_EVENT_LOOP_THREAD_HELPER_H */ diff --git a/TAO/tao/LF_Event_Loop_Thread_Helper.inl b/TAO/tao/LF_Event_Loop_Thread_Helper.inl new file mode 100644 index 00000000000..d3db7e44eea --- /dev/null +++ b/TAO/tao/LF_Event_Loop_Thread_Helper.inl @@ -0,0 +1,28 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Event_Loop_Thread_Helper:: + TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower, + TAO_LF_Strategy &lf_strategy, + ACE_Time_Value *max_wait_time) + : leader_follower_ (leader_follower) + , lf_strategy_ (lf_strategy) +{ + this->event_loop_return_ = + this->lf_strategy_.set_event_loop_thread (max_wait_time, leader_follower_); +} + +ACE_INLINE +TAO_LF_Event_Loop_Thread_Helper::~TAO_LF_Event_Loop_Thread_Helper (void) +{ + int call_reset = (this->event_loop_return_ == 0); + this->lf_strategy_.reset_event_loop_thread (call_reset, + this->leader_follower_); +} + +ACE_INLINE int +TAO_LF_Event_Loop_Thread_Helper::event_loop_return (void) const +{ + return this->event_loop_return_; +} + diff --git a/TAO/tao/LF_Follower.cpp b/TAO/tao/LF_Follower.cpp new file mode 100644 index 00000000000..ef5114a42a8 --- /dev/null +++ b/TAO/tao/LF_Follower.cpp @@ -0,0 +1,46 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Follower.h" +#include "tao/Leader_Follower.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Follower.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Follower, "$Id$") + +TAO_LF_Follower::TAO_LF_Follower (TAO_Leader_Follower &leader_follower) + : leader_follower_ (leader_follower) + , condition_ (leader_follower.lock ()) +{ +} + +TAO_LF_Follower::~TAO_LF_Follower (void) +{ +} + +int +TAO_LF_Follower::signal (void) +{ + // We *must* remove ourselves from the list of followers, otherwise + // we could get signalled twice: to wake up as a follower and as the + // next leader. + // The follower may not be there if the reply is received while + // the consumer is not yet waiting for it (i.e. it send the + // request but has not blocked to receive the reply yet). + // Ignore errors. + (void) this->leader_follower_.remove_follower (this); + + return this->condition_.signal (); +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +template class ACE_Intrusive_List_Node<TAO_LF_Follower>; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#pragma instantiate ACE_Intrusive_List_Node<TAO_LF_Follower> + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/LF_Follower.h b/TAO/tao/LF_Follower.h new file mode 100644 index 00000000000..2f7092c1278 --- /dev/null +++ b/TAO/tao/LF_Follower.h @@ -0,0 +1,69 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Follower.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_FOLLOWER_H +#define TAO_LF_FOLLOWER_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/TAO_Export.h" +#include "ace/Synch.h" +#include "ace/Intrusive_List_Node.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Leader_Follower; + +/** + * @class TAO_LF_Follower + * + * @brief Represent a thread blocked, as a follower, in the + * Leader/Followers set. + * + * @todo Currently this class offers little abstraction, the follower + * loop should be implemented by this class. + * + */ +class TAO_Export TAO_LF_Follower : public ACE_Intrusive_List_Node<TAO_LF_Follower> +{ +public: + /// Constructor + TAO_LF_Follower (TAO_Leader_Follower &leader_follower); + + /// Destructor + ~TAO_LF_Follower (void); + + /// Access the leader follower that owns this follower + TAO_Leader_Follower &leader_follower (void); + + /// Wait until on the underlying condition variable + int wait (ACE_Time_Value *tv); + + /// Signal the underlying condition variable + int signal (void); + +private: + /// The Leader/Follower set this Follower belongs to + TAO_Leader_Follower &leader_follower_; + + /// Condition variable used to + ACE_SYNCH_CONDITION condition_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Follower.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_FOLLOWER_H */ diff --git a/TAO/tao/LF_Follower.inl b/TAO/tao/LF_Follower.inl new file mode 100644 index 00000000000..b7e612b94ee --- /dev/null +++ b/TAO/tao/LF_Follower.inl @@ -0,0 +1,13 @@ +// $Id$ + +ACE_INLINE TAO_Leader_Follower & +TAO_LF_Follower::leader_follower (void) +{ + return this->leader_follower_; +} + +ACE_INLINE int +TAO_LF_Follower::wait (ACE_Time_Value *tv) +{ + return this->condition_.wait (tv); +} diff --git a/TAO/tao/LF_Follower_Auto_Adder.cpp b/TAO/tao/LF_Follower_Auto_Adder.cpp new file mode 100644 index 00000000000..353005b1dc8 --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Adder.cpp @@ -0,0 +1,15 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Follower_Auto_Adder.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Follower_Auto_Adder.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Follower_Auto_Adder, "$Id$") + +TAO_LF_Follower_Auto_Adder::~TAO_LF_Follower_Auto_Adder (void) +{ + this->leader_follower_.remove_follower (this->follower_); +} diff --git a/TAO/tao/LF_Follower_Auto_Adder.h b/TAO/tao/LF_Follower_Auto_Adder.h new file mode 100644 index 00000000000..0a6bf3f6642 --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Adder.h @@ -0,0 +1,55 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Follower_Auto_Adder.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_FOLLOWER_AUTO_ADDER_H +#define TAO_LF_FOLLOWER_AUTO_ADDER_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/Leader_Follower.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_LF_Follower; + +/** + * @brief Implement an auto_adder-like class for the TAO_LF_Followers + * allocated via a TAO_Leader_Follower set. + * + * The Leader/Follower set is a factory for TAO_LF_Follower objects + */ +class TAO_Export TAO_LF_Follower_Auto_Adder +{ +public: + /// Constructor + TAO_LF_Follower_Auto_Adder (TAO_Leader_Follower &, + TAO_LF_Follower *follower); + + /// Destructor + ~TAO_LF_Follower_Auto_Adder (void); + +private: + /// Keep a reference to the leader follower + TAO_Leader_Follower &leader_follower_; + + /// The follower + TAO_LF_Follower *follower_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Follower_Auto_Adder.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_FOLLOWER_AUTO_ADDER_H */ diff --git a/TAO/tao/LF_Follower_Auto_Adder.inl b/TAO/tao/LF_Follower_Auto_Adder.inl new file mode 100644 index 00000000000..62817754d77 --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Adder.inl @@ -0,0 +1,11 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Follower_Auto_Adder:: + TAO_LF_Follower_Auto_Adder (TAO_Leader_Follower &lf, + TAO_LF_Follower *follower) + : leader_follower_ (lf) + , follower_ (follower) +{ + (void) this->leader_follower_.add_follower (this->follower_); +} diff --git a/TAO/tao/LF_Follower_Auto_Ptr.cpp b/TAO/tao/LF_Follower_Auto_Ptr.cpp new file mode 100644 index 00000000000..acb28b3e34e --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Ptr.cpp @@ -0,0 +1,15 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Follower_Auto_Ptr.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Follower_Auto_Ptr.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Follower_Auto_Ptr, "$Id$") + +TAO_LF_Follower_Auto_Ptr::~TAO_LF_Follower_Auto_Ptr (void) +{ + this->leader_follower_.release_follower (this->follower_); +} diff --git a/TAO/tao/LF_Follower_Auto_Ptr.h b/TAO/tao/LF_Follower_Auto_Ptr.h new file mode 100644 index 00000000000..d76fceab0fd --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Ptr.h @@ -0,0 +1,59 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Follower_Auto_Ptr.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_FOLLOWER_AUTO_PTR_H +#define TAO_LF_FOLLOWER_AUTO_PTR_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/Leader_Follower.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_LF_Follower; + +/** + * @brief Implement an auto_ptr-like class for the TAO_LF_Followers + * allocated via a TAO_Leader_Follower set. + * + * The Leader/Follower set is a factory for TAO_LF_Follower objects + */ +class TAO_Export TAO_LF_Follower_Auto_Ptr +{ +public: + /// Constructor + TAO_LF_Follower_Auto_Ptr (TAO_Leader_Follower &); + + /// Destructor + ~TAO_LF_Follower_Auto_Ptr (void); + + /// Implement the smart pointer methods + TAO_LF_Follower *get (void); + TAO_LF_Follower *operator->(void); + operator TAO_LF_Follower *(void); + +private: + /// Keep a reference to the leader follower + TAO_Leader_Follower &leader_follower_; + + /// The follower + TAO_LF_Follower *follower_; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Follower_Auto_Ptr.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_FOLLOWER_AUTO_PTR_H */ diff --git a/TAO/tao/LF_Follower_Auto_Ptr.inl b/TAO/tao/LF_Follower_Auto_Ptr.inl new file mode 100644 index 00000000000..43deadfca37 --- /dev/null +++ b/TAO/tao/LF_Follower_Auto_Ptr.inl @@ -0,0 +1,26 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Follower_Auto_Ptr::TAO_LF_Follower_Auto_Ptr (TAO_Leader_Follower &lf) + : leader_follower_ (lf) + , follower_ (leader_follower_.allocate_follower ()) +{ +} + +ACE_INLINE TAO_LF_Follower * +TAO_LF_Follower_Auto_Ptr::get (void) +{ + return this->follower_; +} + +ACE_INLINE TAO_LF_Follower * +TAO_LF_Follower_Auto_Ptr::operator-> (void) +{ + return this->follower_; +} + +ACE_INLINE +TAO_LF_Follower_Auto_Ptr::operator TAO_LF_Follower * (void) +{ + return this->follower_; +} diff --git a/TAO/tao/LF_Strategy.cpp b/TAO/tao/LF_Strategy.cpp new file mode 100644 index 00000000000..e1717c7baf0 --- /dev/null +++ b/TAO/tao/LF_Strategy.cpp @@ -0,0 +1,14 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Strategy.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Strategy.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Strategy, "$Id$") + +TAO_LF_Strategy::~TAO_LF_Strategy (void) +{ +} diff --git a/TAO/tao/LF_Strategy.h b/TAO/tao/LF_Strategy.h new file mode 100644 index 00000000000..248f52863e2 --- /dev/null +++ b/TAO/tao/LF_Strategy.h @@ -0,0 +1,76 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Strategy.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_STRATEGY_H +#define TAO_LF_STRATEGY_H +#include "ace/pre.h" + +#include "tao/orbconf.h" +#include "tao/TAO_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Leader_Follower; + +/** + * @brief Strategize Leader/Follower manipulations in the ORB event + * loop. + * + * The ORB event loop must participate in the Leader/Followers + * protocol, but only if that concurrency model is configured, + * otherwise performance suffers. + * + * This class strategizes the ORB behavior in this respect. + * + */ +class TAO_Export TAO_LF_Strategy +{ +public: + /// Destructor + virtual ~TAO_LF_Strategy (void); + + /// The current thread will handle an upcall + /** + * Threads that handle requests can block for long periods of time, + * causing deadlocks if they don't elect a new leader before + * starting the upcall the system can become non-responsive or + * dead-lock. + */ + virtual void set_upcall_thread (TAO_Leader_Follower &) = 0; + + /// The current thread is entering the reactor event loop + /** + * Threads that block in the reactor event loop become "server" + * threads for the Leader/Follower set. They must be flagged + * specially because they do not wait for one specific event, but + * for any event whatsoever. + */ + virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, + TAO_Leader_Follower &) = 0; + + /// The current thread is leaving the event loop + /** + * When the thread leaves the event loop a new leader must be + * elected. + */ + virtual void reset_event_loop_thread (int call_reset, + TAO_Leader_Follower &) = 0; +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Strategy.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_STRATEGY_H */ diff --git a/TAO/tao/LF_Strategy.inl b/TAO/tao/LF_Strategy.inl new file mode 100644 index 00000000000..74e88caa0c5 --- /dev/null +++ b/TAO/tao/LF_Strategy.inl @@ -0,0 +1,2 @@ +// $Id$ + diff --git a/TAO/tao/LF_Strategy_Complete.cpp b/TAO/tao/LF_Strategy_Complete.cpp new file mode 100644 index 00000000000..7bda47e9b16 --- /dev/null +++ b/TAO/tao/LF_Strategy_Complete.cpp @@ -0,0 +1,47 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/LF_Strategy_Complete.h" +#include "tao/Leader_Follower.h" + +#if !defined (__ACE_INLINE__) +# include "tao/LF_Strategy_Complete.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Strategy_Complete, "$Id$") + +TAO_LF_Strategy_Complete::~TAO_LF_Strategy_Complete (void) +{ +} + +void +TAO_LF_Strategy_Complete::set_upcall_thread (TAO_Leader_Follower &lf) +{ + lf.set_upcall_thread (); +} + +int +TAO_LF_Strategy_Complete::set_event_loop_thread (ACE_Time_Value *tv, + TAO_Leader_Follower &lf) +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, lf.lock (), -1); + + return lf.set_event_loop_thread (tv); +} + +void +TAO_LF_Strategy_Complete::reset_event_loop_thread (int call_reset, + TAO_Leader_Follower &lf) +{ + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, lf.lock ()); + + if (call_reset) + lf.reset_event_loop_thread (); + + int result = lf.elect_new_leader (); + + if (result == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) Failed to wake up ") + ACE_TEXT ("a follower thread\n"))); +} diff --git a/TAO/tao/LF_Strategy_Complete.h b/TAO/tao/LF_Strategy_Complete.h new file mode 100644 index 00000000000..13084461979 --- /dev/null +++ b/TAO/tao/LF_Strategy_Complete.h @@ -0,0 +1,52 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Strategy_Complete.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_STRATEGY_COMPLETE_H +#define TAO_LF_STRATEGY_COMPLETE_H +#include "ace/pre.h" + +#include "tao/LF_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @brief A concrete TAO_LF_Strategy for ORB configurations that use + * the Leader/Followers event loop. + */ +class TAO_Export TAO_LF_Strategy_Complete : public TAO_LF_Strategy +{ +public: + /// Constructor + TAO_LF_Strategy_Complete (void); + + //@{ + /** @name Virtual Methods + * + * Please check the documentation in TAO_LF_Strategy + */ + virtual ~TAO_LF_Strategy_Complete (void); + + virtual void set_upcall_thread (TAO_Leader_Follower &); + virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, + TAO_Leader_Follower &); + virtual void reset_event_loop_thread (int call_reset, + TAO_Leader_Follower &); +}; + +#if defined (__ACE_INLINE__) +# include "tao/LF_Strategy_Complete.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_STRATEGY_COMPLETE_H */ diff --git a/TAO/tao/LF_Strategy_Complete.inl b/TAO/tao/LF_Strategy_Complete.inl new file mode 100644 index 00000000000..240b3ba5dd0 --- /dev/null +++ b/TAO/tao/LF_Strategy_Complete.inl @@ -0,0 +1,6 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Strategy_Complete::TAO_LF_Strategy_Complete (void) +{ +} diff --git a/TAO/tao/Leader_Follower.cpp b/TAO/tao/Leader_Follower.cpp index 342271f87a5..c94e471e05d 100644 --- a/TAO/tao/Leader_Follower.cpp +++ b/TAO/tao/Leader_Follower.cpp @@ -1,122 +1,65 @@ // $Id$ -#include "Leader_Follower.h" -#include "Resource_Factory.h" +#include "tao/Leader_Follower.h" +#include "tao/Resource_Factory.h" +#include "tao/LF_Follower.h" +#include "tao/LF_Follower_Auto_Ptr.h" +#include "tao/LF_Follower_Auto_Adder.h" +#include "tao/LF_Event.h" +#include "tao/LF_Event_Binder.h" + +#include "tao/Transport.h" #include "ace/Reactor.h" #if !defined (__ACE_INLINE__) -# include "Leader_Follower.i" +# include "tao/Leader_Follower.i" #endif /* ! __ACE_INLINE__ */ ACE_RCSID(tao, Leader_Follower, "$Id$") TAO_Leader_Follower::~TAO_Leader_Follower (void) { + while (!this->follower_free_list_.empty ()) + { + TAO_LF_Follower *follower = + this->follower_free_list_.pop_front (); + delete follower; + } // Hand the reactor back to the resource factory. this->orb_core_->resource_factory ()->reclaim_reactor (this->reactor_); this->reactor_ = 0; } -TAO_Leader_Follower::TAO_Follower_Node::TAO_Follower_Node (TAO_SYNCH_CONDITION* follower_ptr) - : follower_ (follower_ptr), - next_ (0) +TAO_LF_Follower * +TAO_Leader_Follower::allocate_follower (void) { + if (!this->follower_free_list_.empty ()) + return this->follower_free_list_.pop_front (); + return new TAO_LF_Follower (*this); } - -TAO_Leader_Follower::TAO_Follower_Queue::TAO_Follower_Queue (void) - : head_ (0), - tail_ (0) -{ - -} - -int -TAO_Leader_Follower::TAO_Follower_Queue::insert (TAO_Follower_Node* node) +void +TAO_Leader_Follower::release_follower (TAO_LF_Follower *follower) { - if (this->head_ == 0) { - this->head_ = node; - this->tail_ = node; - // Make sure that we don't have garbage in the case when the same node - // is added a second time. This is necessary as the nodes are on the - // stack. - node->next_ = 0; - } - else - { - // Add the node to the tail and modify the pointers - TAO_Follower_Node* temp = this->tail_; - temp->next_ = node; - this->tail_ = node; - node->next_ = 0; - } - return 0; + this->follower_free_list_.push_front (follower); } int -TAO_Leader_Follower::TAO_Follower_Queue::remove (TAO_Follower_Node* node) -{ - TAO_Follower_Node* prev = 0; - TAO_Follower_Node* curr = 0; - - // No followers in queue, return - if (this->head_ == 0) - return -1; - - // Check is for whether we have the same condition variable on the - // queue rather than the same node structure which wraps it. - for (curr = this->head_; - curr != 0 && curr->follower_ != node->follower_; - curr = curr->next_) - { - prev = curr; - } - - // Entry not found in the queue - if (curr == 0) - return -1; - // Entry found at the head of the queue - else if (prev == 0) - this->head_ = this->head_->next_; - else - prev->next_ = curr->next_; - // Entry at the tail - if (curr->next_ == 0) - this->tail_ = prev; - - return 0; -} - - -TAO_SYNCH_CONDITION* -TAO_Leader_Follower::get_next_follower (void) +TAO_Leader_Follower::elect_new_leader_i (void) { - // If the queue is empty return - if (this->follower_set_.is_empty()) - return 0; - - TAO_Follower_Node* next_follower = this->follower_set_.head_; - - TAO_SYNCH_CONDITION *cond = next_follower->follower_; + TAO_LF_Follower* follower = + this->follower_set_.head (); #if defined (TAO_DEBUG_LEADER_FOLLOWER) ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) LF::get_next_follower - " + "TAO (%P|%t) LF::elect_new_leader_i - " "follower is %x\n", - cond)); + follower)); #endif /* TAO_DEBUG_LEADER_FOLLOWER */ - // We *must* remove it when we signal it so the same condition is - // not signalled for both wake up as a follower and as the next - // leader. - // The follower may not be there if the reply is received while the - // consumer is not yet waiting for it (i.e. it send the request but - // has not blocked to receive the reply yet) - (void) this->remove_follower (next_follower); // Ignore errors.. - - return cond; + return follower->signal (); } int @@ -225,77 +168,284 @@ TAO_Leader_Follower::reset_client_thread (void) } } -TAO_LF_Strategy::TAO_LF_Strategy () +int +TAO_Leader_Follower::wait_for_event (TAO_LF_Event *event, + TAO_Transport *transport, + ACE_Time_Value *max_wait_time) { -} + // Obtain the lock. + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock (), -1); + + // Optmize the first iteration [no access to errno] + int result = 1; + + { + // Calls this->set_client_thread () on construction and + // this->reset_client_thread () on destruction. + TAO_LF_Client_Thread_Helper client_thread_helper (*this); + ACE_UNUSED_ARG (client_thread_helper); + + ACE_Countdown_Time countdown (max_wait_time); + + // Check if there is a leader. Note that it cannot be us since we + // gave up our leadership when we became a client. + if (this->leader_available ()) + { + // = Wait as a follower. + + // Grab a follower: + TAO_LF_Follower_Auto_Ptr follower (*this); + if (follower.get () == 0) + return -1; + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " (follower) on Transport <%d>, cond <%x>\n", + transport->id (), + follower.get ())); + + // Bound the follower and the LF_Event, this is important to + // get a signal when the event terminates + TAO_LF_Event_Binder event_binder (event, follower.get ()); + + while (event->keep_waiting () && + this->leader_available ()) + { + // Add ourselves to the list, do it everytime we wake up + // from the CV loop. Because: + // + // - The leader thread could have elected us as the new + // leader. + // - Before we can assume the role another thread becomes + // the leader + // - But our condition variable could have been removed + // already, if we don't add it again we will never wake + // up. + // + // Notice that we can have spurious wake ups, in that case + // adding the leader results in an error, that must be + // ignored. + // You may be thinking of not removing the condition + // variable in the code that sends the signal, but + // removing it here, that does not work either, in that + // case the condition variable may be used twice: + // + // - Wake up because its reply arrived + // - Wake up because it must become the leader + // + // but only the first one has any effect, so the leader is + // lost. + // + + TAO_LF_Follower_Auto_Adder auto_adder (*this, follower); + + if (max_wait_time == 0) + { + if (follower->wait (max_wait_time) == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait_for_event, " + " (follower) on <%d>" + " [no timer, cond failed]\n", + transport->id ())); + + // @@ Michael: What is our error handling in this case? + // We could be elected as leader and + // no leader would come in? + return -1; + } + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (follower->wait (&tv) == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait," + " (follower) on <%x> " + " [has timer, follower failed]\n", + transport->id ())); + + if (!event->successful ()) + { + // Remove follower can fail because either + // 1) the condition was satisfied (i.e. reply + // received or queue drained), or + // 2) somebody elected us as leader, or + // 3) the connection got closed. + // + // Therefore: + // If remove_follower fails and the condition + // was not satisfied, we know that we got + // elected as a leader. + // But we got a timeout, so we cannot become + // the leader, therefore, we have to select a + // new leader. + // + + if (this->elect_new_leader () == -1 + && TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " elect_new_leader failed\n")); + } + } + return -1; + } + } + } + + countdown.update (); + + // @@ Michael: This is an old comment why we do not want to + // remove the follower here. + // We should not remove the follower here, we *must* remove it when + // we signal it so the same condition is not signalled for + // both wake up as a follower and as the next leader. + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " done (follower) on <%d>, successful %d\n", + transport->id (), + event->successful ())); + + // Now somebody woke us up to become a leader or to handle our + // input. We are already removed from the follower queue. + + if (event->successful ()) + return 0; + + if (event->error_detected ()) + return -1; + + // FALLTHROUGH + // We only get here if we woke up but the reply is not + // complete yet, time to assume the leader role.... + // i.e. ACE_ASSERT (event->successful () == 0); + } + + // = Leader Code. + + // The only way to reach this point is if we must become the + // leader, because there is no leader or we have to update to a + // leader or we are doing nested upcalls in this case we do + // increase the refcount on the leader in TAO_ORB_Core. + + // Calls this->set_client_leader_thread () on + // construction and this->reset_client_leader_thread () + // on destruction. Note that this may increase the refcount of + // the leader. + TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (*this); + ACE_UNUSED_ARG (client_leader_thread_helper); -TAO_LF_Strategy::~TAO_LF_Strategy () -{ -} + { + ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>, rev_mon, + this->reverse_lock (), -1); -TAO_Complete_LF_Strategy::TAO_Complete_LF_Strategy () -{ -} + // Become owner of the reactor. + ACE_Reactor *reactor = this->reactor_; + reactor->owner (ACE_Thread::self ()); -TAO_Complete_LF_Strategy::~TAO_Complete_LF_Strategy () -{ -} + // Run the reactor event loop. -void -TAO_Complete_LF_Strategy::set_upcall_thread (TAO_Leader_Follower &leader_follower) -{ - leader_follower.set_upcall_thread (); -} + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " (leader) enter reactor event loop on <%d>\n", + transport->id ())); -int -TAO_Complete_LF_Strategy::set_event_loop_thread (ACE_Time_Value *max_wait_time, - TAO_Leader_Follower &leader_follower) -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, leader_follower.lock (), -1); + // If we got our event, no need to run the event loop any + // further. + while (event->keep_waiting ()) + { + // Run the event loop. + result = reactor->handle_events (max_wait_time); - return leader_follower.set_event_loop_thread (max_wait_time); -} + // Did we timeout? If so, stop running the loop. + if (result == 0 && + max_wait_time != 0 && + *max_wait_time == ACE_Time_Value::zero) + break; -void -TAO_Complete_LF_Strategy::reset_event_loop_thread_and_elect_new_leader (int call_reset, - TAO_Leader_Follower &leader_follower) -{ - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, leader_follower.lock ()); + // Other errors? If so, stop running the loop. + if (result == -1) + break; - if (call_reset) - leader_follower.reset_event_loop_thread (); + // Otherwise, keep going... + } - int result = leader_follower.elect_new_leader (); + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " (leader) exit reactor event loop on <%d>\n", + transport->id ())); + } + } + // + // End artificial scope for auto_ptr like helpers calling: + // this->reset_client_thread () and (maybe) + // this->reset_client_leader_thread (). + // + + // Wake up the next leader, we cannot do that in handle_input, + // because the woken up thread would try to get into handle_events, + // which is at the time in handle_input still occupied. But do it + // before checking the error in <result>, even if there is an error + // in our input we should continue running the loop in another + // thread. + + if (this->elect_new_leader () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " failed to elect new leader\n"), + -1); if (result == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) Failed to wake up ") - ACE_TEXT ("a follower thread\n"))); -} + ACE_ERROR_RETURN ((LM_ERROR, + "TAO (%P|%t) - Leader_Follower::wait_for_event," + " handle_events failed\n"), + -1); -TAO_Null_LF_Strategy::TAO_Null_LF_Strategy () -{ + // Return an error if there was a problem receiving the reply... + if (max_wait_time != 0) + { + if (!event->successful () + && *max_wait_time == ACE_Time_Value::zero) + { + result = -1; + errno = ETIME; + } + else if (event->error_detected ()) + { + // If the time did not expire yet, but we get a failure, + // e.g. the connections closed, we should still return an error. + result = -1; + } + } + else + { + result = 0; + if (event->error_detected ()) + { + result = -1; + } + } + return result; } -TAO_Null_LF_Strategy::~TAO_Null_LF_Strategy () -{ -} +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -void -TAO_Null_LF_Strategy::set_upcall_thread (TAO_Leader_Follower &) -{ -} +template class ACE_Intrusive_List<TAO_LF_Follower>; -int -TAO_Null_LF_Strategy::set_event_loop_thread (ACE_Time_Value *, - TAO_Leader_Follower &) -{ - return 0; -} +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -void -TAO_Null_LF_Strategy::reset_event_loop_thread_and_elect_new_leader (int, - TAO_Leader_Follower &) -{ -} +#pragma instantiate ACE_Intrusive_List<TAO_LF_Follower> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Leader_Follower.h b/TAO/tao/Leader_Follower.h index 2d3b6ae5360..2ff165ca020 100644 --- a/TAO/tao/Leader_Follower.h +++ b/TAO/tao/Leader_Follower.h @@ -13,12 +13,16 @@ #define TAO_LEADER_FOLLOWER_H #include "ace/pre.h" +#include "tao/LF_Follower.h" #include "tao/ORB_Core.h" +#include "ace/Intrusive_List.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +class TAO_LF_Event; + class TAO_Export TAO_Leader_Follower { public: @@ -49,6 +53,22 @@ public: /// A server thread has finished is making a request. void reset_client_thread (void); + /// Wait on the Leader/Followers loop until one event happens. + /** + * @param event The event we wait for, the loop iterates until the + * event is sucessful, or it fails due to timeout, and error or a + * connection closed. + * @param transport The transport attached to the event + * @param max_wait_time Limit the time spent on the loop + * + * @todo Document this better, split the Follower code to the + * TAO_LF_Follower class, we probably don't need the transport + * object. + */ + int wait_for_event (TAO_LF_Event *event, + TAO_Transport *transport, + ACE_Time_Value *max_wait_time); + /// The current thread has become the leader thread in the /// client side leader-follower set. void set_client_leader_thread (void) ; @@ -71,39 +91,62 @@ public: */ int elect_new_leader (void); - /// Node structure for the queue of followers - struct TAO_Export TAO_Follower_Node - { - /// Constructor - TAO_Follower_Node (TAO_SYNCH_CONDITION* follower_ptr); + /** @name Follower creation/destructions + * + * The Leader/Followers set acts as a factory for the Follower + * objects. Followers are used to represent a thread blocked + * waiting in the Follower set. + * + * The Leader/Followers abstraction keeps a list of the waiting + * followers, so it can wake up one when the leader thread stops + * handling events. + * + * For performance reasons the Leader/Followers set uses a pool (or + * free-list) to keep Follower objects unattached to any thread. It + * could be tempting to use TSS to keep such followers, after all a + * thread can only need one such Follower object, however, that does + * not work with multiple Leader/Followers sets, consult this bug + * report for more details: + * + * http://ace.cs.wustl.edu/bugzilla/show_bug.cgi?id=296 + * + */ + //@{ + /// Allocate a new follower to the caller. + TAO_LF_Follower *allocate_follower (void); - /// Follower - TAO_SYNCH_CONDITION *follower_; + /// The caller has finished using a follower. + void release_follower (TAO_LF_Follower *); + //@} - /// Pointer to the next follower - TAO_Follower_Node *next_; - }; - /** - * adds the a follower to the set of followers in the leader- - * follower model - * returns 0 on success, -1 on failure. + /** @name Follower Set Operations + * */ - int add_follower (TAO_Follower_Node *follower_ptr); + //@{ + /// Add a new follower to the set + void add_follower (TAO_LF_Follower *follower); - /// checks for the availablity of a follower - /// returns 1 on available, 0 else - int follower_available (void) const; + /// Removes a follower from the leader-follower set + void remove_follower (TAO_LF_Follower *follower); - /// removes a follower from the leader-follower set - /// returns 0 on success, -1 on failure - int remove_follower (TAO_Follower_Node *follower_ptr); + /// Checks if there are any followers available + /** + * @return 1 if there follower set is not empty + */ + int follower_available (void) const; - /// returns randomly a follower from the leader-follower set - /// returns follower on success, else 0 - TAO_SYNCH_CONDITION *get_next_follower (void); + //@} - /// Accessors + /// Get a reference to the underlying mutex TAO_SYNCH_MUTEX &lock (void); + + /// Provide a pre-initialized reverse lock for the Leader/Followers + /// set. + /** + * The Leader/Followers set mutex must be release during some long + * running operations. This helper class simplifies the process of + * releasing and reacquiring said mutex. + */ ACE_Reverse_Lock<TAO_SYNCH_MUTEX> &reverse_lock (void); /// Check if there are any client threads running @@ -126,6 +169,21 @@ private: */ void reset_event_loop_thread_i (TAO_ORB_Core_TSS_Resources *tss); + /** @name Follower Set Operations + * + */ + //@{ + /// Remote a follower from the Followers set and promote it to the + /// leader role. + /** + * This is a helper routine for elect_new_leader(), after verifying + * that all the pre-conditions are satisfied the Follower set is + * changed and the promoted Follower is signaled. + */ + int elect_new_leader_i (void); + + //@} + private: /// The orb core TAO_ORB_Core *orb_core_; @@ -136,32 +194,12 @@ private: /// do protect the access to the following three members ACE_Reverse_Lock<TAO_SYNCH_MUTEX> reverse_lock_; - /// Queue to store the followers. - struct TAO_Export TAO_Follower_Queue - { - /// Constructor - TAO_Follower_Queue (void); - - /// Checks if the queue is empty. - int is_empty (void) const; - - /// Removes a follower from the queue. - int remove (TAO_Follower_Node *); + /// Implement the Leader/Followers set using an intrusive list + typedef ACE_Intrusive_List<TAO_LF_Follower> Follower_Set; + Follower_Set follower_set_; - /// Inserts a follower into the queue. - /// Returns 0 on success, -1 for failure, 1 if the element is already - /// present. - int insert (TAO_Follower_Node *); - - /// Pointer to the head of the queue. - TAO_Follower_Node *head_; - - /// Pointer to the tail of the queue. - TAO_Follower_Node *tail_; - }; - - /// Queue to keep the followers on the stack. - TAO_Follower_Queue follower_set_; + /// Use a free list to allocate and release Follower objects + Follower_Set follower_free_list_; /** * Count the number of active leaders. @@ -217,80 +255,6 @@ private: TAO_Leader_Follower &leader_follower_; }; -class TAO_LF_Strategy; - -class TAO_Export TAO_LF_Event_Loop_Thread_Helper -{ -public: - /// Constructor - TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower, - TAO_LF_Strategy &lf_strategy); - - /// Destructor - ~TAO_LF_Event_Loop_Thread_Helper (void); - - /// Calls <set_event_loop_thread> on the leader/followers object. - int set_event_loop_thread (ACE_Time_Value *max_wait_time); - -private: - /// Reference to leader/followers object. - TAO_Leader_Follower &leader_follower_; - - TAO_LF_Strategy &lf_strategy_; - - /// Remembers whether we have to call the reset method in the - /// destructor. - int call_reset_; -}; - -class TAO_Export TAO_LF_Strategy -{ -public: - TAO_LF_Strategy (); - - virtual ~TAO_LF_Strategy (); - - virtual void set_upcall_thread (TAO_Leader_Follower &leader_follower) = 0; - - virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, - TAO_Leader_Follower &leader_follower) = 0; - - virtual void reset_event_loop_thread_and_elect_new_leader (int call_reset, - TAO_Leader_Follower &leader_follower) = 0; -}; - -class TAO_Export TAO_Complete_LF_Strategy : public TAO_LF_Strategy -{ -public: - TAO_Complete_LF_Strategy (); - - virtual ~TAO_Complete_LF_Strategy (); - - virtual void set_upcall_thread (TAO_Leader_Follower &leader_follower); - - virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, - TAO_Leader_Follower &leader_follower); - - virtual void reset_event_loop_thread_and_elect_new_leader (int call_reset, - TAO_Leader_Follower &leader_follower); -}; - -class TAO_Export TAO_Null_LF_Strategy : public TAO_LF_Strategy -{ -public: - TAO_Null_LF_Strategy (); - - virtual ~TAO_Null_LF_Strategy (); - - virtual void set_upcall_thread (TAO_Leader_Follower &leader_follower); - - virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, - TAO_Leader_Follower &leader_follower); - - virtual void reset_event_loop_thread_and_elect_new_leader (int call_reset, - TAO_Leader_Follower &leader_follower); -}; - #if defined (__ACE_INLINE__) # include "tao/Leader_Follower.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/tao/Leader_Follower.i b/TAO/tao/Leader_Follower.i index 9e0f1eeff99..6bddae3f4be 100644 --- a/TAO/tao/Leader_Follower.i +++ b/TAO/tao/Leader_Follower.i @@ -23,15 +23,9 @@ TAO_Leader_Follower::get_tss_resources (void) const } ACE_INLINE int -TAO_Leader_Follower::TAO_Follower_Queue::is_empty (void) const -{ - return this->head_ == 0; -} - -ACE_INLINE int TAO_Leader_Follower::follower_available (void) const { - return !this->follower_set_.is_empty (); + return !this->follower_set_.empty (); } ACE_INLINE int @@ -45,9 +39,7 @@ TAO_Leader_Follower::elect_new_leader (void) } else if (this->follower_available ()) { - TAO_SYNCH_CONDITION* condition_ptr = this->get_next_follower (); - if (condition_ptr == 0 || condition_ptr->signal () == -1) - return -1; + return this->elect_new_leader_i (); } } return 0; @@ -161,16 +153,16 @@ TAO_Leader_Follower::is_client_leader_thread (void) const return tss->client_leader_thread_ != 0; } -ACE_INLINE int -TAO_Leader_Follower::add_follower (TAO_Follower_Node *follower_node) +ACE_INLINE void +TAO_Leader_Follower::add_follower (TAO_LF_Follower *follower) { - return this->follower_set_.insert (follower_node); + this->follower_set_.push_back (follower); } -ACE_INLINE int -TAO_Leader_Follower::remove_follower (TAO_Follower_Node *follower_node) +ACE_INLINE void +TAO_Leader_Follower::remove_follower (TAO_LF_Follower *follower) { - return this->follower_set_.remove (follower_node); + this->follower_set_.remove (follower); } ACE_INLINE ACE_Reverse_Lock<TAO_SYNCH_MUTEX> & @@ -185,7 +177,7 @@ TAO_Leader_Follower::has_clients (void) const return this->clients_; } - +// **************************************************************** ACE_INLINE TAO_LF_Client_Thread_Helper::TAO_LF_Client_Thread_Helper (TAO_Leader_Follower &leader_follower) @@ -212,30 +204,3 @@ TAO_LF_Client_Leader_Thread_Helper::~TAO_LF_Client_Leader_Thread_Helper (void) { this->leader_follower_.reset_client_leader_thread (); } - -ACE_INLINE int -TAO_LF_Event_Loop_Thread_Helper::set_event_loop_thread (ACE_Time_Value *max_wait_time) -{ - int result = this->lf_strategy_.set_event_loop_thread (max_wait_time, leader_follower_); - - if (result == 0) - this->call_reset_ = 1; - - return result; -} - -ACE_INLINE -TAO_LF_Event_Loop_Thread_Helper::TAO_LF_Event_Loop_Thread_Helper (TAO_Leader_Follower &leader_follower, - TAO_LF_Strategy &lf_strategy) - : leader_follower_ (leader_follower), - lf_strategy_ (lf_strategy), - call_reset_ (0) -{ -} - -ACE_INLINE -TAO_LF_Event_Loop_Thread_Helper::~TAO_LF_Event_Loop_Thread_Helper (void) -{ - this->lf_strategy_.reset_event_loop_thread_and_elect_new_leader (this->call_reset_, - this->leader_follower_); -} diff --git a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp new file mode 100644 index 00000000000..152ae60c0d7 --- /dev/null +++ b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp @@ -0,0 +1,61 @@ +// -*- C++ -*- +// $Id$ + +#include "tao/Leader_Follower_Flushing_Strategy.h" +#include "tao/Leader_Follower.h" +#include "tao/Transport.h" +#include "tao/ORB_Core.h" +#include "tao/Queued_Message.h" +#include "tao/debug.h" + +ACE_RCSID(tao, Leader_Follower_Flushing_Strategy, "$Id$") + +int +TAO_Leader_Follower_Flushing_Strategy::schedule_output (TAO_Transport *transport) +{ + return transport->schedule_output_i (); +} + +int +TAO_Leader_Follower_Flushing_Strategy::cancel_output (TAO_Transport *transport) +{ + return transport->cancel_output_i (); +} + +int +TAO_Leader_Follower_Flushing_Strategy::flush_message (TAO_Transport *transport, + TAO_Queued_Message *msg, + ACE_Time_Value *max_wait_time) +{ + TAO_Leader_Follower &leader_follower = + transport->orb_core ()->leader_follower (); + return leader_follower.wait_for_event (msg, transport, max_wait_time); +} + +int +TAO_Leader_Follower_Flushing_Strategy::flush_transport (TAO_Transport *transport) +{ + // @todo This is not the right way to do this.... + + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + TAO_ORB_Core *orb_core = transport->orb_core (); + + while (!transport->queue_is_empty ()) + { + int result = orb_core->run (0, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (result == -1) + return -1; + } + } + ACE_CATCHANY + { + return -1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tao/Leader_Follower_Flushing_Strategy.h b/TAO/tao/Leader_Follower_Flushing_Strategy.h new file mode 100644 index 00000000000..4790f65b06a --- /dev/null +++ b/TAO/tao/Leader_Follower_Flushing_Strategy.h @@ -0,0 +1,41 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Leader_Follower_Flushing_Strategy.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LEADER_FOLLOWER_FLUSHING_STRATEGY_H +#define TAO_LEADER_FOLLOWER_FLUSHING_STRATEGY_H +#include "ace/pre.h" + +#include "Flushing_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @class TAO_Leader_Follower_Flushing_Strategy + * + * @brief Implement a flushing strategy that uses the Leader/Follower + * set. + */ +class TAO_Export TAO_Leader_Follower_Flushing_Strategy : public TAO_Flushing_Strategy +{ +public: + virtual int schedule_output (TAO_Transport *transport); + virtual int cancel_output (TAO_Transport *transport); + virtual int flush_message (TAO_Transport *transport, + TAO_Queued_Message *msg, + ACE_Time_Value *max_wait_time); + virtual int flush_transport (TAO_Transport *transport); +}; + +#include "ace/post.h" +#endif /* TAO_LEADER_FOLLOWER_FLUSHING_STRATEGY_H */ diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index 9b9dd8ea637..e44caa86033 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -47,7 +47,16 @@ PUB_HDRS = \ Client_Strategy_Factory \ ORB_Core \ ORB_Table \ + LF_Follower \ + LF_Follower_Auto_Adder \ + LF_Follower_Auto_Ptr \ + LF_Event \ + LF_Event_Binder \ + LF_Event_Loop_Thread_Helper \ + LF_Strategy \ + LF_Strategy_Complete \ Leader_Follower \ + Leader_Follower_Flushing_Strategy \ Reactor_Holder \ Single_Reactor \ Wait_Strategy \ @@ -185,7 +194,16 @@ ORB_CORE_FILES = \ ORB_Core \ Stub_Factory \ ORB_Table \ + LF_Follower \ + LF_Follower_Auto_Ptr \ + LF_Follower_Auto_Adder \ Leader_Follower \ + Leader_Follower_Flushing_Strategy \ + LF_Event \ + LF_Event_Binder \ + LF_Event_Loop_Thread_Helper \ + LF_Strategy \ + LF_Strategy_Complete \ Reactor_Registry \ params \ Resource_Factory \ diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am index 1371deb717c..dc550a9b8bb 100644 --- a/TAO/tao/Makefile.am +++ b/TAO/tao/Makefile.am @@ -131,7 +131,16 @@ ORB_CORE_FILES = \ StringSeqC.cpp \ ORB_Core.cpp \ ORB_Table.cpp \ + LF_Event.cpp \ + LF_Event_Binder.cpp \ + LF_Event_Loop_Thread_Helper.cpp \ + LF_Strategy.cpp \ + LF_Strategy_Complete.cpp \ Leader_Follower.cpp \ + Leader_Follower_Flushing_Strategy.cpp \ + LF_Follower.cpp \ + LF_Follower_Auto_Ptr.cpp \ + LF_Follower_Auto_Adder.cpp \ Reactor_Registry.cpp \ Single_Reactor.cpp \ Reactor_Per_Priority.cpp \ @@ -295,7 +304,16 @@ HEADER_FILES = \ InterceptorS.h \ Invocation.h \ Key_Adapters.h \ + Follower.h \ + Follower_Auto_Ptr.h \ + LF_Follower_Auto_Adder.h \ Leader_Follower.h \ + Leader_Follower_Flushing_Strategy.h \ + LF_Event.h \ + LF_Event_Binder.h \ + LF_Event_Loop_Thread_Helper.h \ + LF_Strategy.h \ + LF_Strategy_Complete.h \ MProfile.h \ Managed_Types.h \ Marshal.h \ @@ -430,7 +448,16 @@ INLINE_FILES = \ InterceptorC.i \ Invocation.i \ Key_Adapters.i \ + Follower.inl \ + Follower_Auto_Ptr.inl \ + LF_Follower_Auto_Adder.inl \ Leader_Follower.i \ + Leader_Follower_Flushing_Strategy.inl \ + LF_Event.inl \ + LF_Event_Binder.inl \ + LF_Event_Loop_Thread_Helper.inl \ + LF_Strategy.inl \ + LF_Strategy_Complete.inl \ MProfile.i \ Managed_Types.i \ Marshal.i \ diff --git a/TAO/tao/Makefile.bor b/TAO/tao/Makefile.bor index 9011376eef6..d68e0c84fea 100644 --- a/TAO/tao/Makefile.bor +++ b/TAO/tao/Makefile.bor @@ -77,6 +77,9 @@ OBJFILES = \ $(OBJDIR)\Fault_Tolerance_Service.obj \ $(OBJDIR)\FILE_Parser.obj \ $(OBJDIR)\Flushing_Strategy.obj \ + $(OBJDIR)\LF_Follower.obj \ + $(OBJDIR)\LF_Follower_Auto_Ptr.obj \ + $(OBJDIR)\LF_Follower_Auto_Adder.obj \ $(OBJDIR)\GIOP_Message_Base.obj \ $(OBJDIR)\GIOP_Message_Lite.obj \ $(OBJDIR)\GIOP_Message_Generator_Parser.obj \ @@ -108,7 +111,13 @@ OBJFILES = \ $(OBJDIR)\IOPC.obj \ $(OBJDIR)\IOR_Parser.obj \ $(OBJDIR)\IORInfo.obj \ + $(OBJDIR)\LF_Event.obj \ + $(OBJDIR)\LF_Event_Binder.obj \ + $(OBJDIR)\LF_Event_Loop_Thread_Helper.obj \ + $(OBJDIR)\LF_Strategy.obj \ + $(OBJDIR)\LF_Strategy_Complete.obj \ $(OBJDIR)\Leader_Follower.obj \ + $(OBJDIR)\Leader_Follower_Flushing_Strategy.obj \ $(OBJDIR)\LocalObject.obj \ $(OBJDIR)\LRU_Connection_Purging_Strategy.obj \ $(OBJDIR)\Managed_Types.obj \ diff --git a/TAO/tao/Muxed_TMS.cpp b/TAO/tao/Muxed_TMS.cpp index 1bd476a279e..1975af86fb9 100644 --- a/TAO/tao/Muxed_TMS.cpp +++ b/TAO/tao/Muxed_TMS.cpp @@ -51,8 +51,7 @@ TAO_Muxed_TMS::bind_dispatcher (CORBA::ULong request_id, return -1; } - return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, - rd); + return 0; } void diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 52a9996365b..38e20e95b8e 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -23,10 +23,6 @@ #include "ObjectIDList.h" -#include "ace/Object_Manager.h" -#include "ace/Env_Value_T.h" -#include "ace/Dynamic_Service.h" -#include "ace/Arg_Shifter.h" #include "Services_Activate.h" #include "Invocation.h" #include "BiDir_Adapter.h" @@ -44,6 +40,14 @@ #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) # include "Buffering_Constraint_Policy.h" #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ + +#include "tao/LF_Event_Loop_Thread_Helper.h" + +#include "ace/Object_Manager.h" +#include "ace/Env_Value_T.h" +#include "ace/Dynamic_Service.h" +#include "ace/Arg_Shifter.h" + #if defined(ACE_MVS) #include "ace/Codeset_IBM1047.h" #endif /* ACE_MVS */ @@ -1783,25 +1787,6 @@ TAO_ORB_Core::poa_adapter (void) return this->poa_adapter_; } -TAO_SYNCH_CONDITION * -TAO_ORB_Core::leader_follower_condition_variable (void) -{ - // Always using TSS. - - // Get tss key. - TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); - - if (tss->leader_follower_condition_variable_ == 0) - { - // Create a new one and return. - ACE_NEW_RETURN (tss->leader_follower_condition_variable_, - TAO_SYNCH_CONDITION (this->leader_follower ().lock ()), - 0); - } - - return tss->leader_follower_condition_variable_; -} - TAO_Stub * TAO_ORB_Core::create_stub(const char *repository_id, const TAO_MProfile &profiles, @@ -2100,10 +2085,11 @@ TAO_ORB_Core::run (ACE_Time_Value *tv, TAO_LF_Strategy &lf_strategy = this->lf_strategy (); - TAO_LF_Event_Loop_Thread_Helper helper (leader_follower, lf_strategy); - - result = helper.set_event_loop_thread (tv); + TAO_LF_Event_Loop_Thread_Helper helper (leader_follower, + lf_strategy, + tv); + int result = helper.event_loop_return (); if (result != 0) { if (errno == ETIME) @@ -3107,7 +3093,6 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void) transport_cache_ (0), event_loop_thread_ (0), client_leader_thread_ (0), - leader_follower_condition_variable_ (0), reactor_registry_ (0), reactor_registry_cookie_ (0), ts_objects_ (), @@ -3140,9 +3125,6 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void) // UNIMPLEMENTED delete this->transport_cache__; this->transport_cache_ = 0; - delete this->leader_follower_condition_variable_; - this->leader_follower_condition_variable_ = 0; - if (this->reactor_registry_ != 0) this->reactor_registry_->destroy_tss_cookie ( this->reactor_registry_cookie_); diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index fa2c5b022e0..0eedb77f8fb 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -152,9 +152,6 @@ public: /// leader. int client_leader_thread_; - /// Condition variable for the leader follower model. - TAO_SYNCH_CONDITION* leader_follower_condition_variable_; - /// The Reactor Holder that we should callback when destroying the /// cookie. TAO_Reactor_Registry *reactor_registry_; @@ -669,10 +666,6 @@ public: /// threads block forever. int thread_per_connection_timeout (ACE_Time_Value &timeout) const; - /// Condition variable used in the Leader Follower Wait Strategy, on - /// which the follower thread blocks. - TAO_SYNCH_CONDITION* leader_follower_condition_variable (void); - /// Makes sure that the ORB is open and then creates a TAO_Stub /// based on the endpoint. TAO_Stub *create_stub_object (const TAO_ObjectKey &key, diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index c06290ef6ed..90e3ec6918a 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -552,7 +552,7 @@ TAO_ORB_Core::resolve_rt_orb (CORBA::Environment &ACE_TRY_ENV) if (CORBA::is_nil (this->rt_orb_.in ())) { // Save a reference to the priority mapping manager. - this->rt_orb_ = + this->rt_orb_ = this->object_ref_table ().resolve_initial_references ( TAO_OBJID_RTORB, ACE_TRY_ENV); @@ -573,7 +573,7 @@ TAO_ORB_Core::resolve_rt_current (CORBA::Environment &ACE_TRY_ENV) if (CORBA::is_nil (this->rt_current_.in ())) { // Save a reference to the priority mapping manager. - this->rt_current_ = + this->rt_current_ = this->object_ref_table ().resolve_initial_references ( TAO_OBJID_RTCURRENT, ACE_TRY_ENV); diff --git a/TAO/tao/PortableServer/ORB_Manager.h b/TAO/tao/PortableServer/ORB_Manager.h index 9a15ea1c45f..7cddcbdf22f 100644 --- a/TAO/tao/PortableServer/ORB_Manager.h +++ b/TAO/tao/PortableServer/ORB_Manager.h @@ -1,15 +1,18 @@ /* -*- C++ -*- */ - -//============================================================================= -/** - * @file ORB_Manager.h - * - * $Id$ - * - * @author Chris Cleeland <cleeland@cs.wustl.edu> - */ -//============================================================================= - +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// tao +// +// = FILENAME +// ORB_Manager.h +// +// = AUTHOR +// Chris Cleeland +// +// ============================================================================ #ifndef TAO_ORB_MANAGER_H #define TAO_ORB_MANAGER_H @@ -23,221 +26,139 @@ #include "tao/ORB.h" -/** - * @class TAO_ORB_Manager - * - * @brief Helper class for simple ORB/POA initialization and - * registering servants with the POA. - * - * This class is a TAO extension that makes it easier to write - * CORBA applications. It's just a wrapper and doesn't do - * anything special within the ORB itself. - */ class TAO_PortableServer_Export TAO_ORB_Manager { + // = TITLE + // Helper class for simple ORB/POA initialization and + // registering servants with the POA. + // + // = DESCRIPTION + // This class is a TAO extension that makes it easier to write + // CORBA applications. It's just a wrapper and doesn't do + // anything special within the ORB itself. public: // = Initialization and termination methods. - /** Constructor. - * - * @param orb pointer to an ORB which is duplicated an stored - * internally in an ORB_var. If pointer is 0, - * a new ORB pointer is created internally in the init() - * call. - * - * @param poa pointer to a POA which is duplicated and stored - * internally in a POA_var. If pointer is 0, - * a pointer to the Root POA is obtained from the ORB. - * - * @param poa_manager pointer to a POA Manager which is duplicated - * and stored internally in a POAManager_var. - * If pointer is 0, a new POAManager is created - * internally in the init() call. - */ TAO_ORB_Manager (CORBA::ORB_ptr orb = 0, PortableServer::POA_ptr poa = 0, PortableServer::POAManager_ptr poa_manager = 0); + // Constructor. - /** Initialize the ORB/root POA, using the supplied command line - * arguments or the default ORB components. - * - * @return -1 on failure, 0 on success - */ int init (int &argc, char *argv[], CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Initialize the ORB/root POA, using the supplied command line + // arguments or the default ORB components. Returns -1 on failure. - /** Initialize the ORB/root POA, using the supplied command line - * arguments or the default ORB components. - * - * @return -1 on failure, 0 on success - */ int init (int &argc, char *argv[], const char *orb_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Initialize the ORB/root POA, using the supplied command line + // arguments or the default ORB components. Returns -1 on failure. - /** - * Creates a child poa under the root poa with PERSISTENT and - * USER_ID policies. Call this if you want a <child_poa> with the - * above policies, otherwise call init. - * - * @return -1 on failure, 0 on success - */ int init_child_poa (int &argc, char *argv[], const char *poa_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Creates a child poa under the root poa with PERSISTENT and + // USER_ID policies. Call this if you want a <child_poa> with the + // above policies, otherwise call init. Returns -1 on failure. - /** - * Creates a child poa under the root poa with PERSISTENT and - * USER_ID policies. Call this if you want a <child_poa> with the - * above policies, otherwise call init. Returns -1 on failure. - */ int init_child_poa (int &argc, char *argv[], const char *poa_name, const char *orb_name, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Creates a child poa under the root poa with PERSISTENT and + // USER_ID policies. Call this if you want a <child_poa> with the + // above policies, otherwise call init. Returns -1 on failure. - /** Shut down. Invoke the destroy() methods on the orb and poa. - * - * @return -1 on failure, 0 on success - */ int fini (CORBA_Environment &ACE_TRY_ENV); + // Shut down the <ORB_Manager>. - /// Destructor. ~TAO_ORB_Manager (void); + // Destructor. // = Accessor methods. - /** - * Put POA manager into the <Active> state, so that incoming corba - * requests are processed. This method is useful for clients, - * which are not going to enter "orb->run" loop, yet may want to - * service incoming requests while waiting for a result of CORBA - * call on a server. - * - * @return -1 on failure, 0 on success - */ int activate_poa_manager (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Put POA manager into the <Active> state, so that incoming corba + // requests are processed. This method is useful for clients, + // which are not going to enter "orb->run" loop, yet may want to + // service incoming requests while waiting for a result of CORBA + // call on a server. Returns -1 on failure. - /** - * Activate <servant>, using the POA <activate_object> call. Users - * can call this method multiple times to activate multiple objects. - * - * @return 0 on failure, a string representation of the object ID if - * successful. Caller of this method is responsible for - * memory deallocation of the string. - */ char *activate (PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Activate <servant>, using the POA <activate_object> call. Users + // can call this method multiple times to activate multiple objects. + // Returns 0 on failure. - /** Deactivate object in RootPOA. - * - * @param id a string representation of the Object ID - * of the servant to deactivate in the POA - */ void deactivate (const char *id, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Deactivate object in RootPOA. - /** - * Precondition: init_child_poa has been called. Activate <servant> - * using the POA <activate_object_with_id> created from the string - * <object_name>. Users should call this to activate objects under - * the child_poa. - * - * @param object_name String name which will be used to create - * an Object ID for the servant. - * @param servant The servant to activate under the child POA. - * - * @return 0 on failure, a string representation of the object ID if - * successful. Caller of this method is responsible for - * memory deallocation of the string. - */ char *activate_under_child_poa (const char *object_name, PortableServer::Servant servant, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Precondition: init_child_poa has been called. Activate <servant> + // using the POA <activate_object_with_id> created from the string + // <object_name>. Users should call this to activate objects under + // the child_poa. - /** Deactivate object in child POA. - * - * @param id string representation of the object ID, which represents - * the object to deactivate in the POA - */ void deactivate_under_child_poa (const char *id, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Deactivate object in child POA. - /** Run the ORB event loop with the specified <tv> time value. - * - * @param tv the time interval for how long to run the ORB event loop. - * @return -1 on failure, 0 on success - */ int run (CORBA_Environment &ACE_TRY_ENV, ACE_Time_Value *tv); int run (ACE_Time_Value &tv, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); int run (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); + // Run the ORB event loop with the specified <tv> time value Returns + // -1 on failure. - /** - * Accessor which returns the ORB pointer. Following the normal - * CORBA memory management rules of return values from functions, - * this function duplicates the orb return value before returning - * it. - * - * @return orb ORB pointer which has been duplicated, so caller - * must release pointer when done. - */ CORBA::ORB_ptr orb (void); + // Accessor which returns the ORB pointer. Following the normal + // CORBA memory management rules of return values from functions, + // this function duplicates the orb return value before returning + // it. - /** - * Accessor which returns the root poa. Following the normal CORBA - * memory management rules of return values from functions, this - * function duplicates the poa return value before returning it. - * - * @return poa Root POA pointer which has been duplicated. Caller - * must release pointer when done. - */ PortableServer::POA_ptr root_poa (void); + // Accessor which returns the root poa. Following the normal CORBA + // memory management rules of return values from functions, this + // function duplicates the poa return value before returning it. - /** - * Accessor which returns the child poa. Following the normal CORBA - * memory management rules of return values from functions, this - * function duplicates the poa return value before returning it. - * - * @return Child POA pointer which has been duplicated. Caller - * must release pointer when done. - */ PortableServer::POA_ptr child_poa (void); + // Accessor which returns the child poa. Following the normal CORBA + // memory management rules of return values from functions, this + // function duplicates the poa return value before returning it. - /** - * Accessor which returns the poa manager. Following the normal - * CORBA memory management rules of return values from functions, - * this function duplicates the poa manager return value before - * returning it. - * - * @return POAManager pointer which has been duplicated. Caller - * must release pointer when done. - */ PortableServer::POAManager_ptr poa_manager (void); + // Accessor which returns the poa manager. Following the normal + // CORBA memory management rules of return values from functions, + // this function duplicates the poa manager return value before + // returning it. protected: - /// The ORB. CORBA::ORB_var orb_; + // The ORB. - /// The POA for this ORB. PortableServer::POA_var poa_; + // The POA for this ORB. - /// Child poa under the root POA. PortableServer::POA_var child_poa_; + // Child poa under the root POA. - /// The POA manager of poa_. PortableServer::POAManager_var poa_manager_; + // The POA manager of poa_. }; diff --git a/TAO/tao/Queued_Message.cpp b/TAO/tao/Queued_Message.cpp index 1cd30ae2e2e..68d308b2eeb 100644 --- a/TAO/tao/Queued_Message.cpp +++ b/TAO/tao/Queued_Message.cpp @@ -10,10 +10,7 @@ ACE_RCSID(tao, Queued_Message, "$Id$") TAO_Queued_Message::TAO_Queued_Message (void) - : connection_closed_ (0) - , send_failure_ (0) - , timeout_ (0) - , next_ (0) + : next_ (0) , prev_ (0) { } @@ -23,24 +20,6 @@ TAO_Queued_Message::~TAO_Queued_Message (void) } void -TAO_Queued_Message::connection_closed (void) -{ - this->connection_closed_ = 1; -} - -void -TAO_Queued_Message::send_failure (void) -{ - this->send_failure_ = 1; -} - -void -TAO_Queued_Message::timeout (void) -{ - this->timeout_ = 1; -} - -void TAO_Queued_Message::remove_from_list (TAO_Queued_Message *&head, TAO_Queued_Message *&tail) { diff --git a/TAO/tao/Queued_Message.h b/TAO/tao/Queued_Message.h index 11eb9861bfc..591aeb01b11 100644 --- a/TAO/tao/Queued_Message.h +++ b/TAO/tao/Queued_Message.h @@ -15,6 +15,7 @@ #include "ace/pre.h" #include "corbafwd.h" +#include "LF_Event.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -60,7 +61,7 @@ class ACE_Message_Block; * allocating the memory? * */ -class TAO_Export TAO_Queued_Message +class TAO_Export TAO_Queued_Message : public TAO_LF_Event { public: /// Constructor @@ -69,16 +70,6 @@ public: /// Destructor virtual ~TAO_Queued_Message (void); - /// The underlying connection has been closed, release resources and - /// signal waiting threads. - void connection_closed (void); - - /// There was an error while sending the data. - void send_failure (void); - - /// There was a timeout while sending the data - void timeout (void); - /** @name Intrusive list manipulation * * The messages are put in a doubled linked list (for easy insertion @@ -179,16 +170,6 @@ public: virtual void destroy (void) = 0; //@} -protected: - /// Set to 1 if the connection was closed - int connection_closed_; - - /// Set to 1 if there was a failure while sending the data - int send_failure_; - - /// Set to 1 if there was a timeout while sending the data - int timeout_; - private: /// Implement an intrusive double-linked list for the message queue TAO_Queued_Message *next_; diff --git a/TAO/tao/RTCORBA/RT_Mutex.cpp b/TAO/tao/RTCORBA/RT_Mutex.cpp index c35317aade1..94bec75f82e 100644 --- a/TAO/tao/RTCORBA/RT_Mutex.cpp +++ b/TAO/tao/RTCORBA/RT_Mutex.cpp @@ -36,8 +36,10 @@ TAO_RT_Mutex::try_lock (TimeBase::TimeT wait_time, int result; if (wait_time == 0) - // No wait. - result = this->mu_.tryacquire (); + { + // No wait. + result = this->mu_.tryacquire (); + } else { // Wait for the specified amount of time before giving up. @@ -55,13 +57,18 @@ TAO_RT_Mutex::try_lock (TimeBase::TimeT wait_time, result = this->mu_.acquire (absolute_time); } - if (result == 0) + // Check result. + if (result == 0 ) return 1; - else if (result == -1 && errno == ETIME) + else + if (result == -1 + && (errno == EBUSY || errno == ETIMEDOUT)) return 0; else - // Some really bad error. - ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + { + // Some really bad error. + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); + } } const char * diff --git a/TAO/tao/RTPortableServer/TAO_RTPortableServer.dsp b/TAO/tao/RTPortableServer/TAO_RTPortableServer.dsp index cbaa4f3f5ea..9e62aa13fe5 100644 --- a/TAO/tao/RTPortableServer/TAO_RTPortableServer.dsp +++ b/TAO/tao/RTPortableServer/TAO_RTPortableServer.dsp @@ -56,7 +56,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServer.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib TAO_RTCORBA.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServer.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
!ELSEIF "$(CFG)" == "RTPortableServer - Win32 Debug"
@@ -83,7 +83,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 TAOd.lib aced.lib TAO_PortableServerd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServerd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
+# ADD LINK32 TAOd.lib aced.lib TAO_PortableServerd.lib TAO_RTCORBAd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServerd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer" /libpath:"..\..\tao\RTCORBA"
!ELSEIF "$(CFG)" == "RTPortableServer - Win32 MFC Debug"
@@ -112,7 +112,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 TAOd.lib aced.lib TAO_Svc_Utilsd.lib TAO_RTEventd.lib TAO_RTSchedd.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_RTPORTABLESERVERd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-# ADD LINK32 TAOmfcd.lib acemfcd.lib TAO_PortableServermfcd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServermfcd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
+# ADD LINK32 TAO_RTCORBAmfcd.lib TAOmfcd.lib acemfcd.lib TAO_PortableServermfcd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServermfcd.dll" /pdbtype:sept /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
!ELSEIF "$(CFG)" == "RTPortableServer - Win32 MFC Release"
@@ -141,7 +141,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ace.lib TAO.lib TAO_Svc_Utils.lib TAO_RTEvent.lib TAO_RTSched.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_RTPORTABLESERVER.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
-# ADD LINK32 TAOmfc.lib acemfc.lib TAO_PortableServermfc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServermfc.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
+# ADD LINK32 TAO_RTCORBAmfc.lib TAOmfc.lib acemfc.lib TAO_PortableServermfc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\TAO_RTPortableServermfc.dll" /libpath:"..\..\tao" /libpath:"..\..\..\ace" /libpath:"..\..\tao\PortableServer"
!ENDIF
diff --git a/TAO/tao/Reactor_Registry.cpp b/TAO/tao/Reactor_Registry.cpp index b5867a2bbc3..f707ca1e1bf 100644 --- a/TAO/tao/Reactor_Registry.cpp +++ b/TAO/tao/Reactor_Registry.cpp @@ -3,6 +3,7 @@ #include "tao/Reactor_Registry.h" #include "tao/ORB_Core.h" #include "tao/Leader_Follower.h" +#include "tao/LF_Strategy.h" #if !defined (__ACE_INLINE__) # include "tao/Reactor_Registry.i" diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h index ad6ffd4c516..67df4e5d8df 100644 --- a/TAO/tao/Reply_Dispatcher.h +++ b/TAO/tao/Reply_Dispatcher.h @@ -76,13 +76,6 @@ public: // Get the Message State into which the reply has been read. /** - * The dispatcher has been bound. - * Some dispatchers need to retain state to cooperate with other - * components, such as the waiting strategy. - */ - virtual void dispatcher_bound (TAO_Transport*) = 0; - - /** * The used for the pending reply has been closed. * No reply is expected. * @@ TODO: If the connection was closed due to a CloseConnection diff --git a/TAO/tao/Strategies/DIOP_Connection_Handler.cpp b/TAO/tao/Strategies/DIOP_Connection_Handler.cpp index b35961941bc..ec9c0a7ecdc 100644 --- a/TAO/tao/Strategies/DIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/DIOP_Connection_Handler.cpp @@ -30,6 +30,7 @@ ACE_RCSID(tao, DIOP_Connect, "$Id$") TAO_DIOP_Connection_Handler::TAO_DIOP_Connection_Handler (ACE_Thread_Manager *t) : TAO_DIOP_SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), + pending_upcalls_ (1), tcp_properties_ (0), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { @@ -43,17 +44,18 @@ TAO_DIOP_Connection_Handler::TAO_DIOP_Connection_Handler (ACE_Thread_Manager *t) TAO_DIOP_Connection_Handler::TAO_DIOP_Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, + CORBA::Boolean /* flag*/, void *arg) : TAO_DIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), + pending_upcalls_ (1), tcp_properties_ (ACE_static_cast (TAO_DIOP_Properties *, arg)), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { TAO_DIOP_Transport* specific_transport = 0; ACE_NEW(specific_transport, - TAO_DIOP_Transport(this, orb_core, flag)); + TAO_DIOP_Transport(this, orb_core, 0)); // store this pointer (indirectly increment ref count) this->transport(specific_transport); @@ -223,10 +225,8 @@ TAO_DIOP_Connection_Handler::handle_close (ACE_HANDLE handle, handle, rm)); - long pending = - this->decr_pending_upcalls (); - - if (pending <= 0) + --this->pending_upcalls_; + if (this->pending_upcalls_ <= 0) { // @@ Why are we doing checks for is_registered flags here if the // handlers are not registered with the reactor? - Bala @@ -343,7 +343,7 @@ int TAO_DIOP_Connection_Handler::handle_input (ACE_HANDLE) { // Increase the reference count on the upcall that have passed us. - this->incr_pending_upcalls (); + this->pending_upcalls_++; this->resume_flag_ = TAO_RESUMES_CONNECTION_HANDLER; @@ -362,7 +362,7 @@ TAO_DIOP_Connection_Handler::handle_input (ACE_HANDLE) } // The upcall is done. Bump down the reference count - if (this->decr_pending_upcalls () <= 0) + if (--this->pending_upcalls_ <= 0) retval = -1; if (retval == -1) diff --git a/TAO/tao/Strategies/DIOP_Connection_Handler.h b/TAO/tao/Strategies/DIOP_Connection_Handler.h index d5583fa1c5b..6116a33b086 100644 --- a/TAO/tao/Strategies/DIOP_Connection_Handler.h +++ b/TAO/tao/Strategies/DIOP_Connection_Handler.h @@ -173,6 +173,13 @@ protected: // DIOP Additions - End private: + + /// Count nested upcalls on this + /// svc_handler i.e., the connection can close during nested upcalls, + /// you should not delete the svc_handler until the stack unwinds + /// from the nested upcalls. + u_long pending_upcalls_; + /// TCP configuration for this connection. TAO_DIOP_Properties *tcp_properties_; diff --git a/TAO/tao/Strategies/LF_Strategy_Null.cpp b/TAO/tao/Strategies/LF_Strategy_Null.cpp new file mode 100644 index 00000000000..d3c740cb9de --- /dev/null +++ b/TAO/tao/Strategies/LF_Strategy_Null.cpp @@ -0,0 +1,32 @@ +// -*- C++ -*- +// $Id$ + +#include "LF_Strategy_Null.h" + +#if !defined (__ACE_INLINE__) +# include "LF_Strategy_Null.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(tao, LF_Strategy_Null, "$Id$") + +TAO_LF_Strategy_Null::~TAO_LF_Strategy_Null (void) +{ +} + +void +TAO_LF_Strategy_Null::set_upcall_thread (TAO_Leader_Follower &) +{ +} + +int +TAO_LF_Strategy_Null::set_event_loop_thread (ACE_Time_Value *, + TAO_Leader_Follower &) +{ + return 0; +} + +void +TAO_LF_Strategy_Null::reset_event_loop_thread (int, + TAO_Leader_Follower &) +{ +} diff --git a/TAO/tao/Strategies/LF_Strategy_Null.h b/TAO/tao/Strategies/LF_Strategy_Null.h new file mode 100644 index 00000000000..a9d54a5348a --- /dev/null +++ b/TAO/tao/Strategies/LF_Strategy_Null.h @@ -0,0 +1,53 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Strategy_Null.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_STRATEGY_NULL_H +#define TAO_LF_STRATEGY_NULL_H +#include "ace/pre.h" + +#include "strategies_export.h" +#include "tao/LF_Strategy.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @brief A concrete TAO_LF_Strategy for ORB configurations that do + * not use the Leader/Followers event loop. + */ +class TAO_Strategies_Export TAO_LF_Strategy_Null : public TAO_LF_Strategy +{ +public: + /// Constructor + TAO_LF_Strategy_Null (void); + + //@{ + /** @name Virtual Methods + * + * Please check the documentation in TAO_LF_Strategy + */ + virtual ~TAO_LF_Strategy_Null (void); + + virtual void set_upcall_thread (TAO_Leader_Follower &); + virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, + TAO_Leader_Follower &); + virtual void reset_event_loop_thread (int call_reset, + TAO_Leader_Follower &); +}; + +#if defined (__ACE_INLINE__) +# include "LF_Strategy_Null.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_LF_STRATEGY_NULL_H */ diff --git a/TAO/tao/Strategies/LF_Strategy_Null.inl b/TAO/tao/Strategies/LF_Strategy_Null.inl new file mode 100644 index 00000000000..c073be304e7 --- /dev/null +++ b/TAO/tao/Strategies/LF_Strategy_Null.inl @@ -0,0 +1,6 @@ +// $Id$ + +ACE_INLINE +TAO_LF_Strategy_Null::TAO_LF_Strategy_Null (void) +{ +} diff --git a/TAO/tao/Strategies/Makefile b/TAO/tao/Strategies/Makefile index 671149799a7..115826e059c 100644 --- a/TAO/tao/Strategies/Makefile +++ b/TAO/tao/Strategies/Makefile @@ -52,7 +52,8 @@ CPP_SRCS += \ Reactor_Per_Priority \ LFU_Connection_Purging_Strategy \ FIFO_Connection_Purging_Strategy \ - NULL_Connection_Purging_Strategy + NULL_Connection_Purging_Strategy \ + LF_Strategy_Null IDL_SRC = \ $(addsuffix S.cpp, $(IDL_FILES)) \ diff --git a/TAO/tao/Strategies/Makefile.bor b/TAO/tao/Strategies/Makefile.bor index 83338364c48..30599f4f7ac 100644 --- a/TAO/tao/Strategies/Makefile.bor +++ b/TAO/tao/Strategies/Makefile.bor @@ -33,7 +33,8 @@ OBJFILES = \ $(OBJDIR)\Reactor_Per_Priority.obj \ $(OBJDIR)\FIFO_Connection_Purging_Strategy.obj \ $(OBJDIR)\LFU_Connection_Purging_Strategy.obj \ - $(OBJDIR)\NULL_Connection_Purging_Strategy.obj + $(OBJDIR)\NULL_Connection_Purging_Strategy.obj \ + $(OBJDIR)\LF_Strategy_Null.obj !ifdef STATIC CFLAGS = $(ACE_CFLAGS) $(TAO_CFLAGS) $(TAO_STRATEGIES_CFLAGS) diff --git a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp index 877b85cd075..f5a0bdf3355 100644 --- a/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connection_Handler.cpp @@ -25,6 +25,7 @@ ACE_RCSID(Strategies, SHMIOP_Connection_Handler, "$Id$") TAO_SHMIOP_Connection_Handler::TAO_SHMIOP_Connection_Handler (ACE_Thread_Manager *t) : TAO_SHMIOP_SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), + pending_upcalls_ (1), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { // This constructor should *never* get called, it is just here to @@ -37,15 +38,16 @@ TAO_SHMIOP_Connection_Handler::TAO_SHMIOP_Connection_Handler (ACE_Thread_Manager TAO_SHMIOP_Connection_Handler::TAO_SHMIOP_Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, + CORBA::Boolean /*flag*/, void *) : TAO_SHMIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), + pending_upcalls_ (1), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { TAO_SHMIOP_Transport* specific_transport = 0; ACE_NEW (specific_transport, - TAO_SHMIOP_Transport(this, orb_core, flag)); + TAO_SHMIOP_Transport(this, orb_core, 0)); // store this pointer (indirectly increment ref count) this->transport (specific_transport); @@ -180,10 +182,8 @@ TAO_SHMIOP_Connection_Handler::handle_close (ACE_HANDLE handle, handle, rm)); - long pending = - this->decr_pending_upcalls (); - - if (pending <= 0) + --this->pending_upcalls_; + if (this->pending_upcalls_ <= 0) { if (this->transport ()->wait_strategy ()->is_registered ()) { @@ -268,7 +268,7 @@ int TAO_SHMIOP_Connection_Handler::handle_input (ACE_HANDLE) { // Increase the reference count on the upcall that have passed us. - this->incr_pending_upcalls (); + this->pending_upcalls_++; this->resume_flag_ = TAO_RESUMES_CONNECTION_HANDLER; @@ -278,7 +278,7 @@ TAO_SHMIOP_Connection_Handler::handle_input (ACE_HANDLE) int retval = this->transport ()->handle_input_i (resume_handle); // The upcall is done. Bump down the reference count - if (this->decr_pending_upcalls () <= 0) + if (--this->pending_upcalls_ <= 0) retval = -1; if (retval == -1) diff --git a/TAO/tao/Strategies/SHMIOP_Connection_Handler.h b/TAO/tao/Strategies/SHMIOP_Connection_Handler.h index 7b1bc6d569c..f6ec45d346b 100644 --- a/TAO/tao/Strategies/SHMIOP_Connection_Handler.h +++ b/TAO/tao/Strategies/SHMIOP_Connection_Handler.h @@ -109,6 +109,13 @@ protected: virtual int handle_input (ACE_HANDLE = ACE_INVALID_HANDLE); private: + + /// Count nested upcalls on this + /// svc_handler i.e., the connection can close during nested upcalls, + /// you should not delete the svc_handler until the stack unwinds + /// from the nested upcalls. + long pending_upcalls_; + /// Flag that we will be passing to the event handler to indicate /// whether the handle will be resumed by the method or not. int resume_flag_; diff --git a/TAO/tao/Strategies/TAO_Strategies.dsp b/TAO/tao/Strategies/TAO_Strategies.dsp index f2c7e384275..975147e7a47 100644 --- a/TAO/tao/Strategies/TAO_Strategies.dsp +++ b/TAO/tao/Strategies/TAO_Strategies.dsp @@ -130,6 +130,10 @@ SOURCE=.\FIFO_Connection_Purging_Strategy.cpp # End Source File
# Begin Source File
+SOURCE=.\LF_Strategy_Null.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LFU_Connection_Purging_Strategy.cpp
# End Source File
# Begin Source File
@@ -246,6 +250,14 @@ SOURCE=.\DIOP_Transport.h # End Source File
# Begin Source File
+SOURCE=.\LF_Strategy_Null.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Null.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Reactor_Per_Priority.h
# End Source File
# Begin Source File
diff --git a/TAO/tao/Strategies/TAO_Strategies_Static.dsp b/TAO/tao/Strategies/TAO_Strategies_Static.dsp index 5402fc26f2a..24e09b71cb9 100644 --- a/TAO/tao/Strategies/TAO_Strategies_Static.dsp +++ b/TAO/tao/Strategies/TAO_Strategies_Static.dsp @@ -127,6 +127,10 @@ SOURCE=.\FIFO_Connection_Purging_Strategy.cpp # End Source File
# Begin Source File
+SOURCE=.\LF_Strategy_Null.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LFU_Connection_Purging_Strategy.cpp
# End Source File
# Begin Source File
@@ -243,6 +247,14 @@ SOURCE=.\DIOP_Transport.h # End Source File
# Begin Source File
+SOURCE=.\LF_Strategy_Null.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Null.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Reactor_Per_Priority.h
# End Source File
# Begin Source File
diff --git a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp index 91d7e0b3a28..8151e633d11 100644 --- a/TAO/tao/Strategies/UIOP_Connection_Handler.cpp +++ b/TAO/tao/Strategies/UIOP_Connection_Handler.cpp @@ -27,6 +27,7 @@ ACE_RCSID(Strategies, UIOP_Connection_Handler, "$Id$") TAO_UIOP_Connection_Handler::TAO_UIOP_Connection_Handler (ACE_Thread_Manager *t) : TAO_UIOP_SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), + pending_upcalls_ (1), uiop_properties_ (0), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { @@ -40,17 +41,18 @@ TAO_UIOP_Connection_Handler::TAO_UIOP_Connection_Handler (ACE_Thread_Manager *t) TAO_UIOP_Connection_Handler::TAO_UIOP_Connection_Handler (TAO_ORB_Core *orb_core, - CORBA::Boolean flag, + CORBA::Boolean /*flag*/, void *arg) : TAO_UIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), + pending_upcalls_ (1), uiop_properties_ (ACE_static_cast (TAO_UIOP_Properties *, arg)), resume_flag_ (TAO_DOESNT_RESUME_CONNECTION_HANDLER) { TAO_UIOP_Transport* specific_transport = 0; ACE_NEW(specific_transport, - TAO_UIOP_Transport(this, orb_core, flag)); + TAO_UIOP_Transport(this, orb_core, 0)); // store this pointer (indirectly increment ref count) this->transport(specific_transport); @@ -164,9 +166,8 @@ TAO_UIOP_Connection_Handler::handle_close (ACE_HANDLE handle, handle, rm)); - long pending = this->decr_pending_upcalls (); - - if (pending <= 0) + --this->pending_upcalls_; + if (this->pending_upcalls_ <= 0) { if (this->transport ()->wait_strategy ()->is_registered ()) { @@ -244,7 +245,7 @@ TAO_UIOP_Connection_Handler::add_transport_to_cache (void) int TAO_UIOP_Connection_Handler::handle_input (ACE_HANDLE) { - this->incr_pending_upcalls (); + this->pending_upcalls_++; this->resume_flag_ = TAO_RESUMES_CONNECTION_HANDLER; @@ -255,7 +256,7 @@ TAO_UIOP_Connection_Handler::handle_input (ACE_HANDLE) this->transport ()->handle_input_i (resume_handle); // The upcall is done. Bump down the reference count - if (this->decr_pending_upcalls () <= 0) + if (--this->pending_upcalls_ <= 0) retval = -1; if (retval == -1) diff --git a/TAO/tao/Strategies/UIOP_Connection_Handler.h b/TAO/tao/Strategies/UIOP_Connection_Handler.h index fb681019fa8..41db582d5cb 100644 --- a/TAO/tao/Strategies/UIOP_Connection_Handler.h +++ b/TAO/tao/Strategies/UIOP_Connection_Handler.h @@ -127,6 +127,12 @@ protected: private: + /// Count nested upcalls on this + /// svc_handler i.e., the connection can close during nested upcalls, + /// you should not delete the svc_handler until the stack unwinds + /// from the nested upcalls. + long pending_upcalls_; + /// TCP configuration for this connection. TAO_UIOP_Properties *uiop_properties_; diff --git a/TAO/tao/Strategies/advanced_resource.cpp b/TAO/tao/Strategies/advanced_resource.cpp index 76f962f8732..09aa67c35ba 100644 --- a/TAO/tao/Strategies/advanced_resource.cpp +++ b/TAO/tao/Strategies/advanced_resource.cpp @@ -15,9 +15,12 @@ #include "FIFO_Connection_Purging_Strategy.h" #include "NULL_Connection_Purging_Strategy.h" +#include "LF_Strategy_Null.h" + #include "tao/debug.h" #include "tao/Single_Reactor.h" #include "tao/LRU_Connection_Purging_Strategy.h" +#include "tao/LF_Strategy_Complete.h" #include "tao/Leader_Follower.h" #include "tao/StringSeqC.h" @@ -82,7 +85,7 @@ TAO_Advanced_Resource_Factory::init (int argc, char **argv) return 0; } this->options_processed_ = 1; - + // If the default resource factory exists, then disable it. // This causes any directives for the "Resource_Factory" to // report warnings. @@ -101,7 +104,7 @@ TAO_Advanced_Resource_Factory::init (int argc, char **argv) unused_argv.length (argc); for (curarg = 0; curarg < argc; curarg++) - { + { if (ACE_OS::strcasecmp (argv[curarg], "-ORBReactorRegistry") == 0) { @@ -222,10 +225,10 @@ TAO_Advanced_Resource_Factory::init (int argc, char **argv) unused_argc++; } } - + unused_argv.length (unused_argc); // "Trim" the string sequence to // the actual size. - + this->TAO_Default_Resource_Factory::init (unused_argc, unused_argv.get_buffer ()); return 0; @@ -711,13 +714,13 @@ TAO_Advanced_Resource_Factory::create_lf_strategy (void) if (this->reactor_type_ == TAO_REACTOR_SELECT_ST) { ACE_NEW_RETURN (strategy, - TAO_Null_LF_Strategy, + TAO_LF_Strategy_Null, 0); } else { ACE_NEW_RETURN (strategy, - TAO_Complete_LF_Strategy, + TAO_LF_Strategy_Complete, 0); } return strategy; diff --git a/TAO/tao/Synch_Queued_Message.cpp b/TAO/tao/Synch_Queued_Message.cpp index a76d964115c..8381449928d 100644 --- a/TAO/tao/Synch_Queued_Message.cpp +++ b/TAO/tao/Synch_Queued_Message.cpp @@ -65,6 +65,8 @@ TAO_Synch_Queued_Message::fill_iov (int iovcnt_max, void TAO_Synch_Queued_Message::bytes_transferred (size_t &byte_count) { + this->state_changed_i (TAO_LF_Event::LFS_ACTIVE); + while (this->current_block_ != 0 && byte_count > 0) { size_t l = this->current_block_->length (); @@ -84,6 +86,8 @@ TAO_Synch_Queued_Message::bytes_transferred (size_t &byte_count) this->current_block_ = this->current_block_->cont (); } } + if (this->current_block_ == 0) + this->state_changed (TAO_LF_Event::LFS_SUCCESS); } void diff --git a/TAO/tao/Synch_Reply_Dispatcher.cpp b/TAO/tao/Synch_Reply_Dispatcher.cpp index 609fa947b29..2b58303a92f 100644 --- a/TAO/tao/Synch_Reply_Dispatcher.cpp +++ b/TAO/tao/Synch_Reply_Dispatcher.cpp @@ -2,9 +2,8 @@ #include "tao/Synch_Reply_Dispatcher.h" #include "tao/ORB_Core.h" -#include "tao/Wait_Strategy.h" #include "tao/Pluggable_Messaging_Utils.h" -#include "Transport.h" +#include "tao/Transport.h" ACE_RCSID(tao, Synch_Reply_Dispatcher, "$Id$") @@ -15,9 +14,7 @@ TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher ( IOP::ServiceContextList &sc ) : reply_service_info_ (sc), - reply_received_ (0), orb_core_ (orb_core), - wait_strategy_ (0), db_ (sizeof buf_, ACE_Message_Block::MB_DATA, this->buf_, @@ -30,9 +27,10 @@ TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher ( TAO_ENCAP_BYTE_ORDER, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, - orb_core), - leader_follower_condition_variable_ (0) + orb_core) { + // As a TAO_LF_Event we start in the active state.... + this->state_changed_i (TAO_LF_Event::LFS_ACTIVE); } // Destructor. @@ -46,12 +44,6 @@ TAO_Synch_Reply_Dispatcher::reply_cdr (void) return this->reply_cdr_; } -int& -TAO_Synch_Reply_Dispatcher::reply_received (void) -{ - return this->reply_received_; -} - int TAO_Synch_Reply_Dispatcher::dispatch_reply ( TAO_Pluggable_Reply_Params ¶ms) @@ -70,42 +62,23 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply ( //this->message_state_.reset (0); // Transfer the <params.input_cdr_>'s content to this->reply_cdr_ + // @@ Somebody could please explain why we ignore the value + // returned? And why don't we simply use the normal C++ idioms to + // represent that? Namely: + // (void) this->reply_cdr_.close_from (params.input_cdr_); + // ACE_Data_Block *db = this->reply_cdr_.clone_from (params.input_cdr_); ACE_UNUSED_ARG (db); - if (this->wait_strategy_ != 0) - { - if (this->wait_strategy_->reply_dispatched ( - this->reply_received_, - this->leader_follower_condition_variable_ - ) - == -1) - { - return -1; - } - } + this->state_changed (TAO_LF_Event::LFS_SUCCESS); return 1; } void -TAO_Synch_Reply_Dispatcher::dispatcher_bound (TAO_Transport *transport) -{ - this->wait_strategy_ = transport->wait_strategy (); - this->leader_follower_condition_variable_ = - transport->wait_strategy ()->leader_follower_condition_variable (); -} - -void TAO_Synch_Reply_Dispatcher::connection_closed (void) { - if (this->wait_strategy_ != 0) - { - this->wait_strategy_->connection_closed ( - this->reply_received_, - this->leader_follower_condition_variable_ - ); - } + this->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED); } diff --git a/TAO/tao/Synch_Reply_Dispatcher.h b/TAO/tao/Synch_Reply_Dispatcher.h index ec6aabe157b..536096b2041 100644 --- a/TAO/tao/Synch_Reply_Dispatcher.h +++ b/TAO/tao/Synch_Reply_Dispatcher.h @@ -20,13 +20,13 @@ #include "ace/pre.h" #include "tao/Reply_Dispatcher.h" +#include "tao/LF_Event.h" #include "tao/GIOP_Message_Version.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class TAO_Wait_Strategy; class TAO_Pluggable_Reply_Params; /** @@ -35,7 +35,9 @@ class TAO_Pluggable_Reply_Params; * @brief Reply dispatcher for Synchoronous Method Invocation (SMI)s. * */ -class TAO_Export TAO_Synch_Reply_Dispatcher : public TAO_Reply_Dispatcher +class TAO_Export TAO_Synch_Reply_Dispatcher + : public TAO_Reply_Dispatcher + , public TAO_LF_Event { public: @@ -49,16 +51,8 @@ public: /// Return the reply CDR. TAO_InputCDR &reply_cdr (void); - /// A flag to check if the reply - int &reply_received (void); - virtual int dispatch_reply (TAO_Pluggable_Reply_Params ¶ms); - // Commented for the time being - Bala - // virtual TAO_GIOP_Message_State *message_state (void); - - virtual void dispatcher_bound (TAO_Transport *); - virtual void connection_closed (void); protected: @@ -66,16 +60,9 @@ protected: IOP::ServiceContextList &reply_service_info_; private: - /// Flag that indicates the reply has been received. - int reply_received_; - /// Cache the ORB Core pointer. TAO_ORB_Core *orb_core_; - /// Save the wait strategy to signal the waiting threads (if - /// appropriate). - TAO_Wait_Strategy *wait_strategy_; - /* @@todo: At some point of time we are going to get to a situation where TAO has huge stack sizes. Need to think on how we would deal with that. One idea would be to push these things on TSS as @@ -93,14 +80,6 @@ private: /// CDR stream which has the reply information that needs to be /// demarshalled by the stubs TAO_InputCDR reply_cdr_; - - /** - * The condition variable used to signal the waiting thread in the - * Leader/Followers model. The variable is acquired in the thread - * that binds the Reply_Dispatcher to its transport, and then passed - * to the Waiting_Strategy to do the signalling, if needed. - */ - TAO_SYNCH_CONDITION *leader_follower_condition_variable_; }; #include "ace/post.h" diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index b319103ab57..ae63a446401 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -387,6 +387,14 @@ SOURCE=.\Flushing_Strategy.cpp # End Source File
# Begin Source File
+SOURCE=.\LF_Follower.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\GIOP_Message_Base.cpp
# End Source File
# Begin Source File
@@ -515,6 +523,26 @@ SOURCE=.\Leader_Follower.cpp # End Source File
# Begin Source File
+SOURCE=.\Leader_Follower_Flushing_Strategy.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LocalObject.cpp
# End Source File
# Begin Source File
@@ -1119,6 +1147,22 @@ SOURCE=.\Flushing_Strategy.h # End Source File
# Begin Source File
+SOURCE=.\LF_Follower.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\giop.h
# End Source File
# Begin Source File
@@ -1267,6 +1311,42 @@ SOURCE=.\Leader_Follower.h # End Source File
# Begin Source File
+SOURCE=.\Leader_Follower_Flushing_Strategy.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Linear_Priority_Mapping.h
# End Source File
# Begin Source File
@@ -1963,6 +2043,30 @@ SOURCE=.\Leader_Follower.i # End Source File
# Begin Source File
+SOURCE=.\LF_Event.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Linear_Priority_Mapping.i
# End Source File
# Begin Source File
diff --git a/TAO/tao/TAO.dsw b/TAO/tao/TAO.dsw index 33302b448de..6def02f39b4 100644 --- a/TAO/tao/TAO.dsw +++ b/TAO/tao/TAO.dsw @@ -219,6 +219,66 @@ Package=<4> ###############################################################################
+Project: "RTCORBA"=.\RTCORBA\TAO_RTCORBA.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name TAO DLL
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "RTCORBA_Static"=.\RTCORBA\TAO_RTCORBA_Static.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "RTPortableServer"=.\RTPortableServer\TAO_RTPortableServer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name PortableServer
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TAO DLL
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name RTCORBA
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "RTPortableServer_Static"=.\RTPortableServer\TAO_RTPortableServer_Static.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "SmartProxies"=.\SmartProxies\SmartProxies.dsp - Package Owner=<4>
Package=<5>
@@ -291,7 +351,7 @@ Package=<4> ###############################################################################
-Project: "TypeCodeFactory_Static"=.\TYPECODEFACTORY\TypeCodeFactory_Static\TypeCodeFactory_Static.dsp - Package Owner=<4>
+Project: "TypeCodeFactory_Static"=H:\fix_886\ACE_wrappers\TAO\tao\TypeCodeFactory\TypeCodeFactory_Static.dsp - Package Owner=<4>
Package=<5>
{{{
diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index 8b7f957361d..95af7b321e0 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -186,18 +186,6 @@ TAO_Internal::open_services_i (int &argc, if (TAO_Internal::service_open_count_++ == 0) { - // @@ We cannot insert the default resource factory into the - // Service Configurator before the ORB is created since it - // will be finalized before the ORB is finalized. The ORB - // requires that a resource factory exist in order to reclaim - // the reactor during finalization. Unfortunately, the - // resource factory must be inserted into the Service - // Repository so that Service Configurator directives such as - // 'static Resource_Factory "-ORBResources global"' actually - // work properly. - // - // This is only a problem when the ORB is dynamically - // loaded/unloaded. ACE_Service_Config::static_svcs ()-> insert (&ace_svc_desc_TAO_Default_Resource_Factory); ACE_Service_Config::static_svcs ()-> diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp index 5353de0a536..e01c7d53320 100644 --- a/TAO/tao/TAO_Static.dsp +++ b/TAO/tao/TAO_Static.dsp @@ -40,8 +40,8 @@ RSC=rc.exe # PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Release"
# PROP Target_Dir ""
-MTL=midl.exe
LINK32=link.exe -lib
+MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../" /D "_WINDOWS" /D "_CONSOLE" /D "NDEBUG" /D "WIN32" /D "TAO_AS_STATIC_LIBS" /D "ACE_AS_STATIC_LIBS" /FD /c
# SUBTRACT CPP /YX
@@ -66,8 +66,8 @@ LIB32=link.exe -lib # PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Debug"
# PROP Target_Dir ""
-MTL=midl.exe
LINK32=link.exe -lib
+MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../" /I "../" /D "_WINDOWS" /D "_CONSOLE" /D "_DEBUG" /D "WIN32" /D "ACE_AS_STATIC_LIBS" /D "TAO_AS_STATIC_LIBS" /FD /c
# SUBTRACT CPP /YX
@@ -323,10 +323,6 @@ SOURCE=.\Flushing_Strategy.h # End Source File
# Begin Source File
-SOURCE=.\giop.h
-# End Source File
-# Begin Source File
-
SOURCE=.\GIOP_Message_Base.h
# End Source File
# Begin Source File
@@ -467,6 +463,38 @@ SOURCE=.\Leader_Follower.h # End Source File
# Begin Source File
+SOURCE=.\LF_Event.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.h
+# End Source File
+# Begin Source File
+
SOURCE=.\LocalObject.h
# End Source File
# Begin Source File
@@ -1151,6 +1179,38 @@ SOURCE=.\Leader_Follower.i # End Source File
# Begin Source File
+SOURCE=.\LF_Event.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.inl
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\LocalObject.i
# End Source File
# Begin Source File
@@ -1787,6 +1847,38 @@ SOURCE=.\Leader_Follower.cpp # End Source File
# Begin Source File
+SOURCE=.\LF_Event.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Binder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Event_Loop_Thread_Helper.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Adder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Follower_Auto_Ptr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\LF_Strategy_Complete.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\LocalObject.cpp
# End Source File
# Begin Source File
diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index f7d4362c48e..3bb6115c194 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -1,8 +1,6 @@ // -*- C++ -*- // $Id$ - - #include "Transport.h" #include "Exception.h" @@ -29,7 +27,6 @@ ACE_RCSID(tao, Transport, "$Id$") - TAO_Synch_Refcountable::TAO_Synch_Refcountable (ACE_Lock *lock, int refcount) : ACE_Refcountable (refcount) , refcount_lock_ (lock) @@ -107,7 +104,7 @@ TAO_Transport::~TAO_Transport (void) { // @@ This is a good point to insert a flag to indicate that a // CloseConnection message was successfully received. - i->connection_closed (); + i->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED); TAO_Queued_Message *tmp = i; i = i->next (); @@ -558,12 +555,6 @@ TAO_Transport::idle_after_reply (void) return this->tms ()->idle_after_reply (); } -TAO_SYNCH_CONDITION * -TAO_Transport::leader_follower_condition_variable (void) -{ - return this->wait_strategy ()->leader_follower_condition_variable (); -} - int TAO_Transport::tear_listen_point_list (TAO_InputCDR &) { @@ -705,7 +696,7 @@ TAO_Transport::close_connection_i (void) for (TAO_Queued_Message *i = this->head_; i != 0; i = i->next ()) { - i->connection_closed (); + i->state_changed (TAO_LF_Event::LFS_CONNECTION_CLOSED); } } @@ -1571,9 +1562,6 @@ TAO_Transport::register_handler (void) guard, *this->handler_lock_, -1)); - if (this->check_event_handler_i ("Transport::register_handler") == -1) - return -1; - return this->register_handler_i (); } diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index 93e4ee7d7a4..20035d38eb6 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -252,13 +252,6 @@ public: int handle_output (void); /** - * Return the TSS leader follower condition variable used in the - * Wait Strategy. Muxed Leader Follower implementation returns a - * valid condition variable, others return 0. - */ - virtual TAO_SYNCH_CONDITION *leader_follower_condition_variable (void); - - /** * Initialising the messaging object. This would be used by the * connector side. On the acceptor side the connection handler * would take care of the messaging objects. @@ -771,10 +764,11 @@ private: /// A helper routine used in drain_queue_i() int drain_queue_helper (int &iovcnt, iovec iov[]); - /// This class needs privileged access to: + /// These classes need privileged access to: /// - schedule_output_i() /// - cancel_output_i() friend class TAO_Reactive_Flushing_Strategy; + friend class TAO_Leader_Follower_Flushing_Strategy; /// Schedule handle_output() callbacks int schedule_output_i (void); diff --git a/TAO/tao/Transport_Mux_Strategy.cpp b/TAO/tao/Transport_Mux_Strategy.cpp index f6c93ddfa4c..2997e5c70d8 100644 --- a/TAO/tao/Transport_Mux_Strategy.cpp +++ b/TAO/tao/Transport_Mux_Strategy.cpp @@ -13,17 +13,3 @@ TAO_Transport_Mux_Strategy::TAO_Transport_Mux_Strategy (TAO_Transport *transport TAO_Transport_Mux_Strategy::~TAO_Transport_Mux_Strategy (void) { } - - -int -TAO_Transport_Mux_Strategy::bind_dispatcher (CORBA::ULong, - TAO_Reply_Dispatcher *rd) -{ - rd->dispatcher_bound (this->transport_); - return 0; -} - -void -TAO_Transport_Mux_Strategy::unbind_dispatcher (CORBA::ULong) -{ -} diff --git a/TAO/tao/Transport_Mux_Strategy.h b/TAO/tao/Transport_Mux_Strategy.h index 5937ff16e9a..d58f8b0fd11 100644 --- a/TAO/tao/Transport_Mux_Strategy.h +++ b/TAO/tao/Transport_Mux_Strategy.h @@ -53,7 +53,7 @@ public: /// Bind the dispatcher with the request id. Commonalities in the /// derived class implementations is kept here. virtual int bind_dispatcher (CORBA::ULong request_id, - TAO_Reply_Dispatcher *rd); + TAO_Reply_Dispatcher *rd) = 0; /** * Unbind the dispatcher, the client is no longer waiting for the @@ -62,7 +62,7 @@ public: * request. * A later reply for that request should be ignored. */ - virtual void unbind_dispatcher (CORBA::ULong request_id); + virtual void unbind_dispatcher (CORBA::ULong request_id) = 0; /// Dispatch the reply for <request_id>, cleanup any resources /// allocated for that request. diff --git a/TAO/tao/Wait_On_Leader_Follower.cpp b/TAO/tao/Wait_On_Leader_Follower.cpp index d614abbafbc..422bc57b541 100644 --- a/TAO/tao/Wait_On_Leader_Follower.cpp +++ b/TAO/tao/Wait_On_Leader_Follower.cpp @@ -3,8 +3,9 @@ #include "tao/Wait_On_Leader_Follower.h" #include "tao/ORB_Core.h" #include "tao/Leader_Follower.h" +#include "tao/Transport.h" +#include "tao/Synch_Reply_Dispatcher.h" #include "tao/debug.h" -#include "Transport.h" ACE_RCSID(tao, Wait_On_Leader_Follower, "$Id$") @@ -47,340 +48,11 @@ TAO_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, int TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, - int &reply_received) + TAO_Synch_Reply_Dispatcher &rd) { - // Cache the ORB core, it won't change and is used multiple times - // below: - TAO_ORB_Core* orb_core = - this->transport_->orb_core (); - - TAO_Leader_Follower& leader_follower = - orb_core->leader_follower (); - - // Obtain the lock. - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, - leader_follower.lock (), -1); - - // Optmize the first iteration [no access to errno] - int result = 1; - - // - // Begin artificial scope for auto_ptr like helpers calling: - // leader_follower.set_client_thread () and (maybe later on) - // leader_follower.set_client_leader_thread (). - // - { - // Calls leader_follower.set_client_thread () on construction and - // leader_follower.reset_client_thread () on destruction. - TAO_LF_Client_Thread_Helper client_thread_helper (leader_follower); - ACE_UNUSED_ARG (client_thread_helper); - - ACE_Countdown_Time countdown (max_wait_time); - - // Check if there is a leader. Note that it cannot be us since we - // gave up our leadership when we became a client. - if (leader_follower.leader_available ()) - { - // = Wait as a follower. - - // Grab the condtion variable. - TAO_SYNCH_CONDITION* cond = - orb_core->leader_follower_condition_variable (); - - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - wait (follower) on Transport <%x>, cond <%x>\n"), - this->transport_, - cond)); - - // Keep the entry on the stack - TAO_Leader_Follower::TAO_Follower_Node node(cond); - - while (!reply_received && - leader_follower.leader_available ()) - { - // Add ourselves to the list, do it everytime we wake up - // from the CV loop. Because: - // - // - The leader thread could have elected us as the new - // leader. - // - Before we can assume the role another thread becomes - // the leader - // - But our condition variable could have been removed - // already, if we don't add it again we will never wake - // up. - // - // Notice that we can have spurious wake ups, in that case - // adding the leader results in an error, that must be - // ignored. - // You may be thinking of not removing the condition - // variable in the code that sends the signal, but - // removing it here, that does not work either, in that - // case the condition variable may be used to: - // - Wake up because its reply arrived - // - Wake up because it must become the leader - // but only the first one has any effect, so the leader is - // lost. - // - - (void) leader_follower.add_follower (&node); - - if (max_wait_time == 0) - { - if (cond == 0 || cond->wait () == -1) - { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - wait (follower) on <%x> ") - ACE_TEXT ("cond == 0 || cond->wait () == -1 : cond = %d\n"), - this->transport_, (cond == 0) ? 0 : cond)); - - // @@ Michael: What is our error handling in this case? - // We could be elected as leader and no leader would come in? - return -1; - } - } - else - { - countdown.update (); - ACE_Time_Value tv = ACE_OS::gettimeofday (); - tv += *max_wait_time; - if (cond == 0 || cond->wait (&tv) == -1) - { - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - wait (follower) on <%x> ") - ACE_TEXT ("cond == 0 || cond->wait (tv) == -1\n"), - this->transport_)); - - if (leader_follower.remove_follower (&node) == -1 - && reply_received == 0) - { - // Remove follower can fail because either - // 1) the reply arrived, or - // 2) somebody elected us as leader, or - // 3) the connection got closed. - // - // reply_received is 1, if the reply arrived. - // reply_received is 0, if the reply did not arrive yet. - // reply_received is -1, if the connection got closed - // - // Therefore: - // If remove_follower fails and reply_received is 0, we know that - // we got elected as a leader. As we cannot be the leader (remember - // we got a timeout), we have to select a new leader. - // - // ACE_DEBUG ((LM_DEBUG, - // "TAO (%P|%t) TAO_Wait_On_Leader_Follower::wait - " - // "We got elected as leader, but have timeout\n")); - - if (leader_follower.elect_new_leader () == -1) - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) TAO_Wait_On_Leader_Follower::wait - " - "elect_new_leader failed\n")); - - } - return -1; - } - } - } - - countdown.update (); - - // @@ Michael: This is an old comment why we do not want to - // remove the follower here. - // We should not remove the follower here, we *must* remove it when - // we signal it so the same condition is not signalled for - // both wake up as a follower and as the next leader. - - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - done (follower) " - "on <%x>, reply_received %d\n"), - this->transport_, reply_received)); - - // Now somebody woke us up to become a leader or to handle our - // input. We are already removed from the follower queue. - - if (reply_received == 1) - return 0; - - // FALLTHROUGH - // We only get here if we woke up but the reply is not - // complete yet, time to assume the leader role.... - // i.e. ACE_ASSERT (reply_received == 0); - } - - // = Leader Code. - - // The only way to reach this point is if we must become the - // leader, because there is no leader or we have to update to a - // leader or we are doing nested upcalls in this case we do - // increase the refcount on the leader in TAO_ORB_Core. - - // Calls leader_follower.set_client_leader_thread () on - // construction and leader_follower.reset_client_leader_thread () - // on destruction. Note that this may increase the refcount of - // the leader. - TAO_LF_Client_Leader_Thread_Helper client_leader_thread_helper (leader_follower); - ACE_UNUSED_ARG (client_leader_thread_helper); - - { - ACE_GUARD_RETURN (ACE_Reverse_Lock<TAO_SYNCH_MUTEX>, rev_mon, - leader_follower.reverse_lock (), -1); - - // Become owner of the reactor. - ACE_Reactor *reactor = orb_core->reactor (); - reactor->owner (ACE_Thread::self ()); - - // Run the reactor event loop. - - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - wait (leader):to enter reactor event loop on <%x>\n"), - this->transport_)); - - // If we got our reply, no need to run the event loop any - // further. - while (!reply_received) - { - // Run the event loop. - result = reactor->handle_events (max_wait_time); - - // Did we timeout? If so, stop running the loop. - if (result == 0 && - max_wait_time != 0 && - *max_wait_time == ACE_Time_Value::zero) - break; - - // Other errors? If so, stop running the loop. - if (result == -1) - break; - - // Otherwise, keep going... - } - - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("TAO (%P|%t) - wait : (leader) : done with reactor event loop on <%x>\n"), - this->transport_)); - } - } - // - // End artificial scope for auto_ptr like helpers calling: - // leader_follower.reset_client_thread () and (maybe) - // leader_follower.reset_client_leader_thread (). - // - - // Wake up the next leader, we cannot do that in handle_input, - // because the woken up thread would try to get into handle_events, - // which is at the time in handle_input still occupied. But do it - // before checking the error in <result>, even if there is an error - // in our input we should continue running the loop in another - // thread. - - if (leader_follower.elect_new_leader () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t):TAO_Wait_On_Leader_Follower::send_request: ") - ACE_TEXT ("Failed to unset the leader and wake up a new follower.\n")), - -1); - - if (result == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t):TAO_Wait_On_Leader_Follower::wait: ") - ACE_TEXT ("handle_events failed.\n")), - -1); - - // Return an error if there was a problem receiving the reply... - if (max_wait_time != 0) - { - if (reply_received != 1 - && *max_wait_time == ACE_Time_Value::zero) - { - result = -1; - errno = ETIME; - } - else if (reply_received == -1) - { - // If the time did not expire yet, but we get a failure, - // e.g. the connections closed, we should still return an error. - result = -1; - } - } - else - { - result = 0; - if (reply_received == -1) - { - result = -1; - } - } - - return result; -} - -TAO_SYNCH_CONDITION * -TAO_Wait_On_Leader_Follower::leader_follower_condition_variable (void) -{ - return this->transport_->orb_core ()->leader_follower_condition_variable (); -} - -int -TAO_Wait_On_Leader_Follower::reply_dispatched (int &reply_received_flag, - TAO_SYNCH_CONDITION *condition) -{ - if (condition == 0) - return 0; - - TAO_Leader_Follower& leader_follower = - this->transport_->orb_core ()->leader_follower (); - - // Obtain the lock. - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, - leader_follower.lock (), - -1); - - reply_received_flag = 1; - - // The following works as the node is assumed to be on the stack - // till the thread is alive. - TAO_Leader_Follower::TAO_Follower_Node node (condition); - - // We *must* remove it when we signal it so the same condition - // is not signalled for both wake up as a follower and as the - // next leader. - // The follower may not be there if the reply is received while - // the consumer is not yet waiting for it (i.e. it send the - // request but has not blocked to receive the reply yet). - // Ignore errors. - (void) leader_follower.remove_follower (&node); - - if (condition->signal () == -1) - return -1; - - return 0; -} - -void -TAO_Wait_On_Leader_Follower::connection_closed (int &reply_received_flag, - TAO_SYNCH_CONDITION *condition) -{ - if (condition == 0) - return; - TAO_Leader_Follower& leader_follower = this->transport_->orb_core ()->leader_follower (); - - // Obtain the lock. - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, leader_follower.lock ()); - - reply_received_flag = -1; - - // The following works as the node is assumed to be on the stack - // till the thread is alive. - TAO_Leader_Follower::TAO_Follower_Node node(condition); - - (void) leader_follower.remove_follower (&node); - - (void) condition->signal (); + return leader_follower.wait_for_event (&rd, + this->transport_, + max_wait_time); } diff --git a/TAO/tao/Wait_On_Leader_Follower.h b/TAO/tao/Wait_On_Leader_Follower.h index 179964fde68..a65d19cd854 100644 --- a/TAO/tao/Wait_On_Leader_Follower.h +++ b/TAO/tao/Wait_On_Leader_Follower.h @@ -49,12 +49,9 @@ public: virtual int sending_request (TAO_ORB_Core *orb_core, int two_way); virtual int wait (ACE_Time_Value *max_wait_time, - int &reply_received); + TAO_Synch_Reply_Dispatcher &rd); virtual int register_handler (void); virtual int non_blocking (void); - virtual TAO_SYNCH_CONDITION *leader_follower_condition_variable (void); - virtual int reply_dispatched (int &, TAO_SYNCH_CONDITION *); - virtual void connection_closed (int &, TAO_SYNCH_CONDITION *); }; #include "ace/post.h" diff --git a/TAO/tao/Wait_On_Reactor.cpp b/TAO/tao/Wait_On_Reactor.cpp index b57ba86b1a2..9abc0063b37 100644 --- a/TAO/tao/Wait_On_Reactor.cpp +++ b/TAO/tao/Wait_On_Reactor.cpp @@ -2,7 +2,8 @@ #include "tao/Wait_On_Reactor.h" #include "tao/ORB_Core.h" -#include "Transport.h" +#include "tao/Transport.h" +#include "tao/Synch_Reply_Dispatcher.h" ACE_RCSID(tao, Wait_On_Reactor, "$Id$") @@ -17,7 +18,7 @@ TAO_Wait_On_Reactor::~TAO_Wait_On_Reactor (void) int TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, - int &reply_received) + TAO_Synch_Reply_Dispatcher &rd) { // Reactor does not change inside the loop. ACE_Reactor* reactor = @@ -32,7 +33,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, // If we got our reply, no need to run the event loop any // further. - if (reply_received) + if (!rd.keep_waiting ()) break; // Did we timeout? If so, stop running the loop. @@ -48,13 +49,13 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, // Otherwise, keep going... } - if (result == -1 || reply_received == -1) + if (result == -1 || rd.error_detected ()) return -1; // Return an error if there was a problem receiving the reply. if (max_wait_time != 0) { - if (reply_received != 1 && + if (rd.successful () && *max_wait_time == ACE_Time_Value::zero) { result = -1; @@ -64,7 +65,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, else { result = 0; - if (reply_received == -1) + if (rd.error_detected ()) result = -1; } diff --git a/TAO/tao/Wait_On_Reactor.h b/TAO/tao/Wait_On_Reactor.h index 3e69a25a9ba..412c194d2af 100644 --- a/TAO/tao/Wait_On_Reactor.h +++ b/TAO/tao/Wait_On_Reactor.h @@ -41,7 +41,7 @@ public: // = Documented in TAO_Wait_Strategy. virtual int wait (ACE_Time_Value *max_wait_time, - int &reply_received); + TAO_Synch_Reply_Dispatcher &rd); virtual int register_handler (void); virtual int non_blocking (void); }; diff --git a/TAO/tao/Wait_On_Read.cpp b/TAO/tao/Wait_On_Read.cpp index 29e983a90db..6e82919b65b 100644 --- a/TAO/tao/Wait_On_Read.cpp +++ b/TAO/tao/Wait_On_Read.cpp @@ -1,8 +1,9 @@ // $Id$ #include "tao/Wait_On_Read.h" -#include "Transport.h" -#include "Resume_Handle.h" +#include "tao/Transport.h" +#include "tao/Resume_Handle.h" +#include "tao/Synch_Reply_Dispatcher.h" ACE_RCSID(tao, Wait_On_Read, "$Id$") @@ -20,9 +21,9 @@ TAO_Wait_On_Read::~TAO_Wait_On_Read (void) // Wait on the read operation. int TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, - int &reply_received) + TAO_Synch_Reply_Dispatcher &rd) { - reply_received = 0; + rd.state_changed (TAO_LF_Event::LFS_ACTIVE); // Do the same sort of looping that is done in other wait // strategies. @@ -37,7 +38,7 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, // If we got our reply, no need to run the loop any // further. - if (reply_received) + if (!rd.keep_waiting ()) break; // @@ We are not checking for timeouts here... @@ -47,12 +48,18 @@ TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, break; } - if (reply_received == -1 || retval == -1) + if (rd.error_detected () == -1 || retval == -1) { this->transport_->close_connection (); } - return (reply_received == 1 ? 0 : reply_received); + if (rd.successful ()) + return 0; + + if (rd.error_detected ()) + return -1; + + return 1; } // No-op. diff --git a/TAO/tao/Wait_On_Read.h b/TAO/tao/Wait_On_Read.h index b6a3c65bc4e..142c7905a48 100644 --- a/TAO/tao/Wait_On_Read.h +++ b/TAO/tao/Wait_On_Read.h @@ -40,7 +40,7 @@ public: // = Documented in TAO_Wait_Strategy. virtual int wait (ACE_Time_Value *max_wait_time, - int &reply_received); + TAO_Synch_Reply_Dispatcher &rd); virtual int register_handler (void); virtual int non_blocking (void); }; diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index 336370dca13..3f79613f092 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -27,28 +27,3 @@ TAO_Wait_Strategy::sending_request (TAO_ORB_Core * /* orb_core */, { return 0; } - -TAO_SYNCH_CONDITION * -TAO_Wait_Strategy::leader_follower_condition_variable (void) -{ - return 0; -} - -int -TAO_Wait_Strategy::reply_dispatched (int &reply_received, - TAO_SYNCH_CONDITION *) -{ - // In most implementations of this strategy there is no need to - // acquire any mutex to set the reply_received flag. - reply_received = 1; - return 0; -} - -void -TAO_Wait_Strategy::connection_closed (int &reply_received, - TAO_SYNCH_CONDITION*) -{ - // In most implementations of this strategy there is no need to - // acquire any mutex to set the reply_received flag. - reply_received = -1; -} diff --git a/TAO/tao/Wait_Strategy.h b/TAO/tao/Wait_Strategy.h index c00e64c11a8..a9bf3d29618 100644 --- a/TAO/tao/Wait_Strategy.h +++ b/TAO/tao/Wait_Strategy.h @@ -23,6 +23,7 @@ class TAO_ORB_Core; class TAO_Transport; +class TAO_Synch_Reply_Dispatcher; /** * @class TAO_Wait_Strategy @@ -51,7 +52,7 @@ public: /// Base class virtual method. Wait till the <reply_received> flag is /// true or the time expires. virtual int wait (ACE_Time_Value *max_wait_time, - int &reply_received) = 0; + TAO_Synch_Reply_Dispatcher &rd) = 0; /// Register the handler needs with the reactor provided that it makes /// sense for the strategy. @@ -61,37 +62,6 @@ public: /// the socket on which it is waiting to non-blocking mode or not. virtual int non_blocking (void) = 0; - /** - * Return the TSS leader follower condition variable used in the - * Wait Strategy. Muxed Leader Follower implementation returns a - * valid condition variable, others return 0. - * The condition variable is acquired by the Reply_Dispatcher (when - * needed) in the thread that binds it to the right Transport. - * Later (when the reply is finally received) the Reply_Dispatcher - * passes this condition variable back to Waiting_Strategy, that can - * then signal the waiting thread if needed. - */ - virtual TAO_SYNCH_CONDITION *leader_follower_condition_variable (void); - - /** - * This is the callback used by the Reply_Dispatcher to inform the - * Waiting_Strategy that a reply has been completely received, that - * it was already stored in the right place, and that the condition - * variable should be signalled if needed. - * The Waiting_Strategy must set the reply received flag, using - * whatever locks it needs. - */ - virtual int reply_dispatched (int &reply_received_flag, - TAO_SYNCH_CONDITION *); - - /** - * The connection has been closed by the lower level components in - * the ORB. - * The wait has finished and must result in an error. - */ - virtual void connection_closed (int &reply_received_flag, - TAO_SYNCH_CONDITION*); - /// Get/Set method for the flag int is_registered (void); void is_registered (int flag); diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index 59549a457b9..804dc0764a2 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -24,7 +24,7 @@ TAO_Default_Client_Strategy_Factory::TAO_Default_Client_Strategy_Factory (void) this->wait_strategy_ = TAO_WAIT_ON_LEADER_FOLLOWER; #endif /* TAO_USE_ST_CLIENT_CONNECTION_HANDLER */ -#if defined (TAO_USE_MUXED_TRANSPORT_MUX_STRATEGY) +#if TAO_USE_MUXED_TRANSPORT_MUX_STRATEGY == 1 this->transport_mux_strategy_ = TAO_MUXED_TMS; #else this->transport_mux_strategy_ = TAO_EXCLUSIVE_TMS; diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp index 08b52c3c2dd..fcbfeb234fc 100644 --- a/TAO/tao/default_resource.cpp +++ b/TAO/tao/default_resource.cpp @@ -12,9 +12,13 @@ #include "tao/Reactive_Flushing_Strategy.h" #include "tao/Block_Flushing_Strategy.h" +#include "tao/Leader_Follower_Flushing_Strategy.h" + #include "tao/Leader_Follower.h" #include "tao/LRU_Connection_Purging_Strategy.h" +#include "tao/LF_Strategy_Complete.h" + #include "ace/TP_Reactor.h" #include "ace/Dynamic_Service.h" #include "ace/Arg_Shifter.h" @@ -26,8 +30,6 @@ ACE_RCSID(tao, default_resource, "$Id$") - - TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void) : use_tss_resources_ (0), use_locked_data_blocks_ (1), @@ -42,7 +44,7 @@ TAO_Default_Resource_Factory::TAO_Default_Resource_Factory (void) options_processed_ (0), factory_disabled_ (0), cached_connection_lock_type_ (TAO_THREAD_LOCK), - flushing_strategy_type_ (TAO_REACTIVE_FLUSHING) + flushing_strategy_type_ (TAO_LEADER_FOLLOWER_FLUSHING) { } @@ -81,7 +83,7 @@ TAO_Default_Resource_Factory::init (int argc, char **argv) return 0; } this->options_processed_ = 1; - + this->parser_names_count_ = 0; int curarg = 0; @@ -335,6 +337,9 @@ TAO_Default_Resource_Factory::init (int argc, char **argv) char *name = argv[curarg]; if (ACE_OS::strcasecmp (name, + "leader_follower") == 0) + this->flushing_strategy_type_ = TAO_LEADER_FOLLOWER_FLUSHING; + else if (ACE_OS::strcasecmp (name, "reactive") == 0) this->flushing_strategy_type_ = TAO_REACTIVE_FLUSHING; else if (ACE_OS::strcasecmp (name, @@ -378,7 +383,7 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, } // OK fallback on the hardcoded ones.... - this->parser_names_count_ = 4; // HOW MANY DO WE HAVE? + this->parser_names_count_ = 4; /*HOW MANY DO WE HAVE?*/ this->parser_names_ = new char *[this->parser_names_count_]; @@ -387,9 +392,7 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, ++i) this->parser_names_[i] = 0; - // Ensure that there is enough space in the parser_names_ array - - size_t index = 0; + // Ensure that there is enough space in the parser_names_ array */ // DLL_Parser TAO_IOR_Parser *tmp = @@ -408,8 +411,12 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, } } - this->parser_names_[index] = CORBA::string_dup ("DLL_Parser"); - index++; + int index = 0; + if (tmp != 0) + { + this->parser_names_[index] = CORBA::string_dup ("DLL_Parser"); + index++; + } // FILE_Parser tmp = @@ -428,9 +435,12 @@ TAO_Default_Resource_Factory::get_parser_names (char **&names, "Error Configuring FILE Parser\n"), -1); } } + if (tmp != 0) + { + this->parser_names_[index] = CORBA::string_dup ("FILE_Parser"); + index++; + } - this->parser_names_[index] = CORBA::string_dup ("FILE_Parser"); - index++; // CORBALOC_Parser tmp = @@ -839,7 +849,11 @@ TAO_Flushing_Strategy * TAO_Default_Resource_Factory::create_flushing_strategy (void) { TAO_Flushing_Strategy *strategy = 0; - if (this->flushing_strategy_type_ == TAO_REACTIVE_FLUSHING) + if (this->flushing_strategy_type_ == TAO_LEADER_FOLLOWER_FLUSHING) + ACE_NEW_RETURN (strategy, + TAO_Leader_Follower_Flushing_Strategy, + 0); + else if (this->flushing_strategy_type_ == TAO_REACTIVE_FLUSHING) ACE_NEW_RETURN (strategy, TAO_Reactive_Flushing_Strategy, 0); @@ -879,7 +893,7 @@ TAO_Default_Resource_Factory::create_lf_strategy (void) TAO_LF_Strategy *strategy = 0; ACE_NEW_RETURN (strategy, - TAO_Complete_LF_Strategy, + TAO_LF_Strategy_Complete, 0); return strategy; diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h index 3f189678498..917a5f7eb14 100644 --- a/TAO/tao/default_resource.h +++ b/TAO/tao/default_resource.h @@ -171,7 +171,7 @@ protected: /// If it has been disabled we should print warnings if options /// were processed before (or later). int factory_disabled_; - + private: enum Lock_Type { @@ -184,6 +184,7 @@ private: enum Flushing_Strategy_Type { + TAO_LEADER_FOLLOWER_FLUSHING, TAO_REACTIVE_FLUSHING, TAO_BLOCKING_FLUSHING }; diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 52d26fc85f9..99e73675bbb 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -982,5 +982,10 @@ enum TAO_Policy_Scope # define TAO_DOESNT_RESUME_CONNECTION_HANDLER 0 #endif /*TAO_DOESNT_RESUMES_CONNECTION_HANDLER*/ +/// By default we use Muxed Transports +#if !defined (TAO_USE_MUXED_TRANSPORT_MUX_STRAGEGY) +# define TAO_USE_MUXED_TRANSPORT_MUX_STRAGEGY 1 +#endif /* TAO_USE_MUXED_TRANSPORT_MUX_STRAGEGY */ + #include "ace/post.h" #endif /* TAO_ORB_CONFIG_H */ diff --git a/TAO/tests/BiDirectional_NestedUpcall/svc.conf b/TAO/tests/BiDirectional_NestedUpcall/svc.conf new file mode 100644 index 00000000000..1987d3d81c6 --- /dev/null +++ b/TAO/tests/BiDirectional_NestedUpcall/svc.conf @@ -0,0 +1,9 @@ +# $Id$ +# + +# This configuration file is used to use only the default TAO +# strategies + +dynamic Advanced_Resource_Factory Service_Object * TAO_Strategies:_make_TAO_Advanced_Resource_Factory () "-ORBReactorType select_mt" + + diff --git a/TAO/tests/Blocking_Sync_None/client.cpp b/TAO/tests/Blocking_Sync_None/client.cpp index 72ac3fcc768..ad5979bff08 100644 --- a/TAO/tests/Blocking_Sync_None/client.cpp +++ b/TAO/tests/Blocking_Sync_None/client.cpp @@ -61,10 +61,12 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; if (CORBA::is_nil (blocking_sync_none.in ())) - ACE_ERROR_RETURN ((LM_DEBUG, - "ERROR: Nil reference in Blocking_Sync_None reference <%s>\n", - ior), - 1); + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Test::Blocking_Sync_None reference <%s>\n", + ior), + 1); + } CORBA::Object_var object = orb->resolve_initial_references ("PolicyCurrent", ACE_TRY_ENV); diff --git a/TAO/tests/IDL_Test/Makefile b/TAO/tests/IDL_Test/Makefile index 79e06fb746b..e689afae5a2 100644 --- a/TAO/tests/IDL_Test/Makefile +++ b/TAO/tests/IDL_Test/Makefile @@ -22,7 +22,6 @@ IDL_ALWAYS = anonymous \ full \ fwd \ generic_object \ - gperf \ included \ including \ interface \ diff --git a/TAO/tests/IDL_Test/Makefile.bor b/TAO/tests/IDL_Test/Makefile.bor index d82cc9e5e2b..77bd990493f 100644 --- a/TAO/tests/IDL_Test/Makefile.bor +++ b/TAO/tests/IDL_Test/Makefile.bor @@ -21,8 +21,6 @@ OBJFILES = \ $(OBJDIR)\fwdS.obj \ $(OBJDIR)\generic_objectC.obj \ $(OBJDIR)\generic_objectS.obj \ - $(OBJDIR)\gperfC.obj \ - $(OBJDIR)\gperfS.obj \ $(OBJDIR)\includedC.obj \ $(OBJDIR)\includedS.obj \ $(OBJDIR)\includingC.obj \ @@ -70,7 +68,6 @@ IDLFILES = \ $(IDLDIR)\full.idl \ $(IDLDIR)\fwd.idl \ $(IDLDIR)\generic_object.idl \ - $(IDLDIR)\gperf.idl \ $(IDLDIR)\included.idl \ $(IDLDIR)\including.idl \ $(IDLDIR)\interface.idl \ @@ -115,9 +112,6 @@ $(IDLDIR)\fwdC.cpp $(IDLDIR)\fwdS.cpp: $(IDLDIR)\fwd.idl $(IDLDIR)\generic_objectC.cpp $(IDLDIR)\generic_objectS.cpp: $(IDLDIR)\generic_object.idl $(TAO_IDL) $** -$(IDLDIR)\gperfC.cpp $(IDLDIR)\gperfS.cpp: $(IDLDIR)\gperf.idl - $(TAO_IDL) $** - $(IDLDIR)\includedC.cpp $(IDLDIR)\includedS.cpp: $(IDLDIR)\included.idl $(TAO_IDL) $** diff --git a/TAO/tests/IDL_Test/gperf.idl b/TAO/tests/IDL_Test/gperf.idl deleted file mode 100644 index a26cb9f9f33..00000000000 --- a/TAO/tests/IDL_Test/gperf.idl +++ /dev/null @@ -1,98 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/IDL_Test -// -// = FILENAME -// gperf.idl -// -// = DESCRIPTION -// This file contains examples of IDL code that has -// caused problems in the past for the TAO IDL -// compiler. This test is to make sure the problems -// stay fixed. -// -// = AUTHORS -// Jeff Parsons <parsons@cs.wustl.edu> and TAO users. -// -// ============================================================================ - -// The examples below uncovered some bugs in gperf, -// in the form of runtime errors when clients made -// requests on some of the methods, for example - -// TAO_Perfect_Hash_Table:find failed -// Bad operation <ackConfArchData> - - -enum TestEnum -{ - first, - second, - third -}; - -interface testlistitem -{ - readonly attribute string name; -}; - - -interface test -{ - attribute string stest; -#ifndef WITHOUT_CORBA_WSTRING - attribute wstring wstest; -#else - attribute string wstest; -#endif -#ifndef WITHOUT_CORBA_LONGLONG - attribute long long ltest; -#else - attribute long ltest; -#endif -#ifndef WITHOUT_CORBA_LONGDOUBLE - attribute long double ldtest; -#else - attribute double ldtest; -#endif - attribute TestEnum etest; -#ifndef WITHOUT_CORBA_WSTRING - attribute wstring setest; -#else - attribute string setest; -#endif - attribute testlistitem tltest; - - testlistitem new_testlistitem (in string name); -}; - -interface Simple_Server -{ - oneway void ackConfBasData (); - - oneway void ackConfMosData (); - oneway void ackConfTwmData (); - oneway void ackConfArchData (); - oneway void ackConfVonData (); - oneway void ackConfFftData (); - oneway void ackConfSosData (); - oneway void ackConfSscData (); - oneway void ackConfCsData (); - - oneway void ackConfR10Data (); - oneway void ackConfR11Data (); - oneway void ackConfR12Data (); - oneway void ackConfR13Data (); - oneway void ackConfR14Data (); - oneway void ackConfR15Data (); - - oneway void shutdown (); - - oneway void transferTriggerDb (); - oneway void transferTriggerTdc (); -}; - - diff --git a/TAO/tests/IDL_Test/idl_test.dsp b/TAO/tests/IDL_Test/idl_test.dsp index 6b9dd766e8c..dbb548e805f 100644 --- a/TAO/tests/IDL_Test/idl_test.dsp +++ b/TAO/tests/IDL_Test/idl_test.dsp @@ -145,14 +145,6 @@ SOURCE=.\generic_objectS.cpp # End Source File
# Begin Source File
-SOURCE=.\gperfC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\gperfS.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\includedC.cpp
# End Source File
# Begin Source File
@@ -321,14 +313,6 @@ SOURCE=.\generic_objectS.h # End Source File
# Begin Source File
-SOURCE=.\gperfC.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\gperfS.h
-# End Source File
-# Begin Source File
-
SOURCE=.\includedC.h
# End Source File
# Begin Source File
@@ -473,14 +457,6 @@ SOURCE=.\generic_objectC.i # End Source File
# Begin Source File
-SOURCE=.\gperfC.i
-# End Source File
-# Begin Source File
-
-SOURCE=.\gperfS.i
-# End Source File
-# Begin Source File
-
SOURCE=.\includedC.i
# End Source File
# Begin Source File
@@ -1024,53 +1000,6 @@ BuildCmds= \ # End Source File
# Begin Source File
-SOURCE=.\gperf.idl
-
-!IF "$(CFG)" == "idl_test - Win32 Release"
-
-!ELSEIF "$(CFG)" == "idl_test - Win32 Debug"
-
-USERDEP__GPERF="..\..\..\bin\tao_idl.exe"
-# Begin Custom Build - Invoking TAO IDL Compiler on $(InputName).idl
-InputPath=.\gperf.idl
-InputName=gperf
-
-BuildCmds= \
- ..\..\..\bin\tao_idl -Ge 1 $(InputName).idl
-
-"$(InputName)C.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)C.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.i" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"$(InputName)S_T.cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
SOURCE=.\included.idl
!IF "$(CFG)" == "idl_test - Win32 Release"
diff --git a/TAO/tests/Oneways_Invoking_Twoways/client.dsp b/TAO/tests/Oneways_Invoking_Twoways/client.dsp index de85042c14e..8c4ba39ea01 100644 --- a/TAO/tests/Oneways_Invoking_Twoways/client.dsp +++ b/TAO/tests/Oneways_Invoking_Twoways/client.dsp @@ -51,8 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 tao.lib ace.lib TAO_PortableServer.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace" /libpath:"..\..\tao" /libpath:"..\..\tao\PortableServer"
-# SUBTRACT LINK32 /pdb:none
+# ADD LINK32 tao.lib ace.lib TAO_PortableServer.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\ace" /libpath:"..\..\tao"
!ELSEIF "$(CFG)" == "Oneways_Invoking_Twoways Client - Win32 Debug"
diff --git a/TAO/tests/RTCORBA/Banded_Connections/bands.hpux b/TAO/tests/RTCORBA/Banded_Connections/bands.hpux deleted file mode 100644 index f4b469e61f4..00000000000 --- a/TAO/tests/RTCORBA/Banded_Connections/bands.hpux +++ /dev/null @@ -1 +0,0 @@ -16 20 21 27 28 31 diff --git a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl index fafc593a837..87ab1a0e7a6 100755 --- a/TAO/tests/RTCORBA/Banded_Connections/run_test.pl +++ b/TAO/tests/RTCORBA/Banded_Connections/run_test.pl @@ -62,19 +62,6 @@ if ($^O eq "dec_osf") { ."-a 23 -b 28 -c 34 "; } -if ($^O eq "hpux") { - $server_args = - "-n $iorfile1 -o $iorfile2 -b bands.hpux -ORBSvcConf $server_conf " - ."-p 17 -w 32 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=20 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=27 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=31 "; - - $client_args = - "-n file://$iorfile1 -o file://$iorfile2 " - ."-a 20 -b 27 -c 32 "; -} - $SV = new PerlACE::Process ("server", $server_args); $CL = new PerlACE::Process ("client", $client_args); diff --git a/TAO/tests/RTCORBA/Client_Propagated/client.cpp b/TAO/tests/RTCORBA/Client_Propagated/client.cpp index 58a48b7a744..f890ca903a4 100644 --- a/TAO/tests/RTCORBA/Client_Propagated/client.cpp +++ b/TAO/tests/RTCORBA/Client_Propagated/client.cpp @@ -49,25 +49,12 @@ main (int argc, char *argv[]) int min_priority = ACE_Sched_Params::priority_min (ACE_SCHED_OTHER); - if (max_priority > min_priority) + if ((max_priority + min_priority) / 2 + 2 > max_priority) { - if ((max_priority + min_priority) / 2 + 2 > max_priority) - { - ACE_DEBUG ((LM_DEBUG, - "Not enough priority levels on this platform" - "to run the test, aborting\n")); - return 0; - } - } - else - { - if ((max_priority + min_priority) / 2 + 2 > min_priority) - { - ACE_DEBUG ((LM_DEBUG, - "Not enough priority levels on this platform" - "to run the test, aborting\n")); - return 0; - } + ACE_DEBUG ((LM_DEBUG, + "Not enough priority levels on this platform" + "to run the test, aborting\n")); + return 0; } // Register the interceptors to check for the RTCORBA @@ -194,13 +181,6 @@ main (int argc, char *argv[]) server->shutdown (ACE_TRY_ENV); ACE_TRY_CHECK; } - ACE_CATCH (CORBA::DATA_CONVERSION, ex) - { - ACE_PRINT_EXCEPTION(ex, - "Most likely, this is due to the in-ability " - "to set the thread priority."); - return 1; - } ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, diff --git a/TAO/tests/RTCORBA/Client_Propagated/server.cpp b/TAO/tests/RTCORBA/Client_Propagated/server.cpp index 93054d1e483..72b6d647391 100644 --- a/TAO/tests/RTCORBA/Client_Propagated/server.cpp +++ b/TAO/tests/RTCORBA/Client_Propagated/server.cpp @@ -59,7 +59,7 @@ Test_i::test_method (CORBA::Short priority, // Print out the info. if (servant_thread_priority != priority) ACE_DEBUG ((LM_DEBUG, - "ERROR: servant thread priority is not equal " + "ERROR: servant thread priority is not equal" "to method argument.\n")); ACE_DEBUG ((LM_DEBUG, @@ -221,7 +221,7 @@ main (int argc, char *argv[]) if (final_thread_priority != initial_thread_priority) ACE_DEBUG ((LM_DEBUG, - "ERROR: Priority of the servant thread " + "ERROR: Priority of the servant thread" "has been permanently changed!\n" "Initial priority: %d Final priority: %d\n", initial_thread_priority, final_thread_priority)); diff --git a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl index b3d985c0194..658c2db8baf 100755 --- a/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl +++ b/TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl @@ -30,16 +30,12 @@ if ($^O eq "MSWin32") { $priority2 = 1; $priority3 = 5; } -elsif ($^O eq "dec_osf") { + +if ($^O eq "dec_osf") { $priority1 = 20; $priority2 = 25; $priority3 = 30; } -elsif ($^O eq "hpux") { - $priority1 = 17; - $priority2 = 22; - $priority3 = 29; -} # Clean up leftovers from previous runs. unlink $iorfile; diff --git a/TAO/tests/RTCORBA/Server_Declared/run_test.pl b/TAO/tests/RTCORBA/Server_Declared/run_test.pl index e13efcd664f..5c73bc8a7a6 100755 --- a/TAO/tests/RTCORBA/Server_Declared/run_test.pl +++ b/TAO/tests/RTCORBA/Server_Declared/run_test.pl @@ -33,23 +33,17 @@ print STDERR "Value is " . $^O; if ($^O eq "MSWin32") { $server_args = "-p $iorfile1 -o $iorfile2 -a 3 -b 5 -c 2 -ORBSvcConf $server_conf " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=3 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=5 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=1 "; + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=3 " + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=5 " + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=1 "; } -elsif ($^O eq "dec_osf") { + +if ($^O eq "dec_osf") { $server_args = "-p $iorfile1 -o $iorfile2 -a 20 -b 30 -c 25 -ORBSvcConf $server_conf " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=20 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=30 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=28 "; -} -elsif ($^O eq "hpux") { - $server_args = - "-p $iorfile1 -o $iorfile2 -a 17 -b 29 -c 24 -ORBSvcConf $server_conf " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=17 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=29 " - ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=27 "; + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=20 " + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=30 " + ."-ORBendpoint iiop://$TARGETHOSTNAME:0/priority=28 "; } $client_args = "-p file://$iorfile1 -o file://$iorfile2"; diff --git a/TAO/tests/Smart_Proxies/Benchmark/Makefile b/TAO/tests/Smart_Proxies/Benchmark/Makefile index 0d12c7c2104..f09dadb09f4 100644 --- a/TAO/tests/Smart_Proxies/Benchmark/Makefile +++ b/TAO/tests/Smart_Proxies/Benchmark/Makefile @@ -49,7 +49,7 @@ CPPFLAGS += .PRECIOUS: testS.h testS.i testS.cpp server: $(addprefix $(VDIR),$(SERVER_OBJS)) - $(LINK.cc) $(LDFLAGS) -o $@ $^ $(TAO_SRVR_LIBS) $(POSTLINK) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) client: $(addprefix $(VDIR),$(CLIENT_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) diff --git a/TAO/tests/Smart_Proxies/Policy/Makefile b/TAO/tests/Smart_Proxies/Policy/Makefile index d8daadd1087..affd82f5898 100644 --- a/TAO/tests/Smart_Proxies/Policy/Makefile +++ b/TAO/tests/Smart_Proxies/Policy/Makefile @@ -48,7 +48,7 @@ LDFLAGS += -L$(TAO_ROOT)/tao .PRECIOUS: testS.h testS.i testS.cpp server: $(addprefix $(VDIR),$(SERVER_OBJS)) - $(LINK.cc) $(LDFLAGS) -o $@ $^ $(TAO_SRVR_LIBS) $(POSTLINK) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) client: $(addprefix $(VDIR),$(CLIENT_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) |