update to new api

Original commit message from CVS:
update to new api
This commit is contained in:
David I. Lehn 2002-10-04 05:35:59 +00:00
parent 439c9df2bf
commit 395e3a265d
2 changed files with 8 additions and 8 deletions

View file

@ -30,7 +30,7 @@ from cp import filter
class Rot13(Identity): class Rot13(Identity):
def chain(self, pad, buf): def chain(self, pad, buf):
# override Identity's chain # override Identity's chain
data = gst_buffer_get_data(buf) data = buf.get_data()
data2 = '' data2 = ''
# waste cycles # waste cycles
for c in data: for c in data:
@ -41,15 +41,15 @@ class Rot13(Identity):
a = 'A' a = 'A'
c = chr((((ord(c) - ord(a)) + 13) % 26) + ord(a)) c = chr((((ord(c) - ord(a)) + 13) % 26) + ord(a))
data2 = data2 + c data2 = data2 + c
newbuf = gst_buffer_new() newbuf = Buffer()
gst_buffer_set_data(newbuf, data2) newbuf.set_data(data2)
self.srcpad.push(newbuf) self.srcpad.push(newbuf)
gobject.type_register(Rot13) gobject.type_register(Rot13)
def main(): def main():
"A GStreamer Python subclassing example of a rot13 filter" "A GStreamer Python subclassing example of a rot13 filter"
gst_debug_set_categories(0) gst_debug_set_categories(0L)
rot13 = Rot13() rot13 = Rot13()
rot13.set_name('rot13') rot13.set_name('rot13')

View file

@ -30,7 +30,7 @@ from cp import filter
class Rot13(Identity): class Rot13(Identity):
def chain(self, pad, buf): def chain(self, pad, buf):
# override Identity's chain # override Identity's chain
data = gst_buffer_get_data(buf) data = buf.get_data()
data2 = '' data2 = ''
# waste cycles # waste cycles
for c in data: for c in data:
@ -41,15 +41,15 @@ class Rot13(Identity):
a = 'A' a = 'A'
c = chr((((ord(c) - ord(a)) + 13) % 26) + ord(a)) c = chr((((ord(c) - ord(a)) + 13) % 26) + ord(a))
data2 = data2 + c data2 = data2 + c
newbuf = gst_buffer_new() newbuf = Buffer()
gst_buffer_set_data(newbuf, data2) newbuf.set_data(data2)
self.srcpad.push(newbuf) self.srcpad.push(newbuf)
gobject.type_register(Rot13) gobject.type_register(Rot13)
def main(): def main():
"A GStreamer Python subclassing example of a rot13 filter" "A GStreamer Python subclassing example of a rot13 filter"
gst_debug_set_categories(0) gst_debug_set_categories(0L)
rot13 = Rot13() rot13 = Rot13()
rot13.set_name('rot13') rot13.set_name('rot13')