#ifndef __RTP_ULPFEC_COMMON_H__
#define __RTP_ULPFEC_COMMON_H__
-#include <gst/rtp/gstrtpbuffer.h>
+#include <gst/gst.h>
+#include <gst/rtp/rtp.h>
G_BEGIN_DECLS
#define RTP_ULPFEC_SEQ_BASE_OFFSET_MAX(L) (RTP_ULPFEC_PROTECTED_PACKETS_MAX(L) - 1)
/**
- * RtpUlpFecMapInfo: Helper wraper around GstRTPBuffer
+ * RtpUlpFecMapInfo: Helper wrapper around GstRTPBuffer
*
* @rtp: mapped RTP buffer
**/
typedef struct {
- // FIXME: it used to contain more fileds now we are left with only GstRTPBuffer.
+ // FIXME: it used to contain more fields now we are left with only GstRTPBuffer.
// it will be nice to use it directly
GstRTPBuffer rtp;
} RtpUlpFecMapInfo;
+/* FIXME: parse/write these properly instead of relying in packed structs */
+#ifdef _MSC_VER
+#pragma pack(push, 1)
+#define ATTRIBUTE_PACKED
+#else
+#define ATTRIBUTE_PACKED __attribute__ ((packed))
+#endif
+
/* RFC 5109 */
/*
0 1 2 3
guint16 seq;
guint32 timestamp;
guint16 len;
-} __attribute__ ((packed)) RtpUlpFecHeader;
+} ATTRIBUTE_PACKED RtpUlpFecHeader;
#else
typedef struct {
guint8 E:1;
guint16 seq;
guint32 timestamp;
guint16 len;
-} __attribute__ ((packed)) RtpUlpFecHeader;
+} ATTRIBUTE_PACKED RtpUlpFecHeader;
#endif
/*
guint16 protection_len;
guint16 mask;
guint32 mask_continued;
-} __attribute__ ((packed)) RtpUlpFecLevelHeader;
+} ATTRIBUTE_PACKED RtpUlpFecLevelHeader;
+
+#ifdef _MSC_VER
+#pragma pack(pop)
+#else
+#undef ATTRIBUTE_PACKED
+#endif
gboolean rtp_ulpfec_map_info_map (GstBuffer *buffer, RtpUlpFecMapInfo *info);
void rtp_ulpfec_map_info_unmap (RtpUlpFecMapInfo *info);
GstBuffer * rtp_ulpfec_bitstring_to_fec_rtp_buffer (GArray *arr, guint16 seq_base, gboolean fec_mask_long,
guint64 fec_mask, gboolean marker, guint8 pt, guint16 seq,
guint32 timestamp, guint32 ssrc);
+
+#ifndef GST_DISABLE_GST_DEBUG
void rtp_ulpfec_log_rtppacket (GstDebugCategory * cat, GstDebugLevel level,
gpointer object, const gchar *name,
GstRTPBuffer *rtp);
+
void rtp_ulpfec_log_fec_packet (GstDebugCategory * cat, GstDebugLevel level,
gpointer object, GstRTPBuffer *fecrtp);
+#else
+#define rtp_ulpfec_log_rtppacket(cat,level,obj,name,rtp) /* NOOP */
+#define rtp_ulpfec_log_fec_packet(cat,level,obj,fecrtp) /* NOOP */
+#endif
+
RtpUlpFecHeader * rtp_ulpfec_buffer_get_fechdr (GstRTPBuffer *rtp);
guint rtp_ulpfec_get_headers_len (gboolean fec_mask_long);
guint16 rtp_ulpfec_hdr_get_protection_len (RtpUlpFecHeader const *fec_hdr);