RTP payloads and profiles

Name

RTP payloads and profiles -- 

Synopsis


#include <payloadtype.h>


            PayloadType;
            RtpProfile;
extern      RtpProfile av_profile;
#define     rtp_profile_get_name            (profile)
#define     rtp_profile_set_name            (profile,nm)
#define     rtp_profile_set_payload         (profile,index,pt)
#define     rtp_profile_get_payload         (profile,index)
#define     rtp_profile_clear_payload       (profile,index)
#define     rtp_profile_clear_all           (profile)

Description

Details

PayloadType

typedef struct {
	gint type;
	#define PAYLOAD_AUDIO_CONTINUOUS 0
	#define PAYLOAD_AUDIO_PACKETIZED 1
	#define	PAYLOAD_VIDEO 2
	#define PAYLOAD_OTHER 3  /* ?? */
	gint clock_rate;
	double bytes_per_sample;		/* in case of continuous audio data */
	char *zero_pattern;
	gint pattern_length;
	/* other usefull information */
	gint normal_bitrate;	/*in bit/s */
	char *mime_type;
	PayloadTypeFlags flags;
	void *user_data;
} PayloadType;


RtpProfile

typedef struct {
	char *name;
	PayloadType *payload[127];
} RtpProfile;


av_profile

extern RtpProfile av_profile;


rtp_profile_get_name()

#define rtp_profile_get_name(profile) 	(profile)->name

profile :

a rtp profile object (RtpProfile)


rtp_profile_set_name()

#define rtp_profile_set_name(profile,nm) 	(profile)->name=(nm)

Set a name to the rtp profile. (This is not required)

profile :

a rtp profile object (RtpProfile)

nm :

a string


rtp_profile_set_payload()

#define rtp_profile_set_payload(profile,index,pt)  (profile)->payload[(index)]=(pt)

Assign payload type number index to payload type desribed in pt for the RTP profile profile.

profile :

an RTP profile (a RtpProfile object)

index :

the payload type number

pt :

the payload type description (a PayloadType object )


rtp_profile_get_payload()

#define rtp_profile_get_payload(profile,index)	((profile)->payload[(index)])

Gets the payload description of the payload type index in the profile profile.

profile :

an RTP profile (a RtpProfile object)

index :

the payload type number


rtp_profile_clear_payload()

#define rtp_profile_clear_payload(profile,index)	(profile)->payload[(index)]=NULL

Set payload type number index unassigned in profile profile.

profile :

an RTP profile (a RtpProfile object)

index :

the payload type number


rtp_profile_clear_all()

#define rtp_profile_clear_all(profile)	memset((void*)(profile),0,sizeof(RtpProfile))

Initialize the profile to the empty profile (all payload type are unassigned).

profile :

an RTP profile (RtpProfile object)