From eb81b4bf8ed13253c7799565818e3b48b78fe703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AE=87=E7=BF=94?= <11123448@vivo.xyz> Date: Mon, 1 Mar 2021 09:19:10 +0800 Subject: [PATCH] add encode api --- avcodec/context.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/avcodec/context.go b/avcodec/context.go index 97695d7f..3cedb8b2 100644 --- a/avcodec/context.go +++ b/avcodec/context.go @@ -201,3 +201,11 @@ func (ctxt *Context) AvcodecSendPacket(packet *Packet) int { func (ctxt *Context) AvcodecReceiveFrame(frame *Frame) int { return (int)(C.avcodec_receive_frame((*C.struct_AVCodecContext)(ctxt), (*C.struct_AVFrame)(frame))) } + +func (ctxt *Context) AvcodecReceivePacket(packet *Packet) int { + return (int)(C.avcodec_receive_packet((*C.struct_AVCodecContext)(ctxt), (*C.struct_AVPacket)(packet))) +} + +func (ctxt *Context) AvcodecSendFrame(frame *Frame) int { + return (int)(C.avcodec_send_frame((*C.struct_AVCodecContext)(ctxt), (*C.struct_AVFrame)(frame))) +} \ No newline at end of file