Author: dmeyer
Date: Wed Dec  6 15:39:16 2006
New Revision: 2155

Modified:
   trunk/popcorn/src/backends/mplayer/__init__.py
   trunk/popcorn/src/backends/mplayer/config.cxml

Log:
move capability settings to config

Modified: trunk/popcorn/src/backends/mplayer/__init__.py
==============================================================================
--- trunk/popcorn/src/backends/mplayer/__init__.py      (original)
+++ trunk/popcorn/src/backends/mplayer/__init__.py      Wed Dec  6 15:39:16 2006
@@ -1,22 +1,56 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# mplayer/__init__.py - mplayer backend
+# -----------------------------------------------------------------------------
+# $Id$
+#
+# -----------------------------------------------------------------------------
+# kaa.popcorn - Generic Player API
+# Copyright (C) 2006 Jason Tackaberry, Dirk Meyer
+#
+# Please see the file AUTHORS for a complete list of authors.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# -----------------------------------------------------------------------------
+
+# kaa imports
 import kaa.utils
 
-from player import MPlayer, _get_mplayer_info
+# kaa.popcorn imports
 from kaa.popcorn.backends import register
 from kaa.popcorn.ptypes import *
+
+# player imports
+from player import MPlayer, _get_mplayer_info
 from config import config
 
 def get_capabilities():
-
+    """
+    Return capabilities of the mplayer backend.
+    """
     capabilities = {
-        CAP_CANVAS : False,
+        CAP_OSD : False,
         CAP_CANVAS : False,
         CAP_DYNAMIC_FILTERS : False,
         CAP_VARIABLE_SPEED : True,
-        CAP_VISUALIZATION : True,
+        CAP_VISUALIZATION : False,
 
-        CAP_DVD : 8,
-        CAP_DVD_MENUS : 1,
-        CAP_DEINTERLACE : 8
+        CAP_DVD : config.capability.dvd,
+        CAP_DVD_MENUS : config.capability.dvdmenu,
+        CAP_DEINTERLACE : config.capability.deinterlace
     }
 
     mp_cmd = config.path
@@ -31,15 +65,19 @@
     if "outbuf" in info["video_filters"]:
         capabilities[CAP_CANVAS] = True
 
-    schemes = ["file", "vcd", "cdda", "cue", "tivo", "http", "mms", "rtp",
-                "rtsp", "ftp", "udp", "sdp", "dvd", "fifo"]
+    # TODO: set CAP_VISUALIZATION if we have libvisual
+
+    schemes = [ "file", "vcd", "cdda", "cue", "tivo", "http", "mms",
+                "rtp", "rtsp", "ftp", "udp", "sdp", "dvd", "fifo" ]
 
     # list of extentions when to prefer this player
-    exts = ["mpg", "mpeg", "mov"]
+    exts = config.preferred.extentions.split(' ')
 
     # list of codecs when to prefer this player
-    codecs = []
+    codecs = config.preferred.codecs.split(' ')
 
     return capabilities, schemes, exts, codecs
 
+
+# register mplayer backend
 register("mplayer", MPlayer, get_capabilities)

Modified: trunk/popcorn/src/backends/mplayer/config.cxml
==============================================================================
--- trunk/popcorn/src/backends/mplayer/config.cxml      (original)
+++ trunk/popcorn/src/backends/mplayer/config.cxml      Wed Dec  6 15:39:16 2006
@@ -7,4 +7,29 @@
     <var name="path" type="str">
         <desc lang="en">Path to mplayer binary (if empty, search $PATH)</desc>
     </var>
+    <group name="capability">
+        <desc>
+            Capability rating of the player. The possible values are between
+            0 (unable to play) up to 10 (perfect). Do not change this unless
+            you know what you are doing.
+        </desc>
+        <var name="dvd" default="8"/>
+        <var name="dvdmenu" default="2"/>
+        <var name="deinterlace" default="6"/>
+    </group>
+    <group name="preferred">
+        <var name="extentions" type="str">
+            <desc>
+                Comma seperated list of extentions for which this player should
+                be the preferred player.
+            </desc>
+        </var>
+        <var name="codecs" type="str">
+            <desc>
+                Comma seperated list of video or audio codecs fourcc codes for
+                which this player should be the preferred player. Use mminfo
+                on a file to get to the needed fourcc code.
+            </desc>
+        </var>
+    </group>
 </config>

-------------------------------------------------------------------------
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