diff options
author | Dave Robillard <dave@drobilla.net> | 2009-06-25 11:47:38 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-06-25 11:47:38 -0400 |
commit | 0ce58265e5ae76238aa7d0b9d56def61fe6be664 (patch) | |
tree | 17179428791e62a1308ce569c8d58edadc6572af /gst/camerabin/camerabinvideo.c | |
parent | 7a7083ba1f8e38b0b51820d4a37f279c6b2c73bd (diff) | |
parent | 699e4f4d044d8111053b631baba4b324a60b1274 (diff) | |
download | gst-plugins-bad-0ce58265e5ae76238aa7d0b9d56def61fe6be664.tar.gz gst-plugins-bad-0ce58265e5ae76238aa7d0b9d56def61fe6be664.tar.bz2 gst-plugins-bad-0ce58265e5ae76238aa7d0b9d56def61fe6be664.zip |
Merge branch 'fdo' into lv2
Diffstat (limited to 'gst/camerabin/camerabinvideo.c')
-rw-r--r-- | gst/camerabin/camerabinvideo.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gst/camerabin/camerabinvideo.c b/gst/camerabin/camerabinvideo.c index d3de662e..2569772a 100644 --- a/gst/camerabin/camerabinvideo.c +++ b/gst/camerabin/camerabinvideo.c @@ -184,6 +184,8 @@ gst_camerabin_video_init (GstCameraBinVideo * vid, vid->pending_eos = NULL; + vid->mute = ARG_DEFAULT_MUTE; + /* Create src and sink ghost pads */ vid->sinkpad = gst_ghost_pad_new_no_target ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (vid), vid->sinkpad); @@ -629,6 +631,8 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid) GST_WARNING_OBJECT (vid, "unable to add volume element"); /* gst_camerabin_try_add_element() destroyed the element */ vid->volume = NULL; + } else { + g_object_set (vid->volume, "mute", vid->mute, NULL); } /* Add user set or default audio encoder element */ @@ -732,8 +736,11 @@ gst_camerabin_video_destroy_elements (GstCameraBinVideo * vid) void gst_camerabin_video_set_mute (GstCameraBinVideo * vid, gboolean mute) { - if (vid && vid->volume) { - GST_DEBUG_OBJECT (vid, "setting mute %s", mute ? "on" : "off"); + g_return_if_fail (vid != NULL); + + GST_DEBUG_OBJECT (vid, "setting mute %s", mute ? "on" : "off"); + vid->mute = mute; + if (vid->volume) { g_object_set (vid->volume, "mute", mute, NULL); } } @@ -800,12 +807,13 @@ gst_camerabin_video_set_audio_src (GstCameraBinVideo * vid, gboolean gst_camerabin_video_get_mute (GstCameraBinVideo * vid) { - gboolean mute = ARG_DEFAULT_MUTE; + g_return_val_if_fail (vid != NULL, FALSE); - if (vid && vid->volume) { - g_object_get (vid->volume, "mute", &mute, NULL); + if (vid->volume) { + g_object_get (vid->volume, "mute", &vid->mute, NULL); } - return mute; + + return vid->mute; } GstElement * |