TT#37157 add G722 transcoding test incl RTP TS testing

Change-Id: I33f244eeccfbf9a9358608a73743585fd235686b
changes/21/21521/2
Richard Fuchs 7 years ago
parent e404f18975
commit 9b447cf18a

@ -180,6 +180,10 @@ static void queue_dump(GString *s, GQueue *q) {
#define PCMU_payload "\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00\x01\x00"
#define PCMU_payload_AMR "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7e\xff\x7e\xf6\xf3\xf5\xf5\xf5\xf6\xf7\xf7\xf8\xf9\xf9\xfa\xfb\xfb\xfc\xfc\xfd\xfd\xfe\xfe\xff\xff\x7e\xff\x7d\xff\x7b\xfc\xf6\xf5\xf6\xe3\x6e\x42\x3d\x3d\x3e\x3f\x41\x3f\x3d\x3f\x41\x44\x46\x49\x4b\x4d\x50\x54\x58\x5b\x60\x67\x6f\x74\xec\x6c\x46\x41\x42\x45\x48\x4a\x4d\x4f\x60\xff\xdb\xd2\xce\xc6\xc6\xc5\xc4\xc6\xbf\xbe\xba\xba\xba\xb8\xb6\xb4\xb3\xb2\xb0\xb0\xaf\xaf\x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x28\x2b\x28\x2b\x28\x2b\x28\x2b\x28\x2b\x28\x2b\x28\x2b\x28" // after G722 decode #2
#define G722_payload "\x23\x84\x20\x84\x20\x84\x04\x84\x04\x04\x84\x04\x84\x04\x84\x05\x85\x46\x87\x48\xc8\x48\x88\x48\xc8\x49\x8a\x4b\xcc\x4c\x8c\x4c\xcc\x4c\x8c\x4d\xce\x50\xcf\x51\x90\x50\xcf\x12\xd1\x52\xd2\x54\x91\x52\xd2\x54\x92\x54\xd3\x56\x93\xd6\x94\xd4\x93\xd7\xd5\x55\x94\x55\xd5\x55\xd4\x56\xd5\x17\xd7\x5a\x95\xd7\x97\xd9\xd4\x16\x58\x57\x98\xd5\xd7\x5b\x96\xda\xd6\x1b\x57\x5a\xd6\x1a\x57\x5b\x98\xd6\xd8\x56\x98\xd7\xd9\x5a\x95\xdb\xd6\x1c\x52\x5e\xd7\x5c\x93\xdf\x99\xd5\xd7\x5f\xd9\x14\x56\x7f\x92\xda\xd9\x5c\x92\xdd\xd7\x5d\x92\xff\xd6\x5a\x96\xdc\xd5\x18\x56\x7e\xd2\x5e\x96\xde\x94\xd8\xd8\x58\xd3\x79\x93\xfb\x90\xdc\xd6\x5b\xdd\x58\x96\xff"
#define G722_payload_2 "\x92\xdf\xd5\x7f\xd4\x5a\x9b\xdd\xd1\x5f\x9b\xff\xd0\x5e\xd9\x59\x92\xf6\x95\xdb\x58\x5f\x96\xdb\x9e\xfc\x51\x7c\x96\xfd\xd0\xfc\x9e\xdb\xd6\xfb\x92\xfd\x54\x79\x96\xfe\x56\x7f\xd4\x5c\x99\xba\x94\xfe\xd4\xff\xd3\x72\xd5\x7d\xd8\x5c\xd4\x9d\x99\xf5\xd3\x74\x94\xd9\x55\xfb\x98\xfe\xd5\x78\xd3\x7f\x52\x75\x98\xda\xdb\xfa\x90\xda\x9a\xf3\x4f\x76\x99\xda\xd6\x5f\xbb\x98\x91\xf1\xd2\xfd\xd3\x74\x9e\xd5\xdc\xfe\xd1\x7d\x96\xf3\x91\xdc\x5b\x7e\xd3\x7b\xda\x7f\x93\xfa\x97\x9d\x95\xfd\x5b\x5f\x95\xff\xd1\xff\xd4\x5e\xd9\x5e\x94\xde\xd2\x78\xd3\xf8\x97\xde\xd5\x5b\x98\x5c\xd1\xf6\x92\xfd\xd3\xfa\x95\xd7\xbe\xde\xd2\x7b\x90\xfd\xd3\x79\x99\xd8"
#define AMR_WB_payload "\xf0\x1c\xf3\x06\x08\x10\x77\x32\x23\x20\xd3\x50\x62\x12\xc7\x7c\xe2\xea\x84\x0e\x6e\xf4\x4d\xe4\x7f\xc9\x4c\xcc\x58\x5d\xed\xcc\x5d\x7c\x6c\x14\x7d\xc0" // octet aligned
#define AMR_WB_payload_noe "\xf1\xfc\xc1\x82\x04\x1d\xcc\x88\xc8\x34\xd4\x18\x84\xb1\xdf\x38\xba\xa1\x03\x9b\xbd\x13\x79\x1f\xf2\x53\x33\x16\x17\x7b\x73\x17\x5f\x1b\x05\x1f\x70" // bandwidth efficient
@ -383,5 +387,28 @@ int main() {
}
}
// G.722 <> PCMA
start();
sdp_pt(8, PCMA, 8000);
transcode(G722);
offer();
expect(A, recv, "");
expect(A, send, "8/PCMA/8000");
expect(B, recv, "8/PCMA/8000 9/G722/8000");
expect(B, send, "");
sdp_pt(9, G722, 8000);
answer();
expect(A, recv, "8/PCMA/8000");
expect(A, send, "8/PCMA/8000");
expect(B, recv, "8/PCMA/8000 9/G722/8000");
expect(B, send, "9/G722/8000");
packet_seq(A, 8, PCMA_payload, 0, 0, -1, ""); // nothing due to resampling
packet_seq(A, 8, PCMA_payload, 160, 1, 9, G722_payload);
packet_seq_ts(A, 8, PCMA_payload, 320, 2, 9, G722_payload_2, 160);
packet_seq(B, 9, G722_payload, 0, 0, -1, ""); // nothing due to resampling
packet_seq(B, 9, G722_payload, 160, 1, 8, PCMA_payload_G722);
packet_seq_ts(B, 9, G722_payload_2, 320, 2, 8, PCMA_payload_G722_2, 160);
end();
return 0;
}

Loading…
Cancel
Save