summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/AVStreams/client.h
blob: 19216de47d87ba4bf03030a1be70c88cb5b84105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO/orbsvcs/tests/AVStreams
//
// = FILENAME
//    client.h
//
// = DESCRIPTION 
//    Test client for the AVStreams demo
//   
// = AUTHORS
//   Sumedh Mungee <sumedh@cs.wustl.edu>
//
// ============================================================================

#if !defined (AVSTREAMS_CLIENT_H)
#define AVSTREAMS_CLIENT_H

#include "ace/Synch.h"
#include "ace/Task.h"
#include "ace/Thread_Manager.h"
#include "orbsvcs/Property/CosPropertyService_i.h"
#include "orbsvcs/AV/AVStreams_i.h"
#include "ace/Get_Opt.h"
#include "tao/tao_util.h"

class Client
{
  // = TITLE
  //    Client for A/V Streams demo.
  //
  // = DESCRIPTION
  //    Encapsulates client functionality.
public:
  // Constructor
  Client (void);
  
  int init (int argc, 
            char **argv,
            CORBA::Environment &env);
  // Initialize the ORB etc, and bind the MMDevices.

  int run (CORBA::Environment &env);
  // Run the client.  This will call StreamCtrl::bind_devs.
  
  int property_tester (CORBA::Environment &env);
  // Testing  the property service methods.

protected:
  int bind_to_remote_mmdevice (int argc,
                               char *argv[],
                               CORBA::Environment &env);
  // Bind to the remote MMDevice.
  
  // = Property Testing.
  
  int test_define_property (CORBA::Environment &env);
  // Testing the define property method.
  
  int test_get_all_property_names (CORBA::Environment &env);
  //Testing get_all_property_names.
  
  int test_get_properties (CORBA::Environment &env);
  //Testing get_properties.  Give the names and get their properties.

  int test_get_all_properties (CORBA::Environment &env);
  // Testing get_all_properties.
  
  TAO_ORB_Manager manager_;
  // The ORB manager, handles ORB initialization etc.
  
  AVStreams::MMDevice_var local_mmdevice_;
  // Our MMDevice.
  
  AVStreams::MMDevice_var remote_mmdevice_;
  // Servers MMDevice.
  
  AVStreams::StreamCtrl_var stream_ctrl_;
  // Stream Controller.
};

class Video_Client_StreamEndPoint
  : public virtual TAO_Client_StreamEndPoint
{
  // = TITLE
  //    Stream Endpoint for the video client.
  //
  // = DESCRIPTION
  //    Implements the callbacks that are made by the AVStreams library.
public:
  Video_Client_StreamEndPoint (void);
  // Constructor.

  virtual void handle_stop (const AVStreams::flowSpec &the_spec,
                            CORBA::Environment &env);
  // Handles stream stoppage.
  
  virtual void handle_start (const AVStreams::flowSpec &the_spec,  
                             CORBA::Environment &env);
  // Handles stream start. Starts the flow of data.
  
  virtual void handle_destroy (const AVStreams::flowSpec &the_spec,  
                               CORBA::Environment &env);
  // Handles the destruction of the stream, tears down the transport.

  virtual CORBA::Boolean handle_connection_established (AVStreams::StreamEndPoint_ptr responder, 
                                                        AVStreams::streamQoS &qos_spec, 
                                                        const AVStreams::flowSpec &the_spec,  
                                                        CORBA::Environment &env);
  // Handles stream bind, establishes the transport.
};

#endif /* AVSTREAMS_CLIENT_H */