mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-06 04:59:16 +01:00
Screen API changed a bit: now size args are taken from init(w,h) screen implementations should provide an _init(w,h) as well constructors are without arguments (as in the rest of freej)
42 lines
622 B
Python
42 lines
622 B
Python
import threading
|
|
import freej
|
|
|
|
class MyCall(freej.DumbCall):
|
|
def __init__(self, *args):
|
|
super(MyCall, self).__init__(*args)
|
|
|
|
def callback(self):
|
|
print "detected EOS of film (python callback)"
|
|
|
|
freej.set_debug(3)
|
|
|
|
W = 400
|
|
H = 300
|
|
|
|
# init context
|
|
cx = freej.Context()
|
|
cx.init()
|
|
# init screen
|
|
scr = freej.SdlScreen()
|
|
scr.init( 400, 300 )
|
|
|
|
cx.add_screen(scr)
|
|
|
|
v = freej.VideoLayer()
|
|
|
|
v.init(cx)
|
|
|
|
v.open('/home/jaromil/Movies/TheRevolutionWillNotBeTelevisedGilScottHeron.mp4')
|
|
|
|
v.start()
|
|
|
|
scr.add_layer( v )
|
|
|
|
|
|
|
|
cb = MyCall()
|
|
v.add_eos_call(cb)
|
|
|
|
th = threading.Thread(target = cx.start , name = "freej")
|
|
th.start();
|