Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / tests / AVStreams / Modify_QoS / sender.h
blob68302f92daab1061fc95b10abec86e46e5ff2852
1 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file sender.h
7 * @author Yamuna Krishnamurthy <yamuna@cs.wustl.edu>
8 */
9 //=============================================================================
11 #include "orbsvcs/Naming/Naming_Client.h"
12 #include "orbsvcs/AV/AVStreams_i.h"
13 #include "orbsvcs/AV/Endpoint_Strategy.h"
14 #include "orbsvcs/AV/Protocol_Factory.h"
16 // = Defines application specific sender stream endpoint.
17 class Sender_StreamEndPoint : public TAO_Client_StreamEndPoint
19 public:
20 int get_callback (const char *flowname,
21 TAO_AV_Callback *&callback);
22 /// Create the application callback and return its handle to
23 /// AVStreams for further application callbacks.
25 int set_protocol_object (const char *flowname,
26 TAO_AV_Protocol_Object *object);
27 /// Set protocol object corresponding to the transport protocol
28 /// chosen.
30 CORBA::Boolean modify_QoS (AVStreams::streamQoS &new_qos,
31 const AVStreams::flowSpec &flow_spec);
33 /// The over-ridden modify_qos method to change the qos of the
34 /// flows specified in the flow spec to that in the new_qos.
36 protected:
37 TAO_AV_Callback callback_;
38 /// Application callback.
41 typedef TAO_AV_Endpoint_Reactive_Strategy_A
42 <Sender_StreamEndPoint,
43 TAO_VDev,
44 AV_Null_MediaCtrl>
45 SENDER_ENDPOINT_STRATEGY;
47 /**
48 * @class Sender
50 * @brief Class is responsible for streaming (and pacing) data to a
51 * receiver.
53 class Sender
55 public:
56 Sender ();
57 /// Constructor
59 int init (int argc,
60 ACE_TCHAR *argv[]);
61 /// Method to initialize the various data components.
63 int pace_data ();
64 /// Method to pace and send data from a file.
66 void protocol_object (TAO_AV_Protocol_Object *protocol_object);
67 /// Set the protocol object corresponding to the transport protocol chosen.
69 private:
70 int parse_args (int argc, ACE_TCHAR *argv[]);
71 /// Method to parse the command line arguments.
73 int bind_to_receiver ();
74 /// Method that binds the sender to the receiver.
76 SENDER_ENDPOINT_STRATEGY endpoint_strategy_;
77 /// The endpoint strategy used by the sender.
79 AVStreams::MMDevice_var receiver_mmdevice_;
80 /// The receiver MMDevice that the sender connects to.
82 TAO_MMDevice *sender_mmdevice_;
83 /// The sender MMDevice.
85 TAO_StreamCtrl *streamctrl_;
86 /// Stream controller
88 int frame_count_;
89 /// Number of frames sent.
91 ACE_CString filename_;
92 /// File from which data is read.
94 TAO_Naming_Client naming_client_;
95 /// The Naming Service client.
97 FILE *input_file_;
98 /// File handle of the file read from.
100 ACE_CString protocol_;
101 /// Selected protocol - default is UDP
103 int frame_rate_;
104 /// Rate at which the data will be sent.
106 ACE_Message_Block mb_;
107 /// Message block into which data is read from a file and then sent.
109 TAO_AV_Protocol_Object *protocol_object_;
110 /// Protocol object corresponding to the transport protocol selected.