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 768301 - buffer: add explicit setters and getters for GstBufferFlags
buffer: add explicit setters and getters for GstBufferFlags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-01 20:03 UTC by Arjen Veenhuizen
Modified: 2016-08-23 07:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.86 KB, patch)
2016-07-01 20:03 UTC, Arjen Veenhuizen
none Details | Review
Revised patch after first review by Tim (2.90 KB, patch)
2016-07-04 05:53 UTC, Arjen Veenhuizen
none Details | Review
Revised patch (v3) (2.90 KB, patch)
2016-07-04 06:01 UTC, Arjen Veenhuizen
committed Details | Review

Description Arjen Veenhuizen 2016-07-01 20:03:39 UTC
Created attachment 330754 [details] [review]
Proposed patch

GST_BUFFER_FLAGS, GST_BUFFER_FLAG_IS_SET, GST_BUFFER_FLAG_SET and GST_BUFFER_FLAG_UNSET do not have an explicit method that gi-introspection can parse. Therefore, these macros cannot be used from Python. In contrast, the GstBufferFlags are already exposed under Gst.BufferFlags.

This patch adds the necessary setters and getters. (Gst.Buffer.flags, Gst.Buffer.flag_is_set, Gst.Buffer.flag_set and Gst.Buffer.flag_unset respectively).
Comment 1 Tim-Philipp Müller 2016-07-03 19:52:12 UTC
Comment on attachment 330754 [details] [review]
Proposed patch

Thanks for the patch, I think this makes sense. Couple of comments:

 - (transfer none) doesn't make sense for booleans and integer types

 - please add "Since: 1.10" markers at the end of each gtk-doc blob

 - not quite sure about naming, in particular:

     - gst_buffer_flags() -> gst_buffer_get_flags() ?

     - gst_buffer_flag_set() -> gst_buffer_set_flags() ? [can set multiple in one go]

     - gst_buffer_flag_unset() -> gst_buffer_unset_flags() ? [ditto]
     
     - gst_buffer_flag_is_set() -> gst_buffer_check_flags() _has_flags() is_flag_set? [not sure]
Comment 2 Arjen Veenhuizen 2016-07-04 05:50:34 UTC
Hi Tim,

Thanks for your feedback!


 - (transfer none) doesn't make sense for booleans and integer types --> fixed

 - please add "Since: 1.10" markers at the end of each gtk-doc blob --> added

 - not quite sure about naming, in particular:

     - gst_buffer_flags() -> gst_buffer_get_flags() ? --> changed

     - gst_buffer_flag_set() -> gst_buffer_set_flags() ? [can set multiple in one go] --> changed

     - gst_buffer_flag_unset() -> gst_buffer_unset_flags() ? [ditto] --> changed
     
     - gst_buffer_flag_is_set() -> gst_buffer_check_flags() _has_flags() is_flag_set? [not sure] --> changed

At first I tried to keep the method names in sync with the macro names, but I agree that your proposed method names are more clear. I will upload a new patch in a couple of minutes.
Comment 3 Arjen Veenhuizen 2016-07-04 05:53:22 UTC
Created attachment 330823 [details] [review]
Revised patch after first review by Tim
Comment 4 Arjen Veenhuizen 2016-07-04 06:01:24 UTC
Created attachment 330826 [details] [review]
Revised patch (v3)

Fixed typo: gst_buffer_flag_has_flags -> gst_buffer_has_flags
Comment 5 Tim-Philipp Müller 2016-08-22 18:00:39 UTC
Thanks for the patch, pushed with minor mostly cosmetic changes:

 commit cec16310458b1fe3b1e0ee42c27c17cbc6f4a400
 Author: Arjen Veenhuizen <arjen.veenhuizen@tno.nl>
 Date:   Thu Jul 7 08:01:24 2016 +0200

    buffer: add explicit getters and setters for buffer flags
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768301


Would be great if you could provide the patch in git format-patch format next time (ie with author and commit message included) :)
Comment 6 Arjen Veenhuizen 2016-08-23 07:51:53 UTC
(In reply to Tim-Philipp Müller from comment #5)
> Thanks for the patch, pushed with minor mostly cosmetic changes:
> 
>  commit cec16310458b1fe3b1e0ee42c27c17cbc6f4a400
>  Author: Arjen Veenhuizen <arjen.veenhuizen@tno.nl>
>  Date:   Thu Jul 7 08:01:24 2016 +0200
> 
>     buffer: add explicit getters and setters for buffer flags
>     
>     https://bugzilla.gnome.org/show_bug.cgi?id=768301
> 
> 
> Would be great if you could provide the patch in git format-patch format
> next time (ie with author and commit message included) :)

I will do that next time! Great that this found its way upstream!