configure.ac: Put DEFAULT_AUDIOSINK in config.h and use whereever possible. (Fixes #165997)

Original commit message from CVS:
* configure.ac: Put DEFAULT_AUDIOSINK in config.h and use
whereever possible.  (Fixes #165997)
* examples/capsfilter/capsfilter1.c: (main):
* examples/dynparams/filter.c: (create_ui):
* examples/seeking/cdparanoia.c: (get_track_info), (main):
* examples/seeking/chained.c: (main):
* examples/seeking/seek.c: (make_mod_pipeline), (make_dv_pipeline),
(make_wav_pipeline), (make_flac_pipeline), (make_sid_pipeline),
(make_vorbis_pipeline), (make_mp3_pipeline), (make_avi_pipeline),
(make_mpeg_pipeline), (make_mpegnt_pipeline):
* examples/seeking/spider_seek.c: (make_spider_pipeline):
* examples/switch/switcher.c: (main):
* ext/dv/demo-play.c: (main):
* ext/faad/gstfaad.c: (gst_faad_change_state):
* ext/mad/gstmad.c: (gst_mad_chain):
* ext/smoothwave/demo-osssrc.c: (main):
* gst-libs/gst/gconf/gconf.c: (gst_gconf_set_string),
(gst_gconf_render_bin_from_description),
(gst_gconf_get_default_audio_sink),
(gst_gconf_get_default_video_sink),
(gst_gconf_get_default_audio_src),
(gst_gconf_get_default_video_src),
(gst_gconf_get_default_visualization_element):
* gst/level/demo.c: (main):
* gst/level/plot.c: (main):
* gst/playback/gstplaybin.c: (gen_video_element),
(gen_audio_element):
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/playondemand/demo-mp3.c: (setup_pipeline):
* gst/sine/demo-dparams.c: (main):
* gst/spectrum/demo-osssrc.c: (main):
* gst/speed/demo-mp3.c: (main):
* gst/volume/demo.c: (main):
* testsuite/embed/embed.c: (main):
This commit is contained in:
David Schleef 2005-02-02 08:14:01 +00:00
parent a1a0c43c24
commit 4785be863a
24 changed files with 197 additions and 111 deletions

View file

@ -1,3 +1,40 @@
2005-02-02 David Schleef <ds@schleef.org>
* configure.ac: Put DEFAULT_AUDIOSINK in config.h and use
whereever possible. (Fixes #165997)
* examples/capsfilter/capsfilter1.c: (main):
* examples/dynparams/filter.c: (create_ui):
* examples/seeking/cdparanoia.c: (get_track_info), (main):
* examples/seeking/chained.c: (main):
* examples/seeking/seek.c: (make_mod_pipeline), (make_dv_pipeline),
(make_wav_pipeline), (make_flac_pipeline), (make_sid_pipeline),
(make_vorbis_pipeline), (make_mp3_pipeline), (make_avi_pipeline),
(make_mpeg_pipeline), (make_mpegnt_pipeline):
* examples/seeking/spider_seek.c: (make_spider_pipeline):
* examples/switch/switcher.c: (main):
* ext/dv/demo-play.c: (main):
* ext/faad/gstfaad.c: (gst_faad_change_state):
* ext/mad/gstmad.c: (gst_mad_chain):
* ext/smoothwave/demo-osssrc.c: (main):
* gst-libs/gst/gconf/gconf.c: (gst_gconf_set_string),
(gst_gconf_render_bin_from_description),
(gst_gconf_get_default_audio_sink),
(gst_gconf_get_default_video_sink),
(gst_gconf_get_default_audio_src),
(gst_gconf_get_default_video_src),
(gst_gconf_get_default_visualization_element):
* gst/level/demo.c: (main):
* gst/level/plot.c: (main):
* gst/playback/gstplaybin.c: (gen_video_element),
(gen_audio_element):
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/playondemand/demo-mp3.c: (setup_pipeline):
* gst/sine/demo-dparams.c: (main):
* gst/spectrum/demo-osssrc.c: (main):
* gst/speed/demo-mp3.c: (main):
* gst/volume/demo.c: (main):
* testsuite/embed/embed.c: (main):
2005-02-02 Jan Schmidt <thaytan@mad.scientist.com>
* gst/tcp/gsttcpclientsink.c: (gst_tcpclientsink_class_init),

View file

@ -119,10 +119,15 @@ case "$host" in
esac
AC_SUBST(DEFAULT_AUDIOSINK)
AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK,"$DEFAULT_AUDIOSINK",[Default audio sink])
AC_SUBST(DEFAULT_AUDIOSRC)
AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC,"$DEFAULT_AUDIOSRC",[Default audio source])
AC_SUBST(DEFAULT_VIDEOSINK)
AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK,"$DEFAULT_VIDEOSINK",[Default video sink])
AC_SUBST(DEFAULT_VIDEOSRC)
AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC,"$DEFAULT_VIDEOSRC",[Default video source])
AC_SUBST(DEFAULT_VISUALIZER)
AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER,"$DEFAULT_VISUALIZER",[Default visualizer])
dnl ############################################
dnl # Super Duper options for plug-in building #
@ -335,6 +340,7 @@ fi
AM_CONDITIONAL(HAVE_GDK_LOADERS, test "x$HAVE_GDK_LOADERS" = "xyes")
PKG_CHECK_MODULES(LIBOIL, liboil-0.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
#PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
AC_SUBST(LIBOIL_CFLAGS)
AC_SUBST(LIBOIL_LIBS)
if test "x${HAVE_LIBOIL}" = xyes ; then

View file

@ -54,7 +54,7 @@ main (gint argc, gchar * argv[])
g_return_val_if_fail (mpeg2dec, -1);
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");
g_return_val_if_fail (colorspace, -1);
videosink = gst_element_factory_make ("ximagesink", "videosink");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "videosink");
g_return_val_if_fail (videosink, -1);
gst_bin_add (GST_BIN (pipeline), filesrc);

