2 #define PIPELINE_TEST 0
5 #define UNUSED __attribute__ ((unused))
15 "framerate", GST_TYPE_FRACTION, FPS, 1, \
16 "width", G_TYPE_INT, WIDTH, \
17 "height", G_TYPE_INT, HEIGHT, \
20 const gchar
*PLUGIN_DIR
= "/home/douglas/sparrow";
22 static inline GstPipeline
*
23 make_pipeline(GstElement
*sink
){
24 GstPipeline
*pipeline
= GST_PIPELINE(gst_pipeline_new("sparow_pipeline"));
25 GstElement
*src
= gst_element_factory_make("v4l2src", NULL
);
26 //GstElement *src = gst_element_factory_make("videotestsrc", NULL);
27 GstElement
*caps1
= gst_element_factory_make("capsfilter", "caps1");
28 GstElement
*cs
= gst_element_factory_make("ffmpegcolorspace", NULL
);
29 GstElement
*sparrow
= gst_element_factory_make("sparrow", NULL
);
30 GstElement
*caps2
= gst_element_factory_make("capsfilter", "caps1");
31 GstElement
*cs2
= gst_element_factory_make("ffmpegcolorspace", NULL
);
33 g_object_set(G_OBJECT(caps1
), "caps",
34 gst_caps_new_simple ("video/x-raw-yuv",
35 "format", GST_TYPE_FOURCC
, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
38 g_object_set(G_OBJECT(caps2
), "caps",
39 gst_caps_new_simple ("video/x-raw-rgb",
43 g_object_set(G_OBJECT(sparrow
),
48 //"reload", "dumpfiles/gtk.dump",
49 //"save", "dumpfiles/gtk.dump",
52 gst_bin_add_many (GST_BIN(pipeline
), src
,
60 gst_element_link_many(src
,
74 post_tee_pipeline(GstPipeline
*pipeline
, GstElement
*tee
, GstElement
*sink
,
75 int rngseed
, int colour
, int timer
, int debug
){
76 GstElement
*queue
= gst_element_factory_make ("queue", NULL
);
77 GstElement
*sparrow
= gst_element_factory_make("sparrow", NULL
);
78 GstElement
*caps_posteriori
= gst_element_factory_make("capsfilter", NULL
);
79 GstElement
*cs_posteriori
= gst_element_factory_make("ffmpegcolorspace", NULL
);
81 g_object_set(G_OBJECT(caps_posteriori
), "caps",
82 gst_caps_new_simple ("video/x-raw-rgb",
85 g_object_set(G_OBJECT(sparrow
),
90 //"reload", "dumpfiles/gtk.dump",
91 //"save", "dumpfiles/gtk.dump",
94 gst_bin_add_many (GST_BIN(pipeline
),
102 gst_element_link_many(tee
,
112 gst-launch-0.10 --gst-plugin-path=. --gst-debug=sparrow:5 v4l2src ! ffmpegcolorspace ! tee name=vid2 \
113 ! queue ! sparrow ! 'video/x-raw-rgb,width=320,height=240,framerate=25/1' ! ximagesink \
114 vid2. ! queue ! sparrow ! 'video/x-raw-rgb,width=320,height=240,framerate=25/1' ! ximagesink
117 static inline GstPipeline
*
118 make_dual_pipeline(GstElement
*sink1
, GstElement
*sink2
)
120 GstPipeline
*pipeline
= GST_PIPELINE(gst_pipeline_new("sparrow_pipeline"));
121 //GstElement *src = gst_element_factory_make("v4l2src", NULL);
122 GstElement
*src
= gst_element_factory_make("videotestsrc", NULL
);
123 GstElement
*caps_priori
= gst_element_factory_make("capsfilter", NULL
);
124 GstElement
*cs_priori
= gst_element_factory_make("ffmpegcolorspace", NULL
);
125 GstElement
*caps_interiori
= gst_element_factory_make("capsfilter", NULL
);
126 GstElement
*tee
= gst_element_factory_make ("tee", NULL
);
128 g_object_set(G_OBJECT(caps_priori
), "caps",
129 gst_caps_new_simple ("video/x-raw-yuv",
130 "format", GST_TYPE_FOURCC
, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
133 g_object_set(G_OBJECT(caps_interiori
), "caps",
134 gst_caps_new_simple ("video/x-raw-rgb",
137 gst_bin_add_many(GST_BIN(pipeline
),
145 gst_element_link_many(src
,
152 post_tee_pipeline(pipeline
, tee
, sink1
,
154 post_tee_pipeline(pipeline
, tee
, sink2
,