Update of /cvsroot/freevo/kaa/xine/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25244/test
Modified Files:
test.py
Log Message:
More API calls. Keep track of the plugin chain, a process which is
obfuscated by the fact that stream PostOuts don't have ports, and that
PostOut.wire(PostIn) is the same as PostOut.wire_video_port(PostIn.port).
So we keep track of the post chain using a wire_object member in Video/
Audio Ports (inputs have a list, outputs have a single target), and PostOut
for streams are treated as a special case (PostOut has its own wire_object
which is used exclusively for the Stream case).
Added _debug_show_chain() to test the chain traversal stuff.
Also added support for xshm.
Index: test.py
===================================================================
RCS file: /cvsroot/freevo/kaa/xine/test/test.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** test.py 19 Jul 2005 04:17:08 -0000 1.5
--- test.py 21 Jul 2005 18:32:13 -0000 1.6
***************
*** 1,37 ****
import sys
! from kaa import xine, display
! import kaa, gc
!
! print xine.get_version()
! sys.exit(0)
! def key_press(key):
print "KEY PRESS", key
if key == 113:
raise SystemExit
win = display.X11Window(size=(640, 480), title="Movie")
win.set_cursor_hide_timeout(0)
- win.show()
x = xine.Xine()
print x.get_log_names()
vo_none = x.open_video_driver("none")
! vo = x.open_video_driver(window = win)
ao = x.open_audio_driver()
! print "0", x.get_log("messages")
! sys.exit(1)
post = x.post_init("buffer", video_targets = [vo])
- print post.list_inputs()
- print post.list_outputs()
- a = post.get_video_inputs()
! print post.get_input("video")
! #apost = x.post_init("stretch", audio_targets = [ao])
! #apost.set_parameter("factor", 0.3)
! #print apost.get_parameters()
- stream = x.stream_new(ao, vo)
- source = stream.get_video_source()
#stream = x.stream_new(apost.get_audio_inputs()[0], a[0])
stream.open(sys.argv[1])
--- 1,57 ----
import sys
! from kaa import xine, display, notifier
! import kaa, gc, weakref
! def key_press(key, stream):
! global post
print "KEY PRESS", key
if key == 113:
raise SystemExit
+ elif key == 32:
+ speed = stream.get_parameter(xine.PARAM_SPEED)
+ if speed == xine.SPEED_PAUSE:
+ stream.set_parameter(xine.PARAM_SPEED, xine.SPEED_NORMAL)
+ else:
+ stream.set_parameter(xine.PARAM_SPEED, xine.SPEED_PAUSE)
+ elif key == 97:
+ post.unwire()
+ xine._debug_show_chain(stream._stream)
win = display.X11Window(size=(640, 480), title="Movie")
win.set_cursor_hide_timeout(0)
x = xine.Xine()
print x.get_log_names()
vo_none = x.open_video_driver("none")
! vo = x.open_video_driver("xv", window = win)
ao = x.open_audio_driver()
! stream = x.stream_new(ao, vo)
! #del x, vo, ao, stream
! #sys.exit(1)
! source = stream.get_video_source()
! asource = stream.get_audio_source()
post = x.post_init("buffer", video_targets = [vo])
! input = post.get_input("video in")
! output = post.get_output("video out")
! print "All Outputs:", post._post.outputs
! for o in post.list_outputs():
! print post.get_output(o)._post_out.port.wire_object
! print "---"
! print "Input:", input, input.get_port()
! print "Output:", output._post_out, output.get_port()
! print "STREAM", source, asource, source.get_port(), source.get_type()
! print "VO", vo._port
! #del x, vo, ao, post, input, output, stream, source, asource
! #sys.exit(1)
! print "\n\n\n"
! # XXX: Activates plugin
! #iport = input.get_port()
! #print "Input port", iport
! source.wire(input)#.get_port())
! print vo._port.wire_object
!
! print "Compare out ports", output.get_port(), vo
#stream = x.stream_new(apost.get_audio_inputs()[0], a[0])
stream.open(sys.argv[1])
***************
*** 39,43 ****
stream.play(time = 60*10)
print "Playing"
! print x.list_post_plugins()
#print post.get_parameters()
print post.set_parameters(ptr = 42)
--- 59,63 ----
stream.play(time = 60*10)
print "Playing"
! print x.list_post_plugins(xine.POST_TYPE_AUDIO_FILTER)
#print post.get_parameters()
print post.set_parameters(ptr = 42)
***************
*** 45,51 ****
#print post.get_parameters()
print "connect"
! kaa.signals["keypress"].connect(key_press)
! print "START MAIN"
kaa.main()
win.hide()
--- 65,100 ----
#print post.get_parameters()
+ #output.unwire()
+ #source.wire(vo)
+ #stream.set_parameter(xine.PARAM_SPEED, xine.SPEED_PAUSE)
+ #post.unwire()
+ #stream.set_parameter(xine.PARAM_SPEED, xine.SPEED_NORMAL)
+ xine._debug_show_chain(stream._stream)
+ print stream._stream.video_source.port
+ #del x, vo, ao, post, input, output, stream, source, asource
+ #sys.exit(1)
+ #stream2 = x.stream_new(ao, vo)
+ #print stream.slave(stream2)
+ #print stream.slave(stream2)
+ #print stream2
print "connect"
! kaa.signals["keypress"].connect_weak(key_press, stream)
!
! def print_vpts(stream):
! print "VPTS", stream.get_current_vpts()
! print "Error", stream.get_error(), " - status", stream.get_status()
! print stream.get_pos_length()
! print stream.get_meta_info(xine.META_INFO_VIDEOCODEC)
!
! #timer = notifier.Timer(print_vpts, stream)
! #timer.start(1000)
!
! #deint = x.post_init("tvtime", video_targets = [vo])
! #deint.set_parameters(method=5)
!
! print post.get_video_inputs()
! win.show()
kaa.main()
win.hide()
+ # Explicitly delete these to test that gc works.
+ del x, vo, ao, post, input, output, stream, source, asource
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog