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 783798 - utils: Add a function to get a string representation of GstStateChange
utils: Add a function to get a string representation of GstStateChange
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal enhancement
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-06-14 21:17 UTC by Thibault Saunier
Modified: 2017-06-20 13:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
utils: Add a function to get a string representation of GstStateChange (2.58 KB, patch)
2017-06-14 21:17 UTC, Thibault Saunier
none Details | Review
element: Add missing values for "to same" state changes (2.31 KB, patch)
2017-06-15 15:06 UTC, Thibault Saunier
none Details | Review
utils: Add a function to get a string representation of GstStateChange (2.87 KB, patch)
2017-06-15 15:06 UTC, Thibault Saunier
none Details | Review
element: Add missing values for "to same" state changes (3.59 KB, patch)
2017-06-15 15:29 UTC, Thibault Saunier
none Details | Review
utils: Add a function to get a string representation of GstStateChange (2.87 KB, patch)
2017-06-15 15:29 UTC, Thibault Saunier
none Details | Review
element: Add missing values for "to same" state changes (3.53 KB, patch)
2017-06-15 15:34 UTC, Thibault Saunier
committed Details | Review
utils: Add a function to get a string representation of GstStateChange (2.87 KB, patch)
2017-06-15 15:34 UTC, Thibault Saunier
committed Details | Review
flactag: Fix warning with the newly added GstStateChange values (808 bytes, patch)
2017-06-15 15:54 UTC, Thibault Saunier
committed Details | Review
Handle newly added GstStateChange values (1.13 KB, patch)
2017-06-15 15:54 UTC, Thibault Saunier
none Details | Review
Handle newly added GstStateChange values (1.00 KB, patch)
2017-06-15 18:26 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2017-06-14 21:17:21 UTC
I have wanted that function quite a few times (for debugging purpose) and
figured it was time to write it.
Comment 1 Thibault Saunier 2017-06-14 21:17:25 UTC
Created attachment 353778 [details] [review]
utils: Add a function to get a string representation of GstStateChange

API:
    gst_state_change_get_name
Comment 2 Tim-Philipp Müller 2017-06-14 21:52:40 UTC
Looks good to me, but is e.g. "NULL to READY" really a "name" or is it more like a description? Undecided whether it's worth caring about though :)

Please also add it to .def file (run 'make update-exports', unless you're sure you can add it in the right place).
Comment 3 Sebastian Dröge (slomo) 2017-06-15 07:11:03 UTC
How about making it "NULL->READY" or similar? Is that more like a name?
Comment 4 Sebastian Dröge (slomo) 2017-06-15 07:12:46 UTC
Review of attachment 353778 [details] [review]:

Also thanks for adding this, I needed it a few times already :)

::: gst/gstutils.c
@@ +1284,3 @@
+      return "PAUSED to READY";
+    case GST_STATE_CHANGE_READY_TO_NULL:
+      return "READY to NULL";

This is not enough unfortunately: there are (valid!) state changes like READY->READY, PAUSED->PAUSED, PLAYING->PLAYING, NULL->NULL
Comment 5 Thibault Saunier 2017-06-15 15:06:37 UTC
Created attachment 353833 [details] [review]
element: Add missing values for "to same" state changes
Comment 6 Thibault Saunier 2017-06-15 15:06:42 UTC
Created attachment 353834 [details] [review]
utils: Add a function to get a string representation of GstStateChange

API:
    gst_state_change_get_name
Comment 7 Thibault Saunier 2017-06-15 15:29:14 UTC
Created attachment 353837 [details] [review]
element: Add missing values for "to same" state changes

https://bugzilla.gnome.org/show_bug.cgi?id=783798

And handle newly added GstStateChange values in GstPipeline
Comment 8 Thibault Saunier 2017-06-15 15:29:21 UTC
Created attachment 353838 [details] [review]
utils: Add a function to get a string representation of GstStateChange

API:
    gst_state_change_get_name
Comment 9 Thibault Saunier 2017-06-15 15:34:39 UTC
Created attachment 353839 [details] [review]
element: Add missing values for "to same" state changes

https://bugzilla.gnome.org/show_bug.cgi?id=783798

And handle newly added GstStateChange values in GstPipeline
Comment 10 Thibault Saunier 2017-06-15 15:34:45 UTC
Created attachment 353840 [details] [review]
utils: Add a function to get a string representation of GstStateChange

API:
    gst_state_change_get_name
Comment 11 Thibault Saunier 2017-06-15 15:54:16 UTC
Created attachment 353842 [details] [review]
flactag: Fix warning with the newly added GstStateChange values
Comment 12 Thibault Saunier 2017-06-15 15:54:41 UTC
Created attachment 353843 [details] [review]
Handle newly added GstStateChange values

The GstStateChange should not be concidered 'closed' and new values
can be added to it, thuse a `default:` handler should be added.
Comment 13 Thibault Saunier 2017-06-15 18:26:34 UTC
Created attachment 353855 [details] [review]
Handle newly added GstStateChange values
Comment 14 Sebastian Dröge (slomo) 2017-06-20 06:16:36 UTC
Comment on attachment 353855 [details] [review]
Handle newly added GstStateChange values

The commit message should probably mention "alsasrc"
Comment 15 Thibault Saunier 2017-06-20 13:50:15 UTC
Attachment 353839 [details] pushed as 54e16cc - element: Add missing values for "to same" state changes
Attachment 353840 [details] pushed as 3a1f2c2 - utils: Add a function to get a string representation of GstStateChange
Comment 16 Thibault Saunier 2017-06-20 13:52:28 UTC
Attachment 353842 [details] pushed as 5ff3106 - flactag: Fix warning with the newly added GstStateChange values