mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
test-clip: Do not set black/silent by default
This commit is contained in:
parent
c57e463b2d
commit
54bf3c05c5
4 changed files with 15 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 *
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#include <ges/ges.h>
|
||||
#include <gst/check/gstcheck.h>
|
||||
|
||||
#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);
|
||||
|
|
Loading…
Reference in a new issue