diff --git a/ChangeLog b/ChangeLog index 9445785639..c1901fcf6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-02 Thomas Vander Stichele + + * docs/libs/gstreamer-libs-sections.txt: + * docs/libs/tmpl/gstdataprotocol.sgml: + * libs/gst/dataprotocol/dataprotocol.c: (gst_dp_crc): + * libs/gst/dataprotocol/dataprotocol.h: + API: make gst_dp_crc() public + 2006-06-01 Stefan Kost * plugins/indexers/gstindexers.c: (plugin_init): diff --git a/docs/libs/gstreamer-libs-sections.txt b/docs/libs/gstreamer-libs-sections.txt index 03edbf3b01..4b1d3e05ef 100644 --- a/docs/libs/gstreamer-libs-sections.txt +++ b/docs/libs/gstreamer-libs-sections.txt @@ -25,6 +25,8 @@ GST_DP_VERSION_MINOR gst_dp_init +gst_dp_crc + gst_dp_header_payload_length gst_dp_header_payload_type diff --git a/docs/libs/tmpl/gstdataprotocol.sgml b/docs/libs/tmpl/gstdataprotocol.sgml index c5446c903f..b60af0d748 100644 --- a/docs/libs/tmpl/gstdataprotocol.sgml +++ b/docs/libs/tmpl/gstdataprotocol.sgml @@ -78,6 +78,16 @@ network connections also need a protocol to do this. + + + + + +@buffer: +@length: +@Returns: + + diff --git a/libs/gst/dataprotocol/dataprotocol.c b/libs/gst/dataprotocol/dataprotocol.c index 6d062463f2..8453b3c99d 100644 --- a/libs/gst/dataprotocol/dataprotocol.c +++ b/libs/gst/dataprotocol/dataprotocol.c @@ -46,8 +46,17 @@ GST_DEBUG_CATEGORY (data_protocol_debug); #define POLY 0x1021 #define CRC_INIT 0xFFFF -static guint16 -gst_dp_crc (const guint8 * buffer, register guint length) +/** + * gst_dp_crc: + * + * Calculate a CRC for the given buffer over the given number of bytes. + * This is only provided for verification purposes; typical GDP users + * will not need this function. + * + * Returns: a two-byte CRC checksum. + */ +guint16 +gst_dp_crc (const guint8 * buffer, guint length) { static gboolean initialized = FALSE; static guint16 crc_table[256]; diff --git a/libs/gst/dataprotocol/dataprotocol.h b/libs/gst/dataprotocol/dataprotocol.h index 0f6024820b..25c09c6f0e 100644 --- a/libs/gst/dataprotocol/dataprotocol.h +++ b/libs/gst/dataprotocol/dataprotocol.h @@ -84,6 +84,10 @@ typedef enum { void gst_dp_init (void); +/* crc checksum */ +guint16 gst_dp_crc (const guint8 * buffer, + guint length); + /* payload information from header */ guint32 gst_dp_header_payload_length (const guint8 * header); GstDPPayloadType