After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795366 - debugutils: Add a testsrc element
debugutils: Add a testsrc element
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other All
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 781441 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-04-18 20:35 UTC by Thibault Saunier
Modified: 2018-07-03 12:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
debugutils: Add a testsrc element (12.85 KB, patch)
2018-04-18 20:35 UTC, Thibault Saunier
none Details | Review
debugutils: Add a testsrc element (15.70 KB, patch)
2018-04-19 00:45 UTC, Thibault Saunier
none Details | Review
debugutils: Add a testsrc element (15.71 KB, patch)
2018-04-19 12:38 UTC, Thibault Saunier
none Details | Review
debugutils: Add a testsrc element (15.76 KB, patch)
2018-04-19 12:39 UTC, Thibault Saunier
none Details | Review
debugutils: Add a testsrc element (16.18 KB, patch)
2018-04-19 13:03 UTC, Thibault Saunier
none Details | Review
debugutils: Add a testsrcbin element (16.50 KB, patch)
2018-04-19 13:27 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2018-04-18 20:35:36 UTC
See commit message.
Comment 1 Thibault Saunier 2018-04-18 20:35:42 UTC
Created attachment 371119 [details] [review]
debugutils: Add a testsrc element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 2 Thibault Saunier 2018-04-19 00:45:55 UTC
Created attachment 371120 [details] [review]
debugutils: Add a testsrc element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 3 Thibault Saunier 2018-04-19 12:38:43 UTC
Created attachment 371128 [details] [review]
debugutils: Add a testsrc element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 4 Thibault Saunier 2018-04-19 12:39:52 UTC
Created attachment 371129 [details] [review]
debugutils: Add a testsrc element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 5 Mathieu Duponchelle 2018-04-19 12:51:32 UTC
Review of attachment 371129 [details] [review]:

This looks generally useful, had a few remarks though :)

Also, I guess you could just add that to the autotools build, shouldn't be too annoyying :)

::: gst/debugutils/gsttestsrc.c
@@ +30,3 @@
+ *
+ * This element also provides GstStream and GstStreamCollection and
+ * thus the element is usefull for testing the new playbin3 infrastructure.

useful*

@@ +60,3 @@
+
+  gchar *uri;
+  gboolean is_live;

Not used

@@ +73,3 @@
+};
+
+#define DEFAULT_LIVE FALSE

Not used

@@ +85,3 @@
+gst_test_src_uri_handler_get_protocols (GType type)
+{
+  static const gchar *protocols[] = { "test", NULL };

we might want a more specific protocol here, eg "testbin", what do you think ?

@@ +94,3 @@
+{
+  GstTestSrc *self = GST_TEST_SRC (handler);
+  gcha uri;

probably doesn't compile ;)

@@ +143,3 @@
+      if (data->collection) {
+        GstStreamCollection *collection = data->collection;
+        data->collection = NULL;

aren't you leaking data->collection here?

@@ +307,3 @@
+    G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_test_src_uri_handler_init))
+
+     static void

indent fail :)

@@ +358,3 @@
+  GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
+
+  switch (transition) {

This whole switch case doesn't seem very useful :P

@@ +406,3 @@
+  gobject_class->set_property = gst_test_src_set_property;
+
+    /**

bad indent?
Comment 6 Thibault Saunier 2018-04-19 13:03:23 UTC
Created attachment 371130 [details] [review]
debugutils: Add a testsrc element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 7 Thibault Saunier 2018-04-19 13:03:35 UTC
(In reply to Mathieu Duponchelle from comment #5)
> Review of attachment 371129 [details] [review] [review]:
> 
> This looks generally useful, had a few remarks though :)
> 
> Also, I guess you could just add that to the autotools build, shouldn't be
> too annoyying :)

Erg, autotools yes :P

> ::: gst/debugutils/gsttestsrc.c
> @@ +30,3 @@
> + *
> + * This element also provides GstStream and GstStreamCollection and
> + * thus the element is usefull for testing the new playbin3 infrastructure.
> 
> useful*

Done
 
> @@ +60,3 @@
> +
> +  gchar *uri;
> +  gboolean is_live;
> 
> Not used
 
FIXED.
 
> @@ +73,3 @@
> +};
> +
> +#define DEFAULT_LIVE FALSE
> 
> Not used

Done. 

> @@ +85,3 @@
> +gst_test_src_uri_handler_get_protocols (GType type)
> +{
> +  static const gchar *protocols[] = { "test", NULL };
> 
> we might want a more specific protocol here, eg "testbin", what do you think
> ?

Not sure, `testsrc` maybe? As you wish tbh :-)

> 
> @@ +143,3 @@
> +      if (data->collection) {
> +        GstStreamCollection *collection = data->collection;
> +        data->collection = NULL;
> 
> aren't you leaking data->collection here?

Nop, gst_event_new_stream_collection  is transfer-full
 
> @@ +307,3 @@
> +    G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
> gst_test_src_uri_handler_init))
> +
> +     static void
> 
> indent fail :)

INDENT-OFF on :-)

> @@ +358,3 @@
> +  GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
> +
> +  switch (transition) {
> 
> This whole switch case doesn't seem very useful :P

Removed.

> @@ +406,3 @@
> +  gobject_class->set_property = gst_test_src_set_property;
> +
> +    /**
> 
> bad indent?

Not sure what gst-indent did.
Comment 8 Mathieu Duponchelle 2018-04-19 13:06:57 UTC
(In reply to Thibault Saunier from comment #7)
> (In reply to Mathieu Duponchelle from comment #5)
> 
> Nop, gst_event_new_stream_collection  is transfer-full
>  

The return value is transfer full, not the parameter afaict
Comment 9 Thibault Saunier 2018-04-19 13:27:44 UTC
Created attachment 371131 [details] [review]
debugutils: Add a testsrcbin element

This is a simple Bin that will expose audiotestsrc or videotestsrc
based on what is asked by the user either through the GstURIHandler
API or through the "stream-types" property.

This element also provides GstStream and GstStreamCollection
so it is nicely usable from playbin3.
Comment 10 Mathieu Duponchelle 2018-04-19 13:32:25 UTC
Review of attachment 371131 [details] [review]:

Good to go for me, please push after fixing these last two remarks, thanks :)

::: gst/debugutils/gsttestsrcbin.c
@@ +21,3 @@
+
+/**
+ * SECTION:element-testsrc

testsrcbin now

@@ +143,3 @@
+        GstStreamCollection *collection = data->collection;
+        data->collection = NULL;
+        gst_pad_push_event (pad, gst_event_new_stream_collection (collection));

just pass data->collection here then gst_object_replace :)
Comment 11 Thibault Saunier 2018-04-19 14:11:50 UTC
Attachment 371131 [details] pushed as 4984af5 - debugutils: Add a testsrcbin element
Comment 12 Nicolas Dufresne (ndufresne) 2018-07-03 12:29:50 UTC
*** Bug 781441 has been marked as a duplicate of this bug. ***