示例#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
//If c is NULL, returns the first registered codec, if c is non-NULL,
func (c *Codec) AvCodecNext() *Codec {
	return (*Codec)(C.av_codec_next((*C.struct_AVCodec)(c)))
}
示例#3
0
//If c is NULL, returns the first registered codec, if c is non-NULL,
//returns the next registered codec after c, or NULL if c is the last one.
//AVCodec *av_codec_next (const AVCodec *c)
func Av_codec_next(c *AVCodec) *AVCodec {
	return (*AVCodec)(C.av_codec_next((*C.struct_AVCodec)(c)))
}