mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
spectrum-test: Send inital events
https://bugzilla.gnome.org/show_bug.cgi?id=700033
This commit is contained in:
parent
890e9e3738
commit
5abd7698f3
1 changed files with 10 additions and 25 deletions
|
@ -86,9 +86,10 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
|
|
||||||
/* takes over reference for outcaps */
|
/* takes over reference for outcaps */
|
||||||
static GstElement *
|
static GstElement *
|
||||||
setup_spectrum (void)
|
setup_spectrum (const gchar * caps_str)
|
||||||
{
|
{
|
||||||
GstElement *spectrum;
|
GstElement *spectrum;
|
||||||
|
GstCaps *caps;
|
||||||
|
|
||||||
GST_DEBUG ("setup_spectrum");
|
GST_DEBUG ("setup_spectrum");
|
||||||
spectrum = gst_check_setup_element ("spectrum");
|
spectrum = gst_check_setup_element ("spectrum");
|
||||||
|
@ -97,6 +98,10 @@ setup_spectrum (void)
|
||||||
gst_pad_set_active (mysrcpad, TRUE);
|
gst_pad_set_active (mysrcpad, TRUE);
|
||||||
gst_pad_set_active (mysinkpad, TRUE);
|
gst_pad_set_active (mysinkpad, TRUE);
|
||||||
|
|
||||||
|
caps = gst_caps_from_string (caps_str);
|
||||||
|
gst_check_setup_events (mysrcpad, spectrum, caps, GST_FORMAT_TIME);
|
||||||
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
return spectrum;
|
return spectrum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +127,6 @@ GST_START_TEST (test_int16)
|
||||||
GstElement *spectrum;
|
GstElement *spectrum;
|
||||||
GstBuffer *inbuffer, *outbuffer;
|
GstBuffer *inbuffer, *outbuffer;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstCaps *caps;
|
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -132,7 +136,7 @@ GST_START_TEST (test_int16)
|
||||||
GstClockTime endtime;
|
GstClockTime endtime;
|
||||||
gfloat level;
|
gfloat level;
|
||||||
|
|
||||||
spectrum = setup_spectrum ();
|
spectrum = setup_spectrum (SPECT_CAPS_STRING_S16);
|
||||||
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
||||||
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
||||||
|
|
||||||
|
@ -155,10 +159,6 @@ GST_START_TEST (test_int16)
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (inbuffer, &map);
|
gst_buffer_unmap (inbuffer, &map);
|
||||||
|
|
||||||
caps = gst_caps_from_string (SPECT_CAPS_STRING_S16);
|
|
||||||
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
/* create a bus to get the spectrum message on */
|
/* create a bus to get the spectrum message on */
|
||||||
|
@ -227,7 +227,6 @@ GST_START_TEST (test_int32)
|
||||||
GstElement *spectrum;
|
GstElement *spectrum;
|
||||||
GstBuffer *inbuffer, *outbuffer;
|
GstBuffer *inbuffer, *outbuffer;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstCaps *caps;
|
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -237,7 +236,7 @@ GST_START_TEST (test_int32)
|
||||||
GstClockTime endtime;
|
GstClockTime endtime;
|
||||||
gfloat level;
|
gfloat level;
|
||||||
|
|
||||||
spectrum = setup_spectrum ();
|
spectrum = setup_spectrum (SPECT_CAPS_STRING_S32);
|
||||||
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
||||||
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
||||||
|
|
||||||
|
@ -260,10 +259,6 @@ GST_START_TEST (test_int32)
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (inbuffer, &map);
|
gst_buffer_unmap (inbuffer, &map);
|
||||||
|
|
||||||
caps = gst_caps_from_string (SPECT_CAPS_STRING_S32);
|
|
||||||
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
/* create a bus to get the spectrum message on */
|
/* create a bus to get the spectrum message on */
|
||||||
|
@ -332,7 +327,6 @@ GST_START_TEST (test_float32)
|
||||||
GstElement *spectrum;
|
GstElement *spectrum;
|
||||||
GstBuffer *inbuffer, *outbuffer;
|
GstBuffer *inbuffer, *outbuffer;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstCaps *caps;
|
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -342,7 +336,7 @@ GST_START_TEST (test_float32)
|
||||||
GstClockTime endtime;
|
GstClockTime endtime;
|
||||||
gfloat level;
|
gfloat level;
|
||||||
|
|
||||||
spectrum = setup_spectrum ();
|
spectrum = setup_spectrum (SPECT_CAPS_STRING_F32);
|
||||||
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
||||||
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
||||||
|
|
||||||
|
@ -365,10 +359,6 @@ GST_START_TEST (test_float32)
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (inbuffer, &map);
|
gst_buffer_unmap (inbuffer, &map);
|
||||||
|
|
||||||
caps = gst_caps_from_string (SPECT_CAPS_STRING_F32);
|
|
||||||
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
/* create a bus to get the spectrum message on */
|
/* create a bus to get the spectrum message on */
|
||||||
|
@ -437,7 +427,6 @@ GST_START_TEST (test_float64)
|
||||||
GstElement *spectrum;
|
GstElement *spectrum;
|
||||||
GstBuffer *inbuffer, *outbuffer;
|
GstBuffer *inbuffer, *outbuffer;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstCaps *caps;
|
|
||||||
GstMessage *message;
|
GstMessage *message;
|
||||||
const GstStructure *structure;
|
const GstStructure *structure;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -447,7 +436,7 @@ GST_START_TEST (test_float64)
|
||||||
GstClockTime endtime;
|
GstClockTime endtime;
|
||||||
gfloat level;
|
gfloat level;
|
||||||
|
|
||||||
spectrum = setup_spectrum ();
|
spectrum = setup_spectrum (SPECT_CAPS_STRING_F64);
|
||||||
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
g_object_set (spectrum, "post-messages", TRUE, "interval", GST_SECOND / 100,
|
||||||
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
"bands", SPECT_BANDS, "threshold", -80, NULL);
|
||||||
|
|
||||||
|
@ -470,10 +459,6 @@ GST_START_TEST (test_float64)
|
||||||
++data;
|
++data;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (inbuffer, &map);
|
gst_buffer_unmap (inbuffer, &map);
|
||||||
|
|
||||||
caps = gst_caps_from_string (SPECT_CAPS_STRING_F64);
|
|
||||||
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
|
||||||
gst_caps_unref (caps);
|
|
||||||
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
ASSERT_BUFFER_REFCOUNT (inbuffer, "inbuffer", 1);
|
||||||
|
|
||||||
/* create a bus to get the spectrum message on */
|
/* create a bus to get the spectrum message on */
|
||||||
|
|
Loading…
Reference in a new issue