diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-04-13 13:41:20 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-04-13 13:41:20 +0000 |
commit | 766aee18aaa0c139b483ba5774bdad24cdc706e2 (patch) | |
tree | 18fe5c44d1549af55552de0a7f5c4580f1891623 /examples/gstplay | |
parent | caedd30afbb9533194edbdb2fa6a58d050e4e087 (diff) | |
download | gst-plugins-bad-766aee18aaa0c139b483ba5774bdad24cdc706e2.tar.gz gst-plugins-bad-766aee18aaa0c139b483ba5774bdad24cdc706e2.tar.bz2 gst-plugins-bad-766aee18aaa0c139b483ba5774bdad24cdc706e2.zip |
make player example use gconf
Original commit message from CVS:
make player example use gconf
Diffstat (limited to 'examples/gstplay')
-rw-r--r-- | examples/gstplay/Makefile.am | 3 | ||||
-rw-r--r-- | examples/gstplay/player.c | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/examples/gstplay/Makefile.am b/examples/gstplay/Makefile.am index 795fc362..cbae9cbf 100644 --- a/examples/gstplay/Makefile.am +++ b/examples/gstplay/Makefile.am @@ -2,9 +2,10 @@ noinst_PROGRAMS = player player_SOURCES = player.c -player_CFLAGS = $(GST_CFLAGS) +player_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) player_LDFLAGS = \ $(GST_LIBS) \ + $(top_builddir)/gst-libs/gst/gconf/libgstgconf-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/play/libgstplay-@GST_MAJORMINOR@.la \ $(top_builddir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la diff --git a/examples/gstplay/player.c b/examples/gstplay/player.c index 92cb9bc7..4258d645 100644 --- a/examples/gstplay/player.c +++ b/examples/gstplay/player.c @@ -18,6 +18,7 @@ */ #include <gst/play/play.h> +#include <gst/gconf/gconf.h> static GMainLoop *loop = NULL; static gint64 length = 0; @@ -121,11 +122,17 @@ main (int argc, char *argv[]) } /* Getting default audio and video plugins from GConf */ - audio_sink = gst_element_factory_make ("osssink", "audio_sink"); - video_sink = gst_element_factory_make ("ximagesink", "video_sink"); vis_element = gst_element_factory_make ("goom", "vis_element"); data_src = gst_element_factory_make ("gnomevfssrc", "source"); + audio_sink = gst_gconf_get_default_audio_sink (); + if (!GST_IS_ELEMENT (audio_sink)) + g_error ("Could not get default audio sink from GConf"); + video_sink = gst_gconf_get_default_video_sink (); + if (!GST_IS_ELEMENT (video_sink)) + g_error ("Could not get default video sink from GConf"); + + /* Let's send them to GstPlay object */ if (!gst_play_set_audio_sink (play, audio_sink)) g_warning ("Could not set audio sink"); @@ -158,7 +165,7 @@ main (int argc, char *argv[]) /* Change state to PLAYING */ if (gst_element_set_state (GST_ELEMENT (play), GST_STATE_PLAYING) == GST_STATE_FAILURE) - g_warning ("Could not set state to PLAYING"); + g_error ("Could not set state to PLAYING"); g_idle_add ((GSourceFunc) idle_iterate, play); g_timeout_add (20000, (GSourceFunc) seek_timer, play); |