-
注册设备 :
avdevice_register_all(); -
设置采集方式: avfoundation / dshow / alsa , 分别对应iOS、windows、Linux平台
AVInputFormat *iformat = av_find_input_format("avfoundation"); -
打开音频设备
int ret = 0;char errors[1024] = {0, };AVFormatContext *fmt_ctx = NULL;AVDictionary *options = NULL;char *devicename = ":0";ret = avformat_open_input(&fmt_ctx, devicename, iformat, &options);