add sizetype tests for fakesrc

Original commit message from CVS:
add sizetype tests for fakesrc
This commit is contained in:
Thomas Vander Stichele 2005-08-05 06:55:03 +00:00
parent e20ed97cb2
commit e8007886c1
62 changed files with 301 additions and 193 deletions

View file

@ -1,3 +1,9 @@
2005-08-05 Thomas Vander Stichele <thomas at apestaart dot org>
* check/elements/gstfakesrc.c: (setup_fakesrc), (cleanup_fakesrc),
(GST_START_TEST), (fakesrc_suite):
add tests for sizetype
2005-08-04 Andy Wingo <wingo@pobox.com>
* gst/elements/gstcapsfilter.c: Reimplement using basetransform,

View file

@ -57,7 +57,8 @@ event_func (GstPad * pad, GstEvent * event)
return FALSE;
}
GST_START_TEST (test_num_buffers)
GstElement *
setup_fakesrc ()
{
GstElement *src;
GstPad *srcpad, *sinkpad;
@ -70,8 +71,6 @@ GST_START_TEST (test_num_buffers)
"sink");
fail_if (sinkpad == NULL, "Could not create a sinkpad");
g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
srcpad = gst_element_get_pad (src, "src");
fail_if (srcpad == NULL, "Could not get source pad from fakesrc");
gst_pad_set_caps (sinkpad, NULL);
@ -80,7 +79,41 @@ GST_START_TEST (test_num_buffers)
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
"Could not link source and sink pads");
return src;
}
void
cleanup_fakesrc (GstElement * src)
{
GstPad *srcpad, *sinkpad;
fail_unless (gst_element_set_state (src, GST_STATE_NULL) == GST_STATE_SUCCESS,
"could not set to null");
srcpad = gst_element_get_pad (src, "src");
sinkpad = gst_pad_get_peer (srcpad);
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
gst_object_unref (src);
gst_pad_unlink (srcpad, sinkpad);
/* pad refs held by both creator and this function (through _get) */
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 2);
gst_object_unref (srcpad);
gst_object_unref (srcpad);
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
gst_object_unref (sinkpad);
gst_object_unref (sinkpad);
}
GST_START_TEST (test_num_buffers)
{
GstElement *src;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
@ -93,15 +126,118 @@ GST_START_TEST (test_num_buffers)
g_list_free (buffers);
/* cleanup */
fail_unless (gst_element_set_state (src, GST_STATE_NULL) == GST_STATE_SUCCESS,
"could not set to null");
gst_object_unref (src);
gst_object_unref (sinkpad);
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_empty)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 1, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_unless (GST_BUFFER_SIZE (buf) == 0);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_fixed)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 2, NULL);
g_object_set (G_OBJECT (src), "sizemax", 8192, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_unless (GST_BUFFER_SIZE (buf) == 8192);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_random)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 3, NULL);
g_object_set (G_OBJECT (src), "sizemin", 4096, NULL);
g_object_set (G_OBJECT (src), "sizemax", 8192, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_if (GST_BUFFER_SIZE (buf) > 8192);
fail_if (GST_BUFFER_SIZE (buf) < 4096);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
Suite *
fakesrc_suite (void)
{
@ -110,6 +246,9 @@ fakesrc_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_num_buffers);
tcase_add_test (tc_chain, test_sizetype_empty);
tcase_add_test (tc_chain, test_sizetype_fixed);
tcase_add_test (tc_chain, test_sizetype_random);
return s;
}

View file

@ -87,9 +87,6 @@ Check out both <ulink url="http://www.cse.ogi.edu/sysl/">OGI's
pipeline</ulink> and Microsoft's DirectShow for some background.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION gst_init ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstBaseSink
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstBaseSink ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstBaseSrc
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstBaseSrc ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstBaseTransform
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstBaseTransform ##### -->
<para>

View file

@ -55,9 +55,6 @@ clock providers in the bin.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstBin ##### -->
<para>

