예제 #1
0
파일: codecCtx.go 프로젝트: 0x46616c6b/gmf
func NewCodecCtx(codec *Codec, options ...[]*Option) *CodecCtx {
	result := &CodecCtx{codec: codec}

	codecctx := C.avcodec_alloc_context3(codec.avCodec)
	if codecctx == nil {
		return nil
	}

	C.avcodec_get_context_defaults3(codecctx, codec.avCodec)

	result.avCodecCtx = codecctx

	// we're really expecting only one options-array —
	// variadic arg is used for backward compatibility
	if len(options) == 1 {
		for _, option := range options[0] {
			option.Set(result.avCodecCtx)
		}
	}

	return result
}
예제 #2
0
파일: context.go 프로젝트: gale320/goav
//Set the fields of the given Context to default values corresponding to the given codec (defaults may be codec-dependent).
func (ctxt *Context) AvcodecGetContextDefaults3(c *Codec) int {
	return int(C.avcodec_get_context_defaults3((*C.struct_AVCodecContext)(ctxt), (*C.struct_AVCodec)(c)))
}
예제 #3
0
//Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaults may be codec-dependent).
//int 	avcodec_get_context_defaults3 (AVCodecContext *s, const AVCodec *codec)
func Avcodec_get_context_defaults3(ctxt *AVCodecContext, c *AVCodec) int {
	return int(C.avcodec_get_context_defaults3((*C.struct_AVCodecContext)(ctxt), (*C.struct_AVCodec)(c)))
}