Example #1
0
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)
	}

}
Example #2
0
//const Descriptor *avcodec_descriptor_get (enum CodecId id)
func AvcodecDescriptorGet(id CodecId) *Descriptor {
	return (*Descriptor)(C.avcodec_descriptor_get((C.enum_AVCodecID)(id)))
}
Example #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)))
}