Example #1
0
 def testComplexIntersectSDP(self):
     from shtoom.sdp import SDP
     from shtoom.rtp.formats import PT_SPEEX, PT_SPEEX_16K, PT_GSM, PT_PCMU
     sdp4 = SDP(sdptext4)
     ae = self.assertEquals
     ae(sdp4.show(), sdptext4)
     rtpmap = sdp4.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101])
     sdp5 = SDP(sdptext5)
     rtpmap = sdp5.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [0, 3, 101, 102])
     ae(sdp5.show(), sdptext5)
     sdp4.intersect(sdp5)
     rtpmap = sdp4.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 102])
     sdp6 = SDP(sdptext6)
     rtpmap = sdp6.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101, 102])
     sdp7 = SDP(sdptext7)
     rtpmap = sdp7.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [0, 3, 101, 102])
     sdp6.intersect(sdp7)
     rtpmap = sdp6.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101, 102])
     ae(rtpmap[3][1], PT_GSM)
     ae(rtpmap[101][1], PT_SPEEX)
     ae(rtpmap[102][1], PT_SPEEX_16K)
Example #2
0
 def testComplexIntersectSDP(self):
     from shtoom.sdp import SDP
     from shtoom.rtp.formats import PT_SPEEX, PT_SPEEX_16K, PT_GSM, PT_PCMU
     sdp4 = SDP(sdptext4)
     ae = self.assertEquals
     ae(sdp4.show(), sdptext4)
     rtpmap = sdp4.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101])
     sdp5 = SDP(sdptext5)
     rtpmap = sdp5.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [0, 3, 101, 102])
     ae(sdp5.show(), sdptext5)
     sdp4.intersect(sdp5)
     rtpmap = sdp4.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 102])
     sdp6 = SDP(sdptext6)
     rtpmap = sdp6.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101, 102])
     sdp7 = SDP(sdptext7)
     rtpmap = sdp7.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [0, 3, 101, 102])
     sdp6.intersect(sdp7)
     rtpmap = sdp6.getMediaDescription('audio').rtpmap
     ae(rtpmap.keys(), [3, 101, 102])
     ae(rtpmap[3][1], PT_GSM)
     ae(rtpmap[101][1], PT_SPEEX)
     ae(rtpmap[102][1], PT_SPEEX_16K)
Example #3
0
 def testIntersectSDP(self):
     from shtoom.sdp import SDP
     ae = self.assertEquals
     sdp1 = SDP(sdptext1)
     ae(sdp1.show(), sdptext1)
     sdp2 = SDP(sdptext2)
     sdp1.intersect(sdp2)
     sdp3 = SDP(sdptext3)
     #ae(sdp1.show(), sdp3.show())
     audio1 = sdp1.getMediaDescription('audio')
     audio3 = sdp3.getMediaDescription('audio')
     ae(audio1.formats, audio3.formats)
     ae(audio1.rtpmap.keys(), [3,])
Example #4
0
 def testIntersectSDP(self):
     from shtoom.sdp import SDP
     ae = self.assertEqual
     sdp1 = SDP(sdptext1)
     ae(sdp1.show(), sdptext1)
     sdp2 = SDP(sdptext2)
     sdp1.intersect(sdp2)
     sdp3 = SDP(sdptext3)
     #ae(sdp1.show(), sdp3.show())
     audio1 = sdp1.getMediaDescription('audio')
     audio3 = sdp3.getMediaDescription('audio')
     ae(audio1.formats, audio3.formats)
     ae(audio1.rtpmap.keys(), [3,])