EMMA Coverage Report (generated Tue Dec 18 20:38:46 CET 2007)
[all classes][cz.vutbr.feec.session.rtprtcp]

## COVERAGE SUMMARY FOR SOURCE FILE [AVSession.java]

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
AVSession.java | 0% (0/1) | 0% (0/15) | 0% (0/234) | 0% (0/51)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class AVSession | 0% (0/1) | 0% (0/15) | 0% (0/234) | 0% (0/51)
<static initializer> |  | 0% (0/1) | 0% (0/5) | 0% (0/2)
AVSession (Config): void |  | 0% (0/1) | 0% (0/157) | 0% (0/25)
addMemberTableChangeListenerAudio (MemberTableChangeListener): void |  | 0% (0/1) | 0% (0/6) | 0% (0/2)
addMemberTableChangeListenerVideo (MemberTableChangeListener): void |  | 0% (0/1) | 0% (0/6) | 0% (0/2)
addPacketListenerAudio (PacketSentOrRetreiveListener): void |  | 0% (0/1) | 0% (0/6) | 0% (0/2)
addPacketListenerVideo (PacketSentOrRetreiveListener): void |  | 0% (0/1) | 0% (0/6) | 0% (0/2)
getPayloadTypeAudio (): Integer |  | 0% (0/1) | 0% (0/5) | 0% (0/1)
getPayloadTypeVideo (): Integer |  | 0% (0/1) | 0% (0/5) | 0% (0/1)
getSessionAudio (): Session3550 |  | 0% (0/1) | 0% (0/4) | 0% (0/1)
getSessionVideo (): Session3550 |  | 0% (0/1) | 0% (0/4) | 0% (0/1)
setPktListenerAudio (PacketSentOrRetreiveListener): void |  | 0% (0/1) | 0% (0/5) | 0% (0/2)
setPktListenerVideo (PacketSentOrRetreiveListener): void |  | 0% (0/1) | 0% (0/5) | 0% (0/2)
setSessionLoggerAudio (MemberTableChangeListener): void |  | 0% (0/1) | 0% (0/5) | 0% (0/2)
setSessionLoggerVideo (MemberTableChangeListener): void |  | 0% (0/1) | 0% (0/5) | 0% (0/2)
start (): void |  | 0% (0/1) | 0% (0/10) | 0% (0/4)

