Revision: 10331 http://pure-data.svn.sourceforge.net/pure-data/?rev=10331&view=rev Author: sergi_ll Date: 2008-10-16 21:46:53 +0000 (Thu, 16 Oct 2008)
Log Message: ----------- using ffmpeg, jump if file is not suported
Modified Paths: -------------- trunk/externals/pdvjtools/videogrid/videogrid-help.pd trunk/externals/pdvjtools/videogrid/videogrid.cc
Modified: trunk/externals/pdvjtools/videogrid/videogrid-help.pd =================================================================== --- trunk/externals/pdvjtools/videogrid/videogrid-help.pd 2008-10-15 13:16:39 UTC (rev 10330) +++ trunk/externals/pdvjtools/videogrid/videogrid-help.pd 2008-10-16 21:46:53 UTC (rev 10331) @@ -1,5 +1,5 @@ -#N canvas 323 160 580 404 10; -#X symbolatom 72 324 60 0 0 0 - - -; +#N canvas 323 160 563 400 10; +#X symbolatom 116 317 60 0 0 0 - - -; #X obj 26 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 24 13 VIDEOGRID; @@ -9,9 +9,7 @@ added in the grid , in form of image of its first frame.; #X text 74 344 LOCATION OF THE SELECTED VIDEO; #X text 24 93 LIST STDOUT; -#X msg 156 127 putvideodir /usr/local/lib/pd/extra/videogrid/videos -; -#X obj 83 159 videogrid videogrid1 3 5 #F0F0F0 #0F0F0F #F1882B; +#X obj 116 171 videogrid videogrid1 3 5 #F0F0F0 #0F0F0F #F1882B; #X msg 156 77 putvideo $1; #X obj 268 74 openpanel; #X obj 348 73 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 @@ -19,12 +17,14 @@ #X msg 16 160 clear; #X msg 13 212 seek $1; #X floatatom 19 185 5 0 0 0 - - -; -#X connect 1 0 9 0; -#X connect 8 0 9 0; -#X connect 9 0 0 0; +#X msg 156 127 putvideodir /home/medialab/opendijous/pd/Gem/examples/data/ +; +#X connect 1 0 8 0; +#X connect 8 0 0 0; +#X connect 9 0 8 0; #X connect 10 0 9 0; #X connect 11 0 10 0; -#X connect 12 0 11 0; -#X connect 13 0 9 0; -#X connect 14 0 9 0; -#X connect 15 0 14 0; +#X connect 12 0 8 0; +#X connect 13 0 8 0; +#X connect 14 0 13 0; +#X connect 15 0 8 0;
Modified: trunk/externals/pdvjtools/videogrid/videogrid.cc =================================================================== --- trunk/externals/pdvjtools/videogrid/videogrid.cc 2008-10-15 13:16:39 UTC (rev 10330) +++ trunk/externals/pdvjtools/videogrid/videogrid.cc 2008-10-16 21:46:53 UTC (rev 10331) @@ -158,7 +158,7 @@
// Retrieve stream information if(av_find_stream_info(pFormatCtx)<0) - return -1; // Couldn't find stream information + return -1; // Couldn't find stream information
// Dump information about file onto standard error dump_format(pFormatCtx, 0, pathFitxer, false); @@ -749,8 +749,8 @@ t1 != NULL; t1 = strtok(NULL,".") ) strcpy(extensio,t1); + /* if(strcmp(extensio,"mov")==0) retorn = 1; - /* if(strcmp(extensio,"eps")==0) retorn = 1; if(strcmp(extensio,"gif")==0) retorn = 1; if(strcmp(extensio,"jpg")==0) retorn = 1; @@ -788,46 +788,52 @@ } sys_vgui(".x%x.c delete %xS%d\n", glist_getcanvas(x->x_glist), x, pos); } - /* encua el nou node */ - encuar(&x->x_cua, entrada); - /* si no és el primer element a encuar incrementem la posicio de la última imatge insertada */ - if(numNodes(&x->x_cua) != 1) x->x_ultima_img ++; - /* si assoleix el maxim torna a començar, inicialitzant la posició en el tauler de la última imatge insertada */ - if(x->x_ultima_img == maxim) x->x_ultima_img = 0;
+ /* Quicktime per les conversions */ + int fferror=0; int nN = x->x_ultima_img; if (format_adequat_v(entrada) == 1) { convertir_img(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN); } else { - convertir_img_ff(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN); + fferror=convertir_img_ff(entrada,FORMAT_MINIATURA, W_CELL, H_CELL, nN); } + post ("%d",fferror); + if (fferror>=0) { + + /* encua el nou node */ + encuar(&x->x_cua, entrada); + /* si no és el primer element a encuar incrementem la posicio de la última imatge insertada */ + if(numNodes(&x->x_cua) != 1) x->x_ultima_img ++; + /* si assoleix el maxim torna a començar, inicialitzant la posició en el tauler de la última imatge insertada */ + if(x->x_ultima_img == maxim) x->x_ultima_img = 0;
- sprintf(nNstr, "%d", nN); - strcat(ig_path,nNstr); - strcat(ig_path,"."); - strcat(ig_path,FORMAT_MINIATURA); - /*printf("Creacio de la imatge %s ...",ig_path);*/ - sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path); - /* printf("1. Creacio de la imatge %s ...",ig_path); */ - sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n", - glist_getcanvas(x->x_glist), - text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2), - text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2), - x,nN,x,nN); - /* printf("2. Creacio de la imatge %s ...",ig_path); */ - if(nN == 0){ - x->x_tauler_primer = x->x_cua.final; - /* post("Ara el primer del tauler es %s\n",x->x_tauler_primer->pathFitxer); */ - } - /* printf("SURT de la creacio de la imatge %s ...",ig_path); */ - /* - sys_vgui("image create photo img%x -file %s\n",x,entrada); - sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", - glist_getcanvas(glist),text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,x); - */ + sprintf(nNstr, "%d", nN); + strcat(ig_path,nNstr); + strcat(ig_path,"."); + strcat(ig_path,FORMAT_MINIATURA); + /*printf("Creacio de la imatge %s ...",ig_path);*/ + sys_vgui("image create photo img%x%d -file %s\n",x,nN,ig_path); + /* printf("1. Creacio de la imatge %s ...",ig_path); */ + sys_vgui(".x%x.c create image %d %d -image img%x%d -tags %xS%d\n", + glist_getcanvas(x->x_glist), + text_xpix(&x->x_obj, x->x_glist) + getX(x,nN) + (W_CELL/2), + text_ypix(&x->x_obj, x->x_glist) + getY(x,nN) + (H_CELL/2), + x,nN,x,nN); + /* printf("2. Creacio de la imatge %s ...",ig_path); */ + if(nN == 0){ + x->x_tauler_primer = x->x_cua.final; + /* post("Ara el primer del tauler es %s\n",x->x_tauler_primer->pathFitxer); */ + } + /* printf("SURT de la creacio de la imatge %s ...",ig_path); */ + /* + sys_vgui("image create photo img%x -file %s\n",x,entrada); + sys_vgui(".x%x.c create image %d %d -image img%x -tags %xS\n", + glist_getcanvas(glist),text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),x,x); + */ + } }
/* dibuixa videogrid */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.