1 # sources should contains a list of ip address patterns for the sources
2 # that we are interested in.
3
4 sources *
5
6 # Maximum number of source
7
8 max_num_of_sources 2
9
10 # This is the se/sion we are interested in
11
12 input_session 224.4.5.6/4444/16
13
14 # This is the description of the program
15
16 description {A transcoder that transcode a source into H261 formats}
17
18 # These are the variables that hooks the input video to the dali program
19
20 input_frame {in inW inH}
21 output_frame {out outW outH}
22
23 # Specifies the output format of the degas program. Can be either H261/JPEG
24
25 output_format {JPEG}
26
27 # Specifies the output size of the output video. Can be either "QCIF", "CIF",
28 # "SCIF", "PAL", "1/4 PAL", "1/16 PAL", "NTSC", "1/4 NTSC", "1/16 NTSC".
29
30 output_size {1/16 NTSC}
31
32 # Output rate
33
34 output_fps {5}
35
36 # A unique string that helps identify the source. For example if there are
37 # more than one source, we can use an array of frames, indexed by the
38 # source_id.
39
40 source_id {src}
41
42 # For server to check if they are eligible to provide service.
43
44 precondition { }
45 server_responds { }
46
47 # List of Dali packages required by this program
48
49 packages {DvmByteGeom}
50
51 # All the following are dali programs
52
53 init_callback {
54 set num_of_source 0
55 set src_list {}
56 set clip [frame_clip $out 8 8 80 60]
57 }
58
59 output_resize_callback {
60 puts "output resized!"
61 frame_free clip
62 set clip [frame_clip $out 8 8 [expr $outW/4] [expr $outH/4]]
63 }
64
65 output_grayed_callback {
66 puts "output grayed!"
67 frame_free clip
68 set clip [frame_clip $out 8 8 [expr $outW/4] [expr $outH/4]]
69 }
70
71 new_source_callback {
72 puts stderr "New source $src detected"
73 incr num_of_source
74 lappend src_list $src
75 set sw [frame_get_w_subsample $in($src)]
76 set sh [frame_get_h_subsample $in($src)]
77 set f($src) [frame_new $inW($src) $inH($src) $sw $sh]
78 if {[llength $src_list] == 2} {
79 set clip2 [frame_clip $f($src) 0 0 80 60]
80 }
81 }
82
83 del_source_callback {
84 frame_free f($src)
85 }
86
87 recv_frame_callback {
88 if {$num_of_source == 1} {
89 frame_scale in($src) out
90 } else {
91 frame_copy in($src) f($src)
92 set s1 [lindex $src_list 0]
93 set s2 [lindex $src_list 1]
94 frame_scale f($s1) out
95 frame_scale clip2 clip
96 }
97 }
98
99 mouse_click_callback {
100 set s1 [lindex $src_list 0]
101 set s2 [lindex $src_list 1]
102 set src_list [lreplace $src_list 0 0 $s2]
103 set src_list [lreplace $src_list 1 1 $s1]
104 }
105
106 destroy_callback {
107 frame_free clip
108 }
109
110 # The following is not supported yet.
111 input_resize_callback {
112 puts "input $src resize : $inW($src) x $inH($src)"
113 }
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.