Commit f2eb8c5b authored by JonY's avatar JonY Committed by Stefano Sabatini

Properly use av_log rather than fprintf/printf.

Fix the "implicit declaration of function 'please_use_av_log'" warnings.
Patch by JonY <10walls _AT_ gmail #dot# com>

Originally committed as revision 15200 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 991945d0
...@@ -155,7 +155,7 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -155,7 +155,7 @@ int Configure(void **ctxp, int argc, char *argv[])
case 't': case 't':
ci->threshold = atof(optarg) * 1000; ci->threshold = atof(optarg) * 1000;
if (ci->threshold > 1000 || ci->threshold < 0) { if (ci->threshold > 1000 || ci->threshold < 0) {
fprintf(stderr, "Invalid threshold value '%s' (range is 0-1)\n", optarg); av_log(NULL, AV_LOG_ERROR, "Invalid threshold value '%s' (range is 0-1)\n", optarg);
return -1; return -1;
} }
break; break;
...@@ -169,20 +169,20 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -169,20 +169,20 @@ int Configure(void **ctxp, int argc, char *argv[])
ci->dir = av_strdup(optarg); ci->dir = av_strdup(optarg);
break; break;
default: default:
fprintf(stderr, "Unrecognized argument '%s'\n", argv[optind]); av_log(NULL, AV_LOG_ERROR, "Unrecognized argument '%s'\n", argv[optind]);
return -1; return -1;
} }
} }
fprintf(stderr, "Fish detector configured:\n"); av_log(NULL, AV_LOG_INFO, "Fish detector configured:\n");
fprintf(stderr, " HSV range: %d,%d,%d - %d,%d,%d\n", av_log(NULL, AV_LOG_INFO, " HSV range: %d,%d,%d - %d,%d,%d\n",
ci->dark.h, ci->dark.h,
ci->dark.s, ci->dark.s,
ci->dark.v, ci->dark.v,
ci->bright.h, ci->bright.h,
ci->bright.s, ci->bright.s,
ci->bright.v); ci->bright.v);
fprintf(stderr, " Threshold is %d%% pixels\n", ci->threshold / 10); av_log(NULL, AV_LOG_INFO, " Threshold is %d%% pixels\n", ci->threshold / 10);
return 0; return 0;
...@@ -234,7 +234,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, ...@@ -234,7 +234,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
int rowsize = picture->linesize[0]; int rowsize = picture->linesize[0];
#if 0 #if 0
printf("pix_fmt = %d, width = %d, pts = %lld, ci->next_pts = %lld\n", av_log(NULL, AV_LOG_DEBUG, "pix_fmt = %d, width = %d, pts = %lld, ci->next_pts = %lld\n",
pix_fmt, width, pts, ci->next_pts); pix_fmt, width, pts, ci->next_pts);
#endif #endif
...@@ -281,7 +281,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, ...@@ -281,7 +281,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
get_hsv(&hsv, r, g, b); get_hsv(&hsv, r, g, b);
if (ci->debug > 1) if (ci->debug > 1)
fprintf(stderr, "(%d,%d,%d) -> (%d,%d,%d)\n", av_log(NULL, AV_LOG_DEBUG, "(%d,%d,%d) -> (%d,%d,%d)\n",
r,g,b,hsv.h,hsv.s,hsv.v); r,g,b,hsv.h,hsv.s,hsv.v);
...@@ -306,7 +306,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width, ...@@ -306,7 +306,7 @@ void Process(void *ctx, AVPicture *picture, enum PixelFormat pix_fmt, int width,
} }
if (ci->debug) if (ci->debug)
fprintf(stderr, "Fish: Inrange=%d of %d = %d threshold\n", inrange, pixcnt, 1000 * inrange / pixcnt); av_log(NULL, AV_LOG_INFO, "Fish: Inrange=%d of %d = %d threshold\n", inrange, pixcnt, 1000 * inrange / pixcnt);
if (inrange * 1000 / pixcnt >= ci->threshold) { if (inrange * 1000 / pixcnt >= ci->threshold) {
/* Save to file */ /* Save to file */
......
...@@ -215,21 +215,21 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -215,21 +215,21 @@ int Configure(void **ctxp, int argc, char *argv[])
ci->fileImage = av_strdup(optarg); ci->fileImage = av_strdup(optarg);
break; break;
case '?': case '?':
fprintf(stderr, "Unrecognized argument '%s'\n", argv[optind]); av_log(NULL, AV_LOG_ERROR, "Unrecognized argument '%s'\n", argv[optind]);
return -1; return -1;
} }
} }
if (ci->eval_colors && !(ci->expr_R && ci->expr_G && ci->expr_B)) if (ci->eval_colors && !(ci->expr_R && ci->expr_G && ci->expr_B))
{ {
fprintf(stderr, "You must specify expressions for all or no colors.\n"); av_log(NULL, AV_LOG_ERROR, "You must specify expressions for all or no colors.\n");
return -1; return -1;
} }
if (ci->text || ci->file) { if (ci->text || ci->file) {
ci->fn = imlib_load_font(font); ci->fn = imlib_load_font(font);
if (!ci->fn) { if (!ci->fn) {
fprintf(stderr, "Failed to load font '%s'\n", font); av_log(NULL, AV_LOG_ERROR, "Failed to load font '%s'\n", font);
return -1; return -1;
} }
imlib_context_set_font(ci->fn); imlib_context_set_font(ci->fn);
...@@ -242,7 +242,7 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -242,7 +242,7 @@ int Configure(void **ctxp, int argc, char *argv[])
if (ci->eval_colors) if (ci->eval_colors)
{ {
fprintf(stderr, "You must not specify both a color name and expressions for the colors.\n"); av_log(NULL, AV_LOG_ERROR, "You must not specify both a color name and expressions for the colors.\n");
return -1; return -1;
} }
...@@ -255,7 +255,7 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -255,7 +255,7 @@ int Configure(void **ctxp, int argc, char *argv[])
f = fopen("/usr/lib/X11/rgb.txt", "r"); f = fopen("/usr/lib/X11/rgb.txt", "r");
} }
if (!f) { if (!f) {
fprintf(stderr, "Failed to find RGB color names file\n"); av_log(NULL, AV_LOG_ERROR, "Failed to find RGB color names file\n");
return -1; return -1;
} }
while (fgets(buff, sizeof(buff), f)) { while (fgets(buff, sizeof(buff), f)) {
...@@ -274,7 +274,7 @@ int Configure(void **ctxp, int argc, char *argv[]) ...@@ -274,7 +274,7 @@ int Configure(void **ctxp, int argc, char *argv[])
} }
fclose(f); fclose(f);
if (!done) { if (!done) {
fprintf(stderr, "Unable to find color '%s' in rgb.txt\n", color); av_log(NULL, AV_LOG_ERROR, "Unable to find color '%s' in rgb.txt\n", color);
return -1; return -1;
} }
} else if (ci->eval_colors) { } else if (ci->eval_colors) {
......
...@@ -50,7 +50,7 @@ void Release(void *ctx) ...@@ -50,7 +50,7 @@ void Release(void *ctx)
int Configure(void **ctxp, int argc, char *argv[]) int Configure(void **ctxp, int argc, char *argv[])
{ {
fprintf(stderr, "Called with argc=%d\n", argc); av_log(NULL, AV_LOG_DEBUG, "Called with argc=%d\n", argc);
*ctxp = av_mallocz(sizeof(ContextInfo)); *ctxp = av_mallocz(sizeof(ContextInfo));
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment