rtp: fix headers

indent, add padding, remove old abidata
This commit is contained in:
Wim Taymans 2011-11-11 19:21:09 +01:00
parent 370dca92d5
commit 107d5a3d05
7 changed files with 54 additions and 56 deletions

View file

@ -211,7 +211,7 @@ gboolean gst_rtcp_buffer_get_first_packet (GstRTCPBuffer *rtcp, GstRTCPP
gboolean gst_rtcp_packet_move_to_next (GstRTCPPacket *packet);
gboolean gst_rtcp_buffer_add_packet (GstRTCPBuffer *rtcp, GstRTCPType type,
GstRTCPPacket *packet);
GstRTCPPacket *packet);
gboolean gst_rtcp_packet_remove (GstRTCPPacket *packet);
/* working with packets */
@ -224,10 +224,10 @@ guint16 gst_rtcp_packet_get_length (GstRTCPPacket *packet);
/* sender reports */
void gst_rtcp_packet_sr_get_sender_info (GstRTCPPacket *packet, guint32 *ssrc,
guint64 *ntptime, guint32 *rtptime,
guint32 *packet_count, guint32 *octet_count);
guint32 *packet_count, guint32 *octet_count);
void gst_rtcp_packet_sr_set_sender_info (GstRTCPPacket *packet, guint32 ssrc,
guint64 ntptime, guint32 rtptime,
guint32 packet_count, guint32 octet_count);
guint32 packet_count, guint32 octet_count);
/* receiver reports */
guint32 gst_rtcp_packet_rr_get_ssrc (GstRTCPPacket *packet);
void gst_rtcp_packet_rr_set_ssrc (GstRTCPPacket *packet, guint32 ssrc);
@ -236,17 +236,17 @@ void gst_rtcp_packet_rr_set_ssrc (GstRTCPPacket *packet, gu
/* report blocks for SR and RR */
guint gst_rtcp_packet_get_rb_count (GstRTCPPacket *packet);
void gst_rtcp_packet_get_rb (GstRTCPPacket *packet, guint nth, guint32 *ssrc,
guint8 *fractionlost, gint32 *packetslost,
guint32 *exthighestseq, guint32 *jitter,
guint32 *lsr, guint32 *dlsr);
guint8 *fractionlost, gint32 *packetslost,
guint32 *exthighestseq, guint32 *jitter,
guint32 *lsr, guint32 *dlsr);
gboolean gst_rtcp_packet_add_rb (GstRTCPPacket *packet, guint32 ssrc,
guint8 fractionlost, gint32 packetslost,
guint32 exthighestseq, guint32 jitter,
guint32 lsr, guint32 dlsr);
guint8 fractionlost, gint32 packetslost,
guint32 exthighestseq, guint32 jitter,
guint32 lsr, guint32 dlsr);
void gst_rtcp_packet_set_rb (GstRTCPPacket *packet, guint nth, guint32 ssrc,
guint8 fractionlost, gint32 packetslost,
guint32 exthighestseq, guint32 jitter,
guint32 lsr, guint32 dlsr);
guint8 fractionlost, gint32 packetslost,
guint32 exthighestseq, guint32 jitter,
guint32 lsr, guint32 dlsr);
/* source description packet */
guint gst_rtcp_packet_sdes_get_item_count (GstRTCPPacket *packet);
@ -257,10 +257,10 @@ gboolean gst_rtcp_packet_sdes_first_entry (GstRTCPPacket *packet);
gboolean gst_rtcp_packet_sdes_next_entry (GstRTCPPacket *packet);
gboolean gst_rtcp_packet_sdes_get_entry (GstRTCPPacket *packet,
GstRTCPSDESType *type, guint8 *len,
guint8 **data);
guint8 **data);
gboolean gst_rtcp_packet_sdes_copy_entry (GstRTCPPacket *packet,
GstRTCPSDESType *type, guint8 *len,
guint8 **data);
guint8 **data);
gboolean gst_rtcp_packet_sdes_add_item (GstRTCPPacket *packet, guint32 ssrc);
gboolean gst_rtcp_packet_sdes_add_entry (GstRTCPPacket *packet, GstRTCPSDESType type,

View file

@ -662,8 +662,8 @@ gst_rtp_base_audio_payload_get_lengths (GstRTPBasePayload *
/* check cached values */
if (G_LIKELY (priv->cached_mtu == mtu
&& priv->cached_ptime_multiple ==
basepayload->abidata.ABI.ptime_multiple
&& priv->cached_ptime == basepayload->abidata.ABI.ptime
basepayload->ptime_multiple
&& priv->cached_ptime == basepayload->ptime
&& priv->cached_max_ptime == basepayload->max_ptime
&& priv->cached_min_ptime == basepayload->min_ptime)) {
/* if nothing changed, return cached values */
@ -674,7 +674,7 @@ gst_rtp_base_audio_payload_get_lengths (GstRTPBasePayload *
}
ptime_mult_octets = priv->time_to_bytes (payload,
basepayload->abidata.ABI.ptime_multiple);
basepayload->ptime_multiple);
*align = ALIGN_DOWN (MAX (priv->align, ptime_mult_octets), priv->align);
/* ptime max */
@ -700,9 +700,9 @@ gst_rtp_base_audio_payload_get_lengths (GstRTPBasePayload *
*min_payload_len = *max_payload_len;
/* If the ptime is specified in the caps, tried to adhere to it exactly */
if (basepayload->abidata.ABI.ptime) {
if (basepayload->ptime) {
guint ptime_in_bytes = priv->time_to_bytes (payload,
basepayload->abidata.ABI.ptime);
basepayload->ptime);
/* clip to computed min and max lengths */
ptime_in_bytes = MAX (*min_payload_len, ptime_in_bytes);
@ -713,10 +713,10 @@ gst_rtp_base_audio_payload_get_lengths (GstRTPBasePayload *
/* cache values */
priv->cached_mtu = mtu;
priv->cached_ptime = basepayload->abidata.ABI.ptime;
priv->cached_ptime = basepayload->ptime;
priv->cached_min_ptime = basepayload->min_ptime;
priv->cached_max_ptime = basepayload->max_ptime;
priv->cached_ptime_multiple = basepayload->abidata.ABI.ptime_multiple;
priv->cached_ptime_multiple = basepayload->ptime_multiple;
priv->cached_min_length = *min_payload_len;
priv->cached_max_length = *max_payload_len;
priv->cached_align = *align;

View file

@ -59,7 +59,7 @@ struct _GstRTPBaseDepayload
/*< private >*/
GstRTPBaseDepayloadPrivate *priv;
gpointer _gst_reserved[GST_PADDING-1];
gpointer _gst_reserved[GST_PADDING];
};
/**
@ -97,7 +97,7 @@ struct _GstRTPBaseDepayloadClass
gboolean (*handle_event) (GstRTPBaseDepayload * filter, GstEvent * event);
/*< private >*/
gpointer _gst_reserved[GST_PADDING-2];
gpointer _gst_reserved[GST_PADDING];
};
GType gst_rtp_base_depayload_get_type (void);

View file

@ -288,7 +288,7 @@ gst_rtp_base_payload_init (GstRTPBasePayload * rtpbasepayload, gpointer g_class)
rtpbasepayload->max_ptime = DEFAULT_MAX_PTIME;
rtpbasepayload->min_ptime = DEFAULT_MIN_PTIME;
rtpbasepayload->priv->perfect_rtptime = DEFAULT_PERFECT_RTPTIME;
rtpbasepayload->abidata.ABI.ptime_multiple = DEFAULT_PTIME_MULTIPLE;
rtpbasepayload->ptime_multiple = DEFAULT_PTIME_MULTIPLE;
rtpbasepayload->priv->base_offset = GST_BUFFER_OFFSET_NONE;
rtpbasepayload->priv->base_rtime = GST_BUFFER_OFFSET_NONE;
@ -553,7 +553,7 @@ gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
}
payload->priv->caps_max_ptime = DEFAULT_MAX_PTIME;
payload->abidata.ABI.ptime = 0;
payload->ptime = 0;
/* the peer caps can override some of the defaults */
peercaps = gst_pad_peer_get_caps (payload->srcpad, srccaps);
@ -593,7 +593,7 @@ gst_rtp_base_payload_set_outcaps (GstRTPBasePayload * payload,
payload->priv->caps_max_ptime = max_ptime * GST_MSECOND;
if (gst_structure_get_uint (s, "ptime", &ptime))
payload->abidata.ABI.ptime = ptime * GST_MSECOND;
payload->ptime = ptime * GST_MSECOND;
if (gst_structure_get_int (s, "payload", &pt)) {
/* use peer pt */
@ -946,7 +946,7 @@ gst_rtp_base_payload_set_property (GObject * object, guint prop_id,
priv->perfect_rtptime = g_value_get_boolean (value);
break;
case PROP_PTIME_MULTIPLE:
rtpbasepayload->abidata.ABI.ptime_multiple = g_value_get_int64 (value);
rtpbasepayload->ptime_multiple = g_value_get_int64 (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -1005,7 +1005,7 @@ gst_rtp_base_payload_get_property (GObject * object, guint prop_id,
g_value_set_boolean (value, priv->perfect_rtptime);
break;
case PROP_PTIME_MULTIPLE:
g_value_set_int64 (value, rtpbasepayload->abidata.ABI.ptime_multiple);
g_value_set_int64 (value, rtpbasepayload->ptime_multiple);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);

View file

@ -102,17 +102,13 @@ struct _GstRTPBasePayload
GstSegment segment;
guint64 min_ptime;
guint64 ptime; /* in ns */
guint64 ptime_multiple; /* in ns */
/*< private >*/
GstRTPBasePayloadPrivate *priv;
union {
struct {
guint64 ptime; /* in ns */
guint64 ptime_multiple; /* in ns */
} ABI;
gpointer _gst_reserved[GST_PADDING - (sizeof(guint64)/sizeof(gpointer)) - 1];
} abidata;
gpointer _gst_reserved[GST_PADDING];
};
/**

View file

@ -112,8 +112,8 @@ void gst_rtp_buffer_set_seq (GstRTPBuffer *rtp, guint16
guint32 gst_rtp_buffer_get_timestamp (GstRTPBuffer *rtp);
void gst_rtp_buffer_set_timestamp (GstRTPBuffer *rtp, guint32 timestamp);
GstBuffer* gst_rtp_buffer_get_payload_buffer (GstRTPBuffer *rtp);
GstBuffer* gst_rtp_buffer_get_payload_subbuffer (GstRTPBuffer *rtp, guint offset, guint len);
GstBuffer* gst_rtp_buffer_get_payload_buffer (GstRTPBuffer *rtp);
GstBuffer* gst_rtp_buffer_get_payload_subbuffer (GstRTPBuffer *rtp, guint offset, guint len);
guint gst_rtp_buffer_get_payload_len (GstRTPBuffer *rtp);
gpointer gst_rtp_buffer_get_payload (GstRTPBuffer *rtp);

View file

@ -182,6 +182,8 @@ struct _GstRTPPayloadInfo
guint clock_rate;
const gchar *encoding_parameters;
guint bitrate;
gpointer _gst_reserved[GST_PADDING];
};
const GstRTPPayloadInfo * gst_rtp_payload_info_for_pt (guint8 payload_type);