From: <en...@ke...> - 2006-11-21 12:04:55
|
CVS Root: /cvs/gstreamer Module: gst-media-test Changes by: ensonic Date: Tue Nov 21 2006 12:04:53 UTC Log message: * gsttester.py: serialize gpointers in tags, since python doesn't know how to serialize them for us. handle exceptions when serializing. * streamtest.py: * typefindtest.py: handle the queues a bit better (change taken from discoverer.py). some logging changes to easily parse caps from logs. Modified files: . : ChangeLog gsttester.py streamtest.py typefindtest.py Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-media-test/ChangeLog.diff?r1=1.36&r2=1.37 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-media-test/gsttester.py.diff?r1=1.10&r2=1.11 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-media-test/streamtest.py.diff?r1=1.2&r2=1.3 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-media-test/typefindtest.py.diff?r1=1.9&r2=1.10 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-media-test/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ChangeLog 10 Nov 2006 14:19:40 -0000 1.36 +++ ChangeLog 21 Nov 2006 12:04:41 -0000 1.37 @@ -1,3 +1,14 @@ +2006-11-21 Stefan Kost <en...@us...> + + * gsttester.py: + serialize gpointers in tags, since python doesn't know how to + serialize them for us. handle exceptions when serializing. + * streamtest.py: + * typefindtest.py: + handle the queues a bit better (change taken from discoverer.py). + some logging changes to easily parse caps from logs. 2006-11-10 Stefan Kost <en...@us...> * gsttester.py: Index: gsttester.py RCS file: /cvs/gstreamer/gst-media-test/gsttester.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gsttester.py 10 Nov 2006 14:19:40 -0000 1.10 +++ gsttester.py 21 Nov 2006 12:04:41 -0000 1.11 @@ -144,6 +144,9 @@ #gst.info("its a buffer"); l[ix] = "GstBuffer" ix += 1 + elif isinstance(value[k], gobject.GPointer): + #gst.info("its a pointer"); + value[k] = "GPointer" self.infos[key] = value def stop_test(self): @@ -169,15 +172,20 @@ if self._timeoutid: gobject.source_remove(self._timeoutid) gst.info("about to send %r,%r,%s,%r" % (self._success, self._reason, self._errors, self.infos)) - data = cPickle.dumps([self._success, - self._reason, - self._percentage, - self._errors, - self._elements, - self.infos]) - pfile = file("pickledata", "w+") - pfile.write(data) - pfile.close() + try: + data = cPickle.dumps([self._success, + self._reason, + self._percentage, + self._errors, + self._elements, + self.infos]) + pfile = file("pickledata", "w+") + pfile.write(data) + pfile.close() + except cPickle.PickleError, detail: + gst.info("can't pickle data:", detail) + except TypeError: + gst.info("can't pickle data") self.mainloop.quit() def get_test_result(self): Index: streamtest.py RCS file: /cvs/gstreamer/gst-media-test/streamtest.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- streamtest.py 10 Nov 2006 14:19:40 -0000 1.2 +++ streamtest.py 21 Nov 2006 12:04:41 -0000 1.3 @@ -34,7 +34,20 @@ src.set_property("location", self.uri) queue = gst.element_factory_make('queue') - queue.set_property("max-size-time", 10 * gst.SECOND) + queue.props.max_size_time = 10 * gst.SECOND + # If durations are bad on the buffers (common for video decoders), we'll + # never reach the min_threshold_time or max_size_time. So, set a large + # max size in buffers, and if reached, disable the min_threshold_time. + # This ensures we don't fail to discover with various ffmpeg + # demuxers/decoders that provide bogus (or no) duration. + queue.props.max_size_buffers = 500 + def _disable_min_threshold_cb(queue): + gst.warning("max buffers in queue reached"); + queue.props.min_threshold_time = 0 + queue.disconnect(queue_signal_id) + # send an error to the bus? + #self.stop_test() + queue_signal_id = queue.connect('overrun', _disable_min_threshold_cb) decodebin = gst.element_factory_make('decodebin') Index: typefindtest.py RCS file: /cvs/gstreamer/gst-media-test/typefindtest.py,v retrieving revision 1.9 diff -u -d -r1.9 -r1.10 --- typefindtest.py 10 Nov 2006 14:19:40 -0000 1.9 +++ typefindtest.py 21 Nov 2006 12:04:41 -0000 1.10 @@ -97,7 +97,7 @@ gobject.idle_add(self.stop_test) def _have_type_cb(self, decodebin, probability, caps): - gst.info("have_type : %s" % caps.to_string()) + gst.info("caps:%s" % caps.to_string()) self.add_info('File Typefinding', {"MimeType":caps.to_string(), "Probability":int(probability)}) @@ -143,15 +143,33 @@ def _connect_fakesink_pad(self, pad, container): queue = gst.element_factory_make("queue") + fakesink = gst.element_factory_make("fakesink") container.add(queue, fakesink) queue.link(fakesink) fakesink.set_state(gst.STATE_PAUSED) queue.set_state(gst.STATE_PAUSED) - pad.link(queue.get_pad("sink")) + res = pad.link(queue.get_pad("sink")) + except gst.LinkError: + pad.warning("failed to link queue and fakesink:") def _new_decoded_pad_cb(self, decodebin, pad, is_last): + # these caps are not yet fixed pad.info("caps:%s" % pad.get_caps().to_string()) pad.debug("is_last:%d" % is_last) self.streams.append(Stream(pad, caps=pad.get_caps())) @@ -173,6 +191,8 @@ gst.info("can't get negotiated caps") stream.caps = stream.pad.get_caps() gst.info("querying on pad %s" % stream.pad.get_name()) + # these are the negotiated caps + gst.info("caps:%s" % stream.caps.to_string()) try: length, format = stream.pad.query_duration(gst.FORMAT_TIME) except: |