2022-07-16 23:13:50 +00:00
|
|
|
//go:build cgo
|
|
|
|
|
|
|
|
package packetizer
|
|
|
|
|
|
|
|
/*
|
|
|
|
#cgo CFLAGS: -march=native -Ofast -std=c99
|
|
|
|
#include "ogg_crc.h"
|
|
|
|
*/
|
|
|
|
import "C"
|
2023-04-09 11:10:30 +00:00
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
2022-07-16 23:13:50 +00:00
|
|
|
|
|
|
|
func oggCrc32(p []byte) uint32 {
|
2022-10-03 09:34:56 +00:00
|
|
|
defer runtime.KeepAlive(p)
|
2023-04-09 11:10:30 +00:00
|
|
|
return uint32(C.ogg_crc32((*C.uint8_t)(unsafe.SliceData(p)), C.size_t(len(p))))
|
2022-07-16 23:13:50 +00:00
|
|
|
}
|