Browse Source

TT#122401 rename "lost packet" functions to DTX

Change-Id: Ie39ff68eb0be8bf77f1b6c213df837c08fc869b7
rfuchs/1283
Richard Fuchs 5 years ago
parent
commit
7c3982ea11
3 changed files with 12 additions and 12 deletions
  1. +2
    -2
      daemon/codec.c
  2. +7
    -7
      lib/codeclib.c
  3. +3
    -3
      lib/codeclib.h

+ 2
- 2
daemon/codec.c View File

@ -2580,7 +2580,7 @@ static void __dtx_send_later(struct timerthread_queue *ttq, void *p) {
// synthetic packet
mp_copy.rtp->seq_num += htons(1);
ret = decoder_lost_packet(ch->decoder, ts,
ret = decoder_dtx(ch->decoder, ts,
ch->handler->packet_decoded, ch, &mp_copy);
if (ret)
ilogs(dtx, LOG_WARN | LOG_FLAG_LIMIT,
@ -2642,7 +2642,7 @@ static void __dtx_free(void *p) {
mutex_destroy(&dtxb->lock);
}
static void __dtx_setup(struct codec_ssrc_handler *ch) {
if (!ch->handler->source_pt.codec_def->packet_lost || ch->dtx_buffer)
if (!ch->handler->source_pt.codec_def->dtx || ch->dtx_buffer)
return;
if (!rtpe_config.dtx_delay)


+ 7
- 7
lib/codeclib.c View File

@ -61,7 +61,7 @@ static int cn_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 *);
static int amr_packet_lost(decoder_t *, GQueue *);
static int amr_dtx(decoder_t *, GQueue *);
@ -374,7 +374,7 @@ static codec_def_t __codec_defs[] = {
.codec_type = &codec_type_amr,
.set_enc_options = amr_set_enc_options,
.set_dec_options = amr_set_dec_options,
.packet_lost = amr_packet_lost,
.dtx = amr_dtx,
},
{
.rtpname = "AMR-WB",
@ -392,7 +392,7 @@ static codec_def_t __codec_defs[] = {
.codec_type = &codec_type_amr,
.set_enc_options = amr_set_enc_options,
.set_dec_options = amr_set_dec_options,
.packet_lost = amr_packet_lost,
.dtx = amr_dtx,
},
{
.rtpname = "telephone-event",
@ -690,7 +690,7 @@ static int __decoder_input_data(decoder_t *dec, const str *data, unsigned long t
if (G_UNLIKELY(!dec))
return -1;
if (!data && !dec->def->packet_lost)
if (!data && !dec->def->dtx)
return 0;
ts *= dec->def->clockrate_mult;
@ -719,7 +719,7 @@ static int __decoder_input_data(decoder_t *dec, const str *data, unsigned long t
if (data)
dec->def->codec_type->decoder_input(dec, data, &frames);
else
dec->def->packet_lost(dec, &frames);
dec->def->dtx(dec, &frames);
AVFrame *frame;
int ret = 0;
@ -745,7 +745,7 @@ int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
return 0;
return __decoder_input_data(dec, data, ts, callback, u1, u2);
}
int decoder_lost_packet(decoder_t *dec, unsigned long ts,
int decoder_dtx(decoder_t *dec, unsigned long ts,
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2)
{
return __decoder_input_data(dec, NULL, ts, callback, u1, u2);
@ -2113,7 +2113,7 @@ static int packetizer_amr(AVPacket *pkt, GString *buf, str *output, encoder_t *e
return 0;
}
static int amr_packet_lost(decoder_t *dec, GQueue *out) {
static int amr_dtx(decoder_t *dec, GQueue *out) {
ilog(LOG_DEBUG, "pushing empty/lost frame to AMR decoder");
unsigned char frame_buf[1];
frame_buf[0] = 0xf << 3; // no data


+ 3
- 3
lib/codeclib.h View File

@ -72,7 +72,7 @@ typedef void format_init_f(struct rtp_payload_type *);
typedef void set_enc_options_f(encoder_t *, const str *, const str *);
typedef void set_dec_options_f(decoder_t *, const str *, const str *);
typedef int format_cmp_f(const struct rtp_payload_type *, const struct rtp_payload_type *);
typedef int packet_lost_f(decoder_t *, GQueue *);
typedef int decoder_dtx_f(decoder_t *, GQueue *);
@ -137,7 +137,7 @@ struct codec_def_s {
format_init_f *init;
set_enc_options_f *set_enc_options;
set_dec_options_f *set_dec_options;
packet_lost_f *packet_lost;
decoder_dtx_f *dtx;
// filled in by codeclib_init()
str rtpname_str;
@ -280,7 +280,7 @@ decoder_t *decoder_new_fmtp(const codec_def_t *def, int clockrate, int channels,
void decoder_close(decoder_t *dec);
int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2);
int decoder_lost_packet(decoder_t *dec, unsigned long ts,
int decoder_dtx(decoder_t *dec, unsigned long ts,
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2);


Loading…
Cancel
Save