3 //=============================================================================
7 * This application reads data from a file and sends it to s
10 * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
12 //=============================================================================
15 #include "orbsvcs/Naming/Naming_Client.h"
16 #include "orbsvcs/AV/AVStreams_i.h"
17 #include "orbsvcs/AV/Endpoint_Strategy.h"
18 #include "orbsvcs/AV/Protocol_Factory.h"
20 typedef ACE_Unbounded_Set
<TAO_AV_Protocol_Object
*> ProtocolObject_Set
;
21 typedef ACE_Unbounded_Set_Iterator
<TAO_AV_Protocol_Object
*> ProtocolObject_SetItor
;
24 * @class Sender_StreamEndPoint
26 * @brief Defines a sender stream endpoint.
28 class Sender_StreamEndPoint
: public TAO_Client_StreamEndPoint
31 /// Create the application callback and return its handle to
32 /// AVStreams for further application callbacks.
33 int get_callback (const char *flowname
,
34 TAO_AV_Callback
*&callback
);
36 /// Set protocol object corresponding to the transport protocol
38 int set_protocol_object (const char *flowname
,
39 TAO_AV_Protocol_Object
*object
);
42 /// Application callback.
43 TAO_AV_Callback callback_
;
46 typedef TAO_AV_Endpoint_Reactive_Strategy_A
47 <Sender_StreamEndPoint
,
50 SENDER_ENDPOINT_STRATEGY
;
55 * @brief Sender Application.
57 * Class is responsible for streaming (and pacing) data to a
66 /// Method to initialize the various data components.
70 /// Method to pace and send data from a file.
73 /// Set the protocol object corresponding to the transport protocol chosen.
74 void protocol_object (TAO_AV_Protocol_Object
*protocol_object
);
79 /// Method to parse the command line arguments.
80 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
82 /// Method that binds the sender to the receiver.
83 int bind_to_receiver ();
85 /// The endpoint strategy used by the sender.
86 SENDER_ENDPOINT_STRATEGY endpoint_strategy_
;
88 /// The receiver MMDevice that the sender connects to.
89 AVStreams::MMDevice_var receiver_mmdevice_
;
91 /// The sender MMDevice.
92 TAO_MMDevice
*sender_mmdevice_
;
95 TAO_StreamCtrl
*streamctrl_
;
97 /// Number of frames sent.
100 /// File from which data is read.
101 ACE_CString filename_
;
103 /// The Naming Service client.
104 TAO_Naming_Client naming_client_
;
106 /// File handle of the file read from.
109 /// Selected protocol - default is UDP
110 ACE_CString protocol_
;
112 /// Rate at which the data will be sent.
115 /// Message block into which data is read from a file and then sent.
116 ACE_Message_Block mb_
;
118 /// Protocol object corresponding to the transport protocol selected.
119 ProtocolObject_Set protocol_object_
;