View file

@ -7,6 +7,9 @@
* you can also enter an input and output part of a pipeline
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
@ -481,7 +484,7 @@ create_ui (_filter_ui_t * fui, _filter_data_t * fd)
widget = gtk_label_new ("Output Pipe");
gtk_container_add (GTK_CONTAINER (vbox), widget);
fui->output = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (fui->output), "osssink fragment=1572872"); /* fixme: gconf default ? */
gtk_entry_set_text (GTK_ENTRY (fui->output), DEFAULT_AUDIOSINK);
gtk_container_add (GTK_CONTAINER (vbox), fui->output);
gtk_container_add (GTK_CONTAINER (fui->selection), vbox);
g_signal_connect (G_OBJECT (fui->output), "activate",

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <gst/gst.h>
#include <string.h>
@ -132,7 +135,7 @@ main (int argc, char **argv)
{
GstElement *pipeline;
GstElement *cdparanoia;
GstElement *osssink;
GstElement *audiosink;
GstPad *pad;
GstFormat track_format;
GstEvent *event;
@ -147,13 +150,13 @@ main (int argc, char **argv)
g_assert (cdparanoia);
g_object_set (G_OBJECT (cdparanoia), "paranoia_mode", 0, NULL);
osssink = gst_element_factory_make ("osssink", "osssink");
g_assert (osssink);
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, DEFAULT_AUDIOSINK);
g_assert (audiosink);
gst_bin_add (GST_BIN (pipeline), cdparanoia);
gst_bin_add (GST_BIN (pipeline), osssink);
gst_bin_add (GST_BIN (pipeline), audiosink);
gst_element_link_pads (cdparanoia, "src", osssink, "sink");
gst_element_link_pads (cdparanoia, "src", audiosink, "sink");
g_signal_connect (G_OBJECT (pipeline), "deep_notify",
G_CALLBACK (gst_element_default_deep_notify), NULL);

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <gst/gst.h>
#include <string.h>
@ -44,7 +47,7 @@ main (int argc, char **argv)
GstElement *oggdemux;
GstElement *vorbisdec;
GstElement *audioconvert;
GstElement *osssink;
GstElement *audiosink;
gst_init (&argc, &argv);
@ -75,14 +78,14 @@ main (int argc, char **argv)
g_assert (vorbisdec);
audioconvert = gst_element_factory_make ("audioconvert", "audioconvert");
g_assert (audioconvert);
osssink = gst_element_factory_make ("osssink", "osssink");
g_assert (osssink);
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, DEFAULT_AUDIOSINK);
g_assert (audiosink);
gst_bin_add (GST_BIN (bin), vorbisdec);
gst_bin_add (GST_BIN (bin), audioconvert);
gst_bin_add (GST_BIN (bin), osssink);
gst_bin_add (GST_BIN (bin), audiosink);
gst_element_link_pads (vorbisdec, "src", audioconvert, "sink");
gst_element_link_pads (audioconvert, "src", osssink, "sink");
gst_element_link_pads (audioconvert, "src", audiosink, "sink");
gst_element_add_ghost_pad (bin, gst_element_get_pad (vorbisdec, "sink"),
"sink");

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
@ -88,7 +91,7 @@ make_mod_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("modplug", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -119,8 +122,8 @@ make_dv_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("dvdec", "decoder");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -156,7 +159,7 @@ make_wav_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("wavparse", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -187,7 +190,7 @@ make_flac_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("flacdec", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -218,7 +221,7 @@ make_sid_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("siddec", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -281,7 +284,7 @@ make_vorbis_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("vorbisfile", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
g_object_set (G_OBJECT (audiosink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -305,7 +308,7 @@ static GstElement *
make_mp3_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *osssink, *queue, *audio_thread;
GstElement *src, *decoder, *audiosink, *queue, *audio_thread;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
@ -313,24 +316,24 @@ make_mp3_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("mad", "dec");
queue = gst_element_factory_make_or_warn ("queue", "queue");
osssink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
audio_thread = gst_thread_new ("a_decoder_thread");
seekable_elements = g_list_prepend (seekable_elements, osssink);
seekable_elements = g_list_prepend (seekable_elements, audiosink);
g_object_set (G_OBJECT (src), "location", location, NULL);
g_object_set (G_OBJECT (osssink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (audio_thread), queue);
gst_bin_add (GST_BIN (audio_thread), osssink);
gst_bin_add (GST_BIN (audio_thread), audiosink);
gst_bin_add (GST_BIN (pipeline), audio_thread);
gst_element_link (src, decoder);
gst_element_link (decoder, queue);
gst_element_link (queue, osssink);
gst_element_link (queue, audiosink);
seekable = gst_element_get_pad (queue, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
@ -364,7 +367,7 @@ make_avi_pipeline (const gchar * location)
audio_bin = gst_bin_new ("a_decoder_bin");
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
gst_element_link (a_decoder, a_queue);
@ -389,7 +392,7 @@ make_avi_pipeline (const gchar * location)
//v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
v_decoder = gst_element_factory_make_or_warn ("ffmpegdecall", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
//videosink = gst_element_factory_make_or_warn ("fakesink", "v_sink");
//g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
@ -442,7 +445,7 @@ make_mpeg_pipeline (const gchar * location)
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
gst_element_link (a_decoder, a_queue);
gst_element_link (a_queue, audiosink);
@ -466,7 +469,7 @@ make_mpeg_pipeline (const gchar * location)
//g_object_set (G_OBJECT (video_thread), "priority", 2, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
gst_element_link_many (v_decoder, v_queue, v_filter, NULL);
gst_element_link (v_filter, videosink);
@ -512,7 +515,7 @@ make_mpegnt_pipeline (const gchar * location)
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
gst_element_link (a_decoder, a_queue);
@ -534,7 +537,7 @@ make_mpegnt_pipeline (const gchar * location)
video_bin = gst_bin_new ("v_decoder_bin");
v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec");
v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
gst_element_link_many (v_decoder, v_filter, videosink, NULL);
gst_bin_add_many (GST_BIN (video_bin), v_decoder, v_filter, videosink, NULL);

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
@ -37,12 +40,12 @@ make_spider_pipeline (const gchar * location, gboolean thread)
decoder = gst_element_factory_make ("spider", "decoder");
a_thread = gst_thread_new ("a_thread");
a_queue = gst_element_factory_make ("queue", "a_queue");
audiosink = gst_element_factory_make ("osssink", "a_sink");
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
v_thread = gst_thread_new ("v_thread");
v_queue = gst_element_factory_make ("queue", "v_queue");
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "v_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);

View file

@ -77,7 +77,7 @@ main (int argc, char *argv[])
src2 = gst_element_factory_make ("videotestsrc", "src2");
g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
video_switch = gst_element_factory_make ("switch", "video_switch");
video_sink = gst_element_factory_make ("ximagesink", "video_sink");
video_sink = gst_element_factory_make (DEFAULT_VIDEOSINK, "video_sink");
gst_bin_add_many (GST_BIN (pipeline), src1, src2, video_switch,
video_sink, NULL);

View file

@ -123,7 +123,7 @@ gst_gconf_set_string (const gchar * key, const gchar * value)
gconf_client_set_string (gst_gconf_get_client (), full_key, value, &error);
if (error) {
g_print ("gst_gconf_set_string: error: %s\n", error->message);
GST_ERROR ("gst_gconf_set_string: error: %s\n", error->message);
g_error_free (error);
}
g_free (full_key);
@ -150,7 +150,7 @@ gst_gconf_render_bin_from_description (const gchar * description)
bin = GST_ELEMENT (gst_parse_launch (desc, &error));
g_free (desc);
if (error) {
g_print ("DEBUG: gstgconf: error parsing pipeline %s\n%s\n",
GST_ERROR ("gstgconf: error parsing pipeline %s\n%s\n",
description, error->message);
g_error_free (error);
return NULL;
@ -191,7 +191,8 @@ gst_gconf_render_bin_from_key (const gchar * key)
* gst_gconf_get_default_audio_sink:
*
* Render audio output bin from GStreamer GConf key : "default/audiosink".
* If key is invalid osssink is used as default output plugin.
* If key is invalid, the default audio sink for the platform is used
* (typically osssink or sunaudiosink).
*
* Returns: a #GstElement containing the audio output bin, or NULL if
* everything failed.
@ -202,12 +203,11 @@ gst_gconf_get_default_audio_sink (void)
GstElement *ret = gst_gconf_render_bin_from_key ("default/audiosink");
if (!ret) {
ret = gst_element_factory_make ("osssink", NULL);
ret = gst_element_factory_make (DEFAULT_AUDIOSINK, NULL);
if (!ret)
g_warning ("No GConf default audio sink key and osssink doesn't work");
else
g_print ("GConf audio sink not found, using osssink\n");
g_warning ("No GConf default audio sink key and %s doesn't work",
DEFAULT_AUDIOSINK);
}
return ret;
@ -217,7 +217,8 @@ gst_gconf_get_default_audio_sink (void)
* gst_gconf_get_default_video_sink:
*
* Render video output bin from GStreamer GConf key : "default/videosink".
* If key is invalid ximagesink is used as default output plugin.
* If key is invalid, the default video sink for the platform is used
* (typically xvimagesink or ximagesink).
*
* Returns: a #GstElement containing the video output bin, or NULL if
* everything failed.
@ -228,12 +229,11 @@ gst_gconf_get_default_video_sink (void)
GstElement *ret = gst_gconf_render_bin_from_key ("default/videosink");
if (!ret) {
ret = gst_element_factory_make ("ximagesink", NULL);
ret = gst_element_factory_make (DEFAULT_VIDEOSINK, NULL);
if (!ret)
g_warning ("No GConf default video sink key and ximagesink doesn't work");
else
g_print ("GConf video sink not found, using ximagesink\n");
g_warning ("No GConf default video sink key and %s doesn't work",
DEFAULT_VIDEOSINK);
}
return ret;
@ -243,7 +243,8 @@ gst_gconf_get_default_video_sink (void)
* gst_gconf_get_default_audio_src:
*
* Render audio acquisition bin from GStreamer GConf key : "default/audiosrc".
* If key is invalid osssrc is used as default source.
* If key is invalid, the default audio source for the plaform is used.
* (typically osssrc or sunaudiosrc).
*
* Returns: a #GstElement containing the audio source bin, or NULL if
* everything failed.
@ -254,12 +255,11 @@ gst_gconf_get_default_audio_src (void)
GstElement *ret = gst_gconf_render_bin_from_key ("default/audiosrc");
if (!ret) {
ret = gst_element_factory_make ("osssrc", NULL);
ret = gst_element_factory_make (DEFAULT_AUDIOSRC, NULL);
if (!ret)
g_warning ("No GConf default audio src key and osssrc doesn't work");
else
g_print ("GConf audio src not found, using osssrc\n");
g_warning ("No GConf default audio src key and %s doesn't work",
DEFAULT_AUDIOSRC);
}
return ret;
@ -269,8 +269,8 @@ gst_gconf_get_default_audio_src (void)
* gst_gconf_get_default_video_src:
*
* Render video acquisition bin from GStreamer GConf key :
* "default/videosrc". If key is invalid videotestsrc
* is used as default source.
* "default/videosrc". If key is invalid, the default video source
* for the platform is used (typically videotestsrc).
*
* Returns: a #GstElement containing the video source bin, or NULL if
* everything failed.
@ -281,12 +281,11 @@ gst_gconf_get_default_video_src (void)
GstElement *ret = gst_gconf_render_bin_from_key ("default/videosrc");
if (!ret) {
ret = gst_element_factory_make ("videotestsrc", NULL);
ret = gst_element_factory_make (DEFAULT_VIDEOSRC, NULL);
if (!ret)
g_warning ("No GConf default video src key and videotestrc doesn't work");
else
g_print ("GConf video src not found, using videotestrc\n");
g_warning ("No GConf default video src key and %s doesn't work",
DEFAULT_VIDEOSRC);
}
return ret;
@ -296,7 +295,7 @@ gst_gconf_get_default_video_src (void)
* gst_gconf_get_default_visualization_element:
*
* Render visualization bin from GStreamer GConf key : "default/visualization".
* If key is invalid goom is used as default visualization element.
* If key is invalid, the default visualization element is used.
*
* Returns: a #GstElement containing the visualization bin, or NULL if
* everything failed.
@ -307,13 +306,12 @@ gst_gconf_get_default_visualization_element (void)
GstElement *ret = gst_gconf_render_bin_from_key ("default/visualization");
if (!ret) {
ret = gst_element_factory_make ("goom", NULL);
ret = gst_element_factory_make (DEFAULT_VISUALIZER, NULL);
if (!ret)
g_warning
("No GConf default visualization plugin key and goom doesn't work");
else
g_print ("GConf visualization plugin not found, using goom\n");
("No GConf default visualization plugin key and %s doesn't work",
DEFAULT_VISUALIZER);
}
return ret;

View file

@ -406,7 +406,7 @@ gen_video_element (GstPlayBin * play_bin)
if (play_bin->video_sink) {
sink = play_bin->video_sink;
} else {
sink = gst_element_factory_make ("xvimagesink", "sink");
sink = gst_element_factory_make (DEFAULT_VIDEOSINK, "sink");
}
gst_object_ref (GST_OBJECT (sink));
g_hash_table_insert (play_bin->cache, "video_sink", sink);
@ -511,7 +511,7 @@ gen_audio_element (GstPlayBin * play_bin)
if (play_bin->audio_sink) {
sink = play_bin->audio_sink;
} else {
sink = gst_element_factory_make ("osssink", "sink");
sink = gst_element_factory_make (DEFAULT_AUDIOSINK, "sink");
play_bin->audio_sink = GST_ELEMENT (gst_object_ref (GST_OBJECT (sink)));
}

View file

@ -16,6 +16,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
static GstElement *
@ -27,7 +30,7 @@ gen_video_element ()
element = gst_thread_new ("vbin");
conv = gst_element_factory_make ("ffmpegcolorspace", "conv");
sink = gst_element_factory_make ("ximagesink", "sink");
sink = gst_element_factory_make (DEFAULT_VIDEOSINK, "sink");
gst_bin_add (GST_BIN (element), conv);
gst_bin_add (GST_BIN (element), sink);
@ -48,7 +51,7 @@ gen_audio_element ()
element = gst_thread_new ("abin");
conv = gst_element_factory_make ("audioconvert", "conv");
sink = gst_element_factory_make ("osssink", "sink");
sink = gst_element_factory_make (DEFAULT_AUDIOSINK, "sink");
gst_bin_add (GST_BIN (element), conv);
gst_bin_add (GST_BIN (element), sink);

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <math.h>
@ -50,7 +53,7 @@ main (int argc, char *argv[])
GtkWidget *volume_slider;
GtkWidget *freq_slider;
GstElement *thread, *sinesrc, *volfilter, *osssink;
GstElement *thread, *sinesrc, *volfilter, *audiosink;
GstDParamManager *dpman;
GstDParam *volume;
GstDParam *freq;
@ -65,13 +68,13 @@ main (int argc, char *argv[])
g_print ("creating elements\n");
thread = gst_thread_new ("live-example");
sinesrc = gst_element_factory_make ("sinesrc", "sine-source");
osssink = gst_element_factory_make ("osssink", "sound-sink");
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, "sound-sink");
volfilter = gst_element_factory_make ("volume", "volume-filter");
gst_bin_add_many (GST_BIN (thread), sinesrc, volfilter, osssink, NULL);
gst_element_link_many (sinesrc, volfilter, osssink, NULL);
gst_bin_add_many (GST_BIN (thread), sinesrc, volfilter, audiosink, NULL);
gst_element_link_many (sinesrc, volfilter, audiosink, NULL);
/* this breaks with current alsa oss compat lib */
g_object_set (G_OBJECT (osssink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (osssink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (sinesrc), "samplesperbuffer", 1024, NULL);

View file

@ -112,7 +112,7 @@ main (int argc, char *argv[])
if (error) {
g_print ("pipeline could not be constructed: %s\n", error->message);
g_print ("Please give a complete pipeline with a 'volume' element.\n");
g_print ("Example: sinesrc ! volume ! osssink\n");
g_print ("Example: sinesrc ! volume ! %s\n", DEFAULT_AUDIOSINK);
g_error_free (error);
return 1;
}

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
@ -88,7 +91,7 @@ make_mod_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("modplug", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -119,8 +122,8 @@ make_dv_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("dvdec", "decoder");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -156,7 +159,7 @@ make_wav_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("wavparse", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -187,7 +190,7 @@ make_flac_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("flacdec", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -218,7 +221,7 @@ make_sid_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("siddec", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -281,7 +284,7 @@ make_vorbis_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("vorbisfile", "decoder");
audiosink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
g_object_set (G_OBJECT (audiosink), "sync", TRUE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);
@ -305,7 +308,7 @@ static GstElement *
make_mp3_pipeline (const gchar * location)
{
GstElement *pipeline;
GstElement *src, *decoder, *osssink, *queue, *audio_thread;
GstElement *src, *decoder, *audiosink, *queue, *audio_thread;
GstPad *seekable;
pipeline = gst_pipeline_new ("app");
@ -313,24 +316,24 @@ make_mp3_pipeline (const gchar * location)
src = gst_element_factory_make_or_warn (SOURCE, "src");
decoder = gst_element_factory_make_or_warn ("mad", "dec");
queue = gst_element_factory_make_or_warn ("queue", "queue");
osssink = gst_element_factory_make_or_warn ("osssink", "sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "sink");
audio_thread = gst_thread_new ("a_decoder_thread");
seekable_elements = g_list_prepend (seekable_elements, osssink);
seekable_elements = g_list_prepend (seekable_elements, audiosink);
g_object_set (G_OBJECT (src), "location", location, NULL);
g_object_set (G_OBJECT (osssink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
gst_bin_add (GST_BIN (pipeline), src);
gst_bin_add (GST_BIN (pipeline), decoder);
gst_bin_add (GST_BIN (audio_thread), queue);
gst_bin_add (GST_BIN (audio_thread), osssink);
gst_bin_add (GST_BIN (audio_thread), audiosink);
gst_bin_add (GST_BIN (pipeline), audio_thread);
gst_element_link (src, decoder);
gst_element_link (decoder, queue);
gst_element_link (queue, osssink);
gst_element_link (queue, audiosink);
seekable = gst_element_get_pad (queue, "src");
seekable_pads = g_list_prepend (seekable_pads, seekable);
@ -364,7 +367,7 @@ make_avi_pipeline (const gchar * location)
audio_bin = gst_bin_new ("a_decoder_bin");
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
gst_element_link (a_decoder, a_queue);
@ -389,7 +392,7 @@ make_avi_pipeline (const gchar * location)
//v_decoder = gst_element_factory_make_or_warn ("windec", "v_dec");
v_decoder = gst_element_factory_make_or_warn ("ffmpegdecall", "v_dec");
video_thread = gst_thread_new ("v_decoder_thread");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
//videosink = gst_element_factory_make_or_warn ("fakesink", "v_sink");
//g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
@ -442,7 +445,7 @@ make_mpeg_pipeline (const gchar * location)
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
gst_element_link (a_decoder, a_queue);
gst_element_link (a_queue, audiosink);
@ -466,7 +469,7 @@ make_mpeg_pipeline (const gchar * location)
//g_object_set (G_OBJECT (video_thread), "priority", 2, NULL);
v_queue = gst_element_factory_make_or_warn ("queue", "v_queue");
v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
gst_element_link_many (v_decoder, v_queue, v_filter, NULL);
gst_element_link (v_filter, videosink);
@ -512,7 +515,7 @@ make_mpegnt_pipeline (const gchar * location)
a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec");
audio_thread = gst_thread_new ("a_decoder_thread");
a_queue = gst_element_factory_make_or_warn ("queue", "a_queue");
audiosink = gst_element_factory_make_or_warn ("osssink", "a_sink");
audiosink = gst_element_factory_make_or_warn (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
gst_element_link (a_decoder, a_queue);
@ -534,7 +537,7 @@ make_mpegnt_pipeline (const gchar * location)
video_bin = gst_bin_new ("v_decoder_bin");
v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec");
v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter");
videosink = gst_element_factory_make_or_warn ("ximagesink", "v_sink");
videosink = gst_element_factory_make_or_warn (DEFAULT_VIDEOSINK, "v_sink");
gst_element_link_many (v_decoder, v_filter, videosink, NULL);
gst_bin_add_many (GST_BIN (video_bin), v_decoder, v_filter, videosink, NULL);

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
@ -37,12 +40,12 @@ make_spider_pipeline (const gchar * location, gboolean thread)
decoder = gst_element_factory_make ("spider", "decoder");
a_thread = gst_thread_new ("a_thread");
a_queue = gst_element_factory_make ("queue", "a_queue");
audiosink = gst_element_factory_make ("osssink", "a_sink");
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
v_thread = gst_thread_new ("v_thread");
v_queue = gst_element_factory_make ("queue", "v_queue");
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "v_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);

View file

@ -54,7 +54,7 @@ main (gint argc, gchar * argv[])
g_return_val_if_fail (mpeg2dec, -1);
colorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");
g_return_val_if_fail (colorspace, -1);
videosink = gst_element_factory_make ("ximagesink", "videosink");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "videosink");
g_return_val_if_fail (videosink, -1);
gst_bin_add (GST_BIN (pipeline), filesrc);

View file

@ -7,6 +7,9 @@
* you can also enter an input and output part of a pipeline
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
@ -481,7 +484,7 @@ create_ui (_filter_ui_t * fui, _filter_data_t * fd)
widget = gtk_label_new ("Output Pipe");
gtk_container_add (GTK_CONTAINER (vbox), widget);
fui->output = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (fui->output), "osssink fragment=1572872"); /* fixme: gconf default ? */
gtk_entry_set_text (GTK_ENTRY (fui->output), DEFAULT_AUDIOSINK);
gtk_container_add (GTK_CONTAINER (vbox), fui->output);
gtk_container_add (GTK_CONTAINER (fui->selection), vbox);
g_signal_connect (G_OBJECT (fui->output), "activate",

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <gst/gst.h>
#include <string.h>
@ -132,7 +135,7 @@ main (int argc, char **argv)
{
GstElement *pipeline;
GstElement *cdparanoia;
GstElement *osssink;
GstElement *audiosink;
GstPad *pad;
GstFormat track_format;
GstEvent *event;
@ -147,13 +150,13 @@ main (int argc, char **argv)
g_assert (cdparanoia);
g_object_set (G_OBJECT (cdparanoia), "paranoia_mode", 0, NULL);
osssink = gst_element_factory_make ("osssink", "osssink");
g_assert (osssink);
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, DEFAULT_AUDIOSINK);
g_assert (audiosink);
gst_bin_add (GST_BIN (pipeline), cdparanoia);
gst_bin_add (GST_BIN (pipeline), osssink);
gst_bin_add (GST_BIN (pipeline), audiosink);
gst_element_link_pads (cdparanoia, "src", osssink, "sink");
gst_element_link_pads (cdparanoia, "src", audiosink, "sink");
g_signal_connect (G_OBJECT (pipeline), "deep_notify",
G_CALLBACK (gst_element_default_deep_notify), NULL);

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <gst/gst.h>
#include <string.h>
@ -44,7 +47,7 @@ main (int argc, char **argv)
GstElement *oggdemux;
GstElement *vorbisdec;
GstElement *audioconvert;
GstElement *osssink;
GstElement *audiosink;
gst_init (&argc, &argv);
@ -75,14 +78,14 @@ main (int argc, char **argv)
g_assert (vorbisdec);
audioconvert = gst_element_factory_make ("audioconvert", "audioconvert");
g_assert (audioconvert);
osssink = gst_element_factory_make ("osssink", "osssink");
g_assert (osssink);
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, DEFAULT_AUDIOSINK);
g_assert (audiosink);
gst_bin_add (GST_BIN (bin), vorbisdec);
gst_bin_add (GST_BIN (bin), audioconvert);
gst_bin_add (GST_BIN (bin), osssink);
gst_bin_add (GST_BIN (bin), audiosink);
gst_element_link_pads (vorbisdec, "src", audioconvert, "sink");
gst_element_link_pads (audioconvert, "src", osssink, "sink");
gst_element_link_pads (audioconvert, "src", audiosink, "sink");
gst_element_add_ghost_pad (bin, gst_element_get_pad (vorbisdec, "sink"),
"sink");

View file

@ -1,3 +1,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <glib.h>
#include <gtk/gtk.h>
@ -37,12 +40,12 @@ make_spider_pipeline (const gchar * location, gboolean thread)
decoder = gst_element_factory_make ("spider", "decoder");
a_thread = gst_thread_new ("a_thread");
a_queue = gst_element_factory_make ("queue", "a_queue");
audiosink = gst_element_factory_make ("osssink", "a_sink");
audiosink = gst_element_factory_make (DEFAULT_AUDIOSINK, "a_sink");
//g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL);
v_thread = gst_thread_new ("v_thread");
v_queue = gst_element_factory_make ("queue", "v_queue");
videosink = gst_element_factory_make ("xvimagesink", "v_sink");
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "v_sink");
//g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
g_object_set (G_OBJECT (src), "location", location, NULL);

View file

@ -77,7 +77,7 @@ main (int argc, char *argv[])
src2 = gst_element_factory_make ("videotestsrc", "src2");
g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
video_switch = gst_element_factory_make ("switch", "video_switch");
video_sink = gst_element_factory_make ("ximagesink", "video_sink");
video_sink = gst_element_factory_make (DEFAULT_VIDEOSINK, "video_sink");
gst_bin_add_many (GST_BIN (pipeline), src1, src2, video_switch,
video_sink, NULL);

View file

@ -2,6 +2,9 @@
* Sample app for element embedding.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/xoverlay/xoverlay.h>
#include <gtk/gtk.h>
@ -29,7 +32,7 @@ main (int argc, char *argv[])
pipeline = gst_element_factory_make ("pipeline", NULL);
testsrc = gst_element_factory_make ("videotestsrc", NULL);
csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
videosink = gst_element_factory_make ("xvimagesink", NULL);
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);

View file

@ -2,6 +2,9 @@
* Sample app for element embedding.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/xoverlay/xoverlay.h>
#include <gtk/gtk.h>
@ -29,7 +32,7 @@ main (int argc, char *argv[])
pipeline = gst_element_factory_make ("pipeline", NULL);
testsrc = gst_element_factory_make ("videotestsrc", NULL);
csp = gst_element_factory_make ("ffmpegcolorspace", NULL);
videosink = gst_element_factory_make ("xvimagesink", NULL);
videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, NULL);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);