diff --git a/ges/ges-audio-test-source.c b/ges/ges-audio-test-source.c index 3f6ebcdd56..4d0f9dde17 100644 --- a/ges/ges-audio-test-source.c +++ b/ges/ges-audio-test-source.c @@ -32,6 +32,7 @@ #include "ges-audio-test-source.h" G_DEFINE_TYPE (GESAudioTestSource, ges_audio_test_source, GES_TYPE_SOURCE); +#define DEFAULT_VOLUME 1.0 struct _GESAudioTestSourcePrivate { @@ -74,7 +75,7 @@ ges_audio_test_source_init (GESAudioTestSource * self) GES_TYPE_AUDIO_TEST_SOURCE, GESAudioTestSourcePrivate); self->priv->freq = 440; - self->priv->volume = 0; + self->priv->volume = DEFAULT_VOLUME; } static void diff --git a/ges/ges-test-clip.c b/ges/ges-test-clip.c index afb3ab5fe6..b76ada73dc 100644 --- a/ges/ges-test-clip.c +++ b/ges/ges-test-clip.c @@ -39,6 +39,9 @@ G_DEFINE_TYPE (GESTestClip, ges_test_clip, GES_TYPE_SOURCE_CLIP); +#define DEFAULT_VOLUME 1.0 +#define DEFAULT_VPATTERN GES_VIDEO_TEST_PATTERN_SMPTE + struct _GESTestClipPrivate { gboolean mute; @@ -127,7 +130,7 @@ ges_test_clip_class_init (GESTestClipClass * klass) g_param_spec_enum ("vpattern", "VPattern", "Which video pattern to display. See videotestsrc element", GES_VIDEO_TEST_PATTERN_TYPE, - GES_VIDEO_TEST_PATTERN_BLACK, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + DEFAULT_VPATTERN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /** * GESTestClip:freq: @@ -147,7 +150,7 @@ ges_test_clip_class_init (GESTestClipClass * klass) g_object_class_install_property (object_class, PROP_VOLUME, g_param_spec_double ("volume", "Audio Volume", "The volume of the test audio signal.", - 0, 1, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + 0, 1, DEFAULT_VOLUME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); /** diff --git a/ges/ges-video-test-source.c b/ges/ges-video-test-source.c index 51a44c7912..c113e5086c 100644 --- a/ges/ges-video-test-source.c +++ b/ges/ges-video-test-source.c @@ -29,6 +29,8 @@ G_DEFINE_TYPE (GESVideoTestSource, ges_video_test_source, GES_TYPE_SOURCE); +#define DEFAULT_VPATTERN GES_VIDEO_TEST_PATTERN_SMPTE + struct _GESVideoTestSourcePrivate { GESVideoTestPattern pattern; @@ -53,7 +55,7 @@ ges_video_test_source_init (GESVideoTestSource * self) self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GES_TYPE_VIDEO_TEST_SOURCE, GESVideoTestSourcePrivate); - self->priv->pattern = GES_VIDEO_TEST_PATTERN_BLACK; + self->priv->pattern = DEFAULT_VPATTERN; } static GstElement * diff --git a/tests/check/ges/backgroundsource.c b/tests/check/ges/backgroundsource.c index dff3c6b22c..92cbd125df 100644 --- a/tests/check/ges/backgroundsource.c +++ b/tests/check/ges/backgroundsource.c @@ -21,6 +21,8 @@ #include #include +#define DEFAULT_VOLUME 1.0 + GST_START_TEST (test_test_source_basic) { GESTestClip *source; @@ -164,22 +166,20 @@ GST_START_TEST (test_test_source_in_layer) a, GES_TYPE_AUDIO_TEST_SOURCE); g_assert (GES_IS_AUDIO_TEST_SOURCE (track_element)); assert_equals_float (ges_test_clip_get_frequency (source), 440); - assert_equals_float (ges_test_clip_get_volume (source), 0); + assert_equals_float (ges_test_clip_get_volume (source), DEFAULT_VOLUME); g_object_get (source, "freq", &freq, "volume", &volume, NULL); assert_equals_float (freq, 440); - assert_equals_float (volume, 0); + assert_equals_float (volume, DEFAULT_VOLUME); freq = ges_audio_test_source_get_freq (GES_AUDIO_TEST_SOURCE (track_element)); volume = ges_audio_test_source_get_volume (GES_AUDIO_TEST_SOURCE (track_element)); g_assert (freq == 440); - g_assert (volume == 0); - + g_assert (volume == DEFAULT_VOLUME); g_object_set (source, "freq", (gdouble) 2000, "volume", (gdouble) 0.5, NULL); - g_object_get (source, "freq", &freq, "volume", &volume, NULL); assert_equals_float (freq, 2000); assert_equals_float (volume, 0.5);