How to use the aiortc.utils.uint16_add function in aiortc

To help you get started, we’ve selected a few aiortc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aiortc / aiortc / tests / test_rtcrtpreceiver.py View on Github external
def create_rtp_packets(count, seq=0):
    packets = []
    for i in range(count):
        packets.append(
            RtpPacket(
                payload_type=0,
                sequence_number=uint16_add(seq, i),
                ssrc=1234,
                timestamp=i * 160,
            )
        )
    return packets
github aiortc / aiortc / tests / test_rtcrtpreceiver.py View on Github external
encoder = get_encoder(codec)
    packets = []
    for frame in self.create_video_frames(width=640, height=480, count=frames):
        payloads, timestamp = encoder.encode(frame)
        self.assertEqual(len(payloads), 1)
        packet = RtpPacket(
            payload_type=codec.payloadType,
            sequence_number=seq,
            ssrc=1234,
            timestamp=timestamp,
        )
        packet.payload = payloads[0]
        packet.marker = 1
        packets.append(packet)

        seq = uint16_add(seq, 1)
    return packets
github aiortc / aiortc / tests / test_utils.py View on Github external
def test_uint16_add(self):
        self.assertEqual(uint16_add(0, 1), 1)
        self.assertEqual(uint16_add(1, 1), 2)
        self.assertEqual(uint16_add(1, 2), 3)
        self.assertEqual(uint16_add(65534, 1), 65535)
        self.assertEqual(uint16_add(65535, 1), 0)
        self.assertEqual(uint16_add(65535, 3), 2)
github aiortc / aiortc / tests / test_utils.py View on Github external
def test_uint16_add(self):
        self.assertEqual(uint16_add(0, 1), 1)
        self.assertEqual(uint16_add(1, 1), 2)
        self.assertEqual(uint16_add(1, 2), 3)
        self.assertEqual(uint16_add(65534, 1), 65535)
        self.assertEqual(uint16_add(65535, 1), 0)
        self.assertEqual(uint16_add(65535, 3), 2)
github aiortc / aiortc / tests / test_utils.py View on Github external
def test_uint16_add(self):
        self.assertEqual(uint16_add(0, 1), 1)
        self.assertEqual(uint16_add(1, 1), 2)
        self.assertEqual(uint16_add(1, 2), 3)
        self.assertEqual(uint16_add(65534, 1), 65535)
        self.assertEqual(uint16_add(65535, 1), 0)
        self.assertEqual(uint16_add(65535, 3), 2)
github aiortc / aiortc / tests / test_utils.py View on Github external
def test_uint16_add(self):
        self.assertEqual(uint16_add(0, 1), 1)
        self.assertEqual(uint16_add(1, 1), 2)
        self.assertEqual(uint16_add(1, 2), 3)
        self.assertEqual(uint16_add(65534, 1), 65535)
        self.assertEqual(uint16_add(65535, 1), 0)
        self.assertEqual(uint16_add(65535, 3), 2)
github aiortc / aiortc / tests / test_utils.py View on Github external
def test_uint16_add(self):
        self.assertEqual(uint16_add(0, 1), 1)
        self.assertEqual(uint16_add(1, 1), 2)
        self.assertEqual(uint16_add(1, 2), 3)
        self.assertEqual(uint16_add(65534, 1), 65535)
        self.assertEqual(uint16_add(65535, 1), 0)
        self.assertEqual(uint16_add(65535, 3), 2)