2 * Copyright (C) 2019 Pexip (http://pexip.com/)
3 * @author: Havard Graff <havard@pexip.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef __RTP_TWCC_H__
22 #define __RTP_TWCC_H__
25 #include <gst/rtp/rtp.h>
28 typedef struct _RTPTWCCPacket RTPTWCCPacket;
29 typedef enum _RTPTWCCPacketStatus RTPTWCCPacketStatus;
31 G_DECLARE_FINAL_TYPE (RTPTWCCManager, rtp_twcc_manager, RTP, TWCC_MANAGER, GObject)
32 #define RTP_TYPE_TWCC_MANAGER (rtp_twcc_manager_get_type())
33 #define RTP_TWCC_MANAGER_CAST(obj) ((RTPTWCCManager *)(obj))
35 enum _RTPTWCCPacketStatus
37 RTP_TWCC_PACKET_STATUS_NOT_RECV = 0,
38 RTP_TWCC_PACKET_STATUS_SMALL_DELTA = 1,
39 RTP_TWCC_PACKET_STATUS_LARGE_NEGATIVE_DELTA = 2,
44 GstClockTime local_ts;
45 GstClockTime remote_ts;
46 GstClockTimeDiff local_delta;
47 GstClockTimeDiff remote_delta;
48 GstClockTimeDiff delta_delta;
49 RTPTWCCPacketStatus status;
54 RTPTWCCManager * rtp_twcc_manager_new (guint mtu);
56 void rtp_twcc_manager_set_mtu (RTPTWCCManager * twcc, guint mtu);
58 gboolean rtp_twcc_manager_recv_packet (RTPTWCCManager * twcc,
59 guint16 seqnum, RTPPacketInfo * pinfo);
61 void rtp_twcc_manager_send_packet (RTPTWCCManager * twcc,
62 guint16 seqnum, RTPPacketInfo * pinfo);
63 void rtp_twcc_manager_set_send_packet_ts (RTPTWCCManager * twcc,
64 guint packet_id, GstClockTime ts);
66 GstBuffer * rtp_twcc_manager_get_feedback (RTPTWCCManager * twcc,
69 GArray * rtp_twcc_manager_parse_fci (RTPTWCCManager * twcc,
70 guint8 * fci_data, guint fci_length);
72 #endif /* __RTP_TWCC_H__ */