[TransCodingSetup] support 1080P with Solo4K.
authorhschang <chang@dev3>
Wed, 25 Nov 2015 02:10:15 +0000 (11:10 +0900)
committerhschang <chang@dev3>
Wed, 25 Nov 2015 08:23:37 +0000 (17:23 +0900)
lib/python/Plugins/SystemPlugins/TransCodingSetup/plugin.py

index e0ed0df..61b76b4 100755 (executable)
@@ -92,7 +92,11 @@ def createTransCodingConfig(encoder):
                setAttr("automode", encoder, choice)
 
        if fileExists( getProcPath(encoder, "resolution") ):
-               choice = TconfigSelection(encoder, default = "480p", choices = [ ("480p", _("480p")), ("576p", _("576p")), ("720p", _("720p")), ("320x240", _("320x240")), ("160x120", _("160x120")) ] )
+               resolutaion_choices = [ ("480p", _("480p")), ("576p", _("576p")), ("720p", _("720p")), ("320x240", _("320x240")), ("160x120", _("160x120")) ]
+               if vumodel in ("solo4k"):
+                       resolutaion_choices.insert(3, ("1080p", _("1080p")))
+
+               choice = TconfigSelection(encoder, default = "480p", choices = resolutaion_choices )
                setAttr("resolution", encoder, choice)
 
        if fileExists( getProcPath(encoder, "aspectratio") ):
@@ -216,7 +220,20 @@ class TranscodingSetupInit:
                                if value != setValue:
                                        print "[TranscodingSetup] set failed. (%s > %s)" % ( value, procPath )
                                        return -1
-                               return 0
+
+                       # Set bitrate "-1" when automode is "ON" and display_format is changed.
+                       # At custom mode, set display_format -> width -> height -> bitrate (-1)
+                       setname = procPath.split('/')[-1]
+                       encoder = procPath.split('/')[-2]
+                       if (setname == "display_format" and value != "custom") or (setname == "height"):
+                               if hasAttr("automode", encoder) and getAttr("automode", encoder).value == "On":
+                                       if hasAttr("bitrate", encoder):
+                                               setProcValue(getProcPath(encoder ,"bitrate"), str(-1))
+                                       elif hasAttr("framerate", encoder):
+                                               setProcValue(getProcPath(encoder ,"framerate"), str(-1))
+
+                       return 0
+
                except:
                        print "setConfig exception error (%s > %s)" % ( value, procPath )
                        return -1