1 # fx_spatial.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 RTPApplication
32 import ScSpatialCombiner
33 import GraphComm
34
35 Class SpatApp -superclass RTPApplication
36
37 SpatApp instproc init args {
38 $self next spat_app
39
40 $self init_resources;
41
42 [$self options] register_option -comm_id comm_id
43 [$self options] register_option -cntrl_spec cntrl_spec
44 [$self options] register_option -spatial_test_mode spatial_test_mode
45 [$self options] register_option -reg_comm_spec reg_comm_spec
46
47 eval [$self options] parse_args $args;
48
49 $self instvar spat_obj_
50
51 set spat_obj_ [new ScSpatialCombiner [$self get_option comm_id] [$self get_option cntrl_spec]];
52
53 if {[$self get_option reg_comm_spec] != ""} {
54 $self instvar reg_comm_obj_;
55
56 set reg_comm_obj_ [new GraphComm/RegComm [$self get_option comm_id] [$self get_option reg_comm_spec] [$self get_option cntrl_spec]];
57 }
58
59 }
60
61 SpatApp instproc init_resources {} {
62 $self add_option network ip
63 $self add_option mtu 1024
64 $self add_option defaultTTL 32
65 $self add_option sessionType rtpv2
66 $self add_option maxVideoSessionBW 30000000
67 $self add_option comm_id spat_comb
68 $self add_option cntrl_spec 224.3.2.1/22334/16
69 $self add_option spatial_test_mode "rate xcode"
70 $self add_option reg_comm_spec "";
71 }
72
73 Class GraphComm/RegComm -superclass GraphComm;
74
75 GraphComm/RegComm instproc init {id reg_spec cntrl_spec} {
76
77 set reg_spec [split $reg_spec "/"];
78
79 set addr [lindex $reg_spec 0];
80 set port [lindex $reg_spec 1];
81 set ttl [lindex $reg_spec 2];
82
83 $self next $id $addr $port $ttl
84
85 $self instvar sess_map_ primary_sess_;
86
87 set sess_map_($primary_sess_,inputs) 0;
88 set sess_map_($primary_sess_,outputs) 0;
89 set sess_map_($primary_sess_,parameters) 0;
90 set sess_map_($primary_sess_,trigger_cmds) 0;
91 set sess_map_($primary_sess_,map_cmds) 0;
92 set sess_map_($primary_sess_,misc) 0;
93
94 $self send_misc [list add_subgraph $cntrl_spec];
95 }
96
97 set app [new SpatApp $argv];
98
99 puts "SpatialCombiner running on [exec hostname]";
100
101 #if {![info exists tk_version]} {
102 # vwait forever;
103 #}
104
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.