1 | package cz.vutbr.feec.session.rtprtcp;
2 |
3 | import org.apache.log4j.Logger;
4 |
5 | import cz.vutbr.feec.session.rtprtcp.internal.MemberTableChangeListener;
6 | import cz.vutbr.feec.session.rtprtcp.internal.PacketSentOrRetreiveListener;
7 | import cz.vutbr.feec.session.rtprtcp.internal.Session3550;
8 | import cz.vutbr.feec.session.rtprtcp.internal.SessionType;
9 |
10 | import net.java.dev.jssm.MulticastSSM;
11 |
12 | /**
13 | * The Class AVSession.
14 | *
15 | * @brief Audio video session using two RTP/RTCP sessions to send audio and video
16 | * streams.
17 | * @author burgetrm
18 | */
19 | public class AVSession {
20 |
21 | /** The logger. */
22 | private static Logger logger = Logger.getLogger(AVSession.class.getName());
23 |
24 | /** The s audio. */
25 | private AbstractSession sAudio;
26 |
27 | /** The s video. */
28 | private AbstractSession sVideo;
29 |
30 | /** The config. */
31 | protected Config config;
32 |
33 | /**
34 | * Create A/V session.
35 | *
36 | * @param conf Configuration.
37 | */
38 | public AVSession(Config conf) {
39 | logger.debug("Creating AUDIO & VIDEO session");
40 | config = conf;
41 | if(conf.getMemberType().equals(SessionType.SENDER)) {
42 | MulticastSSM multicastSocket = new MulticastSSM();
43 | logger.info("SEND TO: ("+conf.getSSMSourceIpAddress()+", "+conf.getSSMGroupIpAddress()+")");
44 | // Audio port se meni a je pouzit pro video i audio.
45 | // co je nezbytne je nastavit cilovou IP adresu conf.getSSMGroupIpAddress()
46 | multicastSocket.setDestination(conf.getSSMPortAudio(), conf.getSSMGroupIpAddress());
47 | logger.info("SSM JOIN: ("+conf.getSSMSourceIpAddress()+", "+conf.getSSMGroupIpAddress()+")");
48 | multicastSocket.join(conf.getSSMSourceIpAddress(), conf.getSSMGroupIpAddress());
49 |
50 | logger.debug("Creating AUDIO session");
51 | sAudio = new AudioSession(conf, multicastSocket, "AUDIO", conf.getPayloadTypeAudio());
52 |
53 | logger.debug("Creating VIDEO session");
54 | sVideo = new VideoSession(conf, multicastSocket, "VIDEO", conf.getPayloadTypeVideo());
55 | } else if(conf.getMemberType().equals(SessionType.RECEIVER)){
56 | // Audio
57 | logger.debug("Creating AUDIO RTP/RTCP session - RECEIVER");
58 | sAudio = new AudioSession(conf, "AUDIO", conf.getPayloadTypeAudio());
59 |
60 | // Video
61 | logger.debug("Creating VIDEO RTP/RTCP session - RECEIVER");
62 | sVideo = new VideoSession(conf, "VIDEO", conf.getPayloadTypeVideo());
63 | } else if(conf.getMemberType().equals(SessionType.FEEDBACK_TARGET)){
64 | // Audio
65 | logger.debug("Creating AUDIO RTP/RTCP session - FEEDBACK TARGET");
66 | sAudio = new AudioSession(conf, "AUDIO", conf.getPayloadTypeAudio());
67 |
68 | // Video
69 | logger.debug("Creating VIDEO RTP/RTCP session - FEEDBACK TARGET");
70 | sVideo = new VideoSession(conf, "VIDEO", conf.getPayloadTypeVideo());
71 | } else {
72 | throw new RuntimeException("Uknown member type");
73 | }
74 | }
75 |
76 | /**
77 | * Creates sockets, binds and starts to receive and send RTP/RTCP packets.
78 | */
79 | public void start() {
80 | logger.debug("Starting Audio & Video session.");
81 | sAudio.start();
82 | sVideo.start();
83 | }
84 |
85 | /**
86 | * Gets the payload type audio.
87 | *
88 | * @return the payload type audio
89 | */
90 | public Integer getPayloadTypeAudio() {
91 | return sAudio.getPayloadType();
92 | }
93 |
94 | /**
95 | * Gets the payload type video.
96 | *
97 | * @return the payload type video
98 | */
99 | public Integer getPayloadTypeVideo() {
100 | return sVideo.getPayloadType();
101 | }
102 |
103 | /**
104 | * Sets the pkt listener video.
105 | *
106 | * @param l the pkt listener video
107 | */
108 | public void setPktListenerVideo(PacketSentOrRetreiveListener l) {
109 | sVideo.setPacketListener(l);
110 | }
111 |
112 | /**
113 | * Sets the pkt listener audio.
114 | *
115 | * @param l the pkt listener audio
116 | */
117 | public void setPktListenerAudio(PacketSentOrRetreiveListener l) {
118 | sAudio.setPacketListener(l);
119 | }
120 |
121 | /**
122 | * Sets the session logger video.
123 | *
124 | * @param l the session logger video
125 | */
126 | public void setSessionLoggerVideo(MemberTableChangeListener l) {
127 | sVideo.setMembersListener(l);
128 | }
129 |
130 | /**
131 | * Sets the session logger audio.
132 | *
133 | * @param l the session logger audio
134 | */
135 | public void setSessionLoggerAudio(MemberTableChangeListener l) {
136 | sAudio.setMembersListener(l);
137 | }
138 |
139 | /**
140 | * Gets the session audio.
141 | *
142 | * @return the session audio
143 | */
144 | public Session3550 getSessionAudio() {
145 | return sAudio.getSession();
146 | }
147 |
148 | /**
149 | * Gets the session video.
150 | *
151 | * @return the session video
152 | */
153 | public Session3550 getSessionVideo() {
154 | return sVideo.getSession();
155 | }
156 |
157 | /**
158 | * Adds the member table change listener for audio.
159 | *
160 | * @param listener the listener
161 | */
162 | protected void addMemberTableChangeListenerAudio(MemberTableChangeListener listener) {
163 | sAudio.getSession().addMemberTableChangeListener(listener);
164 | }
165 |
166 | /**
167 | * Adds the member table change listener for video session.
168 | *
169 | * @param listener the listener
170 | */
171 | protected void addMemberTableChangeListenerVideo(MemberTableChangeListener listener) {
172 | sVideo.getSession().addMemberTableChangeListener(listener);
173 | }
174 |
175 | /**
176 | * Adds the packet listener audio.
177 | *
178 | * @param listener the listener
179 | */
180 | protected void addPacketListenerAudio(PacketSentOrRetreiveListener listener) {
181 | sAudio.getSession().addPacketSentOrRetreiveListener(listener);
182 | }
183 |
184 | /**
185 | * Adds the packet listener.
186 | *
187 | * @param listener the listener for video session
188 | */
189 | protected void addPacketListenerVideo(PacketSentOrRetreiveListener listener) {
190 | sVideo.getSession().addPacketSentOrRetreiveListener(listener);
191 | }
192 |
193 | /**
194 | * Adds the Audio Video listeners.
195 | *
196 | * @param listener the listener
197 | */
198 | // public void addReceiveRtpAVListener(RtpAudioVideoListener listener) {
199 | // addPacketListenerAudio(listener.getAudio());
200 | // addPacketListenerVideo(listener.getVideo());
201 | // }
202 | }

[all classes][cz.vutbr.feec.session.rtprtcp]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov