void va_FoolInit(VADisplay dpy) { char env_value[1024]; struct fool_context *fool_ctx = calloc(sizeof(struct fool_context), 1); if (fool_ctx == NULL) return; if (va_parseConfig("LIBVA_FOOL_POSTP", NULL) == 0) { va_fool_postp = 1; va_infoMessage(dpy, "LIBVA_FOOL_POSTP is on, dummy vaPutSurface\n"); } if (va_parseConfig("LIBVA_FOOL_DECODE", NULL) == 0) { va_fool_codec |= VA_FOOL_FLAG_DECODE; va_infoMessage(dpy, "LIBVA_FOOL_DECODE is on, dummy decode\n"); } if (va_parseConfig("LIBVA_FOOL_ENCODE", &env_value[0]) == 0) { va_fool_codec |= VA_FOOL_FLAG_ENCODE; fool_ctx->fn_enc = strdup(env_value); va_infoMessage(dpy, "LIBVA_FOOL_ENCODE is on, load encode data from file with patten %s\n", fool_ctx->fn_enc); } if (va_parseConfig("LIBVA_FOOL_JPEG", &env_value[0]) == 0) { va_fool_codec |= VA_FOOL_FLAG_JPEG; fool_ctx->fn_jpg = strdup(env_value); va_infoMessage(dpy, "LIBVA_FOOL_JPEG is on, load encode data from file with patten %s\n", fool_ctx->fn_jpg); } ((VADisplayContextP)dpy)->vafool = fool_ctx; }
void va_FoolInit(VADisplay dpy) { char env_value[1024]; int fool_index = 0; for (fool_index = 0; fool_index < FOOL_CONTEXT_MAX; fool_index++) if (fool_context[fool_index].dpy == 0) break; if (fool_index == FOOL_CONTEXT_MAX) return; memset(&fool_context[fool_index], 0, sizeof(struct _fool_context)); if (va_parseConfig("LIBVA_FOOL_POSTP", NULL) == 0) { fool_postp = 1; va_infoMessage("LIBVA_FOOL_POSTP is on, dummy vaPutSurface\n"); } if (va_parseConfig("LIBVA_FOOL_DECODE", NULL) == 0) { fool_codec |= VA_FOOL_FLAG_DECODE; va_infoMessage("LIBVA_FOOL_DECODE is on, dummy decode\n"); } if (va_parseConfig("LIBVA_FOOL_ENCODE", &env_value[0]) == 0) { fool_codec |= VA_FOOL_FLAG_ENCODE; fool_context[fool_index].fn_enc = strdup(env_value); va_infoMessage("LIBVA_FOOL_ENCODE is on, load encode data from file with patten %s\n", fool_context[fool_index].fn_enc); } if (va_parseConfig("LIBVA_FOOL_JPEG", &env_value[0]) == 0) { fool_codec |= VA_FOOL_FLAG_JPEG; fool_context[fool_index].fn_jpg = strdup(env_value); va_infoMessage("LIBVA_FOOL_JPEG is on, load encode data from file with patten %s\n", fool_context[fool_index].fn_jpg); } if (fool_codec) fool_context[fool_index].dpy = dpy; }