Commit ec8069d0 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

CAN_SEND/CAN_RECV payload flags moved to ORTP + use new...

CAN_SEND/CAN_RECV payload flags moved to ORTP + use new find_payload_from_mime_and_flag methods where needed
parent d44b7351
......@@ -38,11 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <mediastreamer2/ms_srtp.h>
#include <mediastreamer2/msequalizer.h>
#define PAYLOAD_TYPE_FLAG_CAN_RECV PAYLOAD_TYPE_USER_FLAG_1
#define PAYLOAD_TYPE_FLAG_CAN_SEND PAYLOAD_TYPE_USER_FLAG_2
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -725,9 +725,9 @@ static void on_cn_received(void *data, MSFilter *f, unsigned int event_id, void
static void setup_generic_confort_noise(AudioStream *stream){
RtpProfile *prof=rtp_session_get_profile(stream->ms.sessions.rtp_session);
PayloadType *pt=rtp_profile_get_payload(prof, rtp_session_get_send_payload_type(stream->ms.sessions.rtp_session));
PayloadType *cn=rtp_profile_find_payload(prof, "CN", 8000, 1);
int cn = rtp_profile_get_payload_number_from_mime_and_flag(prof, "CN", PAYLOAD_TYPE_FLAG_CAN_SEND);
if (cn && pt && pt->channels==1){
if (cn >= 0 && pt && pt->channels==1){
int samplerate = pt->clock_rate;
ms_filter_call_method(stream->ms.decoder, MS_FILTER_GET_SAMPLE_RATE, &samplerate);
if (samplerate == 8000){
......
......@@ -93,15 +93,15 @@ TextStream* text_stream_start(TextStream *stream, RtpProfile *profile, const cha
rtp_session_enable_rtcp(rtps, FALSE);
}
stream->pt_t140 = rtp_profile_get_payload_number_from_mime(profile, "t140");
stream->pt_red = rtp_profile_get_payload_number_from_mime(profile, "red");
stream->pt_t140 = rtp_profile_get_payload_number_from_mime_and_flag(profile, "t140", PAYLOAD_TYPE_FLAG_CAN_SEND);
stream->pt_red = rtp_profile_get_payload_number_from_mime_and_flag(profile, "red", PAYLOAD_TYPE_FLAG_CAN_SEND);
if (payload_type == stream->pt_t140) {
ms_message("Text payload type is T140");
ms_debug("Text payload type is T140");
} else if (payload_type == stream->pt_red) {
ms_message("Text payload type is RED");
ms_debug("Text payload type is RED");
} else {
/* we dont know this kind of textstream... */
ms_warning("unkown type of textstream");
ms_warning("Unknown type of textstream");
}
rtp_session_set_payload_type(rtps, payload_type);
......
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