示例#1
0
IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecode_Type tcs_in_use,
                                                  IMB_Proxy_Size proxy_sizes_in_use, int quality)
{
	IndexBuildContext *context = NULL;

	switch (anim->curtype) {
#ifdef WITH_FFMPEG
		case ANIM_FFMPEG:
			context = index_ffmpeg_create_context(anim, tcs_in_use, proxy_sizes_in_use, quality);
			break;
#endif
#ifdef WITH_AVI
		default:
			context = index_fallback_create_context(anim, tcs_in_use, proxy_sizes_in_use, quality);
			break;
#endif
	}

	if (context)
		context->anim_type = anim->curtype;

	return context;

	(void)tcs_in_use, (void)proxy_sizes_in_use, (void)quality;
}
示例#2
0
IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim, IMB_Timecode_Type tcs_in_use,
                                                  IMB_Proxy_Size proxy_sizes_in_use, int quality,
                                                  const bool overwrite, GSet *file_list)
{
	IndexBuildContext *context = NULL;
	IMB_Proxy_Size proxy_sizes_to_build = proxy_sizes_in_use;
	int i;

	/* Don't generate the same file twice! */
	if (file_list) {
		for (i = 0; i < IMB_PROXY_MAX_SLOT; ++i) {
			IMB_Proxy_Size proxy_size = proxy_sizes[i];
			if (proxy_size & proxy_sizes_to_build) {
				char filename[FILE_MAX];
				get_proxy_filename(anim, proxy_size, filename, false);

				void **filename_key_p;
				if (!BLI_gset_ensure_p_ex(file_list, filename, &filename_key_p)) {
					*filename_key_p = BLI_strdup(filename);
				}
				else {
					proxy_sizes_to_build &= ~proxy_size;
					printf("Proxy: %s already registered for generation, skipping\n", filename);
				}
			}
		}
	}
	
	if (!overwrite) {
		IMB_Proxy_Size built_proxies = IMB_anim_proxy_get_existing(anim);
		if (built_proxies != 0) {

			for (i = 0; i < IMB_PROXY_MAX_SLOT; ++i) {
				IMB_Proxy_Size proxy_size = proxy_sizes[i];
				if (proxy_size & built_proxies) {
					char filename[FILE_MAX];
					get_proxy_filename(anim, proxy_size, filename, false);
					printf("Skipping proxy: %s\n", filename);
				}
			}
		}
		proxy_sizes_to_build &= ~built_proxies;
	}
	
	fflush(stdout);

	if (proxy_sizes_to_build == 0) {
		return NULL;
	}
	

	switch (anim->curtype) {
#ifdef WITH_FFMPEG
		case ANIM_FFMPEG:
			context = index_ffmpeg_create_context(anim, tcs_in_use, proxy_sizes_to_build, quality);
			break;
#endif
#ifdef WITH_AVI
		default:
			context = index_fallback_create_context(anim, tcs_in_use, proxy_sizes_to_build, quality);
			break;
#endif
	}

	if (context)
		context->anim_type = anim->curtype;

	return context;

	UNUSED_VARS(tcs_in_use, proxy_sizes_in_use, quality);
}