mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-24 18:08:15 +00:00
threadshare: jitterbuffer: Rename C symbols to avoid conflicts with the same symbols from the rtpmanager plugin
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/326 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1140>
This commit is contained in:
parent
2da4701b2a
commit
b3b8d73ce1
6 changed files with 163 additions and 201 deletions
|
@ -57,27 +57,27 @@ pub const RTP_JITTER_BUFFER_MODE_BUFFER: RTPJitterBufferMode = 2;
|
||||||
pub const RTP_JITTER_BUFFER_MODE_SYNCED: RTPJitterBufferMode = 4;
|
pub const RTP_JITTER_BUFFER_MODE_SYNCED: RTPJitterBufferMode = 4;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn rtp_jitter_buffer_new() -> *mut RTPJitterBuffer;
|
pub fn ts_rtp_jitter_buffer_new() -> *mut RTPJitterBuffer;
|
||||||
pub fn rtp_jitter_buffer_get_type() -> GType;
|
pub fn ts_rtp_jitter_buffer_get_type() -> GType;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn rtp_jitter_buffer_get_mode(jbuf: *mut RTPJitterBuffer) -> RTPJitterBufferMode;
|
pub fn ts_rtp_jitter_buffer_get_mode(jbuf: *mut RTPJitterBuffer) -> RTPJitterBufferMode;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn rtp_jitter_buffer_set_mode(jbuf: *mut RTPJitterBuffer, mode: RTPJitterBufferMode);
|
pub fn ts_rtp_jitter_buffer_set_mode(jbuf: *mut RTPJitterBuffer, mode: RTPJitterBufferMode);
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn rtp_jitter_buffer_get_delay(jbuf: *mut RTPJitterBuffer) -> GstClockTime;
|
pub fn ts_rtp_jitter_buffer_get_delay(jbuf: *mut RTPJitterBuffer) -> GstClockTime;
|
||||||
pub fn rtp_jitter_buffer_set_delay(jbuf: *mut RTPJitterBuffer, delay: GstClockTime);
|
pub fn ts_rtp_jitter_buffer_set_delay(jbuf: *mut RTPJitterBuffer, delay: GstClockTime);
|
||||||
pub fn rtp_jitter_buffer_set_clock_rate(jbuf: *mut RTPJitterBuffer, clock_rate: c_uint);
|
pub fn ts_rtp_jitter_buffer_set_clock_rate(jbuf: *mut RTPJitterBuffer, clock_rate: c_uint);
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn rtp_jitter_buffer_get_clock_rate(jbuf: *mut RTPJitterBuffer) -> c_uint;
|
pub fn ts_rtp_jitter_buffer_get_clock_rate(jbuf: *mut RTPJitterBuffer) -> c_uint;
|
||||||
pub fn rtp_jitter_buffer_reset_skew(jbuf: *mut RTPJitterBuffer);
|
pub fn ts_rtp_jitter_buffer_reset_skew(jbuf: *mut RTPJitterBuffer);
|
||||||
|
|
||||||
pub fn rtp_jitter_buffer_flush(jbuf: *mut RTPJitterBuffer, free_func: glib::ffi::GFunc);
|
pub fn ts_rtp_jitter_buffer_flush(jbuf: *mut RTPJitterBuffer, free_func: glib::ffi::GFunc);
|
||||||
pub fn rtp_jitter_buffer_find_earliest(
|
pub fn ts_rtp_jitter_buffer_find_earliest(
|
||||||
jbuf: *mut RTPJitterBuffer,
|
jbuf: *mut RTPJitterBuffer,
|
||||||
pts: *mut GstClockTime,
|
pts: *mut GstClockTime,
|
||||||
seqnum: *mut c_uint,
|
seqnum: *mut c_uint,
|
||||||
);
|
);
|
||||||
pub fn rtp_jitter_buffer_calculate_pts(
|
pub fn ts_rtp_jitter_buffer_calculate_pts(
|
||||||
jbuf: *mut RTPJitterBuffer,
|
jbuf: *mut RTPJitterBuffer,
|
||||||
dts: GstClockTime,
|
dts: GstClockTime,
|
||||||
estimated_dts: gboolean,
|
estimated_dts: gboolean,
|
||||||
|
@ -86,30 +86,30 @@ extern "C" {
|
||||||
gap: c_int,
|
gap: c_int,
|
||||||
is_rtx: gboolean,
|
is_rtx: gboolean,
|
||||||
) -> GstClockTime;
|
) -> GstClockTime;
|
||||||
pub fn rtp_jitter_buffer_insert(
|
pub fn ts_rtp_jitter_buffer_insert(
|
||||||
jbuf: *mut RTPJitterBuffer,
|
jbuf: *mut RTPJitterBuffer,
|
||||||
item: *mut RTPJitterBufferItem,
|
item: *mut RTPJitterBufferItem,
|
||||||
head: *mut gboolean,
|
head: *mut gboolean,
|
||||||
percent: *mut c_int,
|
percent: *mut c_int,
|
||||||
) -> gboolean;
|
) -> gboolean;
|
||||||
pub fn rtp_jitter_buffer_pop(
|
pub fn ts_rtp_jitter_buffer_pop(
|
||||||
jbuf: *mut RTPJitterBuffer,
|
jbuf: *mut RTPJitterBuffer,
|
||||||
percent: *mut c_int,
|
percent: *mut c_int,
|
||||||
) -> *mut RTPJitterBufferItem;
|
) -> *mut RTPJitterBufferItem;
|
||||||
pub fn rtp_jitter_buffer_peek(jbuf: *mut RTPJitterBuffer) -> *mut RTPJitterBufferItem;
|
pub fn ts_rtp_jitter_buffer_peek(jbuf: *mut RTPJitterBuffer) -> *mut RTPJitterBufferItem;
|
||||||
|
|
||||||
pub fn gst_rtp_packet_rate_ctx_reset(ctx: *mut RTPPacketRateCtx, clock_rate: c_int);
|
pub fn ts_gst_rtp_packet_rate_ctx_reset(ctx: *mut RTPPacketRateCtx, clock_rate: c_int);
|
||||||
pub fn gst_rtp_packet_rate_ctx_update(
|
pub fn ts_gst_rtp_packet_rate_ctx_update(
|
||||||
ctx: *mut RTPPacketRateCtx,
|
ctx: *mut RTPPacketRateCtx,
|
||||||
seqnum: c_ushort,
|
seqnum: c_ushort,
|
||||||
ts: c_uint,
|
ts: c_uint,
|
||||||
) -> c_uint;
|
) -> c_uint;
|
||||||
pub fn gst_rtp_packet_rate_ctx_get_max_dropout(
|
pub fn ts_gst_rtp_packet_rate_ctx_get_max_dropout(
|
||||||
ctx: *mut RTPPacketRateCtx,
|
ctx: *mut RTPPacketRateCtx,
|
||||||
time_ms: c_int,
|
time_ms: c_int,
|
||||||
) -> c_uint;
|
) -> c_uint;
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn gst_rtp_packet_rate_ctx_get_max_misorder(
|
pub fn ts_gst_rtp_packet_rate_ctx_get_max_misorder(
|
||||||
ctx: *mut RTPPacketRateCtx,
|
ctx: *mut RTPPacketRateCtx,
|
||||||
time_ms: c_int,
|
time_ms: c_int,
|
||||||
) -> c_uint;
|
) -> c_uint;
|
||||||
|
|
|
@ -32,7 +32,7 @@ glib::wrapper! {
|
||||||
pub struct RTPJitterBuffer(Object<ffi::RTPJitterBuffer>);
|
pub struct RTPJitterBuffer(Object<ffi::RTPJitterBuffer>);
|
||||||
|
|
||||||
match fn {
|
match fn {
|
||||||
type_ => || ffi::rtp_jitter_buffer_get_type(),
|
type_ => || ffi::ts_rtp_jitter_buffer_get_type(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,25 +180,25 @@ impl RTPPacketRateCtx {
|
||||||
pub fn new() -> RTPPacketRateCtx {
|
pub fn new() -> RTPPacketRateCtx {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut ptr = std::mem::MaybeUninit::uninit();
|
let mut ptr = std::mem::MaybeUninit::uninit();
|
||||||
ffi::gst_rtp_packet_rate_ctx_reset(ptr.as_mut_ptr(), -1);
|
ffi::ts_gst_rtp_packet_rate_ctx_reset(ptr.as_mut_ptr(), -1);
|
||||||
RTPPacketRateCtx(Box::new(ptr.assume_init()))
|
RTPPacketRateCtx(Box::new(ptr.assume_init()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reset(&mut self, clock_rate: i32) {
|
pub fn reset(&mut self, clock_rate: i32) {
|
||||||
unsafe { ffi::gst_rtp_packet_rate_ctx_reset(&mut *self.0, clock_rate) }
|
unsafe { ffi::ts_gst_rtp_packet_rate_ctx_reset(&mut *self.0, clock_rate) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, seqnum: u16, ts: u32) -> u32 {
|
pub fn update(&mut self, seqnum: u16, ts: u32) -> u32 {
|
||||||
unsafe { ffi::gst_rtp_packet_rate_ctx_update(&mut *self.0, seqnum, ts) }
|
unsafe { ffi::ts_gst_rtp_packet_rate_ctx_update(&mut *self.0, seqnum, ts) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_dropout(&mut self, time_ms: i32) -> u32 {
|
pub fn max_dropout(&mut self, time_ms: i32) -> u32 {
|
||||||
unsafe { ffi::gst_rtp_packet_rate_ctx_get_max_dropout(&mut *self.0, time_ms) }
|
unsafe { ffi::ts_gst_rtp_packet_rate_ctx_get_max_dropout(&mut *self.0, time_ms) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_misorder(&mut self, time_ms: i32) -> u32 {
|
pub fn max_misorder(&mut self, time_ms: i32) -> u32 {
|
||||||
unsafe { ffi::gst_rtp_packet_rate_ctx_get_max_misorder(&mut *self.0, time_ms) }
|
unsafe { ffi::ts_gst_rtp_packet_rate_ctx_get_max_misorder(&mut *self.0, time_ms) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,38 +219,38 @@ pub enum RTPJitterBufferMode {
|
||||||
|
|
||||||
impl RTPJitterBuffer {
|
impl RTPJitterBuffer {
|
||||||
pub fn new() -> RTPJitterBuffer {
|
pub fn new() -> RTPJitterBuffer {
|
||||||
unsafe { from_glib_full(ffi::rtp_jitter_buffer_new()) }
|
unsafe { from_glib_full(ffi::ts_rtp_jitter_buffer_new()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn mode(&self) -> RTPJitterBufferMode {
|
pub fn mode(&self) -> RTPJitterBufferMode {
|
||||||
unsafe { from_glib(ffi::rtp_jitter_buffer_get_mode(self.to_glib_none().0)) }
|
unsafe { from_glib(ffi::ts_rtp_jitter_buffer_get_mode(self.to_glib_none().0)) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn set_mode(&self, mode: RTPJitterBufferMode) {
|
pub fn set_mode(&self, mode: RTPJitterBufferMode) {
|
||||||
unsafe { ffi::rtp_jitter_buffer_set_mode(self.to_glib_none().0, mode.into_glib()) }
|
unsafe { ffi::ts_rtp_jitter_buffer_set_mode(self.to_glib_none().0, mode.into_glib()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn delay(&self) -> gst::ClockTime {
|
pub fn delay(&self) -> gst::ClockTime {
|
||||||
unsafe {
|
unsafe {
|
||||||
try_from_glib(ffi::rtp_jitter_buffer_get_delay(self.to_glib_none().0))
|
try_from_glib(ffi::ts_rtp_jitter_buffer_get_delay(self.to_glib_none().0))
|
||||||
.expect("undefined delay")
|
.expect("undefined delay")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_delay(&self, delay: gst::ClockTime) {
|
pub fn set_delay(&self, delay: gst::ClockTime) {
|
||||||
unsafe { ffi::rtp_jitter_buffer_set_delay(self.to_glib_none().0, delay.into_glib()) }
|
unsafe { ffi::ts_rtp_jitter_buffer_set_delay(self.to_glib_none().0, delay.into_glib()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_clock_rate(&self, clock_rate: u32) {
|
pub fn set_clock_rate(&self, clock_rate: u32) {
|
||||||
unsafe { ffi::rtp_jitter_buffer_set_clock_rate(self.to_glib_none().0, clock_rate) }
|
unsafe { ffi::ts_rtp_jitter_buffer_set_clock_rate(self.to_glib_none().0, clock_rate) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn clock_rate(&self) -> u32 {
|
pub fn clock_rate(&self) -> u32 {
|
||||||
unsafe { ffi::rtp_jitter_buffer_get_clock_rate(self.to_glib_none().0) }
|
unsafe { ffi::ts_rtp_jitter_buffer_get_clock_rate(self.to_glib_none().0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn calculate_pts(
|
pub fn calculate_pts(
|
||||||
|
@ -263,7 +263,7 @@ impl RTPJitterBuffer {
|
||||||
is_rtx: bool,
|
is_rtx: bool,
|
||||||
) -> Option<gst::ClockTime> {
|
) -> Option<gst::ClockTime> {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::rtp_jitter_buffer_calculate_pts(
|
from_glib(ffi::ts_rtp_jitter_buffer_calculate_pts(
|
||||||
self.to_glib_none().0,
|
self.to_glib_none().0,
|
||||||
dts.into().into_glib(),
|
dts.into().into_glib(),
|
||||||
estimated_dts.into_glib(),
|
estimated_dts.into_glib(),
|
||||||
|
@ -280,7 +280,7 @@ impl RTPJitterBuffer {
|
||||||
let mut head = mem::MaybeUninit::uninit();
|
let mut head = mem::MaybeUninit::uninit();
|
||||||
let mut percent = mem::MaybeUninit::uninit();
|
let mut percent = mem::MaybeUninit::uninit();
|
||||||
let ptr = item.0.take().expect("Invalid wrapper");
|
let ptr = item.0.take().expect("Invalid wrapper");
|
||||||
let ret: bool = from_glib(ffi::rtp_jitter_buffer_insert(
|
let ret: bool = from_glib(ffi::ts_rtp_jitter_buffer_insert(
|
||||||
self.to_glib_none().0,
|
self.to_glib_none().0,
|
||||||
ptr.as_ptr(),
|
ptr.as_ptr(),
|
||||||
head.as_mut_ptr(),
|
head.as_mut_ptr(),
|
||||||
|
@ -298,7 +298,7 @@ impl RTPJitterBuffer {
|
||||||
let mut pts = mem::MaybeUninit::uninit();
|
let mut pts = mem::MaybeUninit::uninit();
|
||||||
let mut seqnum = mem::MaybeUninit::uninit();
|
let mut seqnum = mem::MaybeUninit::uninit();
|
||||||
|
|
||||||
ffi::rtp_jitter_buffer_find_earliest(
|
ffi::ts_rtp_jitter_buffer_find_earliest(
|
||||||
self.to_glib_none().0,
|
self.to_glib_none().0,
|
||||||
pts.as_mut_ptr(),
|
pts.as_mut_ptr(),
|
||||||
seqnum.as_mut_ptr(),
|
seqnum.as_mut_ptr(),
|
||||||
|
@ -319,7 +319,7 @@ impl RTPJitterBuffer {
|
||||||
pub fn pop(&self) -> (Option<RTPJitterBufferItem>, i32) {
|
pub fn pop(&self) -> (Option<RTPJitterBufferItem>, i32) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut percent = mem::MaybeUninit::uninit();
|
let mut percent = mem::MaybeUninit::uninit();
|
||||||
let item = ffi::rtp_jitter_buffer_pop(self.to_glib_none().0, percent.as_mut_ptr());
|
let item = ffi::ts_rtp_jitter_buffer_pop(self.to_glib_none().0, percent.as_mut_ptr());
|
||||||
|
|
||||||
(
|
(
|
||||||
if item.is_null() {
|
if item.is_null() {
|
||||||
|
@ -334,7 +334,7 @@ impl RTPJitterBuffer {
|
||||||
|
|
||||||
pub fn peek(&self) -> (Option<gst::ClockTime>, Option<u16>) {
|
pub fn peek(&self) -> (Option<gst::ClockTime>, Option<u16>) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let item = ffi::rtp_jitter_buffer_peek(self.to_glib_none().0);
|
let item = ffi::ts_rtp_jitter_buffer_peek(self.to_glib_none().0);
|
||||||
if item.is_null() {
|
if item.is_null() {
|
||||||
(None, None)
|
(None, None)
|
||||||
} else {
|
} else {
|
||||||
|
@ -356,12 +356,12 @@ impl RTPJitterBuffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::rtp_jitter_buffer_flush(self.to_glib_none().0, Some(free_item));
|
ffi::ts_rtp_jitter_buffer_flush(self.to_glib_none().0, Some(free_item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn reset_skew(&self) {
|
pub fn reset_skew(&self) {
|
||||||
unsafe { ffi::rtp_jitter_buffer_reset_skew(self.to_glib_none().0) }
|
unsafe { ffi::ts_rtp_jitter_buffer_reset_skew(self.to_glib_none().0) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,10 @@ enum
|
||||||
};
|
};
|
||||||
|
|
||||||
/* GObject vmethods */
|
/* GObject vmethods */
|
||||||
static void rtp_jitter_buffer_finalize (GObject * object);
|
static void ts_rtp_jitter_buffer_finalize (GObject * object);
|
||||||
|
|
||||||
GType
|
GType
|
||||||
rtp_jitter_buffer_mode_get_type (void)
|
ts_rtp_jitter_buffer_mode_get_type (void)
|
||||||
{
|
{
|
||||||
static GType jitter_buffer_mode_type = 0;
|
static GType jitter_buffer_mode_type = 0;
|
||||||
static const GEnumValue jitter_buffer_modes[] = {
|
static const GEnumValue jitter_buffer_modes[] = {
|
||||||
|
@ -67,36 +67,36 @@ rtp_jitter_buffer_mode_get_type (void)
|
||||||
|
|
||||||
/* static guint rtp_jitter_buffer_signals[LAST_SIGNAL] = { 0 }; */
|
/* static guint rtp_jitter_buffer_signals[LAST_SIGNAL] = { 0 }; */
|
||||||
|
|
||||||
G_DEFINE_TYPE (RTPJitterBuffer, rtp_jitter_buffer, G_TYPE_OBJECT);
|
G_DEFINE_TYPE (TsRTPJitterBuffer, ts_rtp_jitter_buffer, G_TYPE_OBJECT);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtp_jitter_buffer_class_init (RTPJitterBufferClass * klass)
|
ts_rtp_jitter_buffer_class_init (TsRTPJitterBufferClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
|
|
||||||
gobject_class->finalize = rtp_jitter_buffer_finalize;
|
gobject_class->finalize = ts_rtp_jitter_buffer_finalize;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (rtp_jitter_buffer_debug, "rtpjitterbuffer", 0,
|
GST_DEBUG_CATEGORY_INIT (rtp_jitter_buffer_debug, "rtpjitterbuffer", 0,
|
||||||
"RTP Jitter Buffer");
|
"RTP Jitter Buffer");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtp_jitter_buffer_init (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_init (TsRTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
g_mutex_init (&jbuf->clock_lock);
|
g_mutex_init (&jbuf->clock_lock);
|
||||||
|
|
||||||
jbuf->packets = g_queue_new ();
|
jbuf->packets = g_queue_new ();
|
||||||
jbuf->mode = RTP_JITTER_BUFFER_MODE_SLAVE;
|
jbuf->mode = RTP_JITTER_BUFFER_MODE_SLAVE;
|
||||||
|
|
||||||
rtp_jitter_buffer_reset_skew (jbuf);
|
ts_rtp_jitter_buffer_reset_skew (jbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtp_jitter_buffer_finalize (GObject * object)
|
ts_rtp_jitter_buffer_finalize (GObject * object)
|
||||||
{
|
{
|
||||||
RTPJitterBuffer *jbuf;
|
TsRTPJitterBuffer *jbuf;
|
||||||
RTPJitterBufferItem *item;
|
RTPJitterBufferItem *item;
|
||||||
|
|
||||||
jbuf = RTP_JITTER_BUFFER_CAST (object);
|
jbuf = RTP_JITTER_BUFFER_CAST (object);
|
||||||
|
@ -127,7 +127,7 @@ rtp_jitter_buffer_finalize (GObject * object)
|
||||||
|
|
||||||
g_mutex_clear (&jbuf->clock_lock);
|
g_mutex_clear (&jbuf->clock_lock);
|
||||||
|
|
||||||
G_OBJECT_CLASS (rtp_jitter_buffer_parent_class)->finalize (object);
|
G_OBJECT_CLASS (ts_rtp_jitter_buffer_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -137,10 +137,10 @@ rtp_jitter_buffer_finalize (GObject * object)
|
||||||
*
|
*
|
||||||
* Returns: a new #RTPJitterBuffer. Use g_object_unref() after usage.
|
* Returns: a new #RTPJitterBuffer. Use g_object_unref() after usage.
|
||||||
*/
|
*/
|
||||||
RTPJitterBuffer *
|
TsRTPJitterBuffer *
|
||||||
rtp_jitter_buffer_new (void)
|
ts_rtp_jitter_buffer_new (void)
|
||||||
{
|
{
|
||||||
RTPJitterBuffer *jbuf;
|
TsRTPJitterBuffer *jbuf;
|
||||||
|
|
||||||
jbuf = g_object_new (RTP_TYPE_JITTER_BUFFER, NULL);
|
jbuf = g_object_new (RTP_TYPE_JITTER_BUFFER, NULL);
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ rtp_jitter_buffer_new (void)
|
||||||
* Returns: the current jitterbuffer mode.
|
* Returns: the current jitterbuffer mode.
|
||||||
*/
|
*/
|
||||||
RTPJitterBufferMode
|
RTPJitterBufferMode
|
||||||
rtp_jitter_buffer_get_mode (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_mode (TsRTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
return jbuf->mode;
|
return jbuf->mode;
|
||||||
}
|
}
|
||||||
|
@ -169,20 +169,20 @@ rtp_jitter_buffer_get_mode (RTPJitterBuffer * jbuf)
|
||||||
* Set the buffering and clock slaving algorithm used in the @jbuf.
|
* Set the buffering and clock slaving algorithm used in the @jbuf.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_mode (RTPJitterBuffer * jbuf, RTPJitterBufferMode mode)
|
ts_rtp_jitter_buffer_set_mode (TsRTPJitterBuffer * jbuf, RTPJitterBufferMode mode)
|
||||||
{
|
{
|
||||||
jbuf->mode = mode;
|
jbuf->mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
GstClockTime
|
GstClockTime
|
||||||
rtp_jitter_buffer_get_delay (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_delay (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
g_print ("%p getting delay (%" G_GUINT64_FORMAT ")\n", jbuf, jbuf->delay);
|
g_print ("%p getting delay (%" G_GUINT64_FORMAT ")\n", jbuf, jbuf->delay);
|
||||||
return jbuf->delay;
|
return jbuf->delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_delay (RTPJitterBuffer * jbuf, GstClockTime delay)
|
ts_rtp_jitter_buffer_set_delay (TsRTPJitterBuffer * jbuf, GstClockTime delay)
|
||||||
{
|
{
|
||||||
jbuf->delay = delay;
|
jbuf->delay = delay;
|
||||||
jbuf->low_level = (delay * 15) / 100;
|
jbuf->low_level = (delay * 15) / 100;
|
||||||
|
@ -203,13 +203,13 @@ rtp_jitter_buffer_set_delay (RTPJitterBuffer * jbuf, GstClockTime delay)
|
||||||
* Set the clock rate in the jitterbuffer.
|
* Set the clock rate in the jitterbuffer.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer * jbuf, guint32 clock_rate)
|
ts_rtp_jitter_buffer_set_clock_rate (TsRTPJitterBuffer * jbuf, guint32 clock_rate)
|
||||||
{
|
{
|
||||||
if (jbuf->clock_rate != clock_rate) {
|
if (jbuf->clock_rate != clock_rate) {
|
||||||
GST_DEBUG ("Clock rate changed from %" G_GUINT32_FORMAT " to %"
|
GST_DEBUG ("Clock rate changed from %" G_GUINT32_FORMAT " to %"
|
||||||
G_GUINT32_FORMAT, jbuf->clock_rate, clock_rate);
|
G_GUINT32_FORMAT, jbuf->clock_rate, clock_rate);
|
||||||
jbuf->clock_rate = clock_rate;
|
jbuf->clock_rate = clock_rate;
|
||||||
rtp_jitter_buffer_reset_skew (jbuf);
|
ts_rtp_jitter_buffer_reset_skew (jbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer * jbuf, guint32 clock_rate)
|
||||||
* Returns: the current clock-rate
|
* Returns: the current clock-rate
|
||||||
*/
|
*/
|
||||||
guint32
|
guint32
|
||||||
rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
return jbuf->clock_rate;
|
return jbuf->clock_rate;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ media_clock_synced_cb (GstClock * clock G_GNUC_UNUSED,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_media_clock (RTPJitterBuffer * jbuf, GstClock * clock,
|
ts_rtp_jitter_buffer_set_media_clock (TsRTPJitterBuffer * jbuf, GstClock * clock,
|
||||||
guint64 clock_offset)
|
guint64 clock_offset)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&jbuf->clock_lock);
|
g_mutex_lock (&jbuf->clock_lock);
|
||||||
|
@ -295,7 +295,7 @@ rtp_jitter_buffer_set_media_clock (RTPJitterBuffer * jbuf, GstClock * clock,
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_pipeline_clock (RTPJitterBuffer * jbuf, GstClock * clock)
|
ts_rtp_jitter_buffer_set_pipeline_clock (TsRTPJitterBuffer * jbuf, GstClock * clock)
|
||||||
{
|
{
|
||||||
g_mutex_lock (&jbuf->clock_lock);
|
g_mutex_lock (&jbuf->clock_lock);
|
||||||
if (jbuf->pipeline_clock)
|
if (jbuf->pipeline_clock)
|
||||||
|
@ -319,13 +319,13 @@ rtp_jitter_buffer_set_pipeline_clock (RTPJitterBuffer * jbuf, GstClock * clock)
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
rtp_jitter_buffer_get_rfc7273_sync (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_rfc7273_sync (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
return jbuf->rfc7273_sync;
|
return jbuf->rfc7273_sync;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_rfc7273_sync (RTPJitterBuffer * jbuf,
|
ts_rtp_jitter_buffer_set_rfc7273_sync (TsRTPJitterBuffer * jbuf,
|
||||||
gboolean rfc7273_sync)
|
gboolean rfc7273_sync)
|
||||||
{
|
{
|
||||||
jbuf->rfc7273_sync = rfc7273_sync;
|
jbuf->rfc7273_sync = rfc7273_sync;
|
||||||
|
@ -338,7 +338,7 @@ rtp_jitter_buffer_set_rfc7273_sync (RTPJitterBuffer * jbuf,
|
||||||
* Reset the skew calculations in @jbuf.
|
* Reset the skew calculations in @jbuf.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_reset_skew (TsRTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
jbuf->base_time = -1;
|
jbuf->base_time = -1;
|
||||||
jbuf->base_rtptime = -1;
|
jbuf->base_rtptime = -1;
|
||||||
|
@ -365,13 +365,13 @@ rtp_jitter_buffer_reset_skew (RTPJitterBuffer * jbuf)
|
||||||
* Enable or disable buffering on @jbuf.
|
* Enable or disable buffering on @jbuf.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_disable_buffering (RTPJitterBuffer * jbuf, gboolean disabled)
|
ts_rtp_jitter_buffer_disable_buffering (TsRTPJitterBuffer * jbuf, gboolean disabled)
|
||||||
{
|
{
|
||||||
jbuf->buffering_disabled = disabled;
|
jbuf->buffering_disabled = disabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
rtp_jitter_buffer_resync (RTPJitterBuffer * jbuf, GstClockTime time,
|
ts_rtp_jitter_buffer_resync (TsRTPJitterBuffer * jbuf, GstClockTime time,
|
||||||
GstClockTime gstrtptime, guint64 ext_rtptime, gboolean reset_skew)
|
GstClockTime gstrtptime, guint64 ext_rtptime, gboolean reset_skew)
|
||||||
{
|
{
|
||||||
jbuf->base_time = time;
|
jbuf->base_time = time;
|
||||||
|
@ -438,7 +438,7 @@ get_buffer_level (RTPJitterBuffer * jbuf)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_buffer_level (RTPJitterBuffer * jbuf, gint * percent)
|
update_buffer_level (TsRTPJitterBuffer * jbuf, gint * percent)
|
||||||
{
|
{
|
||||||
gboolean post = FALSE;
|
gboolean post = FALSE;
|
||||||
guint64 level;
|
guint64 level;
|
||||||
|
@ -587,7 +587,7 @@ calculate_skew (RTPJitterBuffer * jbuf, guint64 ext_rtptime,
|
||||||
if (ABS (delta - jbuf->skew) > GST_SECOND) {
|
if (ABS (delta - jbuf->skew) > GST_SECOND) {
|
||||||
GST_WARNING ("delta - skew: %" GST_TIME_FORMAT " too big, reset skew",
|
GST_WARNING ("delta - skew: %" GST_TIME_FORMAT " too big, reset skew",
|
||||||
GST_TIME_ARGS (ABS (delta - jbuf->skew)));
|
GST_TIME_ARGS (ABS (delta - jbuf->skew)));
|
||||||
rtp_jitter_buffer_resync (jbuf, time, gstrtptime, ext_rtptime, TRUE);
|
ts_rtp_jitter_buffer_resync (jbuf, time, gstrtptime, ext_rtptime, TRUE);
|
||||||
send_diff = 0;
|
send_diff = 0;
|
||||||
delta = 0;
|
delta = 0;
|
||||||
gap = 0;
|
gap = 0;
|
||||||
|
@ -692,7 +692,7 @@ no_skew:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
queue_do_insert (RTPJitterBuffer * jbuf, GList * list, GList * item)
|
queue_do_insert (TsRTPJitterBuffer * jbuf, GList * list, GList * item)
|
||||||
{
|
{
|
||||||
GQueue *queue = jbuf->packets;
|
GQueue *queue = jbuf->packets;
|
||||||
|
|
||||||
|
@ -714,7 +714,7 @@ queue_do_insert (RTPJitterBuffer * jbuf, GList * list, GList * item)
|
||||||
}
|
}
|
||||||
|
|
||||||
GstClockTime
|
GstClockTime
|
||||||
rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
|
ts_rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
|
||||||
gboolean estimated_dts, guint32 rtptime, GstClockTime base_time,
|
gboolean estimated_dts, guint32 rtptime, GstClockTime base_time,
|
||||||
gint gap, gboolean is_rtx)
|
gint gap, gboolean is_rtx)
|
||||||
{
|
{
|
||||||
|
@ -742,7 +742,7 @@ rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
|
||||||
/* reset even if we don't have valid incoming time;
|
/* reset even if we don't have valid incoming time;
|
||||||
* still better than producing possibly very bogus output timestamp */
|
* still better than producing possibly very bogus output timestamp */
|
||||||
GST_WARNING ("rtp delta too big, reset skew");
|
GST_WARNING ("rtp delta too big, reset skew");
|
||||||
rtp_jitter_buffer_reset_skew (jbuf);
|
ts_rtp_jitter_buffer_reset_skew (jbuf);
|
||||||
} else {
|
} else {
|
||||||
GST_WARNING ("rtp delta too big: ignore rtx packet");
|
GST_WARNING ("rtp delta too big: ignore rtx packet");
|
||||||
media_clock = NULL;
|
media_clock = NULL;
|
||||||
|
@ -823,7 +823,7 @@ rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
|
||||||
}
|
}
|
||||||
GST_INFO ("resync to time %" GST_TIME_FORMAT ", rtptime %"
|
GST_INFO ("resync to time %" GST_TIME_FORMAT ", rtptime %"
|
||||||
GST_TIME_FORMAT, GST_TIME_ARGS (dts), GST_TIME_ARGS (gstrtptime));
|
GST_TIME_FORMAT, GST_TIME_ARGS (dts), GST_TIME_ARGS (gstrtptime));
|
||||||
rtp_jitter_buffer_resync (jbuf, dts, gstrtptime, ext_rtptime, FALSE);
|
ts_rtp_jitter_buffer_resync (jbuf, dts, gstrtptime, ext_rtptime, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG ("extrtp %" G_GUINT64_FORMAT ", gstrtp %" GST_TIME_FORMAT ", base %"
|
GST_DEBUG ("extrtp %" G_GUINT64_FORMAT ", gstrtp %" GST_TIME_FORMAT ", base %"
|
||||||
|
@ -973,7 +973,7 @@ rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts,
|
||||||
GST_DEBUG ("out %" GST_TIME_FORMAT " + %" G_GUINT64_FORMAT " < time %"
|
GST_DEBUG ("out %" GST_TIME_FORMAT " + %" G_GUINT64_FORMAT " < time %"
|
||||||
GST_TIME_FORMAT ", reset jitterbuffer and discard", GST_TIME_ARGS (pts),
|
GST_TIME_FORMAT ", reset jitterbuffer and discard", GST_TIME_ARGS (pts),
|
||||||
jbuf->delay, GST_TIME_ARGS (dts));
|
jbuf->delay, GST_TIME_ARGS (dts));
|
||||||
rtp_jitter_buffer_reset_skew (jbuf);
|
ts_rtp_jitter_buffer_reset_skew (jbuf);
|
||||||
pts = GST_CLOCK_TIME_NONE;
|
pts = GST_CLOCK_TIME_NONE;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -1009,7 +1009,7 @@ done:
|
||||||
* Returns: %FALSE if a packet with the same number already existed.
|
* Returns: %FALSE if a packet with the same number already existed.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item,
|
ts_rtp_jitter_buffer_insert (RTPJitterBuffer * jbuf, RTPJitterBufferItem * item,
|
||||||
gboolean * head, gint * percent)
|
gboolean * head, gint * percent)
|
||||||
{
|
{
|
||||||
GList *list, *event = NULL;
|
GList *list, *event = NULL;
|
||||||
|
@ -1102,7 +1102,7 @@ duplicate:
|
||||||
* Returns: a #GstBuffer or %NULL when there was no packet in the queue.
|
* Returns: a #GstBuffer or %NULL when there was no packet in the queue.
|
||||||
*/
|
*/
|
||||||
RTPJitterBufferItem *
|
RTPJitterBufferItem *
|
||||||
rtp_jitter_buffer_pop (RTPJitterBuffer * jbuf, gint * percent)
|
ts_rtp_jitter_buffer_pop (TsRTPJitterBuffer * jbuf, gint * percent)
|
||||||
{
|
{
|
||||||
GList *item = NULL;
|
GList *item = NULL;
|
||||||
GQueue *queue;
|
GQueue *queue;
|
||||||
|
@ -1142,7 +1142,7 @@ rtp_jitter_buffer_pop (RTPJitterBuffer * jbuf, gint * percent)
|
||||||
* Returns: a #GstBuffer or %NULL when there was no packet in the queue.
|
* Returns: a #GstBuffer or %NULL when there was no packet in the queue.
|
||||||
*/
|
*/
|
||||||
RTPJitterBufferItem *
|
RTPJitterBufferItem *
|
||||||
rtp_jitter_buffer_peek (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_peek (TsRTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (jbuf != NULL, NULL);
|
g_return_val_if_fail (jbuf != NULL, NULL);
|
||||||
|
|
||||||
|
@ -1158,7 +1158,7 @@ rtp_jitter_buffer_peek (RTPJitterBuffer * jbuf)
|
||||||
* Flush all packets from the jitterbuffer.
|
* Flush all packets from the jitterbuffer.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_flush (RTPJitterBuffer * jbuf, GFunc free_func,
|
ts_rtp_jitter_buffer_flush (TsRTPJitterBuffer * jbuf, GFunc free_func,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GList *item;
|
GList *item;
|
||||||
|
@ -1180,7 +1180,7 @@ rtp_jitter_buffer_flush (RTPJitterBuffer * jbuf, GFunc free_func,
|
||||||
* Returns: the buffering state of @jbuf
|
* Returns: the buffering state of @jbuf
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
return jbuf->buffering && !jbuf->buffering_disabled;
|
return jbuf->buffering && !jbuf->buffering_disabled;
|
||||||
}
|
}
|
||||||
|
@ -1193,7 +1193,7 @@ rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf)
|
||||||
* Forces @jbuf to go into the buffering state.
|
* Forces @jbuf to go into the buffering state.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_set_buffering (RTPJitterBuffer * jbuf, gboolean buffering)
|
ts_rtp_jitter_buffer_set_buffering (TsRTPJitterBuffer * jbuf, gboolean buffering)
|
||||||
{
|
{
|
||||||
jbuf->buffering = buffering;
|
jbuf->buffering = buffering;
|
||||||
}
|
}
|
||||||
|
@ -1207,7 +1207,7 @@ rtp_jitter_buffer_set_buffering (RTPJitterBuffer * jbuf, gboolean buffering)
|
||||||
* Returns: the buffering percent
|
* Returns: the buffering percent
|
||||||
*/
|
*/
|
||||||
gint
|
gint
|
||||||
rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
gint percent;
|
gint percent;
|
||||||
guint64 level;
|
guint64 level;
|
||||||
|
@ -1234,7 +1234,7 @@ rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf)
|
||||||
* Returns: The number of packets in @jbuf.
|
* Returns: The number of packets in @jbuf.
|
||||||
*/
|
*/
|
||||||
guint
|
guint
|
||||||
rtp_jitter_buffer_num_packets (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_num_packets (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (jbuf != NULL, 0);
|
g_return_val_if_fail (jbuf != NULL, 0);
|
||||||
|
|
||||||
|
@ -1251,7 +1251,7 @@ rtp_jitter_buffer_num_packets (RTPJitterBuffer * jbuf)
|
||||||
* Returns: The difference expressed in the timestamp units of the packets.
|
* Returns: The difference expressed in the timestamp units of the packets.
|
||||||
*/
|
*/
|
||||||
guint32
|
guint32
|
||||||
rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
guint64 high_ts, low_ts;
|
guint64 high_ts, low_ts;
|
||||||
RTPJitterBufferItem *high_buf, *low_buf;
|
RTPJitterBufferItem *high_buf, *low_buf;
|
||||||
|
@ -1288,7 +1288,7 @@ rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer * jbuf)
|
||||||
* Returns: The difference expressed in seqnum.
|
* Returns: The difference expressed in seqnum.
|
||||||
*/
|
*/
|
||||||
static guint16
|
static guint16
|
||||||
rtp_jitter_buffer_get_seqnum_diff (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_get_seqnum_diff (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
guint32 high_seqnum, low_seqnum;
|
guint32 high_seqnum, low_seqnum;
|
||||||
RTPJitterBufferItem *high_buf, *low_buf;
|
RTPJitterBufferItem *high_buf, *low_buf;
|
||||||
|
@ -1338,7 +1338,7 @@ rtp_jitter_buffer_get_seqnum_diff (RTPJitterBuffer * jbuf)
|
||||||
* @last_rtptime.
|
* @last_rtptime.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_get_sync (RTPJitterBuffer * jbuf, guint64 * rtptime,
|
ts_rtp_jitter_buffer_get_sync (TsRTPJitterBuffer * jbuf, guint64 * rtptime,
|
||||||
guint64 * timestamp, guint32 * clock_rate, guint64 * last_rtptime)
|
guint64 * timestamp, guint32 * clock_rate, guint64 * last_rtptime)
|
||||||
{
|
{
|
||||||
if (rtptime)
|
if (rtptime)
|
||||||
|
@ -1362,16 +1362,16 @@ rtp_jitter_buffer_get_sync (RTPJitterBuffer * jbuf, guint64 * rtptime,
|
||||||
* Returns: %TRUE if the required number of consecutive packets was found.
|
* Returns: %TRUE if the required number of consecutive packets was found.
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet)
|
ts_rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet)
|
||||||
{
|
{
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
RTPJitterBufferItem *last_item = NULL, *item;
|
RTPJitterBufferItem *last_item = NULL, *item;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
if (rtp_jitter_buffer_num_packets (jbuf) < (guint) num_packet)
|
if (ts_rtp_jitter_buffer_num_packets (jbuf) < (guint) num_packet)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
item = rtp_jitter_buffer_peek (jbuf);
|
item = ts_rtp_jitter_buffer_peek (jbuf);
|
||||||
for (i = 0; i < num_packet; i++) {
|
for (i = 0; i < num_packet; i++) {
|
||||||
if (G_LIKELY (last_item)) {
|
if (G_LIKELY (last_item)) {
|
||||||
guint16 expected_seqnum = last_item->seqnum + 1;
|
guint16 expected_seqnum = last_item->seqnum + 1;
|
||||||
|
@ -1390,14 +1390,14 @@ rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet)
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
rtp_jitter_buffer_is_full (RTPJitterBuffer * jbuf)
|
ts_rtp_jitter_buffer_is_full (RTPJitterBuffer * jbuf)
|
||||||
{
|
{
|
||||||
return rtp_jitter_buffer_get_seqnum_diff (jbuf) >= 32765 &&
|
return ts_rtp_jitter_buffer_get_seqnum_diff (jbuf) >= 32765 &&
|
||||||
rtp_jitter_buffer_num_packets (jbuf) > 10000;
|
ts_rtp_jitter_buffer_num_packets (jbuf) > 10000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rtp_jitter_buffer_find_earliest (RTPJitterBuffer * jbuf, GstClockTime * pts,
|
ts_rtp_jitter_buffer_find_earliest (TsRTPJitterBuffer * jbuf, GstClockTime * pts,
|
||||||
guint * seqnum)
|
guint * seqnum)
|
||||||
{
|
{
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
|
@ -23,16 +23,16 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/rtp/gstrtcpbuffer.h>
|
#include <gst/rtp/gstrtcpbuffer.h>
|
||||||
|
|
||||||
typedef struct _RTPJitterBuffer RTPJitterBuffer;
|
typedef struct _RTPJitterBuffer TsRTPJitterBuffer;
|
||||||
typedef struct _RTPJitterBufferClass RTPJitterBufferClass;
|
typedef struct _RTPJitterBufferClass TsRTPJitterBufferClass;
|
||||||
typedef struct _RTPJitterBufferItem RTPJitterBufferItem;
|
typedef struct _RTPJitterBufferItem RTPJitterBufferItem;
|
||||||
|
|
||||||
#define RTP_TYPE_JITTER_BUFFER (rtp_jitter_buffer_get_type())
|
#define RTP_TYPE_JITTER_BUFFER (ts_rtp_jitter_buffer_get_type())
|
||||||
#define RTP_JITTER_BUFFER(src) (G_TYPE_CHECK_INSTANCE_CAST((src),RTP_TYPE_JITTER_BUFFER,RTPJitterBuffer))
|
#define RTP_JITTER_BUFFER(src) (G_TYPE_CHECK_INSTANCE_CAST((src),RTP_TYPE_JITTER_BUFFER,TsRTPJitterBuffer))
|
||||||
#define RTP_JITTER_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),RTP_TYPE_JITTER_BUFFER,RTPJitterBufferClass))
|
#define RTP_JITTER_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),RTP_TYPE_JITTER_BUFFER,TsRTPJitterBufferClass))
|
||||||
#define RTP_IS_JITTER_BUFFER(src) (G_TYPE_CHECK_INSTANCE_TYPE((src),RTP_TYPE_JITTER_BUFFER))
|
#define RTP_IS_JITTER_BUFFER(src) (G_TYPE_CHECK_INSTANCE_TYPE((src),RTP_TYPE_JITTER_BUFFER))
|
||||||
#define RTP_IS_JITTER_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),RTP_TYPE_JITTER_BUFFER))
|
#define RTP_IS_JITTER_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),RTP_TYPE_JITTER_BUFFER))
|
||||||
#define RTP_JITTER_BUFFER_CAST(src) ((RTPJitterBuffer *)(src))
|
#define RTP_JITTER_BUFFER_CAST(src) ((TsRTPJitterBuffer *)(src))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RTPJitterBufferMode:
|
* RTPJitterBufferMode:
|
||||||
|
@ -61,8 +61,8 @@ typedef enum {
|
||||||
RTP_JITTER_BUFFER_MODE_LAST
|
RTP_JITTER_BUFFER_MODE_LAST
|
||||||
} RTPJitterBufferMode;
|
} RTPJitterBufferMode;
|
||||||
|
|
||||||
#define RTP_TYPE_JITTER_BUFFER_MODE (rtp_jitter_buffer_mode_get_type())
|
#define RTP_TYPE_JITTER_BUFFER_MODE (ts_rtp_jitter_buffer_mode_get_type())
|
||||||
GType rtp_jitter_buffer_mode_get_type (void);
|
GType ts_rtp_jitter_buffer_mode_get_type (void);
|
||||||
|
|
||||||
#define RTP_JITTER_BUFFER_MAX_WINDOW 512
|
#define RTP_JITTER_BUFFER_MAX_WINDOW 512
|
||||||
/**
|
/**
|
||||||
|
@ -144,58 +144,58 @@ struct _RTPJitterBufferItem {
|
||||||
guint rtptime;
|
guint rtptime;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType rtp_jitter_buffer_get_type (void);
|
GType ts_rtp_jitter_buffer_get_type (void);
|
||||||
|
|
||||||
/* managing lifetime */
|
/* managing lifetime */
|
||||||
RTPJitterBuffer* rtp_jitter_buffer_new (void);
|
TsRTPJitterBuffer* ts_rtp_jitter_buffer_new (void);
|
||||||
|
|
||||||
RTPJitterBufferMode rtp_jitter_buffer_get_mode (RTPJitterBuffer *jbuf);
|
RTPJitterBufferMode ts_rtp_jitter_buffer_get_mode (TsRTPJitterBuffer *jbuf);
|
||||||
void rtp_jitter_buffer_set_mode (RTPJitterBuffer *jbuf, RTPJitterBufferMode mode);
|
void ts_rtp_jitter_buffer_set_mode (TsRTPJitterBuffer *jbuf, RTPJitterBufferMode mode);
|
||||||
|
|
||||||
GstClockTime rtp_jitter_buffer_get_delay (RTPJitterBuffer *jbuf);
|
GstClockTime ts_rtp_jitter_buffer_get_delay (RTPJitterBuffer *jbuf);
|
||||||
void rtp_jitter_buffer_set_delay (RTPJitterBuffer *jbuf, GstClockTime delay);
|
void ts_rtp_jitter_buffer_set_delay (TsRTPJitterBuffer *jbuf, GstClockTime delay);
|
||||||
|
|
||||||
void rtp_jitter_buffer_set_clock_rate (RTPJitterBuffer *jbuf, guint32 clock_rate);
|
void ts_rtp_jitter_buffer_set_clock_rate (TsRTPJitterBuffer *jbuf, guint32 clock_rate);
|
||||||
guint32 rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer *jbuf);
|
guint32 ts_rtp_jitter_buffer_get_clock_rate (RTPJitterBuffer *jbuf);
|
||||||
|
|
||||||
void rtp_jitter_buffer_set_media_clock (RTPJitterBuffer *jbuf, GstClock * clock, guint64 clock_offset);
|
void ts_rtp_jitter_buffer_set_media_clock (TsRTPJitterBuffer *jbuf, GstClock * clock, guint64 clock_offset);
|
||||||
void rtp_jitter_buffer_set_pipeline_clock (RTPJitterBuffer *jbuf, GstClock * clock);
|
void ts_rtp_jitter_buffer_set_pipeline_clock (TsRTPJitterBuffer *jbuf, GstClock * clock);
|
||||||
|
|
||||||
gboolean rtp_jitter_buffer_get_rfc7273_sync (RTPJitterBuffer *jbuf);
|
gboolean ts_rtp_jitter_buffer_get_rfc7273_sync (RTPJitterBuffer *jbuf);
|
||||||
void rtp_jitter_buffer_set_rfc7273_sync (RTPJitterBuffer *jbuf, gboolean rfc7273_sync);
|
void ts_rtp_jitter_buffer_set_rfc7273_sync (TsRTPJitterBuffer *jbuf, gboolean rfc7273_sync);
|
||||||
|
|
||||||
void rtp_jitter_buffer_reset_skew (RTPJitterBuffer *jbuf);
|
void ts_rtp_jitter_buffer_reset_skew (TsRTPJitterBuffer *jbuf);
|
||||||
|
|
||||||
gboolean rtp_jitter_buffer_insert (RTPJitterBuffer *jbuf,
|
gboolean ts_rtp_jitter_buffer_insert (RTPJitterBuffer *jbuf,
|
||||||
RTPJitterBufferItem *item,
|
RTPJitterBufferItem *item,
|
||||||
gboolean *head, gint *percent);
|
gboolean *head, gint *percent);
|
||||||
|
|
||||||
void rtp_jitter_buffer_disable_buffering (RTPJitterBuffer *jbuf, gboolean disabled);
|
void ts_rtp_jitter_buffer_disable_buffering (TsRTPJitterBuffer *jbuf, gboolean disabled);
|
||||||
|
|
||||||
RTPJitterBufferItem * rtp_jitter_buffer_peek (RTPJitterBuffer *jbuf);
|
RTPJitterBufferItem * ts_rtp_jitter_buffer_peek (TsRTPJitterBuffer *jbuf);
|
||||||
RTPJitterBufferItem * rtp_jitter_buffer_pop (RTPJitterBuffer *jbuf, gint *percent);
|
RTPJitterBufferItem * ts_rtp_jitter_buffer_pop (TsRTPJitterBuffer *jbuf, gint *percent);
|
||||||
|
|
||||||
void rtp_jitter_buffer_flush (RTPJitterBuffer *jbuf,
|
void ts_rtp_jitter_buffer_flush (TsRTPJitterBuffer *jbuf,
|
||||||
GFunc free_func, gpointer user_data);
|
GFunc free_func, gpointer user_data);
|
||||||
|
|
||||||
gboolean rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf);
|
gboolean ts_rtp_jitter_buffer_is_buffering (RTPJitterBuffer * jbuf);
|
||||||
void rtp_jitter_buffer_set_buffering (RTPJitterBuffer * jbuf, gboolean buffering);
|
void ts_rtp_jitter_buffer_set_buffering (TsRTPJitterBuffer * jbuf, gboolean buffering);
|
||||||
gint rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf);
|
gint ts_rtp_jitter_buffer_get_percent (RTPJitterBuffer * jbuf);
|
||||||
|
|
||||||
guint rtp_jitter_buffer_num_packets (RTPJitterBuffer *jbuf);
|
guint ts_rtp_jitter_buffer_num_packets (RTPJitterBuffer *jbuf);
|
||||||
guint32 rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer *jbuf);
|
guint32 ts_rtp_jitter_buffer_get_ts_diff (RTPJitterBuffer *jbuf);
|
||||||
|
|
||||||
void rtp_jitter_buffer_get_sync (RTPJitterBuffer *jbuf, guint64 *rtptime,
|
void ts_rtp_jitter_buffer_get_sync (TsRTPJitterBuffer *jbuf, guint64 *rtptime,
|
||||||
guint64 *timestamp, guint32 *clock_rate,
|
guint64 *timestamp, guint32 *clock_rate,
|
||||||
guint64 *last_rtptime);
|
guint64 *last_rtptime);
|
||||||
|
|
||||||
GstClockTime rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts, gboolean estimated_dts,
|
GstClockTime ts_rtp_jitter_buffer_calculate_pts (RTPJitterBuffer * jbuf, GstClockTime dts, gboolean estimated_dts,
|
||||||
guint32 rtptime, GstClockTime base_time, gint gap,
|
guint32 rtptime, GstClockTime base_time, gint gap,
|
||||||
gboolean is_rtx);
|
gboolean is_rtx);
|
||||||
|
|
||||||
gboolean rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet);
|
gboolean ts_rtp_jitter_buffer_can_fast_start (RTPJitterBuffer * jbuf, gint num_packet);
|
||||||
|
|
||||||
gboolean rtp_jitter_buffer_is_full (RTPJitterBuffer * jbuf);
|
gboolean ts_rtp_jitter_buffer_is_full (RTPJitterBuffer * jbuf);
|
||||||
void rtp_jitter_buffer_find_earliest (RTPJitterBuffer * jbuf, GstClockTime *pts, guint * seqnum);
|
void ts_rtp_jitter_buffer_find_earliest (TsRTPJitterBuffer * jbuf, GstClockTime *pts, guint * seqnum);
|
||||||
|
|
||||||
#endif /* __RTP_JITTER_BUFFER_H__ */
|
#endif /* __RTP_JITTER_BUFFER_H__ */
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "rtpstats.h"
|
#include "rtpstats.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_rtp_packet_rate_ctx_reset (RTPPacketRateCtx * ctx, gint32 clock_rate)
|
ts_gst_rtp_packet_rate_ctx_reset (RTPPacketRateCtx * ctx, gint32 clock_rate)
|
||||||
{
|
{
|
||||||
ctx->clock_rate = clock_rate;
|
ctx->clock_rate = clock_rate;
|
||||||
ctx->probed = FALSE;
|
ctx->probed = FALSE;
|
||||||
|
@ -31,7 +31,7 @@ gst_rtp_packet_rate_ctx_reset (RTPPacketRateCtx * ctx, gint32 clock_rate)
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
gst_rtp_packet_rate_ctx_update (RTPPacketRateCtx * ctx, guint16 seqnum,
|
ts_gst_rtp_packet_rate_ctx_update (RTPPacketRateCtx * ctx, guint16 seqnum,
|
||||||
guint32 ts)
|
guint32 ts)
|
||||||
{
|
{
|
||||||
guint64 new_ts, diff_ts;
|
guint64 new_ts, diff_ts;
|
||||||
|
@ -80,13 +80,13 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
gst_rtp_packet_rate_ctx_get (RTPPacketRateCtx * ctx)
|
ts_gst_rtp_packet_rate_ctx_get (RTPPacketRateCtx * ctx)
|
||||||
{
|
{
|
||||||
return ctx->avg_packet_rate;
|
return ctx->avg_packet_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
gst_rtp_packet_rate_ctx_get_max_dropout (RTPPacketRateCtx * ctx, gint32 time_ms)
|
ts_gst_rtp_packet_rate_ctx_get_max_dropout (RTPPacketRateCtx * ctx, gint32 time_ms)
|
||||||
{
|
{
|
||||||
if (time_ms <= 0 || !ctx->probed || ctx->avg_packet_rate == G_MAXUINT32) {
|
if (time_ms <= 0 || !ctx->probed || ctx->avg_packet_rate == G_MAXUINT32) {
|
||||||
return RTP_DEF_DROPOUT;
|
return RTP_DEF_DROPOUT;
|
||||||
|
@ -96,7 +96,7 @@ gst_rtp_packet_rate_ctx_get_max_dropout (RTPPacketRateCtx * ctx, gint32 time_ms)
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
gst_rtp_packet_rate_ctx_get_max_misorder (RTPPacketRateCtx * ctx,
|
ts_gst_rtp_packet_rate_ctx_get_max_misorder (RTPPacketRateCtx * ctx,
|
||||||
gint32 time_ms)
|
gint32 time_ms)
|
||||||
{
|
{
|
||||||
if (time_ms <= 0 || !ctx->probed || ctx->avg_packet_rate == G_MAXUINT32) {
|
if (time_ms <= 0 || !ctx->probed || ctx->avg_packet_rate == G_MAXUINT32) {
|
||||||
|
@ -113,9 +113,9 @@ gst_rtp_packet_rate_ctx_get_max_misorder (RTPPacketRateCtx * ctx,
|
||||||
* Initialize @stats with its default values.
|
* Initialize @stats with its default values.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_stats_init_defaults (RTPSessionStats * stats)
|
ts_rtp_stats_init_defaults (RTPSessionStats * stats)
|
||||||
{
|
{
|
||||||
rtp_stats_set_bandwidths (stats, -1, -1, -1, -1);
|
ts_rtp_stats_set_bandwidths (stats, -1, -1, -1, -1);
|
||||||
stats->min_interval = RTP_STATS_MIN_INTERVAL;
|
stats->min_interval = RTP_STATS_MIN_INTERVAL;
|
||||||
stats->bye_timeout = RTP_STATS_BYE_TIMEOUT;
|
stats->bye_timeout = RTP_STATS_BYE_TIMEOUT;
|
||||||
stats->nacks_dropped = 0;
|
stats->nacks_dropped = 0;
|
||||||
|
@ -136,7 +136,7 @@ rtp_stats_init_defaults (RTPSessionStats * stats)
|
||||||
* defaults.
|
* defaults.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rtp_stats_set_bandwidths (RTPSessionStats * stats, guint rtp_bw,
|
ts_rtp_stats_set_bandwidths (RTPSessionStats * stats, guint rtp_bw,
|
||||||
gdouble rtcp_bw, guint rs, guint rr)
|
gdouble rtcp_bw, guint rs, guint rr)
|
||||||
{
|
{
|
||||||
GST_DEBUG ("recalc bandwidths: RTP %u, RTCP %f, RS %u, RR %u", rtp_bw,
|
GST_DEBUG ("recalc bandwidths: RTP %u, RTCP %f, RS %u, RR %u", rtp_bw,
|
||||||
|
@ -217,7 +217,7 @@ rtp_stats_set_bandwidths (RTPSessionStats * stats, guint rtp_bw,
|
||||||
* Returns: the RTCP interval.
|
* Returns: the RTCP interval.
|
||||||
*/
|
*/
|
||||||
GstClockTime
|
GstClockTime
|
||||||
rtp_stats_calculate_rtcp_interval (RTPSessionStats * stats, gboolean we_send,
|
ts_rtp_stats_calculate_rtcp_interval (RTPSessionStats * stats, gboolean we_send,
|
||||||
GstRTPProfile profile, gboolean ptp, gboolean first)
|
GstRTPProfile profile, gboolean ptp, gboolean first)
|
||||||
{
|
{
|
||||||
gdouble members, senders, n;
|
gdouble members, senders, n;
|
||||||
|
@ -296,7 +296,7 @@ rtp_stats_calculate_rtcp_interval (RTPSessionStats * stats, gboolean we_send,
|
||||||
* Returns: the new RTCP interval.
|
* Returns: the new RTCP interval.
|
||||||
*/
|
*/
|
||||||
GstClockTime
|
GstClockTime
|
||||||
rtp_stats_add_rtcp_jitter (RTPSessionStats * stats G_GNUC_UNUSED,
|
ts_rtp_stats_add_rtcp_jitter (RTPSessionStats * stats G_GNUC_UNUSED,
|
||||||
GstClockTime interval)
|
GstClockTime interval)
|
||||||
{
|
{
|
||||||
gdouble temp;
|
gdouble temp;
|
||||||
|
@ -323,7 +323,7 @@ rtp_stats_add_rtcp_jitter (RTPSessionStats * stats G_GNUC_UNUSED,
|
||||||
* Returns: the BYE interval.
|
* Returns: the BYE interval.
|
||||||
*/
|
*/
|
||||||
GstClockTime
|
GstClockTime
|
||||||
rtp_stats_calculate_bye_interval (RTPSessionStats * stats)
|
ts_rtp_stats_calculate_bye_interval (RTPSessionStats * stats)
|
||||||
{
|
{
|
||||||
gdouble members;
|
gdouble members;
|
||||||
gdouble avg_rtcp_size, rtcp_bw;
|
gdouble avg_rtcp_size, rtcp_bw;
|
||||||
|
@ -377,7 +377,7 @@ rtp_stats_calculate_bye_interval (RTPSessionStats * stats)
|
||||||
* Returns: total RTP packets lost.
|
* Returns: total RTP packets lost.
|
||||||
*/
|
*/
|
||||||
gint64
|
gint64
|
||||||
rtp_stats_get_packets_lost (const RTPSourceStats * stats)
|
ts_rtp_stats_get_packets_lost (const RTPSourceStats * stats)
|
||||||
{
|
{
|
||||||
gint64 lost;
|
gint64 lost;
|
||||||
guint64 extended_max, expected;
|
guint64 extended_max, expected;
|
||||||
|
@ -390,41 +390,7 @@ rtp_stats_get_packets_lost (const RTPSourceStats * stats)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rtp_stats_set_min_interval (RTPSessionStats * stats, gdouble min_interval)
|
ts_rtp_stats_set_min_interval (RTPSessionStats * stats, gdouble min_interval)
|
||||||
{
|
{
|
||||||
stats->min_interval = min_interval;
|
stats->min_interval = min_interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
__g_socket_address_equal (GSocketAddress * a, GSocketAddress * b)
|
|
||||||
{
|
|
||||||
GInetSocketAddress *ia, *ib;
|
|
||||||
GInetAddress *iaa, *iab;
|
|
||||||
|
|
||||||
ia = G_INET_SOCKET_ADDRESS (a);
|
|
||||||
ib = G_INET_SOCKET_ADDRESS (b);
|
|
||||||
|
|
||||||
if (g_inet_socket_address_get_port (ia) !=
|
|
||||||
g_inet_socket_address_get_port (ib))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
iaa = g_inet_socket_address_get_address (ia);
|
|
||||||
iab = g_inet_socket_address_get_address (ib);
|
|
||||||
|
|
||||||
return g_inet_address_equal (iaa, iab);
|
|
||||||
}
|
|
||||||
|
|
||||||
gchar *
|
|
||||||
__g_socket_address_to_string (GSocketAddress * addr)
|
|
||||||
{
|
|
||||||
GInetSocketAddress *ia;
|
|
||||||
gchar *ret, *tmp;
|
|
||||||
|
|
||||||
ia = G_INET_SOCKET_ADDRESS (addr);
|
|
||||||
|
|
||||||
tmp = g_inet_address_to_string (g_inet_socket_address_get_address (ia));
|
|
||||||
ret = g_strdup_printf ("%s:%u", tmp, g_inet_socket_address_get_port (ia));
|
|
||||||
g_free (tmp);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
|
@ -216,11 +216,11 @@ typedef struct {
|
||||||
guint32 avg_packet_rate;
|
guint32 avg_packet_rate;
|
||||||
} RTPPacketRateCtx;
|
} RTPPacketRateCtx;
|
||||||
|
|
||||||
void gst_rtp_packet_rate_ctx_reset (RTPPacketRateCtx * ctx, gint32 clock_rate);
|
void ts_gst_rtp_packet_rate_ctx_reset (RTPPacketRateCtx * ctx, gint32 clock_rate);
|
||||||
guint32 gst_rtp_packet_rate_ctx_update (RTPPacketRateCtx *ctx, guint16 seqnum, guint32 ts);
|
guint32 ts_gst_rtp_packet_rate_ctx_update (RTPPacketRateCtx *ctx, guint16 seqnum, guint32 ts);
|
||||||
guint32 gst_rtp_packet_rate_ctx_get (RTPPacketRateCtx *ctx);
|
guint32 ts_gst_rtp_packet_rate_ctx_get (RTPPacketRateCtx *ctx);
|
||||||
guint32 gst_rtp_packet_rate_ctx_get_max_dropout (RTPPacketRateCtx *ctx, gint32 time_ms);
|
guint32 ts_gst_rtp_packet_rate_ctx_get_max_dropout (RTPPacketRateCtx *ctx, gint32 time_ms);
|
||||||
guint32 gst_rtp_packet_rate_ctx_get_max_misorder (RTPPacketRateCtx *ctx, gint32 time_ms);
|
guint32 ts_gst_rtp_packet_rate_ctx_get_max_misorder (RTPPacketRateCtx *ctx, gint32 time_ms);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RTPSessionStats:
|
* RTPSessionStats:
|
||||||
|
@ -245,23 +245,19 @@ typedef struct {
|
||||||
guint nacks_received;
|
guint nacks_received;
|
||||||
} RTPSessionStats;
|
} RTPSessionStats;
|
||||||
|
|
||||||
void rtp_stats_init_defaults (RTPSessionStats *stats);
|
void ts_rtp_stats_init_defaults (RTPSessionStats *stats);
|
||||||
|
|
||||||
void rtp_stats_set_bandwidths (RTPSessionStats *stats,
|
void ts_rtp_stats_set_bandwidths (RTPSessionStats *stats,
|
||||||
guint rtp_bw,
|
guint rtp_bw,
|
||||||
gdouble rtcp_bw,
|
gdouble rtcp_bw,
|
||||||
guint rs, guint rr);
|
guint rs, guint rr);
|
||||||
|
|
||||||
GstClockTime rtp_stats_calculate_rtcp_interval (RTPSessionStats *stats, gboolean sender, GstRTPProfile profile, gboolean ptp, gboolean first);
|
GstClockTime ts_rtp_stats_calculate_rtcp_interval (RTPSessionStats *stats, gboolean sender, GstRTPProfile profile, gboolean ptp, gboolean first);
|
||||||
GstClockTime rtp_stats_add_rtcp_jitter (RTPSessionStats *stats, GstClockTime interval);
|
GstClockTime ts_rtp_stats_add_rtcp_jitter (RTPSessionStats *stats, GstClockTime interval);
|
||||||
GstClockTime rtp_stats_calculate_bye_interval (RTPSessionStats *stats);
|
GstClockTime ts_rtp_stats_calculate_bye_interval (RTPSessionStats *stats);
|
||||||
gint64 rtp_stats_get_packets_lost (const RTPSourceStats *stats);
|
gint64 ts_rtp_stats_get_packets_lost (const RTPSourceStats *stats);
|
||||||
|
|
||||||
void rtp_stats_set_min_interval (RTPSessionStats *stats,
|
void ts_rtp_stats_set_min_interval (RTPSessionStats *stats,
|
||||||
gdouble min_interval);
|
gdouble min_interval);
|
||||||
|
|
||||||
|
|
||||||
gboolean __g_socket_address_equal (GSocketAddress *a, GSocketAddress *b);
|
|
||||||
gchar * __g_socket_address_to_string (GSocketAddress * addr);
|
|
||||||
|
|
||||||
#endif /* __RTP_STATS_H__ */
|
#endif /* __RTP_STATS_H__ */
|
||||||
|
|
Loading…
Reference in a new issue