| | |
| | | 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)) |
| | |
| | | } |
| | | |
| | | // 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.longlong |
| | | |
| | | 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 |