#include <videoscale.h>
+/* debug variable definition */
+GST_DEBUG_CATEGORY (videoscale_debug);
/* elementfactory information */
static GstElementDetails videoscale_details = GST_ELEMENT_DETAILS (
videoscale->srcpad;
othercaps = gst_pad_get_allowed_caps (otherpad);
- GST_DEBUG ("othercaps are: " GST_PTR_FORMAT, othercaps);
+ GST_DEBUG ("othercaps are: %" GST_PTR_FORMAT, othercaps);
caps = gst_caps_copy (othercaps);
for(i=0;i<gst_caps_get_size(caps);i++) {
NULL);
}
- GST_DEBUG ("returning caps: " GST_PTR_FORMAT, caps);
+ GST_DEBUG ("returning caps: %" GST_PTR_FORMAT, caps);
return caps;
}
static void
gst_videoscale_init (GstVideoscale *videoscale)
{
- GST_DEBUG ("gst_videoscale_init");
+ GST_DEBUG_OBJECT (videoscale, "_init");
videoscale->sinkpad = gst_pad_new_from_template (
gst_videoscale_sink_template_factory(),
"sink");
gulong size;
GstBuffer *outbuf;
- GST_DEBUG ("gst_videoscale_chain");
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
size = GST_BUFFER_SIZE(buf);
if(videoscale->passthru){
- gst_pad_push(videoscale->srcpad, GST_DATA (buf));
+ GST_LOG_OBJECT (videoscale, "passing through buffer of %ld bytes in '%s'",
+ size, GST_OBJECT_NAME (videoscale));
+ gst_pad_push (videoscale->srcpad, GST_DATA (buf));
return;
}
- GST_DEBUG ("gst_videoscale_chain: got buffer of %ld bytes in '%s'",size,
- GST_OBJECT_NAME (videoscale));
-
- GST_DEBUG ("size=%ld from=%dx%d to=%dx%d fromsize=%ld (should be %d) tosize=%d",
+ GST_LOG_OBJECT (videoscale, "got buffer of %ld bytes in '%s'",size,
+ GST_OBJECT_NAME (videoscale));
+ GST_LOG_OBJECT (videoscale, "size=%ld from=%dx%d to=%dx%d fromsize=%ld (should be %d) tosize=%d",
size,
videoscale->from_width, videoscale->from_height,
videoscale->to_width, videoscale->to_height,
GST_BUFFER_TIMESTAMP(outbuf) = GST_BUFFER_TIMESTAMP(buf);
g_return_if_fail(videoscale->format);
- GST_DEBUG ("format " GST_FOURCC_FORMAT,GST_FOURCC_ARGS(videoscale->format->fourcc));
+ GST_DEBUG_OBJECT (videoscale, "format " GST_FOURCC_FORMAT,GST_FOURCC_ARGS(videoscale->format->fourcc));
g_return_if_fail(videoscale->format->scale);
videoscale->format->scale(videoscale, GST_BUFFER_DATA(outbuf), data);
- GST_DEBUG ("gst_videoscale_chain: pushing buffer of %d bytes in '%s'",GST_BUFFER_SIZE(outbuf),
+ GST_DEBUG_OBJECT (videoscale, "pushing buffer of %d bytes in '%s'",GST_BUFFER_SIZE(outbuf),
GST_OBJECT_NAME (videoscale));
gst_pad_push(videoscale->srcpad, GST_DATA (outbuf));
g_return_if_fail(GST_IS_VIDEOSCALE(object));
src = GST_VIDEOSCALE(object);
- GST_DEBUG ("gst_videoscale_set_property");
+ GST_DEBUG_OBJECT (src, "gst_videoscale_set_property");
switch (prop_id) {
case ARG_METHOD:
src->method = g_value_get_enum (value);
static gboolean
plugin_init (GstPlugin *plugin)
{
- return gst_element_register (plugin, "videoscale", GST_RANK_NONE, GST_TYPE_VIDEOSCALE);
+ if (!gst_element_register (plugin, "videoscale", GST_RANK_NONE, GST_TYPE_VIDEOSCALE))
+ return FALSE;
+
+ g_print ("going to init debug\n");
+ GST_DEBUG_CATEGORY_INIT (videoscale_debug, "videoscale", 0, "videoscale element");
+
+ return TRUE;
}
GST_PLUGIN_DEFINE (
g_return_if_fail (GST_IS_VIDEOSCALE (videoscale));
g_return_if_fail (videoscale->format != NULL);
- GST_DEBUG ("format=%p " GST_FOURCC_FORMAT " from %dx%d to %dx%d",
- videoscale->format, GST_FOURCC_ARGS(videoscale->format->fourcc),
- videoscale->from_width, videoscale->from_height,
- videoscale->to_width, videoscale->to_height);
+ GST_DEBUG_OBJECT (videoscale, "format=%p " GST_FOURCC_FORMAT
+ " from %dx%d to %dx%d",
+ videoscale->format,
+ GST_FOURCC_ARGS(videoscale->format->fourcc),
+ videoscale->from_width, videoscale->from_height,
+ videoscale->to_width, videoscale->to_height);
if(videoscale->to_width==0 || videoscale->to_height==0 ||
videoscale->from_width==0 || videoscale->from_height==0){
if(videoscale->to_width == videoscale->from_width &&
videoscale->to_height == videoscale->from_height){
- GST_DEBUG ("videoscale: using passthru");
+ GST_DEBUG_OBJECT (videoscale, "using passthru");
videoscale->passthru = TRUE;
videoscale->inited = TRUE;
return;
}
- GST_DEBUG ("videoscale: scaling method POINT_SAMPLE");
+ GST_DEBUG_OBJECT (videoscale, "scaling method POINT_SAMPLE");
videoscale->from_buf_size = (videoscale->from_width * videoscale->from_height
* videoscale->format->bpp) / 8;
int sh = scale->from_height;
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling RGB %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling RGB %dx%d to %dx%d", sw, sh, dw, dh);
switch (scale->scale_bytes) {
case 2:
break;
}
- GST_DEBUG ("videoscale: %p %p", src, dest);
+ GST_DEBUG_OBJECT (scale, "%p %p", src, dest);
//scale->scaler(scale, src, dest, sw, sh, dw, dh);
}
#endif
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling planar 4:1:1 %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling planar 4:1:1 %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest(scale, dest, src, sw, sh, dw, dh);
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling Y-only %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling Y-only %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest(scale, dest, src, sw, sh, dw, dh);
}
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling 4:2:2 %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling 4:2:2 %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest_str2(scale, dest, src, sw, sh, dw, dh);
gst_videoscale_scale_nearest_str4(scale, dest+1, src+1, sw/2, sh, dw/2, dh);
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling 4:2:2 %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling 4:2:2 %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest_str2(scale, dest+1, src, sw, sh, dw, dh);
gst_videoscale_scale_nearest_str4(scale, dest, src+1, sw/2, sh, dw/2, dh);
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling 32bit %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling 32bit %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest_32bit(scale, dest, src, sw, sh, dw, dh);
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling 24bit %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling 24bit %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest_24bit(scale, dest, src, sw, sh, dw, dh);
int dw = scale->to_width;
int dh = scale->to_height;
- GST_DEBUG ("videoscale: scaling 16bit %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_DEBUG_OBJECT (scale, "scaling 16bit %dx%d to %dx%d", sw, sh, dw, dh);
gst_videoscale_scale_nearest_16bit(scale, dest, src, sw, sh, dw, dh);
double dest;
int color;
- GST_DEBUG ("videoscale: scaling bilinear %f %f %dx%d", x, y, sw, sh);
+ GST_DEBUG_OBJECT (scale, "scaling bilinear %f %f %dx%d", x, y, sw, sh);
dest=(1-a)*(1-b)*RC(j,k)+
a*(1-b)*RC(j+1,k);
double t1, t2, t3, t4;
double a1, a2, a3, a4;
- GST_DEBUG ("videoscale: scaling bicubic %dx%d", sw, sh);
+ GST_DEBUG_OBJECT (scale, "scaling bicubic %dx%d", sw, sh);
a1 = -a*(1-a)*(1-a);
a2 = (1-2*a*a+a*a*a);
double xr, yr;
int x, y;
- GST_DEBUG ("videoscale: scale plane slow %dx%d %dx%d %g %g %p %p", sw, sh, dw, dh, zoomx, zoomy, src, dest);
+ GST_DEBUG_OBJECT (scale, "scale plane slow %dx%d %dx%d %g %g %p %p", sw, sh, dw, dh, zoomx, zoomy, src, dest);
for (y=0; y<dh; y++) {
yr = ((double)y)/zoomy;
for (x=0; x<dw; x++) {
xr = ((double)x)/zoomx;
- GST_DEBUG ("videoscale: scale plane slow %g %g %p", xr, yr, (src+(int)(x)+(int)((y)*sw)));
+ GST_DEBUG_OBJECT (scale, "scale plane slow %g %g %p", xr, yr, (src+(int)(x)+(int)((y)*sw)));
if (floor(xr) == xr && floor(yr) == yr){
- GST_DEBUG ("videoscale: scale plane %g %g %p %p", xr, yr, (src+(int)(x)+(int)((y)*sw)), dest);
+ GST_DEBUG_OBJECT (scale, "scale plane %g %g %p %p", xr, yr, (src+(int)(x)+(int)((y)*sw)), dest);
*dest++ = RC(xr, yr);
}
else {
int sum, xcount, ycount, loop;
unsigned char *srcp, *srcp2;
- GST_DEBUG ("videoscale: scaling nearest point sample %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest point sample %p %p %d", src, dest, dw);
ypos = 0x10000;
yinc = (sh<<16)/dh;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;
guchar *destp = dest;
guchar *srcp = src;
- GST_DEBUG ("videoscale: scaling nearest %p %p %d", src, dest, dw);
+ GST_DEBUG_OBJECT (scale, "scaling nearest %p %p %d", src, dest, dw);
ypos = 0x10000;