Commit 0f75bf8d authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

a no-brainer addition

Original commit message from CVS:
a no-brainer addition
parent 3db8587d
...@@ -167,6 +167,40 @@ gst_gconf_get_default_video_sink (void) ...@@ -167,6 +167,40 @@ gst_gconf_get_default_video_sink (void)
return ret; return ret;
} }
GstElement *
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);
if (!ret)
g_warning ("No GConf default audio src key and osssrc doesn't work");
else
g_warning ("GConf audio src not found, using osssrc");
}
return ret;
}
GstElement *
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);
if (!ret)
g_warning ("No GConf default video src key and videotestrc doesn't work");
else
g_warning ("GConf video src not found, using videotestrc");
}
return ret;
}
static gboolean static gboolean
plugin_init (GModule *module, GstPlugin *plugin) plugin_init (GModule *module, GstPlugin *plugin)
{ {
......
...@@ -17,6 +17,8 @@ GstElement * gst_gconf_render_bin_from_description (const gchar *description); ...@@ -17,6 +17,8 @@ GstElement * gst_gconf_render_bin_from_description (const gchar *description);
GstElement * gst_gconf_get_default_video_sink (void); GstElement * gst_gconf_get_default_video_sink (void);
GstElement * gst_gconf_get_default_audio_sink (void); GstElement * gst_gconf_get_default_audio_sink (void);
GstElement * gst_gconf_get_default_video_src (void);
GstElement * gst_gconf_get_default_audio_src (void);
/* /*
guint gst_gconf_notify_add (const gchar *key, guint gst_gconf_notify_add (const gchar *key,
......
...@@ -7,5 +7,9 @@ main (int argc, char *argv[]) ...@@ -7,5 +7,9 @@ main (int argc, char *argv[])
gst_gconf_get_string ("default/videosink")); gst_gconf_get_string ("default/videosink"));
printf ("Default audio sink : %s\n", printf ("Default audio sink : %s\n",
gst_gconf_get_string ("default/audiosink")); gst_gconf_get_string ("default/audiosink"));
printf ("Default video src : %s\n",
gst_gconf_get_string ("default/videosrc"));
printf ("Default audio src : %s\n",
gst_gconf_get_string ("default/audiosrc"));
return 0; return 0;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment