Ejemplo n.º 1
0
int fvp_log_init(FvpLogLevel log_level, FvpLogSaveMode mode, char *filename)	
{
	static int log_inited = 0;

	if(log_inited === 1)
	{
		return 0;
	}
	
    fvp_log_level = log_level;
    fvp_log_save_mode = mode;

	if(mode == LOG_MODE_FILE)
	{	
	    if(filename != NULL)
        {
            log_file = FTK_STRDUP(filename);
        }   
        else
        {
            log_file = FTK_STRDUP("./log.dat");
        }
       
	}
	
	log_inited = 1;

    return 0;
}
Ejemplo n.º 2
0
Ret		   ftk_file_browser_set_filter(FtkWidget* thiz, const char* mime_type)
{
	PrivInfo* priv = (PrivInfo*)ftk_widget_user_data(thiz);
	return_val_if_fail(priv != NULL, RET_FAIL);	

	FTK_FREE(priv->filter_mime_type);
	priv->filter_mime_type = FTK_STRDUP(mime_type);

	return RET_OK;
}
Ejemplo n.º 3
0
Access *access_avi_create(char *access_path)
{
	return_val_if_fail(access_path, NULL);
		
	int fd = -1;
	char file_path[64] = {0};

	if(avi_parse_path(access_path, file_path, 64) != 0)
	{
		msg_dbg("Fun(%s) error parse the access_path(%s) failed!\n", __func__, access_path);
		return NULL;
	}

	Access *thiz = (Access *)FTK_ZALLOC(sizeof(Access) + sizeof(PrivInfo));
	return_val_if_fail(thiz != NULL, NULL);

	/*open the file */
	fd = open(file_path, O_RDONLY);
	if(fd <= 0)
	{
		msg_dbg("error:open the file failed! file path(%s)\n", file_path);
		return NULL;
	}

	thiz->seek = NULL;
	thiz->read = NULL;
	thiz->block = access_avi_block;
	thiz->control = NULL;
	thiz->destroy = access_avi_destroy;

	DECL_PRIV(thiz, priv);

	priv->file_path = FTK_STRDUP(file_path);
	priv->block = block_create(MAX_H264_PACKET_LEN);
	
	access_init_ffmpeg(thiz, file_path);
	
	return thiz;
}