Esempio n. 1
0
func open_codec_context(stream_idx *C.int, fmt_ctx *C.AVFormatContext, mtype C.enum_AVMediaType) C.int {
	if ret := C.av_find_best_stream(fmt_ctx, mtype, -1, -1, nil, 0); ret < 0 {
		log.Printf("Could not find %s stream in input file", C.GoString(C.av_get_media_type_string(mtype)))
		return ret
	} else {
		*stream_idx = ret
	}
	return 0
}
Esempio n. 2
0
//const char * 	av_get_media_type_string (enum AVMediaType media_type)
//Return a string describing the media_type enum, NULL if media_type is unknown.
func Av_get_media_type_string(mt AVMediaType) string {
	return C.GoString(C.av_get_media_type_string((C.enum_AVMediaType)(mt)))
}