gdp: make gst_dp_crc() public
authorThomas Vander Stichele <thomas@apestaart.org>
Fri, 2 Jun 2006 10:08:31 +0000 (10:08 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sun, 25 Dec 2011 22:49:58 +0000 (22:49 +0000)
Original commit message from CVS:

* 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

gst/gdp/dataprotocol.c
gst/gdp/dataprotocol.h

index ef35a13..c4e06b3 100644 (file)
@@ -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];
index 0f60248..25c09c6 100644 (file)
@@ -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