Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gst-python gst-python
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gst-pythongst-python
  • Issues
  • #10

Closed
Open
Created Mar 07, 2018 by Bugzilla Migration User@bugzilla-migration

gst-python: Can't set channel positions with GstAudio.AudioInfo.set_format

Submitted by Vladislav Glinsky

Link to original bug (#794162)

Description

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.

Version: 1.12.4

Assignee
Assign to
Time tracking