diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/docs/filter-API.txt transcode-0.6.3.20030123/docs/filter-API.txt --- orig-transcode-0.6.3.20030123/docs/filter-API.txt Tue Jan 7 20:59:42 2003 +++ transcode-0.6.3.20030123/docs/filter-API.txt Sun Jan 26 10:05:47 2003 @@ -24,16 +24,23 @@ // current config (optional) See /src/optstr.h for explanation - Notes about filter programming: + Notes and Hints about filter programming: * Statics: All information and data you have calculated at INIT time and you want to reuse later must be declared static (tables, flags, etc) - * The optstr_get function provide a convenient way for a developer to parse + * The optstr_get function provides a convenient way for a developer to parse human readable option strings. You are encouraged to use this function. * If your filter shall be called multiple times during and encode session (maybe first as a pre fileter and than as a post process filter) _you_ have to take care to not overwrite your own data. A frame_list_t element has a - field called `instance' which will help you to clean your adress space. + field called `instance' which will help you to keep your adress space clean. See 32detect for an implementation. + * When TC_FILER_GET_CONFIG flag is set, the filter should return its + available parameters using the optstr_param and optstr_filter_desc funtions. + The last parameters of optstr_param are ranges with valid arguments for + this paramter. Sometimes it does not make sense to set the ranges, (e.g. if + the parameter "foo" is valid from 0 to "all frames in this file", so it is + considered good practice to use "oo" - the mathematical symbol for infinity + as the upper limit. Example filter code: diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_32detect.c transcode-0.6.3.20030123/filter/filter_32detect.c --- orig-transcode-0.6.3.20030123/filter/filter_32detect.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_32detect.c Fri Jan 24 15:25:40 2003 @@ -22,7 +22,7 @@ */ #define MOD_NAME "filter_32detect.so" -#define MOD_VERSION "v0.2.1 (2003-01-21)" +#define MOD_VERSION "v0.2.2 (2003-01-24)" #define MOD_CAP "3:2 pulldown / interlace detection plugin" #include @@ -151,7 +151,7 @@ if(ptr->tag & TC_FILTER_GET_CONFIG) { char buf[255]; - optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, "Thomas", "VRYME", "1"); + optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, "Thomas", "VRYMEO", "1"); sprintf(buf, "%d", THRESHOLD); optstr_param (options, "threshold", "Interlace detection threshold", "%d", buf, "0", "255"); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_invert.c transcode-0.6.3.20030123/filter/filter_invert.c --- orig-transcode-0.6.3.20030123/filter/filter_invert.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_invert.c Sun Jan 26 09:43:54 2003 @@ -22,7 +22,7 @@ */ #define MOD_NAME "filter_invert.so" -#define MOD_VERSION "v0.1.2 (2003-01-21)" +#define MOD_VERSION "v0.1.3 (2003-01-26)" #define MOD_CAP "invert the image" #define MOD_AUTHOR "Tilmann Bitterberg" @@ -90,7 +90,7 @@ snprintf(buf, 128, "%ux%u/%d", mfd->start, mfd->end, mfd->step); optstr_param (options, "range", "apply filter to [start-end]/step frames", - "%u-%u/%d", buf, "0", "-1", "0", "-1", "1", "oo"); + "%u-%u/%d", buf, "0", "oo", "0", "oo", "1", "oo"); return 0; } diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_logo.c transcode-0.6.3.20030123/filter/filter_logo.c --- orig-transcode-0.6.3.20030123/filter/filter_logo.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_logo.c Sun Jan 26 09:44:58 2003 @@ -28,7 +28,7 @@ */ #define MOD_NAME "filter_logo.so" -#define MOD_VERSION "v0.7 (2003-01-21)" +#define MOD_VERSION "v0.8 (2003-01-26)" #define MOD_CAP "render image in videostream" #define MOD_AUTHOR "Tilmann Bitterberg" @@ -140,7 +140,7 @@ optstr_param (options, "file", "Image filename", "%s", "logo.png"); optstr_param (options, "posdef", "Position (0=None, 1=TopL, 2=TopR, 3=BotL, 4=BotR, 5=Center)", "%d", "0", "0", "5"); optstr_param (options, "pos", "Position (0-width x 0-height)", "%dx%d", "0x0", "0", "width", "0", "height"); - optstr_param (options, "range", "Restrict rendering to framerange", "%u-%u", "0-0", "0", "-1", "0", "-1"); + optstr_param (options, "range", "Restrict rendering to framerange", "%u-%u", "0-0", "0", "oo", "0", "oo"); // bools optstr_param (options, "ignoredelay", "Ignore delay specified in animations", "", "0"); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_logoaway.c transcode-0.6.3.20030123/filter/filter_logoaway.c --- orig-transcode-0.6.3.20030123/filter/filter_logoaway.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_logoaway.c Sun Jan 26 09:44:32 2003 @@ -51,7 +51,7 @@ */ #define MOD_NAME "filter_logoaway.so" -#define MOD_VERSION "v0.2 (2003-01-22)" +#define MOD_VERSION "v0.2 (2003-01-26)" #define MOD_CAP "remove an image from the video" #define MOD_AUTHOR "Thomas Wehrspann " @@ -403,7 +403,7 @@ optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VRYOM", "1"); sprintf (buf, "%u-%u", data[instance]->start, data[instance]->end); - optstr_param (options, "range", "Frame Range", "%d-%d", buf, "0", "-1", "0", "-1"); + optstr_param (options, "range", "Frame Range", "%d-%d", buf, "0", "oo", "0", "oo"); sprintf (buf, "%dx%d", data[instance]->xpos, data[instance]->ypos); optstr_param (options, "pos", "Position of logo", "%dx%d", buf, "0", "width", "0", "height"); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_pp.c transcode-0.6.3.20030123/filter/filter_pp.c --- orig-transcode-0.6.3.20030123/filter/filter_pp.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_pp.c Fri Jan 24 16:01:16 2003 @@ -22,7 +22,7 @@ */ #define MOD_NAME "filter_pp.so" -#define MOD_VERSION "v1.2.3 (2003-01-22)" +#define MOD_VERSION "v1.2.4 (2003-01-24)" #define MOD_CAP "Mplayers postprocess filters" #define MOD_AUTHOR "Michael Niedermayer et al, Gerhard Monzel" @@ -105,7 +105,7 @@ void do_getconfig(char *opts) { - optstr_filter_desc (opts, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VYMO", "1"); + optstr_filter_desc (opts, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VYMOE", "1"); optstr_param (opts, "hb", "Horizontal deblocking filter", "%d:%d", "64:40", "0", "255", "0", "255"); optstr_param (opts, "vb", "Vertical deblocking filter", "%d:%d", "64:40", "0", "255", "0", "255"); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/filter_smooth.c transcode-0.6.3.20030123/filter/filter_smooth.c --- orig-transcode-0.6.3.20030123/filter/filter_smooth.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/filter_smooth.c Tue Jan 28 11:19:10 2003 @@ -22,7 +22,7 @@ */ #define MOD_NAME "filter_smooth.so" -#define MOD_VERSION "v0.2.1 (2003-01-21)" +#define MOD_VERSION "v0.2.2 (2003-01-29)" #define MOD_CAP "(single-frame) smoothing plugin" #define MOD_AUTHOR "Chad Page" @@ -135,7 +135,6 @@ static vob_t *vob=NULL; static int cdiff[MAX_FILTER], ldiff[MAX_FILTER], range[MAX_FILTER]; static float strength[MAX_FILTER]; - static int width, height; int instance = ptr->filter_id; // API explanation: @@ -164,13 +163,21 @@ if(ptr->tag & TC_FILTER_GET_CONFIG) { + char buf[32]; optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VYEM", "1"); // buf, name, comment, format, val, from, to - optstr_param (options, "strength", "Blending factor", "%f", "0.25", "0.0", "0.9"); - optstr_param (options, "cdiff", "Max difference in chroma values", "%d", "6", "0", "16"); - optstr_param (options, "ldiff", "Max difference in luma value", "%d", "8", "0", "16"); - optstr_param (options, "range", "Search Range", "%d", "4", "0", "16"); + snprintf (buf, 32, "%.2f", strength[instance]); + optstr_param (options, "strength", "Blending factor", "%f", buf, "0.0", "0.9"); + + snprintf (buf, 32, "%d", cdiff[instance]); + optstr_param (options, "cdiff", "Max difference in chroma values", "%d", buf, "0", "16"); + + snprintf (buf, 32, "%d", ldiff[instance]); + optstr_param (options, "ldiff", "Max difference in luma value", "%d", buf, "0", "16"); + + snprintf (buf, 32, "%d", range[instance]); + optstr_param (options, "range", "Search Range", "%d", buf, "0", "16"); return 0; } @@ -204,9 +211,6 @@ optstr_get (options, "range", "%d", &range[instance]); } - width = vob->im_v_width; - height= vob->im_v_height; - tbuf[instance] = (unsigned char *) malloc(SIZE_RGB_FRAME); if (strength[instance]> 0.9) strength[instance] = 0.9; @@ -244,7 +248,7 @@ if(ptr->tag & TC_PRE_PROCESS && ptr->tag & TC_VIDEO) { if (vob->im_v_codec == CODEC_YUV) - smooth_yuv(ptr->video_buf, width, height, cdiff[instance], + smooth_yuv(ptr->video_buf, ptr->v_width, ptr->v_height, cdiff[instance], ldiff[instance], range[instance], strength[instance], instance); } diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/preview/pv.c transcode-0.6.3.20030123/filter/preview/pv.c --- orig-transcode-0.6.3.20030123/filter/preview/pv.c Tue Jan 21 21:15:14 2003 +++ transcode-0.6.3.20030123/filter/preview/pv.c Tue Jan 28 09:32:49 2003 @@ -133,6 +133,19 @@ static int xv_pause=0; +void xv_window_close(xv_display_t *dv_dpy) +{ + dv_dpy->dontdraw = 1; + + XvStopVideo(dv_dpy->dpy, dv_dpy->port, dv_dpy->win); + XDestroyWindow(dv_dpy->dpy, dv_dpy->win); + + tc_socket_submit ("[filter_pv]: preview window close\n"); + //reset + xv_pause=0; +} + + void xv_display_event (xv_display_t *dv_dpy) { int old_pic_format; @@ -225,13 +238,7 @@ // stolen from xmms opengl_plugin -- tibit if ((Atom)(dv_dpy->event.xclient.data.l[0]) == dv_dpy->wm_delete_window_atom) { - dv_dpy->dontdraw = 1; - - XvStopVideo(dv_dpy->dpy, dv_dpy->port, dv_dpy->win); - XDestroyWindow(dv_dpy->dpy, dv_dpy->win); - - //reset - xv_pause=0; + xv_window_close (dv_dpy); } break; @@ -282,14 +289,7 @@ switch(keysym) { case XK_Escape: - dv_dpy->dontdraw = 1; - - XvStopVideo(dv_dpy->dpy, dv_dpy->port, dv_dpy->win); - XDestroyWindow(dv_dpy->dpy, dv_dpy->win); - - //reset - xv_pause=0; - + xv_window_close (dv_dpy); break; case XK_u: diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvdenoise.c transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvdenoise.c --- orig-transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvdenoise.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvdenoise.c Sun Jan 26 09:46:16 2003 @@ -23,7 +23,7 @@ */ #define MOD_NAME "filter_yuvdenoise.so" -#define MOD_VERSION "v0.1.1 (2003-01-21)" +#define MOD_VERSION "v0.1.2 (2003-01-26)" #define MOD_CAP "mjpegs YUV denoiser" #define MOD_AUTHOR "Stefan Fendt, Tilmann Bitterberg" @@ -146,7 +146,7 @@ optstr_param (options, "scene_thres", "Blocks where motion estimation should fail before scenechange", "%d%%", buf, "0", "100" ); sprintf (buf, "%d", denoiser.block_thres); - optstr_param (options, "block_thres", "Every SAD value greater than this will be considered bad", "%d", buf, "0", "-1" ); + optstr_param (options, "block_thres", "Every SAD value greater than this will be considered bad", "%d", buf, "0", "oo" ); sprintf (buf, "%d", denoiser.do_reset); optstr_param (options, "do_reset", "Reset the filter for `n' frames after a scene", "%d", buf, "0", "oo" ); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvmedian.c transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvmedian.c --- orig-transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvmedian.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/filter/yuvdenoise/filter_yuvmedian.c Fri Jan 24 15:26:56 2003 @@ -25,7 +25,7 @@ * this values that fall inside a threshold. */ #define MOD_NAME "filter_yuvmedian.so" -#define MOD_VERSION "v0.0.3 (2003-01-21)" +#define MOD_VERSION "v0.1.0 (2003-01-24)" #define MOD_CAP "mjpegs YUV median filter" #define MOD_AUTHOR "Mike Bernson, Tilmann Bitterberg" @@ -97,7 +97,7 @@ if (ptr->tag & TC_FILTER_GET_CONFIG && options) { char buf[255]; - optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VYO", "1"); + optstr_filter_desc (options, MOD_NAME, MOD_CAP, MOD_VERSION, MOD_AUTHOR, "VYOE", "1"); sprintf (buf, "%d", radius_luma); optstr_param (options, "radius_luma", "Radius for median (luma)", "%d", buf, "1", "24"); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/src/filter.c transcode-0.6.3.20030123/src/filter.c --- orig-transcode-0.6.3.20030123/src/filter.c Thu Jan 23 21:35:00 2003 +++ transcode-0.6.3.20030123/src/filter.c Mon Jan 27 17:27:06 2003 @@ -102,6 +102,7 @@ char *error; int n; + char *c; int id = filter_next_free_id(); @@ -117,7 +118,17 @@ break; } } - + + // delete instance + c = filter[id].name; + while (*c) { + if (*c == '#') { + *c = '\0'; + break; + } + c++; + } + sprintf(module, "%s/filter_%s.so", path, filter[id].name); //fprintf(stderr, "[%s] next free ID (%d) is (%d)\n", __FILE__, filter_next_free_id(), id); diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/src/socket.c transcode-0.6.3.20030123/src/socket.c --- orig-transcode-0.6.3.20030123/src/socket.c Tue Jan 21 21:15:14 2003 +++ transcode-0.6.3.20030123/src/socket.c Fri Jan 24 20:00:57 2003 @@ -331,8 +331,10 @@ ret = TC_SOCK_UNLOAD; } else if (!strncasecmp(buf, "list", 2)) { ret = TC_SOCK_LIST; - } else if (!strncasecmp(buf, "preview", 2)) { + } else if (!strncasecmp(buf, "preview", 3)) { ret = TC_SOCK_PREVIEW; + } else if (!strncasecmp(buf, "progress", 3)) { + ret = TC_SOCK_PROGRESS_METER; } else { ret = TC_SOCK_FAILED; } @@ -471,6 +473,12 @@ case TC_SOCK_PREVIEW: ret = !tc_socket_preview(rbuf); memset (rbuf, 0, M_BUF_SIZE); + break; + case TC_SOCK_PROGRESS_METER: + tc_progress_meter = !tc_progress_meter; + memset (rbuf, 0, M_BUF_SIZE); + break; + default: break; } if (ret>0) diff -Nur -X dontdiff orig-transcode-0.6.3.20030123/src/socket.h transcode-0.6.3.20030123/src/socket.h --- orig-transcode-0.6.3.20030123/src/socket.h Tue Jan 21 21:15:14 2003 +++ transcode-0.6.3.20030123/src/socket.h Fri Jan 24 16:57:28 2003 @@ -43,6 +43,7 @@ TC_SOCK_CONFIG, TC_SOCK_PARAMETER, TC_SOCK_PREVIEW, + TC_SOCK_PROGRESS_METER, }; // The heigh 8 bits are used to pass a char as an arg