Esempio n. 1
0
int ffmpeg_pthread_map_init(void)
{
	pidlist.max_items = 16;
	pidlist.item_ext_buf_size = 4;
	pidlist.muti_threads_access = 1;
	pidlist.reject_same_item_data = 1;
	itemlist_init(&pidlist);
	return 0;
}
ptslist_mgr_t *ptslist_alloc(int flags)
{
    ptslist_mgr_t *mgr = av_mallocz(sizeof(ptslist_mgr_t));
    if (!mgr) {
        av_log(NULL, AV_LOG_INFO, "alloc_ptslist-fialed,no memory!\n");
        return NULL;
    }
    flags = flags;
    mgr->ptsitem.max_items = MAX_PTS_ITEM;
    mgr->ptsitem.reject_same_item_data = 0;
    mgr->ptsitem.item_ext_buf_size = 16; /*two int64_t */
    itemlist_init(&mgr->ptsitem);
    return mgr;
}
int ffmpeg_init(void)
{
    if (basic_init > 0) {
        return 0;
    }
    basic_init++;
    av_register_all();
    av_lockmgr_register(ffmpeg_lock);
    url_set_interrupt_cb(ffmpeg_interrupt_callback);
    kill_item_list.max_items = MAX_PLAYER_THREADS;
    kill_item_list.item_ext_buf_size = 0;
    kill_item_list.muti_threads_access = 1;
    kill_item_list.reject_same_item_data = 1;
    itemlist_init(&kill_item_list);
    return 0;
}