aboutsummaryrefslogtreecommitdiffstats
path: root/examples/emotion
diff options
context:
space:
mode:
authorDavide Andreoli <dave@gurumeditation.it>2013-02-27 20:44:57 +0000
committerDavide Andreoli <dave@gurumeditation.it>2013-02-27 20:44:57 +0000
commit904468ba00d532a72baf9b1b7c1152de01b30d63 (patch)
tree7ced4769fc2f99d2287c696f1c9e8062d9ad79bf /examples/emotion
parentPython-EFL: emotion api and docs 100% done (diff)
downloadpython-efl-904468ba00d532a72baf9b1b7c1152de01b30d63.tar.gz
emotion is really able to play streams from v4l :) I just made a test for it
SVN revision: 84392
Diffstat (limited to 'examples/emotion')
-rw-r--r--examples/emotion/test_emotion.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/examples/emotion/test_emotion.py b/examples/emotion/test_emotion.py
index 4335281..2cccaf3 100644
--- a/examples/emotion/test_emotion.py
+++ b/examples/emotion/test_emotion.py
@@ -96,7 +96,8 @@ class MovieWindow(edje.Edje):
pf = pos * 100 - (ps * 100) - (pm * 60 * 100) - (ph * 60 * 60 * 100)
buf = "%i:%02i:%02i.%02i / %i:%02i:%02i" % (ph, pm, ps, pf, lh, lm, ls)
self.part_text_set("video_progress_txt", buf)
- self.part_drag_value_set("video_progress", pos / length, 0.0)
+ if length > 0:
+ self.part_drag_value_set("video_progress", pos / length, 0.0)
# frame callbacks
def frame_signal_play_cb(self, frame, emission, source):
@@ -314,9 +315,12 @@ def cmdline_parse():
choices=("xine", "gstreamer", "vlc"), default="gstreamer",
help=("multimedia engine to use (xine, gstreamer or vlc) "
"default=%default") )
+ parser.add_option("-w", "--webcams", action="store_true",
+ default=False,
+ help=("show all the available webcams streams") )
options, args = parser.parse_args()
- if not args:
- parser.error("missing filename")
+ if not args and not options.webcams:
+ parser.error("missing filename or the -w option")
return options, args
@@ -337,16 +341,28 @@ if __name__ == "__main__"or True:
win.resize_object_add(scene)
scene.show()
+ win.data["movie_windows"] = objects = []
+
# one edje frame for each file passed
- i = 0
- objects = []
for fname in args:
+ print("Playing url: '%s'" % (fname))
mw = MovieWindow(win.evas, media_module=options.engine, media_file=fname)
+ objects.append(mw)
+
+ # one edje frame for each webcams found
+ if options.webcams:
+ for webcam in emotion.webcams_get():
+ print("Found webcam: '%s' url: '%s'" % (webcam))
+ name, url = webcam
+ mw = MovieWindow(win.evas, media_module=options.engine, media_file=url)
+ objects.append(mw)
+
+ # show each frame
+ i = 0
+ for mw in objects:
mw.pos = (i, i)
mw.show()
- objects.append(mw)
i += 40
- win.data["movie_windows"] = objects
# show the win and enter elm main loop
win.resize(*options.geometry)