indenting tests

Original commit message from CVS:
indenting tests
This commit is contained in:
Thomas Vander Stichele 2004-03-14 20:54:13 +00:00
parent 82d6181bf2
commit 24aa823989
2 changed files with 379 additions and 396 deletions

View file

@ -2,19 +2,20 @@
#include <gst/gst.h> #include <gst/gst.h>
static gboolean static gboolean
idle_func (gpointer data) idle_func (gpointer data)
{ {
gst_bin_iterate(GST_BIN(data)); gst_bin_iterate (GST_BIN (data));
return TRUE; return TRUE;
} }
int int
main (int argc,char *argv[]) main (int argc, char *argv[])
{ {
GstElement *bin; GstElement *bin;
GstElement *src; GstElement *src;
GstElement *dvdec; GstElement *dvdec;
/*GstElement *cspace; */ /*GstElement *cspace; */
GstElement *deint; GstElement *deint;
GstElement *videosink; GstElement *videosink;
@ -26,76 +27,75 @@ main (int argc,char *argv[])
GtkWidget *gtk_socket; GtkWidget *gtk_socket;
gst_init(&argc,&argv); gst_init (&argc, &argv);
gnome_init("Videotest","0.0.1",argc,argv); gnome_init ("Videotest", "0.0.1", argc, argv);
bin = gst_pipeline_new("pipeline"); bin = gst_pipeline_new ("pipeline");
if (argc == 1) { if (argc == 1) {
src = gst_element_factory_make ("dv1394src", "src"); src = gst_element_factory_make ("dv1394src", "src");
} else { } else {
src = gst_element_factory_make ("filesrc", "src"); src = gst_element_factory_make ("filesrc", "src");
g_object_set(G_OBJECT(src),"location",argv[1],"bytesperread",480,NULL); g_object_set (G_OBJECT (src), "location", argv[1], "bytesperread", 480,
NULL);
} }
dvdec = gst_element_factory_make ("dvdec", "decoder"); dvdec = gst_element_factory_make ("dvdec", "decoder");
if (!dvdec) fprintf(stderr,"no dvdec\n"),exit(1); if (!dvdec)
fprintf (stderr, "no dvdec\n"), exit (1);
/* cspace = gst_element_factory_make ("colorspace", "cspace"); */ /* cspace = gst_element_factory_make ("colorspace", "cspace"); */
deint = gst_element_factory_make ("deinterlace", "deinterlace"); deint = gst_element_factory_make ("deinterlace", "deinterlace");
videosink = gst_element_factory_make ("xvideosink", "videosink"); videosink = gst_element_factory_make ("xvideosink", "videosink");
if (!videosink) fprintf(stderr,"no dvdec\n"),exit(1); if (!videosink)
g_object_set(G_OBJECT(videosink),"width",720,"height",576,NULL); fprintf (stderr, "no dvdec\n"), exit (1);
g_object_set (G_OBJECT (videosink), "width", 720, "height", 576, NULL);
gst_bin_add(GST_BIN(bin),GST_ELEMENT(src)); gst_bin_add (GST_BIN (bin), GST_ELEMENT (src));
gst_bin_add(GST_BIN(bin),GST_ELEMENT(dvdec)); gst_bin_add (GST_BIN (bin), GST_ELEMENT (dvdec));
/* gst_bin_add(GST_BIN(bin),GST_ELEMENT(cspace)); */ /* gst_bin_add(GST_BIN(bin),GST_ELEMENT(cspace)); */
gst_bin_add(GST_BIN(bin),GST_ELEMENT(videosink)); gst_bin_add (GST_BIN (bin), GST_ELEMENT (videosink));
gst_element_link(src,"src",dvdec,"sink"); gst_element_link (src, "src", dvdec, "sink");
/* gst_element_link(cspace,"src",videosink,"sink"); */ /* gst_element_link(cspace,"src",videosink,"sink"); */
/* gst_element_link(dvdec,"video",cspace,"sink"); */ /* gst_element_link(dvdec,"video",cspace,"sink"); */
gst_element_link(dvdec,"video",deint,"sink"); gst_element_link (dvdec, "video", deint, "sink");
gst_element_link(deint,"src",videosink,"sink"); gst_element_link (deint, "src", videosink, "sink");
appwindow = gnome_app_new("Videotest","Videotest"); appwindow = gnome_app_new ("Videotest", "Videotest");
vbox1 = gtk_vbox_new (FALSE, 0); vbox1 = gtk_vbox_new (FALSE, 0);
gtk_widget_show (vbox1); gtk_widget_show (vbox1);
button = gtk_button_new_with_label("test"); button = gtk_button_new_with_label ("test");
gtk_widget_show (button); gtk_widget_show (button);
gtk_box_pack_start (GTK_BOX (vbox1), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox1), button, FALSE, FALSE, 0);
draw = gst_util_get_int_arg (GTK_OBJECT (videosink), "xid"), draw = gst_util_get_int_arg (GTK_OBJECT (videosink), "xid"),
gtk_socket = gtk_socket_new ();
gtk_socket = gtk_socket_new (); gtk_widget_set_usize (gtk_socket, 720, 576);
gtk_widget_set_usize(gtk_socket,720,576);
gtk_widget_show (gtk_socket); gtk_widget_show (gtk_socket);
gnome_app_set_contents(GNOME_APP(appwindow), vbox1); gnome_app_set_contents (GNOME_APP (appwindow), vbox1);
gtk_box_pack_start (GTK_BOX (vbox1), gtk_box_pack_start (GTK_BOX (vbox1), GTK_WIDGET (gtk_socket), TRUE, TRUE, 0);
GTK_WIDGET(gtk_socket),
TRUE, TRUE, 0);
gtk_widget_realize (gtk_socket); gtk_widget_realize (gtk_socket);
gtk_socket_steal (GTK_SOCKET (gtk_socket), draw); gtk_socket_steal (GTK_SOCKET (gtk_socket), draw);
gtk_object_set(GTK_OBJECT(appwindow),"allow_grow",TRUE,NULL);
gtk_object_set(GTK_OBJECT(appwindow),"allow_shrink",TRUE,NULL);
gtk_widget_show_all(appwindow); gtk_object_set (GTK_OBJECT (appwindow), "allow_grow", TRUE, NULL);
gtk_object_set (GTK_OBJECT (appwindow), "allow_shrink", TRUE, NULL);
gtk_widget_show_all (appwindow);
#ifndef GST_DISABLE_LOADSAVE #ifndef GST_DISABLE_LOADSAVE
xmlSaveFile("dvshow.xml",gst_xml_write(GST_ELEMENT(bin))); xmlSaveFile ("dvshow.xml", gst_xml_write (GST_ELEMENT (bin)));
#endif #endif
gst_element_set_state(GST_ELEMENT(bin),GST_STATE_PLAYING); gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
g_idle_add(idle_func,bin); g_idle_add (idle_func, bin);
gtk_main(); gtk_main ();
exit (0); exit (0);
} }

File diff suppressed because it is too large Load diff