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 767222 - audio: Fix gst_audio_channel_positions_to_mask annotations
audio: Fix gst_audio_channel_positions_to_mask annotations
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-03 21:31 UTC by Thibault Saunier
Modified: 2017-01-06 16:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audio: Fix gst_audio_channel_positions_to_mask annotations (1.17 KB, patch)
2016-06-03 21:31 UTC, Thibault Saunier
none Details | Review

Description Thibault Saunier 2016-06-03 21:31:30 UTC
Even with that fix the result is not correct as I am getting:

    <parameter name="channels"
               direction="out"
               caller-allocates="0"
               transfer-ownership="full">
      <doc xml:space="preserve">The number of channels</doc>
      <type name="gint" c:type="gint"/>
    </parameter>
    <parameter name="channel_mask" transfer-ownership="none">
      <doc xml:space="preserve">The input channel_mask</doc>
      <type name="guint64" c:type="guint64"/>
    </parameter>

which is not correct, I am not sure if I am missing something or the g-ir-parser is broken
Comment 1 Thibault Saunier 2016-06-03 21:31:34 UTC
Created attachment 329096 [details] [review]
audio: Fix gst_audio_channel_positions_to_mask annotations
Comment 2 Thibault Saunier 2016-06-03 21:32:33 UTC
Channels direction=out, I am not sure how a int value (not a pointer) could be out? :)
Comment 3 Tim-Philipp Müller 2016-06-03 21:54:31 UTC
But but but ... the annotation looks correct, doesn't it? So it does seem like the parser is broken or makes some wrong assumptions, no?
Comment 4 Thibault Saunier 2016-06-03 22:25:45 UTC
I think we were missing `(out caller-allocates)` but appart from that I believe this is correct now, just opening the bug here so you check if I am right, otherwise we should move it to gobject-introspection I think
Comment 5 Tim-Philipp Müller 2016-06-04 11:01:24 UTC
Yeah, that part (caller-allocates) is obviously correct imho, I just think it should not be required to mark the 'channels' gint explicitly as (in). If you remove just the (in) does it work fine?

Fwiw, I'm not getting the direction=out here with g-i 1.48.0.
Comment 6 Thibault Saunier 2016-06-04 13:53:00 UTC
OK, that is weird I am also using g-i 1.48 (I am inside flatpak sandbox so this is what is being used exactly: https://github.com/GNOME/gnome-sdk-images/blob/gnome-3-20/org.gnome.Sdk.json.in#L106)

What does the .gir file look like exactly? (with and without that patch?)

Are you able to do something like:

  $ python3 -c "from gi.repository import Gst; Gst.init(None); from gi.repository import GstAudio; GstAudio.audio_channel_positions_to_mask([GstAudio.AudioChannelPosition.MONO], True)"

also what does that return:

  $python -c "from gi.repository import Gst; Gst.init(None); from gi.repository import GstAudio; print(GstAudio.audio_channel_positions_to_mask.__doc__)"

Thanks.
Comment 7 Tim-Philipp Müller 2016-06-04 14:21:29 UTC
Also - am I confused or does your patch patch _from_mask() while you talk about _to_mask() everywhere? :)
Comment 8 Thibault Saunier 2016-06-04 14:27:54 UTC
> Also - am I confused or does your patch patch _from_mask() while you talk about _to_mask() everywhere? :)

Sorry, none works actually, and my patch is about from_mask indeed.
Comment 9 Sebastian Dröge (slomo) 2016-06-06 08:09:35 UTC
That looks like a problem in the parser indeed, but "channels" is also not marked as "out" for me. Also adding (caller-allocates) does not make any difference in the generated gir here, it's always the following, which is obviously wrong in a few different ways:

      <parameters>
        <parameter name="channels" transfer-ownership="none">
          <doc xml:space="preserve">The number of channels</doc>
          <type name="gint" c:type="gint"/>
        </parameter>
        <parameter name="channel_mask" transfer-ownership="none">
          <doc xml:space="preserve">The input channel_mask</doc>
          <type name="guint64" c:type="guint64"/>
        </parameter>
        <parameter name="position" transfer-ownership="none">
          <doc xml:space="preserve">The
  %GstAudioChannelPosition&lt;!-- --&gt;s</doc>
          <array length="0"
                 zero-terminated="0"
                 c:type="GstAudioChannelPosition*">
            <type name="AudioChannelPosition"
                  c:type="GstAudioChannelPosition"/>
          </array>
        </parameter>
      </parameters>
Comment 10 Tim-Philipp Müller 2016-12-16 14:46:07 UTC
This was pushed:

commit 8bbf67c37d055d65fff4a18e854de8fda72d76d9
Author: Thibault Saunier <tsaunier@gnome.org>
Date:   Thu Dec 15 10:57:14 2016 -0300

    audio: Fix introspection annotation
    
    In gst_audio_check_valid_channel_positions the mask
    is an out parameter.
    
    And minor conversion from a print to a GST_ERROR.


I don't know if it fixes anything, or what else there is to do with this bug?

If the parser is broken we should file an issue against g-i I suppose?
Comment 11 Thibault Saunier 2016-12-16 14:52:09 UTC
(In reply to Tim-Philipp Müller from comment #10)
> This was pushed:
> 
> commit 8bbf67c37d055d65fff4a18e854de8fda72d76d9
> Author: Thibault Saunier <tsaunier@gnome.org>
> Date:   Thu Dec 15 10:57:14 2016 -0300
> 
>     audio: Fix introspection annotation
>     
>     In gst_audio_check_valid_channel_positions the mask
>     is an out parameter.
>     
>     And minor conversion from a print to a GST_ERROR.
> 
> 
> I don't know if it fixes anything, or what else there is to do with this bug?
> 
> If the parser is broken we should file an issue against g-i I suppose?

Well, those are 2 different function, the patch I just pushed surely fixed an issue for that function (it could not work before).

I guess this bug is not related and we should just keep it opened.
Comment 12 Tim-Philipp Müller 2016-12-16 14:56:01 UTC
Ah right, sorry. Still, any idea what to do with this though?
Comment 13 Thibault Saunier 2017-01-06 16:58:47 UTC
OK, it seems to work here now, let's close. Sorry for the noise :)