GNOME Bugzilla – Bug 794162
gst-python: Can't set channel positions with GstAudio.AudioInfo.set_format
Last modified: 2018-11-03 15:37:17 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.
-- 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.