View file

@ -85,9 +85,6 @@ Last reviewed on August 12th, 2004 (0.8.5)
#GstPad, #GstMiniObject
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstBuffer ##### -->
<para>
The basic structure of a buffer.

View file

@ -14,9 +14,6 @@ Structure describing sets of media formats
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstCaps ##### -->
<para>

View file

@ -22,9 +22,6 @@ a good measure of the current playback time in the pipeline.
#GstSystemClock
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstClock ##### -->
<para>

View file

@ -16,6 +16,3 @@ This can be done in CFLAGS for compiling old code.
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -37,9 +37,6 @@ If a subsystem is disabled in GStreamer, a value is defined in
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO GST_DISABLE_LOADSAVE_REGISTRY ##### -->
<para>

View file

@ -65,9 +65,6 @@ and gst_element_set_clock(). You can wait for the clock to reach a given
<!-- basic object functions -->
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstElement ##### -->
<para>

View file

@ -14,9 +14,6 @@ Defines public information about a #GstElement
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstElementDetails ##### -->
<para>
This struct is used to define public information about the element. It

View file

@ -54,9 +54,6 @@ so that the autopluggers can select a plugin more appropriatly
#GstElement, #GstPlugin, #GstPluginFeature, #GstPadTemplate.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstElementFactory ##### -->
<para>

View file

@ -14,6 +14,3 @@ all gstreamer core related enumerations
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,9 +14,6 @@ Categorized error messages
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstCoreError ##### -->
<para>

View file

@ -27,9 +27,6 @@ gst_event_new_flush() creates a new flush event.
#GstPad, #GstElement
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstEvent ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstFakeSink
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstFakeSink ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstFakeSrc
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstFakeSrc ##### -->
<para>
@ -41,6 +38,7 @@ GstFakeSrc
@:
@:
@:
@:
@:
<!-- ##### ARG GstFakeSrc:data ##### -->

View file

@ -14,9 +14,6 @@ GstFileSink
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstFileSink ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstFileSrc
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstFileSrc ##### -->
<para>

View file

@ -17,9 +17,6 @@ on its own.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### USER_FUNCTION GstFilterFunc ##### -->
<para>

View file

@ -15,9 +15,6 @@ formats can be used to perform seeking or conversions/query operations.
#GstPad, #GstElement
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstFormat ##### -->
<para>
Standard predefined formats

View file

@ -14,9 +14,6 @@ Pseudo link pads
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstGhostPad ##### -->
<para>

View file

@ -14,9 +14,6 @@ Core interface implemented by #GstElements that allows runtime querying of inter
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstImplementsInterface ##### -->
<para>

View file

@ -15,9 +15,6 @@ in a pipeline.
#GstIndexFactory
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstIndex ##### -->
<para>

View file

@ -14,9 +14,6 @@ GstIndexFactory is used to dynamically create GstIndex implementations.
#GstIndex
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstIndexFactory ##### -->
<para>
The GstIndexFactory object

View file

@ -68,9 +68,6 @@ categories. These are explained at GST_DEBUG_CATEGORY_INIT().
and environment variables that affect the debugging output.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstDebugLevel ##### -->
<para>
The level defines the importance of a debugging message. The more important a

View file

@ -14,9 +14,6 @@ GstIterator
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstIterator ##### -->
<para>

View file

@ -14,6 +14,3 @@ various portabillity helper macros
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -21,9 +21,6 @@ The GstMemChunk is used to allocate critical resources for #GstBuffer and
#GstBuffer, #GstEvent, #GstData
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstMemChunk ##### -->
<para>
The memchunk structure

View file

@ -14,9 +14,6 @@ GstMiniObject
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstMiniObject ##### -->
<para>

View file

@ -67,9 +67,6 @@ object.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstObject ##### -->
<para>

View file

