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"
21 * @class Sender_StreamEndPoint
23 * @brief Defines a sender stream endpoint.
25 class Sender_StreamEndPoint
: public TAO_Client_StreamEndPoint
28 /// Create the application callback and return its handle to
29 /// AVStreams for further application callbacks.
30 int get_callback (const char *flowname
,
31 TAO_AV_Callback
*&callback
);
33 /// Set protocol object corresponding to the transport protocol
35 int set_protocol_object (const char *flowname
,
36 TAO_AV_Protocol_Object
*object
);
39 /// Application callback.
40 TAO_AV_Callback callback_
;
43 typedef TAO_AV_Endpoint_Reactive_Strategy_A
44 <Sender_StreamEndPoint
,
47 SENDER_ENDPOINT_STRATEGY
;
52 * @brief Sender Application.
54 * Class is responsible for streaming (and pacing) data to a
63 /// Method to initialize the various data components.
67 /// Method to pace and send data from a file.
70 /// Set the protocol object corresponding to the transport protocol chosen.
71 void protocol_object (TAO_AV_Protocol_Object
*protocol_object
);
74 /// Method to parse the command line arguments.
75 int parse_args (int argc
, ACE_TCHAR
*argv
[]);
77 /// Method that binds the sender to the receiver.
78 int bind_to_receiver ();
80 /// The endpoint strategy used by the sender.
81 SENDER_ENDPOINT_STRATEGY endpoint_strategy_
;
83 /// The receiver MMDevice that the sender connects to.
84 AVStreams::MMDevice_var receiver_mmdevice_
;
86 /// The sender MMDevice.
87 TAO_MMDevice
*sender_mmdevice_
;
90 TAO_StreamCtrl
*streamctrl_
;
92 /// Number of frames sent.
95 /// File from which data is read.
96 ACE_CString filename_
;
98 /// The Naming Service client.
99 TAO_Naming_Client naming_client_
;
101 /// File handle of the file read from.
104 /// Selected protocol - default is UDP
105 ACE_CString protocol_
;
107 /// Rate at which the data will be sent.
110 /// Message block into which data is read from a file and then sent.
111 ACE_Message_Block mb_
;
113 /// Protocol object corresponding to the transport protocol selected.
114 TAO_AV_Protocol_Object
*protocol_object_
;