diff --git a/veejay-current/veejay-server/libel/lav_io.c b/veejay-current/veejay-server/libel/lav_io.c index c9e2b7ee..c2dae40e 100644 --- a/veejay-current/veejay-server/libel/lav_io.c +++ b/veejay-current/veejay-server/libel/lav_io.c @@ -58,18 +58,6 @@ static int internal_error=0; #define ERROR_FORMAT 3 #define ERROR_NOAUDIO 4 -static unsigned long jpeg_field_size = 0; -static unsigned long jpeg_quant_offset = 0; -static unsigned long jpeg_huffman_offset = 0; -static unsigned long jpeg_image_offset = 0; -static unsigned long jpeg_scan_offset = 0; -static unsigned long jpeg_data_offset = 0; -static unsigned long jpeg_padded_len = 0; -static unsigned long jpeg_app0_offset = 0; -static unsigned long jpeg_app1_offset = 0; - -uint16_t reorder_16(uint16_t todo, int big_endian); - #ifdef USE_GDK_PIXBUF static int output_scale_width = 0; static int output_scale_height = 0; @@ -98,159 +86,8 @@ void lav_set_project(int w, int h, float f, int fmt) #define M_DQT 0xDB #define M_APP0 0xE0 #define M_APP1 0xE1 - - -#ifdef HAVE_LIBQUICKTIME -/* - put_int4: - Put a 4 byte integer value into a character array as big endian number -*/ - -static void put_int4(unsigned char *buf, int val) -{ - buf[0] = (val >> 24); - buf[1] = (val >> 16); - buf[2] = (val >> 8 ); - buf[3] = (val ); -} -#endif - -//#ifdef SUPPORT_READ_DV2 -//static int check_DV2_input(lav_file_t *lav_fd); -//#endif - #define TMP_EXTENSION ".tmp" -/* - get_int2: - get a 2 byte integer value from a character array as big endian number - */ - -static int get_int2(unsigned char *buff) -{ - return (buff[0]*256 + buff[1]); -} - -/* - scan_jpeg: - Scan jpeg data for markers, needed for Quicktime MJPA format - and partly for AVI files. - Taken mostly from Adam Williams' quicktime library - */ - -static int scan_jpeg(unsigned char * jpegdata, long jpeglen, int header_only) -{ - int marker, length; - long p; - - jpeg_field_size = 0; - jpeg_quant_offset = 0; - jpeg_huffman_offset = 0; - jpeg_image_offset = 0; - jpeg_scan_offset = 0; - jpeg_data_offset = 0; - jpeg_padded_len = 0; - jpeg_app0_offset = 0; - jpeg_app1_offset = 0; - - /* The initial marker must be SOI */ - - if (jpegdata[0] != 0xFF || jpegdata[1] != M_SOI) return -1; - - /* p is the pointer within the jpeg data */ - - p = 2; - - /* scan through the jpeg data */ - - while(p=jpeglen) return -1; - } - - /* Get marker code byte, swallowing any duplicate FF bytes */ - while(jpegdata[p] == 0xFF) - { - p++; - if(p>=jpeglen) return -1; - } - - marker = jpegdata[p++]; - - if(p<=jpeglen-2) - length = get_int2(jpegdata+p); - else - length = 0; - - /* We found a marker - check it */ - - if(marker == M_EOI) { jpeg_field_size = p; break; } - - switch(marker) - { - case M_SOF0: - case M_SOF1: - jpeg_image_offset = p-2; - break; - case M_DQT: - if(jpeg_quant_offset==0) jpeg_quant_offset = p-2; - break; - case M_DHT: - if(jpeg_huffman_offset==0) jpeg_huffman_offset = p-2; - break; - case M_SOS: - jpeg_scan_offset = p-2; - jpeg_data_offset = p+length; - if(header_only) return 0; /* we are done with the headers */ - break; - case M_APP0: - if(jpeg_app0_offset==0) jpeg_app0_offset = p-2; - break; - case M_APP1: - if(jpeg_app1_offset==0) jpeg_app1_offset = p-2; - break; - } - - /* The pseudo marker as well as the markers M_TEM (0x01) - and M_RST0 ... M_RST7 (0xd0 ... 0xd7) have no paramters. - M_SOI and M_EOI also have no parameters, but we should - never come here in that case */ - - if(marker == 0 || marker == 1 || (marker >= 0xd0 && marker <= 0xd7)) - continue; - - /* skip length bytes */ - - if(p+length<=jpeglen) - p += length; - else - return -1; - } - - /* We are through parsing the jpeg data, we should have seen M_EOI */ - - if(!jpeg_field_size) return -1; - - /* Check for trailing garbage until jpeglen is reached or a new - M_SOI is seen */ - - while(pformat; internal_error = 0; /* for error messages */ #ifdef SUPPORT_READ_DV2 if(video_format == 'b') @@ -1152,11 +989,9 @@ int lav_filetype(lav_file_t *lav_file) lav_file_t *lav_open_input_file(char *filename, long mmap_size) { - int n; static char pict[5] = "PICT\0"; char *video_comp = NULL; unsigned char *frame = NULL; - long len; int ierr; lav_file_t *lav_fd = (lav_file_t*) vj_calloc(sizeof(lav_file_t)); @@ -1502,22 +1337,6 @@ ERREXIT: return 0; } -/* Get size of first field of for a data array containing - (possibly) two jpeg fields */ - -int lav_get_field_size(uint8_t * jpegdata, long jpeglen) -{ - int res; - - res = scan_jpeg(jpegdata,jpeglen,0); - if(res<0) return jpeglen; /* Better than nothing */ - - /* we return jpeg_padded len since this routine is used - for field exchange where alignment might be important */ - - return jpeg_padded_len; -} - const char *lav_strerror(void) { static char error_string[1024]; @@ -1650,24 +1469,6 @@ int lav_fileno(lav_file_t *lav_file) return res; } -/* We need this to reorder the 32 bit values for big endian systems */ -uint32_t reorder_32(uint32_t todo, int big_endian) -{ - unsigned char b0, b1, b2, b3; - unsigned long reversed; - - if( big_endian ) - { - b0 = (todo & 0x000000FF); - b1 = (todo & 0x0000FF00) >> 8; - b2 = (todo & 0x00FF0000) >> 16; - b3 = (todo & 0xFF000000) >> 24; - - reversed = (b0 << 24) + (b1 << 16) + (b2 << 8) +b3; - return reversed; - } - return todo; -} int lav_detect_endian (void) { unsigned int fred; @@ -1693,6 +1494,3 @@ int lav_detect_endian (void) - - - diff --git a/veejay-current/veejay-server/libel/pixbuf.c b/veejay-current/veejay-server/libel/pixbuf.c index 6841ad2c..878c4f9d 100644 --- a/veejay-current/veejay-server/libel/pixbuf.c +++ b/veejay-current/veejay-server/libel/pixbuf.c @@ -338,7 +338,7 @@ static void vj_picture_out_cleanup( vj_pixbuf_out_t *pic ) } static void *pic_scaler_ = NULL; -static int pic_data_[3] = { 0,0,0,0}; +static int pic_data_[3] = { 0,0,0}; static int pic_changed_ = 0; static sws_template *pic_template_ = NULL; diff --git a/veejay-current/veejay-server/libplugger/frei0r-loader.c b/veejay-current/veejay-server/libplugger/frei0r-loader.c index fd32c823..895eebeb 100644 --- a/veejay-current/veejay-server/libplugger/frei0r-loader.c +++ b/veejay-current/veejay-server/libplugger/frei0r-loader.c @@ -364,7 +364,6 @@ int frei0r_get_params_f( void *port, int *args ) int i; int vj_seq_no = 0; - char key[20]; f0r_get_param_value_f q = NULL; err = vevo_property_get( parent, "get_params", 0, &q); diff --git a/veejay-current/veejay-server/libsample/sampleadm.c b/veejay-current/veejay-server/libsample/sampleadm.c index a226b2a3..87efe7fe 100644 --- a/veejay-current/veejay-server/libsample/sampleadm.c +++ b/veejay-current/veejay-server/libsample/sampleadm.c @@ -239,23 +239,23 @@ void *sample_get_dict( int sample_id ) * call before using any other function as sample_skeleton_new * ****************************************************************************************************/ -void sample_init(int len, void *font, editlist *pedl) +int sample_init(int len, void *font, editlist *pedl) { if (!initialized) { - int i; - veejay_memset(avail_num, 0, sizeof(avail_num)); - - this_sample_id = 1; /* do not start with zero */ - if (! - (SampleHash = - hash_create(HASHCOUNT_T_MAX, int_compare, int_hash))) { - } - initialized = 1; - veejay_memset( &__sample_project_settings,0,sizeof(sample_setting)); + veejay_memset(avail_num, 0, sizeof(avail_num)); + this_sample_id = 1; /* do not start with zero */ + SampleHash = hash_create(HASHCOUNT_T_MAX, int_compare, int_hash); + if(!SampleHash) { + return 0; + } + initialized = 1; + veejay_memset( &__sample_project_settings,0,sizeof(sample_setting)); } sample_font_ = font; plain_editlist = pedl; + + return 1; } void sample_free(void *edl) @@ -316,7 +316,6 @@ static int _new_id() ****************************************************************************************************/ sample_info *sample_skeleton_new(long startFrame, long endFrame) { - char tmp_file[128]; sample_info *si; int i; diff --git a/veejay-current/veejay-server/libsample/sampleadm.h b/veejay-current/veejay-server/libsample/sampleadm.h index e810562d..f4f3c28f 100644 --- a/veejay-current/veejay-server/libsample/sampleadm.h +++ b/veejay-current/veejay-server/libsample/sampleadm.h @@ -186,7 +186,7 @@ extern int sample_chain_malloc(int sample_id); extern int sample_chain_free(int sample_id); extern int sample_size(); extern int sample_verify(); -extern void sample_init(int len, void *font, editlist *el); +extern int sample_init(int len, void *font, editlist *el); extern int sample_update(sample_info *sample, int s1); #ifdef HAVE_XML2 extern int sample_readFromFile(char *, void *vp, void *ptr, void *font, void *el, int *id, int *mode); diff --git a/veejay-current/veejay-server/libstream/v4l2utils.c b/veejay-current/veejay-server/libstream/v4l2utils.c index 14fb8ccc..41dc63a6 100644 --- a/veejay-current/veejay-server/libstream/v4l2utils.c +++ b/veejay-current/veejay-server/libstream/v4l2utils.c @@ -42,11 +42,6 @@ * */ - -//@ FIXME: not all drivers implement TRY_FMT -//@ FIXME: find maximum width/height: start with large and TRY_FMT -//@ TODO: add support for tuner (set frequency) -// #include #ifdef HAVE_V4L2 #include @@ -1675,7 +1670,6 @@ int32_t v4l2_get_control( void *d, int32_t type ) float range0 = (queryctrl.maximum - queryctrl.minimum); float range1 = 1.0f; - int32_t oldval = control.value; float weight = (( control.value - queryctrl.minimum ) * range1) / range0; control.value = (int) (weight * 65535); @@ -1787,7 +1781,7 @@ int v4l2_reset_roi( void *d ) return 1; } -int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d) +int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d, int *dwidth, int *dheight, double *daspect) { v4l2info *v = (v4l2info*)d; struct v4l2_cropcap cropcap; @@ -1795,7 +1789,6 @@ int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d) struct v4l2_format format; double hscale, vscale; double aspect; - int dwidth, dheight; memset (&cropcap, 0, sizeof (cropcap)); cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -1822,14 +1815,14 @@ int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d) vscale = format.fmt.pix.height / (double) crop.c.height; aspect = cropcap.pixelaspect.numerator / (double) cropcap.pixelaspect.denominator; - aspect = aspect * hscale / vscale; + *daspect = aspect * hscale / vscale; /* Devices following ITU-R BT.601 do not capture square pixels. For playback on a computer monitor we should scale the images to this size. */ - dwidth = format.fmt.pix.width / aspect; - dheight = format.fmt.pix.height; + *dwidth = format.fmt.pix.width / aspect; + *dheight = format.fmt.pix.height; return 1; } diff --git a/veejay-current/veejay-server/libstream/v4l2utils.h b/veejay-current/veejay-server/libstream/v4l2utils.h index 742a7804..746071e1 100644 --- a/veejay-current/veejay-server/libstream/v4l2utils.h +++ b/veejay-current/veejay-server/libstream/v4l2utils.h @@ -49,7 +49,7 @@ void v4l2_get_controls( void *d, void *port ); int32_t v4l2_get_control( void *d, int32_t type ); int v4l2_set_roi( void *d, int w, int h, int x, int y ); int v4l2_reset_roi( void *d ); -int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d); +int v4l2_get_currentscaling_factor_and_pixel_aspect(void *d, int *w, int *h, double *aspect); int v4l2_num_devices(); char **v4l2_get_device_list(); int v4l2_get_composite_status( void *d ); diff --git a/veejay-current/veejay-server/libstream/vj-tag.c b/veejay-current/veejay-server/libstream/vj-tag.c index 87cdd384..367672ba 100644 --- a/veejay-current/veejay-server/libstream/vj-tag.c +++ b/veejay-current/veejay-server/libstream/vj-tag.c @@ -3784,8 +3784,6 @@ static void tagParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample) int anim= 0; int anim_type = 0; int chain_index = 0; - int a_flag = 0; - int volume = 0; veejay_memset( arg, 0, sizeof(arg)); @@ -3885,31 +3883,9 @@ static void tagParseEffect(xmlDocPtr doc, xmlNodePtr cur, int dst_sample) } - if (!xmlStrcmp - (cur->name, (const xmlChar *) XMLTAG_EFFECTAUDIOFLAG)) { - xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - chTemp = UTF8toLAT1(xmlTemp); - if (chTemp) { - a_flag = atoi(chTemp); - free(chTemp); - } - if(xmlTemp) xmlFree(xmlTemp); - - } - - if (!xmlStrcmp - (cur->name, (const xmlChar *) XMLTAG_EFFECTAUDIOVOLUME)) { - xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); - chTemp = UTF8toLAT1(xmlTemp); - if (chTemp) { - volume = atoi(chTemp); - free(chTemp); - } - if(xmlTemp) xmlFree(xmlTemp); - } if (!xmlStrcmp(cur->name, (const xmlChar *) XMLTAG_ARGUMENTS)) { - tagParseArguments(doc, cur->xmlChildrenNode, arg ); - } + tagParseArguments(doc, cur->xmlChildrenNode, arg ); + } // xmlTemp and chTemp should be freed after use xmlTemp = NULL; @@ -4025,11 +4001,10 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon char *extra_data = NULL; int col[3] = {0,0,0}; int fader_active=0, fader_val=0, fader_dir=0, fade_method=0,fade_alpha = 0,fade_entry = -1,opacity=0, nframes=0; - int subrender = 0; xmlNodePtr fx[32]; veejay_memset( fx, 0, sizeof(fx)); int k = 0; - + int subrender = 0; xmlNodePtr subs = NULL; xmlNodePtr cali = NULL; void *d = vj_font_get_dict( font ); @@ -4134,7 +4109,8 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon tag->fader_direction = fader_dir; tag->opacity = opacity; tag->nframes = nframes; - + tag->subrender = subrender; + switch( source_type ) { case VJ_TAG_TYPE_COLOR: diff --git a/veejay-current/veejay-server/libsubsample/subsample.c b/veejay-current/veejay-server/libsubsample/subsample.c index a0f03256..b7b6fa9c 100644 --- a/veejay-current/veejay-server/libsubsample/subsample.c +++ b/veejay-current/veejay-server/libsubsample/subsample.c @@ -63,10 +63,6 @@ const char *ssm_description[SSM_COUNT] = { #endif }; -// forward decl -void ss_420_to_422(uint8_t *buffer, int width, int height); -void ss_422_to_420(uint8_t *buffer, int width, int height); - /************************************************************************* * Chroma Subsampling *************************************************************************/ @@ -411,19 +407,6 @@ static void ss_420jpeg_to_444(uint8_t *buffer, int width, int height) #endif } - -void ss_420_to_422(uint8_t *buffer, int width, int height) -{ - - //todo, 1x2 super sampling (box) -} - -void ss_422_to_420(uint8_t *buffer, int width, int height ) -{ - - //todo 2x1 down sampling (box) -} - static inline void downsample2x1( const uint8_t *src, uint8_t *dst, const int width ) { unsigned int x; @@ -470,7 +453,7 @@ static inline void downsample32x16( const uint8_t *src, uint8_t *dst, const int static void ss_444_to_422_cp(uint8_t *buffer, uint8_t *dest, int width, int height) { const unsigned int dst_stride = width >> 1; - int x,y; + int y; #ifdef HAVE_ASM_MMX const unsigned int left = dst_stride % 8; subsample_load_mask16to8(); @@ -514,11 +497,11 @@ static void tr_422_to_444( uint8_t *buffer, int width, int height) } #else const int mmx_stride = stride >> 3; - int left = (mmx_stride % 16); + int left = (mmx_stride % 16); /* FIXME */ for( y = height -1 ; y > 0; y -- ) { uint8_t *src = buffer + (y* stride); uint8_t *dst = buffer + (y* width); - unsigned int x1 = 0,x2=0; + unsigned int x1 = 0; for( x = 0; x < stride; x += 16, x1 += 32 ) { subsample_up_1x16to1x32( &src[x], &dst[x1] ); } @@ -547,11 +530,11 @@ static void tr_422_to_444t(uint8_t *out, uint8_t *in, int width, int height) } #else const int mmx_stride = stride >> 3; - int left = (mmx_stride % 16); + int left = (mmx_stride % 16); /* FIXME */ + int x1 = 0; for( y = height -1 ; y > 0; y -- ) { uint8_t *src = in + (y* stride); uint8_t *dst = out + (y* width); - unsigned int x1 = 0,x2=0; for( x = 0; x < stride; x += 16, x1 += 32 ) { subsample_up_1x16to1x32(&src[x], &dst[x1] ); } @@ -625,18 +608,13 @@ static void chroma_subsample_task( void *ptr ) case SSM_420_MPEG2: ss_444_to_420mpeg2(f->input[1], f->width, f->height); ss_444_to_420mpeg2(f->input[2], f->width, f->height); - break; + break; case SSM_422_444: ss_444_to_422_cp(f->output[1],f->input[1],f->width,f->height); ss_444_to_422_cp(f->output[2],f->input[2],f->width,f->height); break; - case SSM_420_422: - ss_422_to_420(f->input[1],f->width,f->height); - ss_422_to_420(f->input[2],f->width,f->height); - break; default: - break; - + break; } } static void chroma_supersample_task( void *ptr ) @@ -644,26 +622,21 @@ static void chroma_supersample_task( void *ptr ) vj_task_arg_t *f = (vj_task_arg_t*) ptr; switch (f->iparams[0]) { - case SSM_420_JPEG_BOX: - ss_420jpeg_to_444(f->input[1], f->width, f->height); - ss_420jpeg_to_444(f->input[2], f->width, f->height); - break; - case SSM_420_JPEG_TR: - tr_420jpeg_to_444(f->priv,f->input[1], f->width, f->height); - tr_420jpeg_to_444(f->priv,f->input[2], f->width, f->height); - break; - case SSM_422_444: - tr_422_to_444t(f->input[1],f->output[1],f->width,f->height); - tr_422_to_444t(f->input[2],f->output[2],f->width,f->height); - break; - case SSM_420_422: - ss_420_to_422( f->input[1], f->width, f->height ); - ss_420_to_422( f->input[2], f->width, f->height ); - break; - default: - break; - } - + case SSM_420_JPEG_BOX: + ss_420jpeg_to_444(f->input[1], f->width, f->height); + ss_420jpeg_to_444(f->input[2], f->width, f->height); + break; + case SSM_420_JPEG_TR: + tr_420jpeg_to_444(f->priv,f->input[1], f->width, f->height); + tr_420jpeg_to_444(f->priv,f->input[2], f->width, f->height); + break; + case SSM_422_444: + tr_422_to_444t(f->input[1],f->output[1],f->width,f->height); + tr_422_to_444t(f->input[2],f->output[2],f->width,f->height); + break; + default: + break; + } } void chroma_subsample_cp(subsample_mode_t mode,VJFrame *frame, uint8_t *ycbcr[], uint8_t *dcbcr[]) @@ -701,10 +674,6 @@ void chroma_subsample(subsample_mode_t mode, VJFrame *frame, uint8_t *ycbcr[] ) ss_444_to_422_cp(ycbcr[1],ycbcr[1],frame->width,frame->height); ss_444_to_422_cp(ycbcr[2],ycbcr[2],frame->width,frame->height); break; - case SSM_420_422: - ss_422_to_420(ycbcr[1],frame->width,frame->height); - ss_422_to_420(ycbcr[2],frame->width,frame->height); - break; default: break; } @@ -732,10 +701,6 @@ void chroma_supersample(subsample_mode_t mode,VJFrame *frame, uint8_t *ycbcr[] ) tr_422_to_444(ycbcr[1],frame->width,frame->height); tr_422_to_444(ycbcr[2],frame->width,frame->height); break; - case SSM_420_422: - ss_420_to_422( ycbcr[1], frame->width, frame->height ); - ss_420_to_422( ycbcr[2], frame->width, frame->height ); - break; default: break; } diff --git a/veejay-current/veejay-server/libvje/effects/colormap.c b/veejay-current/veejay-server/libvje/effects/colormap.c index 8ba4d422..d25e95df 100644 --- a/veejay-current/veejay-server/libvje/effects/colormap.c +++ b/veejay-current/veejay-server/libvje/effects/colormap.c @@ -55,7 +55,6 @@ vj_effect *colormap_init(int w, int h) void colormap_apply( VJFrame *frame, int width, int height, int r, int g, int b) { unsigned int i; - const unsigned int len = frame->len; const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len ); uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/complexthreshold.c b/veejay-current/veejay-server/libvje/effects/complexthreshold.c index 55d08dad..48aea4b7 100644 --- a/veejay-current/veejay-server/libvje/effects/complexthreshold.c +++ b/veejay-current/veejay-server/libvje/effects/complexthreshold.c @@ -116,7 +116,7 @@ void complexthreshold_apply(VJFrame *frame, VJFrame *frame2, int width, uint8_t *Y2 = frame2->data[0]; uint8_t *Cb2 = frame2->data[1]; uint8_t *Cr2 = frame2->data[2]; - int iy,iv,iu; + int iy=0,iv=128,iu=128; _rgb2yuv(r,g,b,iy,iu,iv); _y = (float)iy; aa = (float)iu; diff --git a/veejay-current/veejay-server/libvje/effects/contourextract.c b/veejay-current/veejay-server/libvje/effects/contourextract.c index 0d69e6bb..49aabade 100644 --- a/veejay-current/veejay-server/libvje/effects/contourextract.c +++ b/veejay-current/veejay-server/libvje/effects/contourextract.c @@ -206,11 +206,6 @@ int contourextract_prepare(uint8_t *map[4], int width, int height) return 1; } -static void contourextract_centroid() -{ - -} - static int bg_frame_ = 0; void contourextract_apply(void *ed, VJFrame *frame,int width, int height, @@ -231,7 +226,6 @@ void contourextract_apply(void *ed, VJFrame *frame,int width, int height, float sx = (float) width / (float) dw_; float sy = (float) height / (float) dh_; - float sw = (float) sqrt( sx * sy ); veejay_memset( cx,0,sizeof(cx)); veejay_memset( cy,0,sizeof(cy)); @@ -258,8 +252,6 @@ void contourextract_apply(void *ed, VJFrame *frame,int width, int height, return; } - int packets = 0; - //@ clear distance transform map veejay_memset( dt_map, 0 , len * sizeof(uint32_t) ); @@ -315,8 +307,6 @@ void contourextract_apply(void *ed, VJFrame *frame,int width, int height, int y2 = ny + size_y; int n_points = 0; int center = 0; - int dx1 = 0,dy1=0; - if( x1 < 0 ) x1 = 0; else if ( x1 > width ) x1 = width; if( x2 < 0 ) x2 = 0; else if ( x2 > width ) x2 = width; @@ -332,8 +322,6 @@ void contourextract_apply(void *ed, VJFrame *frame,int width, int height, if( dt_map[ (k * width + j) ] > center ) { center = dt_map[ (k* width +j) ]; - dx1 = j; - dy1 = k; } if( dt_map[ (k * width + j) ] == feather ) { diff --git a/veejay-current/veejay-server/libvje/effects/greyselect.c b/veejay-current/veejay-server/libvje/effects/greyselect.c index 55acb209..f41ceaed 100644 --- a/veejay-current/veejay-server/libvje/effects/greyselect.c +++ b/veejay-current/veejay-server/libvje/effects/greyselect.c @@ -69,15 +69,15 @@ void greyselect_apply( VJFrame *frame, int width, { uint8_t *fg_cb, *fg_cr; - int accept_angle_tg, accept_angle_ctg; - int cb, cr; + int accept_angle_tg; + int cb, cr; float kg1, tmp, aa = 255.0f, bb = 255.0f, _y = 0; float angle = (float) i_angle / 100.0f; unsigned int pos; uint8_t val; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; - int iy,iu,iv; + int iy=0,iu=128,iv=128; _rgb2yuv(r,g,b,iy,iu,iv); _y = (float) iy; aa = (float) iu; @@ -90,8 +90,6 @@ void greyselect_apply( VJFrame *frame, int width, /* obtain coordinate system for cb / cr */ accept_angle_tg = (int)( 15.0f * tanf(M_PI * angle / 180.0f)); - accept_angle_ctg= (int)( 15.0f / tanf(M_PI * angle / 180.0f)); - tmp = 1 / kg1; /* intialize pointers */ diff --git a/veejay-current/veejay-server/libvje/effects/overclock.c b/veejay-current/veejay-server/libvje/effects/overclock.c index 6fe678a1..1f873ec7 100644 --- a/veejay-current/veejay-server/libvje/effects/overclock.c +++ b/veejay-current/veejay-server/libvje/effects/overclock.c @@ -78,7 +78,7 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstSt } //copied from xine -static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){ +static void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){ uint8_t temp[2][4096]; uint8_t *a= temp[0], *b=temp[1]; diff --git a/veejay-current/veejay-server/libvje/effects/slice.c b/veejay-current/veejay-server/libvje/effects/slice.c index e35e0973..675fc795 100644 --- a/veejay-current/veejay-server/libvje/effects/slice.c +++ b/veejay-current/veejay-server/libvje/effects/slice.c @@ -97,7 +97,7 @@ void slice_recalc(int width, int height, int val) { if(dx==0) { r = ((rand() & val))-((val>>1)+1); - dx = 8 + (rand() & ((val>>1))-1); + dx = 8 + (rand() & ((val>>1)-1)); } else { @@ -107,7 +107,7 @@ void slice_recalc(int width, int height, int val) { } for(y=dy=0; y < height; y++) { - if(dy==0) { r = (rand() & val)-((val>>1)+1); dy = 8 + rand() & ((val>>1)-1); } else dy--; + if(dy==0) { r = (rand() & val)-((val>>1)+1); dy = 8 + (rand() & ((val>>1)-1)); } else dy--; slice_xshift[y] = r; } } diff --git a/veejay-current/veejay-server/libvje/effects/threshold.c b/veejay-current/veejay-server/libvje/effects/threshold.c index dca8b647..09f69e69 100644 --- a/veejay-current/veejay-server/libvje/effects/threshold.c +++ b/veejay-current/veejay-server/libvje/effects/threshold.c @@ -74,16 +74,6 @@ void threshold_free(void) #define MAX(a,b) ( (a)>(b) ? (a) : (b) ) #endif -static int _dilate_kernel3x3( uint8_t *kernel, uint8_t img[9]) -{ - register int x; - /* consider all background pixels (0) in input image */ - for(x = 0; x < 9; x ++ ) - if((kernel[x] * img[x]) > 0 ) - return 1; - return 0; -} - void threshold_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int threshold, int reverse ) { unsigned int y,x; diff --git a/veejay-current/veejay-server/libvjmsg/vj-common.c b/veejay-current/veejay-server/libvjmsg/vj-common.c index 59b86eef..474b4111 100644 --- a/veejay-current/veejay-server/libvjmsg/vj-common.c +++ b/veejay-current/veejay-server/libvjmsg/vj-common.c @@ -47,7 +47,6 @@ #include #include #include -#include #ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY #include @@ -166,28 +165,6 @@ void veejay_print_backtrace() } #endif -void veejay_backtrace_handler(int n , void *dist, void *x) -{ - switch(n) { - case SIGSEGV: - veejay_msg(VEEJAY_MSG_ERROR,"Found Gremlins in your system."); //@ Suggested by Matthijs - veejay_msg(VEEJAY_MSG_WARNING, "No fresh ale found in the fridge."); //@ - veejay_msg(VEEJAY_MSG_INFO, "Running with sub-atomic precision..."); //@ - - veejay_print_backtrace(); - break; - default: - veejay_print_backtrace(); - break; - } - - //@ Bye - veejay_msg(VEEJAY_MSG_ERROR, "Bugs compromised the system."); - - report_bug(); - - exit(EX_SOFTWARE); -} int veejay_get_debug_level() { diff --git a/veejay-current/veejay-server/libvjmsg/vj-msg.h b/veejay-current/veejay-server/libvjmsg/vj-msg.h index 6a08bf21..8a4cc012 100644 --- a/veejay-current/veejay-server/libvjmsg/vj-msg.h +++ b/veejay-current/veejay-server/libvjmsg/vj-msg.h @@ -20,7 +20,6 @@ #define VJ_COMMON_H #include #include - enum { VEEJAY_MSG_INFO = 2, VEEJAY_MSG_WARNING = 1, @@ -29,7 +28,7 @@ enum { VEEJAY_MSG_DEBUG = 4, }; -extern void veejay_backtrace_handler(int n , void *ist, void *x); +extern void veejay_print_backtrace(); extern void veejay_strrep(char *s, char delim, char tok); extern void report_bug(); extern void veejay_msg(int type, const char format[], ...); diff --git a/veejay-current/veejay-server/veejay/liblavplayvj.c b/veejay-current/veejay-server/veejay/liblavplayvj.c index e9ae72c5..40e178e2 100644 --- a/veejay-current/veejay-server/veejay/liblavplayvj.c +++ b/veejay-current/veejay-server/veejay/liblavplayvj.c @@ -1832,7 +1832,10 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t return -1; } - sample_init( (info->video_output_width * info->video_output_height), info->font, info->plain_editlist ); + if(!sample_init( (info->video_output_width * info->video_output_height), info->font, info->plain_editlist ) ) { + veejay_msg(VEEJAY_MSG_ERROR, "Internal error while initializing sample administrator"); + return -1; + } sample_set_project(info->pixel_format, info->auto_deinterlace, diff --git a/veejay-current/veejay-server/veejay/veejay.c b/veejay-current/veejay-server/veejay/veejay.c index f1082baa..b28ec5c3 100644 --- a/veejay-current/veejay-server/veejay/veejay.c +++ b/veejay-current/veejay-server/veejay/veejay.c @@ -21,6 +21,7 @@ #define VJ_PROMPT "$> " #include #include +#include #include #include #include @@ -554,7 +555,6 @@ static int set_option(const char *name, char *value) static int check_command_line_options(int argc, char *argv[]) { - int stop = 0; int nerr, n, option_index = 0; char option[2]; #ifdef HAVE_GETOPT_LONG @@ -720,12 +720,35 @@ static void donothing(int sig) vj_unlock(info); } +static void veejay_backtrace_handler(int n , siginfo_t *si, void *ptr) +{ + switch(n) { + case SIGSEGV: + veejay_msg(VEEJAY_MSG_ERROR,"Found Gremlins in your system."); //@ Suggested by Matthijs + veejay_msg(VEEJAY_MSG_WARNING, "No fresh ale found in the fridge."); //@ + veejay_msg(VEEJAY_MSG_INFO, "Running with sub-atomic precision..."); //@ + + veejay_print_backtrace(); + break; + default: + veejay_print_backtrace(); + break; + } + + //@ Bye + veejay_msg(VEEJAY_MSG_ERROR, "Bugs compromised the system."); + + report_bug(); + + exit(EX_SOFTWARE); +} + static void sigsegfault_handler(void) { struct sigaction sigst; sigemptyset(&sigst.sa_mask); sigaddset(&sigst.sa_mask, SIGSEGV ); sigst.sa_flags = SA_SIGINFO | SA_ONESHOT; - sigst.sa_sigaction = veejay_backtrace_handler; + sigst.sa_sigaction = &veejay_backtrace_handler; if( sigaction(SIGSEGV, &sigst, NULL) == - 1) veejay_msg(0,"sigaction"); diff --git a/veejay-current/veejay-server/veejay/vj-misc.c b/veejay-current/veejay-server/veejay/vj-misc.c index 7d18ed13..be3e0f66 100644 --- a/veejay-current/veejay-server/veejay/vj-misc.c +++ b/veejay-current/veejay-server/veejay/vj-misc.c @@ -649,9 +649,9 @@ int veejay_sprintf( char *s, size_t size, const char *format, ... ) void xml2flt( xmlDocPtr doc, xmlNodePtr cur, float *dst , const xmlChar *name) { if(!xmlStrcmp(cur->name, name ) ) { xmlChar *xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode,1); - unsigned char *chTemp = UTF8toLAT1(xmlTemp); + char *chTemp = UTF8toLAT1(xmlTemp); if (chTemp) { - *dst = (float) atof( (char*)chTemp); + *dst = (float) atof( chTemp); free(chTemp); } free(xmlTemp); @@ -660,9 +660,9 @@ void xml2flt( xmlDocPtr doc, xmlNodePtr cur, float *dst , const xmlChar *name) { void xml2int( xmlDocPtr doc, xmlNodePtr cur, int *dst , const xmlChar *name) { if(!xmlStrcmp(cur->name, name ) ) { xmlChar *xmlTemp = xmlNodeListGetString(doc, cur->xmlChildrenNode,1); - unsigned char *chTemp = UTF8toLAT1(xmlTemp); + char *chTemp = UTF8toLAT1(xmlTemp); if (chTemp) { - *dst = (int) atoi( (char*)chTemp); + *dst = (int) atoi( chTemp); free(chTemp); } free(xmlTemp); diff --git a/veejay-current/veejay-server/veejay/vj-split.c b/veejay-current/veejay-server/veejay/vj-split.c index d61319c3..81f65137 100644 --- a/veejay-current/veejay-server/veejay/vj-split.c +++ b/veejay-current/veejay-server/veejay/vj-split.c @@ -549,11 +549,11 @@ static void vj_split_copy_plane_mmx( uint8_t *D, uint8_t *S, int left, int right static void vj_split_copy_plane( uint8_t *D, uint8_t *S, int left, int right, int top, int bottom, int w, int h ) { +#ifndef HAVE_ASM_MMX int y = top; int dh = bottom; - int x = 0; int nxt = 0; -#ifndef HAVE_ASM_MMX + int x = 0; for( y = top; y < dh; y ++ ) { for( x = left; x < right; x ++ ) { D[nxt] = S[ y * w + x]; diff --git a/veejay-current/veejay-server/veejay/vj-viewport.c b/veejay-current/veejay-server/veejay/vj-viewport.c index 6feb6997..d342b73c 100644 --- a/veejay-current/veejay-server/veejay/vj-viewport.c +++ b/veejay-current/veejay-server/veejay/vj-viewport.c @@ -1855,7 +1855,6 @@ void *viewport_init(int x0, int y0, int w0, int h0, int w, int h, int iw, int ih const int len = v->w * v->h; const int eln = len + ( v->w * 2 ); - int k; veejay_memset( v->map, len+1, eln ); @@ -1868,7 +1867,7 @@ void *viewport_init(int x0, int y0, int w0, int h0, int w, int h, int iw, int ih if(v->grid_resolution > 0) viewport_compute_grid(v); - return (void*)v; + return (void*)v; } void *viewport_clone(void *vv, int new_w, int new_h ) @@ -3357,9 +3356,6 @@ void *viewport_fx_init_map( int wid, int hei, int x1, int y1, { viewport_t *v = (viewport_t*) vj_calloc(sizeof(viewport_t)); - float fracx = (float) wid / 100.0f; - float fracy = (float) hei / 100.0f; - v->x1 = x1; v->y1 = y1; v->x2 = x2; @@ -3390,7 +3386,6 @@ void *viewport_fx_init_map( int wid, int hei, int x1, int y1, return NULL; } - return (void*)v; }