summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorokellogg <okellogg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-12-08 12:59:11 +0000
committerokellogg <okellogg@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-12-08 12:59:11 +0000
commite6a7680766fd9afb6f225b12133e8256e01eeac6 (patch)
tree7dae4d53cfa057e39007e66f8e65d1e6d5c52085
parent6f06a1a7d81258eaca25000578a40faff1a2535d (diff)
downloadATCD-e6a7680766fd9afb6f225b12133e8256e01eeac6.tar.gz
TAO_1_2_1 merge
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp145
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp23
2 files changed, 105 insertions, 63 deletions
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
index faf10074707..f6e2561b119 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
@@ -220,64 +220,13 @@ TAO_Basic_StreamCtrl::destroy (const AVStreams::flowSpec &flow_spec
// Changes the QoS associated with the stream
// Empty the_spec means apply operation to all flows
CORBA::Boolean
-TAO_Basic_StreamCtrl::modify_QoS (AVStreams::streamQoS & new_qos,
- const AVStreams::flowSpec &flowspec
- TAO_ENV_ARG_DECL)
+TAO_Basic_StreamCtrl::modify_QoS (AVStreams::streamQoS & /*new_qos*/,
+ const AVStreams::flowSpec &/*flowspec*/
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
AVStreams::noSuchFlow,
AVStreams::QoSRequestFailed))
{
- ACE_TRY
- {
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,
- "TAO_Basic_StreamCtrl::modify_QoS\n"));
-
- AVStreams::flowSpec in_flowspec;
- AVStreams::flowSpec out_flowspec;
-
- in_flowspec.length (0);
- out_flowspec.length (0);
-
- int in_index = 0;
- int out_index = 0;
-
- for (u_int i=0;i < flowspec.length ();i++)
- {
- TAO_Forward_FlowSpec_Entry entry;
- entry.parse (flowspec [i].in ());
- int direction = entry.direction ();
- if (direction == 0)
- {
- in_flowspec.length (in_index + 1);
- in_flowspec [in_index++] = CORBA::string_dup (entry.entry_to_string ());
- }
- else
- {
- out_flowspec.length (out_index + 1);
- out_flowspec [out_index++] = CORBA::string_dup (entry.entry_to_string ());
- }
- }
-
- if (in_flowspec.length () != 0)
- {
- this->vdev_a_->modify_QoS (new_qos, in_flowspec TAO_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
-
- if (out_flowspec.length () != 0)
- {
- this->vdev_b_->modify_QoS (new_qos, out_flowspec TAO_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Basic_StreamCtrl::modify_QoS");
- return 0;
- }
- ACE_ENDTRY;
- ACE_CHECK_RETURN (0);
return 1;
}
@@ -285,7 +234,7 @@ TAO_Basic_StreamCtrl::modify_QoS (AVStreams::streamQoS & new_qos,
// E.g., loss of flow, reestablishment of flow, etc..
void
TAO_Basic_StreamCtrl::push_event (const struct CosPropertyService::Property &/*the_event*/
- TAO_ENV_ARG_DECL_NOT_USED )
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (TAO_debug_level > 0)
@@ -1419,7 +1368,7 @@ TAO_StreamCtrl::get_related_vdev (AVStreams::MMDevice_ptr adev,
}
CORBA::Boolean
-TAO_StreamCtrl::modify_QoS (AVStreams::streamQoS &the_qos,
+TAO_StreamCtrl::modify_QoS (AVStreams::streamQoS &new_qos,
const AVStreams::flowSpec &the_spec
TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
@@ -1438,8 +1387,77 @@ TAO_StreamCtrl::modify_QoS (AVStreams::streamQoS &the_qos,
}
else
{
- TAO_Basic_StreamCtrl::modify_QoS (the_qos, the_spec TAO_ENV_ARG_PARAMETER);
+ ACE_TRY
+ {
+
+ AVStreams::flowSpec in_flowspec;
+ AVStreams::flowSpec out_flowspec;
+
+ in_flowspec.length (0);
+ out_flowspec.length (0);
+
+ int in_index = 0;
+ int out_index = 0;
+
+ AVStreams::flowSpec flowspec;
+ if (the_spec.length () == 0)
+ {
+ // Apply modify_qos to all the flows
+ flowspec = this->flows_;
+ MMDevice_Map_Iterator iterator (this->mmdevice_a_map_);
+ MMDevice_Map::ENTRY *entry = 0;
+ for (;iterator.next (entry) != 0;iterator.advance ())
+ {
+ flowspec = entry->int_id_.flowspec_;
+ }
+ }
+ else
+ {
+ flowspec = the_spec;
+ }
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_StreamCtrl::modify_QoS\n"));
+
+
+ for (u_int i=0;i < flowspec.length ();i++)
+ {
+ TAO_Forward_FlowSpec_Entry entry;
+ entry.parse (flowspec [i].in ());
+ int direction = entry.direction ();
+ if (direction == 0)
+ {
+ in_flowspec.length (in_index + 1);
+ in_flowspec [in_index++] = CORBA::string_dup (entry.entry_to_string ());
+ }
+ else
+ {
+ out_flowspec.length (out_index + 1);
+ out_flowspec [out_index++] = CORBA::string_dup (entry.entry_to_string ());
+ }
+ }
+
+ if (in_flowspec.length () != 0)
+ {
+ this->vdev_a_->modify_QoS (new_qos, in_flowspec TAO_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+ if (out_flowspec.length () != 0)
+ {
+ this->vdev_b_->modify_QoS (new_qos, out_flowspec TAO_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_StreamCtrl::modify_QoS");
+ return 0;
+ }
+ ACE_ENDTRY;
ACE_CHECK_RETURN (0);
+
}
return 1;
}
@@ -2289,9 +2307,9 @@ TAO_StreamEndPoint::change_qos (AVStreams::streamQoS &new_qos,
// Refers to modification of transport QoS.
CORBA::Boolean
-TAO_StreamEndPoint::modify_QoS (AVStreams::streamQoS &/* new_qos */,
- const AVStreams::flowSpec &/* the_flows */
- TAO_ENV_ARG_DECL_NOT_USED)
+TAO_StreamEndPoint::modify_QoS (AVStreams::streamQoS &new_qos,
+ const AVStreams::flowSpec &the_flows
+ TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
AVStreams::noSuchFlow,
AVStreams::QoSRequestFailed))
@@ -2299,6 +2317,13 @@ TAO_StreamEndPoint::modify_QoS (AVStreams::streamQoS &/* new_qos */,
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
"TAO_StreamEndPoint::modify_QoS\n"));
+
+ int result = this->change_qos (new_qos, the_flows TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ if (result != 0)
+ return 0;
+
return 1;
}
diff --git a/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp b/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp
index a87e79d155f..c5f59086540 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/AV_Core.cpp
@@ -46,9 +46,11 @@ TAO_AV_Core::~TAO_AV_Core (void)
while (transport_iter != this->transport_factories_.end())
{
- delete (*transport_iter)->factory();
+ if ((*transport_iter)->factory()->ref_count != 1)
+ {
+ delete (*transport_iter)->factory();
+ }
delete (*transport_iter);
-
transport_iter++;
}
@@ -57,7 +59,10 @@ TAO_AV_Core::~TAO_AV_Core (void)
while (flow_iter != this->flow_protocol_factories_.end())
{
- delete (*flow_iter)->factory();
+ if ((*flow_iter)->factory()->ref_count != 1)
+ {
+ delete (*flow_iter)->factory();
+ }
delete (*flow_iter);
flow_iter++;
@@ -640,6 +645,7 @@ TAO_AV_Core::load_default_transport_factories (void)
TAO_AV_UDP_Factory,
-1);
}
+ else udp_factory->ref_count = 1;
ACE_NEW_RETURN (udp_item, TAO_AV_Transport_Item ("UDP_Factory"), -1);
udp_item->factory (udp_factory);
@@ -663,6 +669,7 @@ TAO_AV_Core::load_default_transport_factories (void)
TAO_AV_TCP_Factory,
-1);
}
+ else tcp_factory->ref_count = 1;
ACE_NEW_RETURN (tcp_item, TAO_AV_Transport_Item ("TCP_Factory"), -1);
tcp_item->factory (tcp_factory);
@@ -689,6 +696,7 @@ TAO_AV_Core::load_default_transport_factories (void)
TAO_AV_UDP_QoS_Factory,
-1);
}
+ else udp_qos_factory->ref_count = 1;
ACE_NEW_RETURN (udp_qos_item,
TAO_AV_Transport_Item ("UDP_QoS_Factory"),
@@ -736,6 +744,7 @@ TAO_AV_Core::init_transport_factories (void)
name.c_str (), ""),
-1);
}
+ (*factory)->factory ()->ref_count = 1;
if (TAO_debug_level > 0)
{
@@ -776,6 +785,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_UDP_Flow_Factory,
-1);
}
+ else udp_flow_factory->ref_count = 1;
ACE_NEW_RETURN (udp_item, TAO_AV_Flow_Protocol_Item ("UDP_Flow_Factory"), -1);
udp_item->factory (udp_flow_factory);
@@ -802,6 +812,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_UDP_QoS_Flow_Factory,
-1);
}
+ else udp_qos_flow_factory->ref_count = 1;
ACE_NEW_RETURN (udp_qos_flow_item, TAO_AV_Flow_Protocol_Item ("UDP_QoS_Flow_Factory"), -1);
udp_qos_flow_item->factory (udp_qos_flow_factory);
@@ -827,6 +838,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_TCP_Flow_Factory,
-1);
}
+ else tcp_flow_factory->ref_count = 1;
ACE_NEW_RETURN (tcp_item, TAO_AV_Flow_Protocol_Item ("TCP_Flow_Factory"), -1);
tcp_item->factory (tcp_flow_factory);
@@ -850,6 +862,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_RTP_Flow_Factory,
-1);
}
+ else rtp_flow_factory->ref_count = 1;
ACE_NEW_RETURN (rtp_item, TAO_AV_Flow_Protocol_Item ("RTP_Flow_Factory"), -1);
rtp_item->factory (rtp_flow_factory);
@@ -873,6 +886,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_RTCP_Flow_Factory,
-1);
}
+ else rtcp_flow_factory->ref_count = 1;
ACE_NEW_RETURN (rtcp_item, TAO_AV_Flow_Protocol_Item ("RTCP_Flow_Factory"), -1);
rtcp_item->factory (rtcp_flow_factory);
@@ -896,6 +910,7 @@ TAO_AV_Core::load_default_flow_protocol_factories (void)
TAO_AV_SFP_Factory,
-1);
}
+ else sfp_flow_factory->ref_count = 1;
ACE_NEW_RETURN (sfp_item, TAO_AV_Flow_Protocol_Item ("SFP_Flow_Factory"), -1);
sfp_item->factory (sfp_flow_factory);
@@ -939,6 +954,8 @@ TAO_AV_Core::init_flow_protocol_factories (void)
-1);
}
+ (*factory)->factory ()->ref_count = 1;
+
if (TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,