summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrodrigu <crodrigu@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-04-30 21:55:47 +0000
committercrodrigu <crodrigu@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-04-30 21:55:47 +0000
commit62b6092eb492d90c9c73bcd23e7ffed5087493c1 (patch)
treecd93826841efd791b28d9a4da25d0b2022c59549
parentfbc7cae3c85133b2de2e482d769acc03858657c1 (diff)
downloadATCD-62b6092eb492d90c9c73bcd23e7ffed5087493c1.tar.gz
ChangeLogTag: Tue Apr 30 21:41:12 UTC 2002 Craig Rodrigues
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a20
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp75
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h5
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp50
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h8
-rwxr-xr-xTAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl11
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp6
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h2
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp8
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h2
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp8
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h2
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp8
-rw-r--r--TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h2
14 files changed, 105 insertions, 102 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 0c6018f46c5..8d45721b52c 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,23 @@
+Tue Apr 30 21:41:12 UTC 2002 Craig Rodrigues
+
+ * orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl:
+ * orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp:
+ * orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h:
+ * orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp:
+ * orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h:
+ * orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp:
+ * orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h:
+ Make frame_rate_ a double value.
+
+ * orbsvcs/orbsvcs/AV/AVStreams_i.cpp:
+ * orbsvcs/orbsvcs/AV/AVStreams_i.h:
+ * orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp:
+ * orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h:
+ - Remove extraneous calls to _remove_ref() which were causing crashes
+ - Add additional is_nil() checks before calling
+ - Remove extraneous calls to string_to_object()
+ - Various attempts at memory management fixes
+
Tue Apr 30 14:51:58 2002 Balachandran Natarajan <bala@cs.wustl.edu>
* tests/Makefile:
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
index 9914c3a7224..91a0b6e9425 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.cpp
@@ -21,6 +21,7 @@
#include "tao/debug.h"
#include "tao/ORB_Core.h"
+#include "tao/Any.h"
#if !defined (__ACE_INLINE__)
#include "AVStreams_i.i"
@@ -2103,27 +2104,36 @@ TAO_StreamEndPoint::destroy (const AVStreams::flowSpec &flow_spec
{
CORBA::Any_var vdev_any = this->get_property_value ("Related_VDev"
ACE_ENV_ARG_PARAMETER);
- CORBA::Any_var mc_str_any;
- CORBA::Object_var mc_obj;
+
AVStreams::VDev_ptr vdev;
- // TODO: what if a real AVStreams::MediaControl is used ??
- Null_MediaCtrl_var media_ctrl;
- const char *media_ctrl_str;
+
vdev_any.in() >>= vdev;
- mc_str_any = vdev->get_property_value ("Related_MediaCtrl"
+ CORBA::Any_var mc_any = vdev->get_property_value ("Related_MediaCtrl"
ACE_ENV_ARG_PARAMETER);
- mc_str_any.in() >>= media_ctrl_str;
- mc_obj = TAO_AV_CORE::instance()->orb()->string_to_object (media_ctrl_str
- ACE_ENV_ARG_PARAMETER);
- media_ctrl = Null_MediaCtrl::_narrow (mc_obj.in());
+
+ // The Related_MediaCtrl property was inserted as a CORBA::Object, so we
+ // must extract it as the same type.
+ CORBA::Object_var obj;
+ mc_any.in() >>= CORBA::Any::to_object( obj.out() );
+
+ AVStreams::MediaControl_var media_ctrl =
+ AVStreams::MediaControl::_narrow( obj.in() );
// deactivate the associated vdev and media ctrl
- PortableServer::ServantBase_var vdev_servant =
- TAO_AV_CORE::instance()->poa()->reference_to_servant (vdev);
- TAO_AV_Core::deactivate_servant (vdev_servant.in());
- PortableServer::ServantBase_var mc_servant =
- TAO_AV_CORE::instance()->poa()->reference_to_servant (media_ctrl.in());
- TAO_AV_Core::deactivate_servant (mc_servant.in());
+
+ if ( !CORBA::is_nil( vdev ) )
+ {
+ PortableServer::ServantBase_var vdev_servant =
+ TAO_AV_CORE::instance()->poa()->reference_to_servant ( vdev );
+ TAO_AV_Core::deactivate_servant (vdev_servant.in());
+ }
+
+ if ( !CORBA::is_nil ( media_ctrl.in () ) )
+ {
+ PortableServer::ServantBase_var mc_servant =
+ TAO_AV_CORE::instance()->poa()->reference_to_servant (media_ctrl.in());
+ TAO_AV_Core::deactivate_servant (mc_servant.in());
+ }
int result = TAO_AV_Core::deactivate_servant (this);
if (result < 0)
@@ -3104,19 +3114,11 @@ TAO_VDev::set_peer (AVStreams::StreamCtrl_ptr the_ctrl,
ACE_TRY
{
if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_VDev::set_peer: called"));
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) TAO_VDev::set_peer: called\n"));
- CORBA::String_var ior = TAO_ORB_Core_instance ()->orb ()->object_to_string (the_peer_dev
- ACE_ENV_ARG_PARAMETER);
-
- ACE_TRY_CHECK;
-
- if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) TAO_VDev::set_peer: my peer is %s\n",
- ior.in ()));
CORBA::Any anyval;
- anyval <<= ior.in ();
+ anyval <<= the_peer_dev;
this->define_property ("Related_VDev",
anyval
ACE_ENV_ARG_PARAMETER);
@@ -3127,18 +3129,13 @@ TAO_VDev::set_peer (AVStreams::StreamCtrl_ptr the_ctrl,
this->peer_ = AVStreams::VDev::_duplicate (the_peer_dev);
CORBA::Any_var anyptr;
- const char *media_ctrl_ior;
anyptr = this->peer_->get_property_value ("Related_MediaCtrl"
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- anyptr.in () >>= media_ctrl_ior;
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t)The Media Control IOR is %s\n",
- media_ctrl_ior));
- CORBA::Object_ptr media_ctrl_obj =
- TAO_ORB_Core_instance ()->orb ()->string_to_object
- (media_ctrl_ior ACE_ENV_ARG_PARAMETER);
+ CORBA::Object_ptr media_ctrl_obj = 0;
+
+ anyptr.in () >>= CORBA::Any::to_object(media_ctrl_obj);
ACE_TRY_CHECK;
result = this->set_media_ctrl (media_ctrl_obj ACE_ENV_ARG_PARAMETER);
@@ -3579,10 +3576,6 @@ TAO_MMDevice::create_A (AVStreams::StreamCtrl_ptr streamctrl,
AVStreams::QoSRequestFailed,
AVStreams::noSuchFlow))
{
- CORBA::String_var str_ctrl_ior =
- TAO_ORB_Core_instance ()->orb ()->object_to_string (streamctrl ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
-
AVStreams::StreamEndPoint_A_ptr sep_a = 0;
AVStreams::StreamEndPoint_var sep;
ACE_TRY
@@ -3591,6 +3584,8 @@ TAO_MMDevice::create_A (AVStreams::StreamCtrl_ptr streamctrl,
ACE_TRY_CHECK;
sep_a = AVStreams::StreamEndPoint_A::_narrow (sep.in() ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ ACE_ASSERT( !CORBA::is_nil( sep_a ) );
}
ACE_CATCHANY
{
@@ -3598,7 +3593,7 @@ TAO_MMDevice::create_A (AVStreams::StreamCtrl_ptr streamctrl,
return sep_a;
}
ACE_ENDTRY;
- ACE_CHECK_RETURN (sep_a);
+
return sep_a;
}
@@ -3627,6 +3622,8 @@ TAO_MMDevice::create_B (AVStreams::StreamCtrl_ptr streamctrl,
ACE_TRY_CHECK;
sep_b = AVStreams::StreamEndPoint_B::_narrow (sep.in() ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
+
+ ACE_ASSERT ( !CORBA::is_nil( sep_b ) );
}
ACE_CATCHANY
{
diff --git a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h
index 95ab3009b5b..27dcef1c7b7 100644
--- a/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h
+++ b/TAO/orbsvcs/orbsvcs/AV/AVStreams_i.h
@@ -884,10 +884,11 @@ public:
AVStreams::noSuchFlow,
AVStreams::QoSRequestFailed));
- /// Destructor
+protected:
+ /// Destructor for a servant should be protected or private.
+ /// Use _remove_ref() to delete this servant.
virtual ~TAO_VDev (void);
-protected:
/// hook called after set_peer is done to set the media ctrl of the peer vdev.
virtual CORBA::Boolean set_media_ctrl (CORBA::Object_ptr media_ctrl
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
index 68df61b060d..37c3bb5981c 100644
--- a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
@@ -100,8 +100,6 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ
// Save the object reference, so that create_A can return it
this->vdev_ = vdev->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- vdev->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
}
ACE_CATCHANY
{
@@ -137,16 +135,11 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ
// Associate the media controller object reference with the vdev, as per the OMG spec
CORBA::Any anyval;
- CORBA::Object_var media_ctrl_obj
+ media_ctrl_obj_
= media_ctrl->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- media_ctrl->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- CORBA::String_var str = this->orb_->object_to_string (media_ctrl_obj.in ()
- ACE_ENV_ARG_PARAMETER);
-
- anyval <<= str.in();
+ anyval <<= media_ctrl_obj_.in();
ACE_TRY_CHECK;
@@ -242,8 +235,8 @@ TAO_AV_Endpoint_Reactive_Strategy_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::crea
"(%P|%t) TAO_AV_Endpoint_Reactive_Strategy_A: Error in activate ()\n"),
-1);
- stream_endpoint = this->stream_endpoint_a_;
- vdev = this->vdev_;
+ stream_endpoint = AVStreams::StreamEndPoint_A::_duplicate( this->stream_endpoint_a_ );
+ vdev = AVStreams::VDev::_duplicate( this->vdev_ );
return 0;
}
@@ -261,16 +254,9 @@ TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::act
if (this->make_stream_endpoint (stream_endpoint_a) == -1)
return -1;
-// CORBA::String_var stream_endpoint_ior = this->activate_with_poa (stream_endpoint_a
-// ACE_ENV_ARG_PARAMETER);
-// ACE_TRY_CHECK;
-// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ()));
-
// Save the object references, so that create_a can return them
this->stream_endpoint_a_ = stream_endpoint_a->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- stream_endpoint_a->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
}
ACE_CATCHANY
{
@@ -320,15 +306,9 @@ TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::act
if (this->make_stream_endpoint (stream_endpoint_b) == -1)
return -1;
-// CORBA::String_var stream_endpoint_ior = this->activate_with_poa (stream_endpoint_b
-// ACE_ENV_ARG_PARAMETER);
-// ACE_TRY_CHECK;
-// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint,Stream Endpoint ior is : %s\n",stream_endpoint_ior.in ()));
this->stream_endpoint_b_ = stream_endpoint_b->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- stream_endpoint_b->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
}
ACE_CATCHANY
{
@@ -353,6 +333,7 @@ TAO_AV_Endpoint_Reactive_Strategy_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::crea
-1);
stream_endpoint = this->stream_endpoint_b_;
+ this->vdev_->_add_ref();
vdev = this->vdev_;
return 0;
@@ -537,7 +518,6 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (ACE_ENV_SINGLE_ARG_DECL)
{
- CORBA::Object_ptr vdev_obj = CORBA::Object::_nil ();
ACE_TRY
{
char vdev_name [BUFSIZ];
@@ -554,26 +534,24 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (AC
// make the media controller a property of the vdev
CORBA::Any media_ctrl_property;
- CORBA::Object_var media_ctrl_obj =
+ media_ctrl_obj_ =
this->media_ctrl_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- media_ctrl_property <<= this->orb_->object_to_string (media_ctrl_obj.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+
this->vdev_->define_property ("Related_MediaCtrl",
- media_ctrl_property
+ media_ctrl_obj_.in()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- vdev_obj = this->vdev_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ vdev_obj_ = this->vdev_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- this->vdev_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+
ACE_TRY_CHECK;
ACE_TRY_EX (bind)
{
// Register the vdev with the naming server.
this->naming_context_->bind (this->vdev_name_,
- vdev_obj
+ vdev_obj_.in()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK_EX (bind);
}
@@ -582,7 +560,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (AC
// If the object was already there, replace the older reference
// with this one
this->naming_context_->rebind (this->vdev_name_,
- vdev_obj
+ vdev_obj_.in()
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
}
@@ -667,9 +645,7 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_e
{
stream_endpoint_obj = this->stream_endpoint_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- this->stream_endpoint_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- // if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s:%d\n", __FILE__, __LINE__));
+
// Create a name for the video control object
// subclasses can define their own name for the streamendpoint
// Register the stream endpoint object with the naming server.
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h
index 1ff9129d44f..91dd310f4dc 100644
--- a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.h
@@ -71,6 +71,8 @@ protected:
PortableServer::POA_var poa_;
+ CORBA::Object_var media_ctrl_obj_;
+
};
// ----------------------------------------------------------------------
@@ -215,9 +217,15 @@ protected:
/// The virtual device
T_VDev *vdev_;
+ /// Virtual device CORBA object reference
+ CORBA::Object_var vdev_obj_;
+
/// Media controller
T_MediaCtrl *media_ctrl_;
+ // Media controller CORBA object reference
+ CORBA::Object_var media_ctrl_obj_;
+
/// pid of this process
pid_t pid_;
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 a9958feadc3..2f004e80d8a 100755
--- a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl
@@ -20,7 +20,8 @@ $makefile = PerlACE::LocalFile ("input");
unlink $nsior;
$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service", "-o $nsior");
-$SV = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -s sender -r 1");
+$SV = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -s sender -r 10");
+$SV1 = new PerlACE::Process ("sender", "-ORBInitRef NameService=file://$nsior -s sender -r 1");
$RE1 = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -s distributer -r receiver1 -f output1");
$RE2 = new PerlACE::Process ("receiver", "-ORBInitRef NameService=file://$nsior -s distributer -r receiver2 -f output2");
$DI = new PerlACE::Process ("distributer", "-ORBInitRef NameService=file://$nsior -s sender -r distributer");
@@ -179,7 +180,7 @@ if (PerlACE::waitforfile_timed ($nsior, 10) == -1) {
print STDERR "Starting Sender\n";
-$SV->Spawn ();
+$SV1->Spawn ();
sleep $sleeptime;
@@ -204,7 +205,7 @@ if ($distributer != 0) {
$status = 1;
}
-$sender = $SV->TerminateWaitKill (1000);
+$sender = $SV1->TerminateWaitKill (1000);
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
@@ -261,7 +262,7 @@ sleep $sleeptime;
print STDERR "Starting Sender\n";
-$SV->Spawn ();
+$SV1->Spawn ();
sleep $sleeptime;
@@ -288,7 +289,7 @@ if ($receiver1 != 0) {
$status = 1;
}
-$sender = $SV->TerminateWaitKill (1000);
+$sender = $SV1->TerminateWaitKill (1000);
if ($sender != 0) {
print STDERR "ERROR: sender returned $sender\n";
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp
index 39e4c75da8f..9d4096ed49a 100644
--- a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.cpp
@@ -41,7 +41,7 @@ Sender::Sender (void)
frame_count_ (0),
filename_ ("input"),
input_file_ (0),
- frame_rate_ (10),
+ frame_rate_ (10.0),
mb_ (BUFSIZ),
sender_name_ ("sender")
{
@@ -63,7 +63,7 @@ Sender::parse_args (int argc,
this->filename_ = opts.opt_arg ();
break;
case 'r':
- this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
break;
case 's':
this->sender_name_ = opts.opt_arg ();
@@ -153,7 +153,7 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
ACE_Time_Value inter_frame_time;
// The time between two consecutive frames.
- inter_frame_time.set (1 / (double) this->frame_rate_);
+ inter_frame_time.set (1.0 / ((double) this->frame_rate_));
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
diff --git a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h
index 782049f82fe..910bc9f55f3 100644
--- a/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h
+++ b/TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/sender.h
@@ -91,7 +91,7 @@ private:
FILE *input_file_;
// File handle of the file read from.
- int frame_rate_;
+ double frame_rate_;
// Rate at which the data will be sent.
ACE_Message_Block mb_;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp
index 7e1571f8970..cd5008b2fd7 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.cpp
@@ -58,7 +58,7 @@ Sender::Sender (void)
frame_count_ (0),
filename_ ("input"),
input_file_ (0),
- frame_rate_ (10),
+ frame_rate_ (10.0),
mb_ (BUFSIZ),
protocol_object_ (0)
{
@@ -96,7 +96,7 @@ Sender::parse_args (int argc,
this->filename_ = opts.opt_arg ();
break;
case 'r':
- this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
break;
case 'd':
TAO_debug_level++;
@@ -183,11 +183,11 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
ACE_Time_Value inter_frame_time;
// The time between two consecutive frames.
- inter_frame_time.set (1 / (double) this->frame_rate_);
+ inter_frame_time.set (1.0 / this->frame_rate_);
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
- "Frame Rate = %d / second\n"
+ "Frame Rate = %f / second\n"
"Inter Frame Time = %d (msec)\n",
this->frame_rate_,
inter_frame_time.msec ()));
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h
index bda039011eb..29837f9dca7 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/sender.h
@@ -102,7 +102,7 @@ private:
FILE *input_file_;
// File handle of the file read from.
- int frame_rate_;
+ double frame_rate_;
// Rate at which the data will be sent.
ACE_Message_Block mb_;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
index c70ab17518e..234d7ac3c20 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.cpp
@@ -35,7 +35,7 @@ Sender::Sender (void)
filename_ ("input"),
input_file_ (0),
protocol_ ("UDP"),
- frame_rate_ (30),
+ frame_rate_ (30.0),
mb_ (BUFSIZ)
{
}
@@ -67,7 +67,7 @@ Sender::parse_args (int argc,
this->protocol_ = opts.opt_arg ();
break;
case 'r':
- this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
break;
case 'd':
TAO_debug_level++;
@@ -217,11 +217,11 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
ACE_Time_Value inter_frame_time;
// The time between two consecutive frames.
- inter_frame_time.set (1 / (double) this->frame_rate_);
+ inter_frame_time.set (1.0 / this->frame_rate_);
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
- "Frame Rate = %d / second\n"
+ "Frame Rate = %f / second\n"
"Inter Frame Time = %d (msec)\n",
this->frame_rate_,
inter_frame_time.msec ()));
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
index 06e6de6b045..6efdcf55afd 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/sender.h
@@ -106,7 +106,7 @@ private:
ACE_CString protocol_;
// Selected protocol - default is UDP
- int frame_rate_;
+ double frame_rate_;
// Rate at which the data will be sent.
ACE_Message_Block mb_;
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp
index 27f1de4c22a..471cd0aee34 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.cpp
@@ -72,7 +72,7 @@ Sender::Sender (void)
filename_ ("input"),
input_file_ (0),
protocol_ ("QoS_UDP"),
- frame_rate_ (1),
+ frame_rate_ (1.0),
mb_ (BUFSIZ),
address_ ("localhost:8000")
{
@@ -105,7 +105,7 @@ Sender::parse_args (int argc,
this->protocol_ = opts.opt_arg ();
break;
case 'r':
- this->frame_rate_ = ACE_OS::atoi (opts.opt_arg ());
+ this->frame_rate_ = (double)ACE_OS::atoi (opts.opt_arg ());
break;
case 'd':
TAO_debug_level++;
@@ -307,11 +307,11 @@ Sender::pace_data (ACE_ENV_SINGLE_ARG_DECL)
// The time between two consecutive frames.
- inter_frame_time.set (1 / (double) this->frame_rate_);
+ inter_frame_time.set (1.0 / this->frame_rate_);
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG,
- "Frame Rate = %d / second\n"
+ "Frame Rate = %f / second\n"
"Inter Frame Time = %d (msec)\n",
this->frame_rate_,
inter_frame_time.msec ()));
diff --git a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h
index 41fa4f8325e..39bb7f92c7f 100644
--- a/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h
+++ b/TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/sender.h
@@ -115,7 +115,7 @@ private:
ACE_CString protocol_;
// Selected protocol - default is UDP
- int frame_rate_;
+ double frame_rate_;
// Rate at which the data will be sent.
ACE_Message_Block mb_;