Browse Source

TT#92250 ignore format parameters for DTMF codec

closes #1098

Change-Id: I180667a7c5fa9da8a95d99826cb3fc4006598976
(cherry picked from commit ee74914b22)
mr9.0.1
Richard Fuchs 5 years ago
parent
commit
2f5d170720
3 changed files with 15 additions and 0 deletions
  1. +9
    -0
      lib/codeclib.c
  2. +2
    -0
      lib/codeclib.h
  3. +4
    -0
      lib/rtplib.c

+ 9
- 0
lib/codeclib.c View File

@ -62,6 +62,8 @@ static int ilbc_decoder_input(decoder_t *dec, const str *data, GQueue *out);
static const char *dtmf_decoder_init(decoder_t *, const str *);
static int dtmf_decoder_input(decoder_t *dec, const str *data, GQueue *out);
static int format_cmp_ignore(const struct rtp_payload_type *, const struct rtp_payload_type *);
@ -393,6 +395,7 @@ static codec_def_t __codec_defs[] = {
.default_clockrate = 8000,
.default_channels = 1,
.default_fmtp = "0-15",
.format_cmp = format_cmp_ignore,
.codec_type = &codec_type_dtmf,
.support_encoding = 1,
.support_decoding = 1,
@ -1936,3 +1939,9 @@ static int dtmf_decoder_input(decoder_t *dec, const str *data, GQueue *out) {
return 0;
}
static int format_cmp_ignore(const struct rtp_payload_type *a, const struct rtp_payload_type *b) {
return 0;
}

+ 2
- 0
lib/codeclib.h View File

@ -69,6 +69,7 @@ typedef int packetizer_f(AVPacket *, GString *, str *, encoder_t *);
typedef void format_init_f(struct rtp_payload_type *);
typedef void set_enc_options_f(encoder_t *, const str *);
typedef void set_dec_options_f(decoder_t *, const str *);
typedef int format_cmp_f(const struct rtp_payload_type *, const struct rtp_payload_type *);
@ -105,6 +106,7 @@ struct codec_def_s {
const int default_bitrate;
int default_ptime;
const char *default_fmtp;
format_cmp_f * const format_cmp;
packetizer_f * const packetizer;
const int bits_per_sample;
const enum media_type media_type;


+ 4
- 0
lib/rtplib.c View File

@ -145,6 +145,10 @@ const struct rtp_payload_type *rtp_get_rfc_codec(const str *codec) {
int rtp_payload_type_cmp(const struct rtp_payload_type *a, const struct rtp_payload_type *b) {
if (rtp_payload_type_cmp_nf(a, b))
return 1;
if (a->codec_def && a->codec_def == b->codec_def) {
if (a->codec_def->format_cmp)
return a->codec_def->format_cmp(a, b);
}
if (str_cmp_str(&a->format_parameters, &b->format_parameters))
return 1;
return 0;


Loading…
Cancel
Save