File: eos_test.py

package info (click to toggle)
freej 0.10git20100110-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 32,080 kB
  • ctags: 22,705
  • sloc: cpp: 156,254; ansic: 25,531; sh: 13,538; perl: 4,624; makefile: 3,278; python: 2,889; objc: 1,284; asm: 1,125; ruby: 126
file content (41 lines) | stat: -rw-r--r-- 622 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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();