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 777734 - Compile error in basic-tutorial 4
Compile error in basic-tutorial 4
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: documentation
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-25 09:22 UTC by Brecht De Vlieger
Modified: 2017-03-17 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for basic tutorial: time-management.md (1.21 KB, patch)
2017-03-17 07:19 UTC, Brecht De Vlieger
none Details | Review
Patch for basic tutorial: time-management.md (1.74 KB, patch)
2017-03-17 07:25 UTC, Brecht De Vlieger
committed Details | Review

Description Brecht De Vlieger 2017-01-25 09:22:35 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, &curren
                                                        ^
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
                         ^
Comment 1 Sebastian Dröge (slomo) 2017-01-25 09:24:23 UTC
Indeed, thanks for spotting. Do you want to provide a patch?
Comment 2 Brecht De Vlieger 2017-01-25 10:43:35 UTC
I created a pull request
Comment 3 Tim-Philipp Müller 2017-01-25 12:58:57 UTC
Thanks, but please export the patch with

  git format-patch -1

and then attach the .patch file here to this bug report, thanks! :)
Comment 4 Sebastian Dröge (slomo) 2017-03-16 16:44:06 UTC
Brecht, can you send your patch here? Thanks!
Comment 5 Brecht De Vlieger 2017-03-17 07:19:45 UTC
Created attachment 348146 [details] [review]
Patch for basic tutorial: time-management.md
Comment 6 Brecht De Vlieger 2017-03-17 07:20:16 UTC
Sorry for the delay, I lost this post out of sight. The patch is attached.
Comment 7 Brecht De Vlieger 2017-03-17 07:25:31 UTC
Created attachment 348147 [details] [review]
Patch for basic tutorial: time-management.md
Comment 8 Brecht De Vlieger 2017-03-17 07:26:16 UTC
Its the second one..
Comment 9 Sebastian Dröge (slomo) 2017-03-17 10:18:39 UTC
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