diff --git a/veejay-current/sendVIMS/Makefile.defs b/veejay-current/sendVIMS/Makefile.defs index 75859a8e..e9f5d4ad 100644 --- a/veejay-current/sendVIMS/Makefile.defs +++ b/veejay-current/sendVIMS/Makefile.defs @@ -1,3 +1,3 @@ CC = cc PREFIX = /usr/local/ -OPTI_CFLAGS = -O3 -fomit-frame-pointer -ffast-math -funroll-loops +OPTI_CFLAGS = -O3 -fomit-frame-pointer -ffast-math -funroll-loops -fPIC diff --git a/veejay-current/veejay-server/doc/NET.txt b/veejay-current/veejay-server/doc/NET.txt index 960ca11e..3eff2ab2 100644 --- a/veejay-current/veejay-server/doc/NET.txt +++ b/veejay-current/veejay-server/doc/NET.txt @@ -1,10 +1,7 @@ Veejay stats ============ -As of veejay 1.4.4, veejay server will make a hit on veejay.dyne.org -for collecting geographical data on veejay usage. -This is the HTTP request send: "GET /veejay- HTTP/1.1\nHost: veejay.dyne.org\n\n" -It is defined in vj-server.c and cannot be disabled. +None. Veejay can stream over the Network ================================================= diff --git a/veejay-current/veejay-server/doc/README.audio b/veejay-current/veejay-server/doc/README.audio index 4165eb67..ac756768 100644 --- a/veejay-current/veejay-server/doc/README.audio +++ b/veejay-current/veejay-server/doc/README.audio @@ -7,7 +7,7 @@ Veejay has limited audio support. PREPARE ------- -You need an AVI file with an audio track encoded in PCM WAVE, 44-48Khz, 2 channels (stereo) and 8 or 16 bit per sample. +You need an AVI file with an audio track encoded in PCM WAVE, 44-48Khz, 2 channels (stereo) (16 bit) RUN diff --git a/veejay-current/veejay-server/libel/avilib.c b/veejay-current/veejay-server/libel/avilib.c index fd1630cc..6e2527c8 100644 --- a/veejay-current/veejay-server/libel/avilib.c +++ b/veejay-current/veejay-server/libel/avilib.c @@ -32,9 +32,6 @@ #include #include #include "avilib.h" -#ifdef STRICT_CHECKING -#include -#endif #define RUP8(num)(((num)+8)&~8) @@ -3235,11 +3232,6 @@ int AVI_seek_start(avi_t *AVI) int AVI_set_video_position(avi_t *AVI, long frame) { -#ifdef STRICT_CHECKING - assert( AVI->mode != AVI_MODE_WRITE ); - assert( AVI->video_index ); - assert( frame >= 0 && frame < AVI->video_frames); -#endif if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } if(!AVI->video_index) { AVI_errno = AVI_ERR_NO_IDX; return -1; } // if (frame < 0 ) frame = 0; @@ -3258,11 +3250,6 @@ int AVI_set_audio_bitrate(avi_t *AVI, long bitrate) long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe) { -#ifdef STRICT_CHECKING - assert( AVI->mode != AVI_MODE_WRITE ); - assert( AVI->video_index ); - assert( AVI->video_pos >= 0 && AVI->video_pos < AVI->video_frames ); -#endif // if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; } long n = AVI->video_index[AVI->video_pos].len; @@ -3408,12 +3395,6 @@ long AVI_read_audio_chunk(avi_t *AVI, char *audbuf) if (AVI->track[AVI->aptr].audio_posc+1>AVI->track[AVI->aptr].audio_chunks) return -1; -#ifdef STRICT_CHECKING - assert( AVI->mode != AVI_MODE_WRITE ); - assert( AVI->track[AVI->aptr].audio_index ); - assert( AVI->track[AVI->aptr].audio_posc+1 <= AVI->track[AVI->aptr].audio_chunks ); -#endif - left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb; if (audbuf == NULL) return left; @@ -3459,9 +3440,6 @@ int AVI_read_data(avi_t *AVI, char *vidbuf, long max_vidbuf, char data[8]; // if(AVI->mode==AVI_MODE_WRITE) return 0; -#ifdef STRICT_CHECKING - assert( AVI->mode != AVI_MODE_WRITE ); -#endif while(1) { /* Read tag and length */ diff --git a/veejay-current/veejay-server/libel/elcache.c b/veejay-current/veejay-server/libel/elcache.c index 3fc0c138..1e85f491 100644 --- a/veejay-current/veejay-server/libel/elcache.c +++ b/veejay-current/veejay-server/libel/elcache.c @@ -29,9 +29,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif typedef struct { @@ -66,9 +63,6 @@ static void cache_claim_slot(cache_t *v, int free_slot, uint8_t *linbuf, long fr data->num = frame_num; data->fmt = format; data->buffer = vj_malloc( buf_len ); -#ifdef STRICT_CHECKING - assert( v->index[free_slot] != frame_num ); -#endif // clear old buffer if( v->index[free_slot] >= 0 ) { @@ -166,22 +160,12 @@ void free_cache(void *cache) void cache_frame( void *cache, uint8_t *linbuf, int buflen, long frame_num , int format) { cache_t *v = (cache_t*) cache; -#ifdef STRICT_CHECKING - assert( cache != NULL ); - assert( linbuf != NULL ); - assert( buflen > 0 ); - assert( frame_num >= 0 ); -#else if( buflen <= 0 ) return; -#endif int slot_num = cache_free_slot( cache ); if( slot_num == -1 ) slot_num = cache_find_slot( v, frame_num ); -#ifdef STRICT_CHECKING - assert(slot_num >= 0 ); -#endif cache_claim_slot(v, slot_num, linbuf, frame_num, buflen, format); } @@ -193,15 +177,8 @@ uint8_t *get_cached_frame( void *cache, long frame_num, int *buf_len, int *forma return NULL; cache_slot_t *data = v->cache[ slot ]; -#ifdef STRICT_CHECKING - assert( data->size > 0 ); - assert( data->buffer != NULL ); -#endif *buf_len = data->size; *format = data->fmt; -#ifdef STRICT_CHECKING - assert( data->num == frame_num ); -#endif return (uint8_t*) data->buffer; } diff --git a/veejay-current/veejay-server/libel/lav_io.c b/veejay-current/veejay-server/libel/lav_io.c index ee0607cf..4263ba78 100644 --- a/veejay-current/veejay-server/libel/lav_io.c +++ b/veejay-current/veejay-server/libel/lav_io.c @@ -30,9 +30,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif //#include #include #ifdef USE_GDK_PIXBUF @@ -542,9 +539,6 @@ int lav_write_frame(lav_file_t *lav_file, uint8_t *buff, long size, long count) int res, n; uint8_t *jpgdata = NULL; long jpglen = 0; -#ifdef STRICT_CHECKING - assert( buff != NULL ); -#endif video_format = lav_file->format; internal_error = 0; /* for error messages */ #ifdef SUPPORT_READ_DV2 if(video_format == 'b') diff --git a/veejay-current/veejay-server/libel/pixbuf.c b/veejay-current/veejay-server/libel/pixbuf.c index ea060b7c..09b1853c 100644 --- a/veejay-current/veejay-server/libel/pixbuf.c +++ b/veejay-current/veejay-server/libel/pixbuf.c @@ -35,9 +35,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #define RUP8(num)(((num)+8)&~8) typedef struct @@ -217,16 +214,16 @@ void *vj_picture_open( const char *filename, int v_outw, int v_outh, int v_outf ulen = len / 2; break; default: -#ifdef STRICT_CHECKING - assert(0); -#endif break; } pic->space = (uint8_t*) vj_malloc( sizeof(uint8_t) * (4 * len)); -#ifdef STRICT_CHECKING - assert(pic->space != NULL ); -#endif + if(!pic->space) { + free(pic->filename); + free(pic); + return NULL; + } + pic->img = open_pixbuf( pic, filename, @@ -238,6 +235,8 @@ void *vj_picture_open( const char *filename, int v_outw, int v_outh, int v_outf pic->space + len + ulen ); if(!pic->img) { free(pic->space); + free(pic->filename); + free(pic); return NULL; } diff --git a/veejay-current/veejay-server/libel/vj-avcodec.c b/veejay-current/veejay-server/libel/vj-avcodec.c index 309ec47b..41e0f967 100644 --- a/veejay-current/veejay-server/libel/vj-avcodec.c +++ b/veejay-current/veejay-server/libel/vj-avcodec.c @@ -35,10 +35,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif - //from gst-ffmpeg, round up a number #define GEN_MASK(x) ((1<<(x))-1) diff --git a/veejay-current/veejay-server/libel/vj-dv.c b/veejay-current/veejay-server/libel/vj-dv.c index c9af0032..f9e47402 100644 --- a/veejay-current/veejay-server/libel/vj-dv.c +++ b/veejay-current/veejay-server/libel/vj-dv.c @@ -37,10 +37,6 @@ #define DV_NTSC_SIZE 120000 #define DV_AUDIO_MAX_SAMPLES 1944 -#ifdef STRICT_CHECKING -#include -#endif - int is_dv_resolution(int w, int h) { if( h == NTSC_H && w == NTSC_W ) diff --git a/veejay-current/veejay-server/libel/vj-el.c b/veejay-current/veejay-server/libel/vj-el.c index d66434a1..f1b949d2 100644 --- a/veejay-current/veejay-server/libel/vj-el.c +++ b/veejay-current/veejay-server/libel/vj-el.c @@ -66,10 +66,6 @@ #define CODEC_ID_YUVLZO 900 #define DUMMY_FRAMES 2 -//@@ ! -#ifdef STRICT_CHECKING -#include -#endif static struct { const char *name; @@ -363,9 +359,6 @@ void vj_el_init(int pf, int switch_jpeg, int dw, int dh, float fps) el_height_ = dh; el_fps_ = fps; -#ifdef STRICT_CHECKING - assert( pf == FMT_422 || pf == FMT_422F ); -#endif el_switch_jpeg_ = switch_jpeg; lav_set_project( dw,dh, fps, pf ); @@ -990,9 +983,6 @@ int vj_el_get_video_frame(editlist *el, long nframe, uint8_t *dst[4]) N_EL_FRAME(n)); return -1; } -#ifdef STRICT_CHECKING - assert( dst[0] != NULL && dst[1] != NULL && dst[2] != NULL ); -#endif int strides[4] = { el_out_->len, el_out_->uv_len, el_out_->uv_len,0 }; vj_frame_copy( srci->data, dst, strides ); return 1; @@ -1772,9 +1762,6 @@ char *vj_el_write_line_ascii( editlist *el, int *bytes_written ) char filename[2048]; //@ TRACE char fourcc[6]; //@ TRACE -#ifdef STRICT_CHECKING - int dbg_buflen = 0; -#endif /* get which files are actually referenced in the edit list entries */ int est_len = 0; @@ -1830,9 +1817,6 @@ char *vj_el_write_line_ascii( editlist *el, int *bytes_written ) est_len = 2 * len; -#ifdef STRICT_CHECKING - dbg_buflen = est_len; -#endif result = (char*) vj_calloc(sizeof(char) * est_len ); sprintf(result, "%04d",nnf ); @@ -1882,9 +1866,6 @@ char *vj_el_write_line_ascii( editlist *el, int *bytes_written ) int datalen = strlen(result); *bytes_written = datalen; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "EL estimated %d bytes, %d remaining bytes, %d used bytes",est_len,dbg_buflen,datalen); -#endif return result; } diff --git a/veejay-current/veejay-server/libplugger/dispatcher.c b/veejay-current/veejay-server/libplugger/dispatcher.c index 74b73fb7..db0f54bb 100644 --- a/veejay-current/veejay-server/libplugger/dispatcher.c +++ b/veejay-current/veejay-server/libplugger/dispatcher.c @@ -59,9 +59,6 @@ void deinit() { void init() { char server_port_name[10]; -#ifdef STRICT_CHECKING - assert( uri != NULL ); -#endif char *server = veejay_osc_server_get_addr( info->osc_server ); int server_port= veejay_osc_server_get_port( info->osc_server ); @@ -72,9 +69,6 @@ void init() { void *ui = veejay_new_osc_sender_uri( uri ); veejay_send_osc( ui, "/veejay", "sx", server ); int error = vevo_property_set( info->clients, uri, VEVO_ATOM_TYPE_VOIDPTR,1,&ui ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } @@ -86,10 +80,6 @@ void *veejay_get_osc_sender(veejay_t * info ) void *sender = NULL; if(!info->current_client) return NULL; -#ifdef STRICT_CHECKING - assert( info->current_client != NULL ); - assert( info->clients != NULL ); -#endif int error = vevo_property_get( info->clients, info->current_client, 0, &sender ); if( error == VEVO_NO_ERROR ) return sender; @@ -111,9 +101,6 @@ void veejay_init_ui(veejay_t * info , const char *uri) char veejaystr[100]; sprintf(veejaystr, "Veejay-NG %s", VERSION ); void *sender = veejay_get_osc_sender( info ); -#ifdef STRICT_CHECKING - assert( sender != NULL ); -#endif veejay_osc_set_window( sender , "MainWindow" ); diff --git a/veejay-current/veejay-server/libplugger/freeframe-loader.c b/veejay-current/veejay-server/libplugger/freeframe-loader.c index a838725a..7f2cf2bc 100644 --- a/veejay-current/veejay-server/libplugger/freeframe-loader.c +++ b/veejay-current/veejay-server/libplugger/freeframe-loader.c @@ -39,9 +39,6 @@ #define V_BITS 24 #include #include -#ifdef STRICT_CHECKING -#include -#endif typedef struct { @@ -257,9 +254,6 @@ void freeframe_plug_retrieve_default_values( void *instance, void *fx_values ) { void *base = NULL; int error = vevo_property_get( instance, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; @@ -281,9 +275,6 @@ void freeframe_plug_retrieve_current_values( void *instance, void *fx_values ) { void *base = NULL; int error = vevo_property_get( instance, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; @@ -312,9 +303,6 @@ void freeframe_reverse_clone_parameter( void *instance, int seq, void *fx_values { void *base = NULL; int error = vevo_property_get( instance, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; @@ -345,10 +333,6 @@ void freeframe_clone_parameter( void *instance, int seq, void *fx_values ) // put fx_values to freeframe void *base = NULL; int error = vevo_property_get( instance, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert(0); //@ this function must be dropped -#endif plugMainType *q = (plugMainType*) base; @@ -356,9 +340,6 @@ void freeframe_clone_parameter( void *instance, int seq, void *fx_values ) int i; DWORD inp = 0; error = vevo_property_get( instance, "instance", 0, &inp ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif error = vevo_property_get( instance, "num_params",0,&n); for( i = 0; i < n; i ++ ) @@ -388,15 +369,8 @@ void *freeframe_plug_init( void *plugin, int w, int h ) v.orientation = 1; v.bitDepth = FF_CAP_V_BITS_VIDEO; -#ifdef STRICT_CHECKING - assert( v.bitDepth == FF_CAP_32BITVIDEO ); -#endif - void *base = NULL; int error = vevo_property_get( plugin, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; DWORD instance = q( FF_INSTANTIATE, &v, 0).ivalue; @@ -508,9 +482,6 @@ void freeframe_plug_deinit( void *pluginstance ) { void *base = NULL; int error = vevo_property_get( pluginstance, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; DWORD instance = 0; @@ -529,9 +500,6 @@ void freeframe_plug_free( void *plugin ) int n = 0; void *base = NULL; int error = vevo_property_get( plugin, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; q( FF_DEINITIALISE, NULL, 0 ); @@ -550,16 +518,8 @@ void freeframe_push_channel( void *instance, int n,int dir, VJFrame *frame ) if(dir == 1){ vevo_property_set( instance, "HOST_output", VEVO_ATOM_TYPE_VOIDPTR,1,&frame ); } else { -#ifdef STRICT_CHECKING - assert( freeframe_frame_[n] != NULL ); - assert(yuv_conv_ != NULL ); - assert( dir == 0 ); - assert( n >= 0 && n < 4 ); -#endif yuv_convert_and_scale_rgb( yuv_conv_, frame, freeframe_frame_[ n ] ); - } - } @@ -567,27 +527,16 @@ int freeframe_plug_process( void *plugin, double timecode ) { void *base = NULL; int error = vevo_property_get( plugin, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; DWORD instance = 0; error = vevo_property_get( plugin, "instance",0, &instance ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( instance != 0 ); -#endif q( FF_PROCESSFRAME, freeframe_space_, instance ); VJFrame *output_frame = NULL; error = vevo_property_get( plugin, "HOST_output", 0,&output_frame ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( output_frame != NULL ); -#endif //@ output frame in [0] yuv_convert_and_scale_from_rgb( rgb_conv_, freeframe_frame_[0], output_frame ); @@ -620,14 +569,8 @@ void freeframe_plug_param_f( void *plugin, int seq_no, void *dargs ) void *base = NULL; error = vevo_property_get( plugin, "base", 0, &base); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif DWORD instance = 0; error = vevo_property_get( plugin, "instance", 0, &instance ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif plugMainType *q = (plugMainType*) base; q( FF_SETPARAMETER, &sps, instance ); diff --git a/veejay-current/veejay-server/libplugger/frei0r-loader.c b/veejay-current/veejay-server/libplugger/frei0r-loader.c index 01867471..2c6a856a 100644 --- a/veejay-current/veejay-server/libplugger/frei0r-loader.c +++ b/veejay-current/veejay-server/libplugger/frei0r-loader.c @@ -40,9 +40,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #include #define RUP8(num)(((num)+8)&~8) @@ -224,10 +221,6 @@ void frei0r_plug_param_f( void *port, int num_args, int *args ) if( err != VEVO_NO_ERROR ) { return; } -#ifdef STRICT_CHECKING - f0r_get_param_value_f w = NULL; - vevo_property_get( parent, "get_params", 0, &w ); -#endif int width = 1; int height = 1; diff --git a/veejay-current/veejay-server/libplugger/livido-loader.c b/veejay-current/veejay-server/libplugger/livido-loader.c index 4a974fcc..af04b108 100644 --- a/veejay-current/veejay-server/libplugger/livido-loader.c +++ b/veejay-current/veejay-server/libplugger/livido-loader.c @@ -23,9 +23,6 @@ * See livido specification at http://livido.dyne.org */ #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -173,10 +170,6 @@ int livido_plug_get_index_parameter_as_dbl( void *fx_instance, const char *key,i int error = vevo_property_get( fx_instance, key, k, ¶meter ); if(error != VEVO_NO_ERROR ) return 0; -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( parameter != NULL ); -#endif int value = 0; error = vevo_property_get( parameter, "value", 0, &value ); if( error == VEVO_NO_ERROR ) @@ -190,10 +183,6 @@ int livido_plug_get_number_parameter_as_dbl( void *fx_instance,const char *key, { void *parameter = NULL; int error = vevo_property_get( fx_instance, key, k, ¶meter ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( parameter != NULL ); -#endif double value = 0.0; error = vevo_property_get( parameter, "value", 0, &value ); if( error == VEVO_NO_ERROR ) @@ -207,10 +196,6 @@ int livido_plug_get_coord_parameter_as_dbl( void *fx_instance,const char *key, i { void *parameter = NULL; int error = vevo_property_get( fx_instance, key, k, ¶meter ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( parameter != NULL ); -#endif double value[2]; error = vevo_property_get( parameter, "value", 0, &value ); if( error == VEVO_NO_ERROR ) @@ -227,15 +212,8 @@ int livido_plug_parameter_get_range_dbl( void *fx_instance,const char *key, int int error = vevo_property_get( fx_instance, key, k, ¶meter ); if(error != VEVO_NO_ERROR ) return 0; -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); - assert( parameter != NULL ); -#endif void *parameter_templ = NULL; error = vevo_property_get( parameter, "parent_template", 0, ¶meter_templ ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif /* if(error != VEVO_NO_ERROR ) { *min = 0.0; @@ -246,9 +224,6 @@ int livido_plug_parameter_get_range_dbl( void *fx_instance,const char *key, int }*/ int kind = 0; error = vevo_property_get( parameter_templ, "HOST_kind", 0, &kind ); -#ifdef STRICT_CHECING - assert( error == VEVO_NO_ERROR ); -#endif int irange[2]; if (kind == HOST_PARAM_NUMBER ) @@ -261,13 +236,7 @@ int livido_plug_parameter_get_range_dbl( void *fx_instance,const char *key, int else if(kind == HOST_PARAM_INDEX ) { error = vevo_property_get( parameter_templ, "min", 0 , &(irange[0]) ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif error = vevo_property_get( parameter_templ, "max", 0, &(irange[1]) ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif *min = (double) irange[0]; *max = (double) irange[1]; *dkind = HOST_PARAM_INDEX; @@ -408,12 +377,6 @@ static int livido_scan_out_parameters( void *plugin , void *plugger_port) char *kind = vevo_property_get_string( param, "kind" ); //get_str_vevo( param, "kind" ); -#ifdef STRICT_CHECKING - if( kind == NULL ) - veejay_msg(0, "\tParameter %d of %d has no property kind", n,NP ); - assert( kind != NULL ); -#endif - ikind = livido_pname_to_host_kind(kind); vevo_property_set( param, "HOST_kind", VEVO_ATOM_TYPE_INT,1,&ikind ); @@ -446,9 +409,6 @@ static int livido_scan_parameters( void *plugin, void *plugger_port ) int ikind = 0; char *kind = get_str_vevo( param, "kind" ); -#ifdef STRICT_CHECKING - assert( kind != NULL ); -#endif void *vje_port = vpn( VEVO_VJE_PORT ); int tmp[4]; double dtmp[4]; @@ -496,9 +456,6 @@ static int livido_scan_parameters( void *plugin, void *plugger_port ) } else if (strcasecmp(kind, "TEXT" ) == 0 ) { ikind = HOST_PARAM_TEXT; vj_np ++; -#ifdef STRICT_CHECKING - assert(0); //@implement me -#endif } vevo_property_set( param, "HOST_kind", VEVO_ATOM_TYPE_INT,1,&ikind ); vevo_property_set( vje_port, "HOST_kind", VEVO_ATOM_TYPE_INT,1,&ikind ); @@ -539,12 +496,9 @@ static int init_parameter_port(livido_port_t *ptr, livido_port_t *in_param ) // pctrl = livido_plug_parameter_set_color; break; // case HOST_PARAM_TEXT: // pctrl = livido_plug_parameter_set_text; break; -#ifdef STRICT_CHECKING default: - veejay_msg(0, "Invalid kind : '%d'", kind ); return 0; break; -#endif } vevo_property_set( in_param, "HOST_parameter_func", LIVIDO_ATOM_TYPE_VOIDPTR,1,&pctrl ); @@ -602,9 +556,6 @@ static int init_channel_port(livido_port_t *ptr, livido_port_t *in_channel, int } error = vevo_property_get( ptr, "flags", 0, &flags ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif livido_property_set( in_channel, "width", LIVIDO_ATOM_TYPE_INT,1,&w ); livido_property_set( in_channel, "height", LIVIDO_ATOM_TYPE_INT,1,&h ); livido_property_set( in_channel, "flags", LIVIDO_ATOM_TYPE_INT,1,&flags ); @@ -643,9 +594,6 @@ static int init_ports_from_template( livido_port_t *filter_instance, livido_port { livido_port_t *ptr = NULL; error = livido_property_get( template, name, i, &ptr ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif in_channels[i] = vpn( id ); //@ is this ever freed?! livido_property_set( in_channels[i], "parent_template",LIVIDO_ATOM_TYPE_PORTPTR,1, &ptr); livido_property_soft_reference( in_channels[i], "parent_template" ); @@ -667,12 +615,6 @@ static int init_ports_from_template( livido_port_t *filter_instance, livido_port return -1; } } -#ifdef STRICT_CHECKING - else - { - assert(0); - } -#endif } @@ -695,16 +637,8 @@ char *livido_describe_parameter_format_osc( void *instance, int p ) return NULL; } error = vevo_property_get( param, "parent_template",0,¶m_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - int kind = 0; error = vevo_property_get( param_templ, "HOST_kind",0,&kind ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - char fmt[5]; veejay_memset(fmt,0,sizeof(fmt)); @@ -732,9 +666,6 @@ char *livido_describe_parameter_format_osc( void *instance, int p ) fmt[0] = 's'; break; default: -#ifdef STRICT_CHECKING - assert(0); -#endif break; } @@ -880,13 +811,6 @@ void *livido_plug_init(void *plugin,int w, int h, int base_fmt_ ) "out_parameter_templates", "out_parameters", w,h,0 ); -#ifdef STRICT_CHECKING - assert( num_in_params >= 0 ); - assert( num_out_params >= 0 ); - assert( num_in_channels >= 0 ); - assert( num_out_channels >= 0 ); -#endif - //@ call livido init livido_init_f init_f; vevo_property_get( filter_templ, "init_func", 0, &init_f ); @@ -944,13 +868,6 @@ void *livido_plug_init(void *plugin,int w, int h, int base_fmt_ ) static void livido_push_channel_local( void *instance,const char *key, int n, VJFrame *frame ) // in_channels / out_channels { int error; -#ifdef STRICT_CHECKING - int num_in_channels = vevo_property_num_elements( instance, key); - if( n < 0 || n >= num_in_channels ) - veejay_msg(0, "%s: Cannot push channel %d", __FUNCTION__ , n ); - assert( n >= 0 && n < num_in_channels ); - assert( frame != NULL ); -#endif configure_channel( instance, key, n, frame ); } @@ -965,16 +882,9 @@ void livido_plug_process( void *instance, double time_code ) { void *filter_templ = NULL; int error = vevo_property_get( instance, "filter_templ",0,&filter_templ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif livido_process_f process; error = vevo_property_get( filter_templ, "process_func", 0, &process ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); - assert( (*process) != NULL ); -#endif (*process)( instance, time_code ); @@ -1024,13 +934,6 @@ void livido_plug_deinit( void *instance ) return; } -#ifdef STRICT_CHECKING - char *plugin_name = get_str_vevo( filter_templ, "name" ); - assert( plugin_name != NULL ); - veejay_msg(VEEJAY_MSG_DEBUG, "Destroy '%s'", plugin_name ); - free(plugin_name); -#endif - if( error == VEVO_NO_ERROR ) (*deinit)( instance ); @@ -1042,9 +945,6 @@ void livido_plug_deinit( void *instance ) void *ic = NULL; int hs = 0; error = vevo_property_get( instance, "in_channels",n, &ic ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif } void *channel = NULL; @@ -1066,16 +966,8 @@ void livido_plug_retrieve_values( void *instance, void *fx_values ) void *param = NULL; void *param_templ = NULL; int error = vevo_property_get( instance, "in_parameters", i, ¶m); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif error = vevo_property_get( param, "parent_template", 0, ¶m_templ ); -#ifdef STRICT_CHECKING - if( error != LIVIDO_NO_ERROR ) - veejay_msg(0,"%s: parent_template not found in Parameter %d/%d, error code %d", __FUNCTION__, i, vj_np,error ); - assert( error == LIVIDO_NO_ERROR ); -#endif sprintf(vkey, "p%02d", i ); clone_prop_vevo( param_templ, fx_values, "default", vkey ); @@ -1097,9 +989,6 @@ int livido_plug_read_output_parameters( void *instance, void *fx_values ) void *param_templ = NULL; int error = vevo_property_get( instance, "out_parameters", i, ¶m ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif sprintf(vkey, "p%02d", i ); clone_prop_vevo( param, fx_values, "value", vkey); @@ -1114,21 +1003,11 @@ char *livido_describe_parameter_format( void *instance, int p ) if(error != VEVO_NO_ERROR ) return 0; error = vevo_property_get( param, "parent_template",0,¶m_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int kind = 0; error = vevo_property_get( param_templ, "HOST_kind",0,&kind ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int n_elems = vevo_property_num_elements( param, "value" ); -#ifdef STRICT_CHECKING - assert( n_elems > 0 ); -#endif - char fmt[5]; bzero(fmt,5); @@ -1171,14 +1050,8 @@ int livido_set_parameter_from_string( void *instance, int p, const char *str, vo if(error != VEVO_NO_ERROR ) return 0; error = vevo_property_get( param, "parent_template",0,¶m_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int kind = 0; error = vevo_property_get( param_templ, "HOST_kind",0,&kind ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int res = 0; char vkey[64]; sprintf(vkey, "p%02d", p ); @@ -1218,9 +1091,6 @@ void livido_reverse_clone_parameter( void *instance, int seq, void *fx_value_por char vkey[10]; void *param = NULL; int error = vevo_property_get( instance, "in_parameters", i, ¶m); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif sprintf(vkey, "p%02d", i ); clone_prop_vevo( param, fx_value_port, vkey, "value" ); } @@ -1235,9 +1105,6 @@ void livido_clone_parameter( void *instance, int seq, void *fx_value_port ) char vkey[10]; void *param = NULL; int error = vevo_property_get( instance, "in_parameters", i, ¶m); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif sprintf(vkey, "p%02d", i ); clone_prop_vevo( fx_value_port, param,vkey, "value" ); // clone_prop_vevo( param, fx_value_port, vkey, "value" ); @@ -1254,9 +1121,6 @@ static void livido_notify_parameter_update( void *instance ,void *param, void *v { void *userdata = NULL; error = vevo_property_get( instance, "HOST_data",0, &userdata); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif (*cbf)( userdata, param, value ); } } @@ -1270,20 +1134,11 @@ void livido_set_parameter( void *instance, int seq, void *value ) { livido_set_parameter_f pctrl; error = vevo_property_get( param, "HOST_parameter_func", 0, &pctrl ); -#ifdef STRICT_CHECKING - assert( error == 0 ); -#endif if( (*pctrl)( param, value ) ) livido_notify_parameter_update( instance,param, value ); } } -#ifdef STRICT_CHECKING -void *livido_plugin_port_new( int id ) -{ - return vpn(id); -} -#endif static void *livido_get_parameter_template(void *plugin, unsigned int pos ) { @@ -1349,7 +1204,6 @@ void* deal_with_livido( void *handle, const char *name ) livido_setup_f livido_setup = dlsym( handle, "livido_setup" ); -#ifndef STRICT_CHECKING livido_setup_t setup[] = { { (void(*)())vj_malloc_ }, { (void(*)())free }, @@ -1368,29 +1222,8 @@ void* deal_with_livido( void *handle, const char *name ) }; -#else - livido_setup_t setup[] = { - { (void(*)()) vj_malloc_ }, - { (void(*)()) free }, - { (void(*)())memset }, - { (void(*)())memcpy }, - { (void(*)())livido_plugin_port_new }, - { (void(*)())vevo_port_free }, - { (void(*)())vevo_property_set }, - { (void(*)())vevo_property_get }, - { (void(*)())vevo_property_num_elements }, - { (void(*)())vevo_property_atom_type }, - { (void(*)())vevo_property_element_size }, - { (void(*)())vevo_list_properties }, - { (void(*)())livido_dummy_function }, - { (void(*)())livido_dummy_function }, - }; -#endif void *livido_plugin = livido_setup( setup, LIVIDO_API_VERSION ); -#ifdef STRICT_CHECKING - assert( livido_plugin != NULL ); -#endif if(!livido_plugin) { // ( port ); //FIXME leak @@ -1444,9 +1277,6 @@ void* deal_with_livido( void *handle, const char *name ) veejay_msg(VEEJAY_MSG_DEBUG, "Loading LiVIDO-%d plugin '%s' , %d IP, %d OP" , compiled_as, plugin_name, n_params, n_oparams ); -#ifdef STRICT_CHECKING - assert( plugin_name != NULL ); -#endif char *clone_name = (char*) vj_malloc( strlen(plugin_name) + 5); sprintf(clone_name, "LVD %s", plugin_name ); @@ -1468,9 +1298,6 @@ void* deal_with_livido( void *handle, const char *name ) void livido_set_pref_palette( int pref_palette ) { -#ifdef STRICT_CHECKING - assert( pref_palette == PIX_FMT_YUVJ422P || pref_palette == PIX_FMT_YUV422P ); -#endif pref_palette_ffmpeg_ = pref_palette; pref_palette_ = LIVIDO_PALETTE_YUV422P; } diff --git a/veejay-current/veejay-server/libplugger/oscevents.c b/veejay-current/veejay-server/libplugger/oscevents.c index f62bf163..094b7eda 100644 --- a/veejay-current/veejay-server/libplugger/oscevents.c +++ b/veejay-current/veejay-server/libplugger/oscevents.c @@ -36,9 +36,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif void osc_sample_edl_paste_at( void *ptr,const char *path, const char *types, void **dargv, void *raw ) { @@ -412,9 +409,6 @@ void osc_veejay_ui_init( void *info,const char *path, const char *types, void * { lo_arg **argv = (lo_arg**) dargv; char *uri = osc_get_uri( raw ); -#ifdef STRICT_CHECKING - assert( uri != NULL ); -#endif veejay_add_client( info, uri ); veejay_init_ui( info, uri ); diff --git a/veejay-current/veejay-server/libplugger/oscfactory.c b/veejay-current/veejay-server/libplugger/oscfactory.c index c17a0e1b..11a74034 100644 --- a/veejay-current/veejay-server/libplugger/oscfactory.c +++ b/veejay-current/veejay-server/libplugger/oscfactory.c @@ -29,9 +29,6 @@ int describe_plug(void *info, void *fx_instance, void *in_values) static void sample_notify_parameter( void *sample, void *parameter, void *value ) { char *osc_path = vevo_property_get_string( parameter, "HOST_osc_path" ); -#ifdef STRICT_CHECKING - assert( osc_path != NULL ); -#endif char *osc_types = vevo_property_get_string( parameter, "HOST_osc_types"); sample_runtime_data *srd = (sample_runtime_data*) sample; diff --git a/veejay-current/veejay-server/libplugger/oscsend.c b/veejay-current/veejay-server/libplugger/oscsend.c index 346eed96..cc3dfac5 100644 --- a/veejay-current/veejay-server/libplugger/oscsend.c +++ b/veejay-current/veejay-server/libplugger/oscsend.c @@ -28,9 +28,6 @@ #include //@ client side implementation -#ifdef STRICT_CHECKING -#include -#endif typedef struct { @@ -106,10 +103,6 @@ static void veejay_add_arguments_ ( lo_message lmsg, const char *format, va_list lo_message_add_double( lmsg, g); } break; default: -#ifdef STRICT_CHECKING - veejay_msg(0, "Invalid format : '%c' %x",*format,*format); - assert(0); -#endif break; } *format ++; @@ -172,9 +165,6 @@ static int _vevo_get_int( void *port, const char *key, int n_elem, lo_message lm for( i = 0; i < n_elem; i ++ ) { error = vevo_property_get( port, key, i, &(values[i])); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif lo_message_add_int32( lmsg, values[i]); } @@ -193,9 +183,6 @@ static int _vevo_get_dbl( void *port, const char *key, int n_elem, lo_message lm for( i = 0; i < n_elem; i ++ ) { error = vevo_property_get( port, key, i, &(values[i])); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif lo_message_add_double( lmsg, values[i]); } return VEVO_NO_ERROR; @@ -205,9 +192,6 @@ int veejay_vevo_send_osc( void *osc, const char *msg, void *vevo_port ) { char **keys = vevo_list_properties( vevo_port ); int i; -#ifdef STRICT_CHECKING - assert( keys != NULL ); -#endif lo_message lmsg = lo_message_new(); oscclient_t *c = (oscclient_t*) osc; @@ -215,10 +199,6 @@ int veejay_vevo_send_osc( void *osc, const char *msg, void *vevo_port ) for ( i = 0; keys[i] != NULL; i ++ ) { char *format = vevo_format_kind( vevo_port, keys[i] ); -#ifdef STRICT_CHECKING - assert( format != NULL ); -#endif - int n_elems = vevo_property_num_elements( vevo_port, keys[i] ); while( *format ) @@ -232,9 +212,6 @@ int veejay_vevo_send_osc( void *osc, const char *msg, void *vevo_port ) _vevo_get_dbl( vevo_port, keys[i], n_elems, lmsg ); break; default: -#ifdef STRICT_CHECKING - assert(0); -#endif break; } *format++; @@ -263,9 +240,6 @@ void veejay_xbundle_add( void *osc, const char *window, const char *widget, cons { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); } -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message lmsg = lo_message_new(); if(!window) @@ -290,9 +264,6 @@ void veejay_bundle_add_blobs( void *osc, const char *msg, void *blub, void *blab { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); } -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message lmsg = lo_message_new(); lo_blob blob = (lo_blob) blub; lo_blob blob2 = (lo_blob) blab; @@ -311,9 +282,6 @@ void veejay_bundle_add_blob( void *osc, const char *msg, void *blub ) { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); } -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message lmsg = lo_message_new(); lo_blob blob = (lo_blob) blub; lo_message_add_blob( lmsg, blob ); @@ -327,9 +295,6 @@ void veejay_bundle_add( void *osc, const char *msg, const char *format, ... ) { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); } -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message lmsg = lo_message_new(); lo_message_add_string(lmsg, c->window ); @@ -404,9 +369,6 @@ void *veejay_message_new_widget( void *osc, const char *str1,const char *str2, i void veejay_message_widget_done( void *osc, void *msg ) { oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message *lmsg = (lo_message*) msg; lo_bundle_add_message( c->bundle, "/create/channels", lmsg ); } @@ -414,9 +376,6 @@ void veejay_message_widget_done( void *osc, void *msg ) void veejay_message_add_argument( void *osc, void *msg, const char *format, ... ) { oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message *lmsg = (lo_message*) msg; va_list ap; @@ -427,27 +386,18 @@ void veejay_message_add_argument( void *osc, void *msg, const char *format, ... void veejay_message_pulldown_done( void *osc, void *msg ) { oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message *lmsg = (lo_message*) msg; lo_bundle_add_message( c->bundle, "/create/pulldown", lmsg ); } void veejay_message_pulldown_done_update( void *osc, void *msg ) { oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message *lmsg = (lo_message*) msg; lo_bundle_add_message( c->bundle, "/update/pulldown", lmsg ); } void veejay_message_linked_pulldown_done( void *osc, void *msg ) { oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message *lmsg = (lo_message*) msg; lo_bundle_add_message( c->bundle, "/create/fxpulldown", lmsg ); } @@ -465,10 +415,6 @@ void veejay_bundle_plugin_add( void *osc, const char *window, const char *path, lo_message_add_string(lmsg, path ); int n_elem = strlen( format ); -#ifdef STRICT_CHECKING - assert( n_elem == 1 ); -#endif - int ival; char *str; double gval; @@ -533,9 +479,6 @@ void veejay_bundle_sample_add( void *osc, int id, const char *word, const char * { char osc_path[256]; oscclient_t *c = (oscclient_t*) osc; -#ifdef STRICT_CHECKING - assert( c->window != NULL ); -#endif if(!c->bundle) { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); @@ -719,9 +662,6 @@ void veejay_ui_bundle_add( void *osc, const char *msg, const char *format, ... ) { c->bundle = lo_bundle_new( LO_TT_IMMEDIATE ); } -#ifdef STRICT_CHECKING - assert( c->bundle != NULL ); -#endif lo_message lmsg = lo_message_new(); va_list ap; diff --git a/veejay-current/veejay-server/libplugger/oscservit.c b/veejay-current/veejay-server/libplugger/oscservit.c index 225d42ed..afe971e5 100644 --- a/veejay-current/veejay-server/libplugger/oscservit.c +++ b/veejay-current/veejay-server/libplugger/oscservit.c @@ -35,9 +35,6 @@ a/. * but WITHOUT ANY WARRANTY; without even the implied warranty of #include #include //@ client side implementation -#ifdef STRICT_CHECKING -#include -#endif #include typedef struct { @@ -135,18 +132,10 @@ void veejay_osc_del_methods( void *user_data, void *osc_space,void *vevo_port, v { void *event_port = NULL; error = vevo_property_get( osc_space, keys[i],0,&event_port ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif void *ptr = NULL; error = vevo_property_get( event_port, "userdata",0, &ptr ); -#ifdef STRICT_CHECKING - assert(error == VEVO_NO_ERROR ); - assert( ptr != NULL ); -#endif - char *types = get_str_vevo( event_port, "format" ); lo_server_thread_del_method( s->st, keys[i], types ); @@ -201,9 +190,6 @@ free(uri); return 0; } int n_elem = strlen(required_format); -#ifdef STRICT_CHECKING - assert( n_elem == argc ); -#endif int k; if( types[0] == 'i' ) { @@ -323,9 +309,6 @@ int osc_sample_handler( const char *path, const char *types, } int n_elem = strlen(required_format); -#ifdef STRICT_CHECKING - assert( n_elem == argc ); -#endif int k; free(required_format); @@ -451,53 +434,32 @@ static int servit_new_event( { veejay_t *info = (veejay_t*) userdata; osc_recv_t *s = (osc_recv_t*) info->osc_server; -#ifdef STRICT_CHECKING - void *p = (void*) vevo_port_new( VEVO_ANONYMOUS_PORT,__FUNCTION__,__LINE__ ); -#else void *p = (void*) vevo_port_new( VEVO_ANONYMOUS_PORT ); -#endif int error; if( func ) { error = vevo_property_set( p, "func", VEVO_ATOM_TYPE_VOIDPTR,1,&func ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } if( fmt == NULL ) error = vevo_property_set( p, "format", VEVO_ATOM_TYPE_STRING,0,NULL ); else error = vevo_property_set( p, "format", VEVO_ATOM_TYPE_STRING,1, &fmt ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif if( descr == NULL ) error = vevo_property_set(p, "description",VEVO_ATOM_TYPE_STRING,0, NULL ); else error = vevo_property_set(p, "description", VEVO_ATOM_TYPE_STRING,1, &descr ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - if( ptemplate ) { error = vevo_property_set( p, "parent", VEVO_ATOM_TYPE_VOIDPTR,1,&ptemplate ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - } /* if( extra_token >= 0) { error = vevo_property_set(p, "ref", VEVO_ATOM_TYPE_INT,1, &extra_token ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif }*/ if( args ) @@ -510,9 +472,6 @@ static int servit_new_event( char index[10]; sprintf(index,"help_%d",i); error = vevo_property_set( p, index, VEVO_ATOM_TYPE_STRING,1,&(args[i]) ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } } } @@ -527,10 +486,6 @@ static int servit_new_event( 1, &pd ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - char *tmp_path = NULL; if( base) tmp_path = osc_create_path( base, key ); @@ -545,10 +500,6 @@ static int servit_new_event( 1, &p ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - lo_server_thread_add_method( s->st, my_path, diff --git a/veejay-current/veejay-server/libplugger/plugload.c b/veejay-current/veejay-server/libplugger/plugload.c index 0c0dff8b..b382ed9a 100644 --- a/veejay-current/veejay-server/libplugger/plugload.c +++ b/veejay-current/veejay-server/libplugger/plugload.c @@ -55,9 +55,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -97,9 +94,6 @@ static int select_f( const struct dirent *d ) int plug_set_param_from_str( void *plugin , int p, const char *str, void *values ) { int type = 0; -#ifdef STRICT_CHECKING - assert( plugin != NULL ); -#endif return livido_set_parameter_from_string( plugin, p, str, values ); } @@ -112,13 +106,7 @@ char *plug_describe_param( void *plugin, int p ) static void* instantiate_plugin( const void *plugin, int w , int h ) { int type = 0; -#ifdef STRICT_CHECKING - assert( plugin != NULL ); -#endif int error = vevo_property_get( plugin, "HOST_plugin_type", 0, &type); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif if( error != VEVO_NO_ERROR ) return NULL; @@ -150,9 +138,6 @@ static void* instantiate_plugin( const void *plugin, int w , int h ) static void deinstantiate_plugin( void *instance ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_deinit_f gin = NULL; int error = vevo_property_get( instance, "HOST_plugin_deinit_f", 0, &gin ); @@ -220,9 +205,6 @@ static int add_to_plugin_list( const char *path ) dlerror() ); continue; } -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "\tOpened plugin '%s' in '%s'", name,path ); -#endif char *bname = basename( fullname ); char *basename = strdup( bname ); void *plugin = NULL; @@ -282,14 +264,8 @@ static int add_to_plugin_list( const char *path ) static void free_plugin(void *plugin) { -#ifdef STRICT_CHECKING - assert( plugin != NULL ); -#endif void *handle = NULL; int error = vevo_property_get( plugin, "handle", 0 , &handle ); -#ifdef STRICT_CHECKING - assert( error == 0 ); -#endif if( error == VEVO_NO_ERROR ) vevo_port_recursive_free( plugin ); @@ -547,9 +523,6 @@ int plug_sys_detect_plugins(void) { index_map_ = (vevo_port_t**) vj_calloc(sizeof(vevo_port_t*) * 256 ); illegal_plugins_ = vpn( VEVO_ILLEGAL ); -#ifdef STRICT_CHECKING - assert( illegal_plugins_ != NULL ); -#endif char *lvd_path = get_livido_plug_path(); if( lvd_path != NULL ) { @@ -612,43 +585,30 @@ int plug_sys_detect_plugins(void) void plug_clone_from_parameters(void *instance, void *fx_values) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_reverse_clone_parameter_f grc; int error = vevo_property_get( instance, "HOST_plugin_param_reverse_f", 0, &grc ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif + if( error != VEVO_NO_ERROR ) + return; // copy parameters from plugin to fx_values (*grc)( instance ,0, fx_values ); } int plug_clone_from_output_parameters( void *instance, void *fx_values ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_reverse_clone_out_parameter_f grc; int error = vevo_property_get( instance, "HOST_plugin_out_param_reverse_f", 0, &grc ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif + if( error != VEVO_NO_ERROR ) + return 0; int n = (*grc)(instance,fx_values); return n; } void plug_clone_parameters( void *instance, void *fx_values ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_clone_parameter_f gcc; int error = vevo_property_get( instance, "HOST_plugin_param_clone_f", 0, &gcc ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - (*gcc)( instance, 0, fx_values ); + if( error == VEVO_NO_ERROR ) + (*gcc)( instance, 0, fx_values ); } int plug_is_frei0r( void *instance ) @@ -662,9 +622,6 @@ int plug_is_frei0r( void *instance ) void plug_set_parameter( void *instance, int seq_num,int n_elements,void *value ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_push_parameter_f gpp; int error = vevo_property_get( instance, "HOST_plugin_param_f", 0, &gpp ); if( error == VEVO_NO_ERROR) @@ -677,28 +634,16 @@ void plug_set_parameters( void *instance, int n_args, void *values ) } void plug_get_defaults( void *instance, void *fx_values ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_default_values_f gdv; int error = vevo_property_get( instance, "HOST_plugin_defaults_f", 0, &gdv ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - (*gdv)( instance, fx_values ); + if( error == VEVO_NO_ERROR ) + (*gdv)( instance, fx_values ); } void plug_set_defaults( void *instance, void *fx_values ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_clone_parameter_f gcp; int error = vevo_property_get( instance, "HOST_plugin_param_clone_f", 0, &gcp ); - -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR); -#endif (*gcp)( instance, 0,fx_values ); } @@ -784,9 +729,6 @@ char *plug_describe( int fx_id ) error = vevo_property_get( plug, "instance", 0,&instance ); error = vevo_property_get( instance, "filters",0,&filter ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif //@ cannot handle multiple filters yet char *maintainer = get_str_vevo( instance, "maintainer"); char *version = get_str_vevo( instance, "version" ); @@ -870,9 +812,6 @@ void *plug_activate( int fx_id ) } void *instance = instantiate_plugin( index_map_[fx_id], base_width_,base_height_); -#ifdef STRICT_CHECKING - if( instance ) vevo_port_dump(instance,0); -#endif if( instance == NULL ) { veejay_msg(0, "Error instantiating plugin."); return NULL; @@ -890,13 +829,7 @@ void plug_build_name_space( int fx_id, void *fx_instance, void *data, int entry_ { void *plugin = index_map_[fx_id]; int type = 0; -#ifdef STRICT_CHECKING - assert( plugin != NULL ); -#endif int error = vevo_property_get( plugin, "HOST_plugin_type", 0, &type); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif switch( type ) { case VEVO_PLUG_LIVIDO: @@ -907,9 +840,6 @@ void plug_build_name_space( int fx_id, void *fx_instance, void *data, int entry_ case VEVO_PLUG_FR: break; default: -#ifdef STRICT_CHECKING - assert(0); -#endif break; } @@ -969,12 +899,6 @@ char *plug_get_name( int fx_id ) char *plug_get_osc_format(void *fx_instance, int seq_num) { -/* void *param_templ = NULL; - int error = vevo_property_get( fx_instance, "parent_template",0,¶m_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif*/ - char *required_format = livido_describe_parameter_format_osc( fx_instance,seq_num ); return required_format; } @@ -1005,9 +929,6 @@ int plug_get_num_output_channels( int fx_id ) int res = 0; int error = vevo_property_get( index_map_[fx_id], "num_outputs",0,&res); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif return res; } int plug_get_num_input_channels( int fx_id ) @@ -1018,9 +939,6 @@ int plug_get_num_input_channels( int fx_id ) int res = 0; int error = vevo_property_get( index_map_[fx_id], "num_inputs",0,&res); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif return res; } @@ -1032,9 +950,6 @@ int plug_get_num_parameters( int fx_id ) int res = 0; int error = vevo_property_get( index_map_[fx_id], "num_params",0,&res); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif return res; } @@ -1048,9 +963,6 @@ void plug_push_frame( void *instance, int out, int seq_num, void *frame_info ) { VJFrame *frame = (VJFrame*) frame_info; -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_push_channel_f gpu; int error = vevo_property_get( instance, "HOST_plugin_push_f", 0, &gpu ); @@ -1060,15 +972,10 @@ void plug_push_frame( void *instance, int out, int seq_num, void *frame_info ) void plug_process( void *instance, double timecode ) { -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif generic_process_f gpf; int error = vevo_property_get( instance, "HOST_plugin_process_f", 0, &gpf ); -#ifdef STRICT_CHECKING - assert( error == 0 ); -#endif - (*gpf)( instance, timecode ); + if( error == VEVO_NO_ERROR ) + (*gpf)( instance, timecode ); } diff --git a/veejay-current/veejay-server/libplugger/uifactory.c b/veejay-current/veejay-server/libplugger/uifactory.c index b0d1104f..be3827cb 100644 --- a/veejay-current/veejay-server/libplugger/uifactory.c +++ b/veejay-current/veejay-server/libplugger/uifactory.c @@ -32,9 +32,6 @@ #include #include -#ifdef STRICT_CHECKING -#include -#endif static void vevosample_ui_type_shared( void *sample, char *window ); static void vevosample_ui_type_capture( void *sample, const char *window, const char *frame); @@ -164,14 +161,8 @@ static void vevosample_ui_construct_fx_contents( void *sample, int entry_id, co slot->window = strdup( window ); int error = vevo_property_get( srd->info_port, "primary_key", 0, &id ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif void *filter_template = NULL; error = vevo_property_get( slot->fx_instance, "filter_templ",0 ,&filter_template ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif char *label_str = vevo_property_get_string( filter_template, "name" ); char label[128]; sprintf( label, "FX slot %d with \"%s\" ", entry_id, label_str ); @@ -200,37 +191,17 @@ static void vevosample_ui_construct_fx_contents( void *sample, int entry_id, co { void *parameter = NULL; error = vevo_property_get( slot->fx_instance, "in_parameters", q, ¶meter ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif void *parameter_templ = NULL; error = vevo_property_get( parameter, "parent_template",0,¶meter_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int kind = 0; error = vevo_property_get( parameter_templ, "HOST_kind",0,&kind ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif char *parameter_name = vevo_property_get_string(parameter_templ, "name" ); -#ifdef STRICT_CHECKING - assert( parameter_name != NULL ); -#endif char *osc_path = vevo_property_get_string(parameter, "HOST_osc_path" ); -#ifdef STRICT_CHECKING - if( !osc_path ) - veejay_msg(0,"No osc path for '%s' ",parameter_name ); - assert( osc_path != NULL ); -#endif int ival = 0; double gval = 0.0; int imin = 0, imax = 0; double gmin = 0.0, gmax = 0.0; char *hint = vevo_property_get_string( parameter_templ, "description" ); -#ifdef STRICT_CHECKING - assert( hint != NULL ); -#endif switch( kind ) { case HOST_PARAM_INDEX: @@ -257,10 +228,6 @@ static void vevosample_ui_construct_fx_contents( void *sample, int entry_id, co parameter_name, ival ,osc_path, hint ); break; default: -#ifdef STRICT_CHECKING - veejay_msg(0 ,"Parameter types not implemented"); - assert(0); -#endif break; } free(hint); @@ -323,25 +290,13 @@ veejay_msg(0, "UI Factory: There are %d input channels", n ); { void *parameter = NULL; error = vevo_property_get( slot->fx_instance, "out_parameters", q, ¶meter ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif void *parameter_templ = NULL; error = vevo_property_get( parameter, "parent_template",0,¶meter_templ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif int kind = 0; error = vevo_property_get( parameter_templ, "HOST_kind",0,&kind ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif if( kind == HOST_PARAM_NUMBER || kind == HOST_PARAM_SWITCH || kind == HOST_PARAM_INDEX ) { char *parameter_name = vevo_property_get_string(parameter_templ, "name" ); -#ifdef STRICT_CHECKING - assert( parameter_name != NULL ); -#endif sprintf(fx_frame, "fxb_%d",q ); veejay_ui_bundle_add( osc_send, "/create/vframe", "ssssx", window, box_name,fx_frame, parameter_name ); char param_id[32]; @@ -418,9 +373,6 @@ void vevosample_ui_get_input_parameter_list( void *sample, int fx_id, const char { sample_runtime_data *srd = (sample_runtime_data*) sample; fx_slot_t *rel = (fx_slot_t*) sample_get_fx_port_ptr( srd, fx_id); -#ifdef STRICT_CHECKING - assert( rel->fx_instance != NULL ); -#endif void *osc_send = veejay_get_osc_sender(srd->user_data ); if(!osc_send) return; @@ -440,9 +392,6 @@ void vevosample_ui_get_input_parameter_list( void *sample, int fx_id, const char for( i = 0; i < n ; i++ ) { char *pname = _get_in_parameter_name( rel->fx_instance, i ); -#ifdef STRICT_CHECKING - assert( pname != NULL ); -#endif veejay_msg(0, "\t added parameter '%s'", pname ); veejay_message_add_argument( osc_send, msg, "s", pname ); @@ -463,10 +412,6 @@ void vevosample_ui_get_bind_list( void *sample, const char *window ) sample_runtime_data *srd = (sample_runtime_data*) sample; fx_slot_t *sl = (fx_slot_t*) sample_get_fx_port_ptr( srd, fx_id); -#ifdef STRICT_CHECKING - assert( sl->fx_instance != NULL ); - assert( srd->primary_key == dummy ); -#endif void *osc_send = veejay_get_osc_sender(srd->user_data ); if(!osc_send) return; @@ -494,24 +439,15 @@ void vevosample_ui_get_bind_list( void *sample, const char *window ) for( i = 0; items[i] != NULL ; i ++ ) { int n[3]; -#ifdef STRICT_CHECKING - assert( sscanf( items[i], "bp%d_%d_%d",&n[BIND_OUT_P],&n[BIND_ENTRY],&n[BIND_IN_P] ) == 3 ); -#else sscanf( items[i], "bp%d_%d_%d", &n[BIND_OUT_P],&n[BIND_ENTRY],&n[BIND_IN_P] ); #endif fx_slot_t *rel = (fx_slot_t*) sample_get_fx_port_ptr( srd, n[BIND_ENTRY]); -#ifdef STRICT_CHECKING - assert( rel->fx_instance != NULL ); -#endif if( n[BIND_OUT_P] == p_num && vevo_property_get(sl->bind, items[i],0,NULL) == VEVO_NO_ERROR ) { veejay_msg(0, "'%s' is a valid bind",items[i]); void *filter_template = NULL; int error = vevo_property_get( rel->fx_instance, "filter_templ",0 ,&filter_template ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif char *fxname = vevo_property_get_string( filter_template, "name" ); char *pname = _get_in_parameter_name( rel->fx_instance, n[BIND_IN_P] ); @@ -570,17 +506,11 @@ static void vevosample_ui_construct_bind_list( void *sample, int k, int p_num, v int n[3]; sscanf( items[i], "bp%d_%d_%d", &n[BIND_OUT_P],&n[BIND_ENTRY],&n[BIND_IN_P] ); fx_slot_t *rel = (fx_slot_t*) sample_get_fx_port_ptr( srd, n[BIND_ENTRY]); -#ifdef STRICT_CHECKING - assert( rel->fx_instance != NULL ); -#endif if( n[BIND_OUT_P] == p_num && vevo_property_get( slot->bind, items[i],0,NULL) == VEVO_NO_ERROR) { void *filter_template = NULL; int error = vevo_property_get( rel->fx_instance, "filter_templ",0 ,&filter_template ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif char *fxname = vevo_property_get_string( filter_template, "name" ); char *pname = _get_in_parameter_name( rel->fx_instance, n[BIND_IN_P] ); @@ -611,9 +541,6 @@ void vevosample_ui_construct_fx_bind_window( void *sample, int k, int p_id ) fx_slot_t *sl = sample_get_fx_port_ptr( srd, k); if(!sl->fx_instance) return; -#ifdef STRICT_CHECKING - assert( osc_send != NULL ); -#endif int i; char window_title[128]; @@ -621,9 +548,6 @@ void vevosample_ui_construct_fx_bind_window( void *sample, int k, int p_id ) char *pname = _get_out_parameter_name( sl->fx_instance, p_id ); void *filter_template = NULL; int error = vevo_property_get( sl->fx_instance, "filter_templ",0 ,&filter_template ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif char *fxname = vevo_property_get_string( filter_template, "name" ); char fx_label[128]; char owner[64]; @@ -636,9 +560,6 @@ void vevosample_ui_construct_fx_bind_window( void *sample, int k, int p_id ) if(!window) return; -#ifdef STRICT_CHECKING - assert( sl->fx_instance != NULL ); -#endif sprintf(fx_frame, "NewBind%d_%d_%d",k,p_id,id ); char bindpath[128]; @@ -658,9 +579,6 @@ void vevosample_ui_construct_fx_bind_window( void *sample, int k, int p_id ) { void *ft = NULL; int error = vevo_property_get( slot->fx_instance, "filter_templ",0,&ft ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR); -#endif char *plug = vevo_property_get_string( ft, "name" ); sprintf(list_item, "FX %d %s", i, plug ); free(plug); @@ -788,9 +706,6 @@ static void vevosample_ui_type_capture( void *sample, const char *window, const sample_runtime_data *srd = (sample_runtime_data*) sample; int i; char **list = vj_unicap_get_list( srd->data ); -#ifdef STRICT_CHECKING - assert( list != NULL ); -#endif double min=0.0; double max=0.0; char format[5]; diff --git a/veejay-current/veejay-server/libplugger/utility.c b/veejay-current/veejay-server/libplugger/utility.c index 36263d98..e950887f 100644 --- a/veejay-current/veejay-server/libplugger/utility.c +++ b/veejay-current/veejay-server/libplugger/utility.c @@ -36,9 +36,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif char *get_str_vevo( void *port, const char *key ){ @@ -55,11 +52,6 @@ char *alloc_str_vevo( void *port, const char *key ) if( vevo_property_get( port, key,0,NULL ) != VEVO_NO_ERROR ) return NULL; -#ifdef STRICT_CHECKING - int at = vevo_property_atom_type( port, key ); - - assert( at == VEVO_ATOM_TYPE_STRING || at == VEVO_ATOM_TYPE_UTF8STRING ); -#endif ret = (char*) vj_malloc(sizeof(char) * len ); return ret; } @@ -140,22 +132,13 @@ void clone_prop_vevo( void *port, void *to_port, const char *key, const char *as for( i= 0; i < num; i ++ ) { error = vevo_property_get( port,key,i, &(itmp[i]) ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } error = vevo_property_set( to_port, as_key, type, num, &itmp ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif break; case VEVO_ATOM_TYPE_DOUBLE: for( i = 0; i < num ; i++ ) { error = vevo_property_get( port, key, i, &(dtemp[i])); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } //@ FIXME: scale parameter and treat as TYPE_INT @@ -165,9 +148,6 @@ void clone_prop_vevo( void *port, void *to_port, const char *key, const char *as error = vevo_property_set( to_port, as_key, VEVO_ATOM_TYPE_INT, num, &itmp ); // error = vevo_property_set( to_port, as_key, type, num, &dtemp ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif // veejay_msg(0, "\t\tValue is %g ", dtemp[0] ); break; //@ FIXME: not supported yet @@ -179,20 +159,11 @@ void clone_prop_vevo( void *port, void *to_port, const char *key, const char *as if( len > 0 ) continue; stmp[i] = (char*) vj_malloc(sizeof(char) * len ); error = vevo_property_get( port, key, i, &(stmp[i]) ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } error = vevo_property_set( to_port, as_key, type, num, &stmp ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif break;*/ default: veejay_msg(0, "Internal error. Cannot clone this type of atom"); -#ifdef STRICT_CHECKING - assert(0); -#endif break; } @@ -203,9 +174,6 @@ void clone_prop_vevo( void *port, void *to_port, const char *key, const char *as void clone_prop_vevo2( void *port, void *to_port, const char *key, const char *as_key ) { int n = vevo_property_atom_type( port ,key); -#ifdef STRICT_CHECKING - assert( n >= 0 ); -#endif int itmp = 0; double dtmp = 0.0; int error = 0; @@ -214,43 +182,18 @@ void clone_prop_vevo2( void *port, void *to_port, const char *key, const char * { case VEVO_ATOM_TYPE_INT: error = vevo_property_get( port, key, 0, &itmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR); -#endif error = vevo_property_set( to_port, as_key, n, 1, &itmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR); -#endif break; case VEVO_ATOM_TYPE_DOUBLE: error = vevo_property_get( port, key, 0, &dtmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR); - assert( to_port != NULL ); - assert( key != NULL ); -#endif error = vevo_property_set( to_port, as_key, n, 1, &dtmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR); -#endif - break; case VEVO_ATOM_TYPE_BOOL: error = vevo_property_get( port, key, 0, &itmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR); -#endif error = vevo_property_set( to_port, as_key, n, 1, &itmp ); -#ifdef STRICT_CHECKING - assert( error == LIVIDO_NO_ERROR ); -#endif - break; default: -#ifdef STRICT_CHECKING veejay_msg(0, "Type %d cannot be cloned",n); - assert( 0 ); -#endif break; } } diff --git a/veejay-current/veejay-server/libsample/sampleadm.c b/veejay-current/veejay-server/libsample/sampleadm.c index 0296d484..8a851c97 100644 --- a/veejay-current/veejay-server/libsample/sampleadm.c +++ b/veejay-current/veejay-server/libsample/sampleadm.c @@ -1013,9 +1013,6 @@ void *sample_get_plugin( int s1, int position, void *ptr) int sample_get_effect_any(int s1, int position) { sample_info *sample = sample_get(s1); -#ifdef STRICT_CHECKING - assert( position >= 0 && position < SAMPLE_MAX_EFFECTS ); -#endif // if(position >= SAMPLE_MAX_EFFECTS || position < 0 ) return -1; if(sample) { return sample->effect_chain[position]->effect_id; @@ -1552,19 +1549,12 @@ int sample_load_composite_config( void *compiz, int s1 ) int val = 0; void *temp = composite_load_config( compiz, sample->viewport_config , &val ); if( temp == NULL || val == -1 ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG,"No composite config for sample %d",s1); -#endif return 0; } sample->composite = val; sample->viewport = temp; sample_update(sample,s1); -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Loaded config for sample %d, mode %d", - s1, val ); -#endif return sample->composite; } @@ -1591,10 +1581,6 @@ int sample_set_composite(void *compiz, int s1, int composite) sample->composite = 1; return sample_update(sample,s1); } -#ifdef STRICT_CHECKING - assert( sample->viewport_config != NULL ); - assert( compiz != NULL ); -#endif composite_add_to_config( compiz, sample->viewport_config, composite ); return ( sample_update(sample,s1)); @@ -1815,9 +1801,6 @@ int sample_set_endframe(int s1, long frame_num) if(sample->play_length) { -#ifdef STRICT_CHECKING - assert( sample->edit_list != NULL ); -#endif int new_len = ( frame_num - sample->first_frame ); if( new_len <= 1 ) new_len = 1; @@ -2482,9 +2465,6 @@ int sample_chain_sprint_status( int s1,int cache,int sa,int ca, int pfps, int fr if (!sample) { -#ifdef STRICT_CHECKING - veejay_msg(0, "Fatal : sample %d is invalid, cannot produce a valid status line", s1 ); -#endif return -1; } int e_a, e_d, e_s; @@ -3265,10 +3245,7 @@ void LoadSubtitles( sample_info *skel, char *file, void *font ) { char tmp[512]; - sprintf(tmp, "%s-SUB-%d.srt", file,skel->sample_id ); -#ifdef STRICT_CHECKING - assert( skel->dict != NULL ); -#endif + snprintf(tmp,sizeof(tmp), "%s-SUB-%d.srt", file,skel->sample_id ); vj_font_load_srt( font, tmp ); } diff --git a/veejay-current/veejay-server/libstream/v4l2utils.c b/veejay-current/veejay-server/libstream/v4l2utils.c index 4a4f2b79..717b1cbb 100644 --- a/veejay-current/veejay-server/libstream/v4l2utils.c +++ b/veejay-current/veejay-server/libstream/v4l2utils.c @@ -50,9 +50,6 @@ #include #ifdef HAVE_V4L2 #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -331,9 +328,6 @@ static int v4l2_ffmpeg2v4l2( int pf) return V4L2_PIX_FMT_YUV32; default: -#ifdef STRICT_CHECKING - assert( pf >= 0 ); -#endif return V4L2_PIX_FMT_BGR24; } return V4L2_PIX_FMT_BGR24; @@ -767,9 +761,6 @@ static int v4l2_channel_choose( v4l2info *v, const int pref_channel ) int other = -1; for ( i = 0; i < (pref_channel+1); i ++ ) { if( -1 == vioctl( v->fd, VIDIOC_S_INPUT, &i )) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "v4l2: Input channel %d does not exist", i); -#endif if( errno == EINVAL ) continue; return 0; @@ -823,9 +814,6 @@ int v4l2_poll( void *d , int nfds, int timeout ) err = poll( &p, nfds, timeout ); if( err == -1 ) { if( errno == EAGAIN || errno == EINTR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "v4l2: Capture device busy, try again."); -#endif return 0; } } @@ -1114,9 +1102,6 @@ v4l2_rw_fallback: static double calc_tc( struct v4l2_timecode *tc, float fps ) { -#ifdef STRICT_CHECKING - assert( fps > 0.0 ); -#endif return (double) tc->frames / fps; } @@ -1988,9 +1973,6 @@ static void *v4l2_grabber_thread( void *v ) pthread_exit(NULL); return NULL; } else { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "v4l2: error queuing frame, %d retries left", i->retries ); -#endif i->retries --; } } diff --git a/veejay-current/veejay-server/libstream/v4lutils.c b/veejay-current/veejay-server/libstream/v4lutils.c index 9c60063f..8eb6a689 100644 --- a/veejay-current/veejay-server/libstream/v4lutils.c +++ b/veejay-current/veejay-server/libstream/v4lutils.c @@ -24,9 +24,6 @@ #include #ifdef HAVE_V4L #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -42,11 +39,7 @@ #define STRBUF_LENGTH 1024 -#ifdef STRICT_CHECKING -static int v4l_debug = 1; /* 1 = print debug message */ -#else static int v4l_debug = 0; -#endif extern int errno; static int v4lperror_level = V4L_PERROR_ALL; diff --git a/veejay-current/veejay-server/libstream/v4lvideo.c b/veejay-current/veejay-server/libstream/v4lvideo.c index b034f27d..085a1030 100644 --- a/veejay-current/veejay-server/libstream/v4lvideo.c +++ b/veejay-current/veejay-server/libstream/v4lvideo.c @@ -42,9 +42,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif typedef struct _normlist { @@ -177,17 +174,6 @@ void *v4lvideo_init( char* file, int channel, int norm, int freq, int dst_w, int return v; } -#ifdef STRICT_CHECKING -static void lock__(v4lvideo_template_t *t, const char *f, int line) { - pthread_mutex_lock(&(t->mutex)); -} -static void unlock__(v4lvideo_template_t *t, const char *f, int line) { - pthread_mutex_unlock(&(t->mutex)); -} -#define lock_(t) lock__(t,__FUNCTION__,__LINE__) -#define unlock_(t) unlock__(t, __FUNCTION__ ,__LINE__) - -#else static void lock_(v4lvideo_template_t *t) { pthread_mutex_lock( &(t->mutex )); @@ -196,7 +182,6 @@ static void unlock_(v4lvideo_template_t *t) { pthread_mutex_unlock( &(t->mutex )); } -#endif int v4lvideo_templ_get_palette( int p ) { @@ -329,9 +314,6 @@ static int v4lvideo_fun(v4lvideo_t *v, int w, int h, int palette, int *cap_pale int supported_palette = -1; int is_jpeg[2] = {0,0}; -#ifdef STRICT_CHECKING - assert( v != NULL ); -#endif while( palette_descr_[i].id != -1 ) { if(palette_descr_[i].id == VIDEO_PALETTE_JPEG ) { i ++; @@ -392,9 +374,6 @@ static v4lprocessing *v4lvideo_get_processing( v4lvideo_t *v, int w, int h, int } else { if( fun == VIDEO_PALETTE_JPEG ) { veejay_msg(VEEJAY_MSG_WARNING, "Grabbing JPEG from video device"); -#ifdef STRICT_CHECKING - assert( arr[0] == 1 ); -#endif skip = 1; supported_palette = fun; *cap_palette = arr[1]; @@ -424,10 +403,6 @@ static v4lprocessing *v4lvideo_get_processing( v4lvideo_t *v, int w, int h, int v4lprocessing *p = (v4lprocessing*) vj_calloc(sizeof(v4lprocessing)); p->src_fmt = get_ffmpeg_palette( supported_palette ); p->dst_fmt = get_ffmpeg_palette( palette ); -#ifdef STRICT_CHECKING - assert( p->src_fmt != -1 ); - assert( p->dst_fmt != -1 ); -#endif int max_w = v->vd.capability.maxwidth; int min_w = v->vd.capability.minwidth; @@ -491,9 +466,6 @@ static v4lprocessing *v4lvideo_get_processing( v4lvideo_t *v, int w, int h, int char **v4lvideo_templ_get_devices(int *num) { -#ifdef STRICT_CHECKING - assert( device_list_ != NULL ); -#endif char **items = (char**) vevo_list_properties( device_list_ ); char filename[200]; int error = 0; @@ -517,9 +489,6 @@ char **v4lvideo_templ_get_devices(int *num) char tmp[1024]; for( i = 0; items[i] != NULL ; i ++ ) { error = vevo_property_get(device_list_,items[i],0,NULL); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif size_t name_len = vevo_property_element_size( device_list_, items[i], 0 ); char *name = (char*) vj_calloc(name_len); vevo_property_get( device_list_, items[i], 0, &name ); @@ -548,9 +517,6 @@ void v4lvideo_templ_init() char *name = v4lgetdevicename( &(v->vd)); snprintf(key,sizeof(key), "%d",i); int error = vevo_property_set( device_list_, key, VEVO_ATOM_TYPE_STRING, 1,&name ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif veejay_msg(VEEJAY_MSG_DEBUG, "Detected %s as device /dev/video/%d",name,i); device_count_ ++; @@ -664,10 +630,6 @@ static int __v4lvideo_init( v4lvideo_t *v, char *file, int channel, int norm, in v->native = v->info->native; -#ifdef STRICT_CHECKING - assert(v->info != NULL); -#endif - return 1; } @@ -732,26 +694,17 @@ int v4lvideo_grab_check(v4lvideo_t *v, int palette ) { int ret=0; v4lseterrorlevel( V4L_PERROR_NONE ); if( v4lvideo_set_grabformat(v, palette ) ) { -#ifdef STRICT_CHECKING - veejay_msg(0,"%s: wrong palette %s", __FUNCTION__,get_palette_name( palette) ); -#endif ret = -1; goto VIDEOEXIT; } if( v4lgrabstart( &(v->vd),0) < 0 ) { -#ifdef STRICT_CHECKING - veejay_msg(0, "%s: Unable to start grabbing.", __FUNCTION__ ); -#endif ret = -1; goto VIDEOEXIT; } ret = v4lsync( &(v->vd),0); return ret; VIDEOEXIT: -#ifdef STRICT_CHECKING - veejay_msg(0, "%s: Bail", __FUNCTION__ ); -#endif v4lseterrorlevel( V4L_PERROR_ALL ); return ret; } @@ -779,10 +732,6 @@ static void *v4lvideo_grabber_thread( void * vv ) veejay_msg(0, "Unable to open capture device '%s' in %dx%d - %s", i->filename, v->video_width,v->video_height,get_palette_name(v->video_palette) ); i->error = 1; -#ifdef STRICT_CHECKING - veejay_msg(0,"%s: Giving up, unable to open %s, channel %d, norm %x, %dx%d palette %x", - __FUNCTION__, i->filename , i->channel, i->norm, i->width, i->height, i->palette ); -#endif unlock_(i); pthread_exit(NULL); return NULL; @@ -909,13 +858,6 @@ int v4lvideo_grabstart( void *vv ) static int __v4lvideo_grabstart( void *vv ) { v4lvideo_t *v = (v4lvideo_t*) vv; -#ifdef STRICT_CHECKING - void *ptr = (void*) &(v->vd); - assert( ptr != NULL ); - assert( v->video_width > 0 ); - assert( v->video_height > 0 ); -// assert( v->info != NULL ); -#endif v->vd.frame = 0; if( v4lgrabstart( &(v->vd), 0 ) < 0 ) { @@ -970,9 +912,6 @@ int v4lvideo_copy_framebuffer_to( void *vv, uint8_t *dstY, uint8_t *dstU, uint8_ unlock_(v); return 0; } -#ifdef STRICT_CHECKING - assert( v->v4l != NULL ); -#endif v4lvideo_t *v1 = (v4lvideo_t*) v->v4l; if( v1->has_video ) { uint8_t *src = v->frame_buffer; @@ -994,9 +933,6 @@ int v4lvideo_copy_framebuffer_to( void *vv, uint8_t *dstY, uint8_t *dstU, uint8_ static void __v4lvideo_copy_framebuffer_to(v4lvideo_t *v1, v4lvideo_template_t *v2, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV ) { uint8_t *src = NULL; -#ifdef STRICT_CHECKING - assert(v1->info != NULL ); -#endif if( v1->native == 1 ) { src = v4lgetaddress(&(v1->vd)); /* lock_(v2); @@ -1072,9 +1008,6 @@ static void __v4lvideo_copy_framebuffer_to(v4lvideo_t *v1, v4lvideo_template_t * srcf->data[0] = src; srcf->data[1] = src + srcf->len; srcf->data[2] = src + srcf->len + srcf->uv_len; -#ifdef STRICT_CHECKING - assert(0); -#endif } else {*/ srcf->data[0] = v4lgetaddress(&(v1->vd)); diff --git a/veejay-current/veejay-server/libstream/vj-net.c b/veejay-current/veejay-server/libstream/vj-net.c index 6a91d422..06dfa968 100644 --- a/veejay-current/veejay-server/libstream/vj-net.c +++ b/veejay-current/veejay-server/libstream/vj-net.c @@ -37,9 +37,6 @@ #define RUP8(num)(((num)+8)&~8) -#ifdef STRICT_CHECKING -#include -#endif typedef struct { pthread_mutex_t mutex; @@ -212,15 +209,6 @@ void *reader_thread(void *data) } if(unlock(t) != 0 ) goto NETTHREADEXIT; -/* -#ifdef STRICT_CHECKING - if( vj_client_poll( v, V_CMD ) ) { - char bogus[32]; - while( vj_client_link_can_read(v,V_CMD) ) - vj_client_read( v, bogus, 1 ); - } -#endif -*/ } } NETTHREADRETRY: @@ -248,9 +236,6 @@ NETTHREADRETRY: if( success <= 0 ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Tried to connect to %s:%d code=%d", tag->source_name,tag->video_channel,success); -#endif goto NETTHREADRETRY; } else diff --git a/veejay-current/veejay-server/libstream/vj-tag.c b/veejay-current/veejay-server/libstream/vj-tag.c index 32eb7c6c..f7717a36 100644 --- a/veejay-current/veejay-server/libstream/vj-tag.c +++ b/veejay-current/veejay-server/libstream/vj-tag.c @@ -24,9 +24,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #define VIDEO_PALETTE_YUV420P 15 #define VIDEO_PALETTE_YUV422P 13 @@ -1133,9 +1130,6 @@ int _vj_tag_new_unicap( vj_tag * tag, int stream_nr, int width, int height, int return -1; } last_added_tag = tag->id; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Created new tag %d", tag->id ); -#endif this_tag_id++; #ifdef HAVE_FREETYPE @@ -1411,9 +1405,6 @@ int vj_tag_set_composite( void *compiz,int t1, int n ) tag->composite = 1; return (vj_tag_update(tag,t1)); } -#ifdef STRICT_CHECKING - assert( tag->viewport_config != NULL ); -#endif composite_add_to_config( compiz, tag->viewport_config, n ); return (vj_tag_update(tag,t1)); @@ -1930,9 +1921,6 @@ int vj_tag_get_effect_any(int t1, int position) { vj_tag *tag = vj_tag_get(t1); if(!tag ) return 0; -#ifdef STRICT_CHECKING - assert( position >= 0 && position < SAMPLE_MAX_EFFECTS ); -#endif return tag->effect_chain[position]->effect_id; } @@ -1942,9 +1930,6 @@ int vj_tag_chain_malloc(int t1) int i=0; int e_id = 0; int sum =0; -#ifdef STRICT_CHECKING - assert( tag != NULL ); -#endif for(i=0; i < SAMPLE_MAX_EFFECTS; i++) { @@ -1964,9 +1949,6 @@ int vj_tag_chain_malloc(int t1) int vj_tag_chain_free(int t1) { vj_tag *tag = vj_tag_get(t1); -#ifdef STRICT_CHECKING - assert(tag != NULL ); -#endif int i=0; int e_id = 0; int sum = 0; @@ -2287,9 +2269,6 @@ int vj_tag_get_all_effect_args(int t1, int position, int *args, if( tag->effect_chain[position]->kf_status ) { -#ifdef STRICT_CHECKING - assert( tag->effect_chain[position]->kf != NULL ); -#endif for( i =0;i source_type == VJ_TAG_TYPE_V4L ) { if(tag->capture_type == 1 ) { @@ -2933,9 +2909,6 @@ static uint8_t *blackframe_new( int w, int h, int uv_len, uint8_t *Y, uint8_t *U } veejay_memset( buf, 0, sizeof(uint8_t) * 5 * ((w*h)+2*uv_len)); tag->blackframe = buf; -#ifdef STRICT_CHECKING - assert( uv_len == ( (w/2) * h )); -#endif const int chroma=127; tag->lf = (double*) vj_malloc(sizeof(double) * (w*h)); @@ -3626,9 +3599,6 @@ int vj_tag_sprint_status( int tag_id,int cache,int sa, int ca, int pfps,int fram { vj_tag *tag; tag = vj_tag_get(tag_id); -#ifdef STRICT_CHECKING - assert( tag != NULL ); -#endif //if (!tag) //return -1; @@ -3982,9 +3952,6 @@ 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, opacity=0, nframes=0; -#ifdef STRICT_CHECKING - assert( _tag_info != NULL ); -#endif xmlNodePtr fx[32]; veejay_memset( fx, 0, sizeof(fx)); @@ -4056,9 +4023,6 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon if(n_id > 0 ) { vj_tag *tag = vj_tag_get( n_id ); -#ifdef STRICT_CHECKING - assert( tag != NULL ); -#endif tag->id = id; tag->effect_toggle = fx_on; tag->fader_active = fader_active; @@ -4080,9 +4044,6 @@ void tagParseStreamFX(char *sampleFile, xmlDocPtr doc, xmlNodePtr cur, void *fon { char tmp[512]; sprintf(tmp, "%s-SUB-s%d.srt", sampleFile, id ); -#ifdef STRICT_CHECKING - assert(tag->dict != NULL); -#endif vj_font_set_dict( font, tag->dict ); vj_font_load_srt( font, tmp ); diff --git a/veejay-current/veejay-server/libstream/vj-yuv4mpeg.c b/veejay-current/veejay-server/libstream/vj-yuv4mpeg.c index 7f595eef..eb2496f4 100644 --- a/veejay-current/veejay-server/libstream/vj-yuv4mpeg.c +++ b/veejay-current/veejay-server/libstream/vj-yuv4mpeg.c @@ -31,9 +31,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif vj_yuv *vj_yuv4mpeg_alloc(int w, int h, float fps, int out_pixel_format) { @@ -201,10 +198,6 @@ int vj_yuv_stream_header_pipe(vj_yuv *yuv4mpeg,VJFrame *frame) int vj_yuv_stream_start_write(vj_yuv * yuv4mpeg,VJFrame *frame, char *filename, int outchroma) { -#ifdef STRICT_CHECKING - assert( filename != NULL ); - assert( strlen(filename) > 3 ); -#endif //if(mkfifo( filename, 0600)!=0) return -1; /* if the file exists gamble and simply append, if it does not exist write header diff --git a/veejay-current/veejay-server/libvevo/pool.c b/veejay-current/veejay-server/libvevo/pool.c index 918bd60e..46f2723c 100644 --- a/veejay-current/veejay-server/libvevo/pool.c +++ b/veejay-current/veejay-server/libvevo/pool.c @@ -16,10 +16,6 @@ #include #include "pool.h" -#ifdef STRICT_CHECKING -#include -#endif - //! \typedef space_t structure /*! The space_t structure is a linked list of spaces. Each space has a magazine that can hold up to ROUNDS_PER_MAG rounds. @@ -42,9 +38,6 @@ typedef struct { space_t **spaces; /*!< array of spaces */ space_t *space; /*!< single space */ -#ifdef STRICT_CHECKING - int msize; -#endif } pool_t; //!Allocate a new space of a fixed size @@ -58,9 +51,6 @@ static space_t *alloc_space( size_t bs ) unsigned char *p; space_t *s; s = (space_t*) vj_malloc(sizeof(space_t)); -#ifdef STRICT_CHECKING - assert( s != NULL ); -#endif s->area = vj_calloc(bs * (ROUNDS_PER_MAG+1)); s->mag = vj_calloc( sizeof(void*) * (ROUNDS_PER_MAG + 2) ); @@ -77,12 +67,7 @@ static space_t *alloc_space( size_t bs ) int vevo_pool_size( void *p ) { -#ifdef STRICT_CHECKING - pool_t *pool = (pool_t*) p; - return pool->msize; -#else return 0; -#endif } //! Allocate a new pool with spaces of various fixed sizes @@ -97,9 +82,6 @@ void *vevo_pool_init(size_t prop_size,size_t stor_size, size_t atom_size, size_t { unsigned int Msize = Mend + 1; pool_t *p = (pool_t*) vj_malloc(sizeof(pool_t)); //@ FIXME: reachable -#ifdef STRICT_CHECKING - assert( p != NULL ); -#endif p->space = NULL; p->spaces = (space_t**) vj_malloc(sizeof(space_t*) * Msize ); p->spaces[M4b] = alloc_space( sizeof(int32_t) ); @@ -111,22 +93,6 @@ void *vevo_pool_init(size_t prop_size,size_t stor_size, size_t atom_size, size_t p->spaces[Matom] = alloc_space( atom_size ); p->spaces[Midx] = alloc_space( index_size ); p->spaces[Mend] = NULL; -#ifdef STRICT_CHECKING - int sp_size = sizeof(space_t); - int n = sizeof(void*) * (ROUNDS_PER_MAG+1); - int na = ROUNDS_PER_MAG; - - p->msize = sizeof(space_t*) * Msize; - p->msize += (na * sizeof(int32_t)) + sp_size + n; - p->msize += (na * sizeof(double)) + sp_size + n; - p->msize += (na * sizeof(void*)) + sp_size + n; - p->msize += (na * sizeof(uint64_t)) + sp_size + n; - p->msize += (na * sizeof(prop_size)) + sp_size +n; - p->msize += (na * stor_size) + sp_size + n; - p->msize += (na * atom_size) + sp_size + n; - p->msize += (na * index_size) + sp_size + n; - p->msize += sizeof(pool_t); -#endif return (void*)p; } @@ -140,10 +106,6 @@ void *vevo_pool_slice_init( size_t node_size ) pool_t *p = (pool_t*) malloc(sizeof(pool_t)); p->spaces = NULL; p->space = alloc_space( node_size ); -#ifdef STRICT_CHECKING - p->msize += node_size; - p->msize += sizeof(pool_t); -#endif return p; } diff --git a/veejay-current/veejay-server/libvevo/vevo.c b/veejay-current/veejay-server/libvevo/vevo.c index faca2dfb..5a15df34 100644 --- a/veejay-current/veejay-server/libvevo/vevo.c +++ b/veejay-current/veejay-server/libvevo/vevo.c @@ -97,14 +97,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include //#include //@ for g_locale_to_utf8 and g_locale_from_utf8 -#ifdef STRICT_CHECKING -#include -#define VEVO_DBG -#endif - -//#ifdef VEVO_DBG -//#define VVERBOSE 1 -//#endif #include #define PORT_TYPE_PLUGIN_INFO 1 @@ -115,15 +107,6 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define PORT_TYPE_CHANNEL 6 #define PORT_TYPE_PARAMETER 7 #define PORT_TYPE_GUI 8 -/* - * uncomment to track port new/free calls - * requires -DSTRICT_CHECKING - */ - - -//#ifdef STRICT_CHECKING -//#define VEVO_TRACKPORTS -//#endif // @@ -208,16 +191,8 @@ typedef struct { //! \var port_ref_ Book keeping of allocated and freed ports -/*#ifdef STRICT_CHECKING -static vevo_port_t *port_ref_ = NULL; -#endif*/ static size_t atom_sizes_[100]; -#ifdef VEVO_TRACKPORTS -static void *trackports = NULL; -static int hastrackports = 0; -#endif - //! Check if an object is soft referenced /*! \param p port @@ -305,9 +280,6 @@ static vevo_property_t *prop_node_append(vevo_port_t * p, ukey_t key, static vevo_property_t *prop_node_get(vevo_port_t * p, ukey_t key) { __vevo_port_t *port = (__vevo_port_t *) p; -#ifdef STRICT_CHECKING - assert( port != NULL ); -#endif vevo_property_t *l = port->list; while (l != NULL) { if (key == l->key) @@ -329,11 +301,6 @@ static port_index_t *port_node_new(__vevo_port_t *port,const char *key, ukey_t h // port_index_t *i = (port_index_t *) vevo_malloc(sizeof(port_index_t)); port_index_t *i = (port_index_t *) vevo_pool_alloc_node( port_index_t, port->pool ); -#ifdef STRICT_CHECKING - assert(i != NULL); - assert(key != NULL); - assert(hash_key != 0); -#endif i->key = strdup(key); i->hash_code = hash_key; i->next = NULL; @@ -362,11 +329,6 @@ static void port_node_free(__vevo_port_t *port,port_index_t * node) static void port_node_append(vevo_port_t * p, const char *key, ukey_t hash_key) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert(key != NULL); - assert(hash_key != 0); -#endif __vevo_port_t *port = (__vevo_port_t *) p; port_index_t *node = port_node_new(p,key, hash_key); port_index_t *next; @@ -465,39 +427,6 @@ int vevo_property_soft_reference(vevo_port_t * p, const char *key) return VEVO_NO_ERROR; } -#ifdef STRICT_CHECKING -//! Flag a property as read-only. Use to avoid overriding the value -/*! - \param p port - \param key property to set as readonly - \return error code - */ - -static int vevo_property_finalize(vevo_port_t * p, const char *key) -{ - __vevo_port_t *port = (__vevo_port_t *) p; - ukey_t hash_key = hash_key_code(key); - if (!port->table) { - vevo_property_t *node = NULL; - if ((node = prop_node_get(port, hash_key)) != NULL) { - node->st->flags |= VEVO_PROPERTY_READONLY; - return VEVO_NO_ERROR; - } - } else { - hnode_t *node = NULL; - if ((node = property_exists(port, hash_key)) != NULL) { - vevo_storage_t *stor = (vevo_storage_t *) hnode_get(node); - stor->flags |= VEVO_PROPERTY_READONLY; - // hnode_t *new_node = hnode_create((void *) stor); - // hnode_put(new_node, (void *) hash_key); - // hnode_destroy(new_node); - return VEVO_NO_ERROR; - } - } - return VEVO_ERROR_NOSUCH_PROPERTY; -} -#endif - int vevo_property_protect( vevo_port_t *p, const char *key ) { __vevo_port_t *port = (__vevo_port_t *) p; @@ -592,17 +521,6 @@ static void vevo_port_add_property( vevo_port_t *p,int finalize, const char *key */ static void vevo_port_finalize( vevo_port_t *port, int port_type ) { -/* -#ifdef STRICT_CHECKING - if( port_type != VEVO_PORT_REFERENCES ) - { - int ref = 1; - char ref_key[64]; - sprintf(ref_key,"%p",port ); - vevo_property_set( port_ref_, ref_key, VEVO_ATOM_TYPE_INT, 1, &ref ); - } -#endif -*/ if( port_type <= 1024 && port_type > 0 ) vevo_port_add_property( port, 1,"type",VEVO_ATOM_TYPE_INT,1, &port_type ); @@ -619,32 +537,20 @@ static void vevo_port_finalize( vevo_port_t *port, int port_type ) static int atom_get_value(vevo_storage_t * t, int idx, void *dst) { -#ifdef STRICT_CHECKING - assert(t != NULL); -#endif atom_t *atom = NULL; if (t->num_elements == 1 && idx == 0) { atom = t->elements.atom; -#ifdef STRICT_CHECKING - assert( atom != NULL ); -#endif } if (t->num_elements > 1 && idx >= 0 && idx <= t->num_elements) { atom = t->elements.array[idx]; -#ifdef STRICT_CHECKING - assert( atom != NULL ); -#endif } if( t->num_elements == 0 && idx == 0 ) { atom = t->elements.atom; -#ifdef STRICT_CHECKING - assert( atom != NULL ); -#endif return VEVO_ERROR_PROPERTY_EMPTY; } @@ -662,20 +568,10 @@ static int atom_get_value(vevo_storage_t * t, int idx, void *dst) if( t->atom_type == VEVO_ATOM_TYPE_STRING || t->atom_type == VEVO_ATOM_TYPE_UTF8STRING ) { char **ptr = (char **) dst; char *p = *ptr; -#ifdef STRICT_CHECKING - assert( atom->size > 0 ); -#endif veejay_memcpy(p, atom->value, atom->size); } else if( t->atom_type != VEVO_ATOM_TYPE_FUNCPTR ) { -#ifdef STRICT_CHECKING - assert( atom->size > 0 ); -#endif veejay_memcpy(dst, atom->value, atom->size); - } else { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_WARNING, "vevo_property_get called on getter function ?!"); -#endif - } + } return VEVO_NO_ERROR; } @@ -703,9 +599,6 @@ static atom_t *vevo_new_atom(__vevo_port_t * port, int atom_type, size_t atom_size) { atom_t *atom = (atom_t *) vevo_pool_alloc_atom( atom_t , port->pool ); -#ifdef STRICT_CHECKING - assert(atom != NULL); -#endif atom->size = atom_size; atom->type = atom_type; @@ -726,9 +619,6 @@ static atom_t *vevo_new_atom(__vevo_port_t * port, int atom_type, atom->value = (atom_size > 0 ? (void*) vevo_pool_alloc_int(int32_t, port->pool ): NULL ); } } -#ifdef STRICT_CHECING - assert(atom != NULL); -#endif return atom; } @@ -739,9 +629,6 @@ static atom_t *vevo_new_atom(__vevo_port_t * port, int atom_type, */ static void vevo_free_atom(__vevo_port_t *port,atom_t * atom) { -#ifdef STRICT_CHECKING - assert(atom != NULL); -#endif if (atom) { if(atom->value) switch( atom->type ) @@ -793,18 +680,9 @@ static atom_t *vevo_put_atom(__vevo_port_t * port, void *dst, } } else { -#ifdef STRICT_CHECKING - assert(atom_size > 0); - assert(dst != NULL); -#endif atom = vevo_new_atom(port, atom_type, atom_size); -#ifdef STRICT_CHECING - assert(atom != NULL); - assert(atom->value != NULL); -#else if (!atom) return NULL; -#endif veejay_memcpy(atom->value, dst, atom_size); } return atom; @@ -825,45 +703,21 @@ storage_put_atom_value(__vevo_port_t * port, void *src, int n, vevo_storage_t * d, int v) { int i; -#ifdef STRICT_CHECKING - if (n > 0) - assert((src != NULL)); -#endif - //@ overwrite if (d->num_elements == 0 || d->num_elements == 1) { //@ single atoms -#ifdef STRICT_CHECKING - if( d->num_elements == 1 ) - assert( d->elements.atom != NULL ); - if( d->num_elements == 0 ) - assert( d->elements.atom == NULL ); -#endif if (d->elements.atom) vevo_free_atom(port,d->elements.atom); } else if (d->num_elements > 1) { if (d->elements.array) { for (i = 0; i < d->num_elements; i++) { -#ifdef STRICT_CHECKING - assert( d->elements.array[i] != NULL ); -#endif vevo_free_atom(port,d->elements.array[i]); } free(d->elements.array); } } -#ifdef STRICT_CHECKING - else { - assert( d->num_elements >= 0 ); - } -#endif - -#ifdef STRICT_CHECKING - if( d->num_elements > 1 && n > 0 ) - assert( n == d->num_elements ); -#endif d->atom_type = v; d->num_elements = n; @@ -928,9 +782,6 @@ static vevo_storage_t *vevo_new_storage( __vevo_port_t *port) vevo_storage_t *d = (vevo_storage_t*) vevo_pool_alloc_storage( vevo_storage_t, port->pool ); // (vevo_storage_t *) vevo_malloc(sizeof(vevo_storage_t)); -#ifdef HAVE_STRICT - assert(d != NULL); -#endif memset( d, 0, sizeof(vevo_storage_t)); return d; } @@ -947,18 +798,12 @@ static void vevo_free_storage(__vevo_port_t *port,vevo_storage_t * t) int i; for (i = 0; i < t->num_elements; i++) { -#ifdef STRICT_CHECKING - assert( t->elements.array[i] != NULL ); -#endif vevo_free_atom(port,t->elements.array[i]); } free(t->elements.array); } if (t->num_elements <= 1) { -#ifdef STRICT_CHECKING - assert( t->elements.atom != NULL ); -#endif vevo_free_atom(port,t->elements.atom); } @@ -997,10 +842,6 @@ static int key_compare(const void *key1, const void *key2) */ int vevo_property_num_elements(vevo_port_t * p, const char *key) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert(key != NULL); -#endif if(!p) return -1; __vevo_port_t *port = (__vevo_port_t *) p; @@ -1029,14 +870,7 @@ int vevo_property_num_elements(vevo_port_t * p, const char *key) */ int vevo_property_atom_type(vevo_port_t * p, const char *key) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert(key != NULL); -#endif __vevo_port_t *port = (__vevo_port_t *) p; -#ifdef STRICT_CHECKING - assert(port != NULL); -#endif ukey_t hash_key = hash_key_code(key); if (!port->table) { @@ -1045,11 +879,6 @@ int vevo_property_atom_type(vevo_port_t * p, const char *key) return node->st->atom_type; } else { hnode_t *node = NULL; -#ifdef STRICT_CHECKING - assert(port->table != NULL); -// assert(hash_verify(port->table) != 0); -#endif - if ((node = property_exists(port, hash_key)) != NULL) { vevo_storage_t *stor = (vevo_storage_t *) hnode_get(node); if (stor) @@ -1075,14 +904,7 @@ static int vevo_storage_size( vevo_storage_t *stor ) { int vevo_property_atom_size(vevo_port_t * p, const char *key) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert(key != NULL); -#endif __vevo_port_t *port = (__vevo_port_t *) p; -#ifdef STRICT_CHECKING - assert(port != NULL); -#endif ukey_t hash_key = hash_key_code(key); if (!port->table) { @@ -1092,10 +914,6 @@ int vevo_property_atom_size(vevo_port_t * p, const char *key) } else { hnode_t *node = NULL; -#ifdef STRICT_CHECKING - assert(port->table != NULL); -#endif - if ((node = property_exists(port, hash_key)) != NULL) { vevo_storage_t *stor = (vevo_storage_t *) hnode_get(node); if (stor) { @@ -1108,27 +926,6 @@ int vevo_property_atom_size(vevo_port_t * p, const char *key) return -1; } -#ifdef STRICT_CHECKING -static int vevo_property_is_protected(vevo_port_t * p, const char *key) -{ - __vevo_port_t *port = (__vevo_port_t *) p; - ukey_t hash_key = hash_key_code(key); - - if (!port->table) { - vevo_property_t *node; - if ((node = prop_node_get(port, hash_key)) != NULL) - return ( node->st->flags & VEVO_PROPERTY_PROTECTED ); - } else { - hnode_t *node = NULL; - if ((node = property_exists(port, hash_key)) != NULL) { - vevo_storage_t *stor = (vevo_storage_t *) hnode_get(node); - if (stor) - return (stor->flags & VEVO_PROPERTY_PROTECTED); - } - } - return VEVO_NO_ERROR; -} -#endif //! Return size of an Atom at a given index /*! @@ -1140,15 +937,8 @@ static int vevo_property_is_protected(vevo_port_t * p, const char *key) size_t vevo_property_element_size(vevo_port_t * p, const char *key, const int idx ) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert(key != NULL); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); -#ifdef STRICT_CHECKING - assert( port ); -#endif if (!port->table) { vevo_property_t *node; if ((node = prop_node_get(port, hash_key)) != NULL) { @@ -1162,9 +952,6 @@ vevo_property_element_size(vevo_port_t * p, const char *key, const int idx ) hnode_t *node = NULL; if ((node = property_exists(port, hash_key)) != NULL) { vevo_storage_t *stor = (vevo_storage_t *) hnode_get(node); -#ifdef STRICT_CHECKING - assert(idx <= stor->num_elements); -#endif //todo: sum all element sizes for index of -1 if (stor->num_elements == 1) { return stor->elements.atom->size; @@ -1186,7 +973,6 @@ vevo_property_element_size(vevo_port_t * p, const char *key, const int idx ) \param port_type Type of Port to Create. Port types <= 1024 are typed, > 1024 are anonymous ports. \return A New Port */ -#ifndef STRICT_CHECKING vevo_port_t *vevo_port_new(int port_type) { __vevo_port_t *port = (__vevo_port_t *) malloc(sizeof(__vevo_port_t)); @@ -1206,59 +992,10 @@ vevo_port_t *vevo_port_new(int port_type) return (vevo_port_t *) port; } -#else -vevo_port_t *vevo_port_new(int port_type, const char *func, int line_num) -{ - __vevo_port_t *port = (__vevo_port_t *) malloc(sizeof(__vevo_port_t)); - -#ifdef STRICT_CHECKING - assert(port != NULL); -#endif - port->index = NULL; - port->list = NULL; - port->table = NULL; - port->pool = vevo_pool_init( sizeof(vevo_property_t),sizeof( vevo_storage_t ), sizeof( atom_t ) , sizeof( port_index_t ) ); -/* If the port type is a Livido port this or that */ - if ( (port_type >= 1 && port_type <= 50) || port_type < 0) - port->list = NULL; - else - port->table = hash_create(HASHCOUNT_T_MAX, key_compare, int_hash); - - vevo_port_finalize (port, port_type ); -#ifdef VVERBOSE - veejay_msg( VEEJAY_MSG_INFO, "New port %p (%d) from %s:%d", port,port_type,func,line_num); -#endif - -#ifdef VEVO_TRACKPORTS - if( hastrackports == 0 ) { - hastrackports = 1; - trackports = vpn(1331); - veejay_msg(0, "trackport: %p", trackports ); - } - - if( trackports != NULL && port_type != 1331) { - char key[64]; - char har[1024]; - char *str = &har[0]; - memset(har,0,sizeof(har)); - snprintf(har,sizeof(har)-1, "%s::%d",func,line_num); - snprintf(key,64, "%p", port ); - assert( vevo_property_set( trackports, key,VEVO_ATOM_TYPE_STRING,1,&str ) == VEVO_NO_ERROR ); - } -#endif - return (vevo_port_t *) port; -} - -#endif //! Initialize VeVo. Set up bookkeeping information to track Port construction and destruction void vevo_strict_init() { -/* -#ifdef STRICT_CHECKING - port_ref_ = vevo_port_new( VEVO_PORT_REFERENCES, __FUNCTION__,__LINE__ ); -#endif -*/ memset( atom_sizes_,0,sizeof(atom_sizes_) ); atom_sizes_[1] = sizeof(int32_t); atom_sizes_[2] = sizeof(double); @@ -1273,41 +1010,9 @@ void vevo_strict_init() /*! \param p (local) Port to destroy */ -#ifdef STRICT_CHECKING -static int vevo_port_free_(vevo_port_t *p ) -#else static void vevo_port_free_(vevo_port_t * p) -#endif { __vevo_port_t *port = (__vevo_port_t *) p; -#ifdef STRICT_CHECKING - int msize = 0; -#endif -#ifdef VEVO_TRACKPORTS - char key[64]; - snprintf(key,64, "%p", port ); - char *val = vevo_property_get_string( trackports, key ); - int err = vevo_property_get( trackports, key, 0, NULL ); - if ( err == VEVO_ERROR_PROPERTY_EMPTY ) { - veejay_msg(VEEJAY_MSG_ERROR, "port %s was already freed. (%s)", key,val ); - return; - } - else if ( err == VEVO_ERROR_NOSUCH_PROPERTY ) { - char tkey[64]; - snprintf(tkey, 64, "%p", trackports ); - if(strcasecmp(tkey,key) != 0 ) { - veejay_msg(VEEJAY_MSG_ERROR, "port %s is not a port (not allocated by vpn). (%s)", key,val); - } - } else if ( err == VEVO_NO_ERROR ) { - vevo_property_del( trackports, key ); - // vevo_property_set( trackports, key, VEVO_ATOM_TYPE_PORTPTR,0,NULL );//,VEVO_ATOM_TYPE_STRING, 0, NULL ); - veejay_msg(VEEJAY_MSG_DEBUG, "port %p freed (%s)",key,val); - } else { - veejay_msg(VEEJAY_MSG_ERROR, "unknown error code %d on port %s. (%s)", err,key,val ); - } - if(val) free(val); -#endif - if (port->table) { if (!hash_isempty((hash_t *) port->table)) { hscan_t scan; @@ -1318,12 +1023,6 @@ static void vevo_port_free_(vevo_port_t * p) while ((node = hash_scan_next(&scan)) != NULL) { vevo_storage_t *stor = NULL; stor = hnode_get(node); -#ifdef STRICT_CHECKING - assert(stor != NULL); - assert(node != NULL); - assert((const char *) hnode_getkey(node) != NULL); - msize += vevo_storage_size( stor ); -#endif vevo_free_storage(port,stor); } hash_free_nodes((hash_t *) port->table); @@ -1338,9 +1037,6 @@ static void vevo_port_free_(vevo_port_t * p) vevo_property_t *n; while (l != NULL) { n = l->next; -#ifdef STRICT_CHECKING - msize += vevo_storage_size( l->st ); -#endif vevo_free_storage(port,l->st); prop_node_free(port,l); l = n; @@ -1362,9 +1058,6 @@ static void vevo_port_free_(vevo_port_t * p) free(port); p = port = NULL; -#ifdef STRICT_CHECKING - return msize; -#endif } //! Verify if Vevo has allocated a given Port @@ -1373,36 +1066,7 @@ static void vevo_port_free_(vevo_port_t * p) \return error code */ int vevo_port_verify( vevo_port_t *port ) -{/* -#ifdef STRICT_CHECKING - if( port == port_ref_ ) - return 1; - char pkey[32]; - sprintf(pkey, "%p",port); - - int ref_count = 0; - int error = vevo_property_get( port_ref_, pkey, 0, &ref_count ); - - if( error != 0 ) - { - //veejay_msg(0, "%s: Port '%s' not allocated by vevo_port_new()", __FUNCTION__, pkey ); - return 0; - } - - if( error == VEVO_ERROR_NOSUCH_ELEMENT || error == - VEVO_ERROR_NOSUCH_PROPERTY ) - { - //veejay_msg(0, "%s: Port '%s' does not exist" ); - return 0; - } - - if( ref_count == 0 ) - { - //veejay_msg(0, "%s: Port %s has a reference count of 0 ",__FUNCTION__, pkey); - return 0; - } -#endif -*/ +{ return 1; } @@ -1410,17 +1074,12 @@ int vevo_port_verify( vevo_port_t *port ) /*! \param p Port to destroy */ -#ifdef STRICT_CHECKING -void vevo_port_free( vevo_port_t *port, const char *func, const int line_no ) -#else void vevo_port_free( vevo_port_t *port ) -#endif { if(port != NULL) { vevo_port_free_(port ); port = NULL; } - } //! Check if a Property is soft referenced @@ -1433,15 +1092,8 @@ static int vevo_property_is_soft_referenced(vevo_port_t * p, const char *key ) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert( key != NULL ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); -#ifdef STRICT_CHECKING - assert( port != NULL ); -#endif if (!port->table) { vevo_property_t *pnode = NULL; if ((pnode = prop_node_get(port, hash_key)) != NULL) { @@ -1472,39 +1124,13 @@ vevo_property_set(vevo_port_t * p, const char *key, int atom_type, int num_elements, void *src) { -#ifdef VEVO_TRACKPORTS - veejay_msg(VEEJAY_MSG_DEBUG, "%s: key=%s, type=%d, n=%d, addr=%p",__FUNCTION__,key,atom_type,num_elements,src ); -#endif -#ifdef STRICT_CHECKING - assert(p != NULL); - //@ no self referencing - assert( src != p ); - if( num_elements > 0 ) assert( src != NULL ); - assert( key != NULL ); - // if( atom_type != VEVO_ATOM_TYPE_HIDDEN ) - assert( vevo_atom_size(atom_type) > 0 ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); int new = 1; void *node = NULL; -#ifdef STRICT_CHECKING - assert( port != NULL ); -#endif if (!port->table) { vevo_property_t *pnode = NULL; if ((pnode = prop_node_get(port, hash_key)) != NULL) { -#ifdef STRICT_CHECKING - if (pnode->st->atom_type != atom_type) - return VEVO_ERROR_WRONG_ATOM_TYPE; - if (pnode->st->flags & VEVO_PROPERTY_READONLY) - { -#ifdef VVERBOSE - veejay_msg(VEEJAY_MSG_INFO, "Port %p property %s is read-only!",p,key); -#endif - return VEVO_ERROR_PROPERTY_READONLY; - } -#endif vevo_free_storage(port,pnode->st); //prop_node_free(pnode); new = 0; @@ -1515,13 +1141,6 @@ vevo_property_set(vevo_port_t * p, if ((old_node = property_exists(port, hash_key)) != NULL) { vevo_storage_t *oldstor = (vevo_storage_t *) hnode_get(old_node); -#ifdef STRICT_CHECKING - if (oldstor->atom_type != atom_type) - return VEVO_ERROR_WRONG_ATOM_TYPE; - - if (oldstor->flags & VEVO_PROPERTY_READONLY) - return VEVO_ERROR_PROPERTY_READONLY; -#endif vevo_free_storage(port,oldstor); hash_delete((hash_t *) port->table, old_node); @@ -1540,27 +1159,14 @@ vevo_property_set(vevo_port_t * p, node = (void *) prop_node_append(port, hash_key, stor); } } -#ifdef STRICT_CHECKING - assert(stor != NULL); -#endif if (!port->table) { -#ifdef STRICT_CHECKING - assert(node != NULL); -#endif if (!new) { vevo_property_t *current = (vevo_property_t *) node; current->st = stor; } } else { hnode_t *node2 = hnode_create(stor); - -#ifdef STRICT_CHECKING - assert(node2 != NULL); - assert(!hash_isfull((hash_t *) port->table)); - assert(!property_exists(port, hash_key)); -#endif - hash_insert((hash_t *) port->table, node2, (const void *) hash_key); } @@ -1577,32 +1183,13 @@ vevo_property_set_f(vevo_port_t * p, const char *key, int atom_type, int num_elements, void (*set_func)(), int (*get_func)() ) { -#ifdef STRICT_CHECKING - assert(p != NULL); - //@ no self referencing - assert( key != NULL ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); int new = 1; void *node = NULL; -#ifdef STRICT_CHECKING - assert( port != NULL ); -#endif if (!port->table) { vevo_property_t *pnode = NULL; if ((pnode = prop_node_get(port, hash_key)) != NULL) { -#ifdef STRICT_CHECKING - if (pnode->st->atom_type != atom_type) - return VEVO_ERROR_WRONG_ATOM_TYPE; - if (pnode->st->flags & VEVO_PROPERTY_READONLY) - { -#ifdef VVERBOSE - veejay_msg(VEEJAY_MSG_INFO, "Port %p property %s is read-only!",p,key); -#endif - return VEVO_ERROR_PROPERTY_READONLY; - } -#endif vevo_free_storage(port,pnode->st); //prop_node_free(pnode); new = 0; @@ -1613,13 +1200,6 @@ vevo_property_set_f(vevo_port_t * p, if ((old_node = property_exists(port, hash_key)) != NULL) { vevo_storage_t *oldstor = (vevo_storage_t *) hnode_get(old_node); -#ifdef STRICT_CHECKING - if (oldstor->atom_type != atom_type) - return VEVO_ERROR_WRONG_ATOM_TYPE; - - if (oldstor->flags & VEVO_PROPERTY_READONLY) - return VEVO_ERROR_PROPERTY_READONLY; -#endif vevo_free_storage(port,oldstor); hash_delete((hash_t *) port->table, old_node); @@ -1636,14 +1216,8 @@ vevo_property_set_f(vevo_port_t * p, if (!port->table) node = (void *) prop_node_append(port, hash_key, stor); } -#ifdef STRICT_CHECKING - assert(stor != NULL); -#endif if (!port->table) { -#ifdef STRICT_CHECKING - assert(node != NULL); -#endif if (!new) { vevo_property_t *current = (vevo_property_t *) node; current->st = stor; @@ -1651,12 +1225,6 @@ vevo_property_set_f(vevo_port_t * p, } else { hnode_t *node2 = hnode_create(stor); -#ifdef STRICT_CHECKING - assert(node2 != NULL); - assert(!hash_isfull((hash_t *) port->table)); - assert(!property_exists(port, hash_key)); -#endif - hash_insert((hash_t *) port->table, node2, (const void *) hash_key); } @@ -1681,11 +1249,6 @@ vevo_property_set_f(vevo_port_t * p, int vevo_property_get(vevo_port_t * p, const char *key, int idx, void *dst) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert( key != NULL ); - assert( idx >= 0 ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); @@ -1724,10 +1287,6 @@ vevo_property_get(vevo_port_t * p, const char *key, int idx, void *dst) int vevo_property_call(vevo_port_t * p, const char *key, void *ctx, int32_t type, int32_t value ) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert( key != NULL ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); @@ -1770,10 +1329,6 @@ vevo_property_call(vevo_port_t * p, const char *key, void *ctx, int32_t type, in int vevo_property_call_get(vevo_port_t * p, const char *key, void *ctx ) { -#ifdef STRICT_CHECKING - assert(p != NULL); - assert( key != NULL ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; ukey_t hash_key = hash_key_code(key); @@ -1827,37 +1382,14 @@ char **vevo_list_properties(vevo_port_t * p) if(!port->index) return NULL; -#ifdef STRICT_CHECKING - assert(port != NULL); -#endif char **list = NULL; - -#ifdef STRICT_CHECKING - int nn = 1; - if (port->table) - nn += hash_count((hash_t *) port->table); - else { - vevo_property_t *c = port->list; - while (c != NULL) { - c = c->next; - nn++; - } - } -#endif - int n = 0; int i = 0; -#ifdef STRICT_CHECKING - assert( port->index != NULL ); -#endif port_index_t *l = port->index; while (l != NULL) { n++; l = l->next; -#ifdef STRICT_CHECKING - assert( n > 0 && n < 1048576 ); -#endif } if( n <= 0 ) @@ -1869,24 +1401,9 @@ char **vevo_list_properties(vevo_port_t * p) l = (port_index_t *) port->index; -#ifdef VVERBOSE - veejay_msg(VEEJAY_MSG_INFO, "Property list of port %p",port ); -#endif - - while (l != NULL) { -#ifdef STRICT_CHECKING -// if( vevo_property_atom_type( p, l->key ) != VEVO_ATOM_TYPE_HIDDEN ) -// { -#endif - list[i] = (char *) strdup(l->key); -#ifdef VVERBOSE - veejay_msg(VEEJAY_MSG_INFO, "\t%s", list[i]); -#endif + while (l != NULL) { + list[i] = (char *) strdup(l->key); i++; -#ifdef STRICT_CHECKING -// } -#endif - l = l->next; //i++; } @@ -1928,9 +1445,6 @@ static int vevo_scan_for_atom( vevo_port_t *p, int atype ) hnode_t *node; hscan_t scan; vevo_storage_t *s; -#ifdef STRICT_CHECKING - assert( port->table != NULL ); -#endif hash_scan_begin( &scan,(hash_t*) port->table ); while((node=hash_scan_next(&scan)) != NULL) @@ -2034,28 +1548,6 @@ static vevo_storage_t **vevo_list_nodes_(vevo_port_t * p, int atype) //! Report statistics and free bookkeeping information void vevo_report_stats() { -#ifdef VEVO_TRACKPORTS - vevo_port_dump( trackports,0); - char **items = vevo_list_properties( trackports ); - if( items == NULL ) { - veejay_msg(VEEJAY_MSG_INFO ,"All ports freed."); - vevo_port_free_(trackports); - return; - } - int i; - for( i = 0; items[i] != NULL; i ++ ) { - char *key = items[i]; - char *ref = vevo_property_get_string( trackports, key ); - if(ref ) veejay_msg(0, "never freed: %s, %s", key,ref ); - if( ref) free(ref); - free(items[i]); - } - free(items); - - vevo_port_free_( trackports ); -#else - veejay_msg(0, "recompile with -DVEVO_TRACKPORTS"); -#endif } static int vevo_port_get_port( void *port, vevo_storage_t *item, void *res ) @@ -2077,19 +1569,9 @@ void *vevo_port_register( vevo_port_t *in, vevo_port_t *ref ) { void *port = in; const void *store = ref; -#ifndef STRICT_CHECKING if(!port) port = vevo_port_new( VEVO_PORT_POOL ); -#else - if(!port) - port = vevo_port_new( VEVO_PORT_POOL, __FUNCTION__, __LINE__ ); -#endif char pkey[32]; - -#ifdef STRICT_CHECKING - assert( vevo_port_verify( port ) == 1 ); -#endif - if(store) { sprintf(pkey,"%p", ref); @@ -2120,11 +1602,6 @@ int vevo_union_ports( void *port_a, void *port_b, int filter_type ) if(!vevo_property_exists( port_b, Ea[i] )&& vevo_property_atom_type( port_a, Ea[i] ) == filter_type ) { -#ifdef STRICT_CHECKING - int n = vevo_property_num_elements( port_b, Ea[i] ); - // clone elements! - assert( n <= 1 ); -#endif void *v = NULL; if(vevo_property_get( port_a, Ea[i], 0, &v ) == VEVO_NO_ERROR ) { vevo_property_set( port_b, Ea[i],VEVO_ATOM_TYPE_VOIDPTR,1, &v ); @@ -2169,17 +1646,11 @@ int vevo_special_union_ports( void *port_a, void *port_b ) if( atom_type == VEVO_ATOM_TYPE_VOIDPTR ) { error = vevo_property_get( port_a, Ea[i], 0, &value ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif sprintf(key, "%p", value ); if(!vevo_property_exists( port_b, key )) { error = vevo_property_set( port_b, key, VEVO_ATOM_TYPE_VOIDPTR,1,&value ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif } } free( Ea[i] ); @@ -2193,171 +1664,10 @@ int vevo_special_union_ports( void *port_a, void *port_b ) */ -#ifdef STRICT_CHECKING -int vevo_port_get_total_size_( vevo_port_t *port, int *n_ports ) -{ - char **items = vevo_list_properties( port ); - if( items == NULL ) - return 0; - int i; - int msize = 0; - for( i = 0; items[i] != NULL ; i ++ ) { - msize += vevo_property_atom_size( port, items[i] ); - if( vevo_property_atom_type(port, items[i]) == VEVO_ATOM_TYPE_PORTPTR ) { - void *child_port = NULL; - if(vevo_property_get( port, items[i], 0, &child_port ) == VEVO_NO_ERROR ) { - msize += vevo_port_get_total_size_( child_port, n_ports); - } - } - free(items[i]); - } - free(items); - - __vevo_port_t *p = (__vevo_port_t*) port; - if( p->pool ) { - msize += vevo_pool_size(p->pool); - } - - *n_ports ++; - return msize; -} -int vevo_port_get_total_size( vevo_port_t *port ) -{ - int n_ports = 0; - int total = vevo_port_get_total_size_( port, &n_ports ); - veejay_msg(VEEJAY_MSG_DEBUG, "\tPort %p holds %2.2f Kb memory",port, ( (float) total / 1024.0f )); - return total; -} - - -#else int vevo_port_get_total_size( vevo_port_t *port ) { return 0; } -#endif - -#ifdef STRICT_CHECKING -void vevo_port_validate_ports( vevo_port_t *port , vevo_port_t *ref) -{ - if(port == NULL) - return; - - if( ref == NULL ) - ref = vpn ( VEVO_ANONYMOUS_PORT ); - - int i; - vevo_storage_t **item = vevo_list_nodes_( port, VEVO_ATOM_TYPE_PORTPTR ); - if(!item) - { - free(item); - return; - } - - for( i = 0; item[i] != NULL ; i ++ ) - { - char key[64]; - void *q = NULL; - int n = vevo_port_get_port( port, item[i], &q ); - - if( n == 1 && q != NULL ) - { - sprintf( key, "%p", q ); - if( (vevo_property_get( ref, key,0, NULL ) == VEVO_NO_ERROR ) ) { - veejay_msg(0, " '%s' already exists in ref!", key ); - vevo_port_dump( ref, 0 ); - assert(0); - } - vevo_port_validate_ports( q, ref ); - } - else - { - if( n > 1 ) - { - int k = 0; - for( k = 0; k < item[i]->num_elements; k ++ ) - { - void *qq = NULL; - int err = atom_get_value( item[i], k, &qq ); - if( err != VEVO_NO_ERROR ) - continue; - sprintf( key, "%p", qq ); - if(( vevo_property_get( ref, key,0,NULL ) == VEVO_NO_ERROR) ) { - veejay_msg(0, " '%s' already exists in ref!", key ); - vevo_port_dump(ref,0); - assert(0); - } - vevo_port_validate_ports( qq, ref ); - - } - } - } - } - - char pkey[64]; - sprintf(pkey, "%p", port ); - - vevo_property_set( ref, pkey, VEVO_ATOM_TYPE_STRING, 0, NULL ); - - - free(item); -} - - - -void vevo_port_scan_free( vevo_port_t *port ) -{ - if(port == NULL) - return; - - __vevo_port_t *vp = (__vevo_port_t *) port; - if( vp->index == NULL ) { - port = NULL; - return; - } - - int i; - vevo_storage_t **item = vevo_list_nodes_( port, VEVO_ATOM_TYPE_PORTPTR ); - if(!item) - { - veejay_msg(0, " -> PORT %p", port ); - free(item); - return; - } - - for( i = 0; item[i] != NULL ; i ++ ) - { - void *q = NULL; - int n = vevo_port_get_port( port, item[i], &q ); - - if( n == 1 && q != NULL ) - { - veejay_msg(0, " -> PORT %p", q ); - vevo_port_scan_free( q ); - } - else - { - if( n > 1 ) - { - int k = 0; - for( k = 0; k < item[i]->num_elements; k ++ ) - { - void *qq = NULL; - int err = atom_get_value( item[i], k, &qq ); - if( err != VEVO_NO_ERROR ) - continue; - veejay_msg(0, " -> PORT %p", qq ); - vevo_port_scan_free( qq ); - } - } - } - } - - free(item); -} - - -#endif void vevo_port_recursive_free( vevo_port_t *port ) { @@ -2411,129 +1721,6 @@ void vevo_port_recursive_free( vevo_port_t *port ) port = NULL; } -/* -char **vevo_port_deepen_namespace( void *port, char *path) -{ -#ifdef STRICT_CHECKING - assert( port != NULL ); - assert( path != NULL ); -#endif - char **top_level = vevo_list_properties(port); - int k; - int num = 0; - if(!top_level) - { - return 0; - } - num = vevo_num_properties(port ); - - if( num == 0 ) - { - return NULL; - } - char **res = (char**) malloc( sizeof(char*) * (num+1)); - memset(res,0,sizeof(char*) * (num+1)); - int n = 0; - - for( k = 0; top_level[k] != NULL ; k ++ ) - { - if( vevo_property_is_protected( port, top_level[k] ) ) { - continue; - } - - int atom_type = vevo_property_atom_type( port, top_level[k] ); - if( atom_type != VEVO_ATOM_TYPE_VOIDPTR && atom_type != VEVO_ATOM_TYPE_PORTPTR ) - { - int len = strlen(path) + 2; - len += strlen( top_level[k] ); - res[n] = (char*) malloc(sizeof(char) * len ); - snprintf(res[n],len,"%s/%s",path,top_level[k]); - n++; - } - free(top_level[k]); - } - free(top_level); - res[n] = NULL; - return res; -} -*/ -/* -static void vevo_port_do_recursion( vevo_port_t *port, vevo_port_t *namespace, const char *base ) -{ - char **top_level = vevo_list_properties(port); - if(!top_level) - return; - - int k; - int error; - - error = vevo_property_set( namespace, base, LIVIDO_ATOM_TYPE_VOIDPTR, 0 , NULL ); - - for( k = 0; top_level[k] != NULL ; k ++ ) { - int atom_type = vevo_property_atom_type( port, top_level[k] ); - //@ skip private properties - if( atom_type == VEVO_ATOM_TYPE_VOIDPTR ) { - free(top_level[k]); - continue; - } - //@ skip protected properties - if( vevo_property_is_protected( port, top_level[k] ) ) { - free(top_level[k]); - continue; - } - - if( atom_type != VEVO_ATOM_TYPE_PORTPTR ) { - //@ create path node - - char *path = vj_calloc(sizeof(char) * 256 ); - char *pathptr = vvstrcat( path, base ); - pathptr = vvstrcat( pathptr, "/" ); - char *pathnode= vvstr_valid_osc_name( top_level[k] ); - pathptr = vvstrcat( pathptr, pathnode ); - free(pathnode); - error = vevo_property_set( namespace, path, LIVIDO_ATOM_TYPE_VOIDPTR, 0 , NULL ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - free(path); - } else { - void *child_port = NULL; - error = vevo_property_get( port, top_level[k],0, &child_port ); - - char *path = vj_calloc(sizeof(char) * 256 ); - char *pathptr = vvstrcat( path, base ); - pathptr = vvstrcat( pathptr, "/"); - char *pathnode= vvstr_valid_osc_name( top_level[k] ); - pathptr = vvstrcat( pathptr,pathnode ); - free(pathnode); - - error = vevo_property_set( namespace, path, LIVIDO_ATOM_TYPE_VOIDPTR, 0 , NULL ); -#ifdef STRICT_CHECKING - assert( error == VEVO_NO_ERROR ); -#endif - - vevo_port_do_recursion( child_port, namespace, path ); - - free(path); - - } - - free(top_level[k]); - } - free(top_level); -} - - -void *vevo_port_recurse_namespace( vevo_port_t *port, const char *base ) -{ - void *ns = vpn( VEVO_ANONYMOUS_PORT ); - - vevo_port_do_recursion( port, ns, base ); - - return ns; -} - -*/ //@ FIXME: method to recursivly iterate a port and all subports to size-up all data, vevo_port_get_total_size() //! Flatten all ports and return list of ports to be destroyed @@ -3266,9 +2453,6 @@ int vevo_property_from_string( vevo_port_t *port, const char *s, const char *key break; case 'D': n = sscanf( arg, "%" PRId64, &(i64_val[cur_elem])); -#ifdef STRICT_CHECKING - assert( n == 1 ); -#endif break; case 'g': n = sscanf( arg, "%lf", &(dbl_val[cur_elem])); @@ -3315,10 +2499,6 @@ int vevo_property_from_string( vevo_port_t *port, const char *s, const char *key error = vevo_property_set( port, key, type, 0, NULL ); else { -#ifdef STRICT_CHECKING - assert( port != NULL ); - assert( ptr != NULL ); -#endif error = vevo_property_set( port, key, type, cur_elem, ptr ); } if( error == VEVO_NO_ERROR ) @@ -3338,11 +2518,6 @@ char *vevo_property_get_string( void *port, const char *key ) if( vevo_property_get( port, key,0,NULL ) != VEVO_NO_ERROR ) return NULL; -#ifdef STRICT_CHECKING - int at = vevo_property_atom_type( port, key ); - assert( at == VEVO_ATOM_TYPE_STRING || at == VEVO_ATOM_TYPE_UTF8STRING ); -#endif - ret = (char*) vj_malloc(sizeof(char) * len ); if(ret == NULL) { return NULL; @@ -3375,9 +2550,6 @@ char *vevo_property_get_utf8string( void *port, const char *key ) int at = vevo_property_atom_type(port,key); -#ifdef STRICT_CHECKING - assert( at == VEVO_ATOM_TYPE_STRING|| at == VEVO_ATOM_TYPE_UTF8STRING ); -#endif ret = (char*) vj_malloc(sizeof(char) * len ); vevo_property_get( port, key, 0, &ret ); @@ -3421,16 +2593,6 @@ int vevo_property_del(vevo_port_t * p, const char *key ) { -#ifdef VEVO_TRACKPORTS - veejay_msg(VEEJAY_MSG_DEBUG,"%s: key=%s", __FUNCTION__, key ); -#endif -#ifdef STRICT_CHECKING - assert(p != NULL); - //@ no self referencing - assert( key != NULL ); - //@ deleting ports not allowed in strict mode - assert( vevo_property_atom_type(p, key ) != VEVO_ATOM_TYPE_PORTPTR ); -#endif __vevo_port_t *port = (__vevo_port_t *) p; //@ find value in hash and release from pool @@ -3561,12 +2723,7 @@ void vevo_port_dump( void *p, int lvl ) if( lvl > 0 ) tabs = vevo_tabs( lvl ); -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s%p (%d bytes)", (tabs == NULL ? "/" : tabs ), p, - vevo_port_get_total_size(p)); -#else veejay_msg( VEEJAY_MSG_DEBUG, "%s%p", (tabs == NULL ? "/" : tabs ), p ); -#endif for( k = 0; keys[k] != NULL; k ++ ) { @@ -3640,23 +2797,12 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char int32_t *tmp = (int32_t*) malloc(sizeof(int32_t) * n ); for(i = 0; i < n; i ++ ) { if( vevo_property_get( port, key, i, &(tmp[i])) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s element %d does not exist but reported size is %d elements", - __FUNCTION__, - key, - as_key, - i, - n ); -#endif free(tmp); return VEVO_ERROR_NOSUCH_ELEMENT; } } if( n > 0 ) { if( vevo_property_set( to_port, as_key, t, n, tmp ) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s unable to store %d elements (%d bytes)", __FUNCTION__, key,as_key, n, (n*sizeof(int32_t))); -#endif free(tmp); return VEVO_ERROR_MEMORY_ALLOCATION; } @@ -3671,14 +2817,6 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char double *tmp = (double*) malloc(sizeof(double) * n ); for(i = 0; i < n; i ++ ) { if( vevo_property_get( port, key, i, &(tmp[i])) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s element %d does not exist but reported size is %d elements", - __FUNCTION__, - key, - as_key, - i, - n ); -#endif free(tmp); return VEVO_ERROR_NOSUCH_ELEMENT; } @@ -3686,9 +2824,6 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char if( n > 0 ) { if( vevo_property_set( to_port, as_key, t, n, tmp ) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s unable to store %d elements (%d bytes)", __FUNCTION__, key,as_key, n, (n*sizeof(double))); -#endif free(tmp); return VEVO_ERROR_MEMORY_ALLOCATION; } @@ -3703,14 +2838,6 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char uint64_t *tmp = (uint64_t*) malloc(sizeof(uint64_t) * n ); for(i = 0; i < n; i ++ ) { if( vevo_property_get( port, key, i, &(tmp[i])) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s element %d does not exist but reported size is %d elements", - __FUNCTION__, - key, - as_key, - i, - n ); -#endif free(tmp); return VEVO_ERROR_NOSUCH_ELEMENT; } @@ -3718,9 +2845,6 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char if( n > 0 ) { if( vevo_property_set( to_port, as_key, t, n, tmp ) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s unable to store %d elements (%d bytes)", __FUNCTION__, key,as_key, n, (n*sizeof(double))); -#endif free(tmp); return VEVO_ERROR_MEMORY_ALLOCATION; } @@ -3737,19 +2861,10 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char if( n == 1 ) { char *src = vevo_property_get_string( port, key ); if( vevo_property_set(to_port, as_key, t, 1,&src ) != VEVO_NO_ERROR ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s -> %s unable to store string '%s'", - __FUNCTION__, key,as_key,src ); -#endif free(src); return VEVO_ERROR_MEMORY_ALLOCATION; } } -#ifdef STRICT_CHECKING - else if ( n > 1 ) { - assert( n <= 0 ); // array of strings support - } -#endif else if ( n == 0 ) { if( vevo_property_set(to_port,as_key,t,0,NULL ) != VEVO_NO_ERROR ) { return VEVO_ERROR_PROPERTY_EMPTY; @@ -3758,9 +2873,6 @@ int vevo_property_clone( void *port, void *to_port, const char *key, const char } break; default: -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s: %s cannot be cloned.",__FUNCTION__,key ); -#endif break; } diff --git a/veejay-current/veejay-server/libvje/effects/cali.c b/veejay-current/veejay-server/libvje/effects/cali.c index 1ba62003..969cb6e3 100644 --- a/veejay-current/veejay-server/libvje/effects/cali.c +++ b/veejay-current/veejay-server/libvje/effects/cali.c @@ -30,10 +30,6 @@ #include #include "softblur.h" -#ifdef STRICT_CHECKING -#include -#endif - typedef struct { uint8_t *b[3]; @@ -94,12 +90,6 @@ int cali_prepare( void *ed, double meanY, double meanU, double meanV, uint8_t *d c->mean[0] = meanY; c->mean[1] = meanU; c->mean[2] = meanV; -#ifdef STRICT_CHECKING - assert ( data != NULL ); - assert ( meanY > 0 ); - assert( meanU > 0 ); - assert( meanV > 0 ); -#endif return 1; } diff --git a/veejay-current/veejay-server/libvje/effects/common.c b/veejay-current/veejay-server/libvje/effects/common.c index 9bc4b5ca..e413e0d7 100644 --- a/veejay-current/veejay-server/libvje/effects/common.c +++ b/veejay-current/veejay-server/libvje/effects/common.c @@ -25,9 +25,6 @@ #include #include #include "common.h" -#ifdef STRICT_CHECKING -#include -#endif char **vje_build_param_list( int num, ... ) { @@ -41,12 +38,7 @@ char **vje_build_param_list( int num, ... ) int i; for( i = 0; i -#endif #define PLANES 32 vj_effect *timedistort_init(int w, int h) @@ -184,10 +181,6 @@ void timedistort_apply( VJFrame *frame, int width, int height, int val) if( n__ == N__ || n__ == 0 ) interpolate = 0; -#ifdef STRICT_CHECKING - assert( plane >= 0 && plane < PLANES ); -#endif - //@ process uint8_t *planeTables[4] = { planetableY[plane], planetableU[plane], planetableV[plane], NULL }; int strides[4] = { len, len, len, 0 }; diff --git a/veejay-current/veejay-server/libvje/plugload.c b/veejay-current/veejay-server/libvje/plugload.c index fc7eed49..4ba5f91e 100644 --- a/veejay-current/veejay-server/libvje/plugload.c +++ b/veejay-current/veejay-server/libvje/plugload.c @@ -390,9 +390,6 @@ static void* deal_with_ff( void *handle, char *name ) for( p= 0; p < n_params; p ++ ) { void *parameter = vpn( VEVO_FF_PARAM_PORT ); -#ifdef STRICT_CHECKING - assert( parameter != NULL ); -#endif int type = q( FF_GETPARAMETERTYPE, (LPVOID) p, 0 ).ivalue; // name, kind, flags, description, min,max,default,transition vevo_property_set( parameter, "type", VEVO_ATOM_TYPE_INT, 1, &type); diff --git a/veejay-current/veejay-server/libvje/vj-effect.c b/veejay-current/veejay-server/libvje/vj-effect.c index 436a3a34..73dac173 100644 --- a/veejay-current/veejay-server/libvje/vj-effect.c +++ b/veejay-current/veejay-server/libvje/vj-effect.c @@ -19,9 +19,6 @@ // todo: clean up initialization (use function pointers!) #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -330,12 +327,6 @@ int vj_effect_initialized(int effect_id, void *instance_ptr ) { int seq = vj_effect_real_to_sequence(effect_id); -#ifdef STRICT_CHECKNIG - if( seq < 0 ) { - veejay_msg(0, "FX %d, ptr %p has seq %d", effect_id, instance_ptr , seq); - assert( seq >= 0 ); - } -#endif if( seq < 0 ) return 0; @@ -350,18 +341,12 @@ int vj_effect_initialized(int effect_id, void *instance_ptr ) return 1; } } -#ifdef STRICT_CHECKING - assert( vj_effect_ready[seq] == 0 ); -#endif return 0; } static void *vj_effect_activate_ext( int fx_id, int *result ) { if( fx_id > (MAX_EFFECTS + n_ext_plugs_) ) { -#ifdef STRICT_CHECKING - assert( 0 ); -#endif return NULL; } @@ -465,9 +450,6 @@ int vj_effect_deactivate(int effect_id, void *ptr) if(seq < 0 || seq >= MAX_EFFECTS) if( seq > n_ext_plugs_ + MAX_EFFECTS) { -#ifdef STRICT_CHECKING - assert( seq < n_ext_plugs_ + MAX_EFFECTS ); -#endif return 0; } diff --git a/veejay-current/veejay-server/libvje/vj-effman.c b/veejay-current/veejay-server/libvje/vj-effman.c index bd293a5e..92aa08ad 100644 --- a/veejay-current/veejay-server/libvje/vj-effman.c +++ b/veejay-current/veejay-server/libvje/vj-effman.c @@ -26,9 +26,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #include extern vj_effect *vj_effects[]; @@ -48,9 +45,6 @@ void vj_effman_apply_plug_effect( { int plug_id = entry - MAX_EFFECTS; -#ifdef STRICT_CHECKING - assert( instance != NULL ); -#endif int n = plug_get_num_input_channels( plug_id ); int i; @@ -721,9 +715,6 @@ int vj_effect_apply( VJFrame **frames, VJFrameInfo *frameinfo, vjp_kf *kf, int s if( !frames || !frames[0] ) return VJE_NO_FRAMES; if( !vj_effect_initialized( selector, ptr ) ) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "FX %d was dropped but is needed to render chain, instantiating...", selector); -#endif return VJE_NEED_INIT; } diff --git a/veejay-current/veejay-server/libvjmem/memcpy.c b/veejay-current/veejay-server/libvjmem/memcpy.c index ce4c762a..d99f0f35 100644 --- a/veejay-current/veejay-server/libvjmem/memcpy.c +++ b/veejay-current/veejay-server/libvjmem/memcpy.c @@ -139,9 +139,6 @@ #include #include -#ifdef STRICT_CHECKING -#include -#endif #define BUFSIZE 1024 @@ -328,9 +325,6 @@ char *veejay_strncpy( char *dest, const char *src, size_t n ) char *veejay_strncat( char *s1, char *s2, size_t n ) { -#ifdef STRICT_CHECKING - assert( strlen(s2) == n ); -#endif //@ run forward char *s = s1; while(*s != '\0' ) @@ -1358,12 +1352,6 @@ static void vj_frame_copy_job( void *arg ) { int i; vj_task_arg_t *info = (vj_task_arg_t*) arg; for( i = 0; i < 4; i ++ ) { -#ifdef STRICT_CHECKING - if( info->strides[i] > 0 ) { - assert( info->output[i] != NULL ); - assert( info->input[i] != NULL ); - } -#endif if( info->strides[i] <= 0 || info->output[i] == NULL || info->output[i] == NULL ) continue; veejay_memcpy( info->output[i], info->input[i], info->strides[i] ); @@ -1373,16 +1361,7 @@ static void vj_frame_copy_job( void *arg ) { static void vj_frame_clear_job( void *arg ) { int i; vj_task_arg_t *info = (vj_task_arg_t*) arg; -#ifdef STRICT_CHECKING - assert( task_get_workers() > 0 ); -#endif for( i = 0; i < 4; i ++ ) { -#ifdef STRICT_CHECKING - if( info->strides[i] > 0 ) { - assert( info->input[i] != NULL ); - assert( info->output[i] != NULL ); - } -#endif if( info->strides[i] > 0 ) veejay_memset( info->input[i], info->iparam, info->strides[i] ); } @@ -1538,12 +1517,6 @@ void vj_frame_simple_copy( uint8_t **input, uint8_t **output, int *strides ) { int i; for( i = 0; i < 4; i ++ ) { -#ifdef STRICT_CHECKING - if( strides[i] > 0 ) { - assert( input[i] != NULL ); - assert( output[i] != NULL ); - } -#endif if( input[i] != NULL && output[i] != NULL && strides[i] > 0 ) veejay_memcpy( output[i],input[i], strides[i] ); } diff --git a/veejay-current/veejay-server/libvjmem/vj-x86.c b/veejay-current/veejay-server/libvjmem/vj-x86.c index e58f25e0..8053f533 100644 --- a/veejay-current/veejay-server/libvjmem/vj-x86.c +++ b/veejay-current/veejay-server/libvjmem/vj-x86.c @@ -30,9 +30,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif extern void find_best_memcpy(void); extern void find_best_memset(void); extern void yuyv_plane_init(); @@ -220,9 +217,6 @@ void *vj_malloc_(size_t size) void *ptr = NULL; #ifdef HAVE_POSIX_MEMALIGN size_t aligned_size = (size + 3) & ~0x03; -#ifdef STRICT_CHECKING - assert( MEM_ALIGNMENT_SIZE > 0 ); -#endif int err = posix_memalign( &ptr, MEM_ALIGNMENT_SIZE, aligned_size ); if( err == EINVAL ) { @@ -236,9 +230,6 @@ void *vj_malloc_(size_t size) } #else #ifdef HAVE_MEMALIGN -#ifdef STRICT_CHECKING - assert( MEM_ALIGNMENT_SIZE > 0 ); -#endif ptr = memalign( MEM_ALIGNMENT_SIZE, size ); #else ptr = malloc ( size ) ; diff --git a/veejay-current/veejay-server/libvjmsg/vj-common.c b/veejay-current/veejay-server/libvjmsg/vj-common.c index d10bccd7..a39346bc 100644 --- a/veejay-current/veejay-server/libvjmsg/vj-common.c +++ b/veejay-current/veejay-server/libvjmsg/vj-common.c @@ -70,12 +70,6 @@ static int _debug_level = 0; static int _color_level = 1; static int _no_msg = 0; -#ifdef STRICT_CHECKING -__thread struct timeval _start_time; -__thread int timerdy = 0; -__thread int _start_time_offset = 0; -#endif - #define MAX_LINES 100 typedef struct { @@ -96,39 +90,6 @@ static vj_msg_hist _message_history; static int _message_his_status = 0; */ -#ifdef STRICT_CHECKING - -/* Subtract the `struct timeval' values X and Y, - storing the result in RESULT. - Return 1 if the difference is negative, otherwise 0. - gnu/docs/glibc/libc_428.html - */ - -static int -timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y) -{ - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_usec < y->tv_usec) { - int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; - y->tv_usec -= 1000000 * nsec; - y->tv_sec += nsec; - } - if (x->tv_usec - y->tv_usec > 1000000) { - int nsec = (x->tv_usec - y->tv_usec) / 1000000; - y->tv_usec += 1000000 * nsec; - y->tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - tv_usec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_usec = x->tv_usec - y->tv_usec; - - /* Return 1 if result is negative. */ - return x->tv_sec < y->tv_sec; -} -#endif - #ifdef HAVE_LIBUNWIND static void addr2line_unw( unw_word_t addr, char*file, size_t len, int *line ) { @@ -515,8 +476,7 @@ void report_bug(void) veejay_msg(VEEJAY_MSG_WARNING, "Send at least veejay's output and include the command(s) you have used to start it."); veejay_msg(VEEJAY_MSG_WARNING, "Also, please consider sending in the recovery files if any have been created."); veejay_msg(VEEJAY_MSG_WARNING, "If you compiled it yourself, please include information about your system."); - -#ifdef STRICT_CHECKING +/* veejay_msg(VEEJAY_MSG_WARNING, "Dumping core file to: core.%d",getpid() ); char cmd[128]; @@ -534,8 +494,7 @@ void report_bug(void) veejay_msg(VEEJAY_MSG_WARNING, "Done!"); veejay_msg(VEEJAY_MSG_INFO, "Please bzip2 and upload the coredump somewhere and tell us where to find it!"); } -#endif - + */ } diff --git a/veejay-current/veejay-server/libvjnet/cmd.c b/veejay-current/veejay-server/libvjnet/cmd.c index a897cee1..b5cb1345 100644 --- a/veejay-current/veejay-server/libvjnet/cmd.c +++ b/veejay-current/veejay-server/libvjnet/cmd.c @@ -28,10 +28,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif - struct host_list { struct hostent hostent; @@ -290,9 +286,6 @@ int sock_t_send( vj_sock_t *s, unsigned char *buf, int len ) while( length > 0 ) { n = send( s->sock_fd, buf, length , MSG_NOSIGNAL ); if( n == -1 ) { -#ifdef STRICT_CHECKING - veejay_msg(0, "Error sending buffer:%s",strerror(errno)); -#endif return -1; } if( n == 0 ) { @@ -309,11 +302,6 @@ int sock_t_send( vj_sock_t *s, unsigned char *buf, int len ) int sock_t_send_fd( int fd, int send_size, unsigned char *buf, int len ) { int n; -#ifdef STRICT_CHECKING - assert( buf != NULL ); - assert( len > 0 ); -#endif - unsigned int length = len; unsigned int done = 0; unsigned char *ptr = buf; @@ -333,23 +321,13 @@ int sock_t_send_fd( int fd, int send_size, unsigned char *buf, int len ) length -= n; //@ decrement length by bytes send done += n; //@ keep count of bytes done } - -#ifdef STRICT_CHECKING - assert( length == 0 ); - assert( done == len ); -#endif - return done; - } void sock_t_close( vj_sock_t *s ) { if(s) { -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "\tclosing socket %d", s->sock_fd ); -#endif if( s->sock_fd ) { close(s->sock_fd); s->sock_fd = -1; diff --git a/veejay-current/veejay-server/libvjnet/mcastreceiver.c b/veejay-current/veejay-server/libvjnet/mcastreceiver.c index 500bea7a..9fc9a69f 100644 --- a/veejay-current/veejay-server/libvjnet/mcastreceiver.c +++ b/veejay-current/veejay-server/libvjnet/mcastreceiver.c @@ -39,9 +39,6 @@ #include #include "packet.h" #include -#ifdef STRICT_CHECKING -#include -#endif typedef struct { @@ -155,9 +152,6 @@ int mcast_receiver_set_peer( mcast_receiver *v, const char *hostname ) int mcast_poll( mcast_receiver *v ) { -#ifdef STRICT_CHECKING - assert( v != NULL ); -#endif fd_set fds; struct timeval tv; memset( &tv, 0, sizeof(tv) ); @@ -205,9 +199,6 @@ int mcast_recv_packet_frame( mcast_receiver *v ) { if( q->slot[i]->hdr.usec == hdr.usec ) { d_slot = i; -#ifdef STRICT_CHECKING - assert( q->slot[i]->len == inf.len ); -#endif break; } } @@ -236,10 +227,6 @@ int mcast_recv_packet_frame( mcast_receiver *v ) } d_slot = o; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Dropping frame in slot %d (%d/%d packets)", - d_slot, q->slot[d_slot]->count,q->slot[d_slot]->hdr.length ); -#endif free(q->slot[d_slot]->buf); q->slot[d_slot]->buf = NULL; q->slot[d_slot]->count = 0; @@ -297,9 +284,6 @@ uint8_t *mcast_recv_frame( mcast_receiver *v, int *dw, int *dh, int *dfmt, int * while( (n = mcast_recv_packet_frame(v) ) ) { if( n == 2 ) { -#ifdef STRICT_CHECKING - -#endif break; //@ full frame } } @@ -327,15 +311,6 @@ uint8_t *mcast_recv_frame( mcast_receiver *v, int *dw, int *dh, int *dfmt, int * } } /* -#ifdef STRICT_CHECKING - //@debug queue - for( i = 0; i < PACKET_SLOTS; i ++ ) { - packet_buffer_t *p = q->slot[i]; - veejay_msg(VEEJAY_MSG_DEBUG, "Slot %d: %d bytes, %d/%d queued, rdy=%d, t1=%ld", - i, p->len, p->count,p->hdr.length, p->rdy,(long) p->hdr.usec ); - - } -#endif */ //@ return newest full frame if( full_frame ) { diff --git a/veejay-current/veejay-server/libvjnet/mcastsender.c b/veejay-current/veejay-server/libvjnet/mcastsender.c index 01a6d1e7..768968a6 100644 --- a/veejay-current/veejay-server/libvjnet/mcastsender.c +++ b/veejay-current/veejay-server/libvjnet/mcastsender.c @@ -29,9 +29,6 @@ #include #include #include "packet.h" -#ifdef STRICT_CHECKING -#include -#endif static void print_error(char *msg) { diff --git a/veejay-current/veejay-server/libvjnet/packet.c b/veejay-current/veejay-server/libvjnet/packet.c index 56aa0d53..c7b0f120 100644 --- a/veejay-current/veejay-server/libvjnet/packet.c +++ b/veejay-current/veejay-server/libvjnet/packet.c @@ -24,15 +24,8 @@ #include #include "packet.h" -#ifdef STRICT_CHECKING -#include -#endif - void packet_dump_header( packet_header_t *h) { -#ifdef STRICT_CHECKING - assert( h != NULL ); -#endif veejay_msg(VEEJAY_MSG_DEBUG, "Flag: %x, Sequence Num %d/%d, Timestamp %x Timeout : %ld", h->flag, h->seq_num,h->length, h->usec,h->timeout ); } diff --git a/veejay-current/veejay-server/libvjnet/vj-client.c b/veejay-current/veejay-server/libvjnet/vj-client.c index de5f9432..22530af2 100644 --- a/veejay-current/veejay-server/libvjnet/vj-client.c +++ b/veejay-current/veejay-server/libvjnet/vj-client.c @@ -41,9 +41,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #define VJC_OK 0 #define VJC_NO_MEM 1 #define VJC_SOCKET 2 @@ -98,33 +95,6 @@ void vj_client_free(vj_client *v) } } -#ifdef STRICT_CHECKING -static int verify_integrity( char *buf, int len ) { - if( len < 0 || buf == NULL ) { - veejay_msg(VEEJAY_MSG_DEBUG, "Nothing to send"); - return 0; - } - int i; - for ( i = 0; i < len; i ++ ) { - if( buf[i] == '\0' ) { - veejay_msg(VEEJAY_MSG_DEBUG, "End of string at pos %d, should have been pos %d", - i, len ); - return 0; - } - - if( buf[i] == '\n' || buf[i] == '\r' ) - continue; - - if( !isprint(buf[i]) ) { - veejay_msg(VEEJAY_MSG_DEBUG, "character '%x' is not alphanumeric at pos %d/%d", - buf[i], i, len ); - return 0; - } - } - return 1; -} -#endif - int vj_client_window_sizes( int socket_fd, int *r, int *s ) { int tmp = sizeof(int); @@ -182,10 +152,6 @@ int vj_client_connect(vj_client *v, char *host, char *group_name, int port_id ) { if(host == NULL) return error; -#ifdef STRICT_CHECKING - assert(v->fd[0] == NULL ); - assert(v->fd[1] == NULL ); -#endif v->fd[0] = alloc_sock_t(); v->fd[1] = alloc_sock_t(); @@ -209,12 +175,6 @@ int vj_client_connect(vj_client *v, char *host, char *group_name, int port_id ) } v->ports[0] = port_id + VJ_CMD_PORT; v->ports[1] = port_id + VJ_STA_PORT; -#ifdef STRICT_CHECKING - veejay_msg( VEEJAY_MSG_DEBUG, "connected CMD port %d (socket %p, type %d)", - v->ports[0], v->fd[0], 0 ); - veejay_msg( VEEJAY_MSG_DEBUG, "connected STATUS port %d (socket %p, type %d)", - v->ports[1], v->fd[1], 1 ); -#endif } else { @@ -253,12 +213,7 @@ int vj_client_link_can_read( vj_client *v, int sock_type ) { int vj_client_poll( vj_client *v, int sock_type ) { -#ifdef STRICT_CHECKING - int n = sock_t_poll( v->fd[sock_type] ); - return n; -#else return sock_t_poll( v->fd[sock_type ]); -#endif } static long vj_client_decompress( vj_client *t,uint8_t *in, uint8_t *out, int data_len, int Y, int UV , int header_len, @@ -487,10 +442,6 @@ int vj_client_read_i( vj_client *v, uint8_t *dst, int dstlen ) } int n = sock_t_recv( v->fd[0],v->space,p[3] ); -#ifdef STRICT_CHECKING - if( n > 0 ) assert( n == p[3] ); - if( p[3] > 0 ) assert( p[3] == (16 + strides[0] + strides[1] + strides[2]) ); -#endif if( n <= 0 ) { if( n == -1 ) { diff --git a/veejay-current/veejay-server/libvjnet/vj-server.c b/veejay-current/veejay-server/libvjnet/vj-server.c index aa69408f..329d971b 100644 --- a/veejay-current/veejay-server/libvjnet/vj-server.c +++ b/veejay-current/veejay-server/libvjnet/vj-server.c @@ -33,9 +33,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #define __INVALID 0 #define __SENDER 1 #define __RECEIVER 2 @@ -321,9 +318,6 @@ static int _vj_server_classic(vj_server *vjs, int port_offset) port_num, vjs->recv_size, vjs->send_size ); break; default: -#ifdef STRICT_CHECKING - assert(0); -#endif break; } @@ -404,12 +398,6 @@ int vj_server_send( vj_server *vje, int link_id, uint8_t *buf, int len ) { unsigned int total = 0; unsigned int bytes_left = len; -#ifdef STRICT_CHECKING - assert( vje->send_size > 0 ); - assert( len > 0 ); - assert( buf != NULL ); - assert( link_id >= 0 ); -#endif vj_link **Link = (vj_link**) vje->link; if( !Link[link_id]->in_use ) { @@ -480,22 +468,9 @@ int vj_server_link_can_read( vj_server *vje, int link_id) static int vj_server_send_frame_now( vj_server *vje, int link_id, uint8_t *buf, int len ) { unsigned int total = 0; -#ifdef STRICT_CHECKING - assert( vje->send_size > 0 ); - assert( len > 0 ); - assert( buf != NULL ); - assert( link_id >= 0 ); -#endif vj_link **Link = (vj_link**) vje->link; -#ifdef STRICT_CHECKING - assert( Link[link_id]->in_use == 1 ); -#endif total = sock_t_send_fd( Link[link_id]->handle, vje->send_size, buf, len); -#ifdef STRICT_CHECKING - if( total != len ) - veejay_msg(VEEJAY_MSG_ERROR, "Only sent %d out of %d bytes", total,len); -#endif if( vje->logfd ) { fprintf(vje->logfd, "sent frame %d of %d bytes to handle %d (link %d) %s\n", total,len, Link[link_id]->handle,link_id,(char*)(inet_ntoa(vje->remote.sin_addr)) ); // printbuf( vje->logfd, buf, len ); @@ -612,9 +587,6 @@ void vj_server_client_promote( vj_server *vje, int link_id) { vj_link **Link= (vj_link**) vje->link; -#ifdef STRICT_CHECKING - assert( Link[link_id]->in_use == 1 ); -#endif Link[link_id]->promote = 1; if( vje->logfd ) { fprintf(vje->logfd, "promote link %d\n", link_id ); @@ -839,9 +811,6 @@ static int _vj_parse_msg(vj_server *vje,int link_id, char *buf, int buf_len ) { v[num_msg]->msg = strndup( str_ptr, slen ); //@ '600:;' v[num_msg]->len = slen; //@ 5 -#ifdef STRICT_CHECKING - assert( slen == strlen( v[num_msg]->msg ) ); -#endif num_msg++; } @@ -898,9 +867,6 @@ int vj_server_new_connection(vj_server *vje) int addr_len = sizeof(vje->remote); int n = 0; int fd = accept( vje->handle, (struct sockaddr*) &(vje->remote), &addr_len ); -#ifdef STRICT_CHECKING - assert( fd != 0 ); //@ grab a beer if fd == FILENO_STDIN -#endif if(fd == -1) { veejay_msg(VEEJAY_MSG_ERROR, "Error accepting connection: %s", @@ -1102,9 +1068,6 @@ void vj_server_shutdown(vj_server *vje) int vj_server_link_used( vj_server *vje, int link_id) { vj_link **Link = (vj_link**) vje->link; -#ifdef STRICT_CHECKING - assert( link_id >= 0 && link_id < VJ_MAX_CONNECTIONS ); -#endif return Link[link_id]->in_use; /* if( link_id < 0 || link_id >= VJ_MAX_CONNECTIONS ) @@ -1141,17 +1104,8 @@ char *vj_server_retrieve_msg(vj_server *vje, int id, char *dst, int *str_len ) return NULL; // done char *msg = Link[id]->m_queue[index]->msg; -#ifdef STRICT_CHECKING - assert( msg != NULL ); -#endif int len = Link[id]->m_queue[index]->len; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "L%2d queue [%4d]/[%d] [%4d] '%s'", - id, index, Link[id]->n_queued, len, msg ); - -#endif - index ++; Link[id]->n_retrieved = index; diff --git a/veejay-current/veejay-server/libyuv/yuvconv.c b/veejay-current/veejay-server/libyuv/yuvconv.c index 8540adc5..baf26ace 100644 --- a/veejay-current/veejay-server/libyuv/yuvconv.c +++ b/veejay-current/veejay-server/libyuv/yuvconv.c @@ -49,10 +49,6 @@ * See http://mjpeg.sourceforge.net/ (MJPEG Tools) (lav-common.c) */ -#ifdef STRICT_CHECKING -#include -#endif - typedef struct { struct SwsContext *sws; @@ -200,12 +196,6 @@ static void verify_CCIR_( int a, int b, char *caller, int line ) { } } -#ifdef STRICT_CHECKING -#define verify_CCIR( a,b ) verify_CCIR_( a,b,__FUNCTION__,__LINE__ ) -#else -#define verify_CCIR( a,b ) return -#endif - int yuv_use_auto_ccir_jpeg() { return auto_conversion_ccir_jpeg_; @@ -499,11 +489,6 @@ VJFrame *yuv_yuv_template( uint8_t *Y, uint8_t *U, uint8_t *V, int w, int h, int f->data[1] = NULL; f->data[2] = NULL; break; default: -#ifdef STRICT_CHECKING - yuv_pixstr( __FUNCTION__, "fmt", fmt ); - - assert(0); -#endif break; } f->len = w*h; @@ -544,16 +529,6 @@ VJFrame *yuv_rgb_template( uint8_t *rgb_buffer, int w, int h, int fmt ) void yuv_convert_any_ac_packed( VJFrame *src, uint8_t *dst, int src_fmt, int dst_fmt ) { -#ifdef STRICT_CHEdCKING - assert( dst_fmt >= 0 && dst_fmt < 32 ); - assert( src_fmt == PIX_FMT_YUV420P || src_fmt == PIX_FMT_YUVJ420P || - src_fmt == PIX_FMT_YUV422P || src_fmt == PIX_FMT_YUVJ422P || - src_fmt == PIX_FMT_YUV444P || src_fmt == PIX_FMT_YUVJ444P || - src_fmt == PIX_FMT_RGB24 || src_fmt == PIX_FMT_RGBA || - src_fmt == PIX_FMT_BGR24 || src_fmt == PIX_FMT_RGB32 || - src_fmt == PIX_FMT_RGB32_1 || src_fmt == PIX_FMT_GRAY8 ); - assert( src->width > 0 ); -#endif uint8_t *dst_planes[3] = { dst, NULL, NULL }; if(!ac_imgconvert( src->data, ffmpeg_aclib[ src_fmt ], dst_planes, ffmpeg_aclib[ dst_fmt] , src->width,src->height )) @@ -569,18 +544,6 @@ void yuv_convert_any_ac_packed( VJFrame *src, uint8_t *dst, int src_fmt, int dst void yuv_convert_any_ac( VJFrame *src, VJFrame *dst, int src_fmt, int dst_fmt ) { -#ifdef STRICT_CHECKING - assert( dst_fmt >= 0 && dst_fmt < 32 ); - assert( src_fmt == PIX_FMT_YUV420P || src_fmt == PIX_FMT_YUVJ420P || - src_fmt == PIX_FMT_YUV422P || src_fmt == PIX_FMT_YUVJ422P || - src_fmt == PIX_FMT_YUV444P || src_fmt == PIX_FMT_YUVJ444P || - src_fmt == PIX_FMT_RGB24 || src_fmt == PIX_FMT_RGBA || - src_fmt == PIX_FMT_YUYV422 || - src_fmt == PIX_FMT_BGR24 || src_fmt == PIX_FMT_RGB32 || - src_fmt == PIX_FMT_RGB32_1 || src_fmt == PIX_FMT_GRAY8 || src_fmt == PIX_FMT_ARGB ); - assert( src->width > 0 ); - assert( dst->width > 0 ); -#endif if(!ac_imgconvert( src->data, ffmpeg_aclib[ src_fmt ], dst->data, ffmpeg_aclib[ dst_fmt] , dst->width,dst->height )) { @@ -618,17 +581,6 @@ void yuv_fx_context_destroy( void *ctx ) void yuv_convert_any3( void *scaler, VJFrame *src, int src_stride[3], VJFrame *dst, int src_fmt, int dst_fmt ) { -#ifdef STRICT_CHECKING -/* assert( dst_fmt >= 0 && dst_fmt < 32 ); - assert( src_fmt == PIX_FMT_YUV420P || src_fmt == PIX_FMT_YUVJ420P || - src_fmt == PIX_FMT_YUV422P || src_fmt == PIX_FMT_YUVJ422P || - src_fmt == PIX_FMT_YUV444P || src_fmt == PIX_FMT_YUVJ444P || - src_fmt == PIX_FMT_RGB24 || src_fmt == PIX_FMT_RGBA || src_fmt == PIX_FMT_ARGB );*/ - assert( src_stride[0] > 0 ); - assert( dst->width > 0 ); - assert( dst->height > 0 ); - assert( dst->data[0] != NULL ); -#endif vj_sws *s = (vj_sws*) scaler; if(s->sws) { @@ -1071,9 +1023,6 @@ void* yuv_init_swscaler(VJFrame *src, VJFrame *dst, sws_template *tmpl, int cpu_ int cpu_flags = 0; -#ifdef STRICT_CHECKING - cpu_flags = cpu_flags | SWS_PRINT_INFO; -#endif #ifdef HAVE_ASM_MMX cpu_flags = cpu_flags | SWS_CPU_CAPS_MMX; #endif @@ -1162,10 +1111,6 @@ static void *yuv_init_sws_cached_context(vj_sws *s, VJFrame *src, VJFrame *dst, { int cpu_flags = 0; -#ifdef STRICT_CHECKING - cpu_flags = cpu_flags | SWS_PRINT_INFO; -#endif - #ifdef HAVE_ASM_MMX cpu_flags = cpu_flags | SWS_CPU_CAPS_MMX; #endif diff --git a/veejay-current/veejay-server/veejay/liblavplayvj.c b/veejay-current/veejay-server/veejay/liblavplayvj.c index ce0a4193..a72bebcb 100644 --- a/veejay-current/veejay-server/veejay/liblavplayvj.c +++ b/veejay-current/veejay-server/veejay/liblavplayvj.c @@ -99,9 +99,6 @@ #define QUEUE_LEN 1 #include #include -#ifdef STRICT_CHECKING -#include -#endif /* #ifdef HAVE_GL #include @@ -205,26 +202,6 @@ int veejay_set_yuv_range(veejay_t *info) { ******************************************************/ static void veejay_reset_el_buffer( veejay_t *info ); -#ifdef STRICT_CHECKING -void veejay_change_state1(veejay_t * info, int new_state) -{ - video_playback_setup *settings = - (video_playback_setup *) info->settings; - -// pthread_mutex_lock(&(settings->valid_mutex)); - settings->state = new_state; -// pthread_mutex_unlock(&(settings->valid_mutex)); -} - -#define veejay_change_state(a,b) vcs(a,b,__FUNCTION__,__LINE__) -void vcs(veejay_t *info, int new_state,const char *caller_func,const int caller_line) -{ - veejay_msg(VEEJAY_MSG_DEBUG, - "Change state to %d by %s:%d",new_state, - caller_func,caller_line); - veejay_change_state1(info,new_state); -} -#else void veejay_change_state(veejay_t * info, int new_state) { video_playback_setup *settings = @@ -234,7 +211,7 @@ void veejay_change_state(veejay_t * info, int new_state) settings->state = new_state; // pthread_mutex_unlock(&(settings->valid_mutex)); } -#endif + void veejay_change_state_save(veejay_t * info, int new_state) { if(new_state == LAVPLAY_STATE_STOP ) @@ -629,9 +606,6 @@ static int veejay_start_playing_sample( veejay_t *info, int sample_id ) video_playback_setup *settings = info->settings; editlist *E = sample_get_editlist( sample_id ); -#ifdef STRICT_CHECKING - assert( E != NULL ); -#endif info->current_edit_list = E; veejay_reset_el_buffer(info); @@ -800,9 +774,6 @@ void veejay_change_playback_mode( veejay_t *info, int new_pm, int sample_id ) veejay_stop_playing_sample( info, info->uc->sample_id ); info->uc->playback_mode = new_pm; info->current_edit_list = info->edit_list; -#ifdef STRICT_CHECKING - assert(info->current_edit_list != NULL ); -#endif video_playback_setup *settings = info->settings; settings->min_frame_num = 0; settings->max_frame_num = info->edit_list->total_frames; @@ -1153,11 +1124,7 @@ void veejay_pipe_write_status(veejay_t * info) (info->uc->sample_id,cache_used,info->seq->active,info->seq->current,info->real_fps,settings->current_frame_num, pm, total_slots,info->seq->rec_id,curfps,settings->cycle_count[0],settings->cycle_count[1],mstatus,info->status_what ) != 0) { veejay_msg(VEEJAY_MSG_ERROR, "Fatal error, tried to collect properties of invalid sample"); -#ifdef STRICT_CHECKING - assert(0); -#else veejay_change_state( info, LAVPLAY_STATE_STOP ); -#endif } break; case VJ_PLAYBACK_MODE_PLAIN: @@ -1782,9 +1749,6 @@ int veejay_init(veejay_t * info, int x, int y,char *arg, int def_tags, int gen_t veejay_msg(VEEJAY_MSG_DEBUG, "Using clock_nanosleep timer"); break; } -#ifdef STRICT_CHECKING - assert(info->edit_list != NULL ); -#endif if (veejay_init_editlist(info) != 0) { @@ -2270,9 +2234,6 @@ static void veejay_playback_cycle(veejay_t * info) switch(info->uc->playback_mode) { case VJ_PLAYBACK_MODE_PLAIN: info->current_edit_list = info->edit_list; -#ifdef STRICT_CHECKING - assert( info->edit_list != NULL ); -#endif video_playback_setup *settings = info->settings; settings->min_frame_num = 0; settings->max_frame_num = info->edit_list->total_frames; @@ -2453,7 +2414,7 @@ static void veejay_playback_cycle(veejay_t * info) #endif if( (stats.tdiff > settings->spvf || info->real_fps > (1000 * settings->spvf)) && info->real_fps && info->audio == AUDIO_PLAY) { - veejay_msg(VEEJAY_MSG_WARNING, "Rendering audio/video frame takes too long (measured %ld ms, out of sync by %g). Can't keep pace with audio!", stats.tdiff, info->real_fps); + veejay_msg(VEEJAY_MSG_WARNING, "Can't keep pace with audio! Rendering audio/video frame takes too long (measured %-4ld ms, out of sync by %-2.4f seconds)",(float) stats.tdiff, info->real_fps); } diff --git a/veejay-current/veejay-server/veejay/veejay.c b/veejay-current/veejay-server/veejay/veejay.c index 7d6cc707..0903da3f 100644 --- a/veejay-current/veejay-server/veejay/veejay.c +++ b/veejay-current/veejay-server/veejay/veejay.c @@ -607,16 +607,7 @@ static int check_command_line_options(int argc, char *argv[]) /* These are the old getopt-values (non-long) */ default: sprintf(option, "%c", n); -#ifdef STRICT_CHECKING - { - int tmpn = set_option( option,optarg ); - if(tmpn) - veejay_msg(VEEJAY_MSG_ERROR, "Error setting option '%c'", option ); - nerr += tmpn; - } -#else nerr += set_option(option, optarg); -#endif break; } @@ -828,8 +819,5 @@ int main(int argc, char **argv) veejay_msg(VEEJAY_MSG_INFO, "Thank you for using Veejay"); -#ifdef STRICT_CHECKING - vevo_report_stats(); -#endif return 0; } diff --git a/veejay-current/veejay-server/veejay/vj-composite.c b/veejay-current/veejay-server/veejay/vj-composite.c index 91a1f77e..2f6599e8 100644 --- a/veejay-current/veejay-server/veejay/vj-composite.c +++ b/veejay-current/veejay-server/veejay/vj-composite.c @@ -42,9 +42,6 @@ #include #include -#ifdef STRICT_CHECKING -#include -#endif #ifdef HAVE_GL #include #endif @@ -141,13 +138,7 @@ void *composite_init( int pw, int ph, int iw, int ih, const char *homedir, int s c->frame4 = yuv_yuv_template( c->proj_plane[0],c->proj_plane[1],c->proj_plane[2],iw,ih,c->frame1->format ); c->scaler = yuv_init_swscaler( c->frame1, c->frame2, &sws_templ, 0 ); -#ifdef STRICT_CHECKING - assert(c->scaler != NULL ); -#endif c->back_scaler = yuv_init_swscaler( c->frame4, c->frame3, &sws_templ, 0 ); -#ifdef STRICT_CHECKING - assert(c->back_scaler!=NULL); -#endif c->back1 = NULL; @@ -257,9 +248,6 @@ void *composite_load_config( void *compiz, void *vc, int *result ) if( c->back1 == NULL ) { c->back1 = composite_clone(c ); } -#ifdef STRICT_CHECKING - assert(c->back1 != NULL ); -#endif viewport_update_from(c->vp1, c->back1 ); c->Y_only = cm; *result = m; @@ -281,9 +269,6 @@ int composite_event( void *compiz, uint8_t *in[4], int mouse_x, int mouse_y, int static void composite_scale( composite_t *c, VJFrame *input, VJFrame *output ) { -#ifdef STRICT_CHECKING - assert( c->scaler != NULL ); -#endif yuv_convert_and_scale(c->scaler,input,output); } diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c index d1806100..fd2450b7 100644 --- a/veejay-current/veejay-server/veejay/vj-event.c +++ b/veejay-current/veejay-server/veejay/vj-event.c @@ -68,9 +68,6 @@ /* Highest possible SDL Key identifier */ #define MAX_SDL_KEY (3 * SDLK_LAST) + 1 #define MSG_MIN_LEN 4 /* stripped ';' */ -#ifdef STRICT_CHECKING -#include -#endif #ifdef HAVE_FREETYPE #include #endif @@ -376,19 +373,7 @@ if(bf_len && vj_server_send(v->vjs[VEEJAY_PORT_CMD], v->uc->current_link, (uint8 /* some macros for commonly used checks */ - -#ifdef STRICT_CHECKING -static int SAMPLE_PLAYING( veejay_t *v ) { - if( v->uc->playback_mode == VJ_PLAYBACK_MODE_SAMPLE ) - return 1; - if( v->rmodes[v->uc->current_link] == VJ_PLAYBACK_MODE_SAMPLE ) - return 1; - return 0; -} -#else - #define SAMPLE_PLAYING(v) ( (v->uc->playback_mode == VJ_PLAYBACK_MODE_SAMPLE) || (v->rmodes[v->uc->current_link] == VJ_PLAYBACK_MODE_SAMPLE) ) -#endif #define STREAM_PLAYING(v) ( (v->uc->playback_mode == VJ_PLAYBACK_MODE_TAG) || (v->rmodes[v->uc->current_link] == VJ_PLAYBACK_MODE_TAG)) #define PLAIN_PLAYING(v) ( (v->uc->playback_mode == VJ_PLAYBACK_MODE_PLAIN) || (v->rmodes[v->uc->current_link] == VJ_PLAYBACK_MODE_PLAIN)) @@ -807,9 +792,6 @@ int vj_event_bundle_update( vj_msg_bundle *bundle, int bundle_id ) static void constrain_sample( veejay_t *v,int n ) { -#ifdef STRICT_CHECKING - assert( v->font != NULL ); -#endif vj_font_set_dict(v->font, sample_get_dict(n) ); // v->current_edit_list->video_fps, vj_font_prepare( v->font, sample_get_startFrame(n), @@ -819,9 +801,6 @@ static void constrain_sample( veejay_t *v,int n ) static void constrain_stream( veejay_t *v, int n, long hi ) { -#ifdef STRICT_CHECKING - assert(v->font != NULL ); -#endif vj_font_set_dict(v->font, vj_tag_get_dict(n) ); // v->current_edit_list->video_fps, vj_font_prepare( v->font, 0, vj_tag_get_n_frames(n) ); @@ -1486,22 +1465,7 @@ int vj_event_parse_msg( void *ptr, char *msg, int msg_len ) veejay_msg(VEEJAY_MSG_ERROR, "Error parsing VIMS selector"); return 0; } -#ifdef STRICT_CHECKING - char *dbg_msg = vj_event_vevo_get_event_name( net_id ); - if( dbg_msg == NULL ) { - veejay_msg(VEEJAY_MSG_WARNING, "No event knownn by '%d' (%s)", net_id,msg ); - } else { - veejay_msg(VEEJAY_MSG_DEBUG, "VIMS '%s' %s",msg,dbg_msg ); - free(dbg_msg); - } -#endif -#ifndef STRICT_CHECKING - if( net_id != 412 && net_id != 333) -#else - veejay_msg(VEEJAY_MSG_DEBUG, "VIMS: @%ld Parse message '%s'",v->settings->current_frame_num, msg ); - -#endif if( net_id <= 0 || net_id >= VIMS_MAX ) { veejay_msg(VEEJAY_MSG_ERROR, "VIMS Selector %d invalid", net_id ); @@ -1978,10 +1942,6 @@ static int get_cstr( xmlDocPtr doc, xmlNodePtr cur, const xmlChar *what, char *d t = UTF8toLAT1(tmp); if(!t) return 0; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Load string property '%s' with value '%s'", - cur->name, t); -#endif veejay_strncpy( dst, t, strlen(t) ); free(t); @@ -2002,10 +1962,6 @@ static int get_fstr( xmlDocPtr doc, xmlNodePtr cur, const xmlChar *what, float * t = UTF8toLAT1(tmp); if(!t) return 0; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Load float property '%s' with value '%s'", - cur->name, t); -#endif n = sscanf( t, "%f", &tmp_f ); free(t); @@ -2036,10 +1992,6 @@ static int get_istr( xmlDocPtr doc, xmlNodePtr cur, const xmlChar *what, int *ds veejay_msg(VEEJAY_MSG_ERROR, "Input not in UTF8 format!"); return 0; } -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "Load int property '%s' with value '%s'", - cur->name, t); -#endif n = sscanf( t, "%d", &tmp_i ); free(t); @@ -3014,9 +2966,6 @@ void vj_event_send_bundles(void *ptr, const char format[], va_list ap) continue; m = vj_event_bundle_get(i); -#ifdef STRICT_CHECKING - assert( m!= NULL); -#endif int bun_len = strlen(m->bundle); if( bun_len <= 0 ) @@ -3034,9 +2983,6 @@ void vj_event_send_bundles(void *ptr, const char format[], va_list ap) char *name = vj_event_vevo_get_event_name(i); char *form = vj_event_vevo_get_event_format(i); -#ifdef STRICT_CHECKING - assert( name != NULL ); -#endif int name_len = strlen(name); int form_len = (form ? strlen(form) : 0); #ifdef HAVE_SDL @@ -3049,10 +2995,6 @@ void vj_event_send_bundles(void *ptr, const char format[], va_list ap) veejay_strncat( buf,tmp,strlen(tmp)); -#ifdef STRICT_CHECKING - if( tree->arg_len ) - assert( tree->args != NULL ); -#endif if(form) veejay_strncat( buf, form, form_len); if(tree->arg_len) diff --git a/veejay-current/veejay-server/veejay/vj-eventman.c b/veejay-current/veejay-server/veejay/vj-eventman.c index 02361370..65af64f1 100644 --- a/veejay-current/veejay-server/veejay/vj-eventman.c +++ b/veejay-current/veejay-server/veejay/vj-eventman.c @@ -24,9 +24,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #define MAX_INDEX 1024 @@ -199,16 +196,7 @@ static vevo_port_t *_new_event( char param_name[16]; char descr_name[255]; -#ifdef STRICT_CHECKING - assert( name != NULL ); - assert( function != NULL ); - assert( vims_id > 0 ); -#endif - vevo_port_t *p = (void*) vpn( VEVO_EVENT_PORT ); -#ifdef STRICT_CHECKING - assert( p != NULL ); -#endif if( format ) vevo_property_set( p, "format", VEVO_ATOM_TYPE_STRING, 1, &format ); else @@ -230,10 +218,6 @@ static vevo_port_t *_new_event( sprintf(param_name, "argument_%d", n ); const char *arg = va_arg( ap, const char*); -#ifdef STRICT_CHECKING - if(!arg) veejay_msg(VEEJAY_MSG_DEBUG, "\t'%s' %s - %d = '%s' of format %c (%s)",name,param_name, n, arg, format[it],format ); - assert( arg != NULL ); -#endif char *descr = (char*) strdup( arg ); sprintf(descr_name, "help_%d", n ); diff --git a/veejay-current/veejay-server/veejay/vj-font.c b/veejay-current/veejay-server/veejay/vj-font.c index 2c8e5368..57c87d7f 100644 --- a/veejay-current/veejay-server/veejay/vj-font.c +++ b/veejay-current/veejay-server/veejay/vj-font.c @@ -48,10 +48,6 @@ extern int vj_tag_size(); -#ifdef STRICT_CHECKING -#include -#endif - #ifdef HAVE_FREETYPE #include #include @@ -240,9 +236,6 @@ int vj_font_srt_sequence_exists( void *font, int id ) if(!f->dictionary ) return 0; -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif char *key = make_key(id); void *srt = NULL; int error = vevo_property_get( f->dictionary, key,0,&srt ); @@ -399,9 +392,6 @@ void vj_font_set_current( void *font , int cur ) static void vj_font_del_srt_sequence( vj_font_t *f, int seq_id ) { -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif if(seq_id == 0 ) seq_id = f->auto_number; @@ -424,9 +414,6 @@ static void vj_font_del_srt_sequence( vj_font_t *f, int seq_id ) static void vj_font_store_srt_sequence( vj_font_t *f, srt_seq_t *s ) { -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif void *srt = NULL; int error = vevo_property_get( f->dictionary, s->key, 0, &srt ); if( error == VEVO_NO_ERROR ) @@ -642,9 +629,6 @@ void vj_font_xml_pack( xmlNodePtr node, void *font ) char **items = vevo_list_properties ( ff->dictionary ); if(!items) return; -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif char buf[100]; int i; @@ -717,9 +701,6 @@ int vj_font_save_srt( void *font , const char *filename ) veejay_msg(VEEJAY_MSG_ERROR, "Cannot open file '%s' for writing", filename ); return 0; } -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif for( i = 0; items[i] != NULL ; i ++ ) { void *srt = NULL; @@ -761,9 +742,6 @@ char *vj_font_get_sequence( void *font, int seq ) seq = ff->auto_number; char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif if( vevo_property_get( ff->dictionary, key, 0, &srt ) != VEVO_NO_ERROR ) return NULL; @@ -860,9 +838,6 @@ void vj_font_set_position( void *font, int x, int y ) char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( ff->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -887,9 +862,6 @@ void vj_font_set_size_and_font( void *font, int f_id, int size ) char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( ff->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -918,9 +890,6 @@ void vj_font_update_text( void *font, long s1, long s2, int seq, char *text) if(seq == 0 ) seq = ff->auto_number; char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif int error = vevo_property_get( ff->dictionary, key, 0, &srt ); if( error != VEVO_NO_ERROR ) { @@ -1226,9 +1195,6 @@ void vj_font_set_outline_and_border( void *font, int outline, int border) int seq = ff->auto_number; char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( ff->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -1253,9 +1219,6 @@ void vj_font_set_lncolor( void *font, int r, int g, int b, int a) char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( f->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -1282,9 +1245,6 @@ void vj_font_set_bgcolor( void *font, int r, int g, int b,int a) char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( f->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -1311,9 +1271,6 @@ void vj_font_set_fgcolor( void *font, int r, int g, int b, int a) char *key = make_key( seq ); -#ifdef STRICT_CHECKING - assert( ff->dictionary != NULL ); -#endif srt_seq_t *s = NULL; if( vevo_property_get( ff->dictionary, key, 0, &s ) != VEVO_NO_ERROR ) { @@ -2322,9 +2279,6 @@ void vj_font_render_osd_status( void *ctx, void *_picture, char *status_str, int void vj_font_render(void *ctx, void *_picture, long position) { vj_font_t *f = (vj_font_t *) ctx; -#ifdef STRICT_CHECKING - assert( f->dictionary != NULL ); -#endif font_lock( f ); int i; for( i = 0; i < f->index_len; i ++ ) { diff --git a/veejay-current/veejay-server/veejay/vj-misc.c b/veejay-current/veejay-server/veejay/vj-misc.c index c9d08fb8..a60d0e5c 100644 --- a/veejay-current/veejay-server/veejay/vj-misc.c +++ b/veejay-current/veejay-server/veejay/vj-misc.c @@ -41,9 +41,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #include @@ -116,10 +113,6 @@ static int is_usable_file( filelist_t *filelist, const char *node, const char *f struct stat l; veejay_memset(&l,0,sizeof(struct stat)); -#ifdef STRICT_CHECKING - assert( filelist != NULL ); - assert( filelist->num_files >= 0 || filelist->num_files < 1024 ); -#endif if( lstat( node, &l) < 0 ) return 0; @@ -200,9 +193,6 @@ filelist_t *find_media_files( veejay_t *info ) char *wd = getcwd( working_dir, sizeof(working_dir)); if( wd == NULL ) { -#ifdef STRICT_CHECKING - veejay_msg(0, "Strange, current working directory seems to be invalid?"); -#endif return NULL; } @@ -580,9 +570,6 @@ static char * kern_number(char * buf, char * end, long long num, int base, int t static int kern_vsnprintf(char *buf, size_t size, const char *fmt, va_list args) { -#ifdef STRICT_CHECKING - assert( size > 0 ); -#endif int num,flags,base; char *str, *end, c; const char *s; diff --git a/veejay-current/veejay-server/veejay/vj-osc.c b/veejay-current/veejay-server/veejay/vj-osc.c index 9d745c15..2f42f514 100644 --- a/veejay-current/veejay-server/veejay/vj-osc.c +++ b/veejay-current/veejay-server/veejay/vj-osc.c @@ -37,9 +37,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -239,10 +236,6 @@ static int osc_has_connection( char *name ) { continue; size_t len = vevo_property_element_size( port, "connection", 0 ); -#ifdef STRICT_CHECKING - assert( len > 0 ); -#endif - char *con = malloc( sizeof(char) * len ); int err = vevo_property_get(port, "connection", 0,&con ); if( err == VEVO_NO_ERROR ) { @@ -420,11 +413,6 @@ static void osc_iterate_clients() int err = vevo_property_get( port, "lo", 0, &clnt ); if( err == VEVO_NO_ERROR ) { size_t len = vevo_property_element_size( port, "cmd", 0 ); -#ifdef STRICT_CHECKING - assert( len > 0 ); -#endif - - char *cmd = malloc( sizeof(char) * len ); err = vevo_property_get( port, "cmd", 0, &cmd ); @@ -734,10 +722,9 @@ int vj_osc_build_cont( vj_osc *o ) continue; err = vevo_property_get( o->index, arr[t-1], 0, &attach_id ); -#ifdef STRICT_CHECKING - assert( err == VEVO_NO_ERROR ); -#endif - + if( err != VEVO_NO_ERROR ) { + break; + } err = vevo_property_get( o->index, arr[t], 0, &exists ); if( err == VEVO_NO_ERROR ) { continue; @@ -746,10 +733,6 @@ int vj_osc_build_cont( vj_osc *o ) o->leaves[next_id] = OSCNewContainer( arr[t], o->leaves[attach_id], &(o->cqinfo )); err = vevo_property_set( o->index, arr[t], VEVO_ATOM_TYPE_INT, 1, &next_id ); -#ifdef STRICT_CHECKING - assert(err==VEVO_NO_ERROR); -#endif - next_id ++; //veejay_msg(0, "Added leave '%s'%d to container '%s'%d", arr[t],next_id-1,arr[t-1],attach_id); @@ -771,10 +754,6 @@ int vj_osc_build_cont( vj_osc *o ) int method = containers - 1; err = vevo_property_get( o->index, arr[method-1], 0, &leave_id ); -#ifdef STRICT_CHECKING - assert( err == VEVO_NO_ERROR ); -#endif - #ifdef HAVE_LIBLO if( osc_method_layout[i].vims_id == -2 ) { o->ris.description = strdup( "Setup a OSC sender (Arg 0=host, 1=port)"); diff --git a/veejay-current/veejay-server/veejay/vj-perform.c b/veejay-current/veejay-server/veejay/vj-perform.c index e30928c9..9f0ba7d0 100644 --- a/veejay-current/veejay-server/veejay/vj-perform.c +++ b/veejay-current/veejay-server/veejay/vj-perform.c @@ -56,10 +56,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif - #include #define PERFORM_AUDIO_SIZE 16384 @@ -527,9 +523,6 @@ static long vj_perform_alloc_row(veejay_t *info, int c, int plane_len) uint8_t *buf = vj_malloc(sizeof(uint8_t) * frame_len * 3 * 3); mlock( buf, frame_len * 3 * sizeof(uint8_t)); -#ifdef STRICT_CHECKING - assert ( buf != NULL ); -#endif if(!buf) return 0; @@ -569,9 +562,6 @@ static int vj_perform_verify_rows(veejay_t *info ) int c,v,has_rows = 0; const int w = info->video_output_width; const int h = info->video_output_height; -#ifdef STRICT_CHECKING - long total_size = 0; -#endif for(c=0; c < SAMPLE_MAX_EFFECTS; c++) { v = (info->uc->playback_mode == VJ_PLAYBACK_MODE_SAMPLE ? @@ -580,24 +570,11 @@ static int vj_perform_verify_rows(veejay_t *info ) { if(!vj_perform_row_used(c)) { -#ifdef STRICT_CHECKING - long size = vj_perform_alloc_row( info, c, w*h); - if( size <= 0 ) - { - veejay_msg(VEEJAY_MSG_ERROR, "Unable to allocate memory for FX entry %d",c); - veejay_change_state( info, LAVPLAY_STATE_STOP ); - return -1; - } - else { - total_size += size; - } -#else if( vj_perform_alloc_row( info, c, w * h ) <= 0 ) { veejay_msg(0, "Unable to allocate memory for FX entry %d",c ); veejay_change_state( info, LAVPLAY_STATE_STOP ); return -1; } -#endif } has_rows ++; } @@ -607,11 +584,6 @@ static int vj_perform_verify_rows(veejay_t *info ) vj_perform_free_row(c); } } -#ifdef STRICT_CHECKING - if(total_size > 0) { - veejay_msg(VEEJAY_MSG_DEBUG, "Total Mb used in FX Chain: %2.2f", (float) (total_size / 1048576.0f ) ); - } -#endif return has_rows; } @@ -685,10 +657,6 @@ int vj_perform_init(veejay_t * info) if( mlock( primary_buffer[c]->Y, buf_len ) != 0 ) { mlock_success = 0; } -#ifdef STRICT_CHECKING - assert( primary_buffer[c] != NULL ); - assert( primary_buffer[c]->Y != NULL ); -#endif primary_buffer[c]->Cb = primary_buffer[c]->Y + frame_len; primary_buffer[c]->Cr = primary_buffer[c]->Cb + frame_len; @@ -1125,9 +1093,6 @@ static uint32_t vj_perform_compress_frame( veejay_t *info, uint8_t *dst, uint32_ return 0; } uint32_t size1 = ( *p1_len ); -#ifdef STRICT_CHECKING - assert(size1>0); -#endif dstI = dst + 16 + (sizeof(uint8_t) * size1 ); i = lzo_compress( lzo_, primary_buffer[info->out_buf]->Cb, dstI, p2_len, uv_len ); @@ -1138,9 +1103,6 @@ static uint32_t vj_perform_compress_frame( veejay_t *info, uint8_t *dst, uint32_ } uint32_t size2 = ( *p2_len ); -#ifdef STRICT_CHECKING - assert( size2 > 0); -#endif dstI = dst + 16 + size1 + size2; i = lzo_compress( lzo_, primary_buffer[info->out_buf]->Cr, dstI, p3_len, uv_len ); @@ -1152,10 +1114,6 @@ static uint32_t vj_perform_compress_frame( veejay_t *info, uint8_t *dst, uint32_ uint32_t size3 = ( *p3_len ); -#ifdef STRICT_CHECKING - assert( size3 > 0 ); -#endif - long2str( dst,size1); long2str( dst+4, size2 ); long2str( dst+8, size3 ); @@ -1475,9 +1433,6 @@ static int vj_perform_get_subframe(veejay_t * info, int sub_sample,int chain_ent if(sample_b[2] == 3 ) offset = 0; } -#ifdef STRICT_CHECKING - assert( offset >= 0 ); -#endif sample_set_offset(a, chain_entry, offset); return (sample_b[0] + offset); //1 diff --git a/veejay-current/veejay-server/veejay/vj-sdl.c b/veejay-current/veejay-server/veejay/vj-sdl.c index 62153d96..341a789b 100644 --- a/veejay-current/veejay-server/veejay/vj-sdl.c +++ b/veejay-current/veejay-server/veejay/vj-sdl.c @@ -40,14 +40,8 @@ #include #include //extern void *(* veejay_memcpy)(void *to, const void *from, size_t len) ; -#ifdef STRICT_CHECKING -#include -#endif /* static int wm_fullscreen(int action, Display *disp, Window *win) { -#ifdef STRICT_CHECKING - assert(action == _NET_WM_STATE_REMOVE || action == _NET_WM_STATE_ADD || - action == _NET_WM_STATE_TOGGLE ); #endif XEvent xev; xev.xclient.type = ClientMessage; @@ -248,9 +242,6 @@ int vj_sdl_init(int ncpu, vj_sdl * vjsdl, int scaled_width, int scaled_height, c return 0; } -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "%s" , (fs == 1 ? "Fullscreen": "Windowed")); -#endif //FIXME if( hw_on == 0 ) { @@ -576,12 +567,6 @@ int vj_sdl_update_yuv_overlay(vj_sdl * vjsdl, uint8_t ** yuv420) { if (!vj_sdl_lock(vjsdl)) return 0; -#ifdef STRICT_CHECKING - assert( yuv420[0] != NULL ); - assert( yuv420[1] != NULL ); - assert( yuv420[2] != NULL ); -#endif - #ifdef HAVE_SDL_TTF if( veejay_log_to_ringbuffer() ) { vj_sdl_draw_to_buffer( vjsdl->font, vjsdl->width, vjsdl->height ); diff --git a/veejay-current/veejay-server/veejay/vj-shm.c b/veejay-current/veejay-server/veejay/vj-shm.c index 047dd979..e236b17c 100644 --- a/veejay-current/veejay-server/veejay/vj-shm.c +++ b/veejay-current/veejay-server/veejay/vj-shm.c @@ -17,9 +17,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include -#ifdef STRICT_CHECKING -#include -#endif #include #include #include @@ -148,10 +145,6 @@ 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; -#ifdef STRICT_CHECKING - assert( v->parent == 0 ); - assert( v->sms != NULL ); -#endif int res = pthread_rwlock_rdlock( &data->rwlock ); if( res == -1 ) { // veejay_msg(0, "%s",strerror(errno)); @@ -185,9 +178,6 @@ 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; -#ifdef STRICT_CHECKING - assert( v->parent == 1 ); -#endif //@ call wrlock_wrlock N times before giving up .. @@ -325,14 +315,7 @@ static void failed_init_cleanup( vj_shm_t *v ) //@ new producer, puts frame in shm void *vj_shm_new_master( const char *homedir, VJFrame *frame) { -#ifdef STRICT_CHECKING - assert( frame->width > 0 ); - assert( frame->height > 0 ); -#endif vj_shm_t *v = (vj_shm_t*) vj_calloc(sizeof(vj_shm_t)); -#ifdef STRICT_CHECKING - assert( v != NULL ); -#endif v->parent = 1; if( vj_shm_file_ref( v, homedir ) == -1 ) { diff --git a/veejay-current/veejay-server/veejay/vj-task.c b/veejay-current/veejay-server/veejay/vj-task.c index 3d113fca..c68427d6 100644 --- a/veejay-current/veejay-server/veejay/vj-task.c +++ b/veejay-current/veejay-server/veejay/vj-task.c @@ -50,9 +50,6 @@ #include #include #include -#ifdef STRICT_CHECKING -#include -#endif //@ job description static vj_task_arg_t *vj_task_args[MAX_WORKERS]; diff --git a/veejay-current/veejay-server/veejay/vj-viewport.c b/veejay-current/veejay-server/veejay/vj-viewport.c index 15930b64..c9224af8 100644 --- a/veejay-current/veejay-server/veejay/vj-viewport.c +++ b/veejay-current/veejay-server/veejay/vj-viewport.c @@ -750,12 +750,6 @@ static float msy(viewport_t *v, float y) float a = (float) dy / ( v->h / 100.0f ); float s = (float) v->h / (float) v->ui->sh; -#ifdef STRICT_CHECKING - assert( (v->w > 0) ); - assert( (v->h > 0 )); - assert( (v->ui->sw > 0)); - assert( (v->ui->sh > 0 )); -#endif return (y/s) + a; } @@ -773,12 +767,6 @@ static float msx(viewport_t *v, float x) float a = (float) dx / ( v->w / 100.0f ); float s = (float) v->w / (float) v->ui->sw; -#ifdef STRICT_CHECKING - assert( (v->w > 0) ); - assert( (v->h > 0 )); - assert( (v->ui->sw > 0)); - assert( (v->ui->sh > 0 )); -#endif return (x/s) + a; } @@ -796,12 +784,6 @@ static float vsx(viewport_t *v, float x) float a = (float) dx / ( v->w / 100.0f ); float s = (float) v->w / (float) v->ui->sw; -#ifdef STRICT_CHECKING - assert( (v->w > 0) ); - assert( (v->h > 0 )); - assert( (v->ui->sw > 0)); - assert( (v->ui->sh > 0 )); -#endif return (x-a)*s; } static float vsy(viewport_t *v, float x) @@ -818,12 +800,6 @@ static float vsy(viewport_t *v, float x) float a = (float) dy / ( v->h / 100.0f ); float s = (float) v->h / (float) v->ui->sh; -#ifdef STRICT_CHECKING - assert( (v->w > 0) ); - assert( (v->h > 0 )); - assert( (v->ui->sw > 0)); - assert( (v->ui->sh > 0 )); -#endif return (x-a)*s; } @@ -1644,12 +1620,6 @@ void viewport_update_from(void *vv, void *bb) void *viewport_init(int x0, int y0, int w0, int h0, int w, int h, int iw, int ih,const char *homedir, int *enable, int *frontback, int mode ) { -#ifdef STRICT_CHECKING - assert( w > 0 ); - assert( h > 0 ); - assert( w0 > 0 ); - assert( h0 > 0 ); -#endif //@ try to load last saved settings viewport_config_t *vc = viewport_load_settings( homedir,mode ); if(vc) { @@ -1767,10 +1737,6 @@ void *viewport_clone(void *vv, int new_w, int new_h ) { viewport_t *v = (viewport_t*) vv; if(!v) return NULL; -#ifdef STRICT_CHECKING - assert( new_w > 0 ); - assert( new_h > 0 ); -#endif viewport_t *q = (viewport_t*) vj_malloc(sizeof(viewport_t)); veejay_memcpy(q,v,sizeof(viewport_t)); @@ -3110,13 +3076,6 @@ void viewport_produce_bw_img( void *vdata, uint8_t *img[3], uint8_t *out_img[3], register const int32_t ty1 = v->tty1; register const int32_t ty2 = v->tty2; -#ifdef STRICT_CHECKING - assert(tx1>= 0 ); - assert(tx2>= 0 ); - assert(ty1>= 0 ); - assert(ty2>= 0 ); -#endif - int x,y; y = ty1 * w; veejay_memset( outY,0,len); diff --git a/veejay-current/veejay-server/veejay/vjkf.c b/veejay-current/veejay-server/veejay/vjkf.c index 4ce2da4c..1968ad46 100644 --- a/veejay-current/veejay-server/veejay/vjkf.c +++ b/veejay-current/veejay-server/veejay/vjkf.c @@ -37,9 +37,6 @@ #include #include #endif -#ifdef STRICT_CHECKING -#include -#endif /* veejay server stores keyframes * * @@ -134,9 +131,6 @@ unsigned char *keyframe_pack( void *port, int parameter_id, int entry_id, int *r buf[2] = 0; buf[3] = 0; k++; -#ifdef STRICT_CHECKING - veejay_msg(VEEJAY_MSG_DEBUG, "No keyframe at position %d", i ); -#endif }*/ free(key);