Exemple #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)
	}

}
Exemple #2
0
func (c *Codec) AvCodecIsEncoder() int {
	return int(C.av_codec_is_encoder((*C.struct_AVCodec)(c)))
}
Exemple #3
0
//int 	av_codec_is_encoder (const AVCodec *codec)
func Av_codec_is_encoder(c *AVCodec) int {
	return int(C.av_codec_is_encoder((*C.struct_AVCodec)(c)))
}