00001
00002
00003 #ifndef TAO_AV_ENDPOINT_STRATEGY_T_CPP
00004 #define TAO_AV_ENDPOINT_STRATEGY_T_CPP
00005
00006 #include "orbsvcs/AV/Endpoint_Strategy_T.h"
00007
00008 #include "tao/debug.h"
00009
00010 #include "ace/Process_Semaphore.h"
00011 #include "ace/OS_NS_unistd.h"
00012
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016
00017
00018
00019
00020 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00021 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy (void)
00022 : stream_endpoint_a_servant_(0), stream_endpoint_b_servant_(0), vdev_servant_(0),
00023 media_ctrl_servant_(0)
00024 {
00025 }
00026
00027 template <class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
00028 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy (void)
00029 {
00030
00031 try
00032 {
00033 if(this->stream_endpoint_a_servant_ )
00034 {
00035 stream_endpoint_a_servant_->_remove_ref ();
00036 }
00037
00038 if(this->stream_endpoint_b_servant_)
00039 {
00040 stream_endpoint_b_servant_->_remove_ref ();
00041 }
00042
00043 if(this->vdev_servant_)
00044 {
00045 vdev_servant_->_remove_ref ();
00046 }
00047
00048 if(this->media_ctrl_servant_)
00049 {
00050 media_ctrl_servant_->_remove_ref ();
00051 }
00052 }
00053 catch (const CORBA::Exception&)
00054 {
00055 }
00056
00057 }
00058
00059
00060 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00061 int
00062 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate (void)
00063 {
00064 try
00065 {
00066 this->activate_stream_endpoint ();
00067 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated stream_endpoint\n"));
00068
00069 this->activate_vdev ();
00070 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated vdev\n"));
00071
00072 this->activate_mediactrl ();
00073 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated mediactrl\n"));
00074 }
00075 catch (const CORBA::Exception& ex)
00076 {
00077 ex._tao_print_exception (
00078 "TAO_Endpoint_Reactive_Strategy::activate");
00079 return -1;
00080 }
00081 return 0;
00082 }
00083
00084 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00085 char *
00086 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant)
00087 {
00088
00089 PortableServer::ObjectId_var id =
00090 this->poa_->activate_object (servant);
00091
00092 CORBA::Object_var obj =
00093 this->poa_->id_to_reference (id.in ());
00094
00095 CORBA::String_var str =
00096 this->orb_->object_to_string (obj.in ());
00097
00098 return str._retn ();
00099 }
00100
00101
00102
00103 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00104 int
00105 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_vdev (void)
00106 {
00107 try
00108 {
00109
00110 T_VDev *vdev = 0;
00111 if (this->make_vdev (vdev) == -1)
00112 return -1;
00113
00114
00115
00116
00117
00118
00119
00120
00121 this->vdev_ = vdev->_this ();
00122 }
00123 catch (const CORBA::Exception& ex)
00124 {
00125 ex._tao_print_exception (
00126 "TAO_AV_Endpoint_Reactive_Strategy::activate_vdev");
00127 return -1;
00128 }
00129 return 0;
00130 }
00131
00132
00133
00134 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00135 int
00136 TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_mediactrl (void)
00137 {
00138 try
00139 {
00140
00141 if (this->make_mediactrl ( media_ctrl_servant_ ) == -1)
00142 return -1;
00143
00144
00145 CORBA::Any anyval;
00146 media_ctrl_obj_
00147 = media_ctrl_servant_->_this ();
00148
00149 anyval <<= media_ctrl_obj_.in();
00150
00151
00152 this->vdev_->define_property ("Related_MediaCtrl",
00153 anyval);
00154
00155 }
00156 catch (const CORBA::Exception& ex)
00157 {
00158 ex._tao_print_exception (
00159 "TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl");
00160 return -1;
00161 }
00162 return 0;
00163 }
00164
00165
00166 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00167 int
00168 TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint)
00169 {
00170 ACE_NEW_RETURN (stream_endpoint,
00171 T_StreamEndpoint,
00172 -1);
00173 return 0;
00174 }
00175
00176
00177 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00178 int
00179 TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev)
00180 {
00181 ACE_NEW_RETURN (vdev,
00182 T_VDev,
00183 -1);
00184 return 0;
00185 }
00186
00187
00188 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00189 int
00190 TAO_AV_Endpoint_Reactive_Strategy<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl)
00191 {
00192 ACE_NEW_RETURN (media_ctrl,
00193 T_MediaCtrl,
00194 -1);
00195 return 0;
00196 }
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00207 TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy_A (void)
00208 {
00209 }
00210
00211
00212
00213 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00214 TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy_A (void)
00215 {
00216 }
00217
00218
00219 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00220 int
00221 TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
00222 {
00223 this->orb_ = CORBA::ORB::_duplicate (orb);
00224 this->poa_ = PortableServer::POA::_duplicate (poa);
00225 return 0;
00226 }
00227
00228
00229
00230 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00231 int
00232 TAO_AV_Endpoint_Reactive_Strategy_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
00233 AVStreams::VDev_ptr &vdev)
00234 {
00235 if (this->activate () == -1)
00236 ACE_ERROR_RETURN ((LM_ERROR,
00237 "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_A: Error in activate ()\n"),
00238 -1);
00239
00240 stream_endpoint = AVStreams::StreamEndPoint_A::_duplicate( this->stream_endpoint_a_.in() );
00241 vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
00242 return 0;
00243
00244 }
00245
00246
00247 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00248 int
00249 TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (void)
00250 {
00251 try
00252 {
00253
00254
00255 if (this->make_stream_endpoint (this->stream_endpoint_a_servant_) == -1)
00256 return -1;
00257
00258
00259 this->stream_endpoint_a_ = this->stream_endpoint_a_servant_->_this ();
00260 }
00261 catch (const CORBA::Exception& ex)
00262 {
00263 ex._tao_print_exception (
00264 "TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint");
00265 return -1;
00266 }
00267 return 0;
00268 }
00269
00270
00271
00272
00273
00274
00275
00276 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00277 TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Endpoint_Reactive_Strategy_B (void)
00278 {
00279 }
00280
00281
00282 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00283 TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy_B (void)
00284 {
00285 }
00286
00287
00288 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00289 int
00290 TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::init (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
00291 {
00292 this->orb_ = CORBA::ORB::_duplicate (orb);
00293 this->poa_ = PortableServer::POA::_duplicate (poa);
00294 return 0;
00295 }
00296
00297
00298 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00299 int
00300 TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (void)
00301 {
00302 try
00303 {
00304 if (this->make_stream_endpoint ( this->stream_endpoint_b_servant_ ) == -1)
00305 return -1;
00306
00307 this->stream_endpoint_b_ = this->stream_endpoint_b_servant_->_this ();
00308 }
00309 catch (const CORBA::Exception& ex)
00310 {
00311 ex._tao_print_exception (
00312 "TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint");
00313 return -1;
00314 }
00315 return 0;
00316 }
00317
00318
00319 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00320 int
00321 TAO_AV_Endpoint_Reactive_Strategy_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
00322 AVStreams::VDev_ptr &vdev)
00323 {
00324 if (this->activate () == -1)
00325 ACE_ERROR_RETURN ((LM_ERROR,
00326 "(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_B: Error in activate ()\n"),
00327 -1);
00328
00329 stream_endpoint = AVStreams::StreamEndPoint_B::_duplicate( this->stream_endpoint_b_.in() );
00330 vdev = AVStreams::VDev::_duplicate( this->vdev_.in() );
00331
00332 return 0;
00333 }
00334
00335
00336
00337
00338
00339
00340 template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
00341 TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process ()
00342 : stream_endpoint_name_ (0),
00343 pid_ (-1),
00344 stream_endpoint_(0),
00345 vdev_ (0),
00346 media_ctrl_ (0)
00347 {
00348 this->pid_ = ACE_OS::getpid ();
00349 if (this->pid_ == 0)
00350 ACE_ERROR ((LM_ERROR,"getpid () failed\n"));
00351 ACE_OS::hostname (this->host_,
00352 sizeof this->host_);
00353 }
00354
00355
00356 template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
00357 int
00358 TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
00359 ACE_TCHAR **argv,
00360 CORBA::ORB_ptr orb,
00361 PortableServer::POA_ptr poa)
00362 {
00363 try
00364 {
00365 this->orb_ = orb;
00366
00367 this->poa_ = poa;
00368
00369
00370 this->activate_objects (argc,
00371 argv);
00372
00373
00374 this->bind_to_naming_service ();
00375
00376
00377 this->register_vdev ();
00378
00379
00380 this->register_stream_endpoint ();
00381 }
00382 catch (const CORBA::Exception& ex)
00383 {
00384 ex._tao_print_exception ("TAO_Child_Process");
00385 return -1;
00386 }
00387
00388
00389 if (this->release_semaphore () == -1)
00390 ACE_ERROR_RETURN ((LM_ERROR,
00391 "(%P|%t) Error releasing semaphores\n"),
00392 -1);
00393
00394 return 0;
00395 }
00396
00397 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00398 char *
00399 TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant)
00400 {
00401
00402 PortableServer::ObjectId_var id =
00403 this->poa_->activate_object (servant);
00404
00405 CORBA::Object_var obj =
00406 this->poa_->id_to_reference (id.in ());
00407
00408 CORBA::String_var str =
00409 this->orb_->object_to_string (obj.in ());
00410
00411 return str._retn ();
00412 }
00413
00414
00415 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00416 int
00417 TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects (int ,
00418 ACE_TCHAR ** )
00419 {
00420 try
00421 {
00422
00423 if (this->make_stream_endpoint (this->stream_endpoint_) == -1)
00424 return -1;
00425
00426
00427 if (this->make_vdev (this->vdev_) == -1)
00428 return -1;
00429
00430
00431 if (this->make_mediactrl (this->media_ctrl_) == -1)
00432 return -1;
00433
00434
00435 CORBA::String_var stream_endpoint_ior = this->activate_with_poa (this->stream_endpoint_);
00436 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
00437 "(%P|%t)TAO_AV_Child_Process::activate_objects,stream_endpoint_ior :%s\n",
00438 stream_endpoint_ior.in ()));
00439
00440
00441 CORBA::String_var vdev_ior = this->activate_with_poa (this->vdev_);
00442 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
00443 "(%P|%t)TAO_AV_Child_Process::activate_objects, vdev ior is :%s\n",
00444 vdev_ior.in ()));
00445
00446
00447 CORBA::String_var media_ctrl_ior = this->activate_with_poa (this->media_ctrl_);
00448
00449 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Child_Process::activate_objects,media_ctrl_ior is: %s\n",media_ctrl_ior.in ()));
00450 }
00451 catch (const CORBA::Exception& ex)
00452 {
00453 ex._tao_print_exception ("TAO_AV_Child_Process::init ");
00454 return -1;
00455 }
00456 return 0;
00457 }
00458
00459
00460 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00461 int
00462 TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::bind_to_naming_service (void)
00463 {
00464 try
00465 {
00466 CORBA::Object_var naming_obj =
00467 this->orb_->resolve_initial_references ("NameService");
00468 if (CORBA::is_nil (naming_obj.in ()))
00469 ACE_ERROR_RETURN ((LM_ERROR,
00470 " (%P|%t) Unable to resolve the Name Service.\n"),
00471 -1);
00472
00473 this->naming_context_ =
00474 CosNaming::NamingContext::_narrow (naming_obj.in ());
00475 }
00476 catch (const CORBA::Exception& ex)
00477 {
00478 ex._tao_print_exception (
00479 "TAO_AV_Child_Process::bind_to_naming_service");
00480 return -1;
00481 }
00482 return 0;
00483 }
00484
00485
00486 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00487 int
00488 TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (void)
00489 {
00490 try
00491 {
00492 char vdev_name [BUFSIZ];
00493 ACE_OS::sprintf (vdev_name,
00494 "%s:%s:%ld",
00495 "VDev",
00496 this->host_,
00497 static_cast<long> (this->pid_));
00498
00499 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",vdev_name));
00500
00501 this->vdev_name_.length (1);
00502 this->vdev_name_ [0].id = CORBA::string_dup (vdev_name);
00503
00504
00505 CORBA::Any media_ctrl_property;
00506 media_ctrl_obj_ =
00507 this->media_ctrl_->_this ();
00508
00509 this->vdev_->define_property ("Related_MediaCtrl",
00510 media_ctrl_obj_.in());
00511
00512 vdev_obj_ = this->vdev_->_this ();
00513
00514 try
00515 {
00516
00517 this->naming_context_->bind (this->vdev_name_,
00518 vdev_obj_.in());
00519 }
00520 catch (const CosNaming::NamingContext::AlreadyBound& )
00521 {
00522
00523
00524 this->naming_context_->rebind (this->vdev_name_,
00525 vdev_obj_.in());
00526 }
00527 catch (const CORBA::Exception& ex)
00528 {
00529 ex._tao_print_exception (
00530 "TAO_AV_Child_Process::register_vdev");
00531 return -1;
00532 }
00533 }
00534 catch (const CORBA::Exception& ex)
00535 {
00536 ex._tao_print_exception (
00537 "TAO_AV_Child_Process::register_vdev");
00538 return -1;
00539 }
00540 return 0;
00541 }
00542
00543
00544 template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
00545 int
00546 TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::run (ACE_Time_Value *tv)
00547 {
00548 try
00549 {
00550 this->orb_->run (tv);
00551 }
00552 catch (const CORBA::Exception& ex)
00553 {
00554 ex._tao_print_exception ("orb.run ()");
00555 return -1;
00556 }
00557 return 0;
00558 }
00559
00560
00561 template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
00562 int
00563 TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::release_semaphore ()
00564 {
00565 char sem_str [BUFSIZ];
00566
00567 long pid = this->pid_;
00568 ACE_OS::sprintf (sem_str,
00569 "%s:%s:%ld",
00570 "TAO_AV_Process_Semaphore",
00571 this->host_,
00572 pid);
00573
00574 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
00575 "(%P|%t) semaphore is %s\n",
00576 sem_str));
00577
00578
00579 ACE_Process_Semaphore semaphore (0,
00580
00581 sem_str);
00582
00583 if (semaphore.release () == -1)
00584 ACE_ERROR_RETURN ((LM_ERROR,
00585 "(%P|%t) Error releasing semaphore %s: %p\n",
00586 sem_str,
00587 "semaphore.release ()"),
00588 -1);
00589
00590 return 0;
00591 }
00592
00593
00594 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00595 int
00596 TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_endpoint (void)
00597 {
00598 CORBA::Object_ptr stream_endpoint_obj = CORBA::Object::_nil ();
00599 try
00600 {
00601 stream_endpoint_obj = this->stream_endpoint_->_this ();
00602
00603
00604
00605
00606 this->naming_context_->bind (this->stream_endpoint_name_,
00607 stream_endpoint_obj);
00608 }
00609 catch (const CosNaming::NamingContext::AlreadyBound& )
00610 {
00611
00612 this->naming_context_->rebind (this->stream_endpoint_name_,
00613 stream_endpoint_obj);
00614 }
00615 catch (const CORBA::Exception& ex)
00616 {
00617 ex._tao_print_exception (
00618 "TAO_Endpoint_Reactive_Strategy::activate");
00619 return -1;
00620 }
00621 return 0;
00622 }
00623
00624
00625 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00626 int
00627 TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_stream_endpoint (T_StreamEndpoint *&stream_endpoint)
00628 {
00629 ACE_NEW_RETURN (stream_endpoint,
00630 T_StreamEndpoint,
00631 -1);
00632 return 0;
00633 }
00634
00635
00636 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00637 int
00638 TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_vdev (T_VDev *&vdev)
00639 {
00640 ACE_NEW_RETURN (vdev,
00641 T_VDev,
00642 -1);
00643 return 0;
00644 }
00645
00646
00647 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00648 int
00649 TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::make_mediactrl (T_MediaCtrl *&media_ctrl)
00650 {
00651 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t) TAO_AV_Child_Process::make_mediactrl ()\n"));
00652 ACE_NEW_RETURN (media_ctrl,
00653 T_MediaCtrl,
00654 -1);
00655 return 0;
00656 }
00657
00658
00659 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00660 int
00661 TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::unbind_names (void)
00662 {
00663
00664 try
00665 {
00666 if (CORBA::is_nil (this->naming_context_.in ()) == 0)
00667 return 0;
00668 this->naming_context_->unbind (this->stream_endpoint_name_);
00669
00670 this->naming_context_->unbind (this->vdev_name_);
00671 }
00672 catch (const CORBA::Exception& ex)
00673 {
00674 ex._tao_print_exception (
00675 "TAO_Endpoint_Process_Strategy::activate");
00676 return -1;
00677 }
00678 return 0;
00679 }
00680
00681
00682
00683
00684
00685
00686 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00687 TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process ()
00688 {
00689 this->unbind_names ();
00690 }
00691
00692
00693
00694
00695
00696
00697
00698 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00699 TAO_AV_Child_Process_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_A ()
00700 {
00701 char stream_endpoint_name[BUFSIZ];
00702 ACE_OS::sprintf (stream_endpoint_name,
00703 "%s:%s:%ld",
00704 "Stream_Endpoint_A",
00705 this->host_,
00706 static_cast<long> (this->pid_));
00707
00708 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
00709 this->stream_endpoint_name_.length (1);
00710 this->stream_endpoint_name_ [0].id = CORBA::string_dup (stream_endpoint_name);
00711 }
00712
00713 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00714 TAO_AV_Child_Process_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process_A ()
00715 {
00716 }
00717
00718
00719
00720
00721
00722
00723
00724 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00725 TAO_AV_Child_Process_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::TAO_AV_Child_Process_B ()
00726 {
00727 char stream_endpoint_name[BUFSIZ];
00728 ACE_OS::sprintf (stream_endpoint_name,
00729 "%s:%s:%ld",
00730 "Stream_Endpoint_B",
00731 this->host_,
00732 static_cast<long> (this->pid_));
00733
00734 if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)%s\n",stream_endpoint_name));
00735 this->stream_endpoint_name_.length (1);
00736 this->stream_endpoint_name_ [0].id = CORBA::string_dup (stream_endpoint_name);
00737 }
00738
00739 template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
00740 TAO_AV_Child_Process_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Child_Process_B ()
00741 {
00742 }
00743
00744 TAO_END_VERSIONED_NAMESPACE_DECL
00745
00746 #endif