From: <wi...@fr...> - 2006-02-10 10:56:45
|
CVS Root: /cvs/gstreamer Module: gst-python Changes by: wingo Date: Fri Feb 10 2006 02:53:34 PST Log message: 2006-02-10 Andy Wingo <wi...@po...> * examples/play.py (GstPlayer.query_position) (PlayerWindow.update_scale_cb): Only return position, duration from query_position -- fixes a bugaboo. (main): Add some input validation. * examples/pipeline-tester (data): Add a pipeline to test software scaling. Modified files: . : ChangeLog examples : pipeline-tester play.py Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/ChangeLog.diff?r1=1.405&r2=1.406 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/examples/pipeline-tester.diff?r1=1.14&r2=1.15 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/examples/play.py.diff?r1=1.5&r2=1.6 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-python/ChangeLog,v retrieving revision 1.405 retrieving revision 1.406 diff -u -d -r1.405 -r1.406 --- ChangeLog 7 Feb 2006 18:54:52 -0000 1.405 +++ ChangeLog 10 Feb 2006 10:53:21 -0000 1.406 @@ -1,3 +1,13 @@ +2006-02-10 Andy Wingo <wi...@po...> + + * examples/play.py (GstPlayer.query_position) + (PlayerWindow.update_scale_cb): Only return position, duration + from query_position -- fixes a bugaboo. + (main): Add some input validation. + * examples/pipeline-tester (data): Add a pipeline to test software + scaling. 2006-02-07 Edward Hervey <ed...@fl...> * gst/gst.override: Index: pipeline-tester RCS file: /cvs/gstreamer/gst-python/examples/pipeline-tester,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- pipeline-tester 1 Dec 2005 19:15:26 -0000 1.14 +++ pipeline-tester 10 Feb 2006 10:53:22 -0000 1.15 @@ -67,6 +67,12 @@ ('Video test, RGB format', 'videotestsrc \n' ' ! video/x-raw-rgb,red_mask=0xff00 \n' + ' ! ffmpegcolorspace \n' + ' ! ximagesink'), + ('Software scaling', + 'videotestsrc \n' + ' ! video/x-raw-rgb,height=200,width=320 \n' + ' ! videoscale method=2 \n' ' ! ximagesink'), ('Reencode Vorbis to mulaw, play via ALSA', 'filesrc location=cooldance.ogg \n' Index: play.py RCS file: /cvs/gstreamer/gst-python/examples/play.py,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- play.py 1 Dec 2005 19:15:26 -0000 1.5 +++ play.py 10 Feb 2006 10:53:22 -0000 1.6 @@ -29,20 +29,16 @@ def query_position(self): "Returns a (position, duration) tuple" try: - ret = self.player.query_position(gst.FORMAT_TIME) + position, format = self.player.query_position(gst.FORMAT_TIME) except: position = gst.CLOCK_TIME_NONE - else: - position = ret[0] - ret = self.player.query_duration(gst.FORMAT_TIME) + duration, format = self.player.query_duration(gst.FORMAT_TIME) duration = gst.CLOCK_TIME_NONE - duration = ret[0] - return (position, duration, ret[1]) + return (position, duration) def seek(self, location): """ @@ -222,7 +218,7 @@ self.update_scale_cb) def update_scale_cb(self): - self.p_position, self.p_duration, format = self.player.query_position() + self.p_position, self.p_duration = self.player.query_position() if self.p_position != gst.CLOCK_TIME_NONE: value = self.p_position * 100.0 / self.p_duration self.adjustment.set_value(value) @@ -260,7 +256,19 @@ self.adjustment.set_value(0.0) def main(args): + def usage(): + sys.stderr.write("usage: %s URI-OF-MEDIA-FILE\n" % args[0]) + sys.exit(1) w = PlayerWindow() + if len(args) != 2: + usage() + if not gst.uri_is_valid(args[1]): + sys.stderr.write("Error: Invalid URI: %s\n" % args[1]) w.load_file(args[1]) w.show_all() |