GNOME Bugzilla – Bug 777734
Compile error in basic-tutorial 4
Last modified: 2017-03-17 10:18:44 UTC
In basic tutorial 4: The constant GST_TIME_FORMAT has to change to the enum constant GST_FORMAT_TIME on the following lines: 65, 71, 83, 133. On the other lines the constant is used correctly as it is used in a string representation. This originates from a compilation error: $ gcc basic-tutorial-4.c -o basic-tutorial-4 `pkg-config --cflags --libs gstreamer-1.0 In file included from /usr/include/gstreamer-1.0/gst/gstcontrolsource.h:30:0, from /usr/include/gstreamer-1.0/gst/gstcontrolbinding.h:30, from /usr/include/gstreamer-1.0/gst/gstobject.h:243, from /usr/include/gstreamer-1.0/gst/gstelement.h:56, from /usr/include/gstreamer-1.0/gst/gstbin.h:27, from /usr/include/gstreamer-1.0/gst/gst.h:35, from basic-tutorial-4.c:1: basic-tutorial-4.c: In function ‘main’: /usr/include/gstreamer-1.0/gst/gstclock.h:228:25: error: incompatible type for argument 2 of ‘gst_element_query_position’ #define GST_TIME_FORMAT "u:%02u:%02u.%09u" ^ basic-tutorial-4.c:65:56: note: in expansion of macro ‘GST_TIME_FORMAT’ if (!gst_element_query_position (data.playbin, GST_TIME_FORMAT, ¤ ^ In file included from /usr/include/gstreamer-1.0/gst/gst.h:86:0, from basic-tutorial-4.c:1: /usr/include/gstreamer-1.0/gst/gstutils.h:907:25: note: expected ‘GstFormat {aka enum <anonymous>}’ but argument is of type ‘char *’ gboolean gst_element_query_position (GstElement *element, G ^ In file included from /usr/include/gstreamer-1.0/gst/gstcontrolsource.h:30:0, from /usr/include/gstreamer-1.0/gst/gstcontrolbinding.h:30, from /usr/include/gstreamer-1.0/gst/gstobject.h:243, from /usr/include/gstreamer-1.0/gst/gstelement.h:56, from /usr/include/gstreamer-1.0/gst/gstbin.h:27, from /usr/include/gstreamer-1.0/gst/gst.h:35, from basic-tutorial-4.c:1: /usr/include/gstreamer-1.0/gst/gstclock.h:228:25: error: incompatible type for argument 2 of ‘gst_element_query_duration’ #define GST_TIME_FORMAT "u:%02u:%02u.%09u" ^ basic-tutorial-4.c:71:58: note: in expansion of macro ‘GST_TIME_FORMAT’ if (!gst_element_query_duration (data.playbin, GST_TIME_FORMAT, &data ^ In file included from /usr/include/gstreamer-1.0/gst/gst.h:86:0, from basic-tutorial-4.c:1: /usr/include/gstreamer-1.0/gst/gstutils.h:908:25: note: expected ‘GstFormat {aka enum <anonymous>}’ but argument is of type ‘char *’ gboolean gst_element_query_duration (GstElement *element, G ^
Indeed, thanks for spotting. Do you want to provide a patch?
I created a pull request
Thanks, but please export the patch with git format-patch -1 and then attach the .patch file here to this bug report, thanks! :)
Brecht, can you send your patch here? Thanks!
Created attachment 348146 [details] [review] Patch for basic tutorial: time-management.md
Sorry for the delay, I lost this post out of sight. The patch is attached.
Created attachment 348147 [details] [review] Patch for basic tutorial: time-management.md
Its the second one..
commit 2e29b1e5c3ea0f43a6065696b2423f8ceec7eb07 Author: Sebastian Dröge <sebastian@centricular.com> Date: Fri Mar 17 12:17:56 2017 +0200 tutorials/playback: Fix more occurences of GST_TIME_FORMAT / GST_FORMAT_TIME mixups https://bugzilla.gnome.org/show_bug.cgi?id=777734 commit 282851deef4cb9886cb0d0f91562968ee75f4c58 Author: De Vlieger, Brecht <Brecht.DeVlieger@barco.com> Date: Wed Jan 25 11:41:26 2017 +0100 tutorials/basic: Fix compilation errors https://bugzilla.gnome.org/show_bug.cgi?id=777734