GstVideo-1.0.gir, double entries

May it be possible to remove the doubled entries in

$ grep -A8 "member name=\"onefield\"" /usr/share/gir-1.0/GstVideo-1.0.gir
      <member name="onefield"
              value="8388608"
              c:identifier="GST_VIDEO_BUFFER_FLAG_ONEFIELD"
              glib:nick="onefield">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-frame.h"
             line="161">If the #GstBuffer is interlaced, then only the
                                    first field (as defined by the %GST_VIDEO_BUFFER_FLAG_TFF
                                    flag setting) is to be displayed (Since: 1.16).</doc>
--
      <member name="onefield"
              value="8388608"
              c:identifier="GST_VIDEO_BUFFER_FLAG_ONEFIELD"
              glib:nick="onefield">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-frame.h"
             line="161">If the #GstBuffer is interlaced, then only the
                                    first field (as defined by the %GST_VIDEO_BUFFER_FLAG_TFF
                                    flag setting) is to be displayed (Since: 1.16).</doc>
--
      <member name="onefield"
              value="8"
              c:identifier="GST_VIDEO_FRAME_FLAG_ONEFIELD"
              glib:nick="onefield">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-frame.h"
             line="37">The video frame has one field</doc>
      </member>
      <member name="multiple_view"
--
      <member name="onefield"
              value="8"
              c:identifier="GST_VIDEO_FRAME_FLAG_ONEFIELD"
              glib:nick="onefield">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-frame.h"
             line="37">The video frame has one field</doc>
      </member>
      <member name="bottom_field"

This is for gstreamer-1.16.2.

Unfortunately this gives redefinition errors for Nim.

Known bug in gobject-introspection, see https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/264 .

1 Like

And what do we think about member names starting with a digit?

$ grep -i -A8 "16_235" /usr/share/gir-1.0/GstVideo-1.0.gir
      <member name="16_235"
              value="2"
              c:identifier="GST_VIDEO_COLOR_RANGE_16_235"
              glib:nick="16-235">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-color.h"
             line="33">[16..235] for 8 bit components. Chroma has
                [16..240] range.</doc>
      </member>
      <function name="offsets" c:identifier="gst_video_color_range_offsets">
        <doc xml:space="preserve"
salewski@nuc ~/gintrotest/tests $ grep -i -A8 "0_255" /usr/share/gir-1.0/GstVideo-1.0.gir
      <member name="0_255"
              value="1"
              c:identifier="GST_VIDEO_COLOR_RANGE_0_255"
              glib:nick="0-255">
        <doc xml:space="preserve"
             filename="gst-plugins-base-1.16.2/gst-libs/gst/video/video-color.h"
             line="32">[0..255] for 8 bit components</doc>
      </member>
      <member name="16_235"
              value="2"
              c:identifier="GST_VIDEO_COLOR_RANGE_16_235"

But well, the gst modules are full of names starting with digits, so it seems to be intended:

$ diff     nim_gi/ ~/.nimble/pkgs/gintro-#head/gintro/
Only in /home/salewski/.nimble/pkgs/gintro-#head/gintro/: gimplgst.nim
diff nim_gi/gstgl.nim /home/salewski/.nimble/pkgs/gintro-#head/gintro/gstgl.nim
1292,1307c1292,1307
<     enum100 = 100
<     enum110 = 110
<     enum120 = 120
<     enum130 = 130
<     enum140 = 140
<     enum150 = 150
<     enum300 = 300
<     enum310 = 310
<     enum320 = 320
<     enum330 = 330
<     enum400 = 400
<     enum410 = 410
<     enum420 = 420
<     enum430 = 430
<     enum440 = 440
<     enum450 = 450
---
>     100 = 100
>     110 = 110
>     120 = 120
>     130 = 130
>     140 = 140
>     150 = 150
>     300 = 300
>     310 = 310
>     320 = 320
>     330 = 330
>     400 = 400
>     410 = 410
>     420 = 420
>     430 = 430
>     440 = 440
>     450 = 450
diff nim_gi/gstmpegts.nim /home/salewski/.nimble/pkgs/gintro-#head/gintro/gstmpegts.nim
472,479c472,479
<     enum1_2 = 1
<     enum2_3 = 2
<     enum3_4 = 3
<     enum4_5 = 4
<     enum5_6 = 5
<     enum6_7 = 6
<     enum7_8 = 7
<     enum8_9 = 8
---
>     1_2 = 1
>     2_3 = 2
>     3_4 = 3
>     4_5 = 4
>     5_6 = 5
>     6_7 = 6
>     7_8 = 7
>     8_9 = 8
481,483c481,483
<     enum3_5 = 10
<     enum9_10 = 11
<     enum2_5 = 12
---
>     3_5 = 10
>     9_10 = 11
>     2_5 = 12
2387,2389c2387,2389
<     enum35 = 0
<     enum20 = 1
<     enum25 = 2
---
>     35 = 0
>     20 = 1
>     25 = 2
2480,2481c2480,2481
<     enum14496SceneDescription = 4
<     enum14496ObjetDescriptor = 5
---
>     14496SceneDescription = 4
>     14496ObjetDescriptor = 5
2603,2606c2603,2606
<     enum1_32 = 0
<     enum1_16 = 1
<     enum1_8 = 2
<     enum1_4 = 3
---
>     1_32 = 0
>     1_16 = 1
>     1_8 = 2
>     1_4 = 3
2608,2610c2608,2610
<     enum1_128 = 5
<     enum19_128 = 6
<     enum19_256 = 7
---
>     1_128 = 5
>     19_128 = 6
>     19_256 = 7
2618,2620c2618,2620
<     enum1 = 1
<     enum2 = 2
<     enum4 = 3
---
>     1 = 1
>     2 = 2
>     4 = 3
2625,2626c2625,2626
<     enum2k = 0
<     enum8k = 1
---
>     2k = 0
>     8k = 1
2628,2631c2628,2631
<     enum4k = 3
<     enum1k = 4
<     enum16k = 5
<     enum32k = 6
---
>     4k = 3
>     1k = 4
>     16k = 5
>     32k = 6
diff nim_gi/gstrtp.nim /home/salewski/.nimble/pkgs/gintro-#head/gintro/gstrtp.nim
1412c1412
<     enum1016 = 1
---
>     1016 = 1
diff nim_gi/gstrtsp.nim /home/salewski/.nimble/pkgs/gintro-#head/gintro/gstrtsp.nim
498,500c498,500
<     enum1_0 = 16
<     enum1_1 = 17
<     enum2_0 = 32
---
>     1_0 = 16
>     1_1 = 17
>     2_0 = 32
diff nim_gi/gstvideo.nim /home/salewski/.nimble/pkgs/gintro-#head/gintro/gstvideo.nim
1299,1300c1299,1300
<     enum0_255 = 1
<     enum16_235 = 2
---
>     0_255 = 1
>     16_235 = 2
2280,2282c2280,2282
<     enum90r = 1
<     enum180 = 2
<     enum90l = 3
---
>     90r = 1
>     180 = 2
>     90l = 3

That’s something you need to handle in your bindings generation code. Similar to names that are keywords in the target language or otherwise names that are not allowed.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.