From 4eab3ca9bf020df2bb53fa2a36aa4f57d684225c Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期三, 07 八月 2019 17:25:03 +0800 Subject: [PATCH] add rec notify, try catch --- goffmpeg.go | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/goffmpeg.go b/goffmpeg.go index 8569084..d79d0ba 100644 --- a/goffmpeg.go +++ b/goffmpeg.go @@ -160,6 +160,7 @@ return int(i), path } +// GetRecID get rec id func (h *GoFFMPEG) GetRecID(p string) string { pt := C.CString(p) defer C.free(unsafe.Pointer(pt)) @@ -179,20 +180,21 @@ } // GetPicDecoder get pic from decoder -func (h *GoFFMPEG) GetPicDecoder() ([]byte, int, int) { +func (h *GoFFMPEG) GetPicDecoder() ([]byte, int, int, int64) { var width C.int var height C.int + var fid C.long - p := C.wrap_fn_decoder_pic(h.ffmpeg, &width, &height) + p := C.wrap_fn_decoder_pic(h.ffmpeg, &width, &height, &fid) if width == 0 && height == 0 { - return nil, 0, 0 + return nil, 0, 0, 0 } defer C.free(unsafe.Pointer(p)) d := C.GoBytes(p, width*height*3) wid := int(width) hei := int(height) - - return d, wid, hei + gfid := int64(fid) + return d, wid, hei, gfid } //GetAVPacket get AVPacket -- Gitblit v1.8.0