mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Sample listeners chan (#33)
* switch to sample listeners. * add streamsink total bytes to metrics. * on rtcp to chan. * change logs. * streamsink add real bitrate. * add timing information to sample. * bitrate buckets. * switch to WriteSample.
This commit is contained in:
@ -200,8 +200,8 @@ func CheckPlugins(plugins []string) error {
|
||||
}
|
||||
|
||||
//export goHandlePipelineBuffer
|
||||
func goHandlePipelineBuffer(pipelineID C.int, buf unsafe.Pointer, bufLen C.int, duration C.guint64, deltaUnit C.gboolean) {
|
||||
defer C.free(buf)
|
||||
func goHandlePipelineBuffer(pipelineID C.int, buf C.gpointer, bufLen C.int, duration C.guint64, deltaUnit C.gboolean) {
|
||||
defer C.g_free(buf)
|
||||
|
||||
pipelinesLock.Lock()
|
||||
pipeline, ok := pipelines[int(pipelineID)]
|
||||
@ -209,7 +209,9 @@ func goHandlePipelineBuffer(pipelineID C.int, buf unsafe.Pointer, bufLen C.int,
|
||||
|
||||
if ok {
|
||||
pipeline.sample <- types.Sample{
|
||||
Data: C.GoBytes(buf, bufLen),
|
||||
Data: C.GoBytes(unsafe.Pointer(buf), bufLen),
|
||||
Length: int(bufLen),
|
||||
Timestamp: time.Now(),
|
||||
Duration: time.Duration(duration),
|
||||
DeltaUnit: deltaUnit == C.TRUE,
|
||||
}
|
||||
|
Reference in New Issue
Block a user