MT#65420 support setting marker from packetizer

Change-Id: Icbaa3b874e0afcd3bd9ca06e6c8b684ee2312542
pull/2169/head
Richard Fuchs 1 week ago
parent a46a49ba06
commit 6448f3765d

@ -232,7 +232,7 @@ struct codec_ssrc_handler {
uint64_t skip_pts;
bool rtp_mark:1;
bool rtp_mark;
};
struct transcode_packet {
seq_packet_t p; // must be first
@ -4596,7 +4596,7 @@ void packet_encoded_packetize(AVPacket *pkt, struct codec_ssrc_handler *ch, stru
ilogs(transcoding, LOG_DEBUG, "Adding %i bytes to packetizer", in_pkt->size);
int64_t pts, duration;
int ret = pktzer->fn(in_pkt, &inout, ch->bytes_per_packet, pkt_f_data, &pts,
&duration);
&duration, &ch->rtp_mark);
if (G_UNLIKELY(ret == -1 || pts == AV_NOPTS_VALUE)) {
// nothing

@ -527,7 +527,7 @@ static void amr_encoder_got_packet(encoder_t *enc) {
enc->avc.amr.pkt_seq++;
}
static int packetizer_amr_fn(AVPacket *pkt, str *output, size_t num_bytes, encoder_t *enc,
int64_t *__restrict pts, int64_t *__restrict duration)
int64_t *__restrict pts, int64_t *__restrict duration, bool *mark)
{
assert(pkt->size >= 1);

@ -847,7 +847,7 @@ static int encoder_input_fifo(encoder_t *enc, AVFrame *frame,
static int packetizer_passthrough_fn(AVPacket *pkt, str *output, size_t num_bytes, encoder_t *enc,
int64_t *__restrict pts, int64_t *__restrict duration)
int64_t *__restrict pts, int64_t *__restrict duration, bool *mark)
{
if (!pkt)
return -1;
@ -871,7 +871,7 @@ packetizer_t packetizer_passthrough = {
// returns: -1 = not enough data, nothing returned; 0 = returned a packet;
// 1 = returned a packet and there's more
static int packetizer_samplestream_fn(AVPacket *pkt, str *input_output, size_t num_bytes,
encoder_t *enc, int64_t *__restrict pts, int64_t *__restrict duration)
encoder_t *enc, int64_t *__restrict pts, int64_t *__restrict duration, bool *mark)
{
GString *buf = enc->sample_buffer;

@ -107,7 +107,7 @@ typedef struct dtx_method_s dtx_method_t;
typedef struct codec_cc_s codec_cc_t;
typedef int packetizer_f(AVPacket *, str *, size_t, encoder_t *,
int64_t *__restrict pts, int64_t *__restrict dur);
int64_t *__restrict pts, int64_t *__restrict dur, bool *mark);
typedef void format_init_f(struct rtp_payload_type *);
typedef bool set_enc_options_f(encoder_t *, const str *);
typedef void set_dec_options_f(decoder_t *, const str *);

@ -216,7 +216,7 @@ static void bcg729_encoder_close(encoder_t *enc) {
}
static int packetizer_g729_fn(AVPacket *pkt, str *input_output, size_t num_bytes, encoder_t *enc,
int64_t *__restrict pts, int64_t *__restrict duration)
int64_t *__restrict pts, int64_t *__restrict duration, bool *mark)
{
GString *buf = enc->sample_buffer;
@ -225,7 +225,7 @@ static int packetizer_g729_fn(AVPacket *pkt, str *input_output, size_t num_bytes
// easiest case: we only want one frame. return what we got
if (want_frames == 1 && pkt)
return packetizer_passthrough.fn(pkt, input_output, num_bytes, enc, pts, duration);
return packetizer_passthrough.fn(pkt, input_output, num_bytes, enc, pts, duration, mark);
// any other case, we go through our buffer
str output = *input_output; // remaining output buffer

@ -24,7 +24,8 @@ static int dec_cb(encoder_t *e, void *u1, void *u2) {
char payload[plen];
str inout = STR_LEN(payload, plen);
int64_t pts, dur;
e->def->packetizer->fn(e->avpkt, &inout, plen, e, &pts, &dur);
bool mark;
e->def->packetizer->fn(e->avpkt, &inout, plen, e, &pts, &dur, &mark);
if (inout.len != *expect_len
|| memcmp(inout.s, *expect, *expect_len))

Loading…
Cancel
Save