Browse Source

For RTCPMUX streams we need to filter out RTCP packets selectively from the stream. Original implementation just stops processing packets in JitterBuffer when the first RTCP packet is received in RTCPMUX stream

Closes #1127

Squashed commit of:

commit 23dfb952e7
Author: jakubkarolczyk <51345687+jakubkarolczyk@users.noreply.github.com>
Date:   Fri Dec 4 16:17:00 2020 +0000

    Update jitter_buffer.c

    Changed the way of excluding RTCP from being processed by JB

commit 79f478a30d
Author: Jakub Karolczyk <jakub.karolczyk@gamma.co.uk>
Date:   Wed Dec 23 13:12:44 2020 +0000

    For RTCPMUX streams we need to filter out RTCP packets selectively from the stream. Original implementation just stops processing packets in JitterBuffer when the first RTCP packet is received in RTCPMUX stream

Change-Id: Iad30001a6554630a63474dc069d81aefa93a0bbb
pull/1163/head
Jakub Karolczyk 5 years ago
committed by Richard Fuchs
parent
commit
929c345778
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      daemon/jitter_buffer.c

+ 9
- 3
daemon/jitter_buffer.c View File

@ -4,6 +4,7 @@
#include "call.h" #include "call.h"
#include "codec.h" #include "codec.h"
#include "main.h" #include "main.h"
#include "rtcplib.h"
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
@ -233,7 +234,7 @@ int buffer_packet(struct media_packet *mp, const str *s) {
rwlock_lock_r(&call->master_lock); rwlock_lock_r(&call->master_lock);
struct jitter_buffer *jb = mp->stream->jb; struct jitter_buffer *jb = mp->stream->jb;
if (!jb || jb->disabled || PS_ISSET(mp->sfd->stream, RTCP))
if (!jb || jb->disabled || !PS_ISSET(mp->sfd->stream, RTP))
goto end; goto end;
if(jb->initial_pkts < INITIAL_PACKETS) { //Ignore initial Payload Type 126 if any if(jb->initial_pkts < INITIAL_PACKETS) { //Ignore initial Payload Type 126 if any
@ -245,8 +246,13 @@ int buffer_packet(struct media_packet *mp, const str *s) {
if (!p) if (!p)
goto end; goto end;
ilog(LOG_DEBUG, "Handling JB packet on: %s:%d", sockaddr_print_buf(&mp->stream->endpoint.address),
mp->stream->endpoint.port);
if (PS_ISSET(mp->sfd->stream, RTCP) && rtcp_demux_is_rtcp((void *) &p->mp.raw)){
ilog(LOG_DEBUG, "Discarding from JB. This is RTCP packet. SSRC %u Payload %d", ntohl(p->mp.rtp->ssrc), (p->mp.rtp->m_pt & 0x7f));
goto end;
}
ilog(LOG_DEBUG, "Handling JB packet on: %s:%d (RTP SSRC %u Payload: %d)", sockaddr_print_buf(&mp->stream->endpoint.address),
mp->stream->endpoint.port, ntohl(p->mp.rtp->ssrc), (p->mp.rtp->m_pt & 0x7f));
mp = &p->mp; mp = &p->mp;


Loading…
Cancel
Save