Port from pygst to PyGI [BiteSize]

Bug #833599 reported by Jason Gerard DeRose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Novacut
Fix Released
High
Jason Gerard DeRose

Bug Description

There isn't much code yet in the `novacut` component itself, which is great because it means you can get involved on the ground floor, when it's easy to find your way around.

In 11.09 Cycle, we're migrating all the Novacut components to Python3 (hooray!). This means we'll only be able to run on Oneiric or newer, but Novacut is a young project still and we have to be very forward looking at this point.

The first BiteSize step in the migration to Python3 is to migrate from the hand-coded python-gst bindings (which are Python2 only) to the GObject Introspection based bindings (which can be used from both Python2 and Python3).

To do this, you'll first need to follow the instructions in HACKING.txt to download the 2 test videos the current unit tests use:

  http://bazaar.launchpad.net/~novacut/novacut/trunk/view/head:/HACKING.txt

After you have the videos, make sure the unit tests run correctly before you start any work:

  ./setup.py test

Now you probably need to install the `gir1.2-gst-plugins-base-0.10` package, like this:

  sudo apt-get install gir1.2-gst-plugins-base-0.10

Then you'll be working on 2 files:

  http://bazaar.launchpad.net/~novacut/novacut/trunk/view/head:/novacut/renderer.py
  http://bazaar.launchpad.net/~novacut/novacut/trunk/view/head:/novacut/tests/test_renderer.py

The most obvious change is you'll be replacing:

  import gst
  import gobj

With:

  from gi.repository import GObject, Gst

Overall the new API is very similar, but there will be a number of small changes you'll have to cope with. You'll know you've succeed when you can again run:

  ./setup.py test

And all the tests pass! And the last thing you'll need to do is update debian/control:

  http://bazaar.launchpad.net/~novacut/novacut/trunk/view/head:/debian/control

In both the Build-Depends and Depends, you'll have to replace:

  python-gst0.10

With:

  python-gobject, gir1.2-gst-plugins-base-0.10

Then propose your branch for merging! If you have any questions, stop by #novacut on IRC (freenode) and ping probably jderose or dmj726 for help (or ask any of the other friendly folks in the channel).

In theory you should be able to do this on Natty, but things may go much smoother on Oneiric as from what I understand, PyGI + GStreamer wasn't considered ready for prime time in Natty.

Tags: bitesize pygi

Related branches

Akshat Jain (akshatj)
Changed in novacut:
assignee: nobody → Akshat Jain (ssj6akshat1234)
Changed in novacut:
assignee: Akshat Jain (ssj6akshat1234) → nobody
assignee: nobody → Jason Gerard DeRose (jderose)
status: Triaged → In Progress
Changed in novacut:
status: In Progress → Fix Committed
Changed in novacut:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.