]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/gstreamer0-10.git/blob - components/bonobo-media/bonobo-media-gstreamer-factory.c
e2eb3dbc246ef26a1aae03804e293908c8b2a5e6
[glsdk/gstreamer0-10.git] / components / bonobo-media / bonobo-media-gstreamer-factory.c
1 /* bonobo-media-gstreamer-factry: Factory for GStreamer player using the
2  * Bonobo:Media interfaces
3  *
4  * Copyright (C) 2001 Ali Abdin <aliabdin@aucegypt.edu>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19  */
21 #include <gnome.h>
22 #include <glib.h>
23 #include <bonobo.h>
24 #include <liboaf/liboaf.h>
25 #include "bonobo-media-gstreamer.h"
27 #include <gst/gst.h>
28 #include <config.h>
30 static BonoboObject* gstreamer_factory (BonoboGenericFactory *factory,
31                                      gpointer user_data)
32 {
33         return BONOBO_OBJECT (bonobo_media_gstreamer_new ());
34 }
36 static void init_bonobo (int argc, char **argv)
37 {
38         CORBA_ORB orb;
40         gnome_init_with_popt_table ("bonobo-media-gstreamer", VERSION,
41                                     argc, argv,
42                                     oaf_popt_options, 0, NULL);
44         orb = oaf_init (argc, argv);
46         if (bonobo_init (orb, NULL, NULL) == FALSE)
47                 g_error ("Could not initialize Bonobo");
48 }
50 static void last_unref_cb (BonoboObject *bonobo_object,
51                            BonoboGenericFactory *factory)
52 {
53         bonobo_object_unref (BONOBO_OBJECT (factory));
54         gtk_main_quit ();
55 }
57 int main (int argc, char **argv)
58 {
59         BonoboGenericFactory *factory;
61         gst_init (&argc, &argv);
62         init_bonobo (argc, argv);
64         factory = bonobo_generic_factory_new (
65                         "OAFIID:Bonobo_Media_GStreamer_Factory",
66                         gstreamer_factory, NULL);
68         gtk_signal_connect (GTK_OBJECT (bonobo_context_running_get ()), "last_unref",
69                             GTK_SIGNAL_FUNC (last_unref_cb), factory);
71         bonobo_main ();
73         return 0;
74 }