Mercurial > libavcodec.hg
comparison qtrle.c @ 1807:db067aa9fc2b libavcodec
Use av_log
author | rtognimp |
---|---|
date | Sat, 14 Feb 2004 17:11:46 +0000 |
parents | 66ae3c109d90 |
children | 9d860b33fd54 |
comparison
equal
deleted
inserted
replaced
1806:2721e1859e19 | 1807:db067aa9fc2b |
---|---|
52 | 52 |
53 #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) | 53 #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) |
54 | 54 |
55 #define CHECK_STREAM_PTR(n) \ | 55 #define CHECK_STREAM_PTR(n) \ |
56 if ((stream_ptr + n) > s->size) { \ | 56 if ((stream_ptr + n) > s->size) { \ |
57 printf ("QT RLE problem: stream_ptr out of bounds (%d >= %d)\n", \ | 57 av_log (s->avctx, AV_LOG_INFO, "Problem: stream_ptr out of bounds (%d >= %d)\n", \ |
58 stream_ptr + n, s->size); \ | 58 stream_ptr + n, s->size); \ |
59 return; \ | 59 return; \ |
60 } | 60 } |
61 | 61 |
62 #define CHECK_PIXEL_PTR(n) \ | 62 #define CHECK_PIXEL_PTR(n) \ |
63 if (pixel_ptr + n > pixel_limit) { \ | 63 if (pixel_ptr + n > pixel_limit) { \ |
64 printf ("QT RLE problem: pixel_ptr >= pixel_limit (%d >= %d)\n", \ | 64 av_log (s->avctx, AV_LOG_INFO, "Problem: pixel_ptr >= pixel_limit (%d >= %d)\n", \ |
65 pixel_ptr + n, pixel_limit); \ | 65 pixel_ptr + n, pixel_limit); \ |
66 return; \ | 66 return; \ |
67 } \ | 67 } \ |
68 | 68 |
69 static void qtrle_decode_1bpp(QtrleContext *s) | 69 static void qtrle_decode_1bpp(QtrleContext *s) |
426 case 32: | 426 case 32: |
427 avctx->pix_fmt = PIX_FMT_RGBA32; | 427 avctx->pix_fmt = PIX_FMT_RGBA32; |
428 break; | 428 break; |
429 | 429 |
430 default: | 430 default: |
431 printf ("QT RLE: Unsupported colorspace: %d bits/sample?\n", | 431 av_log (avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n", |
432 avctx->bits_per_sample); | 432 avctx->bits_per_sample); |
433 break; | 433 break; |
434 } | 434 } |
435 avctx->has_b_frames = 0; | 435 avctx->has_b_frames = 0; |
436 dsputil_init(&s->dsp, avctx); | 436 dsputil_init(&s->dsp, avctx); |
455 | 455 |
456 s->frame.reference = 1; | 456 s->frame.reference = 1; |
457 s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | | 457 s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | |
458 FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE; | 458 FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE; |
459 if (avctx->reget_buffer(avctx, &s->frame)) { | 459 if (avctx->reget_buffer(avctx, &s->frame)) { |
460 printf ("reget_buffer() failed\n"); | 460 av_log (s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); |
461 return -1; | 461 return -1; |
462 } | 462 } |
463 | 463 |
464 switch (avctx->bits_per_sample) { | 464 switch (avctx->bits_per_sample) { |
465 case 1: | 465 case 1: |
499 case 32: | 499 case 32: |
500 qtrle_decode_32bpp(s); | 500 qtrle_decode_32bpp(s); |
501 break; | 501 break; |
502 | 502 |
503 default: | 503 default: |
504 printf ("QT RLE: Unsupported colorspace: %d bits/sample?\n", | 504 av_log (s->avctx, AV_LOG_ERROR, "Unsupported colorspace: %d bits/sample?\n", |
505 avctx->bits_per_sample); | 505 avctx->bits_per_sample); |
506 break; | 506 break; |
507 } | 507 } |
508 | 508 |
509 *data_size = sizeof(AVFrame); | 509 *data_size = sizeof(AVFrame); |