mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
gst/arg-types.py (GstCapsArg.write_const_param)
Original commit message from CVS: 2006-04-19 Andy Wingo <wingo@pobox.com> * gst/arg-types.py (GstCapsArg.write_const_param) (GstCapsArg.write_param): If there is a default value, initialize the py_caps variable to NULL. PyArgs_Parse* doesn't touch c variables if the optional arg isn't there. Fixes #339010.
This commit is contained in:
parent
f0a20f8343
commit
ebf47e1442
3 changed files with 19 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-04-19 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
|
* gst/arg-types.py (GstCapsArg.write_const_param)
|
||||||
|
(GstCapsArg.write_param): If there is a default value, initialize
|
||||||
|
the py_caps variable to NULL. PyArgs_Parse* doesn't touch c
|
||||||
|
variables if the optional arg isn't there. Fixes #339010.
|
||||||
|
|
||||||
2006-04-19 Andy Wingo <wingo@pobox.com>
|
2006-04-19 Andy Wingo <wingo@pobox.com>
|
||||||
|
|
||||||
* examples/remuxer.py (GstPlayer.seek): Don't do accurate seeks,
|
* examples/remuxer.py (GstPlayer.seek): Don't do accurate seeks,
|
||||||
|
|
|
@ -165,6 +165,7 @@ class FVUMeter(gtk.DrawingArea):
|
||||||
self.style.set_background(self.window, gtk.STATE_NORMAL)
|
self.style.set_background(self.window, gtk.STATE_NORMAL)
|
||||||
|
|
||||||
def do_expose_event(self, event):
|
def do_expose_event(self, event):
|
||||||
|
print 'foo'
|
||||||
self.chain(event)
|
self.chain(event)
|
||||||
|
|
||||||
x, y, w, h = self.allocation
|
x, y, w, h = self.allocation
|
||||||
|
@ -235,5 +236,6 @@ class FVUMeter(gtk.DrawingArea):
|
||||||
self.leftborder + vumeter_width + 5,
|
self.leftborder + vumeter_width + 5,
|
||||||
self.topborder + int(vumeter_height / 2 - layout_height / 2),
|
self.topborder + int(vumeter_height / 2 - layout_height / 2),
|
||||||
layout)
|
layout)
|
||||||
|
print 'bar'
|
||||||
|
|
||||||
gobject.type_register(FVUMeter)
|
gobject.type_register(FVUMeter)
|
||||||
|
|
|
@ -100,7 +100,11 @@ class GstCapsArg(ArgType):
|
||||||
raise RuntimeError, "write_param not implemented for %s" % ptype
|
raise RuntimeError, "write_param not implemented for %s" % ptype
|
||||||
|
|
||||||
def write_const_param(self, pname, pdflt, pnull, info):
|
def write_const_param(self, pname, pdflt, pnull, info):
|
||||||
info.varlist.add('PyObject', '*py_'+pname)
|
if pdflt:
|
||||||
|
assert pdflt == 'NULL'
|
||||||
|
info.varlist.add('PyObject', '*py_' + pname + ' = NULL')
|
||||||
|
else:
|
||||||
|
info.varlist.add('PyObject', '*py_' + pname)
|
||||||
info.varlist.add('GstCaps', '*'+pname)
|
info.varlist.add('GstCaps', '*'+pname)
|
||||||
info.varlist.add('gboolean', pname+'_is_copy')
|
info.varlist.add('gboolean', pname+'_is_copy')
|
||||||
info.add_parselist('O', ['&py_'+pname], [pname])
|
info.add_parselist('O', ['&py_'+pname], [pname])
|
||||||
|
@ -112,7 +116,11 @@ class GstCapsArg(ArgType):
|
||||||
info.codeafter.append (self.after % { 'name' : pname, 'namecopy' : '&'+pname+'_is_copy' })
|
info.codeafter.append (self.after % { 'name' : pname, 'namecopy' : '&'+pname+'_is_copy' })
|
||||||
|
|
||||||
def write_normal_param(self, pname, pdflt, pnull, info):
|
def write_normal_param(self, pname, pdflt, pnull, info):
|
||||||
info.varlist.add('PyObject', '*py_'+pname)
|
if pdflt:
|
||||||
|
assert pdflt == 'NULL'
|
||||||
|
info.varlist.add('PyObject', '*py_' + pname + ' = NULL')
|
||||||
|
else:
|
||||||
|
info.varlist.add('PyObject', '*py_' + pname)
|
||||||
info.varlist.add('GstCaps', '*'+pname)
|
info.varlist.add('GstCaps', '*'+pname)
|
||||||
info.add_parselist('O', ['&py_'+pname], [pname])
|
info.add_parselist('O', ['&py_'+pname], [pname])
|
||||||
info.arglist.append(pname)
|
info.arglist.append(pname)
|
||||||
|
|
Loading…
Reference in a new issue