@ -57,9 +57,6 @@ Last reviewed on December 13th, 2002 (0.5.0.1)
#GstPadTemplate, #GstElement, #GstEvent
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstPad ##### -->
<para>

View file

@ -73,9 +73,6 @@ The following example shows you how to add the padtemplate to an elementfactory:
#GstPad, #GstElementFactory
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstPadTemplate ##### -->
<para>
The padtemplate object.

View file

@ -14,9 +14,6 @@ get a pipeline from a text pipeline description
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION gst_parse_error_quark ##### -->
<para>

View file

@ -21,9 +21,6 @@ the pipeline, use gst_object_unref() to free its resources.
#GstBin
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstPipeline ##### -->
<para>

View file

@ -35,9 +35,6 @@ to bring the plugin into memory.
#GstPluginFeature, #GstType, #GstAutoplug, #GstElementFactory
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION gst_plugin_error_quark ##### -->
<para>
Get the error quark

View file

@ -14,9 +14,6 @@ This is a base class for anything that can be added to a #GstPlugin.
#GstPlugin
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstPluginFeature ##### -->
<para>

View file

@ -15,9 +15,6 @@ Query types can be used to perform queries on pads and elements.
#GstPad, #GstElement
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstQueryType ##### -->
<para>
Standard predefined Query types

View file

@ -25,9 +25,6 @@ The queue blocks by default.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstQueue ##### -->
<para>

View file

@ -15,6 +15,3 @@ All registries build the #GstRegistryPool.
#GstPlugin, #GstPluginFeature
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -15,9 +15,6 @@ the system.
GstRegistry
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION gst_registry_pool_list ##### -->
<para>

View file

@ -14,9 +14,6 @@ Generic structure containing fields of names and values
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstStructure ##### -->
<para>

View file

@ -15,9 +15,6 @@ system time.
#GstClock
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstSystemClock ##### -->
<para>

View file

@ -14,9 +14,6 @@ List of tags and values used to describe media metadata
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF GstTagList ##### -->
<para>

View file

@ -14,9 +14,6 @@ Element interface that allows setting and retrieval of media metadata
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTagSetter ##### -->
<para>

View file

@ -14,9 +14,6 @@ Tracing functionality
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTrace ##### -->
<para>

View file

@ -14,9 +14,6 @@ gsttrashstack
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTrashStack ##### -->
<para>

View file

@ -14,9 +14,6 @@ typefinding subsystem
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTypeFind ##### -->
<para>

View file

@ -67,9 +67,6 @@ the given data. You can get quite a bit more complicated than that though.
<link linkend="gstreamer-Writing-typefind-functions">Writing typefind functions</link>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTypeFindFactory ##### -->
<para>
Object that stores information about a typefind function

View file

@ -14,9 +14,6 @@ various global enums and constants
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstElementState ##### -->
<para>
These contants describe the state a #GstElement is in and transition scheduled for the #GstElement (the pending state).

View file

@ -15,9 +15,6 @@ and the element property that can handle a given URI.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstURIHandler ##### -->
<para>

View file

@ -14,9 +14,6 @@ describes URI types
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstURIType ##### -->
<para>

View file

@ -14,9 +14,6 @@ various utility functions
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### FUNCTION gst_util_set_value_from_string ##### -->
<para>

View file

@ -14,9 +14,6 @@ GValue implementations specific to GStreamer
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO GST_MAKE_FOURCC ##### -->
<para>
will transform four characters into a host-endiannness guint32 fourcc:

View file

@ -15,9 +15,6 @@ The version macros get defined by including "gst/gst.h".
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
<para>
The major version of GStreamer at compile time

View file

@ -14,9 +14,6 @@ XML save/restore operations of pipelines
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstXML ##### -->
<para>

View file

@ -27,9 +27,6 @@ network connections also need a protocol to do this.
#GstBuffer, #GstCaps, #GstEvent
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstDPHeaderFlag ##### -->
<para>

View file

