mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 00:06:36 +00:00
ext/gconf/: In gconfaudiosink, get the right key as the old key in do_toggle (ie. one dependent on the profile select...
Original commit message from CVS: * ext/gconf/gconf.c: (gst_gconf_get_key_for_sink_profile), (gst_gconf_render_bin_from_key), (gst_gconf_get_default_audio_sink): * ext/gconf/gconf.h: * ext/gconf/gstgconfaudiosink.c: (get_gconf_key_for_profile), (do_toggle_element), (gst_gconf_audio_sink_set_property), (gst_gconf_audio_sink_get_property): In gconfaudiosink, get the right key as the old key in do_toggle (ie. one dependent on the profile selected). Log some more stuff so we can see what's actually going on.
This commit is contained in:
parent
cdba2c4219
commit
881308d5c5
4 changed files with 54 additions and 31 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2007-02-06 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
|
* ext/gconf/gconf.c: (gst_gconf_get_key_for_sink_profile),
|
||||||
|
(gst_gconf_render_bin_from_key),
|
||||||
|
(gst_gconf_get_default_audio_sink):
|
||||||
|
* ext/gconf/gconf.h:
|
||||||
|
* ext/gconf/gstgconfaudiosink.c: (get_gconf_key_for_profile),
|
||||||
|
(do_toggle_element), (gst_gconf_audio_sink_set_property),
|
||||||
|
(gst_gconf_audio_sink_get_property):
|
||||||
|
In gconfaudiosink, get the right key as the old key in do_toggle
|
||||||
|
(ie. one dependent on the profile selected). Log some more stuff so
|
||||||
|
we can see what's actually going on.
|
||||||
|
|
||||||
2007-02-06 Sebastian Dröge <slomo@circular-chaos.org>
|
2007-02-06 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* gst/audiofx/audioamplify.c: (gst_audio_amplify_base_init),
|
* gst/audiofx/audioamplify.c: (gst_audio_amplify_base_init),
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gconf.h"
|
#include "gconf.h"
|
||||||
|
#include "gstgconfelements.h" /* for debug category */
|
||||||
|
|
||||||
#ifndef GST_GCONF_DIR
|
#ifndef GST_GCONF_DIR
|
||||||
#error "GST_GCONF_DIR is not defined !"
|
#error "GST_GCONF_DIR is not defined !"
|
||||||
|
@ -77,6 +78,23 @@ gst_gconf_get_string (const gchar * key)
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gchar *
|
||||||
|
gst_gconf_get_key_for_sink_profile (guint profile)
|
||||||
|
{
|
||||||
|
switch (profile) {
|
||||||
|
case GCONF_PROFILE_SOUNDS:
|
||||||
|
return GST_GCONF_AUDIOSINK_KEY;
|
||||||
|
case GCONF_PROFILE_MUSIC:
|
||||||
|
return GST_GCONF_MUSIC_AUDIOSINK_KEY;
|
||||||
|
case GCONF_PROFILE_CHAT:
|
||||||
|
return GST_GCONF_CHAT_AUDIOSINK_KEY;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_return_val_if_reached (GST_GCONF_AUDIOSINK_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_gconf_set_string:
|
* gst_gconf_set_string:
|
||||||
* @key: a #gchar corresponding to the key you want to set.
|
* @key: a #gchar corresponding to the key you want to set.
|
||||||
|
@ -113,6 +131,9 @@ gst_gconf_render_bin_from_key (const gchar * key)
|
||||||
gchar *value;
|
gchar *value;
|
||||||
|
|
||||||
value = gst_gconf_get_string (key);
|
value = gst_gconf_get_string (key);
|
||||||
|
|
||||||
|
GST_LOG ("%s = %s", GST_STR_NULL (key), GST_STR_NULL (value));
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
|
||||||
|
@ -142,27 +163,10 @@ GstElement *
|
||||||
gst_gconf_get_default_audio_sink (int profile)
|
gst_gconf_get_default_audio_sink (int profile)
|
||||||
{
|
{
|
||||||
GstElement *ret;
|
GstElement *ret;
|
||||||
gchar *key;
|
const gchar *key;
|
||||||
const gchar *profile_string;
|
|
||||||
|
|
||||||
switch (profile) {
|
|
||||||
case GCONF_PROFILE_SOUNDS:
|
|
||||||
profile_string = "";
|
|
||||||
break;
|
|
||||||
case GCONF_PROFILE_MUSIC:
|
|
||||||
profile_string = "music";
|
|
||||||
break;
|
|
||||||
case GCONF_PROFILE_CHAT:
|
|
||||||
profile_string = "chat";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
g_return_val_if_reached (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
key = g_strdup_printf ("default/%saudiosink", profile_string);
|
|
||||||
|
|
||||||
|
key = gst_gconf_get_key_for_sink_profile (profile);
|
||||||
ret = gst_gconf_render_bin_from_key (key);
|
ret = gst_gconf_render_bin_from_key (key);
|
||||||
g_free (key);
|
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ret = gst_element_factory_make (DEFAULT_AUDIOSINK, NULL);
|
ret = gst_element_factory_make (DEFAULT_AUDIOSINK, NULL);
|
||||||
|
|
|
@ -30,10 +30,12 @@
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_GCONF_AUDIOSRC_KEY "default/audiosrc"
|
#define GST_GCONF_AUDIOSRC_KEY "default/audiosrc"
|
||||||
#define GST_GCONF_AUDIOSINK_KEY "default/audiosink"
|
#define GST_GCONF_AUDIOSINK_KEY "default/audiosink"
|
||||||
#define GST_GCONF_VIDEOSRC_KEY "default/videosrc"
|
#define GST_GCONF_MUSIC_AUDIOSINK_KEY "default/musicaudiosink"
|
||||||
#define GST_GCONF_VIDEOSINK_KEY "default/videosink"
|
#define GST_GCONF_CHAT_AUDIOSINK_KEY "default/chataudiosink"
|
||||||
|
#define GST_GCONF_VIDEOSRC_KEY "default/videosrc"
|
||||||
|
#define GST_GCONF_VIDEOSINK_KEY "default/videosink"
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
@ -46,6 +48,8 @@ gchar * gst_gconf_get_string (const gchar *key);
|
||||||
void gst_gconf_set_string (const gchar *key,
|
void gst_gconf_set_string (const gchar *key,
|
||||||
const gchar *value);
|
const gchar *value);
|
||||||
|
|
||||||
|
const gchar * gst_gconf_get_key_for_sink_profile (guint profile);
|
||||||
|
|
||||||
GstElement * gst_gconf_render_bin_from_key (const gchar *key);
|
GstElement * gst_gconf_render_bin_from_key (const gchar *key);
|
||||||
|
|
||||||
GstElement * gst_gconf_get_default_video_sink (void);
|
GstElement * gst_gconf_get_default_video_sink (void);
|
||||||
|
|
|
@ -136,11 +136,11 @@ get_gconf_key_for_profile (int profile)
|
||||||
{
|
{
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
case GCONF_PROFILE_SOUNDS:
|
case GCONF_PROFILE_SOUNDS:
|
||||||
return GST_GCONF_DIR "/default/audiosink";
|
return GST_GCONF_DIR GST_GCONF_AUDIOSINK_KEY;
|
||||||
case GCONF_PROFILE_MUSIC:
|
case GCONF_PROFILE_MUSIC:
|
||||||
return GST_GCONF_DIR "/default/musicaudiosink";
|
return GST_GCONF_DIR GST_GCONF_MUSIC_AUDIOSINK_KEY;
|
||||||
case GCONF_PROFILE_CHAT:
|
case GCONF_PROFILE_CHAT:
|
||||||
return GST_GCONF_DIR "/default/chataudiosink";
|
return GST_GCONF_DIR GST_GCONF_CHAT_AUDIOSINK_KEY;
|
||||||
default:
|
default:
|
||||||
g_return_val_if_reached (NULL);
|
g_return_val_if_reached (NULL);
|
||||||
}
|
}
|
||||||
|
@ -189,11 +189,17 @@ gst_gconf_audio_sink_dispose (GObject * object)
|
||||||
static gboolean
|
static gboolean
|
||||||
do_toggle_element (GstGConfAudioSink * sink)
|
do_toggle_element (GstGConfAudioSink * sink)
|
||||||
{
|
{
|
||||||
|
const gchar *key;
|
||||||
GstPad *targetpad;
|
GstPad *targetpad;
|
||||||
gchar *new_gconf_str;
|
gchar *new_gconf_str;
|
||||||
GstState cur, next;
|
GstState cur, next;
|
||||||
|
|
||||||
new_gconf_str = gst_gconf_get_string (GST_GCONF_AUDIOSINK_KEY);
|
key = gst_gconf_get_key_for_sink_profile (sink->profile);
|
||||||
|
new_gconf_str = gst_gconf_get_string (key);
|
||||||
|
|
||||||
|
GST_LOG_OBJECT (sink, "old gconf string: %s", GST_STR_NULL (sink->gconf_str));
|
||||||
|
GST_LOG_OBJECT (sink, "new gconf string: %s", GST_STR_NULL (new_gconf_str));
|
||||||
|
|
||||||
if (new_gconf_str != NULL && sink->gconf_str != NULL &&
|
if (new_gconf_str != NULL && sink->gconf_str != NULL &&
|
||||||
(strlen (new_gconf_str) == 0 ||
|
(strlen (new_gconf_str) == 0 ||
|
||||||
strcmp (sink->gconf_str, new_gconf_str) == 0)) {
|
strcmp (sink->gconf_str, new_gconf_str) == 0)) {
|
||||||
|
@ -257,8 +263,6 @@ gst_gconf_audio_sink_set_property (GObject * object, guint prop_id,
|
||||||
{
|
{
|
||||||
GstGConfAudioSink *sink;
|
GstGConfAudioSink *sink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_GCONF_AUDIO_SINK (object));
|
|
||||||
|
|
||||||
sink = GST_GCONF_AUDIO_SINK (object);
|
sink = GST_GCONF_AUDIO_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
@ -282,8 +286,6 @@ gst_gconf_audio_sink_get_property (GObject * object, guint prop_id,
|
||||||
{
|
{
|
||||||
GstGConfAudioSink *sink;
|
GstGConfAudioSink *sink;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_GCONF_AUDIO_SINK (object));
|
|
||||||
|
|
||||||
sink = GST_GCONF_AUDIO_SINK (object);
|
sink = GST_GCONF_AUDIO_SINK (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
|
|
Loading…
Reference in a new issue