implementation of the forceTranscodingCodecs option

This commit is contained in:
Frederik Kriewitz 2015-04-12 13:19:42 +02:00
parent 2c7d50e3a6
commit 88ef0da5a6
3 changed files with 14 additions and 1 deletions

View file

@ -244,6 +244,7 @@
<string id="30242">Play Count Sync Indication:</string> <string id="30242">Play Count Sync Indication:</string>
<string id="30243">Enable HTTPS</string> <string id="30243">Enable HTTPS</string>
<string id="30244">Use Season 100 for TV Show Specials (Requires Reset)</string> <string id="30244">Use Season 100 for TV Show Specials (Requires Reset)</string>
<string id="30245">Force Transcoding Codecs</string>
<!-- Default views --> <!-- Default views -->
<string id="30300">Active</string> <string id="30300">Active</string>

View file

@ -76,6 +76,18 @@ class PlayUtils():
# Works out if we are direct playing or not # Works out if we are direct playing or not
def isDirectPlay(self, result): def isDirectPlay(self, result):
addonSettings = xbmcaddon.Addon(id='plugin.video.emby')
# check if we should force encoding due to the forceTranscodingCodecs setting
forceTranscodingCodecs = addonSettings.getSetting('forceTranscodingCodecs')
if forceTranscodingCodecs:
forceTranscodingCodecsSet = frozenset(forceTranscodingCodecs.lower().split(','))
codecs = frozenset([mediaStream.get('Codec', None) for mediaStream in result.get('MediaStreams', [])])
commonCodecs = forceTranscodingCodecsSet & codecs
#xbmc.log("emby isDirectPlay MediaStreams codecs: %s forceTranscodingCodecs: %s, common: %s" % (codecs, forceTranscodingCodecsSet, commonCodecs))
if commonCodecs:
return False
if (self.fileExists(result) or (result.get("LocationType") == "FileSystem" and self.isNetworkQualitySufficient(result) == True and self.isLocalPath(result) == False)): if (self.fileExists(result) or (result.get("LocationType") == "FileSystem" and self.isNetworkQualitySufficient(result) == True and self.isLocalPath(result) == False)):
return True return True
else: else:

View file

@ -9,7 +9,7 @@
<setting id="deviceName" type="text" label="30016" default="Kodi" /> <setting id="deviceName" type="text" label="30016" default="Kodi" />
<setting id="videoBitRate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" default="17" /> <setting id="videoBitRate" type="enum" label="30160" values="664 Kbps SD|996 Kbps HD|1.3 Mbps HD|2.0 Mbps HD|3.2 Mbps HD|4.7 Mbps HD|6.2 Mbps HD|7.7 Mbps HD|9.2 Mbps HD|10.7 Mbps HD|12.2 Mbps HD|13.7 Mbps HD|15.2 Mbps HD|16.7 Mbps HD|18.2 Mbps HD|20.0 Mbps HD|40.0 Mbps HD|100.0 Mbps HD [default]|1000.0 Mbps HD" default="17" />
<setting id="playFromStream" type="bool" label="30002" visible="true" enable="true" default="false" /> <setting id="playFromStream" type="bool" label="30002" visible="true" enable="true" default="false" />
<setting id="forceTranscodingCodecs" type="text" label="30244" /> <setting id="forceTranscodingCodecs" type="text" label="30245" />
</category> </category>
<!-- <category label="Manual sync"> <setting label="Run manual full sync now" type="action" action="RunScript(plugin.video.mbsync, fullsync)" /> <setting label="Run manual incremental sync now" type="action" action="RunScript(plugin.video.mbsync, incrementalsync)" /> <setting label="Reset entire local library" type="action" action="RunScript(plugin.video.mbsync, reset)" /> </category> --> <!-- <category label="Manual sync"> <setting label="Run manual full sync now" type="action" action="RunScript(plugin.video.mbsync, fullsync)" /> <setting label="Run manual incremental sync now" type="action" action="RunScript(plugin.video.mbsync, incrementalsync)" /> <setting label="Reset entire local library" type="action" action="RunScript(plugin.video.mbsync, reset)" /> </category> -->
<category label="Sync Options"> <category label="Sync Options">