Some patches for using xvmc with mplayer as option in addition menu if mpeg{1|2} stream.

Index: src/video/plugins/mplayer.py
===================================================================
--- src/video/plugins/mplayer.py    (revision 9367)
+++ src/video/plugins/mplayer.py    (working copy)
@@ -140,7 +140,14 @@
             # try to play the next subitem
             return '%s\nnot found' % os.path.basename(url)
        
+        set_vcodec=0
 
+        if item['xvmc'] and mode == 'file' and os.path.isfile(url):
+            d=mmpython.parse(url)
+            codec=d['type'][:6]
+            if codec in ['MPEG-1','MPEG-2']:
+                set_vcodec=1
+
         # Build the MPlayer command
         command = [ '--prio=%s' % config.MPLAYER_NICE, config.MPLAYER_CMD ]
         command += [ '-slave', '-v', ]
@@ -150,6 +157,7 @@
         additional_args = []
 
         if mode == 'dvd':
+            set_vcodec=1
             if config.DVD_LANG_PREF:
                 # There are some bad mastered DVDs out there. E.g. the 
specials on
                 # the German Babylon 5 Season 2 disc claim they have more than 
one
@@ -166,8 +174,10 @@
                 additional_args += [ '-slang', config.DVD_SUBTITLE_PREF ]
 
         if hasattr(item.media, 'devicename') and mode != 'file':
+            set_vcodec=1
             additional_args += [ '-dvd-device', item.media.devicename ]
         elif mode == 'dvd':
+            set_vcodec=1
             # dvd on harddisc
             additional_args += [ '-dvd-device', item.filename ]
             url = url[:6] + url[url.rfind('/')+1:]
@@ -196,20 +206,33 @@
             elif item.selected_language == 'right':
                 additional_args += [ '-af', 'pan=2:0:0:1:1' ]
 
-        if item['deinterlace'] and config.MPLAYER_VF_INTERLACED:
-            additional_args += [ '-vf', config.MPLAYER_VF_INTERLACED ]
-        elif config.MPLAYER_VF_PROGRESSIVE:
-            additional_args += [ '-vf', config.MPLAYER_VF_PROGRESSIVE ]
+        if set_vcodec == 0:
+            if item['deinterlace'] and config.MPLAYER_VF_INTERLACED:
+                additional_args += [ '-vf', config.MPLAYER_VF_INTERLACED ]
+            elif config.MPLAYER_VF_PROGRESSIVE:
+                additional_args += [ '-vf', config.MPLAYER_VF_PROGRESSIVE ]
 
+        additional_args += [ '-field-dominance', '%d' % 
int(item['field-dominance']) ]
+
         if os.path.isfile(os.path.splitext(item.filename)[0]+'.edl'):
-           additional_args += [ '-edl', 
str(os.path.splitext(item.filename)[0]+'.edl') ]
+            additional_args += [ '-edl', 
str(os.path.splitext(item.filename)[0]+'.edl') ]
                 
         mode = item.mimetype
         if not config.MPLAYER_ARGS.has_key(mode):
             mode = 'default'
 
+        if config.CHILDAPP_DEBUG:
+            command += [ '-v' ]
+
         # Mplayer command and standard arguments
-        command += [ '-vo', config.MPLAYER_VO_DEV + config.MPLAYER_VO_DEV_OPTS 
]
+        if set_vcodec == 1:
+            if item['deinterlace']:
+                bobdeint='bobdeint'
+            else:
+                bobdeint='nobobdeint'
+            command += [ '-vo', 'xvmc:%s' % bobdeint, '-vc', 'ffmpeg12mc' ]
+        else:
+            command += [ '-vo', config.MPLAYER_VO_DEV + 
config.MPLAYER_VO_DEV_OPTS ]
 
         # mode specific args
         command += config.MPLAYER_ARGS[mode].split(' ')
Index: src/video/configure.py
===================================================================
--- src/video/configure.py  (revision 9367)
+++ src/video/configure.py  (working copy)
@@ -235,6 +234,8 @@
            (item.filename and item.info.has_key('type') and \
             item.info['type'] and item.info['type'].lower().find('mpeg') != 
-1):
         items += [ add_toogle(_('deinterlacing'), item, 'deinterlace') ]
+        items += [ add_toogle(_('xv mc'), item, 'xvmc') ]
+        items += [ add_toogle(_('BOTTOM field first'), item, 
'field-dominance') ]
     return items
 
         
Index: src/video/videoitem.py
===================================================================
--- src/video/videoitem.py  (revision 9367)
+++ src/video/videoitem.py  (working copy)
@@ -51,7 +51,8 @@
 class VideoItem(Item):
 
     def __init__(self, url, parent, info=None, parse=True):
-        self.autovars = [ ('deinterlace', 0) ]
+        #self.autovars = [ ('deinterlace', 0), ('xvmc', config.USE_XVMC), 
('field-dominance', config.FIELD_DOMINANCE) ]
+        self.autovars = [ ('deinterlace', 0), ('xvmc', 0), ('field-dominance', 
0) ]
         Item.__init__(self, parent)
 
         self.type = 'video'
-------------------------------------------------------------------------
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-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to