00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef AVSTREAMS_I_H
00015 #define AVSTREAMS_I_H
00016 #include "ace/pre.h"
00017
00018 #include "orbsvcs/AV/AV_Core.h"
00019
00020 #include "orbsvcs/AV/AV_export.h"
00021 #include "orbsvcs/CosPropertyS.h"
00022 #include "orbsvcs/AVStreamsS.h"
00023 #include "orbsvcs/Property/CosPropertyService_i.h"
00024 #include "orbsvcs/CosNamingC.h"
00025 #include "orbsvcs/AV/AV_Core.h"
00026 #include "orbsvcs/AV/Endpoint_Strategy.h"
00027 #include "orbsvcs/Null_MediaCtrlS.h"
00028 #include "orbsvcs/AV/FlowSpec_Entry.h"
00029
00030 #include "ace/OS.h"
00031 #include "ace/SOCK_Dgram_Mcast.h"
00032 #include "ace/ATM_Addr.h"
00033 #include "ace/Containers_T.h"
00034 #include "ace/Process.h"
00035 #include "ace/SOCK_CODgram.h"
00036 #include "ace/SOCK_Connector.h"
00037 #include "ace/Connector.h"
00038 #include "ace/Acceptor.h"
00039 #include "ace/SOCK_Stream.h"
00040 #include "ace/Svc_Handler.h"
00041 #include "ace/SOCK_Acceptor.h"
00042
00043 #define FLOWSPEC_MAX 5
00044
00045
00046 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00047
00048 typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex> FlowEndPoint_Map;
00049 typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowEndPoint_var> FlowEndPoint_Map_Entry;
00050 typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowEndPoint_var,ACE_Null_Mutex> FlowEndPoint_Map_Iterator;
00051
00052 typedef ACE_Hash_Map_Manager <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex> Flow_Handler_Map;
00053 typedef ACE_Hash_Map_Entry <ACE_CString,TAO_AV_Flow_Handler*> Flow_Handler_Map_Entry;
00054 typedef ACE_Hash_Map_Iterator <ACE_CString,TAO_AV_Flow_Handler*,ACE_Null_Mutex> Flow_Handler_Map_Iterator;
00055
00056
00057
00058 class TAO_AV_Export AV_Null_MediaCtrl
00059 : public virtual POA_Null_MediaCtrl
00060 {
00061 public:
00062 AV_Null_MediaCtrl (void);
00063
00064 protected:
00065
00066 virtual ~AV_Null_MediaCtrl (void);
00067
00068 };
00069
00070
00071
00072
00073
00074
00075 class TAO_AV_Export TAO_Basic_StreamCtrl
00076 : public virtual POA_AVStreams::Basic_StreamCtrl,
00077 public virtual TAO_PropertySet
00078 {
00079
00080 public:
00081
00082 TAO_Basic_StreamCtrl (void);
00083
00084
00085
00086 virtual void stop (const AVStreams::flowSpec &the_spec);
00087
00088
00089
00090 virtual void start (const AVStreams::flowSpec &the_spec);
00091
00092
00093
00094
00095
00096
00097 virtual void destroy (const AVStreams::flowSpec &the_spec);
00098
00099
00100
00101 virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
00102 const AVStreams::flowSpec &the_spec);
00103
00104
00105
00106 virtual void push_event (const struct CosPropertyService::Property & the_event);
00107
00108
00109 virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
00110 const char *fp_name,
00111 const CORBA::Any &fp_settings);
00112
00113
00114
00115 virtual CORBA::Object_ptr get_flow_connection (const char *flow_name);
00116
00117
00118
00119 virtual void set_flow_connection (const char *flow_name,
00120 CORBA::Object_ptr flow_connection);
00121
00122 protected:
00123
00124
00125 virtual ~TAO_Basic_StreamCtrl (void);
00126
00127
00128
00129 AVStreams::VDev_var vdev_a_;
00130 AVStreams::VDev_var vdev_b_;
00131
00132
00133 AVStreams::StreamEndPoint_A_var sep_a_;
00134 AVStreams::StreamEndPoint_B_var sep_b_;
00135
00136
00137 typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map;
00138 typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FlowConnection_var,ACE_Null_Mutex> FlowConnection_Map_Iterator;
00139 typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FlowConnection_var> FlowConnection_Map_Entry;
00140 FlowConnection_Map flow_connection_map_;
00141 AVStreams::FlowConnection_seq flowConnections_;
00142
00143
00144 u_int flow_count_;
00145 AVStreams::flowSpec flows_;
00146 };
00147
00148 class TAO_AV_Export TAO_Negotiator
00149 : public POA_AVStreams::Negotiator
00150 {
00151 public:
00152 virtual CORBA::Boolean negotiate (AVStreams::Negotiator_ptr remote_negotiator,
00153 const AVStreams::streamQoS &qos_spec);
00154 };
00155
00156 class TAO_MCastConfigIf;
00157
00158 class TAO_AV_Export MMDevice_Map_Hash_Key
00159 {
00160 public:
00161
00162 MMDevice_Map_Hash_Key (void);
00163
00164
00165 MMDevice_Map_Hash_Key (AVStreams::MMDevice_ptr mmdevice);
00166
00167
00168 MMDevice_Map_Hash_Key (const MMDevice_Map_Hash_Key&);
00169
00170
00171 ~MMDevice_Map_Hash_Key (void);
00172
00173
00174 bool operator == (const MMDevice_Map_Hash_Key &hash_key) const;
00175
00176
00177 friend bool operator < (const MMDevice_Map_Hash_Key &left,
00178 const MMDevice_Map_Hash_Key &right);
00179
00180
00181 u_long hash (void) const;
00182
00183 static const int hash_maximum_;
00184 protected:
00185 AVStreams::MMDevice_ptr mmdevice_;
00186 };
00187
00188
00189
00190
00191
00192
00193
00194 class TAO_AV_Export TAO_StreamCtrl
00195 : public virtual POA_AVStreams::StreamCtrl,
00196 public virtual TAO_Basic_StreamCtrl
00197 {
00198
00199 public:
00200
00201
00202 TAO_StreamCtrl (void);
00203
00204
00205 virtual ~TAO_StreamCtrl (void);
00206
00207
00208
00209 virtual void stop (const AVStreams::flowSpec &the_spec);
00210
00211
00212
00213 virtual void start (const AVStreams::flowSpec &the_spec);
00214
00215
00216
00217
00218
00219
00220 virtual void destroy (const AVStreams::flowSpec &the_spec);
00221
00222
00223
00224
00225
00226
00227
00228
00229 virtual CORBA::Boolean bind_devs (AVStreams::MMDevice_ptr a_party,
00230 AVStreams::MMDevice_ptr b_party,
00231 AVStreams::streamQoS& the_qos,
00232 const AVStreams::flowSpec& the_flows);
00233
00234
00235
00236
00237
00238
00239 virtual CORBA::Boolean bind (AVStreams::StreamEndPoint_A_ptr a_party,
00240 AVStreams::StreamEndPoint_B_ptr b_party,
00241 AVStreams::streamQoS &the_qos,
00242 const AVStreams::flowSpec &the_flows);
00243
00244 virtual void unbind_dev (AVStreams::MMDevice_ptr dev,
00245 const AVStreams::flowSpec & the_spec);
00246
00247
00248 virtual void unbind_party (AVStreams::StreamEndPoint_ptr the_ep,
00249 const AVStreams::flowSpec &the_spec);
00250
00251
00252 virtual void unbind (void);
00253
00254 virtual AVStreams::VDev_ptr get_related_vdev (AVStreams::MMDevice_ptr adev,
00255 AVStreams::StreamEndPoint_out sep);
00256
00257
00258
00259 virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
00260 const AVStreams::flowSpec &the_spec);
00261
00262 protected:
00263
00264 struct MMDevice_Map_Entry
00265 {
00266 AVStreams::StreamEndPoint_var sep_;
00267 AVStreams::VDev_var vdev_;
00268 AVStreams::flowSpec flowspec_;
00269 AVStreams::streamQoS qos_;
00270 };
00271
00272 typedef ACE_Hash_Map_Manager <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map;
00273 typedef ACE_Hash_Map_Iterator <MMDevice_Map_Hash_Key,MMDevice_Map_Entry,ACE_Null_Mutex> MMDevice_Map_Iterator;
00274
00275 MMDevice_Map mmdevice_a_map_;
00276 MMDevice_Map mmdevice_b_map_;
00277 TAO_MCastConfigIf *mcastconfigif_;
00278 AVStreams::MCastConfigIf_var mcastconfigif_ptr_;
00279 AVStreams::StreamCtrl_var streamctrl_;
00280 CORBA::ULong source_id_;
00281 };
00282
00283 class TAO_AV_Export TAO_MCastConfigIf
00284 : public virtual POA_AVStreams::MCastConfigIf,
00285 public virtual TAO_PropertySet
00286 {
00287 public:
00288
00289 enum Peer_Interface {VDEV = 0, FLOWENDPOINT=1};
00290 struct Peer_Info
00291 {
00292 AVStreams::VDev_var peer_;
00293 AVStreams::FlowEndPoint_var fep_;
00294 AVStreams::streamQoS qos_;
00295 AVStreams::flowSpec flow_spec_;
00296 Peer_Interface interface_;
00297 };
00298
00299
00300 TAO_MCastConfigIf (void);
00301
00302
00303 ~TAO_MCastConfigIf (void);
00304
00305 virtual CORBA::Boolean set_peer (CORBA::Object_ptr peer,
00306 AVStreams::streamQoS & the_qos,
00307 const AVStreams::flowSpec & the_spec);
00308
00309 virtual void configure (const CosPropertyService::Property & a_configuration);
00310
00311 virtual void set_initial_configuration (const CosPropertyService::Properties & initial);
00312
00313 virtual void set_format (const char * flowName,
00314 const char * format_name);
00315
00316 virtual void set_dev_params (const char * flowName,
00317 const CosPropertyService::Properties & new_params)
00318 ;
00319
00320 protected:
00321
00322 int in_flowSpec (const AVStreams::flowSpec& flow_spec, const char *flow_name);
00323
00324
00325 ACE_SOCK_Dgram_Mcast sock_mcast_;
00326
00327
00328 CosPropertyService::Properties initial_configuration_;
00329
00330 ACE_DLList<Peer_Info> peer_list_;
00331 ACE_DLList_Iterator<Peer_Info> peer_list_iterator_;
00332 };
00333
00334
00335
00336
00337
00338
00339 class TAO_AV_Export TAO_AV_QoS
00340 {
00341 public:
00342
00343 TAO_AV_QoS (void);
00344
00345
00346 TAO_AV_QoS (AVStreams::streamQoS &stream_qos);
00347
00348
00349 int set (AVStreams::streamQoS &stream_qos);
00350
00351
00352 int get_flow_qos (const char *flowname,AVStreams::QoS &flow_qos);
00353
00354
00355 int convert (AVStreams::streamQoS &network_qos);
00356
00357
00358 protected:
00359
00360 AVStreams::streamQoS stream_qos_;
00361
00362 ACE_Hash_Map_Manager<ACE_CString,AVStreams::QoS,ACE_Null_Mutex> qos_map_;
00363 };
00364
00365
00366
00367 class TAO_AV_TCP_Flow_Handler;
00368 class TAO_AV_UDP_Flow_Handler;
00369 class TAO_AV_UDP_MCast_Flow_Handler;
00370 class TAO_AV_Protocol_Object;
00371 class TAO_AV_Callback;
00372 class TAO_AV_SourceManager;
00373 class TAO_AV_Source;
00374 class TAO_AV_RTP_State;
00375 class TAO_AV_Flow_Handler;
00376
00377
00378
00379
00380
00381
00382
00383
00384 class TAO_AV_Export TAO_Base_StreamEndPoint
00385 :public virtual TAO_PropertySet
00386 {
00387
00388
00389 public:
00390 TAO_Base_StreamEndPoint (void);
00391 virtual ~TAO_Base_StreamEndPoint (void);
00392
00393
00394 virtual int handle_open (void);
00395
00396
00397 virtual int handle_close (void);
00398
00399
00400 virtual int handle_stop (const AVStreams::flowSpec &the_spec);
00401
00402
00403 virtual int handle_start (const AVStreams::flowSpec &the_spec);
00404
00405
00406 virtual int handle_destroy (const AVStreams::flowSpec &the_spec);
00407
00408
00409 virtual CORBA::Boolean handle_preconnect (AVStreams::flowSpec &the_spec);
00410
00411
00412 virtual CORBA::Boolean handle_postconnect (AVStreams::flowSpec &the_spec);
00413
00414
00415 virtual CORBA::Boolean handle_connection_requested (AVStreams::flowSpec &the_spec);
00416
00417 virtual int get_callback (const char *flowname,
00418 TAO_AV_Callback *&callback);
00419
00420 virtual int get_control_callback (const char *flowname,
00421 TAO_AV_Callback *&callback);
00422
00423 virtual int set_protocol_object (const char *flowname,
00424 TAO_AV_Protocol_Object *object);
00425
00426 virtual void set_flow_handler (const char *flowname,
00427 TAO_AV_Flow_Handler *handler);
00428
00429 virtual void set_control_flow_handler (const char *flowname,
00430 TAO_AV_Flow_Handler *handler);
00431
00432 TAO_AV_QoS &qos (void);
00433
00434 void protocol_object_set (void);
00435 int is_protocol_object_set (void);
00436
00437 protected:
00438
00439 TAO_AV_QoS qos_;
00440 Flow_Handler_Map flow_handler_map_;
00441 Flow_Handler_Map control_flow_handler_map_;
00442 int protocol_object_set_;
00443 };
00444
00445
00446 class TAO_AV_Acceptor;
00447 class TAO_AV_Connector;
00448 class TAO_Forward_FlowSpec_Entry;
00449 class TAO_Reverse_FlowSpec_Entry;
00450
00451
00452
00453
00454
00455
00456 class TAO_AV_Export TAO_StreamEndPoint
00457 : public virtual POA_AVStreams::StreamEndPoint,
00458 public virtual TAO_Base_StreamEndPoint
00459 {
00460
00461 public:
00462
00463 TAO_StreamEndPoint (void);
00464
00465
00466 virtual void stop (const AVStreams::flowSpec &the_spec);
00467
00468
00469 virtual void start (const AVStreams::flowSpec &the_spec);
00470
00471
00472 virtual void destroy (const AVStreams::flowSpec &the_spec);
00473
00474
00475 virtual CORBA::Boolean connect (AVStreams::StreamEndPoint_ptr responder,
00476 AVStreams::streamQoS& qos_spec,
00477 const AVStreams::flowSpec& the_spec);
00478
00479
00480
00481 virtual CORBA::Boolean request_connection (AVStreams::StreamEndPoint_ptr initiator,
00482 CORBA::Boolean is_mcast,
00483 AVStreams::streamQoS &qos,
00484 AVStreams::flowSpec &the_spec);
00485
00486
00487 virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
00488 const AVStreams::flowSpec &the_flows);
00489
00490 virtual int change_qos (AVStreams::streamQoS &new_qos,
00491 const AVStreams::flowSpec &the_flows);
00492
00493
00494 virtual CORBA::Boolean set_protocol_restriction (const AVStreams::protocolSpec &the_pspec);
00495
00496
00497 virtual void disconnect (const AVStreams::flowSpec &the_spec);
00498
00499
00500 virtual void set_FPStatus (const AVStreams::flowSpec &the_spec,
00501 const char *fp_name,
00502 const CORBA::Any &fp_settings);
00503
00504
00505 virtual CORBA::Object_ptr get_fep (const char *flow_name);
00506
00507
00508 virtual char * add_fep (CORBA::Object_ptr the_fep);
00509
00510
00511 virtual void remove_fep (const char *fep_name);
00512
00513
00514 virtual void set_negotiator (AVStreams::Negotiator_ptr new_negotiator);
00515
00516
00517 virtual void set_key (const char *flow_name,
00518 const AVStreams::key & the_key);
00519
00520
00521 virtual void set_source_id (CORBA::Long source_id);
00522
00523
00524 virtual ~TAO_StreamEndPoint (void);
00525
00526 CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
00527 AVStreams::flowSpec &the_spec);
00528
00529 protected:
00530
00531 char* add_fep_i (AVStreams::FlowEndPoint_ptr fep);
00532 char* add_fep_i_add_property (AVStreams::FlowEndPoint_ptr fep);
00533
00534
00535 int translate_qos (const AVStreams::streamQoS& application_qos,
00536 AVStreams::streamQoS& network_qos);
00537
00538
00539
00540 u_int flow_count_;
00541
00542
00543 u_int flow_num_;
00544
00545
00546 FlowEndPoint_Map fep_map_;
00547
00548
00549 AVStreams::flowSpec flows_;
00550
00551
00552 CORBA::Long source_id_;
00553
00554
00555 AVStreams::Negotiator_var negotiator_;
00556
00557
00558 AVStreams::protocolSpec protocols_;
00559
00560
00561 CORBA::String_var protocol_;
00562
00563
00564 AVStreams::key key_;
00565
00566
00567
00568 u_short mcast_port_;
00569 ACE_CString mcast_addr_;
00570 ACE_Hash_Map_Manager <ACE_CString, TAO_FlowSpec_Entry*,ACE_Null_Mutex> mcast_entry_map_;
00571 TAO_AV_FlowSpecSet forward_flow_spec_set;
00572 TAO_AV_FlowSpecSet reverse_flow_spec_set;
00573 AVStreams::StreamEndPoint_var peer_sep_;
00574 AVStreams::SFPStatus *sfp_status_;
00575 AVStreams::StreamCtrl_var streamctrl_;
00576 };
00577
00578
00579
00580
00581
00582 class TAO_AV_Export TAO_StreamEndPoint_A :
00583 public virtual POA_AVStreams::StreamEndPoint_A,
00584 public virtual TAO_StreamEndPoint
00585 {
00586
00587 public:
00588
00589 TAO_StreamEndPoint_A (void);
00590
00591
00592 virtual CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
00593 AVStreams::flowSpec &the_spec);
00594
00595
00596 virtual CORBA::Boolean connect_leaf (AVStreams::StreamEndPoint_B_ptr the_ep,
00597 AVStreams::streamQoS &the_qos,
00598 const AVStreams::flowSpec &the_flows);
00599
00600
00601 virtual void disconnect_leaf (AVStreams::StreamEndPoint_B_ptr the_ep,
00602 const AVStreams::flowSpec &theSpec);
00603
00604
00605 virtual ~TAO_StreamEndPoint_A (void);
00606
00607 };
00608
00609
00610 #define TAO_Client_StreamEndPoint TAO_StreamEndPoint_A
00611 #define TAO_Server_StreamEndPoint TAO_StreamEndPoint_B
00612
00613
00614
00615
00616
00617 class TAO_AV_Export TAO_StreamEndPoint_B :
00618 public virtual POA_AVStreams::StreamEndPoint_B,
00619 public virtual TAO_StreamEndPoint
00620 {
00621
00622
00623 public:
00624
00625 TAO_StreamEndPoint_B (void);
00626
00627
00628 virtual CORBA::Boolean multiconnect (AVStreams::streamQoS &the_qos,
00629 AVStreams::flowSpec &the_spec);
00630
00631
00632 virtual ~TAO_StreamEndPoint_B (void);
00633 };
00634
00635
00636
00637
00638
00639
00640 class TAO_AV_Export TAO_VDev
00641 :public virtual TAO_PropertySet,
00642 public virtual POA_AVStreams::VDev
00643 {
00644
00645 public:
00646
00647 TAO_VDev (void);
00648
00649
00650 virtual CORBA::Boolean set_peer (AVStreams::StreamCtrl_ptr the_ctrl,
00651 AVStreams::VDev_ptr the_peer_dev,
00652 AVStreams::streamQoS &the_qos,
00653 const AVStreams::flowSpec &the_spec);
00654
00655
00656 virtual CORBA::Boolean set_Mcast_peer (AVStreams::StreamCtrl_ptr the_ctrl,
00657 AVStreams::MCastConfigIf_ptr a_mcastconfigif,
00658 AVStreams::streamQoS &the_qos,
00659 const AVStreams::flowSpec &the_spec);
00660
00661
00662 virtual void configure (const CosPropertyService::Property &the_config_mesg);
00663
00664
00665 virtual void set_format (const char *flowName,
00666 const char *format_name);
00667
00668
00669 virtual void set_dev_params (const char *flowName,
00670 const CosPropertyService::Properties &new_params);
00671
00672
00673 virtual CORBA::Boolean modify_QoS (AVStreams::streamQoS &the_qos,
00674 const AVStreams::flowSpec &the_spec);
00675
00676 protected:
00677
00678
00679 virtual ~TAO_VDev (void);
00680
00681
00682 virtual CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl);
00683
00684
00685 AVStreams::StreamCtrl_var streamctrl_;
00686
00687
00688 AVStreams::VDev_var peer_;
00689
00690
00691 AVStreams::MCastConfigIf_var mcast_peer_;
00692 };
00693
00694 class TAO_AV_Endpoint_Strategy;
00695
00696
00697
00698
00699
00700 class TAO_AV_Export TAO_MMDevice
00701 :public virtual POA_AVStreams::MMDevice,
00702 public virtual TAO_PropertySet
00703 {
00704
00705 public:
00706
00707
00708 enum MMDevice_Type {MMDEVICE_A = 0,MMDEVICE_B = 1};
00709 TAO_MMDevice (TAO_AV_Endpoint_Strategy *endpoint_strategy_);
00710
00711 virtual AVStreams::StreamEndPoint_ptr create_A_B (MMDevice_Type type,
00712 AVStreams::StreamCtrl_ptr the_requester,
00713 AVStreams::VDev_out the_vdev,
00714 AVStreams::streamQoS &the_qos,
00715 CORBA::Boolean_out met_qos,
00716 char *&named_vdev,
00717 const AVStreams::flowSpec &the_spec);
00718
00719
00720
00721 virtual AVStreams::StreamCtrl_ptr bind (AVStreams::MMDevice_ptr peer_device,
00722 AVStreams::streamQoS &the_qos,
00723 CORBA::Boolean_out is_met,
00724 const AVStreams::flowSpec &the_spec);
00725
00726
00727 virtual AVStreams::StreamCtrl_ptr bind_mcast (AVStreams::MMDevice_ptr first_peer,
00728 AVStreams::streamQoS &the_qos,
00729 CORBA::Boolean_out is_met,
00730 const AVStreams::flowSpec &the_spec);
00731
00732
00733 virtual AVStreams::StreamEndPoint_A_ptr create_A (AVStreams::StreamCtrl_ptr the_requester,
00734 AVStreams::VDev_out the_vdev,
00735 AVStreams::streamQoS &the_qos,
00736 CORBA::Boolean_out met_qos,
00737 char *&named_vdev,
00738 const AVStreams::flowSpec &the_spec);
00739
00740
00741 virtual AVStreams::StreamEndPoint_B_ptr create_B (AVStreams::StreamCtrl_ptr the_requester,
00742 AVStreams::VDev_out the_vdev,
00743 AVStreams::streamQoS &the_qos,
00744 CORBA::Boolean_out met_qos,
00745 char *&named_vdev,
00746 const AVStreams::flowSpec &the_spec);
00747
00748
00749 virtual void destroy (AVStreams::StreamEndPoint_ptr the_ep,
00750 const char *vdev_name);
00751
00752
00753 virtual char * add_fdev (CORBA::Object_ptr the_fdev);
00754
00755
00756 virtual CORBA::Object_ptr get_fdev (const char *flow_name);
00757
00758
00759 virtual void remove_fdev (const char *flow_name);
00760
00761
00762 virtual ~TAO_MMDevice (void);
00763
00764 protected:
00765
00766 char* add_fdev_i (AVStreams::FDev_ptr fdev);
00767
00768 protected:
00769
00770 TAO_AV_Endpoint_Strategy *endpoint_strategy_;
00771
00772
00773
00774 u_int flow_count_;
00775
00776
00777 u_int flow_num_;
00778
00779 typedef ACE_Hash_Map_Manager <ACE_CString,AVStreams::FDev_var,ACE_Null_Mutex> FDev_Map;
00780 typedef ACE_Hash_Map_Iterator <ACE_CString,AVStreams::FDev_var,ACE_Null_Mutex> FDev_Map_Iterator;
00781 typedef ACE_Hash_Map_Entry <ACE_CString,AVStreams::FDev_var> FDev_Map_Entry;
00782
00783
00784
00785 FDev_Map fdev_map_;
00786
00787
00788 AVStreams::flowSpec flows_;
00789
00790 TAO_StreamCtrl *stream_ctrl_;
00791 };
00792
00793 class TAO_FlowConsumer;
00794 class TAO_FlowProducer;
00795
00796
00797
00798
00799
00800
00801 class TAO_AV_Export TAO_FlowConnection
00802 : public virtual POA_AVStreams::FlowConnection,
00803 public virtual TAO_PropertySet
00804 {
00805
00806 public:
00807
00808 TAO_FlowConnection (void);
00809
00810
00811 virtual void stop (void);
00812
00813
00814 virtual void start (void);
00815
00816
00817 virtual void destroy (void);
00818
00819
00820 virtual CORBA::Boolean modify_QoS (AVStreams::QoS & new_qos);
00821
00822
00823 virtual CORBA::Boolean use_flow_protocol (const char * fp_name,
00824 const CORBA::Any & fp_settings);
00825
00826
00827 virtual void push_event (const AVStreams::streamEvent & the_event);
00828
00829
00830
00831 virtual CORBA::Boolean connect_devs (AVStreams::FDev_ptr a_party,
00832 AVStreams::FDev_ptr b_party,
00833 AVStreams::QoS & the_qos);
00834
00835
00836 virtual CORBA::Boolean connect (AVStreams::FlowProducer_ptr flow_producer,
00837 AVStreams::FlowConsumer_ptr flow_consumer,
00838 AVStreams::QoS & the_qos);
00839
00840
00841 virtual CORBA::Boolean disconnect (void);
00842
00843
00844 virtual CORBA::Boolean add_producer (AVStreams::FlowProducer_ptr flow_producer,
00845 AVStreams::QoS & the_qos);
00846
00847
00848 virtual CORBA::Boolean add_consumer (AVStreams::FlowConsumer_ptr flow_consumer,
00849 AVStreams::QoS & the_qos);
00850
00851
00852 virtual CORBA::Boolean drop (AVStreams::FlowEndPoint_ptr target);
00853
00854 int set_mcast_addr (ACE_CString addr,u_short port);
00855 void set_protocol (const char *protocol);
00856 protected:
00857 typedef ACE_Unbounded_Set<AVStreams::FlowProducer_ptr> FlowProducer_Set;
00858 typedef ACE_Unbounded_Set_Iterator<AVStreams::FlowProducer_ptr> FlowProducer_SetItor;
00859 typedef ACE_Unbounded_Set<AVStreams::FlowConsumer_ptr> FlowConsumer_Set;
00860 typedef ACE_Unbounded_Set_Iterator<AVStreams::FlowConsumer_ptr> FlowConsumer_SetItor;
00861
00862
00863 FlowProducer_Set flow_producer_set_;
00864 FlowConsumer_Set flow_consumer_set_;
00865 CORBA::String_var fp_name_;
00866 CORBA::Any fp_settings_;
00867 CORBA::String_var producer_address_;
00868
00869
00870 int ip_multicast_;
00871 TAO_MCastConfigIf *mcastconfigif_i_;
00872 AVStreams::MCastConfigIf_var mcastconfigif_;
00873 u_short mcast_port_;
00874 ACE_CString mcast_addr_;
00875 CORBA::String_var protocol_;
00876 };
00877
00878
00879
00880
00881
00882
00883 class TAO_AV_Export TAO_FlowEndPoint :
00884 public virtual POA_AVStreams::FlowEndPoint,
00885 public virtual TAO_Base_StreamEndPoint
00886 {
00887
00888 public:
00889
00890
00891 TAO_FlowEndPoint (void);
00892
00893 TAO_FlowEndPoint (const char *flowname,
00894 AVStreams::protocolSpec &protocols,
00895 const char *format);
00896
00897 int open (const char *flowname,
00898 AVStreams::protocolSpec &protocols,
00899 const char *format);
00900
00901 int set_flowname (const char *flowname);
00902
00903 virtual void set_flow_handler (const char *flowname,
00904 TAO_AV_Flow_Handler *handler);
00905
00906 virtual int set_protocol_object (const char *flowname,
00907 TAO_AV_Protocol_Object *object);
00908
00909
00910 virtual CORBA::Boolean lock (void);
00911
00912
00913 virtual void unlock (void);
00914
00915
00916
00917 virtual void destroy (void);
00918
00919
00920
00921 virtual AVStreams::StreamEndPoint_ptr related_sep(void);
00922
00923
00924
00925 virtual void related_sep (AVStreams::StreamEndPoint_ptr related_sep);
00926
00927 virtual AVStreams::FlowConnection_ptr related_flow_connection(void);
00928
00929
00930
00931
00932 virtual void related_flow_connection (AVStreams::FlowConnection_ptr related_flow_connection);
00933
00934
00935 virtual AVStreams::FlowEndPoint_ptr get_connected_fep (void);
00936
00937
00938 virtual CORBA::Boolean use_flow_protocol (const char * fp_name,
00939 const CORBA::Any & fp_settings);
00940
00941
00942 virtual void set_format (const char * format);
00943
00944
00945 virtual void set_dev_params (const CosPropertyService::Properties & new_settings);
00946
00947
00948 virtual void set_protocol_restriction (const AVStreams::protocolSpec & the_spec);
00949
00950
00951 virtual CORBA::Boolean is_fep_compatible (AVStreams::FlowEndPoint_ptr fep);
00952
00953
00954 virtual CORBA::Boolean set_peer (AVStreams::FlowConnection_ptr the_fc,
00955 AVStreams::FlowEndPoint_ptr the_peer_fep,
00956 AVStreams::QoS & the_qos);
00957
00958
00959 virtual CORBA::Boolean set_Mcast_peer (AVStreams::FlowConnection_ptr the_fc,
00960 AVStreams::MCastConfigIf_ptr a_mcastconfigif,
00961 AVStreams::QoS & the_qos);
00962
00963
00964
00965
00966
00967
00968
00969 virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
00970 const char * address,
00971 const char * use_flow_protocol)
00972 = 0;
00973
00974
00975 virtual CORBA::Boolean connect_to_peer_i (TAO_FlowSpec_Entry::Role role,
00976 AVStreams::QoS & the_qos,
00977 const char * address,
00978 const char * use_flow_protocol);
00979
00980
00981
00982
00983
00984
00985 virtual char * go_to_listen (AVStreams::QoS & the_qos,
00986 CORBA::Boolean is_mcast,
00987 AVStreams::FlowEndPoint_ptr peer,
00988 char *& flowProtocol)
00989 = 0;
00990
00991
00992 virtual char * go_to_listen_i (TAO_FlowSpec_Entry::Role role,
00993 AVStreams::QoS & the_qos,
00994 CORBA::Boolean is_mcast,
00995 AVStreams::FlowEndPoint_ptr peer,
00996 char *& flowProtocol);
00997
00998
00999 protected:
01000
01001 AVStreams::StreamEndPoint_var related_sep_;
01002
01003
01004 AVStreams::FlowConnection_var related_flow_connection_;
01005
01006
01007 AVStreams::FlowEndPoint_var peer_fep_;
01008
01009
01010 AVStreams::protocolSpec protocols_;
01011
01012
01013 AVStreams::protocolSpec protocol_addresses_;
01014
01015
01016 AVStreams::MCastConfigIf_var mcast_peer_;
01017
01018
01019 CORBA::Boolean lock_;
01020
01021 CORBA::String_var format_;
01022 CORBA::String_var flowname_;
01023 CosPropertyService::Properties dev_params_;
01024 TAO_AV_FlowSpecSet flow_spec_set_;
01025 CORBA::String_var reverse_channel_;
01026 };
01027
01028 class TAO_AV_Export TAO_FlowProducer:
01029 public virtual POA_AVStreams::FlowProducer,
01030 public virtual TAO_FlowEndPoint
01031 {
01032 public:
01033
01034 TAO_FlowProducer (void);
01035
01036 TAO_FlowProducer (const char *flowname,
01037 AVStreams::protocolSpec protocols,
01038 const char *format);
01039
01040
01041
01042
01043
01044
01045
01046
01047 virtual char * get_rev_channel (const char * pcol_name);
01048
01049
01050 virtual void stop (void);
01051
01052
01053 virtual void start (void);
01054
01055 virtual char * go_to_listen (AVStreams::QoS & the_qos,
01056 CORBA::Boolean is_mcast,
01057 AVStreams::FlowEndPoint_ptr peer,
01058 char *& flowProtocol);
01059
01060 virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
01061 const char * address,
01062 const char * use_flow_protocol);
01063
01064
01065 virtual char * connect_mcast (AVStreams::QoS & the_qos,
01066 CORBA::Boolean_out is_met,
01067 const char * address,
01068 const char * use_flow_protocol);
01069
01070
01071
01072
01073 virtual void set_key (const AVStreams::key & the_key);
01074
01075
01076
01077 virtual void set_source_id (CORBA::Long source_id);
01078
01079 protected:
01080
01081 CORBA::Long source_id_;
01082 CORBA::String_var peer_address_;
01083 };
01084
01085 class TAO_AV_Export TAO_FlowConsumer :
01086 public virtual POA_AVStreams::FlowConsumer,
01087 public virtual TAO_FlowEndPoint
01088 {
01089 public:
01090
01091 TAO_FlowConsumer (void);
01092
01093 TAO_FlowConsumer (const char *flowname,
01094 AVStreams::protocolSpec protocols,
01095 const char *format);
01096
01097
01098 virtual void stop (void);
01099
01100
01101 virtual void start (void);
01102
01103 virtual char * go_to_listen (AVStreams::QoS & the_qos,
01104 CORBA::Boolean is_mcast,
01105 AVStreams::FlowEndPoint_ptr peer,
01106 char *& flowProtocol);
01107
01108 virtual CORBA::Boolean connect_to_peer (AVStreams::QoS & the_qos,
01109 const char * address,
01110 const char * use_flow_protocol);
01111 };
01112
01113
01114
01115
01116
01117
01118
01119 class TAO_AV_Export TAO_MediaControl
01120 :public virtual POA_AVStreams::MediaControl
01121 {
01122
01123 public:
01124
01125 TAO_MediaControl (void);
01126
01127 virtual AVStreams::Position get_media_position (AVStreams::PositionOrigin an_origin,
01128 AVStreams::PositionKey a_key)
01129 =0;
01130
01131 virtual void set_media_position (const AVStreams::Position & a_position)
01132 =0;
01133
01134 virtual void start (const AVStreams::Position & a_position)
01135 =0;
01136
01137 virtual void pause (const AVStreams::Position & a_position)
01138 =0;
01139
01140 virtual void resume (const AVStreams::Position & a_position)
01141 =0;
01142
01143 virtual void stop (const AVStreams::Position & a_position)
01144 =0;
01145
01146 };
01147
01148 TAO_END_VERSIONED_NAMESPACE_DECL
01149
01150 #include "orbsvcs/AV/Transport.h"
01151
01152 #if defined (__ACE_INLINE__)
01153 #include "tao/debug.h"
01154 #include "orbsvcs/AV/AVStreams_i.inl"
01155 #endif
01156
01157 #include "orbsvcs/AV/Flows_T.h"
01158
01159 #include "ace/post.h"
01160 #endif