Commit e41f455d authored by jehan's avatar jehan

add silk support

parent 3256179b
......@@ -192,8 +192,12 @@ VAR_DECLSPEC PayloadType payload_type_amrwb;
VAR_DECLSPEC PayloadType payload_type_truespeech;
VAR_DECLSPEC PayloadType payload_type_evrc0;
VAR_DECLSPEC PayloadType payload_type_evrcb0;
VAR_DECLSPEC PayloadType payload_type_silk_nb;
VAR_DECLSPEC PayloadType payload_type_silk_mb;
VAR_DECLSPEC PayloadType payload_type_silk_wb;
VAR_DECLSPEC PayloadType payload_type_silk_swb;
/* video */
/* video */
VAR_DECLSPEC PayloadType payload_type_mpv;
VAR_DECLSPEC PayloadType payload_type_h261;
VAR_DECLSPEC PayloadType payload_type_h263;
......
......@@ -403,7 +403,7 @@ void rtp_session_enable_network_simulation(RtpSession *session, const OrtpNetwor
void rtp_session_rtcp_set_lost_packet_value( RtpSession *session, const unsigned int value );
void rtp_session_rtcp_set_jitter_value(RtpSession *session, const unsigned int value );
void rtp_session_rtcp_set_delay_value(RtpSession *session, const unsigned int value );
mblk_t * rtp_session_pick_with_cseq (RtpSession * session, const uint16_t sequence_number);
/*private */
void rtp_session_init(RtpSession *session, int mode);
#define rtp_session_set_flag(session,flag) (session)->flags|=(flag)
......
......@@ -590,4 +590,47 @@ PayloadType payload_type_g722={
CHANNELS(1)
};
PayloadType payload_type_silk_nb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(8000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE(10000),
MIME_TYPE ("SILK"),
CHANNELS(1)
};
PayloadType payload_type_silk_mb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(12000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE(15000),
MIME_TYPE ("SILK"),
CHANNELS(1)
};
PayloadType payload_type_silk_wb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(16000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE(20000),
MIME_TYPE ("SILK"),
CHANNELS(1)
};
PayloadType payload_type_silk_swb={
TYPE( PAYLOAD_AUDIO_PACKETIZED),
CLOCK_RATE(24000),
BITS_PER_SAMPLE( 0),
ZERO_PATTERN(NULL),
PATTERN_LENGTH( 0),
NORMAL_BITRATE(30000),
MIME_TYPE ("SILK"),
CHANNELS(1)
};
......@@ -963,7 +963,30 @@ static void payload_type_changed_notify(RtpSession *session, int paytype){
rtp_signal_table_emit (&session->on_payload_type_changed);
}
}
/**
* Try to get an rtp packet presented as a mblk_t structure from the rtp session at a given sequence number.
* This function is very usefull for codec with Forward error correction capabilities
*
* This function returns the entire packet (with header).
*
* *
* @param session a rtp session.
* @param sequence_number a sequence number.
*
* @return a rtp packet presented as a mblk_t, or NULL if not found.
**/
mblk_t *
rtp_session_pick_with_cseq (RtpSession * session, const uint16_t sequence_number) {
queue_t* q= &session->rtp.rq;
mblk_t* mb;
for (mb=qbegin(q); !qend(q,mb); mb=qnext(q,mb)){
if (rtp_get_seqnumber(mb)==sequence_number) {
return mb;
}
}
return NULL;
}
/**
* Try to get a rtp packet presented as a mblk_t structure from the rtp session.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment