mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
gdp: 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
This commit is contained in:
parent
e0e93cd3d1
commit
c0fc54e2b4
2 changed files with 15 additions and 2 deletions
|
@ -46,8 +46,17 @@ GST_DEBUG_CATEGORY (data_protocol_debug);
|
||||||
#define POLY 0x1021
|
#define POLY 0x1021
|
||||||
#define CRC_INIT 0xFFFF
|
#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 gboolean initialized = FALSE;
|
||||||
static guint16 crc_table[256];
|
static guint16 crc_table[256];
|
||||||
|
|
|
@ -84,6 +84,10 @@ typedef enum {
|
||||||
|
|
||||||
void gst_dp_init (void);
|
void gst_dp_init (void);
|
||||||
|
|
||||||
|
/* crc checksum */
|
||||||
|
guint16 gst_dp_crc (const guint8 * buffer,
|
||||||
|
guint length);
|
||||||
|
|
||||||
/* payload information from header */
|
/* payload information from header */
|
||||||
guint32 gst_dp_header_payload_length (const guint8 * header);
|
guint32 gst_dp_header_payload_length (const guint8 * header);
|
||||||
GstDPPayloadType
|
GstDPPayloadType
|
||||||
|
|
Loading…
Reference in a new issue