[Bug 677925] New: Gst.ElementFactory.list_get_elements fails with constant values

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Tue Jun 12 01:15:01 PDT 2012


https://bugzilla.gnome.org/show_bug.cgi?id=677925
  GStreamer | gst-plugins-bad | 0.11.x

           Summary: Gst.ElementFactory.list_get_elements fails with
                    constant values
    Classification: Platform
           Product: GStreamer
           Version: 0.11.x
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: shakaran at gmail.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


Using the object Gst.ElementFactory.list_get_elements function causes serveral
exception on python. I am using Ubuntu 12.10 with Gstreamer 0.11.91-2.

This is the exaple code:
#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; mode: python -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet 

import sys

import gi
try:
    gi.require_version('Gst', '1.0')
    from gi.repository import Gst
except ValueError:
    print 'Could not find required Gstreamer 1.0 library.'
    sys.exit(1)

# Setup GStreamer 
Gst.init(None)
Gst.init_check(None)
print Gst.version_string(), Gst.version()

print 'ELEMENT_FACTORY_TYPE_ANY:', Gst.ELEMENT_FACTORY_TYPE_ANY
print Gst.ElementFactory.list_get_elements('Gst.ELEMENT_FACTORY_TYPE_ANY',
10000)

Running the example shows this traceback

GStreamer 1.0.0 (1L, 0L, 0L, 0L)
ELEMENT_FACTORY_TYPE_ANY: -1
Traceback (most recent call last):
  File "/home/shakaran/Documentos/Projects/fs/gst_element_factory.py", line 22,
in <module>
    print Gst.ElementFactory.list_get_elements('Gst.ELEMENT_FACTORY_TYPE_ANY',
10000)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: Must be number, not str

Also using other constants yields other exceptions:

#!/usr/bin/env python
# -*- coding: utf-8; tab-width: 4; mode: python -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet 

import sys

import gi
try:
    gi.require_version('Gst', '1.0')
    from gi.repository import Gst
except ValueError:
    print 'Could not find required Gstreamer 1.0 library.'
    sys.exit(1)

# Setup GStreamer 
Gst.init(None)
Gst.init_check(None)
print Gst.version_string(), Gst.version()

print 'ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS:',
Gst.ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS
print
Gst.ElementFactory.list_get_elements(Gst.ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS,
10000)
----

GStreamer 1.0.0 (1L, 0L, 0L, 0L)
ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS: 0
Traceback (most recent call last):
  File "/home/shakaran/Documentos/Projects/fs/gst_element_factory.py", line 22,
in <module>
    print
Gst.ElementFactory.list_get_elements(Gst.ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS,
10000)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 47, in function
    return info.invoke(*args, **kwargs)
TypeError: Expected a Gst.Rank, but got int


I can observe on Gst-1.0.gir file this constants and all this have bad values
defined:

    <constant name="ELEMENT_FACTORY_TYPE_ANY"
              value="-1"
              c:type="GST_ELEMENT_FACTORY_TYPE_ANY">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_AUDIOVIDEO_SINKS">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_AUDIO_ENCODER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_AUDIO_ENCODER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_DECODABLE"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_DECODABLE">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_DECODER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_DECODER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_DEMUXER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_DEMUXER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_DEPAYLOADER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_DEPAYLOADER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_ENCODER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_ENCODER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_FORMATTER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_FORMATTER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MAX_ELEMENTS"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MAX_ELEMENTS">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_ANY"
              value="-281474976710656"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_ANY">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_AUDIO"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_IMAGE"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_METADATA"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_METADATA">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_SUBTITLE">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MEDIA_VIDEO"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_MUXER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_MUXER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_PARSER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_PARSER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_PAYLOADER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_PAYLOADER">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_SINK"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_SINK">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_SRC"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_SRC">
      <type name="gint" c:type="gint"/>
    </constant>
    <constant name="ELEMENT_FACTORY_TYPE_VIDEO_ENCODER"
              value="0"
              c:type="GST_ELEMENT_FACTORY_TYPE_VIDEO_ENCODER">
      <type name="gint" c:type="gint"/>
    </constant>

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list