Skip to content

gst-python: Upgrade old python2 code

R S Nikhil Krishna requested to merge rsnk96/gstreamer:py2to3 into main

Upgrades old python2 code (python2 has been deprecated for 4 years)

Todo:

  • Run py-2to3 and filter out irrelevant corrections
  • Upgrade any gstreamer-0.1x tests --> gstreamer-1.x (Only Pads tests are left)
  • Upgrade any other gstreamer-0.1x code --> gstreamer-1.x
  • Evaluate what to do with obsolete code Obsolete code removed

TODO in a future MR:

  • Fix missing functionality, and make Python Gst API more usable:
    • Remove warnings on not specifying min Gst/GLib/.... versions.
    • Buffers:
      • Make Gst.Buffer("56789") = Gst.Buffer.new_wrapped(b"56789")
      • Make _repr_(buffer) = buf.map(Gst.MapFlags.READ).data.tobytes().decode()
      • Make len(buffer) = buffer.get_size()
      • Figure out how to write buffers in python API, add it here?
    • Let Gst.ElementFactory.make() run with a single arg (take None as default arg for 2nd)
    • Allow writing to Gst structures from within python
    • Tags
      • Make Gst.TagList() = Gst.TagList.new_empty()
      • Allow creation of non-standard tags / expose relevant API from C (Gst.tag_register() doesn't work)
      • GstTag.tag_list_to_xmp_buffer doesn't copy taglist to xmp
    • Make Gst.Pad()=Gst.Pad.new()
    • Fix the inconsistency in the API - for int ranges, it's intrange.range.start vs for doubles, it's doublerange.start
    • Allow many args to Gst.bin.remove(), it has been overridden for add() already
  • Add missing py tutorials
  • Migrate the 1 or 2 pending tests
Edited by R S Nikhil Krishna

Merge request reports

Loading