func (self *Coder) setCodecParams() { for mkey, mval := range self.Parameter { var o *C.AVOption = nil key := C.CString(mkey) val := C.CString(mval) defer C.free(unsafe.Pointer(key)) defer C.free(unsafe.Pointer(val)) C.av_set_string3(unsafe.Pointer(self.Ctx), key, val, 1, &o) } }
func av_set_string(ctx *CodecContext, key, val string) bool { result := true ckey := C.CString(key) cval := C.CString(val) defer C.free(unsafe.Pointer(ckey)) defer C.free(unsafe.Pointer(cval)) var o *C.AVOption = new(C.AVOption) if C.av_set_string3(unsafe.Pointer(ctx.ctx), ckey, cval, 1, &o) != 0 { result = false if o == nil { fmt.Printf("option for %s not found!\n", key) } //fmt.Printf("Error while setting option '%s' = '%s'\n", key, val) } return result }