@ -14,9 +14,6 @@ accelerated routines for getting bits from a data stream.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT gst_getbits_t ##### -->
<para>

View file

@ -57,7 +57,8 @@ event_func (GstPad * pad, GstEvent * event)
return FALSE;
}
GST_START_TEST (test_num_buffers)
GstElement *
setup_fakesrc ()
{
GstElement *src;
GstPad *srcpad, *sinkpad;
@ -70,8 +71,6 @@ GST_START_TEST (test_num_buffers)
"sink");
fail_if (sinkpad == NULL, "Could not create a sinkpad");
g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
srcpad = gst_element_get_pad (src, "src");
fail_if (srcpad == NULL, "Could not get source pad from fakesrc");
gst_pad_set_caps (sinkpad, NULL);
@ -80,7 +79,41 @@ GST_START_TEST (test_num_buffers)
fail_unless (gst_pad_link (srcpad, sinkpad) == GST_PAD_LINK_OK,
"Could not link source and sink pads");
return src;
}
void
cleanup_fakesrc (GstElement * src)
{
GstPad *srcpad, *sinkpad;
fail_unless (gst_element_set_state (src, GST_STATE_NULL) == GST_STATE_SUCCESS,
"could not set to null");
srcpad = gst_element_get_pad (src, "src");
sinkpad = gst_pad_get_peer (srcpad);
ASSERT_OBJECT_REFCOUNT (src, "src", 1);
gst_object_unref (src);
gst_pad_unlink (srcpad, sinkpad);
/* pad refs held by both creator and this function (through _get) */
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 2);
gst_object_unref (srcpad);
gst_object_unref (srcpad);
ASSERT_OBJECT_REFCOUNT (sinkpad, "sinkpad", 2);
gst_object_unref (sinkpad);
gst_object_unref (sinkpad);
}
GST_START_TEST (test_num_buffers)
{
GstElement *src;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "num-buffers", 3, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
@ -93,15 +126,118 @@ GST_START_TEST (test_num_buffers)
g_list_free (buffers);
/* cleanup */
fail_unless (gst_element_set_state (src, GST_STATE_NULL) == GST_STATE_SUCCESS,
"could not set to null");
gst_object_unref (src);
gst_object_unref (sinkpad);
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_empty)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 1, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_unless (GST_BUFFER_SIZE (buf) == 0);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_fixed)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 2, NULL);
g_object_set (G_OBJECT (src), "sizemax", 8192, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_unless (GST_BUFFER_SIZE (buf) == 8192);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
GST_START_TEST (test_sizetype_random)
{
GstElement *src;
GList *l;
src = setup_fakesrc ();
g_object_set (G_OBJECT (src), "sizetype", 3, NULL);
g_object_set (G_OBJECT (src), "sizemin", 4096, NULL);
g_object_set (G_OBJECT (src), "sizemax", 8192, NULL);
g_object_set (G_OBJECT (src), "num-buffers", 100, NULL);
fail_unless (gst_element_set_state (src,
GST_STATE_PLAYING) == GST_STATE_SUCCESS, "could not set to playing");
while (!have_eos) {
g_usleep (1000);
}
fail_unless (g_list_length (buffers) == 100);
l = buffers;
while (l) {
GstBuffer *buf = l->data;
fail_if (GST_BUFFER_SIZE (buf) > 8192);
fail_if (GST_BUFFER_SIZE (buf) < 4096);
l = l->next;
}
g_list_foreach (buffers, (GFunc) gst_mini_object_unref, NULL);
g_list_free (buffers);
/* cleanup */
cleanup_fakesrc (src);
}
GST_END_TEST;
Suite *
fakesrc_suite (void)
{
@ -110,6 +246,9 @@ fakesrc_suite (void)
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_num_buffers);
tcase_add_test (tc_chain, test_sizetype_empty);
tcase_add_test (tc_chain, test_sizetype_fixed);
tcase_add_test (tc_chain, test_sizetype_random);
return s;
}