Revision c83c639e

b/.gitignore
4 4
*.o
5 5
*.lo
6 6
*.la
7
*.so
7 8
*.tar.gz
8 9
*.html
9 10
*.libs
b/src/libsharedvideo/Makefile
39 39
data_writer_from_rtp: data-writer-from-rtp-example.cpp
40 40
	g++ -Wall data-writer-from-rtp-example.cpp -o data_writer_from_rtp -L. -lscenicsharedvideo $(DEPS)
41 41

  
42
pcd_write: pcd_write.cpp
43
	g++ -o pcd_write pcd_write.cpp -L. -lscenicsharedvideo `pkg-config --cflags --libs pcl_visualization-1.4 gstreamer-0.10 gio-2.0 gstreamer-app-0.10` -I /usr/include/vtk-5.6/
44

  
45
pcd_read: pcd_read.cpp
46
	g++ -o pcd_read pcd_read.cpp -L. -lscenicsharedvideo `pkg-config --cflags --libs pcl_visualization-1.4 gstreamer-0.10 gio-2.0 gstreamer-app-0.10` -I /usr/include/vtk-5.6/
47

  
42 48
clean:
43 49
	rm -f *.o *.so writer_example reader_example reader_osg reader_clutter_actor data_writer_example data_reader_example *~ data_reader_to_rtp data_reader_from_rtp data_writer_from_rtp
b/src/libsharedvideo/data-reader-example.cpp
13 13

  
14 14
#include <string>
15 15
#include "shared-video.h"
16
#include <unistd.h>//sleep
17 16

  
18 17
typedef struct _App App;
19 18
struct _App
......
39 38
	    GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf),
40 39
	    GST_TIME_AS_MSECONDS(GST_BUFFER_TIMESTAMP(buf)),
41 40
	    gst_caps_to_string(GST_BUFFER_CAPS(buf)));
42
    g_print ("received: %s\n",GST_BUFFER_DATA(buf));
41
    //g_print ("received: %s\n",GST_BUFFER_DATA(buf));
43 42
    
44 43
    if (buf)
45 44
	gst_buffer_unref (buf);
b/src/libsharedvideo/data-writer-example.cpp
86 86
    int mytime=0;
87 87

  
88 88

  
89
    gchar hello[11]="helloworld";
89
    gchar hello[21]="helloworldhelloworld";
90 90
    
91 91
    //g_print ("max int %d\n",INT_MAX);
92
    
93
    int usecPeriod=30000;
92 94

  
93 95
    while (app->on){  
94 96
	for (i = 0; i < 1; i++) {
......
96 98

  
97 99
	    
98 100
//data here should be serialized in order
99
	    
101
	
100 102
//	    buf = gst_app_buffer_new (data, size, dont_eat_my_chicken_wings, data);
101 103
	    buf = gst_app_buffer_new (&hello, sizeof(hello), dont_eat_my_chicken_wings, NULL);
102 104
	    
103
	    GST_BUFFER_TIMESTAMP(buf) = (GstClockTime)((mytime) * 1e9); 
105
	    GST_BUFFER_TIMESTAMP(buf) = (GstClockTime)((mytime) * 1e9/usecPeriod); 
104 106
	    // g_print ("mytime %d \n",mytime);
105 107
	    // printf ("%d: creating buffer for pointer %p, %p\n", i, data, buf);
106 108
	    gst_app_src_push_buffer (GST_APP_SRC (app->src), buf);
107 109
	}
108
	sleep (1);
110
	usleep (usecPeriod);
109 111
	mytime++;
110 112
    }
111 113
    

Also available in: Unified diff