Library optimized to generate/process sequence of the RTP packets
Project description
librtpsynth
Low-level library optimized to generate and/or consume sequence of the RTP packets. Based on some code and ideas from the RTPProxy projects.
Originally designed to supplement Python code to do low-level bits shuffling for the proof of concept IoT implementation.
Reasonably fast, 100-200x real-time (i.e. 100-200K packets per second) when used from the Python code. 100x of that (10-20M PPS) if used from C code directly.
RTP Generation
Generate continuous sequence of RTP packets of the same payload type.
C API Functions
#include <rtpsynth.h>
-
void *rsynth_ctor(int srate, int ptime);
Initializes the RTP synthesizer with given sample rate and packet time. Returns a handle to be used in other calls. -
void *rsynth_next_pkt(void *ri, int plen, int pt);
Generates the next RTP packet. Takes the handle, packet length, and payload type as parameters. Returns a pointer to the generated packet. -
int rsynth_next_pkt_pa(void *ri, int plen, int pt, char *buf, unsigned int blen, int pa);
Similar torsynth_next_pkt
but allows pre-allocated buffer and packet attributes. Returns the length of the packet generated. -
void rsynth_pkt_free(void *rnp);
Frees the allocated packet. Takes a pointer to the packet as parameter. -
void rsynth_dtor(void *ri);
Destroys the RTP synthesizer and frees resources. Takes the handle as parameter. -
unsigned int rsynth_set_mbt(void *ri, unsigned int new_st);
Sets a new marker bit toggle state. Takes the handle and the new state as parameters. Returns the old state. -
void rsynth_resync(void *ri, struct rsynth_seq *rsp);
Resynchronizes the RTP packet sequence. Takes the handle and optionally a sequence structure as parameters. Use this function when a time discontinuity is expected in packet generation, such as when VAD (Voice Activity Detection) is active. The library will recalculate the timestamp for the next packet based on the current system clock and the time the last packet was generated.
RtpGen (Python)
RTP Parser & Validator / Jitter Buffer
Simple RTP parser and validator to process incoming UDP datagrams, parse & validate RTP headers. Resulting RTP stream is passed through fixed-size jitter buffer to de-duplicate and re-order packets if needed.
rtpjbuf (c)
RtpJBuf (Python)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file rtpsynth-1.1.tar.gz
.
File metadata
- Download URL: rtpsynth-1.1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e372a22b1f1f536ac7bb005564d0e96d0ea95d4e1dfefad4ba9e8c2bafb53ba4 |
|
MD5 | 1800194f590adc05ea05d46dc0a220e3 |
|
BLAKE2b-256 | 02d04e18bd10fcdce91fdb79e96257184e0170ccab4eb4e92788184d0ea60936 |