Update of /cvsroot/artoolkit/artoolkit/lib/SRC/VideoGStreamer
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv28053/lib/SRC/VideoGStreamer
Modified Files:
video.c
Log Message:
implemented (read as: copied code) Waynes proposed ARTOOLKIT_CONFIG for GStreamer. Removed all GStreamer related example configuration strings from the examples and utils. Added section into the documentation
Index: video.c
===================================================================
RCS file: /cvsroot/artoolkit/artoolkit/lib/SRC/VideoGStreamer/video.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** video.c 8 Aug 2006 03:33:45 -0000 1.4
--- video.c 18 Sep 2006 04:48:33 -0000 1.5
***************
*** 92,95 ****
--- 92,124 ----
}
+ void
+ testing_pad(GstPad *pad)
+ {
+ const GstCaps *caps;
+ GstStructure *str;
+
+ gint width,height;
+ gdouble rate;
+
+ caps=gst_pad_get_negotiated_caps(pad);
+
+ if (caps) {
+ str=gst_caps_get_structure(caps,0);
+
+ /* Get some data about the frame */
+ gst_structure_get_int(str,"width",&width);
+ gst_structure_get_int(str,"height",&height);
+ gst_structure_get_double(str,"framerate",&rate);
+
+ g_print("libARvideo: GStreamer negotiated %dx%d\n",width,height);
+ } else {
+ return;
+ #if 0
+ g_print("Nothing yet!");
+ #endif
+
+ }
+ }
+
int
***************
*** 157,164 ****
GError *error = 0;
int i;
! GstPad *pad;
GstXML *xml;
GstStateChangeReturn _ret;
/* initialise GStreamer */
gst_init(0,0);
--- 186,209 ----
GError *error = 0;
int i;
! GstPad *pad, *peerpad;
GstXML *xml;
GstStateChangeReturn _ret;
+ /* following plainly copied from Wayne :) */
+ /* If no config string is supplied, we should use the environment variable otherwise set a sane default */
+ if (!strcmp (config, "")) {
+
+ /* None suppplied, lets see if the user supplied one from the shell */
+ char *envconf = getenv ("ARTOOLKIT_CONFIG");
+ if ((envconf != NULL) && (strcmp (envconf, ""))) {
+ config = envconf;
+ printf ("Using config string from environment [%s]\n", config);
+ }
+ else {
+ g_printf ("No config string supplied, please consult documentation\n");
+ }
+ } else
+ g_print ("Using supplied config string [%s]\n", config);
+
/* initialise GStreamer */
gst_init(0,0);
***************
*** 210,216 ****
gst_pad_add_buffer_probe (pad, G_CALLBACK (cb_have_data), vid);
! /* dismiss the pad */
! gst_object_unref (pad);
/* request ready state */
gst_element_set_state (vid->pipeline, GST_STATE_READY);
--- 255,261 ----
gst_pad_add_buffer_probe (pad, G_CALLBACK (cb_have_data), vid);
!
+ #if 0
/* request ready state */
gst_element_set_state (vid->pipeline, GST_STATE_READY);
***************
*** 222,228 ****
--- 267,281 ----
g_print ("libARvideo: GStreamer pipeline is READY!\n");
}
+ #endif
/* Needed to fill the information for ARVidInfo */
gst_element_set_state (vid->pipeline, GST_STATE_PAUSED);
+
+ peerpad = gst_pad_get_peer(pad);
+
+ testing_pad(peerpad);
+
+ /* dismiss the pad */
+ gst_object_unref (pad);
/* wait until it's up and running or failed */
|