|
|
|
|
@ -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_dtx(decoder_t *, GQueue *);
|
|
|
|
|
static int amr_dtx(decoder_t *, GQueue *, int);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -682,7 +682,7 @@ err:
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int __decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
|
|
|
|
|
static int __decoder_input_data(decoder_t *dec, const str *data, unsigned long ts, int ptime,
|
|
|
|
|
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2)
|
|
|
|
|
{
|
|
|
|
|
GQueue frames = G_QUEUE_INIT;
|
|
|
|
|
@ -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->dtx(dec, &frames);
|
|
|
|
|
dec->def->dtx(dec, &frames, ptime);
|
|
|
|
|
|
|
|
|
|
AVFrame *frame;
|
|
|
|
|
int ret = 0;
|
|
|
|
|
@ -743,12 +743,12 @@ int decoder_input_data(decoder_t *dec, const str *data, unsigned long ts,
|
|
|
|
|
{
|
|
|
|
|
if (!data || !data->s || !data->len)
|
|
|
|
|
return 0;
|
|
|
|
|
return __decoder_input_data(dec, data, ts, callback, u1, u2);
|
|
|
|
|
return __decoder_input_data(dec, data, ts, 0, callback, u1, u2);
|
|
|
|
|
}
|
|
|
|
|
int decoder_dtx(decoder_t *dec, unsigned long ts,
|
|
|
|
|
int decoder_dtx(decoder_t *dec, unsigned long ts, int ptime,
|
|
|
|
|
int (*callback)(decoder_t *, AVFrame *, void *u1, void *u2), void *u1, void *u2)
|
|
|
|
|
{
|
|
|
|
|
return __decoder_input_data(dec, NULL, ts, callback, u1, u2);
|
|
|
|
|
return __decoder_input_data(dec, NULL, ts, ptime, callback, u1, u2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2113,7 +2113,8 @@ static int packetizer_amr(AVPacket *pkt, GString *buf, str *output, encoder_t *e
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
static int amr_dtx(decoder_t *dec, GQueue *out) {
|
|
|
|
|
static int amr_dtx(decoder_t *dec, GQueue *out, int ptime) {
|
|
|
|
|
// ignore ptime, must be 20
|
|
|
|
|
ilog(LOG_DEBUG, "pushing empty/lost frame to AMR decoder");
|
|
|
|
|
unsigned char frame_buf[1];
|
|
|
|
|
frame_buf[0] = 0xf << 3; // no data
|
|
|
|
|
|