Commit 2d529db5 authored by Luca Abeni's avatar Luca Abeni

Pass a context to av_log(), when possible

Originally committed as revision 21999 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
parent 6f9ca74b
This diff is collapsed.
......@@ -33,13 +33,6 @@
#define AVV(x...) {x}
#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
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
/* this struct should be aligned on at least 32-byte boundary */
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
......
......@@ -2972,7 +2972,7 @@ i--;
static int firstTime=1; //FIXME move this into the context perhaps
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");
firstTime=0;
}
......
......@@ -611,7 +611,7 @@ SwsFunc yuv2rgb_get_func_ptr (SwsContext *c)
}
#endif
MSG_WARN("No accelerated colorspace conversion found\n");
av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found\n");
switch(c->dstFormat){
case PIX_FMT_BGR32:
......@@ -828,7 +828,7 @@ int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange,
default:
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?
return -1;
}
......
......@@ -710,22 +710,22 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c)
switch(c->dstFormat){
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;
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;
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;
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;
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;
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;
default: return NULL;
}
......@@ -734,7 +734,7 @@ SwsFunc yuv2rgb_init_altivec (SwsContext *c)
case PIX_FMT_UYVY422:
switch(c->dstFormat){
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;
default: return NULL;
}
......@@ -877,7 +877,7 @@ altivec_yuv2packedX (SwsContext *c,
instead. */
static int 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));
printed_error_message=1;
}
......@@ -952,7 +952,7 @@ altivec_yuv2packedX (SwsContext *c,
case PIX_FMT_BGR24: out_bgr24 (R,G,B,nout); break;
default:
/* 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));
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