aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/help-pdp_ascii.pd67
-rw-r--r--doc/help-pdp_capture.pd8
-rw-r--r--doc/help-pdp_ffmpeg~.pd59
-rw-r--r--doc/help-pdp_mp4live~.pd100
-rw-r--r--doc/help-pdp_mp4player~.pd10
-rw-r--r--doc/help-pdp_ocanvas.pd6
-rw-r--r--doc/help-pdp_rec~.pd2
-rw-r--r--doc/help-pdp_streaming.pd22
-rw-r--r--doc/rs_pdp_live~.pd36
-rw-r--r--doc/rs_pdp_mp4player~.pd63
-rw-r--r--include/pdp_mp4player~.h8
-rw-r--r--modules/Makefile2
-rw-r--r--modules/Makefile.in2
-rw-r--r--modules/pdp_ascii.c153
-rw-r--r--modules/pdp_canvas.c8
-rw-r--r--modules/pdp_ffmpeg~.c2
-rw-r--r--modules/pdp_i.c2
-rw-r--r--modules/pdp_lumafilt.c2
-rw-r--r--modules/pdp_mp4audiosource.cpp45
-rw-r--r--modules/pdp_mp4audiosync.cpp289
-rw-r--r--modules/pdp_mp4live~.cpp32
-rw-r--r--modules/pdp_mp4player~.cpp24
-rw-r--r--modules/pdp_mp4videosync.cpp40
-rw-r--r--modules/pdp_ocanvas.c2
-rw-r--r--modules/pdp_vertigo.c2
-rw-r--r--patches/help_pdp_effects_rack.pd8
-rw-r--r--patches/pdp_cabaret.pd52
-rw-r--r--patches/pdp_charcoal.pd36
-rw-r--r--system/pidip.c2
29 files changed, 578 insertions, 506 deletions
diff --git a/doc/help-pdp_ascii.pd b/doc/help-pdp_ascii.pd
index 94e2290..d678c46 100644
--- a/doc/help-pdp_ascii.pd
+++ b/doc/help-pdp_ascii.pd
@@ -2,18 +2,17 @@
#X obj 268 64 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 123 136 loop \$1;
-#X obj 124 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
+#X obj 124 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1
1;
#X msg 370 44 open \$1;
#X obj 369 20 openpanel;
#X obj 354 3 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
-#X floatatom 316 99 5 0 0;
+#X floatatom 316 99 5 0 0 0 - - -;
#X msg 225 65 stop;
#X obj 323 68 hsl 300 15 0 1000 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
#X obj 257 135 metro 70;
-#X obj 346 203 pdp_v4l;
#X obj 355 172 metro 70;
#X obj 400 138 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
@@ -24,44 +23,56 @@
1;
#X obj 606 582 pdp_control;
#X msg 606 555 thread \$1;
-#X floatatom 606 643 5 0 0;
+#X floatatom 606 643 5 0 0 0 - - -;
#X obj 606 614 route pdp_drop;
#X text 226 604 written by Yves Degoyon (ydegoyon@free.fr);
#X text 225 589 pdp_aa : output images in ASCII art;
#X msg 302 347 color \$1;
#X obj 373 348 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
-#X text 393 347 activate/suppress colors;
-#X obj 191 413 pdp_ascii;
#X msg 302 372 brightness \$1;
-#X floatatom 404 373 5 0 0;
-#X text 452 374 increase brightness ( default 25 );
-#X floatatom 302 398 5 0 0;
-#X text 352 397 Character to pixel ratio;
+#X floatatom 404 373 5 0 0 0 - - -;
+#X floatatom 302 398 5 0 0 0 - - -;
#X obj 191 444 pdp_xv;
+#X obj 366 300 openpanel;
+#X obj 438 301 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X msg 304 300 load \$1;
+#X text 304 321 ( file with the same format than charmaps.dat );
+#X obj 191 413 pdp_ascii;
+#X text 352 397 Character to pixel ratio;
+#X text 452 374 Increase brightness ( default 25 );
+#X text 393 347 Activate/suppress colors;
+#X text 462 300 Load a characters map;
+#X obj 346 203 pdp_v4l;
+#X obj 95 307 pdp_scale 800 600;
#X connect 0 0 9 0;
-#X connect 1 0 15 0;
+#X connect 1 0 14 0;
#X connect 2 0 1 0;
-#X connect 3 0 15 0;
+#X connect 3 0 14 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 6 0 9 1;
#X connect 7 0 9 0;
#X connect 8 0 6 0;
-#X connect 9 0 15 0;
-#X connect 10 0 26 0;
+#X connect 9 0 14 0;
+#X connect 10 0 37 0;
#X connect 11 0 10 0;
-#X connect 12 0 11 0;
-#X connect 13 0 11 0;
-#X connect 14 0 10 0;
-#X connect 15 0 26 0;
-#X connect 16 0 18 0;
-#X connect 17 0 20 0;
-#X connect 18 0 17 0;
-#X connect 20 0 19 0;
-#X connect 23 0 26 0;
-#X connect 24 0 23 0;
-#X connect 26 0 32 0;
-#X connect 27 0 26 0;
-#X connect 28 0 27 0;
-#X connect 30 0 26 1;
+#X connect 12 0 10 0;
+#X connect 13 0 37 0;
+#X connect 14 0 38 0;
+#X connect 15 0 17 0;
+#X connect 16 0 19 0;
+#X connect 17 0 16 0;
+#X connect 19 0 18 0;
+#X connect 22 0 32 0;
+#X connect 23 0 22 0;
+#X connect 24 0 32 0;
+#X connect 25 0 24 0;
+#X connect 26 0 32 1;
+#X connect 28 0 30 0;
+#X connect 29 0 28 0;
+#X connect 30 0 32 0;
+#X connect 32 0 27 0;
+#X connect 37 0 38 0;
+#X connect 38 0 32 0;
diff --git a/doc/help-pdp_capture.pd b/doc/help-pdp_capture.pd
index cba441f..c8ed544 100644
--- a/doc/help-pdp_capture.pd
+++ b/doc/help-pdp_capture.pd
@@ -26,6 +26,10 @@
#X text 332 226 Height ( default : 240 );
#X floatatom 174 109 5 0 0 0 - - -;
#X msg 218 101 display 158.37.56.31:0;
+#X obj 287 377 pdp_ffmpeg~;
+#X msg 364 317 feed http://www.xicnet.com:8000/feed1.ffm;
+#X floatatom 300 423 5 0 0 0 - - -;
+#X floatatom 263 402 5 0 0 0 - - -;
#X connect 1 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 2 0;
@@ -38,7 +42,11 @@
#X connect 13 0 18 0;
#X connect 14 0 19 0;
#X connect 17 0 0 0;
+#X connect 17 0 26 0;
#X connect 18 0 19 0;
#X connect 19 0 17 0;
#X connect 24 0 18 1;
#X connect 25 0 19 0;
+#X connect 26 0 29 0;
+#X connect 26 1 28 0;
+#X connect 27 0 26 0;
diff --git a/doc/help-pdp_ffmpeg~.pd b/doc/help-pdp_ffmpeg~.pd
index dd0819a..5b9f10a 100644
--- a/doc/help-pdp_ffmpeg~.pd
+++ b/doc/help-pdp_ffmpeg~.pd
@@ -26,7 +26,7 @@
#X floatatom 606 643 5 0 0 0 - - -;
#X obj 606 614 route pdp_drop;
#X text 82 562 written by Yves Degoyon (ydegoyon@free.fr);
-#X text 631 358 Set and open the feed;
+#X text 657 358 Set and open the feed;
#X floatatom 193 439 5 0 0 0 - - -;
#X text 241 440 Streaming status;
#X floatatom 229 462 5 0 0 0 - - -;
@@ -50,30 +50,32 @@ server;
1;
#X obj 171 309 adc~;
#X obj 504 284 dac~;
-#X obj 501 251 spigot~;
#X obj 684 223 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 548 223 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X msg 674 285 close;
-#X msg 317 358 feed http://online.loeil.org:8090/feed1.ffm;
-#X msg 318 415 feed http://localhost:8090/feed1.ffm;
#X obj 193 413 pdp_ffmpeg~;
#X floatatom 306 505 5 0 0 0 - - -;
#X text 352 505 Emission framerate;
#X obj 282 199 pdp_yqt;
+#X obj 501 251 spigot~;
+#X floatatom 128 194 5 0 0 0 - - -;
+#X obj 122 273 pdp_affine;
+#X msg 319 358 feed http://www.xicnet.com:8000/feed1.ffm;
+#X msg 318 415 feed http://localhost:8090/feed1.ffm;
#X connect 0 0 9 0;
-#X connect 1 0 49 0;
+#X connect 1 0 46 0;
#X connect 2 0 1 0;
-#X connect 3 0 49 0;
+#X connect 3 0 46 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 6 0 9 1;
#X connect 7 0 9 0;
#X connect 8 0 6 0;
-#X connect 9 0 49 0;
+#X connect 9 0 46 0;
#X connect 10 0 36 0;
-#X connect 10 0 46 0;
+#X connect 10 0 49 0;
#X connect 11 0 10 0;
#X connect 12 0 11 0;
#X connect 13 0 11 0;
@@ -82,24 +84,27 @@ server;
#X connect 16 0 19 0;
#X connect 17 0 16 0;
#X connect 19 0 18 0;
-#X connect 27 0 46 0;
+#X connect 27 0 43 0;
#X connect 36 1 35 0;
#X connect 37 0 36 1;
-#X connect 38 0 46 0;
-#X connect 38 1 46 1;
-#X connect 40 1 39 1;
-#X connect 40 1 39 0;
-#X connect 42 0 40 1;
-#X connect 43 0 35 0;
-#X connect 44 0 46 0;
-#X connect 45 0 46 0;
-#X connect 46 0 22 0;
-#X connect 46 1 24 0;
-#X connect 46 2 29 0;
-#X connect 46 3 47 0;
-#X connect 49 0 36 0;
-#X connect 49 0 46 0;
-#X connect 49 4 40 0;
-#X connect 49 4 46 0;
-#X connect 49 5 40 0;
-#X connect 49 5 46 1;
+#X connect 38 0 43 0;
+#X connect 38 1 43 1;
+#X connect 41 0 47 1;
+#X connect 42 0 35 0;
+#X connect 43 0 22 0;
+#X connect 43 1 24 0;
+#X connect 43 2 29 0;
+#X connect 43 3 44 0;
+#X connect 46 0 36 0;
+#X connect 46 0 43 0;
+#X connect 46 4 43 0;
+#X connect 46 4 47 0;
+#X connect 46 5 43 1;
+#X connect 46 5 47 0;
+#X connect 47 1 39 1;
+#X connect 47 1 39 0;
+#X connect 48 0 49 1;
+#X connect 49 0 43 0;
+#X connect 49 0 35 0;
+#X connect 50 0 43 0;
+#X connect 51 0 43 0;
diff --git a/doc/help-pdp_mp4live~.pd b/doc/help-pdp_mp4live~.pd
index d87d9e3..3efd145 100644
--- a/doc/help-pdp_mp4live~.pd
+++ b/doc/help-pdp_mp4live~.pd
@@ -2,7 +2,7 @@
#X obj 268 64 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 93 136 loop \$1;
-#X obj 94 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1 1
+#X obj 94 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1
;
#X msg 123 92 open \$1;
#X obj 122 68 openpanel;
@@ -14,7 +14,6 @@
-1 -1 0 1;
#X obj 257 134 metro 70;
#X obj 365 156 pdp_v4l;
-#X obj 374 125 metro 70;
#X obj 419 91 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 376 92 stop;
@@ -41,7 +40,6 @@
;
#X msg 109 316 close;
#X text 32 162 Local echoes;
-#X text 81 579 pdp_mp4live~ : mpeg4ip streaming emitter;
#X text 0 390 Start the streaming;
#X text 1 409 Stop the streaming;
#X msg 142 411 disconnect;
@@ -71,59 +69,67 @@
#X text 338 540 Frame Rate;
#X obj 220 470 pdp_mp4live~;
#X msg 366 436 sdp /usr/local/movies/pdstream.sdp;
-#X text 81 604 The rest is written by Yves Degoyon (ydegoyon@free.fr)
+#X text 81 625 The rest is written by Yves Degoyon (ydegoyon@free.fr)
;
-#X text 80 592 This object uses some code from mpeg4ip;
+#X text 81 611 This object uses some code from mpeg4ip;
#X msg 362 208 ipaddr 213.56.149.35;
#X obj 207 200 pdp_scale 320 240;
#X obj 273 231 adc~;
-#X msg 366 289 vwidth 320;
#X obj 54 282 pdp_spigot;
+#X obj 123 477 osc~ 440;
+#X text 83 597 ( to a quicktime or darwin server );
+#X text 85 583 pdp_mp4live~ : mpeg4ip stream emitter;
+#X obj 374 125 metro 70;
+#X msg 366 289 vwidth 160;
#X connect 0 0 9 0;
-#X connect 1 0 14 0;
+#X connect 1 0 13 0;
#X connect 2 0 1 0;
-#X connect 3 0 14 0;
+#X connect 3 0 13 0;
#X connect 4 0 3 0;
#X connect 5 0 4 0;
#X connect 6 0 9 1;
#X connect 7 0 9 0;
#X connect 8 0 6 0;
-#X connect 9 0 14 0;
-#X connect 10 0 60 0;
-#X connect 10 0 68 0;
-#X connect 11 0 10 0;
-#X connect 12 0 11 0;
-#X connect 13 0 11 0;
-#X connect 14 0 65 0;
-#X connect 14 0 68 0;
-#X connect 14 4 28 0;
-#X connect 14 5 28 0;
-#X connect 15 0 17 0;
-#X connect 16 0 19 0;
-#X connect 17 0 16 0;
-#X connect 19 0 18 0;
-#X connect 26 0 68 1;
-#X connect 28 1 27 1;
-#X connect 28 1 27 0;
-#X connect 30 0 28 1;
-#X connect 31 0 25 0;
-#X connect 36 0 60 0;
-#X connect 37 0 60 0;
-#X connect 39 0 60 0;
-#X connect 40 0 60 0;
-#X connect 44 0 60 0;
-#X connect 48 0 60 0;
-#X connect 50 0 60 0;
-#X connect 53 0 60 0;
-#X connect 54 0 60 0;
-#X connect 57 0 60 0;
-#X connect 60 0 20 0;
-#X connect 60 1 22 0;
-#X connect 60 2 24 0;
-#X connect 61 0 60 0;
-#X connect 64 0 60 0;
-#X connect 65 0 60 0;
-#X connect 66 0 60 0;
-#X connect 66 1 60 1;
-#X connect 67 0 60 0;
-#X connect 68 1 25 0;
+#X connect 9 0 13 0;
+#X connect 10 0 58 0;
+#X connect 10 0 65 0;
+#X connect 11 0 69 0;
+#X connect 12 0 69 0;
+#X connect 13 0 63 0;
+#X connect 13 0 65 0;
+#X connect 13 4 27 0;
+#X connect 13 4 58 0;
+#X connect 13 5 27 0;
+#X connect 13 5 58 1;
+#X connect 14 0 16 0;
+#X connect 15 0 18 0;
+#X connect 16 0 15 0;
+#X connect 18 0 17 0;
+#X connect 25 0 65 1;
+#X connect 27 1 26 1;
+#X connect 27 1 26 0;
+#X connect 29 0 27 1;
+#X connect 30 0 24 0;
+#X connect 34 0 58 0;
+#X connect 35 0 58 0;
+#X connect 37 0 58 0;
+#X connect 38 0 58 0;
+#X connect 42 0 58 0;
+#X connect 46 0 58 0;
+#X connect 48 0 58 0;
+#X connect 51 0 58 0;
+#X connect 52 0 58 0;
+#X connect 55 0 58 0;
+#X connect 58 0 19 0;
+#X connect 58 1 21 0;
+#X connect 58 2 23 0;
+#X connect 59 0 58 0;
+#X connect 62 0 58 0;
+#X connect 63 0 58 0;
+#X connect 64 0 58 0;
+#X connect 64 1 58 1;
+#X connect 65 1 24 0;
+#X connect 66 0 58 0;
+#X connect 66 0 58 1;
+#X connect 69 0 10 0;
+#X connect 70 0 58 0;
diff --git a/doc/help-pdp_mp4player~.pd b/doc/help-pdp_mp4player~.pd
index d9935cb..9b12904 100644
--- a/doc/help-pdp_mp4player~.pd
+++ b/doc/help-pdp_mp4player~.pd
@@ -4,14 +4,14 @@
#X text 279 128 where the block size is redefined;
#X text 279 143 this is necessary for an;
#X text 280 155 ( acceptable? ) audio decoding;
-#X obj 395 221 loadbang;
#X msg 395 251 \; pd dsp 1;
#X text 51 295 pdp_mp4player~ : decodes a mpeg4ip video stream;
-#X text 51 308 ( from darwin or quicktime server );
#X obj 128 113 rs_pdp_mp4player~;
#X text 50 333 The rest is written by Yves Degoyon (ydegoyon@free.fr)
;
#X text 51 321 This object uses some code from mpeg4ip;
-#X connect 5 0 6 0;
-#X connect 9 0 0 0;
-#X connect 9 1 0 1;
+#X text 51 308 ( from a darwin or quicktime server );
+#X obj 395 221 loadbang;
+#X connect 7 0 0 0;
+#X connect 7 1 0 1;
+#X connect 11 0 5 0;
diff --git a/doc/help-pdp_ocanvas.pd b/doc/help-pdp_ocanvas.pd
index 8d9c989..2069ead 100644
--- a/doc/help-pdp_ocanvas.pd
+++ b/doc/help-pdp_ocanvas.pd
@@ -1,4 +1,4 @@
-#N canvas 507 -5 828 668 10;
+#N canvas 507 0 828 668 10;
#X obj 227 100 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 123 139 loop \$1;
@@ -33,7 +33,7 @@ overlay;
#X obj 470 99 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 366 138 loop \$1;
-#X obj 367 116 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1
+#X obj 367 116 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
1;
#X msg 362 79 open \$1;
#X obj 361 55 openpanel;
@@ -97,6 +97,7 @@ overlay;
#X msg 96 417 dim 640 480;
#X obj 228 449 pdp_scale 320 240;
#X msg 105 446 cursor 1;
+#X obj 358 315 pdp_i 5000;
#X connect 0 0 7 0;
#X connect 1 0 8 0;
#X connect 2 0 1 0;
@@ -170,3 +171,4 @@ overlay;
#X connect 78 0 77 0;
#X connect 79 0 77 0;
#X connect 80 0 77 0;
+#X connect 81 0 76 3;
diff --git a/doc/help-pdp_rec~.pd b/doc/help-pdp_rec~.pd
index ffbf1b7..89b1e64 100644
--- a/doc/help-pdp_rec~.pd
+++ b/doc/help-pdp_rec~.pd
@@ -2,7 +2,7 @@
#X obj 255 34 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 117 65 loop \$1;
-#X obj 117 40 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1
+#X obj 117 40 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1 1
;
#X msg 280 33 open \$1;
#X obj 342 33 openpanel;
diff --git a/doc/help-pdp_streaming.pd b/doc/help-pdp_streaming.pd
index 9615b13..f8a26ad 100644
--- a/doc/help-pdp_streaming.pd
+++ b/doc/help-pdp_streaming.pd
@@ -9,7 +9,7 @@
#X obj 149 21 openpanel;
#X obj 134 4 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
-#X floatatom 287 66 5 0 0;
+#X floatatom 287 66 5 0 0 0 - - -;
#X msg 227 66 stop;
#X obj 233 92 metro 70;
#X text 386 588 written by Yves Degoyon ( ydegoyon@free.fr );
@@ -19,36 +19,36 @@
#X msg 267 179 disconnect;
#X msg 267 202 start;
#X msg 267 227 stop;
-#X floatatom 203 492 5 0 0;
+#X floatatom 203 492 5 0 0 0 - - -;
#X obj 145 443 pdp_i 4578;
-#X floatatom 180 512 5 0 0;
+#X floatatom 180 512 5 0 0 0 - - -;
#X text 229 512 Connection state;
#X text 249 492 Number of frames received;
-#X symbolatom 220 470 10 0 0;
+#X symbolatom 220 470 10 0 0 0 - - -;
#X text 301 472 Address of the emitter;
#X msg 267 253 refresh;
#X msg 267 279 framerate \$1;
-#X floatatom 366 280 5 0 0;
+#X floatatom 366 280 5 0 0 0 - - -;
#X text 411 280 Emission frame rate;
-#X floatatom 136 406 5 0 0;
+#X floatatom 136 406 5 0 0 0 - - -;
#X text 188 407 Connection state;
-#X floatatom 165 386 7 0 0;
+#X floatatom 165 386 7 0 0 0 - - -;
#X text 223 384 Frames emitted;
-#X floatatom 190 362 7 0 0;
+#X floatatom 190 362 7 0 0 0 - - -;
#X text 250 360 Frames dropped;
#X obj 571 390 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 571 442 pdp_control;
#X msg 571 415 thread \$1;
-#X floatatom 571 503 5 0 0;
+#X floatatom 571 503 5 0 0 0 - - -;
#X obj 571 474 route pdp_drop;
#X text 385 569 pdp_o/pdp_i : PDP packets streaming;
-#X floatatom 366 302 5 0 0;
+#X floatatom 366 302 5 0 0 0 - - -;
#X msg 267 301 smoothing \$1;
#X text 411 302 Smoothing factor;
#X text 413 242 The bandwidth used can be controlled;
#X text 413 255 by changing these two parameters :;
-#X floatatom 207 341 5 0 0;
+#X floatatom 207 341 5 0 0 0 - - -;
#X text 259 340 Bandwidth (in kb);
#X connect 1 0 9 0;
#X connect 2 0 11 0;
diff --git a/doc/rs_pdp_live~.pd b/doc/rs_pdp_live~.pd
index 387d943..50f6b80 100644
--- a/doc/rs_pdp_live~.pd
+++ b/doc/rs_pdp_live~.pd
@@ -34,13 +34,11 @@
#X text 348 298 Activate decoding of audio ( default : off );
#X obj 247 200 makefilename file://%s;
#X msg 9 388 autocreate 1;
-#X msg 246 78 connect http://www.hackitectura.net:8090/test2.mpg;
#X msg 244 52 connect http://localhost:8090/test1.mpg;
#X obj 65 61 block~ 1024;
#X obj 322 261 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X msg 248 259 thread \$1;
-#X obj 113 374 pdp_live~;
#X obj 378 259 loadbang;
#X msg 343 259 1;
#X text 449 259 Activate threading ( default : on );
@@ -48,26 +46,28 @@
#X text 306 430 Reception framerate;
#X text 333 411 End of stream reached;
#X floatatom 287 409 5 0 0 0 - - -;
-#X connect 7 0 36 0;
-#X connect 13 0 36 0;
+#X msg 246 78 connect http://gollum.artefacte.org:8090/osas.mpg;
+#X obj 113 374 pdp_live~;
+#X connect 7 0 43 0;
+#X connect 13 0 43 0;
#X connect 14 0 13 0;
-#X connect 20 0 36 0;
+#X connect 20 0 43 0;
#X connect 24 0 25 0;
#X connect 25 0 29 0;
-#X connect 26 0 36 0;
+#X connect 26 0 43 0;
#X connect 27 0 26 0;
#X connect 29 0 20 0;
#X connect 30 0 4 0;
-#X connect 31 0 36 0;
-#X connect 32 0 36 0;
-#X connect 34 0 35 0;
+#X connect 31 0 43 0;
+#X connect 33 0 34 0;
+#X connect 34 0 43 0;
#X connect 35 0 36 0;
-#X connect 36 0 4 0;
-#X connect 36 1 16 0;
-#X connect 36 2 17 0;
-#X connect 36 3 1 0;
-#X connect 36 4 3 0;
-#X connect 36 5 40 0;
-#X connect 36 6 43 0;
-#X connect 37 0 38 0;
-#X connect 38 0 34 0;
+#X connect 36 0 33 0;
+#X connect 42 0 43 0;
+#X connect 43 0 4 0;
+#X connect 43 1 16 0;
+#X connect 43 2 17 0;
+#X connect 43 3 1 0;
+#X connect 43 4 3 0;
+#X connect 43 5 38 0;
+#X connect 43 6 41 0;
diff --git a/doc/rs_pdp_mp4player~.pd b/doc/rs_pdp_mp4player~.pd
index 4981102..9d544ab 100644
--- a/doc/rs_pdp_mp4player~.pd
+++ b/doc/rs_pdp_mp4player~.pd
@@ -1,29 +1,20 @@
-#N canvas 168 29 842 529 10;
-#X text 460 551 written by Yves Degoyon (ydegoyon@free.fr);
-#X floatatom 226 441 5 0 0 0 - - -;
-#X text 272 440 Streaming status;
-#X floatatom 221 419 5 0 0 0 - - -;
+#N canvas 168 29 837 579 10;
+#X text 460 540 written by Yves Degoyon (ydegoyon@free.fr);
+#X floatatom 305 462 5 0 0 0 - - -;
+#X text 351 461 Streaming status;
+#X floatatom 300 440 5 0 0 0 - - -;
#X obj 36 449 pdp_xv;
#X text 321 185 Disconnect from the current stream;
#X msg 243 183 disconnect;
-#X text 270 420 Number of video frames decoded;
-#X text 457 527 ( at least from ffserver );
-#X text 23 547 NOTE : as for pdp_ffmpeg~ \, transmitting audio;
-#X text 22 565 with the video stream produces some unsteady sound;
-#X text 23 580 a prefered solution would be to use mp3cast~/mp3amp~
-;
+#X text 349 441 Number of video frames decoded;
#X obj 70 493 outlet~;
#X obj 146 486 outlet~;
#X obj 65 60 block~ 4096;
-#X text 460 513 pdp_live~ : decodes a live video stream;
-#X text 458 539 and reads most common files ( avi \, mpg \, .... )
-;
#X msg 245 243 audio \$1;
-#X obj 314 245 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+#X obj 314 245 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X text 345 245 Activate decoding of audio ( default : off );
-#X msg 240 125 connect rtsp://ayp.unia.es/pdstream.sdp;
-#X text 529 126 Connect to a mpeg4ip stream;
+#X text 591 123 Connect to a mpeg4ip stream;
#X msg 244 213 overtcp \$1;
#X text 358 215 Use RTP over RTSP (TCP);
#X obj 330 215 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
@@ -39,19 +30,25 @@
#X msg 244 322 vwidth 320;
#X text 339 324 Set video width ( default : 320 );
#X text 339 344 Set video height ( default : 240 );
-#X connect 6 0 31 0;
-#X connect 17 0 31 0;
-#X connect 18 0 17 0;
-#X connect 20 0 31 0;
-#X connect 22 0 31 0;
-#X connect 24 0 22 0;
-#X connect 25 0 31 0;
-#X connect 26 0 25 0;
-#X connect 30 0 31 0;
-#X connect 31 0 4 0;
-#X connect 31 1 12 0;
-#X connect 31 2 13 0;
-#X connect 31 3 1 0;
-#X connect 31 4 3 0;
-#X connect 32 0 31 0;
-#X connect 33 0 31 0;
+#X floatatom 286 416 5 0 0 0 - - -;
+#X text 334 416 Reception frame rate;
+#X text 460 513 pdp_mp4player~ : decodes a quicktime video stream;
+#X msg 240 125 connect rtsp://sputnik.psand.net:554/anyware.sdp;
+#X text 457 527 ( at least from a darwin server );
+#X connect 6 0 24 0;
+#X connect 11 0 24 0;
+#X connect 12 0 11 0;
+#X connect 15 0 24 0;
+#X connect 17 0 15 0;
+#X connect 18 0 24 0;
+#X connect 19 0 18 0;
+#X connect 23 0 24 0;
+#X connect 24 0 4 0;
+#X connect 24 1 8 0;
+#X connect 24 2 9 0;
+#X connect 24 3 1 0;
+#X connect 24 4 3 0;
+#X connect 24 5 29 0;
+#X connect 25 0 24 0;
+#X connect 26 0 24 0;
+#X connect 32 0 24 0;
diff --git a/include/pdp_mp4player~.h b/include/pdp_mp4player~.h
index 05e6d14..412dff5 100644
--- a/include/pdp_mp4player~.h
+++ b/include/pdp_mp4player~.h
@@ -54,7 +54,7 @@ typedef struct pdp_mp4player_struct t_pdp_mp4player;
#include "pdp_mp4videosource.h"
#include "pdp_mp4audiosource.h"
-#define DEFAULT_CHANNELS 1
+#define DEFAULT_CHANNELS 2
#define MIN_PRIORITY -20
#define DEFAULT_PRIORITY 0
#define MAX_PRIORITY 20
@@ -69,7 +69,7 @@ typedef struct pdp_mp4player_struct
t_object x_obj;
t_float x_f;
- t_int x_packet0;
+ t_int x_packet;
t_int x_dropped;
t_pdp *x_header;
@@ -93,6 +93,7 @@ typedef struct pdp_mp4player_struct
t_int x_samplerate; // audio sample rate
t_int x_audiochannels; // audio channels
t_int x_audioon; // enough audio data to start playing
+ t_int x_blocksize; // audio block size
struct timeval x_starttime; // streaming starting time
t_int x_cursec; // current second
t_int x_secondcount; // number of frames received in the current second
@@ -100,9 +101,10 @@ typedef struct pdp_mp4player_struct
t_int x_priority; // priority of decoding thread
t_int x_newpicture; // flag indicating a new picture
+ short int *x_datav; // video data from mpeg4hippies
+
/* audio structures */
t_int x_audio; // flag to activate the decoding of audio
- short x_audio_buf[4*MAX_AUDIO_PACKET_SIZE]; /* buffer for audio from stream*/
short x_audio_in[4*MAX_AUDIO_PACKET_SIZE]; /* buffer for resampled PCM audio */
t_int x_audioin_position; // writing position for incoming audio
diff --git a/modules/Makefile b/modules/Makefile
index 5d93176..1bca11a 100644
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -15,7 +15,7 @@ OBJECTS = pdp_intrusion.o pdp_yqt.o pdp_simura.o pdp_underwatch.o \
pdp_capture.o pdp_smuck.o pdp_lumafilt.o \
pdp_transition.o pdp_imgloader.o pdp_imgsaver.o pdp_cache.o \
pdp_canvas.o pdp_pen.o pdp_shape.o pdp_fqt.o pdp_fcqt.o \
- pdp_ocanvas.o pdp_spotlight.o pdp_live~.o pdp_ffmpeg~.o
+ pdp_ocanvas.o pdp_spotlight.o pdp_colorgrid.o pdp_live~.o pdp_ffmpeg~.o
# pdp_xcanvas.o pdp_aa.o
all_modules: $(OBJECTS)
diff --git a/modules/Makefile.in b/modules/Makefile.in
index 0b221e6..7d9daad 100644
--- a/modules/Makefile.in
+++ b/modules/Makefile.in
@@ -15,7 +15,7 @@ OBJECTS = pdp_intrusion.o pdp_yqt.o pdp_simura.o pdp_underwatch.o \
pdp_capture.o pdp_smuck.o pdp_lumafilt.o \
pdp_transition.o pdp_imgloader.o pdp_imgsaver.o pdp_cache.o \
pdp_canvas.o pdp_pen.o pdp_shape.o pdp_fqt.o pdp_fcqt.o \
- pdp_ocanvas.o pdp_spotlight.o @PDP_STREAMING_OBJECTS@
+ pdp_ocanvas.o pdp_spotlight.o pdp_colorgrid.o @PDP_STREAMING_OBJECTS@
# pdp_xcanvas.o pdp_aa.o
all_modules: $(OBJECTS)
diff --git a/modules/pdp_ascii.c b/modules/pdp_ascii.c
index cf7f77a..a43956c 100644
--- a/modules/pdp_ascii.c
+++ b/modules/pdp_ascii.c
@@ -25,9 +25,11 @@
#include "pdp.h"
#include "yuv.h"
-#include "charmaps.h"
+#include "default.map"
#include <math.h>
+#define LINE_MAX_LENGTH 1024
+
static char *pdp_ascii_version = "pdp_ascii: version 0.1, ASCII art output written by ydegoyon@free.fr";
typedef struct pdp_ascii_struct
@@ -49,6 +51,13 @@ typedef struct pdp_ascii_struct
t_int x_brightness; // added value for brightness
t_float x_ratio; // character to pixel ratio
+ t_int x_charwidth; // width of characters
+ t_int x_charheight; // height of characters
+ t_int x_nbchars; // number of characters in the map
+ char* x_charmaps; // the table of characters
+
+ FILE *x_filed; // charmaps file descriptor
+
} t_pdp_ascii;
static void pdp_ascii_color(t_pdp_ascii *x, t_floatarg fcolor)
@@ -61,9 +70,12 @@ static void pdp_ascii_color(t_pdp_ascii *x, t_floatarg fcolor)
static void pdp_ascii_ratio(t_pdp_ascii *x, t_floatarg fratio)
{
- if ( ( fratio > 0) && ( x->x_ratio < x->x_vwidth/2 ) )
+ if ( ( fratio > 0)
+ && ( fratio < x->x_vwidth/x->x_charwidth )
+ && ( fratio < x->x_vheight/x->x_charheight ) )
{
x->x_ratio = fratio;
+ // post( "psp_ascii : set ratio : %f", x->x_ratio );
}
}
@@ -84,7 +96,7 @@ static void pdp_ascii_process_yv12(t_pdp_ascii *x)
t_int i, pixsum;
t_int px, py, ppx, ppy;
t_int rank, value;
- t_int pwidth, pheight;
+ t_int pwidth, pheight, offset;
x->x_vwidth = header->info.image.width;
x->x_vheight = header->info.image.height;
@@ -96,14 +108,16 @@ static void pdp_ascii_process_yv12(t_pdp_ascii *x)
memset( newdata, 0x00, (x->x_vsize+(x->x_vsize>>1))<<1 );
- pwidth = (int) CHARWIDTH*x->x_ratio;
+ pwidth = (int) x->x_charwidth*x->x_ratio;
if (pwidth==0) pwidth=1;
- if (pwidth>x->x_vwidth) return;
- pheight = (int) CHARHEIGHT*x->x_ratio;
+ // if (pwidth>x->x_vwidth) return;
+ pheight = (int) x->x_charheight*x->x_ratio;
if (pheight==0) pheight=1;
- if (pheight>x->x_vheight) return;
+ // if (pheight>x->x_vheight) return;
- for(py=1; py<x->x_vheight; py+=pheight)
+ // post( "psp_ascii : pwidth=%d, pheight=%d", pwidth, pheight );
+
+ for(py=0; py<x->x_vheight; py+=pheight)
{
for(px=0; px<x->x_vwidth; px+=pwidth)
{
@@ -112,6 +126,11 @@ static void pdp_ascii_process_yv12(t_pdp_ascii *x)
{
for ( ppx=0; ppx<pwidth; ppx++ )
{
+ if ( ( px+ppx >= x->x_vwidth ) ||
+ ( py+ppy >= x->x_vheight ) )
+ {
+ break;
+ }
pixsum += (data[(py+ppy)*x->x_vwidth + (px+ppx)]>>7);
}
}
@@ -120,12 +139,14 @@ static void pdp_ascii_process_yv12(t_pdp_ascii *x)
{
for ( ppx=0; ppx<pwidth; ppx++ )
{
- if ( ( px+ppx > x->x_vwidth ) ||
- ( py+ppy > x->x_vheight ) )
+ if ( ( px+ppx >= x->x_vwidth ) ||
+ ( py+ppy >= x->x_vheight ) )
{
break;
}
- if ( charmaps[rank][((int)(ppy/x->x_ratio))*CHARWIDTH+((int)(ppx/x->x_ratio))] )
+ offset = rank*x->x_charwidth*x->x_charheight
+ +((int)(ppy/x->x_ratio))*x->x_charwidth+((int)(ppx/x->x_ratio));
+ if ( *(x->x_charmaps+offset) && ( offset < x->x_nbchars*x->x_charwidth*x->x_charheight ) )
{
value = ( (2*rank+x->x_brightness) > 255 ) ? 255 : (2*rank+x->x_brightness);
newdata[(py+ppy)*x->x_vwidth+(px+ppx)] = (value)<<7;
@@ -209,10 +230,113 @@ static void pdp_ascii_free(t_pdp_ascii *x)
{
int i;
+ if ( x->x_charmaps ) free( x->x_charmaps );
pdp_queue_finish(x->x_queue_id);
pdp_packet_mark_unused(x->x_packet0);
}
+ /* load a new charmaps file */
+static void pdp_ascii_load(t_pdp_ascii *x, t_symbol *sfile)
+{
+ char *lineread = (char*) getbytes( LINE_MAX_LENGTH );
+ char *word1 = (char*) getbytes( LINE_MAX_LENGTH );
+ char *word2 = (char*) getbytes( LINE_MAX_LENGTH );
+ char *word3 = (char*) getbytes( LINE_MAX_LENGTH );
+ t_int charwidth, charheight, nbchars, nblines;
+ t_int nbexpdata;
+ char *pdata;
+ char charread;
+
+ // opening new charmaps file
+ if ( ( x->x_filed = fopen( sfile->s_name, "r" ) ) == NULL )
+ {
+ error( "pdp_ascii : cannot open >%s<", sfile->s_name);
+ return;
+ }
+ post( "pdp_ascii : opened >%s<", sfile->s_name);
+
+ // read the new dimensions of the charmaps
+ charwidth = -1;
+ charheight = -1;
+ nbchars = -1;
+ nblines = 0;
+ while ( lineread[0] != '{' )
+ {
+ if ( fgets( lineread, LINE_MAX_LENGTH, x->x_filed ) == 0 )
+ {
+ post( "pdp_ascii : abnormal end of file encountered..." );
+ goto closeandreturn;
+ }
+
+ if ( strncmp( lineread, "#define", 7 ) == 0 )
+ {
+ sscanf( lineread, "%s %s %s", word1, word2, word3 );
+ // post( "pdp_ascii : definition : %s = %s", word2, word3 );
+ if ( !strcmp( word2, "CHARWIDTH" ) )
+ {
+ charwidth = atoi( word3 );
+ }
+ if ( !strcmp( word2, "CHARHEIGHT" ) )
+ {
+ charheight = atoi( word3 );
+ }
+ if ( !strcmp( word2, "NBCHARS" ) )
+ {
+ nbchars = atoi( word3 );
+ }
+ }
+
+ nblines++;
+ if ( nblines>20 ) break;
+ }
+
+ if ( ( charwidth > 0 ) && ( charheight > 0 ) && ( nbchars > 0 ) )
+ {
+ post( "pdp_ascii : new dimensions : %d %dx%d characters", nbchars, charwidth, charheight );
+ if ( x->x_charmaps ) free( x->x_charmaps );
+ x->x_charwidth = charwidth;
+ x->x_charheight = charheight;
+ x->x_nbchars = nbchars;
+ x->x_charmaps = (char*)malloc(x->x_nbchars*x->x_charwidth*x->x_charheight*sizeof(char));
+ }
+ else
+ {
+ post( "pdp_ascii : wrong file format : couldn't read new dimensions" );
+ goto closeandreturn;
+ }
+
+ nbexpdata = nbchars*charwidth*charheight;
+ pdata = x->x_charmaps;
+
+ while ( ( ( charread = fgetc( x->x_filed ) ) != EOF ) && ( nbexpdata > 0 ) )
+ {
+ switch ( charread )
+ {
+ case '0':
+ case '1':
+ *pdata++ = ( charread == '0' )?0:1;
+ nbexpdata--;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+closeandreturn :
+
+ // closing opened file
+ if ( x->x_filed != NULL )
+ {
+ if(fclose(x->x_filed) < 0)
+ {
+ perror( "pdp_ascii : closing file" );
+ }
+ x->x_filed = NULL;
+ return;
+ }
+}
+
t_class *pdp_ascii_class;
void *pdp_ascii_new(void)
@@ -230,6 +354,12 @@ void *pdp_ascii_new(void)
x->x_ratio = 1.;
x->x_brightness = 25;
+ x->x_charwidth = CHARWIDTH;
+ x->x_charheight = CHARHEIGHT;
+ x->x_nbchars = NBCHARS;
+ x->x_charmaps = (char*)malloc(x->x_nbchars*x->x_charwidth*x->x_charheight*sizeof(char));
+ memcpy( (void*)x->x_charmaps, (void*)charmaps, x->x_nbchars*x->x_charwidth*x->x_charheight*sizeof(char) );
+
return (void *)x;
}
@@ -250,6 +380,7 @@ void pdp_ascii_setup(void)
class_addmethod(pdp_ascii_class, (t_method)pdp_ascii_color, gensym("color"), A_DEFFLOAT, A_NULL);
class_addmethod(pdp_ascii_class, (t_method)pdp_ascii_brightness, gensym("brightness"), A_DEFFLOAT, A_NULL);
class_addmethod(pdp_ascii_class, (t_method)pdp_ascii_ratio, gensym("ratio"), A_DEFFLOAT, A_NULL);
+ class_addmethod( pdp_ascii_class, (t_method)pdp_ascii_load, gensym("load"), A_SYMBOL, 0);
class_sethelpsymbol( pdp_ascii_class, gensym("pdp_ascii.pd") );
}
diff --git a/modules/pdp_canvas.c b/modules/pdp_canvas.c
index a099da1..587811e 100644
--- a/modules/pdp_canvas.c
+++ b/modules/pdp_canvas.c
@@ -41,6 +41,7 @@ typedef struct pdp_canvas_struct
t_int x_queue_id;
t_int x_opacket;
+ t_int x_lastpacket;
t_int x_current;
t_float x_xmouse;
@@ -139,6 +140,7 @@ static void pdp_canvas_process_yv12(t_pdp_canvas *x)
memcpy( pV+((py>>1)*(x->x_owidth>>1))+((t_int)(x->x_xoffsets[ii]+mx)>>1),
ppV+((py-(t_int)x->x_yoffsets[ii])>>1)*(x->x_widths[ii]>>1)+(mx>>1), dx );
}
+
}
}
@@ -241,10 +243,10 @@ static void pdp_canvas_input(t_pdp_canvas *x, t_symbol *s, t_floatarg f, t_int n
if (s== gensym("register_rw"))
{
- /* release the packet */
if ( x->x_packets[ni] != -1 )
- {
- pdp_packet_mark_unused(x->x_packets[ni]);
+ {
+ // delete the packet
+ pdp_packet_delete(x->x_packets[ni]);
x->x_packets[ni] = -1;
}
x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packets[ni], (int)f, pdp_gensym("image/YCrCb/*") );
diff --git a/modules/pdp_ffmpeg~.c b/modules/pdp_ffmpeg~.c
index 5669e96..58cdd61 100644
--- a/modules/pdp_ffmpeg~.c
+++ b/modules/pdp_ffmpeg~.c
@@ -601,7 +601,7 @@ static t_int *pdp_ffmpeg_perform(t_int *w)
x->x_audioin_position=(x->x_audioin_position+1)%(2*MAX_AUDIO_PACKET_SIZE);
if ( x->x_audioin_position == 2*MAX_AUDIO_PACKET_SIZE-1 )
{
- post( "pdp_ffmpeg~ : reaching end of audio buffer" );
+ // post( "pdp_ffmpeg~ : reaching end of audio buffer" );
}
}
diff --git a/modules/pdp_i.c b/modules/pdp_i.c
index d7d4b2f..e18a077 100644
--- a/modules/pdp_i.c
+++ b/modules/pdp_i.c
@@ -204,7 +204,7 @@ static void pdp_i_recv(t_pdp_i *x)
// check we don't overflow input buffer
if ( x->x_inwriteposition+ret >= x->x_inbuffersize )
{
- // post( "pdp_i : too much input...resetting" );
+ post( "pdp_i : too much input...resetting" );
x->x_inwriteposition=0;
return;
}
diff --git a/modules/pdp_lumafilt.c b/modules/pdp_lumafilt.c
index 0de1676..17036d4 100644
--- a/modules/pdp_lumafilt.c
+++ b/modules/pdp_lumafilt.c
@@ -134,7 +134,7 @@ static void pdp_lumafilt_process_yv12(t_pdp_lumafilt *x)
}
else
{
- post( "pdp_lumafilt : luminosity value out of bounds : %d", luma );
+ // post( "pdp_lumafilt : luminosity value out of bounds : %d", luma );
}
pnY++;
if ( (px%2==0) && (py%2==0) )
diff --git a/modules/pdp_mp4audiosource.cpp b/modules/pdp_mp4audiosource.cpp
index 7ae18f4..40a8c91 100644
--- a/modules/pdp_mp4audiosource.cpp
+++ b/modules/pdp_mp4audiosource.cpp
@@ -101,8 +101,7 @@ bool CPDPAudioSource::Init(void)
// for live capture we can match the source to the destination
m_audioSrcSamplesPerFrame = m_audioDstSamplesPerFrame;
- m_pcmFrameSize =
- m_audioSrcSamplesPerFrame * m_audioSrcChannels * sizeof(u_int16_t);
+ m_pcmFrameSize = m_audioSrcSamplesPerFrame * m_audioSrcChannels * sizeof(u_int16_t);
if (m_audioOssMaxBufferSize > 0) {
size_t array_size;
@@ -135,7 +134,6 @@ bool CPDPAudioSource::Init(void)
void CPDPAudioSource::ProcessAudio(u_int8_t* pcmBuffer, u_int32_t pcmBufferSize)
{
- audio_buf_info info;
Timestamp currentTime = GetTimestamp();
Timestamp timestamp;
@@ -156,49 +154,14 @@ void CPDPAudioSource::ProcessAudio(u_int8_t* pcmBuffer, u_int32_t pcmBufferSize)
memcpy( m_pcmFrameBuffer, pcmBuffer, pcmBufferSize );
}
- if (info.bytes == m_audioOssMaxBufferSize) {
- // means the audio buffer is full, and not capturing
- // we want to make the timestamp based on the previous one
- // When we hit this case, we start using the m_timestampOverflowArray
- // This will give us a timestamp for when the array is full.
- //
- // In other words, if we have a full audio buffer (ie: it's not loading
- // any more), we start storing the current timestamp into the array.
- // This will let us "catch up", and have a somewhat accurate timestamp
- // when we loop around
- //
- // wmay - I'm not convinced that this actually works - if the buffer
- // cleans up, we'll ignore m_timestampOverflowArray
- if (m_timestampOverflowArray != NULL &&
- m_timestampOverflowArray[m_timestampOverflowArrayIndex] != 0) {
- timestamp = m_timestampOverflowArray[m_timestampOverflowArrayIndex];
- } else {
- timestamp = m_prevTimestamp + SrcSamplesToTicks(m_audioSrcSamplesPerFrame);
- }
-
- if (m_timestampOverflowArray != NULL)
- m_timestampOverflowArray[m_timestampOverflowArrayIndex] = currentTime;
-
- debug_message("pdp_mp4live~ : audio buffer full !");
-
- } else {
- // buffer is not full - so, we make the timestamp based on the number
- // of bytes in the buffer that we read.
- timestamp = currentTime - SrcSamplesToTicks(SrcBytesToSamples(info.bytes));
- if (m_timestampOverflowArray != NULL)
- m_timestampOverflowArray[m_timestampOverflowArrayIndex] = 0;
- }
+ timestamp = currentTime - SrcSamplesToTicks(SrcBytesToSamples(pcmBufferSize));
#ifdef DEBUG_TIMESTAMPS
- debug_message("pdp_mp4live~ : info.bytes=%d t=%llu timestamp=%llu delta=%llu",
- info.bytes, currentTime, timestamp, timestamp - m_prevTimestamp);
+ debug_message("pdp_mp4live~ : bytes=%d t=%llu timestamp=%llu delta=%llu",
+ pcmBufferSize, currentTime, timestamp, timestamp - m_prevTimestamp);
#endif
m_prevTimestamp = timestamp;
- if (m_timestampOverflowArray != NULL) {
- m_timestampOverflowArrayIndex = (m_timestampOverflowArrayIndex + 1) %
- m_audioOssMaxBufferFrames;
- }
ProcessAudioFrame(m_pcmFrameBuffer, m_pcmFrameSize, timestamp, false);
}
diff --git a/modules/pdp_mp4audiosync.cpp b/modules/pdp_mp4audiosync.cpp
index e364c0f..e53a533 100644
--- a/modules/pdp_mp4audiosync.cpp
+++ b/modules/pdp_mp4audiosync.cpp
@@ -33,54 +33,36 @@
#include "our_config_file.h"
#include "m_pd.h"
-#define audio_message(loglevel, fmt...) message(loglevel, "audiosync", fmt)
-
static void pdp_audio_callback (void *userdata, Uint8 *stream, int len)
{
CPDPAudioSync *a = (CPDPAudioSync *)userdata;
+ // post( "pdp_mp4audiosync : audio callback" );
a->audio_callback(stream, len);
}
CPDPAudioSync::CPDPAudioSync (CPlayerSession *psptr, t_pdp_mp4player *pdp_father) : CAudioSync(psptr)
{
- m_fill_index = m_play_index = 0;
- for (int ix = 0; ix < DECODE_BUFFERS_MAX; ix++) {
- m_buffer_filled[ix] = 0;
- m_sample_buffer[ix] = NULL;
- }
- m_buffer_size = 0;
m_config_set = 0;
- m_audio_initialized = 0;
- m_audio_paused = 1;
+ m_audio_initialized = 1;
+ m_audio_paused = 0;
m_resync_required = 0;
m_dont_fill = 0;
- m_consec_no_buffers = 0;
- m_audio_waiting_buffer = 0;
- m_skipped_buffers = 0;
- m_didnt_fill_buffers = 0;
m_play_time = 0 ;
m_buffer_latency = 0;
m_first_time = 1;
- m_first_filled = 1;
- m_buffer_offset_on = 0;
- m_buffer_ts = 0;
- m_load_audio_do_next_resync = 0;
m_convert_buffer = NULL;
m_father = pdp_father;
+ post( "pdp_mp4audiosync : created audio sync" );
}
CPDPAudioSync::~CPDPAudioSync (void)
{
- for (int ix = 0; ix < DECODE_BUFFERS_MAX; ix++) {
- if (m_sample_buffer[ix] != NULL)
- free(m_sample_buffer[ix]);
- m_sample_buffer[ix] = NULL;
+ if (m_sample_buffer[0] != NULL)
+ {
+ free(m_sample_buffer[0]);
}
+ m_sample_buffer[0] = NULL;
CHECK_AND_FREE(m_convert_buffer);
- audio_message(LOG_NOTICE,
- "Audio sync skipped %u buffers",
- m_skipped_buffers);
- audio_message(LOG_NOTICE, "didn't fill %u buffers", m_didnt_fill_buffers);
}
void CPDPAudioSync::set_config (int freq,
@@ -107,10 +89,9 @@ void CPDPAudioSync::set_config (int freq,
m_buffer_size = channels * sample_size * m_bytes_per_sample;
- for (int ix = 0; ix < DECODE_BUFFERS_MAX; ix++) {
- m_buffer_filled[ix] = 0;
- m_sample_buffer[ix] = (uint8_t *)malloc(2 * m_buffer_size);
- }
+ m_buffer_filled[0] = 0;
+ m_sample_buffer[0] = (uint8_t *)malloc(2 * m_buffer_size);
+
m_freq = freq;
m_channels = channels;
m_format = format;
@@ -121,7 +102,7 @@ void CPDPAudioSync::set_config (int freq,
}
m_config_set = 1;
m_msec_per_frame = (sample_size * 1000) / m_freq;
- audio_message(LOG_DEBUG, "buffer size %d msec per frame %d", m_buffer_size, m_msec_per_frame);
+ post("pdp_mp4audiosync : buffer size %d msec per frame %d", m_buffer_size, m_msec_per_frame);
};
uint8_t *CPDPAudioSync::get_audio_buffer (void)
@@ -132,28 +113,14 @@ uint8_t *CPDPAudioSync::get_audio_buffer (void)
return (NULL);
}
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- ret = m_buffer_filled[m_fill_index];
- if (ret == 1) {
- m_audio_waiting_buffer = 1;
- m_audio_waiting_buffer = 0;
- if (m_dont_fill != 0) {
- return (NULL);
- }
- locked = 0;
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- ret = m_buffer_filled[m_fill_index];
- if (locked)
- if (ret == 1) {
- post("pdp_mp4audiosync : no buffer");
- return (NULL);
- }
+ ret = m_buffer_filled[0];
+ if (ret == 1)
+ {
+ post("pdp_mp4audiosync : no buffer");
+ return (NULL);
}
- return (m_sample_buffer[m_fill_index]);
+ // post("pdp_mp4audiosync : get_audio_buffer : return %x", m_sample_buffer[0]);
+ return (m_sample_buffer[0]);
}
void CPDPAudioSync::load_audio_buffer (uint8_t *from,
@@ -164,182 +131,71 @@ void CPDPAudioSync::load_audio_buffer (uint8_t *from,
uint8_t *to;
uint32_t copied;
copied = 0;
- if (m_buffer_offset_on == 0) {
- int64_t diff = ts - m_buffer_ts;
- if (m_buffer_ts != 0 && diff > 1) {
- m_load_audio_do_next_resync = 1;
- audio_message(LOG_DEBUG, "timeslot doesn't match - %llu %llu",
- ts, m_buffer_ts);
- }
- m_buffer_ts = ts;
- } else {
- int64_t check;
- check = ts - m_loaded_next_ts;
- if (check > m_msec_per_frame) {
- audio_message(LOG_DEBUG, "potential resync at ts "U64" should be ts "U64,
- ts, m_loaded_next_ts);
- uint32_t left;
- left = m_buffer_size - m_buffer_offset_on;
- to = get_audio_buffer();
- memset(to + m_buffer_offset_on, 0, left);
- filled_audio_buffer(m_buffer_ts, 0);
- m_buffer_offset_on = 0;
- m_load_audio_do_next_resync = 1;
- m_buffer_ts = ts;
- }
- }
- m_loaded_next_ts = bytes * M_64;
- m_loaded_next_ts /= m_bytes_per_sample;
- m_loaded_next_ts /= m_freq;
- m_loaded_next_ts += ts;
-
- while ( bytes > 0) {
- to = get_audio_buffer();
- if (to == NULL) {
- return;
- }
- int copy;
- uint32_t left;
-
- left = m_buffer_size - m_buffer_offset_on;
- copy = MIN(left, bytes);
- memcpy(to + m_buffer_offset_on, from, copy);
- bytes -= copy;
- copied += copy;
- from += copy;
- m_buffer_offset_on += copy;
- if (m_buffer_offset_on >= m_buffer_size) {
- m_buffer_offset_on = 0;
- filled_audio_buffer(m_buffer_ts, resync | m_load_audio_do_next_resync);
- m_buffer_ts += m_msec_per_frame;
- resync = 0;
- m_load_audio_do_next_resync = 0;
- }
+ post( "pdp_mp4audiosync : load audio buffer : length=%d", bytes );
+
+ to = get_audio_buffer();
+ if (to == NULL)
+ {
+ return;
}
+ int copy;
+ uint32_t left;
+
+ bytes = MIN(m_buffer_size, bytes);
+ memcpy(to, from, bytes);
+
return;
}
void CPDPAudioSync::filled_audio_buffer (uint64_t ts, int resync)
{
- uint32_t fill_index;
- int locked;
- // m_dont_fill will be set when we have a pause
- if (m_dont_fill == 1) {
- return;
- }
- // resync = 0;
- fill_index = m_fill_index;
- m_fill_index++;
- m_fill_index %= DECODE_BUFFERS_MAX;
-
- locked = 0;
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- if (m_first_filled != 0) {
- m_first_filled = 0;
- resync = 0;
- m_resync_required = 0;
- } else {
- int64_t diff;
- diff = ts - m_last_fill_timestamp;
- if (diff - m_msec_per_frame > m_msec_per_frame) {
- // have a hole here - don't want to resync
- if (diff > ((m_msec_per_frame + 1) * 4)) {
- resync = 1;
- } else {
- // try to fill the holes
- m_last_fill_timestamp += m_msec_per_frame + 1; // fill plus extra
- int64_t ts_diff;
- do {
- uint8_t *retbuffer;
- // Get and swap buffers.
- retbuffer = get_audio_buffer();
- if (retbuffer == NULL) {
- return;
- }
- if (retbuffer != m_sample_buffer[m_fill_index]) {
- audio_message(LOG_ERR, "retbuffer not fill index in audio sync");
- return;
- }
- locked = 0;
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- m_sample_buffer[m_fill_index] = m_sample_buffer[fill_index];
- m_sample_buffer[fill_index] = retbuffer;
- memset(retbuffer, m_silence, m_buffer_size);
- m_buffer_time[fill_index] = m_last_fill_timestamp;
- m_buffer_filled[fill_index] = 1;
- m_samples_loaded += m_buffer_size;
- fill_index++;
- fill_index %= DECODE_BUFFERS_MAX;
- m_fill_index++;
- m_fill_index %= DECODE_BUFFERS_MAX;
- audio_message(LOG_NOTICE, "Filling timestamp %llu with silence",
- m_last_fill_timestamp);
- m_last_fill_timestamp += m_msec_per_frame + 1; // fill plus extra
- ts_diff = ts - m_last_fill_timestamp;
- audio_message(LOG_DEBUG, "diff is %lld", ts_diff);
- } while (ts_diff > 0);
- locked = 0;
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- }
- } else {
- if (m_last_fill_timestamp == ts) {
- audio_message(LOG_NOTICE, "Repeat timestamp with audio %llu", ts);
- return;
+ // post( "pdp_mp4audiosync : filled audio buffer" );
+ // if (resync) m_psptr->wake_sync_thread();
+
+ if ( m_father->x_audio )
+ {
+ // copy the buffer filled by the codec towards pdp
+ if ( (m_father->x_audioin_position*sizeof(short)+m_buffer_size) < (4*MAX_AUDIO_PACKET_SIZE*sizeof(short)) )
+ {
+ memcpy( m_father->x_audio_in+m_father->x_audioin_position, m_sample_buffer[0], m_buffer_size );
+ m_father->x_audioin_position+=(m_buffer_size/sizeof(short));
+ // post( "pdp_mp4audiosync : filled_audio_buffer : copied %d PCM samples : audio in : %d : resync : %d",
+ // m_buffer_size/sizeof(short), m_father->x_audioin_position, resync );
+ if ( ( m_father->x_audioin_position > DEFAULT_CHANNELS*m_father->x_blocksize )
+ && (!m_father->x_audioon) )
+ {
+ m_father->x_audioon = 1;
+ // post( "pdp_mp4audiosync : audio on" );
}
}
+ else
+ {
+ post( "pdp_mp4audiosync : filled_audio_buffer : skipped buffer : (in : %d)",
+ m_father->x_audioin_position );
+ }
}
- m_last_fill_timestamp = ts;
- m_buffer_filled[fill_index] = 1;
- m_samples_loaded += m_buffer_size;
- m_buffer_time[fill_index] = ts;
- if (resync) {
- m_resync_required = 1;
- m_resync_buffer = fill_index;
-#ifdef DEBUG_AUDIO_FILL
- audio_message(LOG_DEBUG, "Resync from filled_audio_buffer");
-#endif
- }
-
- // Check this - we might not want to do this unless we're resyncing
- if (resync) m_psptr->wake_sync_thread();
-#ifdef DEBUG_AUDIO_FILL
- audio_message(LOG_DEBUG, "Filling " LLU " %u %u", ts, fill_index, m_samples_loaded);
-#endif
+
+ return;
}
void CPDPAudioSync::set_eof(void)
{
uint8_t *to;
- if (m_buffer_offset_on != 0) {
- to = get_audio_buffer();
- if (to != NULL) {
- uint32_t left;
- left = m_buffer_size - m_buffer_offset_on;
- memset(to + m_buffer_offset_on, 0, left);
- m_buffer_offset_on = 0;
- filled_audio_buffer(m_buffer_ts, 0);
- m_buffer_ts += m_msec_per_frame;
- }
- }
+
+ to = get_audio_buffer();
CAudioSync::set_eof();
}
-int CPDPAudioSync::initialize_audio (int have_video)
+int CPDPAudioSync::initialize_audio (int have_audio)
{
+ m_audio_initialized = 1;
return (1);
}
int CPDPAudioSync::is_audio_ready (uint64_t &disptime)
{
- disptime = m_buffer_time[m_play_index];
- return (m_dont_fill == 0 && m_buffer_filled[m_play_index] == 1);
+ return (1);
}
uint64_t CPDPAudioSync::check_audio_sync (uint64_t current_time, int &have_eof)
@@ -355,6 +211,8 @@ void CPDPAudioSync::audio_callback (Uint8 *stream, int ilen)
int delay = 0;
int playtime;
+ post( "pdp_mp4audiosync : audio callback" );
+
}
void CPDPAudioSync::play_audio (void)
@@ -366,29 +224,14 @@ void CPDPAudioSync::play_audio (void)
void CPDPAudioSync::flush_sync_buffers (void)
{
+ post( "pdp_mp4audiosync : flush sync buffer" );
clear_eof();
- m_dont_fill = 1;
- if (m_audio_waiting_buffer) {
- m_audio_waiting_buffer = 0;
- }
}
void CPDPAudioSync::flush_decode_buffers (void)
{
- int locked = 0;
- if (m_audio_initialized != 0) {
- locked = 1;
- }
- m_dont_fill = 0;
- m_first_filled = 1;
- for (int ix = 0; ix < DECODE_BUFFERS_MAX; ix++) {
- m_buffer_filled[ix] = 0;
- }
- m_buffer_offset_on = 0;
- m_play_index = m_fill_index = 0;
- m_audio_paused = 1;
- m_resync_buffer = 0;
- m_samples_loaded = 0;
+ post( "pdp_mp4audiosync : flush decode buffer" );
+ m_buffer_filled[0] = 0;
}
void CPDPAudioSync::set_volume (int volume)
@@ -466,7 +309,7 @@ static void pdp_filled_audio_buffer (void *ifptr,
int resync_req)
{
((CPDPAudioSync *)ifptr)->filled_audio_buffer(ts,
- resync_req);
+ resync_req);
}
static void pdp_load_audio_buffer (void *ifptr,
diff --git a/modules/pdp_mp4live~.cpp b/modules/pdp_mp4live~.cpp
index dfa55a5..2c3f52c 100644
--- a/modules/pdp_mp4live~.cpp
+++ b/modules/pdp_mp4live~.cpp
@@ -60,7 +60,7 @@
#define VIDEO_BUFFER_SIZE (1024*1024)
#define MAX_AUDIO_PACKET_SIZE (128 * 1024)
-#define AUDIO_PACKET_SIZE (2*1024) /* using aac encoding */
+#define AUDIO_PACKET_SIZE (2*1024*2) /* using aac encoding, 2 channels, 2 bytes per sample */
static char *pdp_mp4live_version = "pdp_mp4live~: version 0.1, an mpeg4ip video streaming object ( ydegoyon@free.fr )";
@@ -90,8 +90,6 @@ typedef struct pdp_mp4live_struct
/* audio structures */
short x_audio_buf[2*MAX_AUDIO_PACKET_SIZE]; /* buffer for incoming audio */
- short x_audio_enc_buf[2*MAX_AUDIO_PACKET_SIZE]; /* buffer for audio to be encoded */
- uint8_t x_audio_out[4*MAX_AUDIO_PACKET_SIZE]; /* buffer for encoded audio */
t_int x_audioin_position; // writing position for incoming audio
t_int x_audio_per_frame; // number of audio samples to transmit for each frame
@@ -425,8 +423,6 @@ static void pdp_mp4live_process_yv12(t_pdp_mp4live *x)
pU = data+x->x_vsize;
pV = data+x->x_vsize+(x->x_vsize>>2);
- x->x_videosource->ProcessVideo( pY, pV, pU );
-
/* update frames counter */
if ( gettimeofday(&etime, NULL) == -1)
@@ -442,17 +438,8 @@ static void pdp_mp4live_process_yv12(t_pdp_mp4live *x)
x->x_nbframes++;
x->x_secondcount++;
- /* send an audio frame */
- if ( x->x_audioin_position > x->x_audio_per_frame )
- {
- x->x_audiosource->ProcessAudio( (u_int8_t*)x->x_audio_buf,
- (u_int32_t)x->x_audio_per_frame*sizeof(short) );
+ x->x_videosource->ProcessVideo( pY, pV, pU );
- /* output resampled raw samples */
- memcpy( x->x_audio_buf, x->x_audio_buf+x->x_audio_per_frame,
- x->x_audioin_position-x->x_audio_per_frame );
- x->x_audioin_position-=x->x_audio_per_frame;
- }
}
return;
}
@@ -499,6 +486,21 @@ static t_int *pdp_mp4live_perform(t_int *w)
}
}
+ if ( x->x_streaming )
+ {
+ /* send an audio frame */
+ if ( (t_int)(x->x_audioin_position*sizeof(short)) > (t_int)x->x_audio_per_frame )
+ {
+ x->x_audiosource->ProcessAudio( (u_int8_t*)x->x_audio_buf,
+ (u_int32_t)x->x_audio_per_frame );
+
+ /* recopy the buffer and set new pointers */
+ memcpy( x->x_audio_buf, x->x_audio_buf+(x->x_audio_per_frame/sizeof(short)),
+ x->x_audioin_position*sizeof(short)-x->x_audio_per_frame );
+ x->x_audioin_position-=(x->x_audio_per_frame/sizeof(short));
+ }
+ }
+
return (w+5);
}
diff --git a/modules/pdp_mp4player~.cpp b/modules/pdp_mp4player~.cpp
index 613f673..de47614 100644
--- a/modules/pdp_mp4player~.cpp
+++ b/modules/pdp_mp4player~.cpp
@@ -102,10 +102,13 @@ static void pdp_mp4player_disconnect(t_pdp_mp4player *x)
}
x->x_streaming = 0;
+ x->x_newpicture = 0;
outlet_float( x->x_outlet_streaming, x->x_streaming );
x->x_nbframes = 0;
outlet_float( x->x_outlet_nbframes, x->x_nbframes );
+ x->x_framerate = 0;
+ outlet_float( x->x_outlet_framerate, x->x_framerate );
post( "pdp_mp4player~ : deleting session" );
delete x->x_psession;
@@ -227,11 +230,12 @@ static t_int *pdp_mp4player_perform(t_int *w)
struct timeval etime;
t_int sn;
+ x->x_blocksize = n;
+
// just read the buffer
if ( x->x_audioon )
{
sn=0;
- n=n*DEFAULT_CHANNELS;
while (n--)
{
sampleL=x->x_audio_in[ sn++ ];
@@ -249,7 +253,7 @@ static t_int *pdp_mp4player_perform(t_int *w)
out2++;
}
x->x_audioin_position-=sn;
- memcpy( &x->x_audio_in[0], &x->x_audio_in[sn], 4*MAX_AUDIO_PACKET_SIZE-sn );
+ memcpy( &x->x_audio_in[0], &x->x_audio_in[sn], (4*MAX_AUDIO_PACKET_SIZE-sn-1)*sizeof(short) );
// post( "pdp_mp4player~ : audio in position : %d", x->x_audioin_position );
if ( x->x_audioin_position <= sn )
{
@@ -281,13 +285,17 @@ static t_int *pdp_mp4player_perform(t_int *w)
if ( x->x_newpicture )
{
- pdp_packet_pass_if_valid(x->x_pdp_out, &x->x_packet0);
+ x->x_packet = pdp_packet_new_image_YCrCb( x->x_vwidth, x->x_vheight );
+ x->x_data = (short int *)pdp_packet_data(x->x_packet);
+ memcpy( x->x_data, x->x_datav, (x->x_vsize + (x->x_vsize>>1))<<1 );
+ pdp_packet_pass_if_valid(x->x_pdp_out, &x->x_packet);
// update streaming status
outlet_float( x->x_outlet_streaming, x->x_streaming );
x->x_nbframes++;
x->x_secondcount++;
outlet_float( x->x_outlet_nbframes, x->x_nbframes );
+ x->x_newpicture = 0;
}
return (w+5);
@@ -307,7 +315,7 @@ static void pdp_mp4player_free(t_pdp_mp4player *x)
pdp_mp4player_disconnect(x);
}
post( "pdp_mp4player~ : freeing object" );
- pdp_packet_mark_unused(x->x_packet0);
+ pdp_packet_mark_unused(x->x_packet);
// remove invalid global ports
close_plugins();
@@ -330,16 +338,20 @@ void *pdp_mp4player_new(void)
x->x_outlet_nbframes = outlet_new(&x->x_obj, &s_float);
x->x_outlet_framerate = outlet_new(&x->x_obj, &s_float);
- x->x_packet0 = -1;
+ x->x_packet = -1;
x->x_nbframes = 0;
x->x_cursec = 0;
x->x_secondcount = 0;
x->x_audioin_position = 0;
+ x->x_blocksize = MIN_AUDIO_SIZE;
x->x_priority = DEFAULT_PRIORITY;
x->x_decodechild = 0;
x->x_newpicture = 0;
- memset( &x->x_audio_buf[0], 0x0, 4*MAX_AUDIO_PACKET_SIZE*sizeof(short) );
+ x->x_vwidth = -1;
+ x->x_vheight = -1;
+ x->x_datav = NULL;
+
memset( &x->x_audio_in[0], 0x0, 4*MAX_AUDIO_PACKET_SIZE*sizeof(short) );
// initialize mpeg4hippies
diff --git a/modules/pdp_mp4videosync.cpp b/modules/pdp_mp4videosync.cpp
index b7fca2e..76a874b 100644
--- a/modules/pdp_mp4videosync.cpp
+++ b/modules/pdp_mp4videosync.cpp
@@ -175,9 +175,47 @@ void CPDPVideoSync::set_video_frame(const uint8_t *y,
int pixelw_uv,
uint64_t time)
{
- // post( "pdp_mp4videosync : set video frame : %dx%d", m_width, m_height );
+ short int *pY, *pU, *pV;
+ t_int px, py;
+
m_psptr->wake_sync_thread();
+ if ( !m_father->x_streaming )
+ {
+ return;
+ }
+
+ // transforming into a image for pdp
+ if ( ( (t_int)m_father->x_vheight != (t_int)m_height ) ||
+ ( (t_int)m_father->x_vwidth != (t_int)m_width ) )
+ {
+ m_father->x_vheight = m_height;
+ m_father->x_vwidth = m_width;
+ m_father->x_vsize = m_father->x_vheight*m_father->x_vwidth;
+ post( "pdp_mp4videosync : allocating video data : %dx%d", m_width, m_height );
+
+ // allocate video data
+ m_father->x_datav = ( short int* ) malloc( (m_father->x_vsize+(m_father->x_vsize>>1))<<1 );
+ }
+
+ // post( "pdp_mp4videosync : set video frame : width : y:%d, uv:%d", pixelw_y, pixelw_uv );
+
+ pY = m_father->x_datav;
+ pV = m_father->x_datav+m_father->x_vsize;
+ pU = m_father->x_datav+m_father->x_vsize+(m_father->x_vsize>>2);
+ for(py=0; py<m_father->x_vheight; py++)
+ {
+ for(px=0; px<m_father->x_vwidth; px++)
+ {
+ *(pY+py*m_father->x_vwidth+px) = *(y+py*pixelw_y+px)<<7;
+ if ( ( px%2 == 0 ) && ( py%2 == 0 ) )
+ {
+ *(pU+(py>>1)*(m_father->x_vwidth>>1)+(px>>1)) = ((*(u+(py>>1)*pixelw_uv+(px>>1)))-128)<<8;
+ *(pV+(py>>1)*(m_father->x_vwidth>>1)+(px>>1)) = ((*(v+(py>>1)*pixelw_uv+(px>>1)))-128)<<8;
+ }
+ }
+ }
+
// pass the data to the pdp object
m_father->x_newpicture = 1;
return;
diff --git a/modules/pdp_ocanvas.c b/modules/pdp_ocanvas.c
index e06a500..c92253b 100644
--- a/modules/pdp_ocanvas.c
+++ b/modules/pdp_ocanvas.c
@@ -238,7 +238,7 @@ static void pdp_ocanvas_input(t_pdp_ocanvas *x, t_symbol *s, t_floatarg f, t_int
/* release the packet */
if ( x->x_packets[ni] != -1 )
{
- pdp_packet_mark_unused(x->x_packets[ni]);
+ pdp_packet_delete(x->x_packets[ni]);
x->x_packets[ni] = -1;
}
x->x_dropped = pdp_packet_convert_ro_or_drop(&x->x_packets[ni], (int)f, pdp_gensym("image/YCrCb/*") );
diff --git a/modules/pdp_vertigo.c b/modules/pdp_vertigo.c
index ce5295a..f9dd553 100644
--- a/modules/pdp_vertigo.c
+++ b/modules/pdp_vertigo.c
@@ -211,7 +211,7 @@ static void pdp_vertigo_process_yv12(t_pdp_vertigo *x)
if ( i >= (x->x_vsize + (x->x_vsize>>1)) ) i = (x->x_vsize + (x->x_vsize>>1))-1;
v = pcy[i] & 0xffff;
v = (v * 3) + ((*poy++) & 0xffff);
- *pny++ = (v>>2);
+ *pny++ = (v>>2)<<7;
if ( (((px+1)%2)==0) && (((py+1)%2)==0) )
{
ninc++;
diff --git a/patches/help_pdp_effects_rack.pd b/patches/help_pdp_effects_rack.pd
index 9495acb..7654ac3 100644
--- a/patches/help_pdp_effects_rack.pd
+++ b/patches/help_pdp_effects_rack.pd
@@ -2,7 +2,7 @@
#X obj 230 7 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 150 44 loop \$1;
-#X obj 151 22 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1 1
+#X obj 151 22 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0 1
;
#X msg 86 45 open \$1;
#X obj 78 21 openpanel;
@@ -157,7 +157,7 @@
#X obj 19 544 pdp_zoom;
#X floatatom 68 500 5 0 0 0 - - -;
#X obj 152 436 hsl 300 15 0.01 100 1 1 empty empty empty -2 -6 0 8
--262144 -1 -1 16604 1;
+-262144 -1 -1 15104 1;
#X floatatom 122 547 5 0 0 0 - - -;
#X obj 146 487 hsl 300 15 0.01 100 1 1 empty empty empty -2 -6 0 8
-262144 -1 -1 14200 1;
@@ -252,6 +252,8 @@
#X msg 355 646 pos 0 0;
#X msg 418 645 dim 1024 768;
#X floatatom 197 93 5 0 0 0 - - -;
+#X msg 233 409 1;
+#X obj 272 411 loadbang;
#X connect 0 0 8 0;
#X connect 1 0 9 0;
#X connect 2 0 1 0;
@@ -476,3 +478,5 @@
#X connect 199 0 16 0;
#X connect 200 0 193 0;
#X connect 201 0 193 0;
+#X connect 203 0 124 0;
+#X connect 204 0 203 0;
diff --git a/patches/pdp_cabaret.pd b/patches/pdp_cabaret.pd
index 1f72e30..f515fd7 100644
--- a/patches/pdp_cabaret.pd
+++ b/patches/pdp_cabaret.pd
@@ -30,10 +30,10 @@
#X floatatom 547 636 5 0 0 0 - - -;
#X obj 547 607 route pdp_drop;
#X text 100 619 author : Yves Degoyon ( ydegoyon@free.fr );
-#X obj 416 394 colorgrid colorgrid1 256 0 256 50 0 50 0 1 1 10 10 481
-420;
+#X obj 416 394 pdp_colorgrid pdp_colorgrid1 256 0 256 50 0 50 0 1 1
+10 10 498 428;
#X obj 680 393 vsl 8 50 0 1 0 0 empty empty empty 0 -8 0 8 -262144
--1 -1 0 1;
+-1 -1 1000 1;
#X obj 213 200 pdp_shape;
#X obj 258 243 -;
#X floatatom 265 266 5 0 0 0 - - -;
@@ -58,6 +58,31 @@
#X msg 295 542 cursor 1;
#X text 100 605 pdp_cabaret : specially made for pep';
#X obj 223 515 pdp_spotlight;
+#X msg 412 195 tolerance \$1;
+#X floatatom 412 170 5 0 0 0 - - -;
+#X obj 100 562 pdp_rec~;
+#X msg 50 514 open /tmp/output.mov;
+#X msg 50 537 start;
+#X msg 51 560 stop;
+#X floatatom 98 587 5 0 0 0 - - -;
+#X msg 512 194 luminosity \$1;
+#X obj 511 168 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 634 237 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
+-1;
+#X msg 489 309 loop \$1;
+#X obj 490 287 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
+1;
+#X msg 518 270 open \$1;
+#X obj 517 246 openpanel;
+#X obj 502 229 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
+-1;
+#X floatatom 682 272 5 0 0 0 - - -;
+#X msg 591 238 stop;
+#X obj 689 241 hsl 300 15 0 1000 0 0 empty empty empty -2 -6 0 8 -262144
+-1 -1 0 1;
+#X obj 623 308 metro 70;
+#X obj 618 340 pdp_yqt;
#X connect 0 0 9 0;
#X connect 1 0 13 0;
#X connect 2 0 1 0;
@@ -86,7 +111,6 @@
#X connect 25 2 50 6;
#X connect 26 0 50 7;
#X connect 27 0 48 0;
-#X connect 27 0 50 0;
#X connect 27 1 28 1;
#X connect 27 1 40 0;
#X connect 27 2 31 1;
@@ -117,3 +141,23 @@
#X connect 47 0 38 0;
#X connect 48 0 34 0;
#X connect 50 0 34 0;
+#X connect 50 0 53 0;
+#X connect 51 0 27 0;
+#X connect 52 0 51 0;
+#X connect 53 0 57 0;
+#X connect 54 0 53 0;
+#X connect 55 0 53 0;
+#X connect 56 0 53 0;
+#X connect 58 0 27 0;
+#X connect 59 0 58 0;
+#X connect 60 0 69 0;
+#X connect 61 0 70 0;
+#X connect 62 0 61 0;
+#X connect 63 0 70 0;
+#X connect 64 0 63 0;
+#X connect 65 0 64 0;
+#X connect 66 0 69 1;
+#X connect 67 0 69 0;
+#X connect 68 0 66 0;
+#X connect 69 0 70 0;
+#X connect 70 0 50 0;
diff --git a/patches/pdp_charcoal.pd b/patches/pdp_charcoal.pd
index f0aa9c1..79b9df6 100644
--- a/patches/pdp_charcoal.pd
+++ b/patches/pdp_charcoal.pd
@@ -2,7 +2,7 @@
#X obj 268 64 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1
-1;
#X msg 123 136 loop \$1;
-#X obj 124 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 1
+#X obj 124 114 tgl 15 0 empty empty empty 20 8 0 8 -262144 -1 -1 0
1;
#X msg 370 44 open \$1;
#X obj 369 20 openpanel;
@@ -28,7 +28,7 @@
#X obj 549 443 route pdp_drop;
#X floatatom 322 407 5 0 0 0 - - -;
#X text 389 405 Blur factor;
-#N canvas 346 16 870 675 edge_detect 1;
+#N canvas 346 16 870 675 edge_detect 0;
#X obj 343 530 pdp_mul;
#X obj 132 421 inlet;
#X obj 234 621 outlet;
@@ -210,7 +210,6 @@
#X obj 298 300 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X obj 216 266 pdp_grey;
-#X obj 216 237 pdp_spigot;
#X obj 298 238 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
#X text 325 238 on/off;
@@ -255,6 +254,7 @@
#X obj 132 207 inlet;
#X obj 215 556 outlet;
#X obj 276 467 inlet;
+#X obj 216 237 pdp_spigot;
#X connect 0 0 9 0;
#X connect 1 0 10 0;
#X connect 2 0 1 0;
@@ -265,8 +265,8 @@
#X connect 7 0 9 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
-#X connect 10 0 35 0;
-#X connect 11 0 35 0;
+#X connect 10 0 51 0;
+#X connect 11 0 51 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
#X connect 14 0 12 0;
@@ -278,25 +278,25 @@
#X connect 21 0 25 1;
#X connect 23 0 28 0;
#X connect 24 0 23 1;
-#X connect 25 0 43 0;
-#X connect 26 0 50 0;
+#X connect 25 0 42 0;
+#X connect 26 0 49 0;
#X connect 28 0 25 0;
#X connect 28 1 30 0;
#X connect 29 0 28 1;
#X connect 30 0 26 0;
-#X connect 30 1 50 0;
+#X connect 30 1 49 0;
#X connect 31 0 30 1;
#X connect 32 0 23 0;
#X connect 32 1 28 0;
#X connect 33 0 32 1;
#X connect 34 0 32 0;
-#X connect 35 0 34 0;
-#X connect 35 1 32 0;
-#X connect 36 0 35 1;
-#X connect 43 0 46 0;
-#X connect 43 1 30 0;
-#X connect 44 0 43 1;
-#X connect 46 0 30 0;
-#X connect 47 0 46 1;
-#X connect 49 0 35 0;
-#X connect 51 0 47 0;
+#X connect 35 0 51 1;
+#X connect 42 0 45 0;
+#X connect 42 1 30 0;
+#X connect 43 0 42 1;
+#X connect 45 0 30 0;
+#X connect 46 0 45 1;
+#X connect 48 0 51 0;
+#X connect 50 0 46 0;
+#X connect 51 0 34 0;
+#X connect 51 1 32 0;
diff --git a/system/pidip.c b/system/pidip.c
index 90b7faa..8a62a6f 100644
--- a/system/pidip.c
+++ b/system/pidip.c
@@ -63,6 +63,7 @@ extern "C"
void pdp_pen_setup(void);
void pdp_shape_setup(void);
void pdp_spotlight_setup(void);
+ void pdp_colorgrid_setup(void);
#ifdef HAVE_PIDIP_FFMPEG
void pdp_ffmpeg_tilde_setup(void);
@@ -133,6 +134,7 @@ void pidip_setup(void){
pdp_pen_setup();
pdp_shape_setup();
pdp_spotlight_setup();
+ pdp_colorgrid_setup();
#ifdef HAVE_PIDIP_FFMPEG
pdp_ffmpeg_tilde_setup();