From 3865e167716a1cb04da3f8c30acdcb3f5950a195 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Fri, 2 Jun 2006 10:08:31 +0000 Subject: [PATCH] API: make gst_dp_crc() public 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 --- ChangeLog | 8 ++++++++ docs/libs/gstreamer-libs-sections.txt | 2 ++ docs/libs/tmpl/gstdataprotocol.sgml | 10 ++++++++++ libs/gst/dataprotocol/dataprotocol.c | 13 +++++++++++-- libs/gst/dataprotocol/dataprotocol.h | 4 ++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9445785..c1901fc 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 03edbf3..4b1d3e0 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 c5446c9..b60af0d 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 6d06246..8453b3c 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 0f60248..25c09c6 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 -- 2.7.4