func FindEncoder(i interface{}) (*Codec, error) { var avc *C.AVCodec switch t := i.(type) { case string: cname := C.CString(i.(string)) defer C.free(unsafe.Pointer(cname)) avc = C.avcodec_find_encoder_by_name(cname) break case int: avc = C.avcodec_find_encoder(uint32(i.(int))) break default: return nil, errors.New(fmt.Sprintf("Unable to find codec, unexpected arguments type '%v'", t)) } if avc == nil { return nil, errors.New(fmt.Sprintf("Unable to find codec by value '%v'", i)) } return &Codec{avCodec: avc}, nil }
func avcodec_find_encoder_by_name(name string) _Codec { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) return _Codec{codec: C.avcodec_find_encoder_by_name(cname)} }
//Find a registered encoder with the specified name. func AvcodecFindEncoderByName(c string) *Codec { return (*Codec)(C.avcodec_find_encoder_by_name(C.CString(c))) }
//Find a registered encoder with the specified name. //AVCodec *avcodec_find_encoder_by_name (const char *name) func Avcodec_find_encoder_by_name(c string) *AVCodec { return (*AVCodec)(C.avcodec_find_encoder_by_name(C.CString(c))) }