summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/AVStreams/client.h
blob: 6b3c0f22ccf16694610f472f5270098b76affcac (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
/* -*- 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/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);
  
  // Initialize the ORB etc, and bind the MMDevices
  int init (int argc, 
            char **argv,
            CORBA::Environment &env);

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

protected:
  // Bind to the remote MMDevice
  int bind_to_remote_mmdevice (int argc,
                               char **argv,
                               CORBA::Environment &env);

  // The ORB manager, handles ORB initialization etc.
  TAO_ORB_Manager manager_;
  
  // Our MMDevice
  AVStreams::MMDevice_var local_mmdevice_;

  // Servers MMDevice
  AVStreams::MMDevice_var remote_mmdevice_;

  // Stream Controller
  AVStreams::StreamCtrl_var stream_ctrl_;
};

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:
  // Constructor
  Video_Client_StreamEndPoint ();

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

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


};



#endif /* AVSTREAMS_CLIENT_H */