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 599018 - caca: Cleanups and fixes
caca: Cleanups and fixes
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-20 07:26 UTC by Priit Laes (IRC: plaes)
Modified: 2018-11-03 14:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Exit-properly-when-invalid-driver-has-been-selected.patch (756 bytes, patch)
2009-10-20 07:26 UTC, Priit Laes (IRC: plaes)
committed Details | Review
0002-Minor-cleanups-for-header.patch (1.15 KB, patch)
2009-10-20 07:27 UTC, Priit Laes (IRC: plaes)
committed Details | Review
0003-Add-driver-selection-support-from-the-pipeline.patch (6.40 KB, patch)
2009-10-20 07:28 UTC, Priit Laes (IRC: plaes)
none Details | Review
0003-Add-driver-selection-support-from-the-pipeline.patch (6.42 KB, patch)
2009-10-20 12:47 UTC, Priit Laes (IRC: plaes)
reviewed Details | Review
cacasink: add driver selection support from the pipeline (6.03 KB, patch)
2014-06-18 12:54 UTC, Guillaume Desmottes
none Details | Review
cacasink: add driver selection support from the pipeline (6.00 KB, patch)
2015-01-12 17:32 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
cacasink: add driver selection support from the pipeline (5.96 KB, patch)
2015-01-30 10:00 UTC, Guillaume Desmottes
none Details | Review

Description Priit Laes (IRC: plaes) 2009-10-20 07:26:27 UTC
Created attachment 145832 [details] [review]
0001-Exit-properly-when-invalid-driver-has-been-selected.patch

Currently, when specifying a driver that doesn't exist causes crash in
cacasink.
Comment 1 Priit Laes (IRC: plaes) 2009-10-20 07:27:28 UTC
Created attachment 145833 [details] [review]
0002-Minor-cleanups-for-header.patch

Clean up the header file.
Comment 2 Priit Laes (IRC: plaes) 2009-10-20 07:28:42 UTC
Created attachment 145834 [details] [review]
0003-Add-driver-selection-support-from-the-pipeline.patch

Adds "driver" option for the pipeline.

Please note that there's a FIXME in the code ;)
Comment 3 Priit Laes (IRC: plaes) 2009-10-20 12:47:47 UTC
Created attachment 145856 [details] [review]
0003-Add-driver-selection-support-from-the-pipeline.patch
Comment 4 Tim-Philipp Müller 2009-10-22 01:16:58 UTC
Review of attachment 145856 [details] [review]:

::: ext/libcaca/gstcacasink.c
@@ +149,3 @@
+
+  list = caca_get_display_driver_list ();
+

Why is this code in the _get_type() function? You're basically rebuildilng the driver list on every type check, so possibly even multiple times for each buffer that arrives. Is that really what you want?

But even if, this needs locking really, so that two different threads calling _get_type() don't trample over each other.

If the driver list is assumed to be static during the runtime of the program, you could just put a _build_driver_list() call into the plugin_init function or so, or call it from class_init.

@@ +161,3 @@
+    driver[i].value_nick = g_strdup (list[2 * i]);
+    driver[i].value_name = g_strdup (list[2 * i + 1]);
+  }

Since you're buildling an enum table here: will the drivers always be enumerated with the same integer/enum values, or only be addressed by string nick/name? If the latter, then maybe this should be a string property instead, since the assumption for enum properties is that you could theoretically hard-code numbers and still always get what you expect.

@@ +358,3 @@
+    case ARG_DRIVER:{
+      cacasink->driver = g_value_get_enum (value);
+    }

A break here woudl be nice, even if it's not stricly needed.
Comment 5 Tim-Philipp Müller 2010-04-29 20:17:13 UTC
Priit: ping? Are you going to work on this some more? Do you know the answer to any of the questions any asked?
Comment 6 Priit Laes (IRC: plaes) 2010-04-29 20:36:59 UTC
(In reply to comment #5)
> Priit: ping? Are you going to work on this some more? Do you know the answer to
> any of the questions any asked?

I haven't had much time to look into this due to school and I probably won't have time until um.. second part of summer :(
Comment 7 Tobias Mueller 2010-06-16 13:20:26 UTC
Hm. But if you want to do it, you could assign this bug to yourself and get it done as soon as you come around to do it :-)
Comment 8 Tobias Mueller 2010-11-07 11:55:53 UTC
Folks, this bugs is lacking attention for quite some time now. And there is a patch bit rotting around. If nobody steps up, I feel it's appropriate to close as INCOMPLETE.
Comment 9 Tim-Philipp Müller 2010-11-07 12:21:47 UTC
> If nobody steps up, I feel it's appropriate to close
> as INCOMPLETE.

I don't, please keep it open, thanks.
Comment 10 Jan Schmidt 2012-10-03 23:01:06 UTC
It would be nice if the enum values could be made consistent, but I don't see a way. On the other hand, using a string property leaves no way to discover which device backends are available - which an enum does, so the inconsistent enum is probably better.
Comment 11 Sebastian Dröge (slomo) 2014-01-09 15:28:23 UTC
Also this needs to be ported to 1.0 now
Comment 12 Guillaume Desmottes 2014-06-18 12:54:58 UTC
Created attachment 278676 [details] [review]
cacasink: add driver selection support from the pipeline
Comment 13 Guillaume Desmottes 2014-06-18 12:55:44 UTC
I rebased the patch on top of 1.2 and tried fixing the review comments.

Still not sure if we want an enum or string property though.
Comment 14 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-10 21:10:32 UTC
Review of attachment 278676 [details] [review]:

::: ext/libcaca/gstcacasink.c
@@ +190,3 @@
+  g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DRIVER,
+      g_param_spec_enum ("driver", "driver", "Output driver",
+          GST_TYPE_CACADRIVER, 0, G_PARAM_READWRITE));

| G_PARAM_STATIC_STRINGS

@@ +407,3 @@
+  cacasink->dp =
+      caca_create_display_with_driver (cacasink->cv,
+      driver_array[cacasink->driver]);

You can avoid the driver_array.
GEnumValue *ev = g_enum_get_value (enum_class, cacasink->driver);
caca_create_display_with_driver (cacasink->cv, ev->value_nick)
Comment 15 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-10 21:14:22 UTC
Regarding the enums, can we assume that future libcaca versions would append new drivers? If they remove one the would indeed break the stability.
Comment 16 Guillaume Desmottes 2015-01-12 17:32:06 UTC
Created attachment 294365 [details] [review]
cacasink: add driver selection support from the pipeline
Comment 17 Stefan Sauer (gstreamer, gtkdoc dev) 2015-01-23 13:10:17 UTC
Review of attachment 294365 [details] [review]:

Just a small suggestions. Thanks!

::: ext/libcaca/gstcacasink.c
@@ +404,3 @@
     goto init_failed;
 
+  enum_class = g_type_class_ref (GST_TYPE_CACADRIVER);

its probably better to use g_type_class_peek() here, the type is definitely loaded (as it is an enum on the class) - this way you don't need to unref
Comment 18 Guillaume Desmottes 2015-01-30 10:00:09 UTC
Created attachment 295796 [details] [review]
cacasink: add driver selection support from the pipeline
Comment 19 GStreamer system administrator 2018-11-03 14:40:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/17.