Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
ortp
Commits
7283d835
Commit
7283d835
authored
Jan 21, 2010
by
Simon Morlat
Browse files
add api to change ssrc_changed_thres.
parent
305f3368
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/ortp/ortp.h
View file @
7283d835
...
...
@@ -64,8 +64,8 @@
#ifndef ORTP_H
#define ORTP_H
#include
<
ortp/rtpsession.h
>
#include
<
ortp/sessionset.h
>
#include
"
ortp/rtpsession.h
"
#include
"
ortp/sessionset.h
"
#ifdef __cplusplus
extern
"C"
...
...
include/ortp/rtpsession.h
View file @
7283d835
...
...
@@ -99,7 +99,7 @@ typedef struct _RtpTransport
typedef
struct
_RtpStream
{
ortp_socket_t
socket
;
struct
_RtpTransport
*
tr
;
struct
_RtpTransport
*
tr
;
int
sockfamily
;
int
max_rq_size
;
int
time_jump
;
...
...
@@ -145,14 +145,14 @@ typedef struct _RtpStream
int
send_errno
;
int
snd_socket_size
;
int
rcv_socket_size
;
int
ssrc_changed_thres
;
}
RtpStream
;
typedef
struct
_RtcpStream
{
ortp_socket_t
socket
;
int
sockfamily
;
struct
_RtpTransport
*
tr
;
struct
_RtpTransport
*
tr
;
mblk_t
*
cached_mp
;
#ifdef ORTP_INET6
struct
sockaddr_storage
rem_addr
;
...
...
@@ -302,6 +302,8 @@ void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno);
void
rtp_session_enable_rtcp
(
RtpSession
*
session
,
bool_t
yesno
);
void
rtp_session_set_ssrc_changed_threshold
(
RtpSession
*
session
,
int
numpackets
);
/*low level recv and send functions */
mblk_t
*
rtp_session_recvm_with_ts
(
RtpSession
*
session
,
uint32_t
user_ts
);
mblk_t
*
rtp_session_create_packet
(
RtpSession
*
session
,
int
header_size
,
const
uint8_t
*
payload
,
int
payload_size
);
...
...
src/rtpparse.c
View file @
7283d835
...
...
@@ -18,13 +18,11 @@
*/
#include
<
ortp/ortp.h
>
#include
"
ortp/ortp.h
"
#include "jitterctl.h"
#include "utils.h"
#include "rtpsession_priv.h"
#define SSRC_CHANGED_THRESHOLD 50
static
void
queue_packet
(
queue_t
*
q
,
int
maxrqsz
,
mblk_t
*
mp
,
rtp_header_t
*
rtp
,
int
*
discarded
)
{
mblk_t
*
tmp
;
...
...
@@ -135,7 +133,7 @@ void rtp_session_rtp_parse(RtpSession *session, mblk_t *mp, uint32_t local_str_t
session
->
inc_same_ssrc_count
=
0
;
session
->
inc_ssrc_candidate
=
rtp
->
ssrc
;
}
if
(
session
->
inc_same_ssrc_count
>
SSRC_CHANGED_THRESHOLD
){
if
(
session
->
inc_same_ssrc_count
>
=
session
->
rtp
.
ssrc_changed_thres
){
/* store the sender rtp address to do symmetric RTP */
if
(
!
session
->
use_connect
){
...
...
src/rtpsession.c
View file @
7283d835
...
...
@@ -246,6 +246,7 @@ rtp_session_init (RtpSession * session, int mode)
#else
session
->
rtp
.
snd_socket_size
=
session
->
rtp
.
rcv_socket_size
=
65536
;
#endif
session
->
rtp
.
ssrc_changed_thres
=
50
;
session
->
dscp
=
RTP_DEFAULT_DSCP
;
session
->
multicast_ttl
=
RTP_DEFAULT_MULTICAST_TTL
;
session
->
multicast_loopback
=
RTP_DEFAULT_MULTICAST_LOOPBACK
;
...
...
@@ -1334,6 +1335,14 @@ void rtp_session_uninit (RtpSession * session)
msgb_allocator_uninit
(
&
session
->
allocator
);
}
/**
* Sets the number of packets containg a new SSRC that will trigger the
* "ssrc_changed" callback.
**/
void
rtp_session_set_ssrc_changed_threshold
(
RtpSession
*
session
,
int
numpackets
){
session
->
rtp
.
ssrc_changed_thres
=
numpackets
;
}
/**
* Resynchronize to the incoming RTP streams.
* This can be useful to handle discoutinuous timestamps.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment