1 # fx_proc.tcl --
2 #
3 # FIXME: This file needs a description here.
4 #
5 # Copyright (c) 1999-2002 The Regents of the University of California.
6 # All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions are met:
10 #
11 # A. Redistributions of source code must retain the above copyright notice,
12 # this list of conditions and the following disclaimer.
13 # B. Redistributions in binary form must reproduce the above copyright notice,
14 # this list of conditions and the following disclaimer in the documentation
15 # and/or other materials provided with the distribution.
16 # C. Neither the names of the copyright holders nor the names of its
17 # contributors may be used to endorse or promote products derived from this
18 # software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
21 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
24 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 import GraphComm;
32 import RTPApplication
33
34 Class FXProcApp -superclass RTPApplication
35
36 FXProcApp instproc init args {
37
38 $self next fx_proc;
39
40 $self init_resources;
41
42 [$self options] register_option -subprogram subprogram;
43 [$self options] register_option -comm_id comm_id
44 [$self options] register_option -cntrl_spec cntrl_spec;
45 [$self options] register_option -reg_comm_spec reg_comm_spec
46
47 eval [$self options] parse_args $args;
48
49 set subprog_type [$self get_option subprogram];
50
51 puts "Proc running on [exec hostname]";
52
53 uplevel #0 import $subprog_type;
54
55 $self instvar subprog_obj_;
56 set subprog_obj_ [new $subprog_type [$self get_option comm_id] [$self get_option cntrl_spec]];
57
58 if {[$self get_option reg_comm_spec] != ""} {
59 $self instvar reg_comm_obj_;
60
61 set reg_comm_obj_ [new GraphComm/RegComm [$self get_option comm_id] [$self get_option reg_comm_spec] [$self get_option cntrl_spec]];
62 }
63 }
64
65 FXProcApp instproc init_resources {} {
66 $self add_option network ip
67 $self add_option mtu 1024
68 $self add_option defaultTTL 32
69 $self add_option sessionType rtpv2
70
71 # Set up default cntrl_spec and comm_id
72
73 set hname [exec hostname];
74 set hname [split $hname .];
75 set hname [string trim [lindex $hname 0]];
76
77 $self add_option comm_id $hname;
78
79 set hnum [string range $hname 1 end];
80 $self add_option cntrl_spec 224.5.8.${hnum}/22334/16
81 $self add_option maxVideoSessionBW 30000000
82 $self add_option subprogram WhirlpoolSubprogram
83 $self add_option reg_comm_spec "";
84 }
85
86 FXProcApp instproc remote_exit {} {
87 exit;
88 }
89
90 Class GraphComm/RegComm -superclass GraphComm;
91
92 GraphComm/RegComm instproc init {id reg_spec cntrl_spec} {
93
94 set reg_spec [split $reg_spec "/"];
95
96 set addr [lindex $reg_spec 0];
97 set port [lindex $reg_spec 1];
98 set ttl [lindex $reg_spec 2];
99
100 $self next $id $addr $port $ttl
101
102 $self instvar sess_map_ primary_sess_;
103
104 set sess_map_($primary_sess_,inputs) 0;
105 set sess_map_($primary_sess_,outputs) 0;
106 set sess_map_($primary_sess_,parameters) 0;
107 set sess_map_($primary_sess_,trigger_cmds) 0;
108 set sess_map_($primary_sess_,map_cmds) 0;
109 set sess_map_($primary_sess_,misc) 0;
110
111 $self send_misc [list add_subgraph $cntrl_spec];
112 }
113
114 set app [new FXProcApp $argv];
115
116 #if {![info exists tk_version]} {
117 # vwait forever;
118 #}
119
120
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.