Commit 85088ede authored by lucabe's avatar lucabe

Pass a context to av_log(), when possible


git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@21999 b3059339-0415-0410-9bf9-f77b7e298cf2
parent af92e2a5
This diff is collapsed.
...@@ -33,13 +33,6 @@ ...@@ -33,13 +33,6 @@
#define AVV(x...) {x} #define AVV(x...) {x}
#endif #endif
#define MSG_WARN(args...) av_log(NULL, AV_LOG_DEBUG, ##args )
#define MSG_FATAL(args...) av_log(NULL, AV_LOG_ERROR, ##args )
#define MSG_ERR(args...) av_log(NULL, AV_LOG_ERROR, ##args )
#define MSG_V(args...) av_log(NULL, AV_LOG_INFO, ##args )
#define MSG_DBG2(args...) av_log(NULL, AV_LOG_DEBUG, ##args )
#define MSG_INFO(args...) av_log(NULL, AV_LOG_INFO, ##args )
#define MAX_FILTER_SIZE 256 #define MAX_FILTER_SIZE 256
typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
...@@ -47,6 +40,11 @@ typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride ...@@ -47,6 +40,11 @@ typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride
/* this struct should be aligned on at least 32-byte boundary */ /* this struct should be aligned on at least 32-byte boundary */
typedef struct SwsContext{ typedef struct SwsContext{
/**
* info on struct for av_log
*/
AVClass *av_class;
/** /**
* *
* Note the src,dst,srcStride,dstStride will be copied, in the sws_scale() warper so they can freely be modified here * Note the src,dst,srcStride,dstStride will be copied, in the sws_scale() warper so they can freely be modified here
......
...@@ -2972,7 +2972,7 @@ i--; ...@@ -2972,7 +2972,7 @@ i--;
static int firstTime=1; //FIXME move this into the context perhaps static int firstTime=1; //FIXME move this into the context perhaps
if(flags & SWS_PRINT_INFO && firstTime) if(flags & SWS_PRINT_INFO && firstTime)
{ {
MSG_WARN("SwScaler: Warning: dstStride is not aligned!\n" av_log(c, AV_LOG_WARNING, "SwScaler: Warning: dstStride is not aligned!\n"
"SwScaler: ->cannot do aligned memory acesses anymore\n"); "SwScaler: ->cannot do aligned memory acesses anymore\n");
firstTime=0; firstTime=0;
} }
......
...@@ -611,7 +611,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c) ...@@ -611,7 +611,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
} }
#endif #endif
MSG_WARN("No accelerated colorspace conversion found\n"); av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found\n");
switch(c->dstFormat){ switch(c->dstFormat){
case PIX_FMT_BGR32: case PIX_FMT_BGR32:
...@@ -828,7 +828,7 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, ...@@ -828,7 +828,7 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange,
default: default:
table_start= NULL; table_start= NULL;
MSG_ERR("%ibpp not supported by yuv2rgb\n", bpp); av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
//free mem? //free mem?
return -1; return -1;
} }
......
...@@ -710,22 +710,22 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c) ...@@ -710,22 +710,22 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c)
switch(c->dstFormat){ switch(c->dstFormat){
case PIX_FMT_RGB24: case PIX_FMT_RGB24:
MSG_WARN("ALTIVEC: Color Space RGB24\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n");
return altivec_yuv2_rgb24; return altivec_yuv2_rgb24;
case PIX_FMT_BGR24: case PIX_FMT_BGR24:
MSG_WARN("ALTIVEC: Color Space BGR24\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n");
return altivec_yuv2_bgr24; return altivec_yuv2_bgr24;
case PIX_FMT_ARGB: case PIX_FMT_ARGB:
MSG_WARN("ALTIVEC: Color Space ARGB\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n");
return altivec_yuv2_argb; return altivec_yuv2_argb;
case PIX_FMT_ABGR: case PIX_FMT_ABGR:
MSG_WARN("ALTIVEC: Color Space ABGR\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n");
return altivec_yuv2_abgr; return altivec_yuv2_abgr;
case PIX_FMT_RGBA: case PIX_FMT_RGBA:
MSG_WARN("ALTIVEC: Color Space RGBA\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n");
return altivec_yuv2_rgba; return altivec_yuv2_rgba;
case PIX_FMT_BGRA: case PIX_FMT_BGRA:
MSG_WARN("ALTIVEC: Color Space BGRA\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n");
return altivec_yuv2_bgra; return altivec_yuv2_bgra;
default: return NULL; default: return NULL;
} }
...@@ -734,7 +734,7 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c) ...@@ -734,7 +734,7 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c)
case PIX_FMT_UYVY422: case PIX_FMT_UYVY422:
switch(c->dstFormat){ switch(c->dstFormat){
case PIX_FMT_BGR32: case PIX_FMT_BGR32:
MSG_WARN("ALTIVEC: Color Space UYVY -> RGB32\n"); av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n");
return altivec_uyvy_rgb32; return altivec_uyvy_rgb32;
default: return NULL; default: return NULL;
} }
...@@ -877,7 +877,7 @@ altivec_yuv2packedX (SwsContext *c, ...@@ -877,7 +877,7 @@ altivec_yuv2packedX (SwsContext *c,
instead. */ instead. */
static int printed_error_message; static int printed_error_message;
if(!printed_error_message) { if(!printed_error_message) {
MSG_ERR("altivec_yuv2packedX doesn't support %s output\n", av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n",
sws_format_name(c->dstFormat)); sws_format_name(c->dstFormat));
printed_error_message=1; printed_error_message=1;
} }
...@@ -952,7 +952,7 @@ altivec_yuv2packedX (SwsContext *c, ...@@ -952,7 +952,7 @@ altivec_yuv2packedX (SwsContext *c,
case PIX_FMT_BGR24: out_bgr24 (R,G,B,nout); break; case PIX_FMT_BGR24: out_bgr24 (R,G,B,nout); break;
default: default:
/* Unreachable, I think. */ /* Unreachable, I think. */
MSG_ERR("altivec_yuv2packedX doesn't support %s output\n", av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n",
sws_format_name(c->dstFormat)); sws_format_name(c->dstFormat));
return; return;
} }
......
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