Author: dmeyer
Date: Thu Dec 21 14:14:03 2006
New Revision: 2266

Modified:
   trunk/popcorn/src/backends/xine/child.py
   trunk/xine/src/__init__.py

Log:
use logging for debug

Modified: trunk/popcorn/src/backends/xine/child.py
==============================================================================
--- trunk/popcorn/src/backends/xine/child.py    (original)
+++ trunk/popcorn/src/backends/xine/child.py    Thu Dec 21 14:14:03 2006
@@ -28,6 +28,7 @@
 
 # python imports
 import sys
+import logging
 
 # kaa imports
 import kaa
@@ -39,6 +40,10 @@
 from kaa.popcorn.utils import Player
 from kaa.popcorn.ptypes import *
 
+# get and configure logging object
+log = logging.getLogger('xine')
+log.setLevel(logging.DEBUG)
+
 
 BUFFER_UNLOCKED = 0x10
 BUFFER_LOCKED = 0x20
@@ -148,7 +153,7 @@
         #print "Frame output", width, height, aspect
         w, h, a = self._xine._get_vo_display_size(width, height, aspect)
         if abs(self._x11_last_aspect - a) > 0.01:
-            print "VO: %dx%d -> %dx%d" % (width, height, w, h)
+            log.debug('VO: %dx%d -> %dx%d', width, height, w, h)
             self.parent.resize((w, h))
             self._x11_last_aspect = a
         if self._x11_window_size != (0, 0):
@@ -338,11 +343,11 @@
             xine._debug_show_chain(self._stream._obj)
         except xine.XineError:
             self.parent.set_streaminfo(False, self._stream.get_error())
-            print "Open failed:", self._stream.get_error()
+            log.error('Open failed: %s', self._stream.get_error())
             return False
         if not self._check_stream_handles():
             self.parent.set_streaminfo(False, None)
-            print "unable to play stream"
+            log.error('unable to play stream')
             return False
         self.parent.set_streaminfo(True, self._get_streaminfo())
         self._status.start(0.03)
@@ -416,10 +421,10 @@
             self._driver_control("set_passthrough", vo)
         if notify != None:
             if notify:
-                print "DEINTERLACE CHEAP MODE: True"
+                log.info('deinterlace cheap mode: True')
                 self._deint_post.set_parameters(cheap_mode = True, 
framerate_mode = 'half_top')
             else:
-                print "DEINTERLACE CHEAP MODE: False"
+                log.info('deinterlace cheap mode: False')
                 self._deint_post.set_parameters(cheap_mode = False, 
framerate_mode = 'full')
 
             self._driver_control("set_notify_frame", notify)

Modified: trunk/xine/src/__init__.py
==============================================================================
--- trunk/xine/src/__init__.py  (original)
+++ trunk/xine/src/__init__.py  Thu Dec 21 14:14:03 2006
@@ -1,10 +1,16 @@
-import weakref, threading, math, os
-
+import weakref
+import threading
+import math
+import logging
+ 
 import _xine
 import kaa
 from kaa import display, notifier, metadata
 from kaa.version import Version
 from constants import *
+ 
+# get logging object
+log = logging.getLogger('xine')
 
 # FIXME: find a good place to document this:
 #
@@ -207,7 +213,7 @@
     def _default_frame_output_cb(self, width, height, aspect, window):
         w, h, a = self._get_vo_display_size(width, height, aspect)
         if aspect > 0 and abs(window._aspect - a) > 0.01:
-            print "VO: %dx%d -> %dx%d" % (width, height, w, h)
+            log.info('VO: %dx%d -> %dx%d', width, height, w, h)
             window.resize((w, h))
             window._aspect = a
         if window:
@@ -534,7 +540,7 @@
     def _seek_thread(self, time):
         self.set_parameter(PARAM_SPEED, SPEED_NORMAL)
         if not self.get_parameter(STREAM_INFO_SEEKABLE):
-            print "Stream not seekable"
+            log.error('Stream not seekable')
             return False
 
         self.play(time)
@@ -542,7 +548,7 @@
 
     def _seek(self, time):
         if self.get_status() != STATUS_PLAY:
-            print "Stream not playing"
+            log.error('Stream not playing')
             return False
          
         # Need a xine engine mutex for this.  Later.  

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to