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

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

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
GeneralRTCPHeader.java | 100% (1/1) | 94% (15/16) | 74% (153/207) | 86% (32,7/38)

### COVERAGE BREAKDOWN BY CLASS AND METHOD

name | class, % | method, % | block, % | line, %
--- | --- | --- | --- | ---
class GeneralRTCPHeader | 100% (1/1) | 94% (15/16) | 74% (153/207) | 86% (32,7/38)
getReportCount (): int |  | 0% (0/1) | 0% (0/3) | 0% (0/1)
generate (byte [], int): int |  | 100% (1/1) | 54% (58/108) | 62% (6,8/11)
<static initializer> |  | 100% (1/1) | 88% (7/8) | 87% (0,9/1)
GeneralRTCPHeader (): void |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getLength (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getPadding (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getPayloadtype (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getSSRC (): long |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
getVersion (): int |  | 100% (1/1) | 100% (3/3) | 100% (1/1)
parse (byte [], int, int): int |  | 100% (1/1) | 100% (46/46) | 100% (8/8)
setLength (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setPadding (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setPayloadtype (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setReportCount (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setSSRC (long): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)
setVersion (int): void |  | 100% (1/1) | 100% (4/4) | 100% (2/2)

1 | package cz.vutbr.feec.packets.rtcp;
2 |
3 | import cz.vutbr.feec.packets.IPacket;
4 | import cz.vutbr.feec.packets.PacketGenerateException;
5 | import cz.vutbr.feec.packets.PacketParseException;
6 | import cz.vutbr.feec.packets.PacketUtils;
7 |
8 | public class GeneralRTCPHeader implements IPacket{
9 | private int version;
10 | private int padding;
11 | protected int reportCount;
12 | private int payloadtype;
13 | private int length;
14 | private long SSRC;
15 | public int getVersion() {
16 | return version;
17 | }
18 | public void setVersion(int version) {
19 | this.version = version;
20 | }
21 | public int getPadding() {
22 | return padding;
23 | }
24 | public void setPadding(int padding) {
25 | this.padding = padding;
26 | }
27 | public int getReportCount() {
28 | return reportCount;
29 | }
30 | protected void setReportCount(int reportCount) {
31 | this.reportCount = reportCount;
32 | }
33 | public int getPayloadtype() {
34 | return payloadtype;
35 | }
36 | public void setPayloadtype(int payloadtype) {
37 | this.payloadtype = payloadtype;
38 | }
39 | public int getLength() {
40 | return length;
41 | }
42 | public void setLength(int length) {
43 | this.length = length;
44 | }
45 | public long getSSRC() {
46 | return SSRC;
47 | }
48 | public void setSSRC(long ssrc_ps) {
49 | SSRC = ssrc_ps;
50 | }
51 | public int generate(byte[] buffer, int offset)
52 | throws PacketGenerateException {
53 | assert PacketUtils.checkSize(this.getVersion(), 2);
54 | assert PacketUtils.checkSize(this.getPadding(), 1);
55 | assert PacketUtils.checkSize(this.getReportCount(), 5);
56 | assert PacketUtils.checkSize(this.getPayloadtype(), 8);
57 | assert PacketUtils.checkSize(this.getLength(), 16);
58 |
59 | byte V_P_RC = (byte) ((this.getVersion() << 6) & 0xC0 | (this.getPadding() << 5) & 0x20 | (this.getReportCount() & 0x1F));
60 | buffer[offset] = V_P_RC;
61 |
62 | PacketUtils.setOctet1(buffer, offset+1, this.getPayloadtype());
63 | PacketUtils.setOctet2(buffer, offset+2, this.getLength());
64 | PacketUtils.setOctet4(buffer, offset+4, this.getSSRC());
65 |
66 | return 8;
67 | }
68 | public int parse(byte[] buffer, int offset, int length)
69 | throws PacketParseException {
70 | int first = PacketUtils.getOctet1(buffer, offset);
71 | this.setVersion((first & 0xC0) >> 6);
72 | this.setPadding((first & 0x20) >> 5);
73 | this.setReportCount(first & 0x1F);
74 |
75 | this.setPayloadtype(PacketUtils.getOctet1(buffer, offset+1));
76 | this.setLength(PacketUtils.getOctet2(buffer , offset+2));
77 | this.setSSRC(PacketUtils.getOctet4(buffer, offset+4));
78 |
79 | return 8;
80 | }
81 |
82 |
83 | }

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