diff --git a/veejay-current/veejay-server/bio2jack/bio2jack.c b/veejay-current/veejay-server/bio2jack/bio2jack.c index 2a0d47a9..94ee2e64 100644 --- a/veejay-current/veejay-server/bio2jack/bio2jack.c +++ b/veejay-current/veejay-server/bio2jack/bio2jack.c @@ -2096,7 +2096,7 @@ JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, long elapsedMS; double sec2msFactor = 1000; - char *type_str = "UNKNOWN type"; + //char *type_str = "UNKNOWN type"; /* if we are reset we should return a position of 0 */ if(drv->state == RESET) @@ -2107,15 +2107,15 @@ JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, if(type == WRITTEN) { - type_str = "WRITTEN"; + // type_str = "WRITTEN"; return_val = drv->client_bytes; } else if(type == WRITTEN_TO_JACK) { - type_str = "WRITTEN_TO_JACK"; +// type_str = "WRITTEN_TO_JACK"; return_val = drv->written_client_bytes; } else if(type == PLAYED) /* account for the elapsed time for the played_bytes */ { - type_str = "PLAYED"; +// type_str = "PLAYED"; return_val = drv->played_client_bytes; // gettimeofday(&now, 0); clock_gettime( CLOCK_REALTIME, &now ); @@ -2156,8 +2156,8 @@ JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position, } } - TRACE("drv->deviceID(%d), type(%s), return_val = %ld\n", drv->deviceID, - type_str, return_val); +// TRACE("drv->deviceID(%d), type(%s), return_val = %ld\n", drv->deviceID, +// type_str, return_val); return return_val; } diff --git a/veejay-current/veejay-server/doc/README.video_formats.txt b/veejay-current/veejay-server/doc/README.video_formats.txt index 1389d8c8..e1e9206c 100644 --- a/veejay-current/veejay-server/doc/README.video_formats.txt +++ b/veejay-current/veejay-server/doc/README.video_formats.txt @@ -3,3 +3,5 @@ Recommended format is MJPEG Transcode your video with: ffmpeg -i input-file -vcodec mjpeg -pix_fmt yuvj422p -q:v 0 output-file.avi + +Optionally add PCM 16bit audio, 44.1/48.0 Khz, 2 channels, 8 bits per channel diff --git a/veejay-current/veejay-server/doc/YCbCr.txt b/veejay-current/veejay-server/doc/YCbCr.txt index 23c79a51..6a6a337c 100644 --- a/veejay-current/veejay-server/doc/YCbCr.txt +++ b/veejay-current/veejay-server/doc/YCbCr.txt @@ -18,6 +18,6 @@ Why YUV ? - Many video codecs decode into some YUV flavour - Many capture devices deliver YUV - - Software conversion of RGB <-> YUV is expensive - - Consumes less bandwith then RGB + - Software conversion of RGB <-> YUV was expensive + - Consumes less memory bandwith then RGB diff --git a/veejay-current/veejay-server/libel/vj-avcodec.c b/veejay-current/veejay-server/libel/vj-avcodec.c index 1204bd7c..309ec47b 100644 --- a/veejay-current/veejay-server/libel/vj-avcodec.c +++ b/veejay-current/veejay-server/libel/vj-avcodec.c @@ -488,7 +488,7 @@ static int vj_avcodec_copy_frame( vj_encoder *av, uint8_t *src[4], uint8_t *dst if( av->encoder_id == 999 ) { - uint8_t *dest[3] = { dst, dst + (av->len), dst + (av->len + av->len/4) }; + uint8_t *dest[4] = { dst, dst + (av->len), dst + (av->len + av->len/4),NULL }; vj_frame_copy1(src[0], dest[0], av->len ); yuv422to420planar( src,dest, av->width,av->height ); @@ -502,7 +502,7 @@ static int vj_avcodec_copy_frame( vj_encoder *av, uint8_t *src[4], uint8_t *dst } if( av->encoder_id == 996 ) { - uint8_t *dest[3] = { dst, dst + (av->len), dst + (av->len + av->len/4) }; + uint8_t *dest[4] = { dst, dst + (av->len), dst + (av->len + av->len/4),NULL }; vj_frame_copy1( src[0], dest[0], av->len ); yuv422to420planar( src,dest, av->width,av->height ); diff --git a/veejay-current/veejay-server/libsample/sampleadm.c b/veejay-current/veejay-server/libsample/sampleadm.c index c5ce0370..0296d484 100644 --- a/veejay-current/veejay-server/libsample/sampleadm.c +++ b/veejay-current/veejay-server/libsample/sampleadm.c @@ -82,6 +82,8 @@ static int sampleadm_state = SAMPLE_PEEK; /* default state */ extern void tagParseStreamFX(char *file, xmlDocPtr doc, xmlNodePtr cur, void *font, void *vp); extern void tag_writeStream( char *file, int n, xmlNodePtr node, void *font, void *vp ); extern int vj_tag_size(); +extern int veejay_sprintf( char *s, size_t size, const char *format, ... ); + typedef struct { int active; @@ -858,8 +860,6 @@ int sample_verify_delete( int sample_id, int sample_type ) { s->effect_chain[j]->channel = i; s->effect_chain[j]->source_type = 0; - veejay_msg(VEEJAY_MSG_INFO, "Dereferenced mix entry %d of Sample %d", - j, i ); sample_update( s, i ); } } @@ -2015,7 +2015,7 @@ int sample_get_kf_status( int s1, int entry, int *type ) void sample_set_kf_type(int s1, int entry, int type ) { sample_info *sample = sample_get(s1); - if(!sample) return 0; + if(!sample) return; sample->effect_chain[entry]->kf_type = type; } @@ -2927,7 +2927,6 @@ xmlNodePtr ParseSample(xmlDocPtr doc, xmlNodePtr cur, sample_info * skel,void *e xmlChar *xmlTemp = NULL; unsigned char *chTemp = NULL; xmlNodePtr subs = NULL; - int post_check = 0; if(!sample_read_edl( skel )) { veejay_msg(VEEJAY_MSG_WARNING, "No saved edit decision list '%s' for sample %d", skel->edit_list_file, skel->sample_id ); @@ -2935,7 +2934,6 @@ xmlNodePtr ParseSample(xmlDocPtr doc, xmlNodePtr cur, sample_info * skel,void *e veejay_msg(VEEJAY_MSG_WARNING, "Plainmode is dummy !"); } veejay_msg(VEEJAY_MSG_WARNING, "Using plainmode to play sample %d", skel->sample_id ); - post_check = 1; skel->edit_list = NULL; } if(!skel->edit_list) @@ -3266,7 +3264,6 @@ int is_samplelist(char *filename) void LoadSubtitles( sample_info *skel, char *file, void *font ) { char tmp[512]; - float fps = 25.0; sprintf(tmp, "%s-SUB-%d.srt", file,skel->sample_id ); #ifdef STRICT_CHECKING diff --git a/veejay-current/veejay-server/libstream/vj-tag.c b/veejay-current/veejay-server/libstream/vj-tag.c index fa991796..2ec67a20 100644 --- a/veejay-current/veejay-server/libstream/vj-tag.c +++ b/veejay-current/veejay-server/libstream/vj-tag.c @@ -1188,8 +1188,6 @@ int vj_tag_verify_delete(int id, int type ) { s->effect_chain[j]->channel = i; s->effect_chain[j]->source_type = 1; - veejay_msg(VEEJAY_MSG_INFO, "Dereferenced mix entry %d of Stream %d", - j, i ); vj_tag_update( s, i ); } } diff --git a/veejay-current/veejay-server/libvevo/vevo.c b/veejay-current/veejay-server/libvevo/vevo.c index 63129b6a..faca2dfb 100644 --- a/veejay-current/veejay-server/libvevo/vevo.c +++ b/veejay-current/veejay-server/libvevo/vevo.c @@ -2115,7 +2115,6 @@ int vevo_union_ports( void *port_a, void *port_b, int filter_type ) char **Ea = vevo_list_properties( port_a ); int i; - int error; for( i = 0; Ea[i] != NULL; i ++ ) { if(!vevo_property_exists( port_b, Ea[i] )&& vevo_property_atom_type( port_a, Ea[i] ) == diff --git a/veejay-current/veejay-server/libvje/effects/bathroom.c b/veejay-current/veejay-server/libvje/effects/bathroom.c index a82ede96..190da6e0 100644 --- a/veejay-current/veejay-server/libvje/effects/bathroom.c +++ b/veejay-current/veejay-server/libvje/effects/bathroom.c @@ -31,7 +31,7 @@ #include #include "bathroom.h" #include "common.h" -static uint8_t *bathroom_frame[3]; +static uint8_t *bathroom_frame[4] = { NULL,NULL,NULL,NULL }; vj_effect *bathroom_init(int width,int height) { @@ -57,7 +57,6 @@ vj_effect *bathroom_init(int width,int height) static int n__ = 0; static int N__ = 0; -// FIXME private int bathroom_malloc(int width, int height) { int i; diff --git a/veejay-current/veejay-server/libvje/effects/bgsubtract.c b/veejay-current/veejay-server/libvje/effects/bgsubtract.c index 3c722a8f..a42aeda4 100644 --- a/veejay-current/veejay-server/libvje/effects/bgsubtract.c +++ b/veejay-current/veejay-server/libvje/effects/bgsubtract.c @@ -65,7 +65,7 @@ void bgsubtract_free() static_bg = NULL; } -int bgsubtract_prepare(uint8_t *map[3], int width, int height) +int bgsubtract_prepare(uint8_t *map[4], int width, int height) { if(!static_bg ) { diff --git a/veejay-current/veejay-server/libvje/effects/bgsubtract.h b/veejay-current/veejay-server/libvje/effects/bgsubtract.h index 1c3f0df8..957c11cc 100644 --- a/veejay-current/veejay-server/libvje/effects/bgsubtract.h +++ b/veejay-current/veejay-server/libvje/effects/bgsubtract.h @@ -27,6 +27,6 @@ vj_effect *bgsubtract_init(int width, int height); void bgsubtract_free(); int bgsubtract_malloc(int w, int h); -int bgsubtract_prepare(uint8_t *map[3], int w, int h); +int bgsubtract_prepare(uint8_t *map[4], int w, int h); void bgsubtract_apply(VJFrame *frame,int width,int height,int mode, int threshold); #endif diff --git a/veejay-current/veejay-server/libvje/effects/bwselect.c b/veejay-current/veejay-server/libvje/effects/bwselect.c index ad113cf3..ba02780a 100644 --- a/veejay-current/veejay-server/libvje/effects/bwselect.c +++ b/veejay-current/veejay-server/libvje/effects/bwselect.c @@ -57,10 +57,10 @@ void bwselect_apply(VJFrame *frame, int width, int height, int min_threshold, in for(c=0; c < width; c++) { uint8_t p = Y[r+c]; if( p > min_threshold && p < max_threshold) { - Y[r+c] = 235; + Y[r+c] = pixel_Y_hi_; } else { - Y[r+c] = 16; + Y[r+c] = pixel_Y_lo_; } } } diff --git a/veejay-current/veejay-server/libvje/effects/cartonize.c b/veejay-current/veejay-server/libvje/effects/cartonize.c index c4648499..3b6f1025 100644 --- a/veejay-current/veejay-server/libvje/effects/cartonize.c +++ b/veejay-current/veejay-server/libvje/effects/cartonize.c @@ -71,7 +71,6 @@ void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int for( i = 0 ; i < len ; i ++ ) { tmp = Y[i]; - // if(tmp < 16 ) tmp = 16; else if(tmp > 235 ) tmp = 235; Y[i] = (tmp / base) * base; // loose fractional part } @@ -79,8 +78,6 @@ void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int for( i = 0; i < uv_len; i ++ ) { p = Cb[i] - 128; - //if( p < -127 ) p = -127; - // if( p > 127 ) p = 127; Cb[i] = (p / ubase) * ubase + 128; } @@ -88,8 +85,6 @@ void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int for( i = 0; i < uv_len; i ++ ) { p = Cr[i] - 128; - //if( p < -127 ) p = -127; - // if( p > 127 ) p = 127; Cr[i] = (p / vbase) * vbase + 128; } diff --git a/veejay-current/veejay-server/libvje/effects/chameleon.c b/veejay-current/veejay-server/libvje/effects/chameleon.c index 75f2f36d..c2033431 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleon.c +++ b/veejay-current/veejay-server/libvje/effects/chameleon.c @@ -57,14 +57,14 @@ static int n__ = 0; static int has_bg = 0; static int32_t *sum = NULL; static uint8_t *timebuffer = NULL; -static uint8_t *tmpimage[3] = { NULL,NULL,NULL}; +static uint8_t *tmpimage[4] = { NULL,NULL,NULL, NULL}; static int plane = 0; -static uint8_t *bgimage[3] = { NULL,NULL,NULL}; +static uint8_t *bgimage[4] = { NULL,NULL,NULL, NULL}; #define PLANES_DEPTH 6 #define PLANES (1<< PLANES_DEPTH) -int chameleon_prepare( uint8_t *map[3], int width, int height ) +int chameleon_prepare( uint8_t *map[4], int width, int height ) { if(!bgimage[0]) { return 0; diff --git a/veejay-current/veejay-server/libvje/effects/chameleon.h b/veejay-current/veejay-server/libvje/effects/chameleon.h index 7ed7b957..cf52aaf2 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleon.h +++ b/veejay-current/veejay-server/libvje/effects/chameleon.h @@ -28,5 +28,5 @@ vj_effect *chameleon_init(int w, int h); void chameleon_apply( VJFrame *frame, int width, int height, int mode); int chameleon_malloc(int w, int h ); void chameleon_free(); -int chameleon_prepare( uint8_t *bg[3], int w, int h ); +int chameleon_prepare( uint8_t *bg[4], int w, int h ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/chameleonblend.c b/veejay-current/veejay-server/libvje/effects/chameleonblend.c index 624dac90..66d20944 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleonblend.c +++ b/veejay-current/veejay-server/libvje/effects/chameleonblend.c @@ -56,14 +56,14 @@ static int n__ = 0; static int has_bg = 0; static int32_t *sum = NULL; static uint8_t *timebuffer = NULL; -static uint8_t *tmpimage[3] = { NULL,NULL,NULL}; +static uint8_t *tmpimage[4] = { NULL,NULL,NULL, NULL}; static int plane = 0; -static uint8_t *bgimage[3] = { NULL,NULL,NULL}; +static uint8_t *bgimage[4] = { NULL,NULL,NULL, NULL}; #define PLANES_DEPTH 6 #define PLANES (1<< PLANES_DEPTH) -int chameleonblend_prepare( uint8_t *map[3], int width, int height ) +int chameleonblend_prepare( uint8_t *map[4], int width, int height ) { if(!bgimage[0]) return 0; diff --git a/veejay-current/veejay-server/libvje/effects/chameleonblend.h b/veejay-current/veejay-server/libvje/effects/chameleonblend.h index 1ccbd385..3c3746f2 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleonblend.h +++ b/veejay-current/veejay-server/libvje/effects/chameleonblend.h @@ -27,6 +27,6 @@ vj_effect *chameleonblend_init(int w, int h); void chameleonblend_apply( VJFrame *frame, VJFrame *source, int width, int height, int mode); int chameleonblend_malloc(int w, int h ); -int chameleonblend_prepare( uint8_t *bg[3],int w, int h ); +int chameleonblend_prepare( uint8_t *bg[4],int w, int h ); void chameleonblend_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/chromascratcher.c b/veejay-current/veejay-server/libvje/effects/chromascratcher.c index 1b4d2882..920b0b9c 100644 --- a/veejay-current/veejay-server/libvje/effects/chromascratcher.c +++ b/veejay-current/veejay-server/libvje/effects/chromascratcher.c @@ -24,7 +24,7 @@ #include "common.h" #include "chromascratcher.h" #include "chromamagick.h" -static uint8_t *cframe[3]; +static uint8_t *cframe[3] = {NULL,NULL,NULL}; static int cnframe = 0; static int cnreverse = 0; static int chroma_restart = 0; diff --git a/veejay-current/veejay-server/libvje/effects/colmorphology.c b/veejay-current/veejay-server/libvje/effects/colmorphology.c index 3bacf3eb..57fe5f03 100644 --- a/veejay-current/veejay-server/libvje/effects/colmorphology.c +++ b/veejay-current/veejay-server/libvje/effects/colmorphology.c @@ -76,8 +76,8 @@ static uint8_t _dilate_kernel3x3( uint8_t *kernel, uint8_t img[9]) /* consider all background pixels (0) in input image */ for(x = 0; x < 9; x ++ ) if((kernel[x] * img[x]) > 0 ) - return 235; - return 16; + return pixel_Y_hi_; + return pixel_Y_lo_; } @@ -87,8 +87,8 @@ static uint8_t _erode_kernel3x3( uint8_t *kernel, uint8_t img[9]) /* consider all background pixels (0) in input image */ for(x = 0; x < 9; x ++ ) if(kernel[x] && img[x] == 0 ) - return 16; - return 235; + return pixel_Y_lo_; + return pixel_Y_hi_; } static morph_func _morphology_function(int i) diff --git a/veejay-current/veejay-server/libvje/effects/common.c b/veejay-current/veejay-server/libvje/effects/common.c index c0ca3d5b..9bc4b5ca 100644 --- a/veejay-current/veejay-server/libvje/effects/common.c +++ b/veejay-current/veejay-server/libvje/effects/common.c @@ -836,10 +836,10 @@ uint8_t bl_pix_unfreeze_Y(uint8_t y1, uint8_t y2) uint8_t a, b, new_Y; a = y1; b = y2; - if (a < 16) { - new_Y = 16; + if (a < pixel_Y_lo_) { + new_Y = pixel_Y_lo_; } else { - if(b > 235) b = 235; + if(b > pixel_Y_hi_) b = pixel_Y_hi_; new_Y = 0xff - ((0xff - b) * (0xff - b)) / a; } return new_Y; @@ -939,8 +939,8 @@ uint8_t bl_pix_dblbneg_C(uint8_t y1, uint8_t y2) uint8_t bl_pix_muldiv_Y(uint8_t y1, uint8_t y2) { - if( y2 > 235 ) y2 = 235; - if( y1 < 16 ) y1 = 16; + if( y2 > pixel_Y_hi_ ) y2 = pixel_Y_hi_; + if( y1 < pixel_Y_lo_ ) y1 = pixel_Y_lo_; return ( (y1*y1) / (0xff - y2 ) ); } @@ -956,8 +956,8 @@ uint8_t bl_pix_add_Y(uint8_t y1, uint8_t y2) if ((0xff - b) <= 0) { new_Y = (a * a) >> 8; } else { - if( b > 235) - b= 235; + if( b > pixel_Y_hi_) + b= pixel_Y_hi_; new_Y = (a * a) / (0xff - b); } return new_Y; @@ -1019,17 +1019,17 @@ uint8_t bl_pix_selunfreeze_Y(uint8_t y1, uint8_t y2) a = y1; b = y2; if (a > b) { - if (b < 16) { - new_Y = 16; + if (b < pixel_Y_lo_) { + new_Y = pixel_Y_lo_; } else { - if( a > 235 ) a = 235; + if( a > pixel_Y_hi_ ) a = pixel_Y_hi_; new_Y = 0xff - ((0xff - a) * (0xff - a)) / b; - if (new_Y < 16) - new_Y = 16; + if (new_Y < pixel_Y_lo_) + new_Y = pixel_Y_lo_; } return new_Y; } - return 0; + return pixel_Y_lo_; } uint8_t bl_pix_seldiff_Y(uint8_t y1, uint8_t y2) diff --git a/veejay-current/veejay-server/libvje/effects/complexsync.c b/veejay-current/veejay-server/libvje/effects/complexsync.c index 36e7a899..900855a4 100644 --- a/veejay-current/veejay-server/libvje/effects/complexsync.c +++ b/veejay-current/veejay-server/libvje/effects/complexsync.c @@ -24,7 +24,7 @@ #include "complexsync.h" #include -static uint8_t *c_outofsync_buffer[3] = { NULL,NULL,NULL }; +static uint8_t *c_outofsync_buffer[4] = { NULL,NULL,NULL, NULL }; vj_effect *complexsync_init(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/effects/contourextract.c b/veejay-current/veejay-server/libvje/effects/contourextract.c index f310e0f5..0d69e6bb 100644 --- a/veejay-current/veejay-server/libvje/effects/contourextract.c +++ b/veejay-current/veejay-server/libvje/effects/contourextract.c @@ -186,7 +186,7 @@ void contourextract_free(void *d) d = NULL; } -int contourextract_prepare(uint8_t *map[3], int width, int height) +int contourextract_prepare(uint8_t *map[4], int width, int height) { if(!static_bg ) { @@ -276,7 +276,7 @@ void contourextract_apply(void *ed, VJFrame *frame,int width, int height, } //@ calculate distance map - veejay_distance_transform( ud->bitmap, width, height, dt_map ); + veejay_distance_transform8( ud->bitmap, width, height, dt_map ); to_shrink_.data[0] = ud->bitmap; shrinked_.data[0] = ud->current; diff --git a/veejay-current/veejay-server/libvje/effects/contourextract.h b/veejay-current/veejay-server/libvje/effects/contourextract.h index 4243a42e..f9e4e9d2 100644 --- a/veejay-current/veejay-server/libvje/effects/contourextract.h +++ b/veejay-current/veejay-server/libvje/effects/contourextract.h @@ -27,7 +27,7 @@ vj_effect *contourextract_init(int width, int height); void contourextract_free(void *d); int contourextract_malloc(void **c, int w, int h); -int contourextract_prepare(uint8_t *map[3], int w, int h); +int contourextract_prepare(uint8_t *map[4], int w, int h); void contourextract_apply(void *d , VJFrame *frame,int width, int height, int th, int reverse, int show, int feather, int blob); void contourextract_destroy(); diff --git a/veejay-current/veejay-server/libvje/effects/crosspixel.c b/veejay-current/veejay-server/libvje/effects/crosspixel.c index b9bb7088..79dc5bd1 100644 --- a/veejay-current/veejay-server/libvje/effects/crosspixel.c +++ b/veejay-current/veejay-server/libvje/effects/crosspixel.c @@ -24,7 +24,7 @@ #include "common.h" #include -static uint8_t *cross_pixels[3]; +static uint8_t *cross_pixels[4] = { NULL,NULL,NULL, NULL}; vj_effect *crosspixel_init(int w, int h) { @@ -47,7 +47,7 @@ vj_effect *crosspixel_init(int w, int h) ve->param_description = vje_build_param_list( ve->num_params, "Mode", "Size" ); return ve; } -// FIXME private + int crosspixel_malloc(int w, int h) { int i; @@ -92,7 +92,7 @@ void crosspixel_apply(VJFrame *frame, int w, int h, int t,int v) { } else { - vj_frame_clear1(Y, 235, len); + vj_frame_clear1(Y, pixel_Y_hi_, len); vj_frame_clear1(Cb, 128, uv_len); vj_frame_clear1(Cr, 128, uv_len); } diff --git a/veejay-current/veejay-server/libvje/effects/cutstop.c b/veejay-current/veejay-server/libvje/effects/cutstop.c index 1798196c..331a2240 100644 --- a/veejay-current/veejay-server/libvje/effects/cutstop.c +++ b/veejay-current/veejay-server/libvje/effects/cutstop.c @@ -27,8 +27,8 @@ #include #include -static uint8_t *vvcutstop_buffer[3]; -static unsigned int frq_cnt; +static uint8_t *vvcutstop_buffer[4] = { NULL,NULL,NULL,NULL }; +static unsigned int frq_cnt = 0; vj_effect *cutstop_init(int width , int height) { diff --git a/veejay-current/veejay-server/libvje/effects/diff.c b/veejay-current/veejay-server/libvje/effects/diff.c index 01ef3626..8d69f973 100644 --- a/veejay-current/veejay-server/libvje/effects/diff.c +++ b/veejay-current/veejay-server/libvje/effects/diff.c @@ -113,7 +113,7 @@ void diff_free(void *d) d = NULL; } -int diff_prepare(void *user, uint8_t *map[3], int width, int height) +int diff_prepare(void *user, uint8_t *map[4], int width, int height) { if(!static_bg ) { diff --git a/veejay-current/veejay-server/libvje/effects/diff.h b/veejay-current/veejay-server/libvje/effects/diff.h index 114dc8c0..8b5c6d29 100644 --- a/veejay-current/veejay-server/libvje/effects/diff.h +++ b/veejay-current/veejay-server/libvje/effects/diff.h @@ -27,7 +27,7 @@ vj_effect *diff_init(int width, int height); void diff_free(void *d); int diff_malloc(void **c, int w, int h); -int diff_prepare(void *d, uint8_t *map[3], int w, int h); +int diff_prepare(void *d, uint8_t *map[4], int w, int h); void diff_apply(void *d , VJFrame *frame, VJFrame *frame2, int width, int height, int th, int reverse, int show, int feather); diff --git a/veejay-current/veejay-server/libvje/effects/diffimg.c b/veejay-current/veejay-server/libvje/effects/diffimg.c index a334f79b..bf4fc295 100644 --- a/veejay-current/veejay-server/libvje/effects/diffimg.c +++ b/veejay-current/veejay-server/libvje/effects/diffimg.c @@ -32,7 +32,7 @@ vj_effect *diffimg_init(int width, int height) ve->defaults = (int *) vj_calloc(sizeof(int) * ve->num_params); ve->defaults[0] = 6;/* type */ ve->defaults[1] = 15; /* min */ - ve->defaults[2] = 235; /* max */ + ve->defaults[2] = 240; /* max */ ve->limits[0][0] = 0; ve->limits[1][0] = 7; @@ -72,7 +72,7 @@ void diffimg_apply( for(i=0; i < len; i++) { y = Y[i]; - if( y < 16 ) y = 16; else if (y > 235) y = 235; + if( y < 16 ) y = 16; else if (y > pixel_Y_hi_) y = pixel_Y_hi_; yb = y; if(y >= threshold_min && y <= threshold_max) { @@ -82,7 +82,7 @@ void diffimg_apply( d /= 100; m = m + d; y = ((((y << 1) - (255 - m))>>1) + Y[i])>>1; - if(y < 16) y = 16; else if (y>235) y = 235; + if(y < 16) y = 16; else if (y>pixel_Y_hi_) y = pixel_Y_hi_; Y[i] = _pff(y,yb); } } diff --git a/veejay-current/veejay-server/libvje/effects/fisheye.c b/veejay-current/veejay-server/libvje/effects/fisheye.c index 05f35f18..e7c66dde 100644 --- a/veejay-current/veejay-server/libvje/effects/fisheye.c +++ b/veejay-current/veejay-server/libvje/effects/fisheye.c @@ -24,6 +24,8 @@ #include #include "common.h" #include +#define RUP8(num)(((num)+8)&~8) + vj_effect *fisheye_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -39,17 +41,15 @@ vj_effect *fisheye_init(int w, int h) ve->sub_format = 1; ve->extra_frame = 0; ve->has_user = 0; - ve->param_description = vje_build_param_list( ve->num_params, "Value" ); + ve->param_description = vje_build_param_list( ve->num_params, "Curve" ); return ve; } -//FIXME private static int _v = 0; - -static double *polar_map; -static double *fish_angle; -static int *cached_coords; -static uint8_t *buf[3]; +static double *polar_map = NULL; +static double *fish_angle = NULL; +static int *cached_coords = NULL; +static uint8_t *buf[3] = { NULL,NULL,NULL }; int fisheye_malloc(int w, int h) { @@ -58,17 +58,17 @@ int fisheye_malloc(int w, int h) int w2=w/2; int p =0; - buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * 3 ); + buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * RUP8(w * h * 3 ) ); if(!buf[0]) return 0; buf[1] = buf[0] + (w*h); buf[2] = buf[1] + (w*h); - polar_map = (double*) vj_calloc(sizeof(double) * w* h ); + polar_map = (double*) vj_calloc(sizeof(double) * RUP8(w* h) ); if(!polar_map) return 0; - fish_angle = (double*) vj_calloc(sizeof(double) * w* h ); + fish_angle = (double*) vj_calloc(sizeof(double) * RUP8(w* h) ); if(!fish_angle) return 0; - cached_coords = (int*) vj_calloc(sizeof(int) * w * h); + cached_coords = (int*) vj_calloc(sizeof(int) * RUP8( w * h)); if(!cached_coords) return 0; for(y=(-1 *h2); y < (h-h2); y++) diff --git a/veejay-current/veejay-server/libvje/effects/flare.c b/veejay-current/veejay-server/libvje/effects/flare.c index 4fbc6a61..ca45db9f 100644 --- a/veejay-current/veejay-server/libvje/effects/flare.c +++ b/veejay-current/veejay-server/libvje/effects/flare.c @@ -56,7 +56,7 @@ vj_effect *flare_init(int w, int h) return ve; } -static uint8_t *flare_buf[3]; +static uint8_t *flare_buf[4] = { NULL,NULL,NULL,NULL}; int flare_malloc(int w, int h) { diff --git a/veejay-current/veejay-server/libvje/effects/ghost.c b/veejay-current/veejay-server/libvje/effects/ghost.c index 6979fa82..e89d1e0e 100644 --- a/veejay-current/veejay-server/libvje/effects/ghost.c +++ b/veejay-current/veejay-server/libvje/effects/ghost.c @@ -25,7 +25,7 @@ #include "common.h" #include "ghost.h" -static uint8_t *ghost_buf[3]; +static uint8_t *ghost_buf[4] = { NULL,NULL,NULL, NULL}; static uint8_t *diff_map = NULL; static int diff_period = 0; diff --git a/veejay-current/veejay-server/libvje/effects/magicmirror.c b/veejay-current/veejay-server/libvje/effects/magicmirror.c index f91929c3..1d1f4847 100644 --- a/veejay-current/veejay-server/libvje/effects/magicmirror.c +++ b/veejay-current/veejay-server/libvje/effects/magicmirror.c @@ -24,7 +24,7 @@ #include "magicmirror.h" #include "common.h" // if d or n changes, tables need to be calculated -static uint8_t *magicmirrorbuf[3]; +static uint8_t *magicmirrorbuf[4] = { NULL,NULL,NULL,NULL }; static double *funhouse_x = NULL; static double *funhouse_y = NULL; static unsigned int *cache_x = NULL; @@ -90,7 +90,6 @@ int magicmirror_malloc(int w, int h) n__ =0; N__ =0; - //p0_frame_ = (uint8_t*) vj_malloc( sizeof(uint8_t) * RUP8( w * h * 3) ); return 1; } @@ -106,8 +105,6 @@ void magicmirror_free() if(funhouse_y) free(funhouse_y); if(cache_x) free(cache_x); if(cache_y) free(cache_y); -// if(p0_frame_) free(p0_frame_); -// p0_frame_=0; magicmirrorbuf[0] = NULL; magicmirrorbuf[1] = NULL; magicmirrorbuf[2] = NULL; @@ -201,29 +198,6 @@ void magicmirror_apply( VJFrame *frame, int w, int h, int vx, int vy, int d, int Cr[q] = magicmirrorbuf[2][p]; } } -/* - uint8_t *p0[3] = { - p0_frame_ + 0, - p0_frame_ + (w*h), - p0_frame_ + (2*w*h) }; - - if(interpolate) - { - VJFrame prev; - veejay_memcpy(&prev, frame, sizeof(VJFrame)); - prev->data[0] = p0_frame_; - prev->data[1] = p0_frame_ + (w*h); - prev->data[2] = p0_frame_ + (2*w*h); - - motionmap_lerp_frame( frame, &prev, N__, n__ ); - } - - if( motionmap_active()) - { - veejay_memcpy( prev->data[0], Y, w*h); - veejay_memcpy( prev->data[1], Cb, w*h); - veejay_memcpY( prev->data[2], Cr,w*h); - }*/ if( interpolate ) { diff --git a/veejay-current/veejay-server/libvje/effects/magicscratcher.c b/veejay-current/veejay-server/libvje/effects/magicscratcher.c index de279af4..38d6db76 100644 --- a/veejay-current/veejay-server/libvje/effects/magicscratcher.c +++ b/veejay-current/veejay-server/libvje/effects/magicscratcher.c @@ -24,7 +24,8 @@ #include "magicscratcher.h" #include "common.h" -static uint8_t *mframe; +#define RUP8(num)(((num)+8)&~8) +static uint8_t *mframe = NULL; static int m_frame = 0; static int m_reverse = 0; static int m_rerun = 0; @@ -53,11 +54,10 @@ vj_effect *magicscratcher_init(int w, int h) ve->param_description = vje_build_param_list( ve->num_params, "Mode", "Scratch frames", "PingPong"); return ve; } -//FIXME: private int magicscratcher_malloc(int w, int h) { mframe = - (uint8_t *) vj_calloc(w * h * sizeof(uint8_t) * MAX_SCRATCH_FRAMES); + (uint8_t *) vj_calloc( RUP8(w * h) * sizeof(uint8_t) * MAX_SCRATCH_FRAMES); if(!mframe) return 0; return 1; diff --git a/veejay-current/veejay-server/libvje/effects/morphology.c b/veejay-current/veejay-server/libvje/effects/morphology.c index b6e7b7f7..f71123e3 100644 --- a/veejay-current/veejay-server/libvje/effects/morphology.c +++ b/veejay-current/veejay-server/libvje/effects/morphology.c @@ -23,7 +23,7 @@ #include #include #include "morphology.h" - +#include "common.h" typedef uint8_t (*morph_func)(uint8_t *kernel, uint8_t mt[9] ); vj_effect *morphology_init(int w, int h) @@ -74,8 +74,8 @@ static uint8_t _dilate_kernel3x3( uint8_t *kernel, uint8_t img[9]) /* consider all background pixels (0) in input image */ for(x = 0; x < 9; x ++ ) if((kernel[x] * img[x]) > 0 ) - return 235; - return 16; + return pixel_Y_hi_; + return pixel_Y_lo_; } @@ -85,8 +85,8 @@ static uint8_t _erode_kernel3x3( uint8_t *kernel, uint8_t img[9]) /* consider all background pixels (0) in input image */ for(x = 0; x < 9; x ++ ) if(kernel[x] && img[x] == 0 ) - return 16; - return 235; + return pixel_Y_lo_; + return pixel_Y_hi_; } morph_func _morphology_function(int i) diff --git a/veejay-current/veejay-server/libvje/effects/motionblur.c b/veejay-current/veejay-server/libvje/effects/motionblur.c index 43b9c697..5180b5fd 100644 --- a/veejay-current/veejay-server/libvje/effects/motionblur.c +++ b/veejay-current/veejay-server/libvje/effects/motionblur.c @@ -24,7 +24,7 @@ #include "motionblur.h" #include -static uint8_t *previous_frame[3]; +static uint8_t *previous_frame[3] = { NULL,NULL,NULL }; vj_effect *motionblur_init(int width, int height) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); diff --git a/veejay-current/veejay-server/libvje/effects/motionmap.c b/veejay-current/veejay-server/libvje/effects/motionmap.c index 8c354735..d9d7c897 100644 --- a/veejay-current/veejay-server/libvje/effects/motionmap.c +++ b/veejay-current/veejay-server/libvje/effects/motionmap.c @@ -258,7 +258,7 @@ void motionmap_interpolate_frame( VJFrame *fx, int N, int n ) motionmap_lerp_frame( fx, &prev, N, n ); } -int motionmap_prepare( uint8_t *map[3], int width, int height ) +int motionmap_prepare( uint8_t *map[4], int width, int height ) { if(!previous_img) return 0; @@ -368,10 +368,11 @@ void motionmap_apply( VJFrame *frame, int width, int height, int threshold, int if( capturing ) { - uint8_t *dst[3]; + uint8_t *dst[4]; dst[0] = large_buf + ( n_captured * (len*3) ); dst[1] = dst[0] + len; dst[2] = dst[1] + len; + dst[3] = NULL; int strides[4] = { len, len, len, 0 }; vj_frame_copy( frame->data, dst, strides ); n_captured ++; @@ -383,10 +384,11 @@ void motionmap_apply( VJFrame *frame, int width, int height, int threshold, int } else if (playing ) { - uint8_t *src[3]; + uint8_t *src[4]; src[0] = large_buf + ( n_played * (len*3)); src[1] = src[0]+ len; src[2] = src[1]+ len; + src[3] = NULL; /* veejay_memcpy( frame->data[0], src[0], len ); veejay_memcpy( frame->data[1], src[1], len ); veejay_memcpy( frame->data[2], src[2], len );*/ diff --git a/veejay-current/veejay-server/libvje/effects/motionmap.h b/veejay-current/veejay-server/libvje/effects/motionmap.h index b1960f7c..4dc8d82c 100644 --- a/veejay-current/veejay-server/libvje/effects/motionmap.h +++ b/veejay-current/veejay-server/libvje/effects/motionmap.h @@ -28,5 +28,5 @@ vj_effect *motionmap_init(int w, int h); void motionmap_apply( VJFrame *frame, int width, int height, int t, int n, int draw, int histo, int op); int motionmap_malloc(int w,int h); void motionmap_free(void); -int motionmap_prepare( uint8_t *map[3], int w, int h ); +int motionmap_prepare( uint8_t *map[4], int w, int h ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/mtracer.c b/veejay-current/veejay-server/libvje/effects/mtracer.c index 49be7d07..89c3dba7 100644 --- a/veejay-current/veejay-server/libvje/effects/mtracer.c +++ b/veejay-current/veejay-server/libvje/effects/mtracer.c @@ -26,7 +26,7 @@ #include "magicoverlays.h" -static uint8_t *mtrace_buffer[3]; +static uint8_t *mtrace_buffer[4] = { NULL,NULL,NULL,NULL }; static int mtrace_counter = 0; vj_effect *mtracer_init(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/neighbours.c b/veejay-current/veejay-server/libvje/effects/neighbours.c index e8b52a84..f556a790 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours.c @@ -232,7 +232,7 @@ void neighbours_apply( VJFrame *frame, int width, int height, int brush_size, in if(mode) { int strides[4] = { 0,frame->len, frame->len }; - uint8_t *dest[3] = { NULL, chromacity[0], chromacity[1] }; + uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/neighbours2.c b/veejay-current/veejay-server/libvje/effects/neighbours2.c index eb03db9c..bfdc2013 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours2.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours2.c @@ -234,7 +234,7 @@ void neighbours2_apply( VJFrame *frame, int width, int height, int brush_size, i if(mode) { int strides[4] = { 0, frame->len, frame->len,0 }; - uint8_t *dest[3] = { NULL, chromacity[0],chromacity[1] }; + uint8_t *dest[4] = { NULL, chromacity[0],chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/neighbours3.c b/veejay-current/veejay-server/libvje/effects/neighbours3.c index f4aa936a..01da9509 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours3.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours3.c @@ -237,7 +237,7 @@ void neighbours3_apply( VJFrame *frame, int width, int height, int brush_size, i if(mode) { int strides[4] = { 0, frame->len, frame->len, 0 }; - uint8_t *dest[3] = { NULL, chromacity[0], chromacity[1] }; + uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1], NULL }; vj_frame_copy( frame->data, dest, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/neighbours5.c b/veejay-current/veejay-server/libvje/effects/neighbours5.c index fed8c8a9..d59a4a72 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours5.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours5.c @@ -237,8 +237,8 @@ void neighbours5_apply( VJFrame *frame, int width, int height, int brush_size, i if(mode) { - int strides[4] = { 0,frame->len, frame->len }; - uint8_t *dest[3] = { NULL, chromacity[0], chromacity[1] }; + int strides[4] = { 0,frame->len, frame->len,0 }; + uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/nervous.c b/veejay-current/veejay-server/libvje/effects/nervous.c index 2195c7bb..74dd4b9a 100644 --- a/veejay-current/veejay-server/libvje/effects/nervous.c +++ b/veejay-current/veejay-server/libvje/effects/nervous.c @@ -31,9 +31,10 @@ #include #include "nervous.h" -#define N_MAX 25 +#define N_MAX 100 +#define RUP8(num)(((num)+8)&~8) -static uint8_t *nervous_buf[3]; // huge buffer +static uint8_t *nervous_buf[4] = { NULL,NULL,NULL,NULL }; // huge buffer static int frames_elapsed; vj_effect *nervous_init(int w, int h) @@ -57,9 +58,9 @@ vj_effect *nervous_init(int w, int h) int nervous_malloc(int w, int h ) { - nervous_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * w * h * N_MAX * 3); - + nervous_buf[0] = (uint8_t*) vj_malloc(sizeof(uint8_t) * RUP8(w * h * N_MAX * 3)); if(!nervous_buf[0]) return 0; + nervous_buf[1] = nervous_buf[0] + (w*h*N_MAX); nervous_buf[2] = nervous_buf[1] + (w*h*N_MAX); frames_elapsed = 0; @@ -76,8 +77,9 @@ void nervous_free(void) if( nervous_buf[0] ) free(nervous_buf[0]); nervous_buf[0] = NULL; nervous_buf[1] = NULL; - nervous_buf[2] = NULL; -} + nervous_buf[2] = NULL; + nervous_buf[3] = NULL; +} void nervous_apply( VJFrame *frame, int width, int height, int delay) diff --git a/veejay-current/veejay-server/libvje/effects/overclock.c b/veejay-current/veejay-server/libvje/effects/overclock.c index 495005b7..3740559c 100644 --- a/veejay-current/veejay-server/libvje/effects/overclock.c +++ b/veejay-current/veejay-server/libvje/effects/overclock.c @@ -46,7 +46,7 @@ vj_effect *overclock_init(int w, int h) return ve; } -static uint8_t *oc_buf[3]; +static uint8_t *oc_buf[3] = { NULL,NULL,NULL }; //copied from xine static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstStep, int srcStep){ diff --git a/veejay-current/veejay-server/libvje/effects/posterize.c b/veejay-current/veejay-server/libvje/effects/posterize.c index ad65feb6..a8e081e8 100644 --- a/veejay-current/veejay-server/libvje/effects/posterize.c +++ b/veejay-current/veejay-server/libvje/effects/posterize.c @@ -21,6 +21,7 @@ #include #include #include "posterize.h" +#include "common.h" vj_effect *posterize_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -68,7 +69,7 @@ static void _posterize_y_simple(uint8_t *src[3], int len, int value, int thresho } else { - if( Y < threshold_min) Y = 16; else Y = 235; + if( Y < threshold_min) Y = pixel_Y_lo_; else Y = pixel_Y_hi_; } } } diff --git a/veejay-current/veejay-server/libvje/effects/radcor.c b/veejay-current/veejay-server/libvje/effects/radcor.c index ea4f29a1..47cf0aad 100644 --- a/veejay-current/veejay-server/libvje/effects/radcor.c +++ b/veejay-current/veejay-server/libvje/effects/radcor.c @@ -102,7 +102,7 @@ void radcor_apply( VJFrame *frame, int width, int height, int alpaX, int alpaY, int nyout = ny; //@ copy source image to internal buffer - uint8_t *dest[3] = { badbuf, badbuf + len, badbuf + len + len }; + uint8_t *dest[4] = { badbuf, badbuf + len, badbuf + len + len,NULL }; int strides[4] = { len, len, len, 0 }; vj_frame_copy( frame->data, dest, strides ); diff --git a/veejay-current/veejay-server/libvje/effects/radialblur.c b/veejay-current/veejay-server/libvje/effects/radialblur.c index de683b85..149800ae 100644 --- a/veejay-current/veejay-server/libvje/effects/radialblur.c +++ b/veejay-current/veejay-server/libvje/effects/radialblur.c @@ -47,7 +47,7 @@ #include "radialblur.h" #include "common.h" //FIXME: private -static uint8_t *radial_src[3]; +static uint8_t *radial_src[4] = { NULL,NULL,NULL,NULL}; vj_effect *radialblur_init(int w,int h) { diff --git a/veejay-current/veejay-server/libvje/effects/ripple.c b/veejay-current/veejay-server/libvje/effects/ripple.c index 54973f2d..8b73851e 100644 --- a/veejay-current/veejay-server/libvje/effects/ripple.c +++ b/veejay-current/veejay-server/libvje/effects/ripple.c @@ -40,7 +40,7 @@ #define RIPPLE_VAL 180.0 static double *ripple_table; -static uint8_t *ripple_data[3]; +static uint8_t *ripple_data[4] = { NULL,NULL,NULL,NULL }; static double *ripple_sin; static double *ripple_cos; diff --git a/veejay-current/veejay-server/libvje/effects/rotozoom.c b/veejay-current/veejay-server/libvje/effects/rotozoom.c index 2283ecd6..61b46804 100644 --- a/veejay-current/veejay-server/libvje/effects/rotozoom.c +++ b/veejay-current/veejay-server/libvje/effects/rotozoom.c @@ -32,7 +32,7 @@ static int new_zpath = 0; static int new_path = 0; static int roto_old_p = 0; static int roto_old_z = 0; -static uint8_t *rotobuffer[3]; +static uint8_t *rotobuffer[4] = { NULL,NULL,NULL,NULL }; // FIXME private vj_effect *rotozoom_init(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/effects/scratcher.c b/veejay-current/veejay-server/libvje/effects/scratcher.c index 0cca4f42..f2455160 100644 --- a/veejay-current/veejay-server/libvje/effects/scratcher.c +++ b/veejay-current/veejay-server/libvje/effects/scratcher.c @@ -27,7 +27,7 @@ #include "opacity.h" #include -static uint8_t *frame[3]; +static uint8_t *frame[4] = { NULL,NULL,NULL,NULL }; static int nframe = 0; static int nreverse = 0; @@ -94,10 +94,11 @@ void store_frame(VJFrame *src, int w, int h, int n, int no_reverse) uint8_t *Cb= src->data[1]; uint8_t *Cr= src->data[2]; - uint8_t *dest[3] = { + uint8_t *dest[4] = { frame[0] + (w*h*nframe), frame[1] + (uv_len*nframe), - frame[2] + (uv_len*nframe) }; + frame[2] + (uv_len*nframe), + NULL }; if (!nreverse) { vj_frame_copy( src->data, dest, strides ); diff --git a/veejay-current/veejay-server/libvje/effects/sinoids.c b/veejay-current/veejay-server/libvje/effects/sinoids.c index 47b206e0..19447ad3 100644 --- a/veejay-current/veejay-server/libvje/effects/sinoids.c +++ b/veejay-current/veejay-server/libvje/effects/sinoids.c @@ -27,8 +27,8 @@ #include "sinoids.h" #include "common.h" -static int *sinoids_X; -static uint8_t *sinoid_frame[3]; +static int *sinoids_X = NULL; +static uint8_t *sinoid_frame[3] = { NULL,NULL,NULL }; vj_effect *sinoids_init(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/effects/slice.c b/veejay-current/veejay-server/libvje/effects/slice.c index 2d27a449..d7848af6 100644 --- a/veejay-current/veejay-server/libvje/effects/slice.c +++ b/veejay-current/veejay-server/libvje/effects/slice.c @@ -24,9 +24,9 @@ #include #include "common.h" -static uint8_t *slice_frame[3]; -static int *slice_xshift; -static int *slice_yshift; +static uint8_t *slice_frame[4] = { NULL,NULL,NULL,NULL }; +static int *slice_xshift = NULL; +static int *slice_yshift = NULL; static int n__ = 0; static int N__ = 0; void slice_recalc(int width, int height, int val); diff --git a/veejay-current/veejay-server/libvje/effects/split.c b/veejay-current/veejay-server/libvje/effects/split.c index 39d69f7e..1feca3de 100644 --- a/veejay-current/veejay-server/libvje/effects/split.c +++ b/veejay-current/veejay-server/libvje/effects/split.c @@ -19,7 +19,7 @@ #include #include #include "split.h" -static uint8_t *split_fixme[3]; +static uint8_t *split_fixme[4] = { NULL,NULL,NULL, NULL }; vj_effect *split_init(int width,int height) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -110,10 +110,11 @@ void split_fib_downscaleb(VJFrame *frame, int width, int height) split_fib_downscale(frame, width, height); int strides[4] = { len, uv_len, uv_len, 0 }; - uint8_t *output[3] = { + uint8_t *output[4] = { Y + len, Cb + uv_len, - Cr + uv_len }; + Cr + uv_len, + NULL }; vj_frame_copy( frame->data, output, strides ); } @@ -240,7 +241,7 @@ void split_push_downscale_lh(VJFrame *frame, int width, int height) } int strides[4] = { hlen, uv_hlen, uv_hlen,0 }; - uint8_t *input[3] = { Y + hlen, Cb + uv_hlen, Cr + uv_hlen }; + uint8_t *input[4] = { Y + hlen, Cb + uv_hlen, Cr + uv_hlen, NULL }; vj_frame_copy( split_fixme, input, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/swirl.c b/veejay-current/veejay-server/libvje/effects/swirl.c index f43027f0..2ee06bb7 100644 --- a/veejay-current/veejay-server/libvje/effects/swirl.c +++ b/veejay-current/veejay-server/libvje/effects/swirl.c @@ -48,7 +48,7 @@ vj_effect *swirl_init(int w, int h) static double *polar_map; static double *fish_angle; static int *cached_coords; -static uint8_t *buf[3]; +static uint8_t *buf[4] = { NULL,NULL,NULL,NULL }; int swirl_malloc(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/timedistort.c b/veejay-current/veejay-server/libvje/effects/timedistort.c index 6a01cd64..ccae63ae 100644 --- a/veejay-current/veejay-server/libvje/effects/timedistort.c +++ b/veejay-current/veejay-server/libvje/effects/timedistort.c @@ -59,7 +59,7 @@ vj_effect *timedistort_init(int w, int h) static int n__ = 0; static int N__ = 0; static uint8_t *nonmap = NULL; -static uint8_t *planes[3] = { NULL, NULL, NULL }; +static uint8_t *planes[4] = { NULL, NULL, NULL, NULL }; static uint8_t *planetableY[PLANES]; static uint8_t *planetableU[PLANES]; static uint8_t *planetableV[PLANES]; @@ -189,7 +189,7 @@ void timedistort_apply( VJFrame *frame, int width, int height, int val) #endif //@ process - uint8_t *planeTables[3] = { planetableY[plane], planetableU[plane], planetableV[plane] }; + uint8_t *planeTables[4] = { planetableY[plane], planetableU[plane], planetableV[plane], NULL }; int strides[4] = { len, len, len, 0 }; vj_frame_copy( frame->data, planeTables, strides ); diff --git a/veejay-current/veejay-server/libvje/effects/tracer.c b/veejay-current/veejay-server/libvje/effects/tracer.c index 4bc3c502..3e7bf002 100644 --- a/veejay-current/veejay-server/libvje/effects/tracer.c +++ b/veejay-current/veejay-server/libvje/effects/tracer.c @@ -23,7 +23,7 @@ #include "scratcher.h" #include "common.h" -static uint8_t *trace_buffer[3]; +static uint8_t *trace_buffer[4] = { NULL,NULL,NULL,NULL}; static int trace_counter = 0; vj_effect *tracer_init(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/water.c b/veejay-current/veejay-server/libvje/effects/water.c index 82a170cb..2591a5d3 100644 --- a/veejay-current/veejay-server/libvje/effects/water.c +++ b/veejay-current/veejay-server/libvje/effects/water.c @@ -37,7 +37,7 @@ #include "common.h" typedef struct { - uint8_t *ripple_data[3]; + uint8_t *ripple_data[4]; uint8_t *diff_img; int stat; signed char *vtable; diff --git a/veejay-current/veejay-server/libvje/effects/zoom.c b/veejay-current/veejay-server/libvje/effects/zoom.c index 2ecfb81c..faad4f38 100644 --- a/veejay-current/veejay-server/libvje/effects/zoom.c +++ b/veejay-current/veejay-server/libvje/effects/zoom.c @@ -58,7 +58,7 @@ vj_effect *zoom_init(int width , int height) static int zoom_[4] = { 0,0,0,0 }; static void *zoom_vp_ = NULL; -static uint8_t *zoom_private_[3] = { NULL, NULL, NULL }; +static uint8_t *zoom_private_[4] = { NULL, NULL, NULL, NULL }; int zoom_malloc(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/internal.h b/veejay-current/veejay-server/libvje/internal.h index f24de888..5b737b20 100644 --- a/veejay-current/veejay-server/libvje/internal.h +++ b/veejay-current/veejay-server/libvje/internal.h @@ -524,11 +524,11 @@ extern void dissolve_apply(VJFrame *frame,VJFrame *frame2, int w, int h, int opa extern void overclock_apply(VJFrame *frame, int w, int h, int val, int r); -extern int bgsubstract_prepare(void *user, uint8_t *map[3], int width, int height); +extern int bgsubstract_prepare(void *user, uint8_t *map[4], int width, int height); extern void bgsubstract_apply(VJFrame *frame,int width, int height, int mode, int threshold ); -extern int diff_prepare(void *data, uint8_t *map[3], int w, int h); +extern int diff_prepare(void *data, uint8_t *map[4], int w, int h); extern void cartonize_apply( VJFrame *frame, int w, int h, int b1, int b2, int b3 ); @@ -616,11 +616,11 @@ extern void radcor_apply( VJFrame *frame, int width, int height, int a, int b, i extern void bgsubtract_apply(VJFrame *frame,int width,int height,int mode, int threshold); -extern int motionmap_prepare( uint8_t *map[3], int w, int h ); -extern int chameleon_prepare( uint8_t *bg[3], int w, int h ); -extern int bgsubtract_prepare(uint8_t *map[3], int w, int h); -extern int contourextract_prepare(uint8_t *map[3], int w, int h); -extern int chameleonblend_prepare( uint8_t *bg[3],int w, int h ); +extern int motionmap_prepare( uint8_t *map[4], int w, int h ); +extern int chameleon_prepare( uint8_t *bg[4], int w, int h ); +extern int bgsubtract_prepare(uint8_t *map[4], int w, int h); +extern int contourextract_prepare(uint8_t *map[4], int w, int h); +extern int chameleonblend_prepare( uint8_t *bg[4],int w, int h ); #endif diff --git a/veejay-current/veejay-server/libvjmsg/vj-common.c b/veejay-current/veejay-server/libvjmsg/vj-common.c index 9336070b..d10bccd7 100644 --- a/veejay-current/veejay-server/libvjmsg/vj-common.c +++ b/veejay-current/veejay-server/libvjmsg/vj-common.c @@ -267,7 +267,7 @@ int veejay_is_silent() #define MESSAGE_RING_SIZE 5000 static message_ring_t *msg_ring = NULL; -static msg_ring_enabled = 0; +static int msg_ring_enabled = 0; void veejay_init_msg_ring() { msg_ring = vj_calloc( sizeof(message_ring_t)); diff --git a/veejay-current/veejay-server/veejay/liblavplayvj.c b/veejay-current/veejay-server/veejay/liblavplayvj.c index 1e10b7a1..b845c7f1 100644 --- a/veejay-current/veejay-server/veejay/liblavplayvj.c +++ b/veejay-current/veejay-server/veejay/liblavplayvj.c @@ -2234,7 +2234,6 @@ static void veejay_schedule_fifo(veejay_t *info, int pid ) * veejay_playback_cycle() * the playback cycle ******************************************************/ -static double last_tdiff = 0.0; static void veejay_playback_cycle(veejay_t * info) { video_playback_stats stats; @@ -3685,8 +3684,6 @@ static void configure_dummy_defaults(veejay_t *info, char override_norm, float f int veejay_open_files(veejay_t * info, char **files, int num_files, float ofps, int force,int force_pix_fmt, char override_norm, int switch_jpeg) { int ret = 0; - video_playback_setup *settings = - (video_playback_setup *) info->settings; switch( force_pix_fmt ) { case 1: info->pixel_format = FMT_422;break; diff --git a/veejay-current/veejay-server/veejay/vj-composite.c b/veejay-current/veejay-server/veejay/vj-composite.c index fc6b019c..91a1f77e 100644 --- a/veejay-current/veejay-server/veejay/vj-composite.c +++ b/veejay-current/veejay-server/veejay/vj-composite.c @@ -50,8 +50,8 @@ #endif typedef struct { - uint8_t *proj_plane[3]; - uint8_t *mirror_plane[3]; + uint8_t *proj_plane[4]; + uint8_t *mirror_plane[4]; void *vp1; void *back1; void *scaler; @@ -268,7 +268,7 @@ void *composite_load_config( void *compiz, void *vc, int *result ) return NULL; } -int composite_event( void *compiz, uint8_t *in[3], int mouse_x, int mouse_y, int mouse_button, int w_x, int w_y ) +int composite_event( void *compiz, uint8_t *in[4], int mouse_x, int mouse_y, int mouse_button, int w_x, int w_y ) { composite_t *c = (composite_t*) compiz; if(viewport_external_mouse( c->vp1, c->proj_plane, mouse_x, mouse_y, mouse_button, 1,w_x,w_y )) { @@ -287,7 +287,7 @@ static void composite_scale( composite_t *c, VJFrame *input, VJFrame *output ) yuv_convert_and_scale(c->scaler,input,output); } -int composite_get_original_frame(void *compiz, uint8_t *current_in[3], uint8_t *out[3], int which_vp, int row_start, int row_end ) +int composite_get_original_frame(void *compiz, uint8_t *current_in[4], uint8_t *out[4], int which_vp, int row_start, int row_end ) { composite_t *c = (composite_t*) compiz; if( c->has_mirror_plane ) { @@ -301,7 +301,7 @@ int composite_get_original_frame(void *compiz, uint8_t *current_in[3], uint8_t * return -1; } -int composite_get_top(void *compiz, uint8_t *current_in[3], uint8_t *out[3], int which_vp ) +int composite_get_top(void *compiz, uint8_t *current_in[4], uint8_t *out[4], int which_vp ) { composite_t *c = (composite_t*) compiz; int vp1_active = viewport_active(c->vp1); @@ -335,7 +335,7 @@ int composite_get_top(void *compiz, uint8_t *current_in[3], uint8_t *out[3], int } /* Top frame, blit */ -void composite_blit_yuyv( void *compiz, uint8_t *in[3], uint8_t *yuyv, int which_vp ) +void composite_blit_yuyv( void *compiz, uint8_t *in[4], uint8_t *yuyv, int which_vp ) { composite_t *c = (composite_t*) compiz; int vp1_active = viewport_active(c->vp1); @@ -368,7 +368,7 @@ void composite_blit_yuyv( void *compiz, uint8_t *in[3], uint8_t *yuyv, int which //@OBSOLETE void composite_blit_ycbcr( void *compiz, - uint8_t *in[3], + uint8_t *in[4], int which_vp, void *gl ) { diff --git a/veejay-current/veejay-server/veejay/vj-composite.h b/veejay-current/veejay-server/veejay/vj-composite.h index d32cc64c..51aee7fa 100644 --- a/veejay-current/veejay-server/veejay/vj-composite.h +++ b/veejay-current/veejay-server/veejay/vj-composite.h @@ -26,20 +26,20 @@ void composite_set_colormode( void *compiz, int mode ); int composite_get_colormode(void *compiz); -int composite_get_original_frame(void *compiz, uint8_t *current_in[3], uint8_t *out[3], int which_vp, int row_start, int row_end ); +int composite_get_original_frame(void *compiz, uint8_t *current_in[4], uint8_t *out[4], int which_vp, int row_start, int row_end ); -int composite_get_top(void *compiz, uint8_t *current_in[3], uint8_t *out[3], int mode ); +int composite_get_top(void *compiz, uint8_t *current_in[4], uint8_t *out[4], int mode ); -int composite_processX( void *compiz, void *back1,uint8_t *tmp_data[3], VJFrame *input ); +int composite_processX( void *compiz, void *back1,uint8_t *tmp_data[4], VJFrame *input ); int composite_process(void *compiz, VJFrame *output, VJFrame *input, int which_vp, int pixfmt ); -void composite_blit_ycbcr( void *compiz,uint8_t *in[3], int which_vp, void *gl ); +void composite_blit_ycbcr( void *compiz,uint8_t *in[4], int which_vp, void *gl ); -void composite_blit_yuyv( void *compiz,uint8_t *in[3], uint8_t *yuyv, int which_vp ); +void composite_blit_yuyv( void *compiz,uint8_t *in[4], uint8_t *yuyv, int which_vp ); -int composite_event( void *compiz, uint8_t *in[3], int mouse_x, int mouse_y, int mouse_button, int w_x, int w_y ); +int composite_event( void *compiz, uint8_t *in[4], int mouse_x, int mouse_y, int mouse_button, int w_x, int w_y ); void composite_destroy( void *compiz ); diff --git a/veejay-current/veejay-server/veejay/vj-perform.c b/veejay-current/veejay-server/veejay/vj-perform.c index 3377ac7a..84b35432 100644 --- a/veejay-current/veejay-server/veejay/vj-perform.c +++ b/veejay-current/veejay-server/veejay/vj-perform.c @@ -3139,7 +3139,7 @@ static void vj_perform_finish_render( veejay_t *info, video_playback_setup *sett { VJFrame *frame = info->effect_frame1; VJFrame *frame2= info->effect_frame2; - uint8_t *pri[3]; + uint8_t *pri[4]; char *osd_text = NULL; char *more_text = NULL; int placement= 0; @@ -3147,7 +3147,7 @@ static void vj_perform_finish_render( veejay_t *info, video_playback_setup *sett pri[0] = primary_buffer[destination]->Y; pri[1] = primary_buffer[destination]->Cb; pri[2] = primary_buffer[destination]->Cr; - + pri[3] = NULL; if( settings->composite ) { //@ scales in software if( settings->ca ) { diff --git a/veejay-current/veejay-server/veejay/vj-share.c b/veejay-current/veejay-server/veejay/vj-share.c index 2a6d5f3a..3c102214 100644 --- a/veejay-current/veejay-server/veejay/vj-share.c +++ b/veejay-current/veejay-server/veejay/vj-share.c @@ -27,9 +27,10 @@ #include #include #include +#include #include #include - +#include static vj_client *vj_share_connect(char *hostname, int port) { vj_client *c = vj_client_alloc( 0,0,0 ); diff --git a/veejay-current/veejay-server/veejay/vj-shm.c b/veejay-current/veejay-server/veejay/vj-shm.c index e26ac666..41ac4f83 100644 --- a/veejay-current/veejay-server/veejay/vj-shm.c +++ b/veejay-current/veejay-server/veejay/vj-shm.c @@ -144,7 +144,7 @@ int vj_shm_get_shm_id( void *vv ) return v->shm_id; } -int vj_shm_read( void *vv , uint8_t *dst[3] ) +int vj_shm_read( void *vv , uint8_t *dst[4] ) { vj_shm_t *v = (vj_shm_t*) vv; vj_shared_data *data = (vj_shared_data*) v->sms; @@ -181,7 +181,7 @@ int vj_shm_read( void *vv , uint8_t *dst[3] ) int rot_val =0; -int vj_shm_write( void *vv, uint8_t *frame[3], int plane_sizes[4] ) +int vj_shm_write( void *vv, uint8_t *frame[4], int plane_sizes[4] ) { vj_shm_t *v = (vj_shm_t*) vv; vj_shared_data *data = (vj_shared_data*) v->sms;