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 794162 - gst-python: Can't set channel positions with GstAudio.AudioInfo.set_format
gst-python: Can't set channel positions with GstAudio.AudioInfo.set_format
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-python
1.12.4
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-07 19:01 UTC by Vladislav Glinsky
Modified: 2018-11-03 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vladislav Glinsky 2018-03-07 19:01:05 UTC
Hello, I'm trying to rewrite basic tutorial #8 (https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html) in Python and in original C code we have lines:

GstAudioInfo info;
gst_audio_info_set_format(&info, GST_AUDIO_FORMAT_S16, SAMPLE_RATE, 1, NULL);

I've rewritten them as:

info = GstAudio.AudioInfo()
info.set_format(
    format=GstAudio.AudioFormat.S16,
    rate=SAMPLE_RATE,
    channels=1,
    position=None
)

According to documentation and source code of `gst_audio_info_set_format` last parameter `position` is nullable (for 1 and 2 channel setup).
Python documents type of `position` argument as `GstAudio.AudioChannelPosition` and nothing said if it accepts `None`, so with Python code above I will get an error: "Argument 4 does not allow None as a value".

I can't pass list of `GstAudio.AudioChannelPosition` instead - I will get "Expected a GstAudio.AudioChannelPosition, but got list". Isn't list of `GstAudio.AudioChannelPosition` an equivalent of `GstAudioChannelPosition*`?

Also it's weird why `position` in C code is annotated with `fixed size` of 64 when in fact 64 is the maximum size of channel positions array and channel count argument used to determine actual array size.
Comment 1 GStreamer system administrator 2018-11-03 15:37:17 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-python/issues/10.