예제 #1
0
파일: codecDesc.go 프로젝트: jasonmoo/gmf
func InitDesc() {
	var desc *C.struct_AVCodecDescriptor = nil
	var c *C.struct_AVCodec

	if Codecs != nil {
		log.Println("Wrong method call. Map 'Codecs' is already initialized. Ignoring...")
		return
	}

	Codecs = make([]*CodecDescriptor, 0)

	for {
		if c = C.av_codec_next(c); c == nil {
			break
		}

		if desc = C.avcodec_descriptor_get(c.id); desc == nil {
			log.Printf("Unable to get descriptor for codec id: %d\n", int(c.id))
		}

		result := &CodecDescriptor{avDesc: desc, IsEncoder: false}

		if C.av_codec_is_encoder(c) > 0 {
			result.IsEncoder = true
		}

		Codecs = append(Codecs, result)
	}

}
예제 #2
0
파일: avcodec.go 프로젝트: hbdlb/goav
//const Descriptor *avcodec_descriptor_get (enum CodecId id)
func AvcodecDescriptorGet(id CodecId) *Descriptor {
	return (*Descriptor)(C.avcodec_descriptor_get((C.enum_AVCodecID)(id)))
}
예제 #3
0
//const AVCodecDescriptor *avcodec_descriptor_get (enum AVCodecID id)
func Avcodec_descriptor_get(id AVCodecID) *AVCodecDescriptor {
	return (*AVCodecDescriptor)(C.avcodec_descriptor_get((C.enum_AVCodecID)(id)))
}