diff options
137 files changed, 1201 insertions, 4277 deletions
diff --git a/addons/metadata.album.universal/addon.xml b/addons/metadata.album.universal/addon.xml index 248230c990..ec1038b180 100644 --- a/addons/metadata.album.universal/addon.xml +++ b/addons/metadata.album.universal/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.album.universal" name="Universal Album Scraper" - version="1.7.6" + version="2.1.0" provider-name="Olympia, Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> @@ -10,7 +10,7 @@ <import addon="metadata.common.musicbrainz.org" version="1.2.3"/> <import addon="metadata.common.fanart.tv" version="2.1.2"/> <import addon="metadata.common.amazon.de" version="1.0.0"/> - <import addon="metadata.common.theaudiodb.com" version="1.4.0"/> + <import addon="metadata.common.theaudiodb.com" version="1.7.0"/> </requires> <extension point="xbmc.metadata.scraper.albums" language="en" diff --git a/addons/metadata.album.universal/albumuniversal.xml b/addons/metadata.album.universal/albumuniversal.xml index 94ed3db07c..d18eacc4b5 100644 --- a/addons/metadata.album.universal/albumuniversal.xml +++ b/addons/metadata.album.universal/albumuniversal.xml @@ -1,12 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> -<scraper framework="1.1" date="2012-06-09"> +<scraper framework="1.1" date="2013-05-29"> <NfoUrl dest="3"> <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url>" dest="3"> <expression>release/(.+)</expression> </RegExp> </NfoUrl> + <ResolveIDToUrl dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url>" dest="3"> + <expression>(.+)</expression> + </RegExp> + </ResolveIDToUrl> <CreateAlbumSearchUrl dest="3"> - <RegExp input="$$1" output="<url>http://search.musicbrainz.org/ws/2/release/?fmt=xml&query=release:\1%20AND%20artist:"$$4"</url>" dest="3"> + <RegExp input="$$1" output="<url>http://search.musicbrainz.org/ws/2/release/?fmt=xml&query=release:"\1"%20AND%20artist:"$$4"</url>" dest="3"> <RegExp input="$$2" output="\1" dest="4"> <expression noclean="1">(.+)</expression> </RegExp> @@ -22,16 +27,16 @@ <GetAlbumSearchResults dest="8"> <RegExp input="$$5" output="<results sorted="yes">\1</results>" dest="8"> <RegExp input="$$1" output="<entity><year>\5-\4-T#\6</year><artist>\3</artist><title>\2</title><url cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></entity>" dest="5"> - <expression repeat="yes">id="([^"]*)"><title>([^<]*)</title><status>Official</status><text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\stype="Album"\sid="[^"]*">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> + <expression repeat="yes">id="([^"]*)"><title>([^<]*)</title><status>Official</status>(?:<disambiguation>[^<]*</disambiguation>)*<text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\stype="Album"\sid="[^"]*">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> </RegExp> <RegExp input="$$1" output="<entity><year>\5-\4-T#\6</year><artist>\3</artist><title>\2</title><url cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></entity>" dest="5+"> - <expression repeat="yes">id="([^"]*)"><title>([^<]*)</title><status>Official</status><text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group(?:\stype="[^"]*")*\sid="[^"]*">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> + <expression repeat="yes">id="([^"]*)"><title>([^<]*)</title><status>Official</status>(?:<disambiguation>[^<]*</disambiguation>)*<text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group(?:\stype="[^"]*")*\sid="[^"]*">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> </RegExp> <RegExp input="$$1" output="<entity><year>\5-\4-T#\6</year><artist>\3</artist><title>\2</title><url cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></entity>" dest="5"> - <expression repeat="yes">id="([^"]*)" ext:score="[^"]*"><title>([^<]*)</title><status>Official</status><text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\sid="[^"]*"\stype="Album">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> + <expression repeat="yes">id="([^"]*)" ext:score="[^"]*"><title>([^<]*)</title><status>Official</status>(?:<disambiguation>[^<]*</disambiguation>)*<text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\sid="[^"]*"\stype="Album">(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> </RegExp> <RegExp input="$$1" output="<entity><year>\5-\4-T#\6</year><artist>\3</artist><title>\2</title><url cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></entity>" dest="5+"> - <expression repeat="yes">id="([^"]*)" ext:score="[^"]*"><title>([^<]*)</title><status>Official</status><text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*<)*/script></text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\sid="[^"]*"(?:\stype="[^"]*")*>(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> + <expression repeat="yes">id="([^"]*)" ext:score="[^"]*"><title>([^<]*)</title><status>Official</status>(?:<disambiguation>[^<]*</disambiguation>)*<text-representation>(?:<language>[^<]*</language>)*(?:<script>[^<]*</script>)*</text-representation><artist-credit><name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>([^<]*)</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>(?:<name-credit(?:>)*(?:\sjoinphrase="[^"]*">)*(?:<name>[^<]*</name)*(?:>)*<artist\sid="[^"]*"><name>[^<]*</name>(?:<sort-name>[^<]*</sort-name>)*(?:<disambiguation>[^<]*</disambiguation>)*(?:<alias-list>.*?</alias-list>)*</artist></name-credit>)*</artist-credit><release-group\sid="[^"]*"(?:\stype="[^"]*")*>(?:<primary-type>[^<]*</primary-type>)*(?:<secondary-type-list><secondary-type>[^<]*</secondary-type></secondary-type-list>)*</release-group><date>(\d{4})[^<]*</date>(?:<country>)*([^<]*)?.*?<track-list\scount="(\d+)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -57,6 +62,9 @@ <RegExp input="$$3" output="<chain function="GetMBAlbumTitleByMBID">\1</chain>" dest="5"> <expression noclean="1">(.+)</expression> </RegExp> + <RegExp input="$$3" output="<chain function="GetMBAlbumArtistsByMBID">\1</chain>" dest="5+"> + <expression noclean="1">(.+)</expression> + </RegExp> <RegExp input="$$3" output="<chain function="GetMBAlbumArtistByMBID">\1</chain>" dest="5+"> <expression noclean="1">(.+)</expression> </RegExp> @@ -87,6 +95,9 @@ <RegExp input="$INFO[albumratingsource]" output="<url function="GetAMGAlbumRating" cache="mb-$$4-rg.xml">http://musicbrainz.org/ws/2/release-group/$$4?inc=url-rels</url>" dest="5+"> <expression>allmusic.com</expression> </RegExp> + <RegExp input="$INFO[albumratingsource]" output="<chain function="GetTADBAlbumRatingByMBID">$$4</chain>" dest="5+"> + <expression>TheAudioDb.com</expression> + </RegExp> <RegExp input="$INFO[albumstylessource]" output="<url function="GetAMGAlbumStyles" cache="mb-$$4-rg.xml">http://musicbrainz.org/ws/2/release-group/$$4?inc=url-rels</url>" dest="5+"> <expression>allmusic.com</expression> </RegExp> diff --git a/addons/metadata.album.universal/changelog.txt b/addons/metadata.album.universal/changelog.txt index 5624e3ee43..4692df7d3f 100644 --- a/addons/metadata.album.universal/changelog.txt +++ b/addons/metadata.album.universal/changelog.txt @@ -1,3 +1,10 @@ +[B]2.1.0[/B] +Added: option to fetch album Rating from TheAudioDB.com + +[B]2.0.0[/B] +Added: ResolveIDToUrl +Fixed: album won't find some times (thanks and credits to crankylemur & ezechiel1917) + [B]1.7.6[/B] Updated language files from Transifex diff --git a/addons/metadata.album.universal/resources/settings.xml b/addons/metadata.album.universal/resources/settings.xml index f75639eb20..7cba6db113 100644 --- a/addons/metadata.album.universal/resources/settings.xml +++ b/addons/metadata.album.universal/resources/settings.xml @@ -5,7 +5,7 @@ <setting label="30002" type="labelenum" values="TheAudioDb.com|amazon.de|None" id="albumreviewsource" default="TheAudioDb.com"/> <setting label="30003" type="labelenum" values="en|de|es|fr|it|cn|jp|ru|pt|se|nl|hu" id="tadbalbumlanguage" default="en" visible="eq(-1,0)"/> <setting type="sep"/> - <setting label="30004" type="labelenum" values="MusicBrainz|allmusic.com|None" id="albumratingsource" default="MusicBrainz"/> + <setting label="30004" type="labelenum" values="MusicBrainz|allmusic.com|TheAudioDb.com|None" id="albumratingsource" default="MusicBrainz"/> <setting label="30005" type="labelenum" values="allmusic.com|None" id="albumstylessource" default="allmusic.com"/> <setting label="30006" type="labelenum" values="allmusic.com|None" id="albummoodssource" default="allmusic.com"/> <setting label="30007" type="labelenum" values="allmusic.com|None" id="albumthemessource" default="allmusic.com"/> diff --git a/addons/metadata.artists.universal/addon.xml b/addons/metadata.artists.universal/addon.xml index 1bc15a7e2a..1501afa178 100644 --- a/addons/metadata.artists.universal/addon.xml +++ b/addons/metadata.artists.universal/addon.xml @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.artists.universal" name="Universal Artist Scraper" - version="2.6.5" + version="3.3.0" provider-name="Olympia, Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> <import addon="metadata.common.last.fm" version="1.6.0"/> - <import addon="metadata.common.allmusic.com" version="2.6.0"/> + <import addon="metadata.common.allmusic.com" version="3.0.0"/> <import addon="metadata.common.musicbrainz.org" version="1.3.0"/> - <import addon="metadata.common.htbackdrops.com" version="1.2.0"/> <import addon="metadata.common.fanart.tv" version="2.1.2"/> <import addon="metadata.common.theaudiodb.com" version="1.5.0"/> + <import addon="metadata.common.htbackdrops.com" version="1.3.0"/> </requires> <extension point="xbmc.metadata.scraper.artists" language="en" diff --git a/addons/metadata.artists.universal/artistuniversal.xml b/addons/metadata.artists.universal/artistuniversal.xml index 48945d7182..2f0c12873b 100644 --- a/addons/metadata.artists.universal/artistuniversal.xml +++ b/addons/metadata.artists.universal/artistuniversal.xml @@ -1,18 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?> -<scraper framework="1.1" date="2013-02-27"> +<scraper framework="1.1" date="2013-05-29"> <NfoUrl dest="3"> - <RegExp input="$$1" output="<url>http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> <expression>http://musicbrainz.org/artist/(.+)</expression> </RegExp> </NfoUrl> + <ResolveIDToUrl dest="3"> + <RegExp input="$$1" output="<url>http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url>" dest="3"> + <expression>(.+)</expression> + </RegExp> + </ResolveIDToUrl> + <CreateArtistSearchUrl dest="3"> <RegExp input="$$1" output="<url>http://search.musicbrainz.org/ws/2/artist/?fmt=xml&query=artist:"$$4"&limit=100</url>" dest="3"> <RegExp input="$$1" output="\1" dest="4"> <expression noclean="1">(.+)</expression> </RegExp> + <RegExp input="$$1" output="\1/\2\3" dest="7"> + <expression noclean="1">(.+)([-!])(.+)</expression> + </RegExp> <RegExp input="$$1" output="\1" dest="6"> <expression noclean="1">(.+)(?:Ft%2e|Feat%2e|%20Ft\.|%20Feat\.|%20and%20)</expression> </RegExp> + <RegExp input="$$7" output="\1" dest="4"> + <expression>(.+)</expression> + </RegExp> <RegExp input="$$6" output="\1" dest="4"> <expression>(.+)</expression> </RegExp> @@ -21,10 +33,10 @@ </CreateArtistSearchUrl> <GetArtistSearchResults dest="8"> <RegExp input="$$5" output="<results sorted="yes">\1</results>" dest="8"> - <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> + <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> <expression repeat="yes" noclean="1">artist id="([^"]*)"(?:\stype="[^"]*")* ext:score="[^"]*"><name>([^<]*)</name>(<sort-name>[^<]*</sort-name>)?(<gender>[^<]*</gender>)?(<country>[^<]*</country>)?(<disambiguation>([^<]*))?</expression> </RegExp> - <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> + <RegExp input="$$1" output="<entity><title>\2</title><genre>\7</genre><url cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></entity>" dest="9"> <expression repeat="yes" noclean="1">artist ext:score="[^"]*"(?:\stype="[^"]*")* id="([^"]*)"><name>([^<]*)</name>(<sort-name>[^<]*</sort-name>)?(<gender>[^<]*</gender>)?(<country>[^<]*</country>)?(<disambiguation>([^<]*))?</expression> </RegExp> <RegExp input="$$9" output="\1" dest="5"> @@ -43,8 +55,8 @@ <RegExp input="$$1" output="\2" dest="9"> <expression noclean="1">>http://(www.)?allmusic.com/artist/([^<]*)</expression> </RegExp> - <RegExp input="$$1" output="<name>\1</name>" dest="5"> - <expression noclean="1"><artist(?:\stype="[^"]*")* id="[^"]*"><name>([^<]*)</expression> + <RegExp input="$$1" output="<musicBrainzArtistID>\1</musicBrainzArtistID><name>\2</name>" dest="5"> + <expression noclean="1"><artist(?:\stype="[^"]*")* id="([^"]*)"><name>([^<]*)</expression> </RegExp> <RegExp input="$$8" conditional="fanarttvthumbs" output="<chain function="GetFanartTvArtistThumbsByMBID">\1</chain>" dest="5+"> <expression/> diff --git a/addons/metadata.artists.universal/changelog.txt b/addons/metadata.artists.universal/changelog.txt index 34f7905b00..101d1983ce 100644 --- a/addons/metadata.artists.universal/changelog.txt +++ b/addons/metadata.artists.universal/changelog.txt @@ -1,3 +1,17 @@ +[B]3.3.0[/B] +Added: Restore scraping from HTBackdrops.com using their new domain htbackdrops.org + +[B]3.2.0[/B] +Added: An attempt to handle dash and exclamation mark in the artist name + +[B]3.1.0[/B] +Added: Polish for theaudiodb.com language selection +Removed: htbackdrops.com scraping since site is dead for a good while +Fixed: allmusic.com scraping + +[B]3.0.0[/B] +Added: ResolveIDToUrl + [B]2.6.5[/B] Updated language files from Transifex diff --git a/addons/metadata.artists.universal/resources/settings.xml b/addons/metadata.artists.universal/resources/settings.xml index 434725a8d8..d158409ad9 100644 --- a/addons/metadata.artists.universal/resources/settings.xml +++ b/addons/metadata.artists.universal/resources/settings.xml @@ -2,7 +2,7 @@ <settings> <category label="128"> <setting label="30006" type="labelenum" values="TheAudioDb.com|None" id="biogsource" default="TheAudioDb.com"/> - <setting label="30015" type="labelenum" values="en|de|es|fr|it|cn|jp|ru|pt|se|nl|hu" id="tadbartistlanguage" default="en" visible="eq(-1,0)"/> + <setting label="30015" type="labelenum" values="en|de|es|fr|it|cn|jp|ru|pt|se|nl|hu|pl" id="tadbartistlanguage" default="en" visible="eq(-1,0)"/> <setting type="sep"/> <setting label="30008" type="labelenum" values="MusicBrainz|allmusic.com|TheAudioDb.com|None" id="discogsource" default="MusicBrainz"/> <setting type="sep"/> @@ -16,7 +16,7 @@ <category label="30021"> <setting label="30016" type="labelenum" values="TheAudioDb.com|None" id="biogfbsource" default="None"/> - <setting label="30015" type="labelenum" values="en|de|es|fr|it|cn|jp|ru|pt|se|nl|hu" id="tadbartistlanguage" default="en" visible="eq(-1,0)"/> + <setting label="30015" type="labelenum" values="en|de|es|fr|it|cn|jp|ru|pt|se|nl|hu|pl" id="tadbartistlanguage" default="en" visible="eq(-1,0)"/> <setting type="sep"/> <setting label="30020" type="labelenum" values="TheAudioDb.com|MusicBrainz|allmusic.com|None" id="lifespanfbsource" default="None"/> <setting type="sep"/> @@ -28,9 +28,9 @@ <setting type="lsep" label="Thumb Sources"/> <setting label="30005" type="bool" id="fanarttvthumbs" default="true"/> <setting label="30022" type="bool" id="tadbthumbs" default="true"/> - <setting label="30003" type="bool" id="htbthumbs" default="true"/> <setting label="30002" type="bool" id="lastfmartistthumbs" default="false"/> <setting label="30001" type="bool" id="allmusicartistthumbs" default="true"/> + <setting label="30003" type="bool" id="htbthumbs" default="true"/> <setting type="lsep" label="Fanart Sources"/> <setting label="30004" type="bool" id="fanarttvfanart" default="true"/> <setting label="30023" type="bool" id="tadbfanart" default="true"/> diff --git a/addons/metadata.common.allmusic.com/addon.xml b/addons/metadata.common.allmusic.com/addon.xml index 750870ebbd..94ad5612c6 100644 --- a/addons/metadata.common.allmusic.com/addon.xml +++ b/addons/metadata.common.allmusic.com/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.allmusic.com" name="AllMusic" - version="2.6.0" + version="3.0.2" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.allmusic.com/allmusic.xml b/addons/metadata.common.allmusic.com/allmusic.xml index 51d57fbaf3..a1c074987b 100644 --- a/addons/metadata.common.allmusic.com/allmusic.xml +++ b/addons/metadata.common.allmusic.com/allmusic.xml @@ -1,6 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetAMGDiscographyByAMGID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url cache="am-\1-artist.html" function="ParseAMGDiscography">http://www.allmusic.com/artist/\1</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url cache="am-\1-artist-discography.html" function="ParseAMGDiscography">http://www.allmusic.com/artist/\1/discography</url></details>" dest="5"> <expression clear="yes" noclean="1"/> </RegExp> </GetAMGDiscographyByAMGID> @@ -10,7 +11,7 @@ <expression /> </RegExp> <RegExp input="$$1" output="<album><year>\1</year><title>\2</title><label>\3</label></album>" dest="3"> - <expression repeat="yes" clear="yes" trim="1"><td class="year[^"]*"(?:\stitle="[^"]*")*\s*data-sort-value="[^>]*>([^<]*)</td>[^<]*<td class=".*?title="([^"]*)</expression> + <expression repeat="yes" clear="yes" trim="1"><td\sclass="year[^"]*"(?:\stitle="[^"]*")*\s*data-sort-value="[^>]*>\s*([^<]*)</td>[^<]*<td\sclass=".*?title="([^"]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -62,20 +63,6 @@ </RegExp> </ParseAMGFallbackBiography> - <GetAMGArtistNameByAMGID dest="5"> - <RegExp input="$$1" output="<details><url cache="am-\1-artist.html" function="ParseAMGArtistName">http://www.allmusic.com/artist/\1</url></details>" dest="5"> - <expression noclean="1"/> - </RegExp> - </GetAMGArtistNameByAMGID> - <ParseAMGArtistName dest="5"> - <RegExp input="$$2" output="<details>\1</details>" dest="5"> - <RegExp input="$$1" output="<name>\1</name>" dest="2"> - <expression noclean="1">http://schema.org/MusicGroup">[^<]*<span itemprop="name">([^<]*)</span></expression> - </RegExp> - <expression noclean="1"/> - </RegExp> - </ParseAMGArtistName> - <GetAMGArtistLifeSpanByAMGID dest="5" clearbuffers="no"> <RegExp input="$$1" output="<details><url cache="am-\1-artist.html" function="ParseAMGArtistLifeSpan">http://www.allmusic.com/artist/\1</url></details>" dest="5"> <expression noclean="1"/> @@ -90,16 +77,16 @@ <expression /> </RegExp> <RegExp input="$$1" output="<born>\1 \2</born>" dest="11+"> - <expression trim="1,2"><dt>\s*Born[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Born\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<died>\1 \2</died>" dest="11+"> - <expression trim="1,2"><dt>\s*Died[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Died\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<formed>\1</formed>" dest="11+"> - <expression trim="1,2"><dt>\s*Formed[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Formed\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<disbanded>\1</disbanded>" dest="11+"> - <expression trim="1,2"><dt>\s*Disbanded[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Disbanded\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$11" output="$$12" dest="2"> <RegExp input="$INFO[lifespanfbsource]" output="<chain function="GetMBFallbackLafeSpanByMBID">$$8</chain>" dest="12"> @@ -128,16 +115,16 @@ <expression /> </RegExp> <RegExp input="$$1" output="<born>\1 \2</born>" dest="2"> - <expression trim="1,2"><dt>\s*Born[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Born\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<died>\1 \2</died>" dest="2+"> - <expression trim="1,2"><dt>\s*Died[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Died\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<formed>\1</formed>" dest="2"> - <expression trim="1,2"><dt>\s*Formed[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Formed\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <RegExp input="$$1" output="<disbanded>\1</disbanded>" dest="2+"> - <expression trim="1,2"><dt>\s*Disbanded[^>]*>[^>]*>[^>]*>(.*?\d{4})\s*([^<]*)?</expression> + <expression trim="1,2"><h4>\s*Disbanded\s*</h4>\s*<div>(.*?\d{4})\s*([^<]*)?</expression> </RegExp> <expression noclean="1"/> </RegExp> @@ -154,7 +141,7 @@ <expression /> </RegExp> <RegExp input="$$1" output="<yearsactive>\1</yearsactive>" dest="2"> - <expression trim="1" noclean="1"><dd class="active">([^<]*)<</expression> + <expression trim="1" noclean="1"><h\d>Active</h\d>[^>]*>([^<]*)<</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -174,10 +161,10 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="6"> - <expression noclean="1"><dt>Genres</dt>(.*?)</dd></expression> + <expression noclean="1"><h4>Genre</h4>\s*<div>(.*?)</div></expression> </RegExp> - <RegExp input="$$6" output="<genre>\2</genre>" dest="11"> - <expression repeat="yes" noclean="1"><li><a href="/genre/[^"]*">(<strong>)?([^<]*)</expression> + <RegExp input="$$6" output="<genre>\1</genre>" dest="11"> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/genre/[^"]*">([^<]*)</expression> </RegExp> <RegExp input="$$11" output="$$12" dest="2"> <RegExp input="$INFO[genresfbsource]" output="<chain function="GetLastFMFallbackArtistGenresByMBID">$$8</chain>" dest="12"> @@ -209,10 +196,10 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="6"> - <expression noclean="1"><dt>Genres</dt>(.*?)</dd></expression> + <expression noclean="1"><h4>Genre</h4>\s*<div>(.*?)</div></expression> </RegExp> - <RegExp input="$$6" output="<genre>\2</genre>" dest="2"> - <expression repeat="yes" noclean="1"><li><a href="/genre/[^"]*">(<strong>)?([^<]*)</expression> + <RegExp input="$$6" output="<genre>\1</genre>" dest="2"> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/genre/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -232,10 +219,10 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="7"> - <expression noclean="1"><dt>Styles</dt>(.*?)</dd></expression> + <expression noclean="1"><h4>Styles</h4>\s*<div>(.*?)</div></expression> </RegExp> <RegExp input="$$7" output="<style>\1</style>" dest="11"> - <expression repeat="yes" noclean="1"><li><a href="/style/[^"]*">([^<]*)</expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/style/[^"]*">([^<]*)</expression> </RegExp> <RegExp input="$$11" output="$$12" dest="2"> <RegExp input="$INFO[stylesfbsource]" output="<chain function="GetLastFMFallbackArtistStylesByMBID">$$8</chain>" dest="12"> @@ -264,10 +251,10 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="7"> - <expression noclean="1"><dt>Styles</dt>(.*?)</dd></expression> + <expression noclean="1"><h4>Styles</h4>\s*<div>(.*?)</div></expression> </RegExp> <RegExp input="$$7" output="<style>\1</style>" dest="2"> - <expression repeat="yes" noclean="1"><li><a href="/style/[^"]*">([^<]*)</expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/style/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -284,10 +271,10 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="10"> - <expression noclean="1"><h4>artist moods</h4>(.*?)</ul></expression> + <expression noclean="1">>Artists\sMoods</h\d*>(.*?)</ul></expression> </RegExp> <RegExp input="$$10" output="<mood>\1</mood>" dest="2"> - <expression repeat="yes" noclean="1"><li>[^>]*>([^<]*)</a></li></expression> + <expression repeat="yes" noclean="1"><li>[^>]*>([^<]*)</a>\s*</li></expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -307,7 +294,7 @@ <expression /> </RegExp> <RegExp input="$$1" output="\1" dest="4"> - <expression noclean="1"><h4>photo gallery</h4>(.*?)<h4></expression> + <expression noclean="1"><h\d>Photo\sGallery</h\d>(.*?)<h2\sclass="artist-name"</expression> </RegExp> <RegExp input="$$4" output="<thumb>http://cps-static.rovicorp.com/3/JPG_1080/\1</thumb>" dest="2"> <expression repeat="yes" noclean="1"><img src="http://cps-static.rovicorp.com/3/JPG_[^/]*/([^"]*)</expression> @@ -366,8 +353,8 @@ </GetAMGAlbumRatingByAMGID> <ParseAMGAlbumRating dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> - <RegExp input="$$1" output="<rating max="5.0">\1</rating>" dest="2"> - <expression noclean="1">itemprop="rating">([0-9^]*)</expression> + <RegExp input="$$1" output="<rating max="10.0">\1</rating>" dest="2"> + <expression noclean="1">rating-allmusic-([0-9^]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -398,10 +385,10 @@ <ParseAMGAlbumGenres dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="\1" dest="6"> - <expression noclean="1"><dd class="genres">(.*?)</dd></expression> + <expression noclean="1"><h4>Genre</h4>\s*<div>(.*?)</div></expression> </RegExp> <RegExp input="$$6" output="<genre>\1</genre>" dest="2"> - <expression repeat="yes" trim="1" noclean="1"><li>[^>]*>([^<]*)</a></li></expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/genre/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -415,10 +402,10 @@ <ParseAMGAlbumStyles dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="\1" dest="7"> - <expression noclean="1"><dd class="styles">(.*?)</dd></expression> + <expression noclean="1"><h4>Styles</h4>\s*<div>(.*?)</div></expression> </RegExp> <RegExp input="$$7" output="<style>\1</style>" dest="2"> - <expression repeat="yes" trim="1" noclean="1"><li>[^>]*>([^<]*)</a></li></expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/style/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -432,10 +419,10 @@ <ParseAMGAlbumMoods dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="\1" dest="8"> - <expression trim="1" noclean="1">>\s*<h4>album moods</h4>(.*?)</ul></expression> + <expression trim="1" noclean="1">>\s*<h4>Album\sMoods</h4>(.*?)</section></expression> </RegExp> <RegExp input="$$8" output="<mood>\1</mood>" dest="2"> - <expression repeat="yes" noclean="1"><li>[^>]*>([^<]*)</a></li></expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/mood/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -449,10 +436,10 @@ <ParseAMGAlbumThemes dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="\1" dest="4"> - <expression noclean="1"><h4>album themes</h4>(.*?)</ul></expression> + <expression trim="1" noclean="1">>\s*<h4>Themes</h4>(.*?)</ul></expression> </RegExp> <RegExp input="$$4" output="<theme>\1</theme>" dest="2"> - <expression repeat="yes" noclean="1"><li>[^>]*>([^<]*)</a></li></expression> + <expression repeat="yes" noclean="1"><a\shref="http://www.allmusic.com/theme/[^"]*">([^<]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -480,7 +467,7 @@ <ParseAMGAlbumThumbs dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="<thumb>http://cps-static.rovicorp.com/3/JPG_500/\1</thumb>" dest="2"> - <expression noclean="1"><meta property="og:image" content="http://cps-static.rovicorp.com/3/JPG_[^/]*/([^"]*)</expression> + <expression noclean="1">"http://cps-static.rovicorp.com/3/JPG_[^/]*/([^"]*)</expression> </RegExp> <expression noclean="1" /> </RegExp> diff --git a/addons/metadata.common.amazon.de/addon.xml b/addons/metadata.common.amazon.de/addon.xml index d9750bce8a..9971148ff5 100644 --- a/addons/metadata.common.amazon.de/addon.xml +++ b/addons/metadata.common.amazon.de/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.amazon.de" name="Amazon.de" - version="1.0.0" + version="1.0.1" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="1.0"/> diff --git a/addons/metadata.common.amazon.de/amazonde.xml b/addons/metadata.common.amazon.de/amazonde.xml index a8e054b8fc..759116446b 100644 --- a/addons/metadata.common.amazon.de/amazonde.xml +++ b/addons/metadata.common.amazon.de/amazonde.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetAmazonDEAlbumReviewByASIN dest="5"> <RegExp input="$$1" output="<details><url function="ParseAmazonDEAlbumReview">http://www.amazon.de/exec/obidos/ASIN/\1</url></details>" dest="5"> diff --git a/addons/metadata.common.fanart.tv/addon.xml b/addons/metadata.common.fanart.tv/addon.xml index b88455c675..fa70dc8673 100644 --- a/addons/metadata.common.fanart.tv/addon.xml +++ b/addons/metadata.common.fanart.tv/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.fanart.tv" name="fanart.tv" - version="2.1.2" + version="2.1.3" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.fanart.tv/fanarttv.xml b/addons/metadata.common.fanart.tv/fanarttv.xml index 09120f610f..758a3b20f8 100644 --- a/addons/metadata.common.fanart.tv/fanarttv.xml +++ b/addons/metadata.common.fanart.tv/fanarttv.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetFanartTvArtistThumbsByMBID dest="5" clearbuffers="no"> <RegExp input="$$1" output="<details><url function="ParseFanartTvArtistThumbs" cache="fanarttv-artistimages-\1.json">http://api.fanart.tv/webservice/artist/ed4b784f97227358b31ca4dd966a04f1/\1/json/</url></details>" dest="5"> diff --git a/addons/metadata.common.hdtrailers.net/addon.xml b/addons/metadata.common.hdtrailers.net/addon.xml index 0a71e092de..a0e15844ea 100644 --- a/addons/metadata.common.hdtrailers.net/addon.xml +++ b/addons/metadata.common.hdtrailers.net/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.hdtrailers.net" name="HD-Trailers common scraper functions" - version="1.0.9" + version="2.0.3" provider-name="Bence Nádas (olympia)"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.hdtrailers.net/hdtrailers.xml b/addons/metadata.common.hdtrailers.net/hdtrailers.xml index 485e72b4a3..e0a0d775d2 100644 --- a/addons/metadata.common.hdtrailers.net/hdtrailers.xml +++ b/addons/metadata.common.hdtrailers.net/hdtrailers.xml @@ -1,8 +1,9 @@ -<scraperfunctions> +<?xml version="1.0" encoding="UTF-8"?> +<scraperfunctions> <GetHDTrailersnet480p dest="3"> <RegExp input="$$6" output="<details><url function="Parse480pTrailer" cache="hd-trailers-\1.xml">http://xbmc.hd-trailers.net/movie/\1</url></details>" dest="3"> <RegExp input="$$1" output="\1-" dest="6"> - <expression repeat="yes" fixchars="1" trim="1">([\w]+)</expression> + <expression repeat="yes" trim="1">([\w]+)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -10,7 +11,7 @@ <GetHDTrailersnet720p dest="3"> <RegExp input="$$6" output="<details><url function="Parse720pTrailer" cache="hd-trailers-\1.xml">http://xbmc.hd-trailers.net/movie/\1</url></details>" dest="3"> <RegExp input="$$1" output="\1-" dest="6"> - <expression repeat="yes" fixchars="1" trim="1">([\w]+)</expression> + <expression repeat="yes" trim="1">([\w]+)</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -18,66 +19,48 @@ <GetHDTrailersnet1080p dest="3"> <RegExp input="$$6" output="<details><url function="Parse1080pTrailer" cache="hd-trailers-\1.xml">http://xbmc.hd-trailers.net/movie/\1</url></details>" dest="3"> <RegExp input="$$1" output="\1-" dest="6"> - <expression repeat="yes" fixchars="1" trim="1">([\w]+)</expression> + <expression repeat="yes" trim="1">([\w]+)</expression> </RegExp> <expression noclean="1" /> </RegExp> </GetHDTrailersnet1080p> <Parse480pTrailer dest="5"> - <RegExp input="$$6" output="<details><trailer>\1</trailer></details>" dest="5"> + <RegExp input="$$6" output="<details>\1</details>" dest="5"> <!--fetch 480p trailer link from hdtrailers.net--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_480p_dl.mov)"\srel="lightbox\[res480p</expression> </RegExp> <expression noclean="1" /> </RegExp> </Parse480pTrailer> <Parse720pTrailer dest="5"> - <RegExp input="$$6" output="<details><trailer>\1</trailer></details>" dest="5"> + <RegExp input="$$6" output="<details>\1</details>" dest="5"> <!--Fallback to fetch 480p trailer link if 720p is not available--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_480p_dl.mov)"\srel="lightbox\[res480p</expression> </RegExp> <!--Fetch 720p trailer link from hdtrailers.net--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res720p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res720p</expression> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_720p_dl.mov)"\srel="lightbox\[res720p</expression> </RegExp> <expression noclean="1" /> </RegExp> </Parse720pTrailer> <Parse1080pTrailer dest="5"> - <RegExp input="$$6" output="<details><trailer>\1</trailer></details>" dest="5"> + <RegExp input="$$6" output="<details>\1</details>" dest="5"> <!--Fallback to fetch 480p trailer link if 720p and 1080p are not available--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res480p</expression> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_480p_dl.mov)"\srel="lightbox\[res480p</expression> </RegExp> - <!--Fallback to fetch 720p trailer link if 1080p is not available--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res720p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res720p</expression> + <!--Fetch 720p trailer link from hdtrailers.net--> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_720p_dl.mov)"\srel="lightbox\[res720p</expression> </RegExp> <!--Fetch 1080p trailer link from hdtrailers.net--> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6"> - <expression noclean="1">">(Theatrical )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res1080p</expression> - </RegExp> - <RegExp input="$$1" output="http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=\2" dest="6+"> - <expression noclean="1">">(Teaser )?Trailer</span></td>.*?sid=(\d*)" rel="lightbox\[res1080p</expression> + <RegExp input="$$1" output="<trailer>http://pdl.stream.aol.com/\1</trailer>" dest="6"> + <expression noclean="1">http://pdl\.stream\.aol\.com/([^"]*?_1080p_dl.mov)"\srel="lightbox\[res1080p</expression> </RegExp> <expression noclean="1" /> </RegExp> </Parse1080pTrailer> -</scraperfunctions> +</scraperfunctions>
\ No newline at end of file diff --git a/addons/metadata.common.htbackdrops.com/addon.xml b/addons/metadata.common.htbackdrops.com/addon.xml index 2b7d8b3ab0..46c5ae7915 100644 --- a/addons/metadata.common.htbackdrops.com/addon.xml +++ b/addons/metadata.common.htbackdrops.com/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.htbackdrops.com" name="HTBackdrops" - version="1.2.0" + version="1.3.1" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="1.0"/> diff --git a/addons/metadata.common.htbackdrops.com/htbackdrops.xml b/addons/metadata.common.htbackdrops.com/htbackdrops.xml index 0531585803..a5017c746c 100644 --- a/addons/metadata.common.htbackdrops.com/htbackdrops.xml +++ b/addons/metadata.common.htbackdrops.com/htbackdrops.xml @@ -1,11 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetHTBThumbsByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseHTBThumbs" post="yes" cache="htb-images-\1.xml">http://htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/searchXML?mbid=\1&aid=1,5</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseHTBThumbs" post="yes" cache="htb-images-\1.xml">http://htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/searchXML?mbid=\1&aid=1,5</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetHTBThumbsByMBID> <GetHTBThumbs dest="5"> - <RegExp input="$$1" output="<details><url function="ParseHTBThumbs" post="yes" cache="htb-images-\1.xml">http://htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/searchXML?keywords=\1&default_operator=and&aid=1,5</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseHTBThumbs" post="yes" cache="htb-images-\1.xml">http://htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/searchXML?keywords=\1&default_operator=and&aid=1,5</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetHTBThumbs> @@ -14,7 +15,7 @@ <RegExp input="" output="" dest="13"> <expression /> </RegExp> - <RegExp input="$$1" output="<thumb preview="http://www.htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/download/\1/thumbnail">http://www.htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/download/\1/fullsize</thumb>" dest="13"> + <RegExp input="$$1" output="<thumb preview="http://www.htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/download/\1/thumbnail">http://www.htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/download/\1/fullsize</thumb>" dest="13"> <expression repeat="yes" noclean="1"><id>([^<]+)</id>\n[^<]+<aid>5</aid></expression> </RegExp> <expression noclean="1" /> @@ -22,12 +23,12 @@ </ParseHTBThumbs> <GetHTBFanartByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseHTBFanart" post="yes" cache="htb-images-\1.xml">http://htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/searchXML?mbid=\1&aid=1,5</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseHTBFanart" post="yes" cache="htb-images-\1.xml">http://htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/searchXML?mbid=\1&aid=1,5</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetHTBFanartByMBID> <GetHTBFanart dest="5"> - <RegExp input="$$1" output="<details><url function="ParseHTBFanart" post="yes" cache="htb-images-\1.xml">http://htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/searchXML?keywords=\1&default_operator=and&aid=1,5</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseHTBFanart" post="yes" cache="htb-images-\1.xml">http://htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/searchXML?keywords=\1&default_operator=and&aid=1,5</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetHTBFanart> @@ -39,7 +40,7 @@ <RegExp input="" output="" dest="14"> <expression /> </RegExp> - <RegExp input="$$1" output="<thumb preview="http://www.htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/download/\1/thumbnail">http://www.htbackdrops.com/api/7681a907c805e0670330c694e788e8e8/download/\1/fullsize</thumb>" dest="14"> + <RegExp input="$$1" output="<thumb preview="http://www.htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/download/\1/thumbnail">http://www.htbackdrops.org/api/7681a907c805e0670330c694e788e8e8/download/\1/fullsize</thumb>" dest="14"> <expression repeat="yes" noclean="1"><id>([^<]+)</id>\n[^<]+<aid>1</aid></expression> </RegExp> <RegExp input="$$14" output="\1" dest="13"> diff --git a/addons/metadata.common.imdb.com/addon.xml b/addons/metadata.common.imdb.com/addon.xml index 4658980204..99fe531d92 100644 --- a/addons/metadata.common.imdb.com/addon.xml +++ b/addons/metadata.common.imdb.com/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.imdb.com" name="IMDB Scraper Library" - version="2.7.6" + version="2.7.8" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.imdb.com/changelog.txt b/addons/metadata.common.imdb.com/changelog.txt index 95d20ec2b6..d310c4a047 100644 --- a/addons/metadata.common.imdb.com/changelog.txt +++ b/addons/metadata.common.imdb.com/changelog.txt @@ -1,3 +1,9 @@ +[B]2.7.8[/B] +- fixed: add xml header + +[B]2.7.7[/B] +- fixed: MetaCritic Score for 100/100 films + [B]2.7.6[/B] - fixed: IMDb studio/director/writer after layout change diff --git a/addons/metadata.common.imdb.com/imdb.xml b/addons/metadata.common.imdb.com/imdb.xml index 7d92f3647c..0ea0e5f457 100644 --- a/addons/metadata.common.imdb.com/imdb.xml +++ b/addons/metadata.common.imdb.com/imdb.xml @@ -1,4 +1,5 @@ -<scraperfunctions> +<?xml version="1.0" encoding="UTF-8"?> +<scraperfunctions> <GetIMDBGenresById dest="5"> <RegExp input="$$1" output="<details><url cache="$$1-main.html" function="ParseIMDBGenres">http://akas.imdb.com/title/$$1/|accept-language=en-us</url></details>" dest="5"> <expression noclean="1" /> @@ -77,7 +78,7 @@ <ParseMetaCriticRating dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="<rating>\1.\2</rating>" dest="2"> - <expression><a\shref="criticreviews[^"]*?"\stitle[^>]*?>\s(\d)(\d*)</expression> + <expression><a\shref="criticreviews[^"]*?"\stitle[^>]*?>\s(\d*)(\d)/</expression> </RegExp> <expression noclean="1" /> </RegExp> diff --git a/addons/metadata.common.last.fm/addon.xml b/addons/metadata.common.last.fm/addon.xml index 98c914dbd8..ed1fb4a4af 100644 --- a/addons/metadata.common.last.fm/addon.xml +++ b/addons/metadata.common.last.fm/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.last.fm" name="Last.FM" - version="1.6.0" + version="1.6.1" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.last.fm/lastfm.xml b/addons/metadata.common.last.fm/lastfm.xml index 364e70714b..0c5b26341b 100644 --- a/addons/metadata.common.last.fm/lastfm.xml +++ b/addons/metadata.common.last.fm/lastfm.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetLastFMDiscographyByMBID dest="5" clearbuffers="no"> <RegExp input="$$1" output="<details><url function="ParseLastFMDiscography" cache="lastfmdiscog-\1.xml">http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&amp;mbid=\1&amp;api_key=71e468a84c1f40d4991ddccc46e40f1b</url></details>" dest="5"> diff --git a/addons/metadata.common.musicbrainz.org/addon.xml b/addons/metadata.common.musicbrainz.org/addon.xml index df66d41263..bf8801c3c9 100644 --- a/addons/metadata.common.musicbrainz.org/addon.xml +++ b/addons/metadata.common.musicbrainz.org/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.musicbrainz.org" name="musicbrainz" - version="1.3.0" + version="2.0.2" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.musicbrainz.org/musicbrainz.xml b/addons/metadata.common.musicbrainz.org/musicbrainz.xml index 5ee46d5dc4..9f73aa38a8 100644 --- a/addons/metadata.common.musicbrainz.org/musicbrainz.xml +++ b/addons/metadata.common.musicbrainz.org/musicbrainz.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetMBDiscographyByMBID dest="5" clearbuffers="no"> <RegExp input="$$1" output="<details><url function="ParseMBDiscography" cache="mb-\1-discog.xml">http://musicbrainz.org/ws/2/release-group?artist=\1&amp;limit=100&amp;type=album</url></details>" dest="5"> @@ -17,7 +18,7 @@ </ParseMBDiscography> <GetMBLafeSpanByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseMBLifeSpan" cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseMBLifeSpan" cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetMBLafeSpanByMBID> @@ -58,7 +59,7 @@ </ParseMBLifeSpan> <GetMBFallbackLafeSpanByMBID dest="5" clearbuffers="no"> - <RegExp input="$$1" output="<details><url function="ParseFallbackMBLifeSpan" cache="mb-\1-artist.xml">http://www.musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> + <RegExp input="$$1" output="<details><url function="ParseFallbackMBLifeSpan" cache="mb-\1-artist.xml">http://musicbrainz.org/ws/2/artist/\1?inc=url-rels</url></details>" dest="5"> <expression noclean="1" /> </RegExp> </GetMBFallbackLafeSpanByMBID> @@ -90,13 +91,27 @@ </GetMBAlbumTitleByMBID> <ParseMBAlbumTitle dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> - <RegExp input="$$1" output="<title>\1</title>" dest="2"> - <expression noclean="1"><release id="[^"]*"><title>([^<]*)<</expression> + <RegExp input="$$1" output="<musicBrainzAlbumID>\1</musicBrainzAlbumID><title>\2</title>" dest="2"> + <expression noclean="1"><release id="([^"]*)"><title>([^<]*)<</expression> </RegExp> <expression noclean="1">(.+)</expression> </RegExp> </ParseMBAlbumTitle> + <GetMBAlbumArtistsByMBID dest="5"> + <RegExp input="$$1" output="<details><url function="ParseMBAlbumArtists" cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></details>" dest="5"> + <expression noclean="1" /> + </RegExp> + </GetMBAlbumArtistsByMBID> + <ParseMBAlbumArtists dest="5"> + <RegExp input="$$2" output="<details>\1</details>" dest="5"> + <RegExp input="$$1" output="<albumArtistCredits><joinphrase>\1</joinphrase><musicBrainzArtistID>\2</musicBrainzArtistID><artist>\3</artist></albumArtistCredits>" dest="2"> + <expression repeat="yes" noclean="1">(?:joinphrase="([^"]*)">)?<artist\sid="([^"]*)"><name>([^<]*)<</expression> + </RegExp> + <expression noclean="1">(.+)</expression> + </RegExp> + </ParseMBAlbumArtists> + <GetMBAlbumArtistByMBID dest="5"> <RegExp input="$$1" output="<details><url function="ParseMBAlbumArtist" cache="mb-\1-album.xml">http://musicbrainz.org/ws/2/release/\1?inc=recordings+release-groups+artists+labels+ratings</url></details>" dest="5"> <expression noclean="1" /> @@ -164,7 +179,7 @@ <ParseMBAlbumTracks dest="5"> <RegExp input="$$2" output="<details>\1</details>" dest="5"> <RegExp input="$$1" output="<track><position>\1</position><title>\4</title><duration>\2</duration></track>" dest="2"> - <expression repeat="yes"><track><position>(\d+)</position><number>\d*</number>(?:<length>(\d*?)\d{3}</length>)*(?:<recording id="([^"]*)">)*<title>([^<]*)<</expression> + <expression repeat="yes"><track[^>]+><position>(\d+)</position><number>\d*</number>(?:<length>(\d*?)\d{3}</length>)*(?:<recording id="([^"]*)">)*<title>([^<]*)<</expression> </RegExp> <expression noclean="1">(.+)</expression> </RegExp> diff --git a/addons/metadata.common.theaudiodb.com/addon.xml b/addons/metadata.common.theaudiodb.com/addon.xml index 432763702a..7ab19a2d02 100644 --- a/addons/metadata.common.theaudiodb.com/addon.xml +++ b/addons/metadata.common.theaudiodb.com/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.theaudiodb.com" name="TheAudioDb Common Scraper Functions" - version="1.6.1" + version="1.7.2" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.theaudiodb.com/tadb.xml b/addons/metadata.common.theaudiodb.com/tadb.xml index 7c1a807a05..e3052a2dcd 100644 --- a/addons/metadata.common.theaudiodb.com/tadb.xml +++ b/addons/metadata.common.theaudiodb.com/tadb.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> <GetTADBArtistThumbsByID dest="5" clearbuffers="no"> <RegExp input="$$1" output="<details><url function="ParseTADBArtistThumbs" cache="tadb-\1-artist.json">http://www.theaudiodb.com/api/v1/json/58424d43204d6564696120/artist.php?i=\1</url></details>" dest="5"> @@ -67,6 +68,9 @@ <RegExp input="" output="" dest="11"> <expression /> </RegExp> + <RegExp input="" output="" dest="12"> + <expression /> + </RegExp> <RegExp input="$$1" output="\1" dest="11"> <expression fixchars="1">strBiographyEN":"(.*?)","</expression> </RegExp> @@ -149,6 +153,9 @@ <RegExp input="" output="" dest="11"> <expression /> </RegExp> + <RegExp input="" output="" dest="12"> + <expression /> + </RegExp> <RegExp input="$$1" output="<formed>\2 (\1)</formed>" dest="11"> <expression fixchars="2" noclean="1">intFormedYear":"([^"]*).*?strCountry":"([^"]*)</expression> </RegExp> @@ -190,6 +197,9 @@ <RegExp input="" output="" dest="11"> <expression /> </RegExp> + <RegExp input="" output="" dest="12"> + <expression /> + </RegExp> <RegExp input="$$1" output="<formed>\2 (\1)</formed>" dest="11"> <expression fixchars="2" noclean="1">intFormedYear":"([^"]*).*?strCountry":"([^"]*)</expression> </RegExp> @@ -227,6 +237,9 @@ <RegExp input="" output="" dest="11"> <expression /> </RegExp> + <RegExp input="" output="" dest="12"> + <expression /> + </RegExp> <RegExp input="$$1" output="\1" dest="11"> <expression fixchars="1">strSubGenre":"([^"]*)</expression> </RegExp> @@ -286,6 +299,25 @@ </RegExp> </ParseTADBAlbumReview> + <GetTADBAlbumRating dest="5"> + <RegExp input="$$1" output="<details><url function="ParseTADBAlbumRating" cache="tadb-\1-album.json">http://www.theaudiodb.com/api/v1/json/58424d43204d6564696120/album.php?m=\1</url></details>" dest="5"> + <expression noclean="1"/> + </RegExp> + </GetTADBAlbumRating> + <GetTADBAlbumRatingByMBID dest="5" clearbuffers="no"> + <RegExp input="$$1" output="<details><url function="ParseTADBAlbumRating">http://www.theaudiodb.com/api/v1/json/58424d43204d6564696120/album-mb.php?i=\1</url></details>" dest="5"> + <expression noclean="1"/> + </RegExp> + </GetTADBAlbumRatingByMBID> + <ParseTADBAlbumRating dest="5"> + <RegExp input="$$2" output="<details>\1</details>" dest="5"> + <RegExp input="$$1" output="<rating max="10.0">\1</rating>" dest="2"> + <expression fixchars="1">intScore":"(.*?)","</expression> + </RegExp> + <expression noclean="1" /> + </RegExp> + </ParseTADBAlbumRating> + <GetTADBAlbumTitleByID dest="5"> <RegExp input="$$1" output="<details><url function="ParseTADBAlbumTitle" cache="tadb-\1-album.json">http://www.theaudiodb.com/api/v1/json/58424d43204d6564696120/album.php?m=\1</url></details>" dest="5"> <expression noclean="1"/> diff --git a/addons/metadata.common.themoviedb.org/addon.xml b/addons/metadata.common.themoviedb.org/addon.xml index fc9a87aea6..c343d100f1 100644 --- a/addons/metadata.common.themoviedb.org/addon.xml +++ b/addons/metadata.common.themoviedb.org/addon.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.themoviedb.org" name="The Movie Database Scraper Library" - version="2.9.3" + version="2.9.6" provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> diff --git a/addons/metadata.common.themoviedb.org/tmdb.xml b/addons/metadata.common.themoviedb.org/tmdb.xml index 675bf672d6..ac35cf1ccd 100644 --- a/addons/metadata.common.themoviedb.org/tmdb.xml +++ b/addons/metadata.common.themoviedb.org/tmdb.xml @@ -1,5 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> <scraperfunctions> - <GetTMDBCertificationsByIdChain dest="4"> <RegExp input="$$5" output="<details>\1</details>" dest="4"> <RegExp input="$$1" output="<url function="ParseTMDBCertifications" cache="tmdb-cert-\1.json">http://api.themoviedb.org/3/movie/\1/releases?api_key=57983e31fb435df4df77afb854740ea9&amp;language=$INFO[tmdbcertcountry]</url>" dest="5"> @@ -190,11 +190,11 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"cast":\[([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<actor><name>\1</name><role>\2</role><thumb>http://cf2.imgobject.com/t/p/original\3</thumb></actor>" dest="2"> - <expression repeat="yes" fixchars="1">"name":"([^"]*)","character":"([^"]*)","order":[0-9]*,"cast_id":[0-9]*,"profile_path":"([^"]*)"</expression> + <RegExp input="$$7" output="<actor><name>\1</name><role>\2</role><order>\3</order><thumb>http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\4</thumb></actor>" dest="2"> + <expression repeat="yes" fixchars="1">"name":"([^"]*)","character":"([^"]*)","order":([0-9]*),"cast_id":[0-9]*,"profile_path":"([^"]*)"</expression> </RegExp> - <RegExp input="$$7" output="<actor><name>\1</name><role>\2</role></actor>" dest="2+"> - <expression repeat="yes" fixchars="1">"name":"([^"]*)","character":"([^"]*)","order":[0-9]*,"cast_id":[0-9]*,"profile_path":null</expression> + <RegExp input="$$7" output="<actor><name>\1</name><role>\2</role><order>\3</order></actor>" dest="2+"> + <expression repeat="yes" fixchars="1">"name":"([^"]*)","character":"([^"]*)","order":([0-9]*),"cast_id":[0-9]*,"profile_path":null</expression> </RegExp> <expression noclean="1" /> </RegExp> @@ -409,7 +409,7 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"backdrops":\[\{([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<thumb preview="http://cf2.imgobject.com/t/p/w780\1">http://cf2.imgobject.com/t/p/original\1</thumb>" dest="2"> + <RegExp input="$$7" output="<thumb preview="http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w780\1">http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\1</thumb>" dest="2"> <expression repeat="yes" noclean="1">"file_path":"([^"]*)</expression> </RegExp> <expression noclean="1">(.+)</expression> @@ -440,7 +440,7 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"posters":\[\{([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<thumb aspect="poster" preview="http://cf2.imgobject.com/t/p/w500\1">http://cf2.imgobject.com/t/p/original\1</thumb>" dest="9"> + <RegExp input="$$7" output="<thumb aspect="poster" preview="http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500\1">http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\1</thumb>" dest="9"> <expression repeat="yes" noclean="1">"file_path":"([^"]*)</expression> </RegExp> <RegExp input="$$9" output="$$12" dest="2+"> @@ -466,7 +466,7 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"posters":\[\{([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<thumb aspect="poster" preview="http://cf2.imgobject.com/t/p/w500\1">http://cf2.imgobject.com/t/p/original\1</thumb>" dest="9"> + <RegExp input="$$7" output="<thumb aspect="poster" preview="http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500\1">http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\1</thumb>" dest="9"> <expression repeat="yes" noclean="1">"file_path":"([^"]*)</expression> </RegExp> <RegExp input="$$9" output="$$12" dest="2+"> @@ -492,7 +492,7 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"posters":\[\{([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<thumb aspect="poster" preview="http://cf2.imgobject.com/t/p/w500\1">http://cf2.imgobject.com/t/p/original\1</thumb>" dest="9"> + <RegExp input="$$7" output="<thumb aspect="poster" preview="http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500\1">http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\1</thumb>" dest="9"> <expression repeat="yes" noclean="1">"file_path":"([^"]*)</expression> </RegExp> <RegExp input="$$9" output="<url function="ParseTMDBAllThumbs" cache="tmdb-images-$$8.json">http://api.themoviedb.org/3/movie/$$8/images?api_key=57983e31fb435df4df77afb854740ea9</url>" dest="2"> @@ -509,7 +509,7 @@ <RegExp input="$$1" output="\1" dest="7"> <expression clear="yes" noclean="1">"posters":\[\{([^\]]*)</expression> </RegExp> - <RegExp input="$$7" output="<thumb aspect="poster" preview="http://cf2.imgobject.com/t/p/w500\1">http://cf2.imgobject.com/t/p/original\1</thumb>" dest="2"> + <RegExp input="$$7" output="<thumb aspect="poster" preview="http://d3gtl9l2a4fn1j.cloudfront.net/t/p/w500\1">http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original\1</thumb>" dest="2"> <expression repeat="yes" noclean="1">"file_path":"([^"]*)</expression> </RegExp> <expression noclean="1">(.+)</expression> diff --git a/addons/script.module.pysqlite/addon.xml b/addons/script.module.pysqlite/addon.xml deleted file mode 100644 index 8b76f6694f..0000000000 --- a/addons/script.module.pysqlite/addon.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addon id="script.module.pysqlite" - name="Python SQLite library hook" - version="2.5.6" - provider-name="Gerhard Haering"> - <requires> - <import addon="xbmc.python" version="2.0.0"/> - </requires> - <extension point="xbmc.python.module" - library="lib" /> - <extension point="xbmc.addon.metadata"> - <platform>all</platform> - </extension> -</addon> diff --git a/addons/script.module.pysqlite/lib/pysqlite2/__init__.py b/addons/script.module.pysqlite/lib/pysqlite2/__init__.py deleted file mode 100644 index 94d26e6694..0000000000 --- a/addons/script.module.pysqlite/lib/pysqlite2/__init__.py +++ /dev/null @@ -1,37 +0,0 @@ - -# if we got here then someone tried to import pysqlite.dbapi2 -# this will only be allowed if the script is greater that version 1.0 - -import warnings -import re - -# Credit gnud on stackoverflow: -# see http://stackoverflow.com/questions/1714027/version-number-comparison/1714190#1714190 -def xbmcVerCmp(version1, version2): - def normalize(v): - return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")] - return cmp(normalize(version1), normalize(version2)) - -# Not sure why this might fail but .... -try: - import __main__ - xbmcapiversion = __main__.__xbmcapiversion__ -except: - xbmcapiversion = "1.0" - warnings.warn("For some reason the module '" + str(__name__) + "' couldn't get access to '__main__'. This may prevent certain backward compatility modes from operating correctly.") - -# if the xbmcapiversion is either not set (because trying to get it failed or -# the script was invoked in an odd manner from xbmc) ... -if (xbmcVerCmp(xbmcapiversion,"1.0") <= 0): - # then import sqlite3 in place of dbapi2 - try: - import sqlite3 as dbapi2 - except Exception, e: - warnings.warn("Unable to import sqlite3. This probably means you're on a version of python prior to 2.5 and trying to run an old script.") - raise e - - # ask politely :) - warnings.warn("DeprecationWarning: the pysqlite2 module is deprecated; please change your script to use sqlite3.") -else: - raise DeprecationWarning("You cannot use pysqlite2 while depending on version " + str(xbmcapiversion) + " of the xbmc.python api. Please use sqlite3 instead.") - diff --git a/addons/script.module.simplejson/addon.xml b/addons/script.module.simplejson/addon.xml deleted file mode 100644 index c5709c415a..0000000000 --- a/addons/script.module.simplejson/addon.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<addon id="script.module.simplejson" - name="simplejson" - version="2.0.10" - provider-name="code.google.com/simplejson"> - <requires> - <import addon="xbmc.python" version="2.0.0"/> - </requires> - <extension point="xbmc.python.module" - library="lib" /> - <extension point="xbmc.addon.metadata"> - <platform>all</platform> - </extension> -</addon> diff --git a/addons/script.module.simplejson/lib/LICENSE.txt b/addons/script.module.simplejson/lib/LICENSE.txt deleted file mode 100644 index ad95f29c17..0000000000 --- a/addons/script.module.simplejson/lib/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006 Bob Ippolito - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/addons/script.module.simplejson/lib/simplejson/__init__.py b/addons/script.module.simplejson/lib/simplejson/__init__.py deleted file mode 100644 index d5b4d39913..0000000000 --- a/addons/script.module.simplejson/lib/simplejson/__init__.py +++ /dev/null @@ -1,318 +0,0 @@ -r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of -JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data -interchange format. - -:mod:`simplejson` exposes an API familiar to users of the standard library -:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained -version of the :mod:`json` library contained in Python 2.6, but maintains -compatibility with Python 2.4 and Python 2.5 and (currently) has -significant performance advantages, even without using the optional C -extension for speedups. - -Encoding basic Python object hierarchies:: - - >>> import simplejson as json - >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) - '["foo", {"bar": ["baz", null, 1.0, 2]}]' - >>> print json.dumps("\"foo\bar") - "\"foo\bar" - >>> print json.dumps(u'\u1234') - "\u1234" - >>> print json.dumps('\\') - "\\" - >>> print json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True) - {"a": 0, "b": 0, "c": 0} - >>> from StringIO import StringIO - >>> io = StringIO() - >>> json.dump(['streaming API'], io) - >>> io.getvalue() - '["streaming API"]' - -Compact encoding:: - - >>> import simplejson as json - >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) - '[1,2,3,{"4":5,"6":7}]' - -Pretty printing:: - - >>> import simplejson as json - >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) - >>> print '\n'.join([l.rstrip() for l in s.splitlines()]) - { - "4": 5, - "6": 7 - } - -Decoding JSON:: - - >>> import simplejson as json - >>> obj = [u'foo', {u'bar': [u'baz', None, 1.0, 2]}] - >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj - True - >>> json.loads('"\\"foo\\bar"') == u'"foo\x08ar' - True - >>> from StringIO import StringIO - >>> io = StringIO('["streaming API"]') - >>> json.load(io)[0] == 'streaming API' - True - -Specializing JSON object decoding:: - - >>> import simplejson as json - >>> def as_complex(dct): - ... if '__complex__' in dct: - ... return complex(dct['real'], dct['imag']) - ... return dct - ... - >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', - ... object_hook=as_complex) - (1+2j) - >>> import decimal - >>> json.loads('1.1', parse_float=decimal.Decimal) == decimal.Decimal('1.1') - True - -Specializing JSON object encoding:: - - >>> import simplejson as json - >>> def encode_complex(obj): - ... if isinstance(obj, complex): - ... return [obj.real, obj.imag] - ... raise TypeError(repr(o) + " is not JSON serializable") - ... - >>> json.dumps(2 + 1j, default=encode_complex) - '[2.0, 1.0]' - >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) - '[2.0, 1.0]' - >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) - '[2.0, 1.0]' - - -Using simplejson.tool from the shell to validate and pretty-print:: - - $ echo '{"json":"obj"}' | python -m simplejson.tool - { - "json": "obj" - } - $ echo '{ 1.2:3.4}' | python -m simplejson.tool - Expecting property name: line 1 column 2 (char 2) -""" -__version__ = '2.0.9' -__all__ = [ - 'dump', 'dumps', 'load', 'loads', - 'JSONDecoder', 'JSONEncoder', -] - -__author__ = 'Bob Ippolito <bob@redivi.com>' - -from decoder import JSONDecoder -from encoder import JSONEncoder - -_default_encoder = JSONEncoder( - skipkeys=False, - ensure_ascii=True, - check_circular=True, - allow_nan=True, - indent=None, - separators=None, - encoding='utf-8', - default=None, -) - -def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, - allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): - """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a - ``.write()``-supporting file-like object). - - If ``skipkeys`` is true then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. - - If ``ensure_ascii`` is false, then the some chunks written to ``fp`` - may be ``unicode`` instances, subject to normal Python ``str`` to - ``unicode`` coercion rules. Unless ``fp.write()`` explicitly - understands ``unicode`` (as in ``codecs.getwriter()``) this is likely - to cause an error. - - If ``check_circular`` is false, then the circular reference check - for container types will be skipped and a circular reference will - result in an ``OverflowError`` (or worse). - - If ``allow_nan`` is false, then it will be a ``ValueError`` to - serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) - in strict compliance of the JSON specification, instead of using the - JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). - - If ``indent`` is a non-negative integer, then JSON array elements and object - members will be pretty-printed with that indent level. An indent level - of 0 will only insert newlines. ``None`` is the most compact representation. - - If ``separators`` is an ``(item_separator, dict_separator)`` tuple - then it will be used instead of the default ``(', ', ': ')`` separators. - ``(',', ':')`` is the most compact JSON representation. - - ``encoding`` is the character encoding for str instances, default is UTF-8. - - ``default(obj)`` is a function that should return a serializable version - of obj or raise TypeError. The default simply raises TypeError. - - To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the - ``.default()`` method to serialize additional types), specify it with - the ``cls`` kwarg. - - """ - # cached encoder - if (not skipkeys and ensure_ascii and - check_circular and allow_nan and - cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): - iterable = _default_encoder.iterencode(obj) - else: - if cls is None: - cls = JSONEncoder - iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii, - check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, - default=default, **kw).iterencode(obj) - # could accelerate with writelines in some versions of Python, at - # a debuggability cost - for chunk in iterable: - fp.write(chunk) - - -def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, - allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): - """Serialize ``obj`` to a JSON formatted ``str``. - - If ``skipkeys`` is false then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. - - If ``ensure_ascii`` is false, then the return value will be a - ``unicode`` instance subject to normal Python ``str`` to ``unicode`` - coercion rules instead of being escaped to an ASCII ``str``. - - If ``check_circular`` is false, then the circular reference check - for container types will be skipped and a circular reference will - result in an ``OverflowError`` (or worse). - - If ``allow_nan`` is false, then it will be a ``ValueError`` to - serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in - strict compliance of the JSON specification, instead of using the - JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). - - If ``indent`` is a non-negative integer, then JSON array elements and - object members will be pretty-printed with that indent level. An indent - level of 0 will only insert newlines. ``None`` is the most compact - representation. - - If ``separators`` is an ``(item_separator, dict_separator)`` tuple - then it will be used instead of the default ``(', ', ': ')`` separators. - ``(',', ':')`` is the most compact JSON representation. - - ``encoding`` is the character encoding for str instances, default is UTF-8. - - ``default(obj)`` is a function that should return a serializable version - of obj or raise TypeError. The default simply raises TypeError. - - To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the - ``.default()`` method to serialize additional types), specify it with - the ``cls`` kwarg. - - """ - # cached encoder - if (not skipkeys and ensure_ascii and - check_circular and allow_nan and - cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): - return _default_encoder.encode(obj) - if cls is None: - cls = JSONEncoder - return cls( - skipkeys=skipkeys, ensure_ascii=ensure_ascii, - check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, default=default, - **kw).encode(obj) - - -_default_decoder = JSONDecoder(encoding=None, object_hook=None) - - -def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None, - parse_int=None, parse_constant=None, **kw): - """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing - a JSON document) to a Python object. - - If the contents of ``fp`` is encoded with an ASCII based encoding other - than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must - be specified. Encodings that are not ASCII based (such as UCS-2) are - not allowed, and should be wrapped with - ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` - object and passed to ``loads()`` - - ``object_hook`` is an optional function that will be called with the - result of any object literal decode (a ``dict``). The return value of - ``object_hook`` will be used instead of the ``dict``. This feature - can be used to implement custom decoders (e.g. JSON-RPC class hinting). - - To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` - kwarg. - - """ - return loads(fp.read(), - encoding=encoding, cls=cls, object_hook=object_hook, - parse_float=parse_float, parse_int=parse_int, - parse_constant=parse_constant, **kw) - - -def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, - parse_int=None, parse_constant=None, **kw): - """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON - document) to a Python object. - - If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding - other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name - must be specified. Encodings that are not ASCII based (such as UCS-2) - are not allowed and should be decoded to ``unicode`` first. - - ``object_hook`` is an optional function that will be called with the - result of any object literal decode (a ``dict``). The return value of - ``object_hook`` will be used instead of the ``dict``. This feature - can be used to implement custom decoders (e.g. JSON-RPC class hinting). - - ``parse_float``, if specified, will be called with the string - of every JSON float to be decoded. By default this is equivalent to - float(num_str). This can be used to use another datatype or parser - for JSON floats (e.g. decimal.Decimal). - - ``parse_int``, if specified, will be called with the string - of every JSON int to be decoded. By default this is equivalent to - int(num_str). This can be used to use another datatype or parser - for JSON integers (e.g. float). - - ``parse_constant``, if specified, will be called with one of the - following strings: -Infinity, Infinity, NaN, null, true, false. - This can be used to raise an exception if invalid JSON numbers - are encountered. - - To use a custom ``JSONDecoder`` subclass, specify it with the ``cls`` - kwarg. - - """ - if (cls is None and encoding is None and object_hook is None and - parse_int is None and parse_float is None and - parse_constant is None and not kw): - return _default_decoder.decode(s) - if cls is None: - cls = JSONDecoder - if object_hook is not None: - kw['object_hook'] = object_hook - if parse_float is not None: - kw['parse_float'] = parse_float - if parse_int is not None: - kw['parse_int'] = parse_int - if parse_constant is not None: - kw['parse_constant'] = parse_constant - return cls(encoding=encoding, **kw).decode(s) diff --git a/addons/script.module.simplejson/lib/simplejson/decoder.py b/addons/script.module.simplejson/lib/simplejson/decoder.py deleted file mode 100644 index b769ea486c..0000000000 --- a/addons/script.module.simplejson/lib/simplejson/decoder.py +++ /dev/null @@ -1,354 +0,0 @@ -"""Implementation of JSONDecoder -""" -import re -import sys -import struct - -from simplejson.scanner import make_scanner -try: - from simplejson._speedups import scanstring as c_scanstring -except ImportError: - c_scanstring = None - -__all__ = ['JSONDecoder'] - -FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL - -def _floatconstants(): - _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') - if sys.byteorder != 'big': - _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1] - nan, inf = struct.unpack('dd', _BYTES) - return nan, inf, -inf - -NaN, PosInf, NegInf = _floatconstants() - - -def linecol(doc, pos): - lineno = doc.count('\n', 0, pos) + 1 - if lineno == 1: - colno = pos - else: - colno = pos - doc.rindex('\n', 0, pos) - return lineno, colno - - -def errmsg(msg, doc, pos, end=None): - # Note that this function is called from _speedups - lineno, colno = linecol(doc, pos) - if end is None: - #fmt = '{0}: line {1} column {2} (char {3})' - #return fmt.format(msg, lineno, colno, pos) - fmt = '%s: line %d column %d (char %d)' - return fmt % (msg, lineno, colno, pos) - endlineno, endcolno = linecol(doc, end) - #fmt = '{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})' - #return fmt.format(msg, lineno, colno, endlineno, endcolno, pos, end) - fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' - return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) - - -_CONSTANTS = { - '-Infinity': NegInf, - 'Infinity': PosInf, - 'NaN': NaN, -} - -STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS) -BACKSLASH = { - '"': u'"', '\\': u'\\', '/': u'/', - 'b': u'\b', 'f': u'\f', 'n': u'\n', 'r': u'\r', 't': u'\t', -} - -DEFAULT_ENCODING = "utf-8" - -def py_scanstring(s, end, encoding=None, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match): - """Scan the string s for a JSON string. End is the index of the - character in s after the quote that started the JSON string. - Unescapes all valid JSON string escape sequences and raises ValueError - on attempt to decode an invalid string. If strict is False then literal - control characters are allowed in the string. - - Returns a tuple of the decoded string and the index of the character in s - after the end quote.""" - if encoding is None: - encoding = DEFAULT_ENCODING - chunks = [] - _append = chunks.append - begin = end - 1 - while 1: - chunk = _m(s, end) - if chunk is None: - raise ValueError( - errmsg("Unterminated string starting at", s, begin)) - end = chunk.end() - content, terminator = chunk.groups() - # Content is contains zero or more unescaped string characters - if content: - if not isinstance(content, unicode): - content = unicode(content, encoding) - _append(content) - # Terminator is the end of string, a literal control character, - # or a backslash denoting that an escape sequence follows - if terminator == '"': - break - elif terminator != '\\': - if strict: - msg = "Invalid control character %r at" % (terminator,) - #msg = "Invalid control character {0!r} at".format(terminator) - raise ValueError(errmsg(msg, s, end)) - else: - _append(terminator) - continue - try: - esc = s[end] - except IndexError: - raise ValueError( - errmsg("Unterminated string starting at", s, begin)) - # If not a unicode escape sequence, must be in the lookup table - if esc != 'u': - try: - char = _b[esc] - except KeyError: - msg = "Invalid \\escape: " + repr(esc) - raise ValueError(errmsg(msg, s, end)) - end += 1 - else: - # Unicode escape sequence - esc = s[end + 1:end + 5] - next_end = end + 5 - if len(esc) != 4: - msg = "Invalid \\uXXXX escape" - raise ValueError(errmsg(msg, s, end)) - uni = int(esc, 16) - # Check for surrogate pair on UCS-4 systems - if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535: - msg = "Invalid \\uXXXX\\uXXXX surrogate pair" - if not s[end + 5:end + 7] == '\\u': - raise ValueError(errmsg(msg, s, end)) - esc2 = s[end + 7:end + 11] - if len(esc2) != 4: - raise ValueError(errmsg(msg, s, end)) - uni2 = int(esc2, 16) - uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) - next_end += 6 - char = unichr(uni) - end = next_end - # Append the unescaped character - _append(char) - return u''.join(chunks), end - - -# Use speedup if available -scanstring = c_scanstring or py_scanstring - -WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) -WHITESPACE_STR = ' \t\n\r' - -def JSONObject((s, end), encoding, strict, scan_once, object_hook, _w=WHITESPACE.match, _ws=WHITESPACE_STR): - pairs = {} - # Use a slice to prevent IndexError from being raised, the following - # check will raise a more specific ValueError if the string is empty - nextchar = s[end:end + 1] - # Normally we expect nextchar == '"' - if nextchar != '"': - if nextchar in _ws: - end = _w(s, end).end() - nextchar = s[end:end + 1] - # Trivial empty object - if nextchar == '}': - return pairs, end + 1 - elif nextchar != '"': - raise ValueError(errmsg("Expecting property name", s, end)) - end += 1 - while True: - key, end = scanstring(s, end, encoding, strict) - - # To skip some function call overhead we optimize the fast paths where - # the JSON key separator is ": " or just ":". - if s[end:end + 1] != ':': - end = _w(s, end).end() - if s[end:end + 1] != ':': - raise ValueError(errmsg("Expecting : delimiter", s, end)) - - end += 1 - - try: - if s[end] in _ws: - end += 1 - if s[end] in _ws: - end = _w(s, end + 1).end() - except IndexError: - pass - - try: - value, end = scan_once(s, end) - except StopIteration: - raise ValueError(errmsg("Expecting object", s, end)) - pairs[key] = value - - try: - nextchar = s[end] - if nextchar in _ws: - end = _w(s, end + 1).end() - nextchar = s[end] - except IndexError: - nextchar = '' - end += 1 - - if nextchar == '}': - break - elif nextchar != ',': - raise ValueError(errmsg("Expecting , delimiter", s, end - 1)) - - try: - nextchar = s[end] - if nextchar in _ws: - end += 1 - nextchar = s[end] - if nextchar in _ws: - end = _w(s, end + 1).end() - nextchar = s[end] - except IndexError: - nextchar = '' - - end += 1 - if nextchar != '"': - raise ValueError(errmsg("Expecting property name", s, end - 1)) - - if object_hook is not None: - pairs = object_hook(pairs) - return pairs, end - -def JSONArray((s, end), scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR): - values = [] - nextchar = s[end:end + 1] - if nextchar in _ws: - end = _w(s, end + 1).end() - nextchar = s[end:end + 1] - # Look-ahead for trivial empty array - if nextchar == ']': - return values, end + 1 - _append = values.append - while True: - try: - value, end = scan_once(s, end) - except StopIteration: - raise ValueError(errmsg("Expecting object", s, end)) - _append(value) - nextchar = s[end:end + 1] - if nextchar in _ws: - end = _w(s, end + 1).end() - nextchar = s[end:end + 1] - end += 1 - if nextchar == ']': - break - elif nextchar != ',': - raise ValueError(errmsg("Expecting , delimiter", s, end)) - - try: - if s[end] in _ws: - end += 1 - if s[end] in _ws: - end = _w(s, end + 1).end() - except IndexError: - pass - - return values, end - -class JSONDecoder(object): - """Simple JSON <http://json.org> decoder - - Performs the following translations in decoding by default: - - +---------------+-------------------+ - | JSON | Python | - +===============+===================+ - | object | dict | - +---------------+-------------------+ - | array | list | - +---------------+-------------------+ - | string | unicode | - +---------------+-------------------+ - | number (int) | int, long | - +---------------+-------------------+ - | number (real) | float | - +---------------+-------------------+ - | true | True | - +---------------+-------------------+ - | false | False | - +---------------+-------------------+ - | null | None | - +---------------+-------------------+ - - It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as - their corresponding ``float`` values, which is outside the JSON spec. - - """ - - def __init__(self, encoding=None, object_hook=None, parse_float=None, - parse_int=None, parse_constant=None, strict=True): - """``encoding`` determines the encoding used to interpret any ``str`` - objects decoded by this instance (utf-8 by default). It has no - effect when decoding ``unicode`` objects. - - Note that currently only encodings that are a superset of ASCII work, - strings of other encodings should be passed in as ``unicode``. - - ``object_hook``, if specified, will be called with the result - of every JSON object decoded and its return value will be used in - place of the given ``dict``. This can be used to provide custom - deserializations (e.g. to support JSON-RPC class hinting). - - ``parse_float``, if specified, will be called with the string - of every JSON float to be decoded. By default this is equivalent to - float(num_str). This can be used to use another datatype or parser - for JSON floats (e.g. decimal.Decimal). - - ``parse_int``, if specified, will be called with the string - of every JSON int to be decoded. By default this is equivalent to - int(num_str). This can be used to use another datatype or parser - for JSON integers (e.g. float). - - ``parse_constant``, if specified, will be called with one of the - following strings: -Infinity, Infinity, NaN. - This can be used to raise an exception if invalid JSON numbers - are encountered. - - """ - self.encoding = encoding - self.object_hook = object_hook - self.parse_float = parse_float or float - self.parse_int = parse_int or int - self.parse_constant = parse_constant or _CONSTANTS.__getitem__ - self.strict = strict - self.parse_object = JSONObject - self.parse_array = JSONArray - self.parse_string = scanstring - self.scan_once = make_scanner(self) - - def decode(self, s, _w=WHITESPACE.match): - """Return the Python representation of ``s`` (a ``str`` or ``unicode`` - instance containing a JSON document) - - """ - obj, end = self.raw_decode(s, idx=_w(s, 0).end()) - end = _w(s, end).end() - if end != len(s): - raise ValueError(errmsg("Extra data", s, end, len(s))) - return obj - - def raw_decode(self, s, idx=0): - """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning - with a JSON document) and return a 2-tuple of the Python - representation and the index in ``s`` where the document ended. - - This can be used to decode a JSON document from a string that may - have extraneous data at the end. - - """ - try: - obj, end = self.scan_once(s, idx) - except StopIteration: - raise ValueError("No JSON object could be decoded") - return obj, end diff --git a/addons/script.module.simplejson/lib/simplejson/encoder.py b/addons/script.module.simplejson/lib/simplejson/encoder.py deleted file mode 100644 index cf58290366..0000000000 --- a/addons/script.module.simplejson/lib/simplejson/encoder.py +++ /dev/null @@ -1,440 +0,0 @@ -"""Implementation of JSONEncoder -""" -import re - -try: - from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii -except ImportError: - c_encode_basestring_ascii = None -try: - from simplejson._speedups import make_encoder as c_make_encoder -except ImportError: - c_make_encoder = None - -ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') -ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') -HAS_UTF8 = re.compile(r'[\x80-\xff]') -ESCAPE_DCT = { - '\\': '\\\\', - '"': '\\"', - '\b': '\\b', - '\f': '\\f', - '\n': '\\n', - '\r': '\\r', - '\t': '\\t', -} -for i in range(0x20): - #ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i)) - ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) - -# Assume this produces an infinity on all machines (probably not guaranteed) -INFINITY = float('1e66666') -FLOAT_REPR = repr - -def encode_basestring(s): - """Return a JSON representation of a Python string - - """ - def replace(match): - return ESCAPE_DCT[match.group(0)] - return '"' + ESCAPE.sub(replace, s) + '"' - - -def py_encode_basestring_ascii(s): - """Return an ASCII-only JSON representation of a Python string - - """ - if isinstance(s, str) and HAS_UTF8.search(s) is not None: - s = s.decode('utf-8') - def replace(match): - s = match.group(0) - try: - return ESCAPE_DCT[s] - except KeyError: - n = ord(s) - if n < 0x10000: - #return '\\u{0:04x}'.format(n) - return '\\u%04x' % (n,) - else: - # surrogate pair - n -= 0x10000 - s1 = 0xd800 | ((n >> 10) & 0x3ff) - s2 = 0xdc00 | (n & 0x3ff) - #return '\\u{0:04x}\\u{1:04x}'.format(s1, s2) - return '\\u%04x\\u%04x' % (s1, s2) - return '"' + str(ESCAPE_ASCII.sub(replace, s)) + '"' - - -encode_basestring_ascii = c_encode_basestring_ascii or py_encode_basestring_ascii - -class JSONEncoder(object): - """Extensible JSON <http://json.org> encoder for Python data structures. - - Supports the following objects and types by default: - - +-------------------+---------------+ - | Python | JSON | - +===================+===============+ - | dict | object | - +-------------------+---------------+ - | list, tuple | array | - +-------------------+---------------+ - | str, unicode | string | - +-------------------+---------------+ - | int, long, float | number | - +-------------------+---------------+ - | True | true | - +-------------------+---------------+ - | False | false | - +-------------------+---------------+ - | None | null | - +-------------------+---------------+ - - To extend this to recognize other objects, subclass and implement a - ``.default()`` method with another method that returns a serializable - object for ``o`` if possible, otherwise it should call the superclass - implementation (to raise ``TypeError``). - - """ - item_separator = ', ' - key_separator = ': ' - def __init__(self, skipkeys=False, ensure_ascii=True, - check_circular=True, allow_nan=True, sort_keys=False, - indent=None, separators=None, encoding='utf-8', default=None): - """Constructor for JSONEncoder, with sensible defaults. - - If skipkeys is false, then it is a TypeError to attempt - encoding of keys that are not str, int, long, float or None. If - skipkeys is True, such items are simply skipped. - - If ensure_ascii is true, the output is guaranteed to be str - objects with all incoming unicode characters escaped. If - ensure_ascii is false, the output will be unicode object. - - If check_circular is true, then lists, dicts, and custom encoded - objects will be checked for circular references during encoding to - prevent an infinite recursion (which would cause an OverflowError). - Otherwise, no such check takes place. - - If allow_nan is true, then NaN, Infinity, and -Infinity will be - encoded as such. This behavior is not JSON specification compliant, - but is consistent with most JavaScript based encoders and decoders. - Otherwise, it will be a ValueError to encode such floats. - - If sort_keys is true, then the output of dictionaries will be - sorted by key; this is useful for regression tests to ensure - that JSON serializations can be compared on a day-to-day basis. - - If indent is a non-negative integer, then JSON array - elements and object members will be pretty-printed with that - indent level. An indent level of 0 will only insert newlines. - None is the most compact representation. - - If specified, separators should be a (item_separator, key_separator) - tuple. The default is (', ', ': '). To get the most compact JSON - representation you should specify (',', ':') to eliminate whitespace. - - If specified, default is a function that gets called for objects - that can't otherwise be serialized. It should return a JSON encodable - version of the object or raise a ``TypeError``. - - If encoding is not None, then all input strings will be - transformed into unicode using that encoding prior to JSON-encoding. - The default is UTF-8. - - """ - - self.skipkeys = skipkeys - self.ensure_ascii = ensure_ascii - self.check_circular = check_circular - self.allow_nan = allow_nan - self.sort_keys = sort_keys - self.indent = indent - if separators is not None: - self.item_separator, self.key_separator = separators - if default is not None: - self.default = default - self.encoding = encoding - - def default(self, o): - """Implement this method in a subclass such that it returns - a serializable object for ``o``, or calls the base implementation - (to raise a ``TypeError``). - - For example, to support arbitrary iterators, you could - implement default like this:: - - def default(self, o): - try: - iterable = iter(o) - except TypeError: - pass - else: - return list(iterable) - return JSONEncoder.default(self, o) - - """ - raise TypeError(repr(o) + " is not JSON serializable") - - def encode(self, o): - """Return a JSON string representation of a Python data structure. - - >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) - '{"foo": ["bar", "baz"]}' - - """ - # This is for extremely simple cases and benchmarks. - if isinstance(o, basestring): - if isinstance(o, str): - _encoding = self.encoding - if (_encoding is not None - and not (_encoding == 'utf-8')): - o = o.decode(_encoding) - if self.ensure_ascii: - return encode_basestring_ascii(o) - else: - return encode_basestring(o) - # This doesn't pass the iterator directly to ''.join() because the - # exceptions aren't as detailed. The list call should be roughly - # equivalent to the PySequence_Fast that ''.join() would do. - chunks = self.iterencode(o, _one_shot=True) - if not isinstance(chunks, (list, tuple)): - chunks = list(chunks) - return ''.join(chunks) - - def iterencode(self, o, _one_shot=False): - """Encode the given object and yield each string - representation as available. - - For example:: - - for chunk in JSONEncoder().iterencode(bigobject): - mysocket.write(chunk) - - """ - if self.check_circular: - markers = {} - else: - markers = None - if self.ensure_ascii: - _encoder = encode_basestring_ascii - else: - _encoder = encode_basestring - if self.encoding != 'utf-8': - def _encoder(o, _orig_encoder=_encoder, _encoding=self.encoding): - if isinstance(o, str): - o = o.decode(_encoding) - return _orig_encoder(o) - - def floatstr(o, allow_nan=self.allow_nan, _repr=FLOAT_REPR, _inf=INFINITY, _neginf=-INFINITY): - # Check for specials. Note that this type of test is processor- and/or - # platform-specific, so do tests which don't depend on the internals. - - if o != o: - text = 'NaN' - elif o == _inf: - text = 'Infinity' - elif o == _neginf: - text = '-Infinity' - else: - return _repr(o) - - if not allow_nan: - raise ValueError( - "Out of range float values are not JSON compliant: " + - repr(o)) - - return text - - - if _one_shot and c_make_encoder is not None and not self.indent and not self.sort_keys: - _iterencode = c_make_encoder( - markers, self.default, _encoder, self.indent, - self.key_separator, self.item_separator, self.sort_keys, - self.skipkeys, self.allow_nan) - else: - _iterencode = _make_iterencode( - markers, self.default, _encoder, self.indent, floatstr, - self.key_separator, self.item_separator, self.sort_keys, - self.skipkeys, _one_shot) - return _iterencode(o, 0) - -def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, - ## HACK: hand-optimized bytecode; turn globals into locals - False=False, - True=True, - ValueError=ValueError, - basestring=basestring, - dict=dict, - float=float, - id=id, - int=int, - isinstance=isinstance, - list=list, - long=long, - str=str, - tuple=tuple, - ): - - def _iterencode_list(lst, _current_indent_level): - if not lst: - yield '[]' - return - if markers is not None: - markerid = id(lst) - if markerid in markers: - raise ValueError("Circular reference detected") - markers[markerid] = lst - buf = '[' - if _indent is not None: - _current_indent_level += 1 - newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) - separator = _item_separator + newline_indent - buf += newline_indent - else: - newline_indent = None - separator = _item_separator - first = True - for value in lst: - if first: - first = False - else: - buf = separator - if isinstance(value, basestring): - yield buf + _encoder(value) - elif value is None: - yield buf + 'null' - elif value is True: - yield buf + 'true' - elif value is False: - yield buf + 'false' - elif isinstance(value, (int, long)): - yield buf + str(value) - elif isinstance(value, float): - yield buf + _floatstr(value) - else: - yield buf - if isinstance(value, (list, tuple)): - chunks = _iterencode_list(value, _current_indent_level) - elif isinstance(value, dict): - chunks = _iterencode_dict(value, _current_indent_level) - else: - chunks = _iterencode(value, _current_indent_level) - for chunk in chunks: - yield chunk - if newline_indent is not None: - _current_indent_level -= 1 - yield '\n' + (' ' * (_indent * _current_indent_level)) - yield ']' - if markers is not None: - del markers[markerid] - - def _iterencode_dict(dct, _current_indent_level): - if not dct: - yield '{}' - return - if markers is not None: - markerid = id(dct) - if markerid in markers: - raise ValueError("Circular reference detected") - markers[markerid] = dct - yield '{' - if _indent is not None: - _current_indent_level += 1 - newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) - item_separator = _item_separator + newline_indent - yield newline_indent - else: - newline_indent = None - item_separator = _item_separator - first = True - if _sort_keys: - items = dct.items() - items.sort(key=lambda kv: kv[0]) - else: - items = dct.iteritems() - for key, value in items: - if isinstance(key, basestring): - pass - # JavaScript is weakly typed for these, so it makes sense to - # also allow them. Many encoders seem to do something like this. - elif isinstance(key, float): - key = _floatstr(key) - elif key is True: - key = 'true' - elif key is False: - key = 'false' - elif key is None: - key = 'null' - elif isinstance(key, (int, long)): - key = str(key) - elif _skipkeys: - continue - else: - raise TypeError("key " + repr(key) + " is not a string") - if first: - first = False - else: - yield item_separator - yield _encoder(key) - yield _key_separator - if isinstance(value, basestring): - yield _encoder(value) - elif value is None: - yield 'null' - elif value is True: - yield 'true' - elif value is False: - yield 'false' - elif isinstance(value, (int, long)): - yield str(value) - elif isinstance(value, float): - yield _floatstr(value) - else: - if isinstance(value, (list, tuple)): - chunks = _iterencode_list(value, _current_indent_level) - elif isinstance(value, dict): - chunks = _iterencode_dict(value, _current_indent_level) - else: - chunks = _iterencode(value, _current_indent_level) - for chunk in chunks: - yield chunk - if newline_indent is not None: - _current_indent_level -= 1 - yield '\n' + (' ' * (_indent * _current_indent_level)) - yield '}' - if markers is not None: - del markers[markerid] - - def _iterencode(o, _current_indent_level): - if isinstance(o, basestring): - yield _encoder(o) - elif o is None: - yield 'null' - elif o is True: - yield 'true' - elif o is False: - yield 'false' - elif isinstance(o, (int, long)): - yield str(o) - elif isinstance(o, float): - yield _floatstr(o) - elif isinstance(o, (list, tuple)): - for chunk in _iterencode_list(o, _current_indent_level): - yield chunk - elif isinstance(o, dict): - for chunk in _iterencode_dict(o, _current_indent_level): - yield chunk - else: - if markers is not None: - markerid = id(o) - if markerid in markers: - raise ValueError("Circular reference detected") - markers[markerid] = o - o = _default(o) - for chunk in _iterencode(o, _current_indent_level): - yield chunk - if markers is not None: - del markers[markerid] - - return _iterencode diff --git a/addons/script.module.simplejson/lib/simplejson/scanner.py b/addons/script.module.simplejson/lib/simplejson/scanner.py deleted file mode 100644 index adbc6ec979..0000000000 --- a/addons/script.module.simplejson/lib/simplejson/scanner.py +++ /dev/null @@ -1,65 +0,0 @@ -"""JSON token scanner -""" -import re -try: - from simplejson._speedups import make_scanner as c_make_scanner -except ImportError: - c_make_scanner = None - -__all__ = ['make_scanner'] - -NUMBER_RE = re.compile( - r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', - (re.VERBOSE | re.MULTILINE | re.DOTALL)) - -def py_make_scanner(context): - parse_object = context.parse_object - parse_array = context.parse_array - parse_string = context.parse_string - match_number = NUMBER_RE.match - encoding = context.encoding - strict = context.strict - parse_float = context.parse_float - parse_int = context.parse_int - parse_constant = context.parse_constant - object_hook = context.object_hook - - def _scan_once(string, idx): - try: - nextchar = string[idx] - except IndexError: - raise StopIteration - - if nextchar == '"': - return parse_string(string, idx + 1, encoding, strict) - elif nextchar == '{': - return parse_object((string, idx + 1), encoding, strict, _scan_once, object_hook) - elif nextchar == '[': - return parse_array((string, idx + 1), _scan_once) - elif nextchar == 'n' and string[idx:idx + 4] == 'null': - return None, idx + 4 - elif nextchar == 't' and string[idx:idx + 4] == 'true': - return True, idx + 4 - elif nextchar == 'f' and string[idx:idx + 5] == 'false': - return False, idx + 5 - - m = match_number(string, idx) - if m is not None: - integer, frac, exp = m.groups() - if frac or exp: - res = parse_float(integer + (frac or '') + (exp or '')) - else: - res = parse_int(integer) - return res, m.end() - elif nextchar == 'N' and string[idx:idx + 3] == 'NaN': - return parse_constant('NaN'), idx + 3 - elif nextchar == 'I' and string[idx:idx + 8] == 'Infinity': - return parse_constant('Infinity'), idx + 8 - elif nextchar == '-' and string[idx:idx + 9] == '-Infinity': - return parse_constant('-Infinity'), idx + 9 - else: - raise StopIteration - - return _scan_once - -make_scanner = c_make_scanner or py_make_scanner diff --git a/addons/script.module.simplejson/lib/simplejson/tool.py b/addons/script.module.simplejson/lib/simplejson/tool.py deleted file mode 100644 index 90443317b2..0000000000 --- a/addons/script.module.simplejson/lib/simplejson/tool.py +++ /dev/null @@ -1,37 +0,0 @@ -r"""Command-line tool to validate and pretty-print JSON - -Usage:: - - $ echo '{"json":"obj"}' | python -m simplejson.tool - { - "json": "obj" - } - $ echo '{ 1.2:3.4}' | python -m simplejson.tool - Expecting property name: line 1 column 2 (char 2) - -""" -import sys -import simplejson - -def main(): - if len(sys.argv) == 1: - infile = sys.stdin - outfile = sys.stdout - elif len(sys.argv) == 2: - infile = open(sys.argv[1], 'rb') - outfile = sys.stdout - elif len(sys.argv) == 3: - infile = open(sys.argv[1], 'rb') - outfile = open(sys.argv[2], 'wb') - else: - raise SystemExit(sys.argv[0] + " [infile [outfile]]") - try: - obj = simplejson.load(infile) - except ValueError, e: - raise SystemExit(e) - simplejson.dump(obj, outfile, sort_keys=True, indent=4) - outfile.write('\n') - - -if __name__ == '__main__': - main() diff --git a/addons/skin.confluence/720p/MyWeather.xml b/addons/skin.confluence/720p/MyWeather.xml index 76b66834a5..3b6d5bb12c 100644 --- a/addons/skin.confluence/720p/MyWeather.xml +++ b/addons/skin.confluence/720p/MyWeather.xml @@ -97,6 +97,14 @@ <textcolor>white</textcolor> <shadowcolor>black</shadowcolor> </control> + <control type="image"> + <posx>70</posx> + <posy>40</posy> + <width>360</width> + <height>90</height> + <aspectratio align="center" aligny="center">keep</aspectratio> + <texture>$INFO[Window.Property(WeatherProviderLogo)]</texture> + </control> <control type="label"> <description>Provider Text</description> <posx>20</posx> @@ -110,80 +118,84 @@ <aligny>center</aligny> <label>$LOCALIZE[31303] : [COLOR=orange]$INFO[Window.Property(WeatherProvider)][/COLOR]</label> <include>Window_OpenClose_Animation</include> + <visible>IsEmpty(Window.Property(WeatherProviderLogo))</visible> </control> - <control type="label"> - <description>weather location label</description> - <posx>20</posx> - <posy>80</posy> - <width>460</width> - <height>30</height> - <font>font13_title</font> - <textcolor>white</textcolor> - <scroll>false</scroll> - <align>center</align> - <aligny>center</aligny> - <label>$INFO[Window.Property(Location)]</label> - </control> - <control type="label"> - <description>update label</description> - <posx>20</posx> - <posy>100</posy> - <width>460</width> - <height>35</height> - <font>font12</font> - <label>$LOCALIZE[31301] - $INFO[Window.Property(Updated)]</label> - <align>center</align> - <aligny>center</aligny> - <textcolor>grey2</textcolor> - </control> - <control type="label"> - <description>current temp Value</description> - <posx>195</posx> - <posy>175</posy> - <width>180</width> - <height>40</height> - <font>WeatherTemp</font> - <align>right</align> - <aligny>top</aligny> - <label>$INFO[Window.Property(Current.Temperature)]</label> - <textcolor>white</textcolor> - <shadowcolor>black</shadowcolor> - </control> - <control type="label"> - <description>current temp Value Units</description> - <posx>190</posx> - <posy>185</posy> - <width>100</width> - <height>40</height> - <font>font16</font> - <align>left</align> - <aligny>top</aligny> - <label>$INFO[System.TemperatureUnits]</label> - <textcolor>white</textcolor> - <shadowcolor>black</shadowcolor> - </control> - <control type="image"> - <description>current weather icon</description> - <posx>230</posx> - <posy>120</posy> - <width>230</width> - <height>230</height> - <info>Window.Property(Current.ConditionIcon)</info> - <aspectratio>keep</aspectratio> - </control> - <control type="label"> - <description>current condition label</description> - <posx>20</posx> - <posy>320</posy> - <width>460</width> - <height>30</height> - <info>Window.Property(Current.Condition)</info> - <wrapmultiline>true</wrapmultiline> - <font>font13</font> - <align>center</align> - <aligny>center</aligny> - <textcolor>white</textcolor> - <shadowcolor>black</shadowcolor> + <control type="group"> + <animation effect="slide" start="0,0" end="0,30" condition="!IsEmpty(Window.Property(WeatherProviderLogo))">Conditional</animation> + <control type="label"> + <description>weather location label</description> + <posx>20</posx> + <posy>100</posy> + <width>460</width> + <height>30</height> + <font>font13_title</font> + <textcolor>white</textcolor> + <scroll>false</scroll> + <align>center</align> + <aligny>center</aligny> + <label>$INFO[Window.Property(Location)]</label> + </control> + <control type="label"> + <description>update label</description> + <posx>20</posx> + <posy>120</posy> + <width>460</width> + <height>35</height> + <font>font12</font> + <label>$LOCALIZE[31301] - $INFO[Window.Property(Updated)]</label> + <align>center</align> + <aligny>center</aligny> + <textcolor>grey2</textcolor> + </control> + <control type="label"> + <description>current temp Value</description> + <posx>195</posx> + <posy>175</posy> + <width>180</width> + <height>40</height> + <font>WeatherTemp</font> + <align>right</align> + <aligny>top</aligny> + <label>$INFO[Window.Property(Current.Temperature)]</label> + <textcolor>white</textcolor> + <shadowcolor>black</shadowcolor> + </control> + <control type="label"> + <description>current temp Value Units</description> + <posx>190</posx> + <posy>185</posy> + <width>100</width> + <height>40</height> + <font>font16</font> + <align>left</align> + <aligny>top</aligny> + <label>$INFO[System.TemperatureUnits]</label> + <textcolor>white</textcolor> + <shadowcolor>black</shadowcolor> + </control> + <control type="image"> + <description>current weather icon</description> + <posx>230</posx> + <posy>120</posy> + <width>230</width> + <height>230</height> + <info>Window.Property(Current.ConditionIcon)</info> + <aspectratio>keep</aspectratio> + </control> + <control type="label"> + <description>current condition label</description> + <posx>20</posx> + <posy>320</posy> + <width>460</width> + <height>30</height> + <info>Window.Property(Current.Condition)</info> + <wrapmultiline>true</wrapmultiline> + <font>font13</font> + <align>center</align> + <aligny>center</aligny> + <textcolor>white</textcolor> + <shadowcolor>black</shadowcolor> + </control> </control> <control type="image"> <posx>20</posx> diff --git a/configure.in b/configure.in index a9bd5d01c6..6a4e784754 100644 --- a/configure.in +++ b/configure.in @@ -810,7 +810,7 @@ AC_CHECK_SIZEOF([size_t]) # Check for intrinsics AC_MSG_CHECKING([for __sync_add_and_fetch(temp, 1)]) -AC_TRY_COMPILE([],[long* temp=0; __sync_add_and_fetch(temp, 1);], +AC_TRY_LINK([],[long* temp=0; long ret=__sync_add_and_fetch(temp, 1);], [have_builtin_sync_add_and_fetch=yes], [have_builtin_sync_add_and_fetch=no]) AC_MSG_RESULT($have_builtin_sync_add_and_fetch) @@ -820,7 +820,7 @@ if test "x$have_builtin_sync_add_and_fetch" = "xyes"; then fi AC_MSG_CHECKING([for __sync_sub_and_fetch(temp, 1)]) -AC_TRY_COMPILE([],[long* temp=0; __sync_sub_and_fetch(temp, 1);], +AC_TRY_LINK([],[long* temp=0; long ret=__sync_sub_and_fetch(temp, 1);], [have_builtin_sync_sub_and_fetch=yes], [have_builtin_sync_sub_and_fetch=no]) AC_MSG_RESULT($have_builtin_sync_sub_and_fetch) @@ -830,7 +830,7 @@ if test "x$have_builtin_sync_sub_and_fetch" = "xyes"; then fi AC_MSG_CHECKING([for __sync_val_compare_and_swap(temp, 1, 1)]) -AC_TRY_COMPILE([],[long *temp = 0; __sync_val_compare_and_swap(temp, 1, 1);], +AC_TRY_LINK([],[long *temp = 0; long ret=__sync_val_compare_and_swap(temp, 1, 1);], [have_builtin_sync_val_compare_and_swap=yes], [have_builtin_sync_val_compare_and_swap=no]) AC_MSG_RESULT($have_builtin_sync_val_compare_and_swap) diff --git a/lib/asap/win32/build_xbmc_win32.sh b/lib/asap/win32/build_xbmc_win32.sh index 7f3514a562..47d9f01141 100644 --- a/lib/asap/win32/build_xbmc_win32.sh +++ b/lib/asap/win32/build_xbmc_win32.sh @@ -1,6 +1,7 @@ #!/bin/bash MAKEFLAGS="" +BGPROCESSFILE="$2" if [ "$1" == "clean" ] then @@ -12,4 +13,6 @@ fi make $MAKEFLAGS xbmc -cp xbmc_asap.dll /xbmc/system/players/paplayer/
\ No newline at end of file +cp xbmc_asap.dll /xbmc/system/players/paplayer/ +#remove the bgprocessfile for signaling the process end +rm $BGPROCESSFILE
\ No newline at end of file diff --git a/lib/cpluff/libcpluff/win32/dirent.c b/lib/cpluff/libcpluff/win32/dirent.c index db72f39d37..3254b22729 100644 --- a/lib/cpluff/libcpluff/win32/dirent.c +++ b/lib/cpluff/libcpluff/win32/dirent.c @@ -199,6 +199,8 @@ int scandir( ++entries; } + closedir(d); + // sort if (*namelist && compar) qsort(*namelist, entries, sizeof((*namelist)[0]), compar); diff --git a/lib/cximage-6.0/CxImage/ximadsp.cpp b/lib/cximage-6.0/CxImage/ximadsp.cpp index feff6ab867..f54ffd615a 100644 --- a/lib/cximage-6.0/CxImage/ximadsp.cpp +++ b/lib/cximage-6.0/CxImage/ximadsp.cpp @@ -1374,6 +1374,7 @@ bool CxImage::Median(long Ksize) CxImage tmp(*this); if (!tmp.IsValid()){ + free(kernel); strcpy(info.szLastError,tmp.GetLastError()); return false; } @@ -2424,11 +2425,15 @@ bool CxImage::TextBlur(BYTE threshold, BYTE decay, BYTE max_depth, bool bBlurHor pPalette = new RGBQUAD[head.biClrUsed]; memcpy(pPalette, GetPalette(),GetPaletteSize()); if (!IncreaseBpp(24)) + { + delete [] pPalette; return false; + } } CxImage tmp(*this); if (!tmp.IsValid()){ + delete [] pPalette; strcpy(info.szLastError,tmp.GetLastError()); return false; } @@ -2484,12 +2489,16 @@ bool CxImage::GaussianBlur(float radius /*= 1.0f*/, CxImage* iDst /*= 0*/) pPalette = new RGBQUAD[head.biClrUsed]; memcpy(pPalette, GetPalette(),GetPaletteSize()); if (!IncreaseBpp(24)) + { + delete [] pPalette; return false; + } } CxImage tmp_x(*this, false, true, true); if (!tmp_x.IsValid()){ strcpy(info.szLastError,tmp_x.GetLastError()); + delete [] pPalette; return false; } @@ -2508,7 +2517,7 @@ bool CxImage::GaussianBlur(float radius /*= 1.0f*/, CxImage* iDst /*= 0*/) double dbScaler = 50.0f/head.biHeight; // blur the rows - for (y=0;y<head.biHeight;y++) + for (y=0;y<head.biHeight;y++) { if (info.nEscape) break; info.nProgress = (long)(y*dbScaler); @@ -2518,6 +2527,7 @@ bool CxImage::GaussianBlur(float radius /*= 1.0f*/, CxImage* iDst /*= 0*/) CxImage tmp_y(tmp_x, false, true, true); if (!tmp_y.IsValid()){ + delete [] pPalette; strcpy(info.szLastError,tmp_y.GetLastError()); return false; } @@ -2525,8 +2535,8 @@ bool CxImage::GaussianBlur(float radius /*= 1.0f*/, CxImage* iDst /*= 0*/) CImageIterator itDst(&tmp_y); // blur the cols - BYTE* cur_col = (BYTE*)malloc(bypp*head.biHeight); - BYTE* dest_col = (BYTE*)malloc(bypp*head.biHeight); + BYTE* cur_col = (BYTE*)malloc(bypp*head.biHeight); + BYTE* dest_col = (BYTE*)malloc(bypp*head.biHeight); dbScaler = 50.0f/head.biWidth; @@ -2594,11 +2604,15 @@ bool CxImage::SelectiveBlur(float radius, BYTE threshold, CxImage* iDst) pPalette = new RGBQUAD[head.biClrUsed]; memcpy(pPalette, GetPalette(),GetPaletteSize()); if (!Tmp.IncreaseBpp(24)) + { + delete [] pPalette; return false; + } } CxImage Dst(Tmp, true, true, true); if (!Dst.IsValid()){ + delete [] pPalette; strcpy(info.szLastError,Dst.GetLastError()); return false; } @@ -2608,6 +2622,7 @@ bool CxImage::SelectiveBlur(float radius, BYTE threshold, CxImage* iDst) BYTE thresh_up = (BYTE)min(255,(int)(128 + threshold)); long kernel[]={-100,-100,-100,-100,801,-100,-100,-100,-100}; if (!Tmp.Filter(kernel,3,800,128)){ + delete [] pPalette; strcpy(info.szLastError,Tmp.GetLastError()); return false; } @@ -2644,6 +2659,7 @@ bool CxImage::SelectiveBlur(float radius, BYTE threshold, CxImage* iDst) //blur the image (only in the selected pixels) Dst.SelectionCopy(Tmp); if (!Dst.GaussianBlur(radius)){ + delete [] pPalette; strcpy(info.szLastError,Dst.GetLastError()); return false; } @@ -3493,12 +3509,18 @@ bool CxImage::FloodFill(const long xStart, const long yStart, const RGBQUAD cFil pPalette = new RGBQUAD[head.biClrUsed]; memcpy(pPalette, GetPalette(),GetPaletteSize()); if (!IncreaseBpp(24)) + { + delete [] pPalette; return false; + } } BYTE* pFillMask = (BYTE*)calloc(head.biWidth * head.biHeight,1); if (!pFillMask) + { + delete [] pPalette; return false; + } //------------------------------------- Begin of Flood Fill POINT offset[4] = {{-1,0},{0,-1},{1,0},{0,1}}; diff --git a/lib/cximage-6.0/CxImage/ximatif.cpp b/lib/cximage-6.0/CxImage/ximatif.cpp index 0018fa98f2..658392a824 100644 --- a/lib/cximage-6.0/CxImage/ximatif.cpp +++ b/lib/cximage-6.0/CxImage/ximatif.cpp @@ -316,6 +316,7 @@ bool CxImageTIF::Decode(CxFile * hFile) if (info.nEscape){ // <vho> - cancel decoding free(bits); + free(row_shifts); cx_throw("Cancelled"); } @@ -332,6 +333,7 @@ bool CxImageTIF::Decode(CxFile * hFile) if (TIFFReadTile(m_tif, tilebuf, col, ys, 0, 0) < 0){ free(tilebuf); free(bits); + free(row_shifts); cx_throw("Corrupted tiled TIFF file!"); } diff --git a/lib/ffmpeg/build_xbmc_win32.sh b/lib/ffmpeg/build_xbmc_win32.sh index cc5682f9d9..62b16fbfab 100644 --- a/lib/ffmpeg/build_xbmc_win32.sh +++ b/lib/ffmpeg/build_xbmc_win32.sh @@ -1,6 +1,7 @@ #!/bin/bash MAKEFLAGS="" +BGPROCESSFILE="$2" if [ "$1" == "clean" ] then @@ -59,3 +60,7 @@ cp .libs/avfilter-2.dll /xbmc/system/players/dvdplayer/ && cp .libs/postproc-52.dll /xbmc/system/players/dvdplayer/ && cp .libs/swresample-0.dll /xbmc/system/players/dvdplayer/ && cp .libs/swscale-2.dll /xbmc/system/players/dvdplayer/ + +#remove the bgprocessfile for signaling the process end +echo deleting $BGPROCESSFILE +rm $BGPROCESSFILE diff --git a/lib/libdvd/build-xbmc-win32.sh b/lib/libdvd/build-xbmc-win32.sh index e32b81f2fa..f68a975b01 100644 --- a/lib/libdvd/build-xbmc-win32.sh +++ b/lib/libdvd/build-xbmc-win32.sh @@ -2,6 +2,7 @@ MAKECLEAN=0 MAKEFLAGS="" +BGPROCESSFILE=$2 if [ "$1" = "clean" ] then @@ -78,3 +79,5 @@ strip -S obj/libdvdnav.dll cd .. cp libdvdnav/obj/libdvdnav.dll /xbmc/system/players/dvdplayer/ echo "***** Done *****" +#remove the bgprocessfile for signaling the process end +rm $BGPROCESSFILE diff --git a/lib/libmpeg2/make-xbmc-lib-win32.sh b/lib/libmpeg2/make-xbmc-lib-win32.sh index ce54d062b8..10f85f7111 100644 --- a/lib/libmpeg2/make-xbmc-lib-win32.sh +++ b/lib/libmpeg2/make-xbmc-lib-win32.sh @@ -1,6 +1,7 @@ #!/bin/bash MAKEFLAGS="" +BGPROCESSFILE="$2" if [ "$1" == "clean" ] then @@ -27,3 +28,6 @@ make $MAKEFLAGS && strip libmpeg2/.libs/*.dll && cp libmpeg2/.libs/*.dll /xbmc/system/players/dvdplayer/ + +#remove the bgprocessfile for signaling the process end +rm $BGPROCESSFILE
\ No newline at end of file diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list index d20c040f09..d2a00aa2db 100644 --- a/project/BuildDependencies/scripts/0_package.list +++ b/project/BuildDependencies/scripts/0_package.list @@ -7,7 +7,7 @@ ; -> ... doxygen-1.8.2-win32 sqlite-3.7.12.1-win32 -libnfs-1.3.0-win32 +libnfs-1.6.0-win32 libshairplay-d689c6-win32 libjpeg-turbo-1.2.0-win32 libbluray-0.2.3-win32 diff --git a/project/BuildDependencies/scripts/libnfs_d.bat b/project/BuildDependencies/scripts/libnfs_d.bat index a7fdb2a8d8..3b3c44352f 100644 --- a/project/BuildDependencies/scripts/libnfs_d.bat +++ b/project/BuildDependencies/scripts/libnfs_d.bat @@ -7,7 +7,7 @@ CALL dlextract.bat libnfs %FILES% cd %TMP_PATH% -xcopy libnfs-1.3.0-win32\project\BuildDependencies\include\* "%CUR_PATH%\include\" /E /Q /I /Y -copy libnfs-1.3.0-win32\system\libnfs.dll "%XBMC_PATH%\system\" /Y +xcopy libnfs-1.6.1-win32\project\BuildDependencies\include\* "%CUR_PATH%\include\" /E /Q /I /Y +copy libnfs-1.6.1-win32\system\libnfs.dll "%XBMC_PATH%\system\" /Y cd %LOC_PATH% diff --git a/project/BuildDependencies/scripts/libnfs_d.txt b/project/BuildDependencies/scripts/libnfs_d.txt index 58409bba95..eb6914c4ff 100644 --- a/project/BuildDependencies/scripts/libnfs_d.txt +++ b/project/BuildDependencies/scripts/libnfs_d.txt @@ -1,2 +1,2 @@ ; filename source of the file -libnfs-1.3.0-win32.7z http://mirrors.xbmc.org/build-deps/win32/ +libnfs-1.6.1-win32.7z http://mirrors.xbmc.org/build-deps/win32/ diff --git a/project/Win32BuildSetup/BuildSetup.bat b/project/Win32BuildSetup/BuildSetup.bat index b3afd93b09..8f86bffdb8 100644 --- a/project/Win32BuildSetup/BuildSetup.bat +++ b/project/Win32BuildSetup/BuildSetup.bat @@ -1,9 +1,10 @@ @ECHO OFF +SETLOCAL ENABLEDELAYEDEXPANSION rem ----Usage---- rem BuildSetup [gl|dx] [clean|noclean] rem vs2010 for compiling with visual studio 2010 -rem gl for opengl build (default) -rem dx for directx build +rem gl for opengl build +rem dx for directx build (default) rem clean to force a full rebuild rem noclean to force a build without clean rem noprompt to avoid all prompts @@ -24,6 +25,8 @@ SET buildmode=ask SET promptlevel=prompt SET buildmingwlibs=true SET exitcode=0 +SET useshell=rxvt +SET BRANCH=na FOR %%b in (%1, %2, %3, %4, %5) DO ( IF %%b==vs2010 SET comp=vs2010 IF %%b==dx SET target=dx @@ -32,18 +35,36 @@ FOR %%b in (%1, %2, %3, %4, %5) DO ( IF %%b==noclean SET buildmode=noclean IF %%b==noprompt SET promptlevel=noprompt IF %%b==nomingwlibs SET buildmingwlibs=false + IF %%b==sh SET useshell=sh ) SET buildconfig=Release (DirectX) IF %target%==gl SET buildconfig=Release (OpenGL) IF %comp%==vs2010 ( - IF "%VS100COMNTOOLS%"=="" ( - set NET="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" - ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" ( - set NET="%VS100COMNTOOLS%\..\IDE\VCExpress.exe" - ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" ( - set NET="%VS100COMNTOOLS%\..\IDE\devenv.exe" + REM look for MSBuild.exe in .NET Framework 4.x + FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET NET=%%AMSBuild.exe + IF NOT EXIST "!NET!" ( + FOR /F "tokens=3* delims= " %%A IN ('REG QUERY HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath') DO SET NET=%%AMSBuild.exe + ) + + IF EXIST "!NET!" ( + set msbuildemitsolution=1 + set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Build /p:Configuration="%buildconfig%" + set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /t:Clean /p:Configuration="%buildconfig%" + ) ELSE ( + IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.com" ( + set NET="%VS100COMNTOOLS%\..\IDE\devenv.com" + ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\devenv.exe" ( + set NET="%VS100COMNTOOLS%\..\IDE\devenv.exe" + ) ELSE IF "%VS100COMNTOOLS%"=="" ( + set NET="%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\VCExpress.exe" + ) ELSE IF EXIST "%VS100COMNTOOLS%\..\IDE\VCExpress.exe" ( + set NET="%VS100COMNTOOLS%\..\IDE\VCExpress.exe" + ) + + set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /build "%buildconfig%" + set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /clean "%buildconfig%" ) ) @@ -52,9 +73,11 @@ IF %comp%==vs2010 ( goto DIE ) - set OPTS_EXE="..\VS2010Express\XBMC for Windows.sln" /build "%buildconfig%" - set CLEAN_EXE="..\VS2010Express\XBMC for Windows.sln" /clean "%buildconfig%" set EXE= "..\VS2010Express\XBMC\%buildconfig%\XBMC.exe" + set PDB= "..\VS2010Express\XBMC\%buildconfig%\XBMC.pdb" + + :: sets the BRANCH env var + call getbranch.bat rem CONFIG END rem ------------------------------------------------------------- @@ -109,9 +132,9 @@ IF %comp%==vs2010 ( ECHO ------------------------------------------------------------ ECHO Cleaning Solution... %NET% %CLEAN_EXE% - ECHO Compiling XBMC... + ECHO Compiling XBMC branch %BRANCH%... %NET% %OPTS_EXE% - IF NOT EXIST %EXE% ( + IF %errorlevel%==1 ( set DIETEXT="XBMC.EXE failed to build! See %CD%\..\vs2010express\XBMC\%buildconfig%\objs\XBMC.log" IF %promptlevel%==noprompt ( type "%CD%\..\vs2010express\XBMC\%buildconfig%\objs\XBMC.log" @@ -126,9 +149,9 @@ IF %comp%==vs2010 ( :COMPILE_NO_CLEAN_EXE ECHO Wait while preparing the build. ECHO ------------------------------------------------------------ - ECHO Compiling Solution... + ECHO Compiling XBMC branch %BRANCH%... %NET% %OPTS_EXE% - IF NOT EXIST %EXE% ( + IF %errorlevel%==1 ( set DIETEXT="XBMC.EXE failed to build! See %CD%\..\vs2010express\XBMC\%buildconfig%\objs\XBMC.log" IF %promptlevel%==noprompt ( type "%CD%\..\vs2010express\XBMC\%buildconfig%\objs\XBMC.log" @@ -147,7 +170,12 @@ IF %comp%==vs2010 ( IF %buildmode%==clean ( ECHO bla>makeclean ) - call buildmingwlibs.bat + rem only use sh to please jenkins + IF %useshell%==sh ( + call buildmingwlibs.bat sh + ) ELSE ( + call buildmingwlibs.bat + ) IF EXIST errormingw ( set DIETEXT="failed to build mingw libs" goto DIE @@ -232,7 +260,8 @@ IF %comp%==vs2010 ( ECHO ------------------------------------------------------------ call getdeploydependencies.bat CALL extract_git_rev.bat > NUL - SET XBMC_SETUPFILE=XBMCSetup-%GIT_REV%-%target%.exe + SET XBMC_SETUPFILE=XBMCSetup-%GIT_REV%-%BRANCH%.exe + SET XBMC_PDBFILE=XBMCSetup-%GIT_REV%-%BRANCH%.pdb ECHO Creating installer %XBMC_SETUPFILE%... IF EXIST %XBMC_SETUPFILE% del %XBMC_SETUPFILE% > NUL rem get path to makensis.exe from registry, first try tab delim @@ -271,11 +300,12 @@ IF %comp%==vs2010 ( ) SET NSISExe=%NSISExePath%\makensis.exe - "%NSISExe%" /V1 /X"SetCompressor /FINAL lzma" /Dxbmc_root="%CD%\BUILD_WIN32" /Dxbmc_revision="%GIT_REV%" /Dxbmc_target="%target%" "XBMC for Windows.nsi" + "%NSISExe%" /V1 /X"SetCompressor /FINAL lzma" /Dxbmc_root="%CD%\BUILD_WIN32" /Dxbmc_revision="%GIT_REV%" /Dxbmc_target="%target%" /Dxbmc_branch="%BRANCH%" "XBMC for Windows.nsi" IF NOT EXIST "%XBMC_SETUPFILE%" ( set DIETEXT=Failed to create %XBMC_SETUPFILE%. NSIS installed? goto DIE ) + copy %PDB% %XBMC_PDBFILE% > nul ECHO ------------------------------------------------------------ ECHO Done! ECHO Setup is located at %CD%\%XBMC_SETUPFILE% @@ -291,6 +321,7 @@ IF %comp%==vs2010 ( echo %DIETEXT% SET exitcode=1 ECHO ------------------------------------------------------------ + GOTO END :VIEWLOG_EXE SET log="%CD%\..\vs2010express\XBMC\%buildconfig%\objs\XBMC.log" diff --git a/project/Win32BuildSetup/XBMC for Windows.nsi b/project/Win32BuildSetup/XBMC for Windows.nsi index 7af23dfd73..2dd377d21f 100644 --- a/project/Win32BuildSetup/XBMC for Windows.nsi +++ b/project/Win32BuildSetup/XBMC for Windows.nsi @@ -15,7 +15,7 @@ ;Name and file Name "XBMC" - OutFile "XBMCSetup-${xbmc_revision}-${xbmc_target}.exe" + OutFile "XBMCSetup-${xbmc_revision}-${xbmc_branch}.exe" XPStyle on diff --git a/project/Win32BuildSetup/buildmingwlibs.bat b/project/Win32BuildSetup/buildmingwlibs.bat index 2e6206a32c..2bf4313d60 100644 --- a/project/Win32BuildSetup/buildmingwlibs.bat +++ b/project/Win32BuildSetup/buildmingwlibs.bat @@ -4,11 +4,29 @@ rem batch file to compile mingw libs via BuildSetup rem set M$ env call "%VS100COMNTOOLS%..\..\VC\bin\vcvars32.bat" -rem check for mingw env -IF EXIST ..\BuildDependencies\msys\bin\sh.exe ( - rem compiles a bunch of mingw libs and not more +SET opt=sh +IF $%1$==$$ SET opt=rxvt + +rem compiles a bunch of mingw libs and not more +IF %opt%==sh ( + IF EXIST ..\BuildDependencies\msys\bin\sh.exe ( + ECHO starting sh shell + ..\BuildDependencies\msys\bin\sh --login /xbmc/project/Win32BuildSetup/buildmingwlibs.sh + GOTO END + ) ELSE ( + GOTO ENDWITHERROR + ) +) +IF EXIST ..\BuildDependencies\msys\bin\rxvt.exe ( + ECHO starting rxvt shell ..\BuildDependencies\msys\bin\rxvt -backspacekey -sl 2500 -sr -fn Courier-12 -tn msys -geometry 120x25 -title "building mingw dlls" -e /bin/sh --login /xbmc/project/Win32BuildSetup/buildmingwlibs.sh -) ELSE ( + GOTO END +) +GOTO ENDWITHERROR + +:ENDWITHERROR ECHO bla>errormingw - ECHO mingw environment not found -)
\ No newline at end of file + ECHO msys environment not found + +:END + ECHO exiting msys environment
\ No newline at end of file diff --git a/project/Win32BuildSetup/buildmingwlibs.sh b/project/Win32BuildSetup/buildmingwlibs.sh index 6fdb9a521f..cdf9641637 100644 --- a/project/Win32BuildSetup/buildmingwlibs.sh +++ b/project/Win32BuildSetup/buildmingwlibs.sh @@ -2,6 +2,7 @@ ERRORFILE=/xbmc/project/Win32BuildSetup/errormingw NOPFILE=/xbmc/project/Win32BuildSetup/noprompt MAKECLEANFILE=/xbmc/project/Win32BuildSetup/makeclean +BGPROCESSFILE=/xbmc/project/Win32BuildSetup/bgprocess TOUCH=/bin/touch RM=/bin/rm NOPROMPT=0 @@ -33,6 +34,20 @@ function checkfiles () done } +function runBackgroundProcess () +{ + #start the process backgrounded + $TOUCH $BGPROCESSFILE + echo "backgrounding: sh $1 $BGPROCESSFILE & (workdir: $(PWD))" + sh $1 $BGPROCESSFILE & + echo "waiting on bgprocess..." + while [ -f $BGPROCESSFILE ]; do + echo -n "." + sleep 5 + done + echo "done" +} + # cleanup if [ -f $ERRORFILE ]; then $RM $ERRORFILE @@ -47,6 +62,8 @@ fi if [ -f $MAKECLEANFILE ]; then $RM $MAKECLEANFILE MAKECLEAN="clean" +else + MAKECLEAN="noclean" fi if [ $NUMBER_OF_PROCESSORS > 1 ]; then @@ -62,21 +79,21 @@ echo "################################" echo "##### building ffmpeg dlls #####" cd /xbmc/lib/ffmpeg/ -sh ./build_xbmc_win32.sh $MAKECLEAN +runBackgroundProcess "./build_xbmc_win32.sh $MAKECLEAN" setfilepath /xbmc/system/players/dvdplayer checkfiles avcodec-53.dll avformat-53.dll avutil-51.dll postproc-52.dll swscale-2.dll avfilter-2.dll swresample-0.dll echo "##### building of ffmpeg dlls done #####" echo "##### building libdvd dlls #####" cd /xbmc/lib/libdvd/ -sh ./build-xbmc-win32.sh $MAKECLEAN +runBackgroundProcess "./build-xbmc-win32.sh $MAKECLEAN" setfilepath /xbmc/system/players/dvdplayer checkfiles libdvdcss-2.dll libdvdnav.dll echo "##### building of libdvd dlls done #####" echo "##### building libmpeg2 dlls #####" cd /xbmc/lib/libmpeg2/ -sh ./make-xbmc-lib-win32.sh $MAKECLEAN +runBackgroundProcess "./make-xbmc-lib-win32.sh $MAKECLEAN" setfilepath /xbmc/system/players/dvdplayer checkfiles libmpeg2-0.dll echo "##### building of libmpeg2 dlls done #####" @@ -93,7 +110,7 @@ echo "##### building of timidity dlls done #####" echo "##### building asap dlls #####" cd /xbmc/lib/asap/win32 -sh ./build_xbmc_win32.sh $MAKECLEAN +runBackgroundProcess "./build_xbmc_win32.sh $MAKECLEAN" setfilepath /xbmc/system/players/paplayer checkfiles xbmc_asap.dll echo "##### building of asap dlls done #####" diff --git a/project/Win32BuildSetup/buildpvraddons.bat b/project/Win32BuildSetup/buildpvraddons.bat index 18609bac9a..7453f1e712 100644 --- a/project/Win32BuildSetup/buildpvraddons.bat +++ b/project/Win32BuildSetup/buildpvraddons.bat @@ -9,13 +9,18 @@ SET DEPS_DIR=..\BuildDependencies SET TMP_DIR=%DEPS_DIR%\tmp SET LIBNAME=xbmc-pvr-addons -SET VERSION=590f862065d0f07d399fe4443a72dc37394becb4 +SET VERSION=56a77af4e56da9a2658b3748d19bc2db9c491791 SET SOURCE=%LIBNAME% SET GIT_URL=git://github.com/opdenkamp/%LIBNAME%.git SET SOURCE_DIR=%TMP_DIR%\%SOURCE% SET BUILT_ADDONS_DIR=%SOURCE_DIR%\addons -set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /build Release +REM check if MSBuild.exe is used because it requires different command line switches +IF "%msbuildemitsolution%" == "1" ( + set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /t:Build /p:Configuration="Release" +) ELSE ( + set OPTS_EXE=%SOURCE_DIR%\project\VS2010Express\xbmc-pvr-addons.sln /build Release +) REM Try wrapped msysgit - must be in the path SET GITEXE=git.cmd diff --git a/project/Win32BuildSetup/getbranch.bat b/project/Win32BuildSetup/getbranch.bat new file mode 100644 index 0000000000..f1a2b97712 --- /dev/null +++ b/project/Win32BuildSetup/getbranch.bat @@ -0,0 +1,48 @@ +@echo off +rem this gets the current branch from either the branchname (if we attached) or +rem by using scientific branch fetching algorithms [tm] git is in detached HEAD state +rem result will be in env var %BRANCH% +SET BRANCH=na +SET DETACHED=1 +:: detect detached head +git symbolic-ref HEAD >nul 2>&1 +IF %ERRORLEVEL%==0 ( + SET DETACHED=0 +) +rem find the branchname - if current branch is a pr we have to take this into account aswell +rem (would be refs/pulls/pr/number/head then) +rem normal branch would be refs/heads/branchname +IF %DETACHED%==0 ( + FOR /f "tokens=3,4 delims=/" %%a IN ('git symbolic-ref HEAD') DO ( + IF %%a==pr ( + SET BRANCH=PR%%b + ) ELSE ( + SET BRANCH=%%a + ) + ) + GOTO branchfound +) + +:: when building with jenkins there's no branch. First git command gets the branch even there +:: it ignores all branches in the pr/ scope (pull requests) and finds the first non pr branch +:: (this mimics what the linux side does via sed and head -n1 +:: but is empty in a normal build environment. Second git command gets the branch there. +FOR /f "tokens=2,3 delims=/" %%a IN ('git branch -r --contains HEAD') DO ( + :: ignore pull requests + IF NOT %%a==pr ( + rem our branch could be like origin/Frodo (we need %%a here) + rem or our branch could be like origin/HEAD -> origin/master (we need %%b here) + rem if we have %%b - use it - else use %%a + IF NOT "%%b"=="" ( + :: we found the first non-pullrequest branch - gotcha + SET BRANCH=%%b + ) ELSE ( + SET BRANCH=%%a + ) + GOTO branchfound + ) +) +IF "%BRANCH%"=="na" ( + FOR /f "tokens=* delims= " %%a IN ('git rev-parse --abbrev-ref HEAD') DO SET BRANCH=%%a +) +:branchfound diff --git a/tools/android/depends/libnfs/Makefile b/tools/android/depends/libnfs/Makefile index e14f99c440..8a99d68018 100644 --- a/tools/android/depends/libnfs/Makefile +++ b/tools/android/depends/libnfs/Makefile @@ -3,7 +3,7 @@ DEPS= ../Makefile.include Makefile # lib name, version LIBNAME=libnfs -VERSION=1.5.0 +VERSION=1.6.0 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz @@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) -rm -rf $(PLATFORM); mkdir -p $(PLATFORM) $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); ./bootstrap + cd $(PLATFORM); patch -p0 < ../timeval.patch cd $(PLATFORM); $(CONFIGURE) $(LIBDYLIB): $(PLATFORM) @@ -31,7 +32,7 @@ $(LIBDYLIB): $(PLATFORM) .installed-$(PLATFORM): $(LIBDYLIB) $(MAKE) -C $(PLATFORM) install rm -f $(PREFIX)/lib/libnfs.la $(PREFIX)/lib/libnfs.so $(PREFIX)/lib/libnfs.so.1 - mv -f $(PREFIX)/lib/libnfs.so.1.0.5 $(PREFIX)/lib/libnfs.so + mv -f $(PREFIX)/lib/libnfs.so.1.0.6 $(PREFIX)/lib/libnfs.so $(RPL) -e "libnfs.so.1" "libnfs.so\x00\x00" $(PREFIX)/lib/libnfs.so -$(READELF) --dynamic $(PREFIX)/lib/libnfs.so | grep ibrary touch $@ diff --git a/tools/android/depends/libnfs/timeval.patch b/tools/android/depends/libnfs/timeval.patch new file mode 100644 index 0000000000..7f453d6c6f --- /dev/null +++ b/tools/android/depends/libnfs/timeval.patch @@ -0,0 +1,15 @@ +--- include/nfsc/libnfs.h.orig 2013-05-28 21:59:32.000000000 +0200 ++++ include/nfsc/libnfs.h 2013-05-28 21:59:56.000000000 +0200 +@@ -18,12 +18,7 @@ + * This is the highlevel interface to access NFS resources using a posix-like interface + */ + #include <stdint.h> +-#if defined(ANDROID) + #include <sys/time.h> +-#endif +-#if defined(AROS) +-#include <sys/time.h> +-#endif + + struct nfs_context; + struct rpc_context; diff --git a/tools/android/depends/xbmc-pvr-addons/Makefile b/tools/android/depends/xbmc-pvr-addons/Makefile index 6228d7cf95..c56aa74a26 100644 --- a/tools/android/depends/xbmc-pvr-addons/Makefile +++ b/tools/android/depends/xbmc-pvr-addons/Makefile @@ -2,7 +2,7 @@ include ../Makefile.include DEPS= ../Makefile.include Makefile LIBNAME=xbmc-pvr-addons -VERSION=590f862065d0f07d399fe4443a72dc37394becb4 +VERSION=56a77af4e56da9a2658b3748d19bc2db9c491791 GIT_DIR=$(TARBALLS_LOCATION)/$(LIBNAME).git BASE_URL=git://github.com/opdenkamp/$(LIBNAME).git DYLIB=$(PLATFORM)/addons/pvr.demo/.libs/libpvrdemo-addon.so diff --git a/tools/buildsteps/win32/prepare-env.bat b/tools/buildsteps/win32/prepare-env.bat new file mode 100644 index 0000000000..c55b667d9f --- /dev/null +++ b/tools/buildsteps/win32/prepare-env.bat @@ -0,0 +1,24 @@ +@ECHO OFF + +ECHO Workspace is %WORKSPACE% + +rem git clean the untracked files but not the directories +rem to keep the downloaded dependencies +rem we assume git in path as this is a requirement + +cd %WORKSPACE% +ECHO running git clean -xf +git clean -xf + +rem cleaning additional directories +ECHO delete build directories +IF EXIST %WORKSPACE%\project\Win32BuildSetup\BUILD_WIN32 rmdir %WORKSPACE%\project\Win32BuildSetup\BUILD_WIN32 /S /Q +IF EXIST %WORKSPACE%\project\Win32BuildSetup\dependencies rmdir %WORKSPACE%\project\Win32BuildSetup\dependencies /S /Q + +IF EXIST %WORKSPACE%\project\BuildDependencies\include rmdir %WORKSPACE%\project\BuildDependencies\include /S /Q +IF EXIST %WORKSPACE%\project\BuildDependencies\lib rmdir %WORKSPACE%\project\BuildDependencies\lib /S /Q +IF EXIST %WORKSPACE%\project\BuildDependencies\msys rmdir %WORKSPACE%\project\BuildDependencies\msys /S /Q + +IF EXIST %WORKSPACE%\project\VS2010Express\XBMC rmdir %WORKSPACE%\project\VS2010Express\XBMC /S /Q +IF EXIST %WORKSPACE%\project\VS2010Express\objs rmdir %WORKSPACE%\project\VS2010Express\objs /S /Q +IF EXIST %WORKSPACE%\project\VS2010Express\libs rmdir %WORKSPACE%\project\VS2010Express\libs /S /Q
\ No newline at end of file diff --git a/tools/darwin/depends/libnfs/Makefile b/tools/darwin/depends/libnfs/Makefile index aff0aeff66..7349d4bc58 100644 --- a/tools/darwin/depends/libnfs/Makefile +++ b/tools/darwin/depends/libnfs/Makefile @@ -3,15 +3,13 @@ include ../config.site.mk # lib name, version LIBNAME=libnfs -VERSION=1.3.0 +VERSION=1.6.0 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz # configuration settings CONFIGURE=./configure --prefix=$(PREFIX) -RPC_HEADERS=rpcinc/auth.h rpcinc/auth_unix.h rpcinc/clnt.h rpcinc/pmap_clnt.h rpcinc/pmap_prot.h rpcinc/pmap_rmt.h rpcinc/rpc.h rpcinc/rpc_msg.h rpcinc/svc.h rpcinc/svc_auth.h rpcinc/types.h rpcinc/xdr.h - LIBDYLIB=$(SOURCE)/lib/$(DYLIBNAME) CLEAN_FILES=$(ARCHIVE) $(SOURCE) @@ -26,8 +24,8 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE) $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) echo $(SOURCE) > .gitignore mkdir -p $(PREFIX)/include/rpc - install -c -m 644 $(RPC_HEADERS) $(PREFIX)/include/rpc/ cd $(SOURCE); ./bootstrap + cd $(SOURCE); patch -p0 < ../timeval.patch cd $(SOURCE); $(CONFIGURE) $(LIBDYLIB): $(SOURCE) diff --git a/tools/darwin/depends/libnfs/rpcinc/auth.h b/tools/darwin/depends/libnfs/rpcinc/auth.h deleted file mode 100644 index 97a289c821..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/auth.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)auth.h 1.17 88/02/08 SMI - * from: @(#)auth.h 2.3 88/08/07 4.0 RPCSRC - * $Id: auth.h,v 1.4 2004/11/25 19:41:19 emoy Exp $ - */ - -/* - * auth.h, Authentication interface. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * The data structures are completely opaque to the client. The client - * is required to pass a AUTH * to routines that create rpc - * "sessions". - */ - -#ifndef _RPC_AUTH_H -#define _RPC_AUTH_H -#include <sys/cdefs.h> - -#define MAX_AUTH_BYTES 400 -#define MAXNETNAMELEN 255 /* maximum length of network user's name */ - -/* - * Status returned from authentication check - */ -enum auth_stat { - AUTH_OK=0, - /* - * failed at remote end - */ - AUTH_BADCRED=1, /* bogus credentials (seal broken) */ - AUTH_REJECTEDCRED=2, /* client should begin new session */ - AUTH_BADVERF=3, /* bogus verifier (seal broken) */ - AUTH_REJECTEDVERF=4, /* verifier expired or was replayed */ - AUTH_TOOWEAK=5, /* rejected due to security reasons */ - /* - * failed locally - */ - AUTH_INVALIDRESP=6, /* bogus response verifier */ - AUTH_FAILED=7 /* some unknown reason */ -}; - -/* 32-bit unsigned integers */ -#ifdef __LP64__ -typedef unsigned int u_int32; -#else -typedef unsigned long u_int32; -#endif - -union des_block { - struct { - u_int32 high; - u_int32 low; - } key; - char c[8]; -}; -typedef union des_block des_block; -__BEGIN_DECLS -extern bool_t xdr_des_block __P((XDR *, des_block *)); -__END_DECLS - -/* - * Authentication info. Opaque to client. - */ -struct opaque_auth { - enum_t oa_flavor; /* flavor of auth */ - caddr_t oa_base; /* address of more auth stuff */ - unsigned int oa_length; /* not to exceed MAX_AUTH_BYTES */ -}; - - -/* - * Auth handle, interface to client side authenticators. - */ -struct AUTH{ - struct opaque_auth ah_cred; - struct opaque_auth ah_verf; - union des_block ah_key; - struct auth_ops { -#ifdef __cplusplus - void (*ah_nextverf)(...); - int (*ah_marshal)(...); /* nextverf & serialize */ - int (*ah_validate)(...); /* validate varifier */ - int (*ah_refresh)(...); /* refresh credentials */ - void (*ah_destroy)(...); /* destroy this structure */ -#else - /* DO NOT REMOVE THE COMMENTED OUT ...: fixincludes needs to see them */ - void (*ah_nextverf)(/*...*/); - int (*ah_marshal)(/*...*/); /* nextverf & serialize */ - int (*ah_validate)(/*...*/); /* validate varifier */ - int (*ah_refresh)(/*...*/); /* refresh credentials */ - void (*ah_destroy)(/*...*/); /* destroy this structure */ -#endif - } *ah_ops; - caddr_t ah_private; -}; -typedef struct AUTH AUTH; - - -/* - * Authentication ops. - * The ops and the auth handle provide the interface to the authenticators. - * - * AUTH *auth; - * XDR *xdrs; - * struct opaque_auth verf; - */ -#define AUTH_NEXTVERF(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) -#define auth_nextverf(auth) \ - ((*((auth)->ah_ops->ah_nextverf))(auth)) - -#define AUTH_MARSHALL(auth, xdrs) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) -#define auth_marshall(auth, xdrs) \ - ((*((auth)->ah_ops->ah_marshal))(auth, xdrs)) - -#define AUTH_VALIDATE(auth, verfp) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp)) -#define auth_validate(auth, verfp) \ - ((*((auth)->ah_ops->ah_validate))((auth), verfp)) - -#define AUTH_REFRESH(auth) \ - ((*((auth)->ah_ops->ah_refresh))(auth)) -#define auth_refresh(auth) \ - ((*((auth)->ah_ops->ah_refresh))(auth)) - -#define AUTH_DESTROY(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) -#define auth_destroy(auth) \ - ((*((auth)->ah_ops->ah_destroy))(auth)) - - -extern struct opaque_auth _null_auth; - - -/* - * These are the various implementations of client side authenticators. - */ - -/* - * Unix style authentication - * AUTH *authunix_create(machname, uid, gid, len, aup_gids) - * char *machname; - * int uid; - * int gid; - * int len; - * int *aup_gids; - */ -__BEGIN_DECLS -extern AUTH *authunix_create __P((char *, int, int, int, int *)); -extern AUTH *authunix_create_default __P((void)); -extern AUTH *authnone_create __P((void)); -extern AUTH *authdes_create __P((char *, unsigned int, - struct sockaddr_in *, - des_block *)); -__END_DECLS - -#define AUTH_NONE 0 /* no authentication */ -#define AUTH_NULL 0 /* backward compatibility */ -#define AUTH_UNIX 1 /* unix style (uid, gids) */ -#define AUTH_SHORT 2 /* short hand unix style */ -#define AUTH_DES 3 /* des style (encrypted timestamps) */ - -#endif /* !_RPC_AUTH_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/auth_unix.h b/tools/darwin/depends/libnfs/rpcinc/auth_unix.h deleted file mode 100644 index 496defb79a..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/auth_unix.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)auth_unix.h 1.8 88/02/08 SMI - * from: @(#)auth_unix.h 2.2 88/07/29 4.0 RPCSRC - * $Id: auth_unix.h,v 1.4 2004/10/28 21:58:21 emoy Exp $ - */ - -/* - * auth_unix.h, Protocol for UNIX style authentication parameters for RPC - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -/* - * The system is very weak. The client uses no encryption for it - * credentials and only sends null verifiers. The server sends backs - * null verifiers or optionally a verifier that suggests a new short hand - * for the credentials. - */ - -#ifndef _RPC_AUTH_UNIX_H -#define _RPC_AUTH_UNIX_H -#include <sys/cdefs.h> - -/* The machine name is part of a credential; it may not exceed 255 bytes */ -#define MAX_MACHINE_NAME 255 - -/* - * Unix style credentials. - */ -struct authunix_parms { -#ifdef __LP64__ - unsigned int aup_time; -#else - unsigned long aup_time; -#endif - char *aup_machname; - int aup_uid; - int aup_gid; - unsigned int aup_len; - int *aup_gids; -}; - -__BEGIN_DECLS -extern bool_t xdr_authunix_parms __P((XDR *, struct authunix_parms *)); -__END_DECLS - -/* - * If a response verifier has flavor AUTH_SHORT, - * then the body of the response verifier encapsulates the following structure; - * again it is serialized in the obvious fashion. - */ -struct short_hand_verf { - struct opaque_auth new_cred; -}; - -#endif /* !_RPC_AUTH_UNIX_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/clnt.h b/tools/darwin/depends/libnfs/rpcinc/clnt.h deleted file mode 100644 index 4ed9b51bf3..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/clnt.h +++ /dev/null @@ -1,445 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)clnt.h 1.31 88/02/08 SMI - * from: @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC - * $Id: clnt.h,v 1.4 2004/10/28 21:58:22 emoy Exp $ - */ - -/* - * clnt.h - Client side remote procedure call interface. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -#ifndef _RPC_CLNT_H_ -#define _RPC_CLNT_H_ -#include <sys/cdefs.h> - -/* - * Rpc calls return an enum clnt_stat. This should be looked at more, - * since each implementation is required to live with this (implementation - * independent) list of errors. - */ - -/* Avoid collision with mach definition */ -#if defined(RPC_SUCCESS) -#undef RPC_SUCCESS -#endif - -enum clnt_stat { - RPC_SUCCESS=0, /* call succeeded */ - /* - * local errors - */ - RPC_CANTENCODEARGS=1, /* can't encode arguments */ - RPC_CANTDECODERES=2, /* can't decode results */ - RPC_CANTSEND=3, /* failure in sending call */ - RPC_CANTRECV=4, /* failure in receiving result */ - RPC_TIMEDOUT=5, /* call timed out */ - /* - * remote errors - */ - RPC_VERSMISMATCH=6, /* rpc versions not compatible */ - RPC_AUTHERROR=7, /* authentication error */ - RPC_PROGUNAVAIL=8, /* program not available */ - RPC_PROGVERSMISMATCH=9, /* program version mismatched */ - RPC_PROCUNAVAIL=10, /* procedure unavailable */ - RPC_CANTDECODEARGS=11, /* decode arguments error */ - RPC_SYSTEMERROR=12, /* generic "other problem" */ - - /* - * callrpc & clnt_create errors - */ - RPC_UNKNOWNHOST=13, /* unknown host name */ - RPC_UNKNOWNPROTO=17, /* unkown protocol */ - - /* - * _ create errors - */ - RPC_PMAPFAILURE=14, /* the pmapper failed in its call */ - RPC_PROGNOTREGISTERED=15, /* remote program is not registered */ - /* - * unspecified error - */ - RPC_FAILED=16 -}; - - -/* - * Error info. - */ -struct rpc_err { - enum clnt_stat re_status; - union { - int RE_errno; /* realated system error */ - enum auth_stat RE_why; /* why the auth error occurred */ - struct { -#ifdef __LP64__ - unsigned int low; /* lowest verion supported */ - unsigned int high; /* highest verion supported */ -#else - unsigned long low; /* lowest verion supported */ - unsigned long high; /* highest verion supported */ -#endif - } RE_vers; - struct { /* maybe meaningful if RPC_FAILED */ -#ifdef __LP64__ - int s1; - int s2; -#else - long s1; - long s2; -#endif - } RE_lb; /* life boot & debugging only */ - } ru; -#define re_errno ru.RE_errno -#define re_why ru.RE_why -#define re_vers ru.RE_vers -#define re_lb ru.RE_lb -}; - - -/* - * Client rpc handle. - * Created by individual implementations, see e.g. rpc_udp.c. - * Client is responsible for initializing auth, see e.g. auth_none.c. - */ -typedef struct CLIENT CLIENT; -struct CLIENT -{ - AUTH *cl_auth; /* authenticator */ - struct clnt_ops { -#ifdef __LP64__ - enum clnt_stat (*cl_call)(CLIENT *, unsigned int, xdrproc_t, void *, xdrproc_t, void *, struct timeval); /* call remote procedure */ -#else - enum clnt_stat (*cl_call)(CLIENT *, unsigned long, xdrproc_t, void *, xdrproc_t, void *, struct timeval); /* call remote procedure */ -#endif - void (*cl_abort)(void); /* abort a call */ - void (*cl_geterr)(CLIENT *, struct rpc_err *); /* get specific error code */ - bool_t (*cl_freeres)(CLIENT *, xdrproc_t, void *); /* frees results */ - void (*cl_destroy)(CLIENT *); /* destroy this structure */ - bool_t (*cl_control)(CLIENT *, int, char *); /* the ioctl() of rpc */ - } *cl_ops; - caddr_t cl_private; /* private stuff */ -}; - -/* - * client side rpc interface ops - * - * Parameter types are: - * - */ - -/* - * enum clnt_stat - * CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout) - * CLIENT *rh; - * u_long proc; - * xdrproc_t xargs; - * caddr_t argsp; - * xdrproc_t xres; - * caddr_t resp; - * struct timeval timeout; - */ -#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) -#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \ - ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs)) - -/* - * void - * CLNT_ABORT(rh); - * CLIENT *rh; - */ -#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh)) -#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh)) - -/* - * struct rpc_err - * CLNT_GETERR(rh); - * CLIENT *rh; - */ -#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) -#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp)) - - -/* - * bool_t - * CLNT_FREERES(rh, xres, resp); - * CLIENT *rh; - * xdrproc_t xres; - * caddr_t resp; - */ -#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) -#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp)) - -/* - * bool_t - * CLNT_CONTROL(cl, request, info) - * CLIENT *cl; - * unsigned int request; - * char *info; - */ -#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) -#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in)) - -/* - * control operations that apply to both udp and tcp transports - */ -#define CLSET_TIMEOUT 1 /* set timeout (timeval) */ -#define CLGET_TIMEOUT 2 /* get timeout (timeval) */ -#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */ -/* - * udp only control operations - */ -#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */ -#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */ - -/* - * void - * CLNT_DESTROY(rh); - * CLIENT *rh; - */ -#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) -#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh)) - - -/* - * RPCTEST is a test program which is accessable on every rpc - * transport/port. It is used for testing, performance evaluation, - * and network administration. - */ - -#ifdef __LP64__ -#define RPCTEST_PROGRAM ((unsigned int)1) -#define RPCTEST_VERSION ((unsigned int)1) -#define RPCTEST_NULL_PROC ((unsigned int)2) -#define RPCTEST_NULL_BATCH_PROC ((unsigned int)3) -#else -#define RPCTEST_PROGRAM ((unsigned long)1) -#define RPCTEST_VERSION ((unsigned long)1) -#define RPCTEST_NULL_PROC ((unsigned long)2) -#define RPCTEST_NULL_BATCH_PROC ((unsigned long)3) -#endif - -/* - * By convention, procedure 0 takes null arguments and returns them - */ - -#ifdef __LP64__ -#define NULLPROC ((unsigned int)0) -#else -#define NULLPROC ((unsigned long)0) -#endif - -/* - * Below are the client handle creation routines for the various - * implementations of client side rpc. They can return NULL if a - * creation failure occurs. - */ - -/* - * Memory based rpc (for speed check and testing) - * CLIENT * - * clntraw_create(prog, vers) - * u_long prog; - * u_long vers; - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern CLIENT *clntraw_create __P((unsigned int, unsigned int)); -#else -extern CLIENT *clntraw_create __P((unsigned long, unsigned long)); -#endif -__END_DECLS - - -/* - * Generic client creation routine. Supported protocols are "udp" and "tcp" - * CLIENT * - * clnt_create(host, prog, vers, prot); - * char *host; -- hostname - * u_long prog; -- program number - * u_long vers; -- version number - * char *prot; -- protocol - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern CLIENT *clnt_create __P((char *, unsigned int, unsigned int, char *)); -#else -extern CLIENT *clnt_create __P((char *, unsigned long, unsigned long, char *)); -#endif -__END_DECLS - - -/* - * TCP based rpc - * CLIENT * - * clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) - * struct sockaddr_in *raddr; - * u_long prog; - * u_long version; - * register int *sockp; - * unsigned int sendsz; - * unsigned int recvsz; - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern CLIENT *clnttcp_create __P((struct sockaddr_in *, - unsigned int, - unsigned int, - int *, - unsigned int, - unsigned int)); -#else -extern CLIENT *clnttcp_create __P((struct sockaddr_in *, - unsigned long, - unsigned long, - int *, - unsigned int, - unsigned int)); -#endif -__END_DECLS - - -/* - * UDP based rpc. - * CLIENT * - * clntudp_create(raddr, program, version, wait, sockp) - * struct sockaddr_in *raddr; - * u_long program; - * u_long version; - * struct timeval wait; - * int *sockp; - * - * Same as above, but you specify max packet sizes. - * CLIENT * - * clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) - * struct sockaddr_in *raddr; - * u_long program; - * u_long version; - * struct timeval wait; - * int *sockp; - * unsigned int sendsz; - * unsigned int recvsz; - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern CLIENT *clntudp_create __P((struct sockaddr_in *, - unsigned int, - unsigned int, - struct timeval, - int *)); -extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *, - unsigned int, - unsigned int, - struct timeval, - int *, - unsigned int, - unsigned int)); -#else -extern CLIENT *clntudp_create __P((struct sockaddr_in *, - unsigned long, - unsigned long, - struct timeval, - int *)); -extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *, - unsigned long, - unsigned long, - struct timeval, - int *, - unsigned int, - unsigned int)); -#endif -__END_DECLS - - -/* - * Print why creation failed - */ -__BEGIN_DECLS -extern void clnt_pcreateerror __P((char *)); /* stderr */ -extern char *clnt_spcreateerror __P((char *)); /* string */ -__END_DECLS - -/* - * Like clnt_perror(), but is more verbose in its output - */ -__BEGIN_DECLS -extern void clnt_perrno __P((enum clnt_stat)); /* stderr */ -extern char *clnt_sperrno __P((enum clnt_stat)); /* string */ -__END_DECLS - -/* - * Print an English error message, given the client error code - */ -__BEGIN_DECLS -extern void clnt_perror __P((CLIENT *, char *)); /* stderr */ -extern char *clnt_sperror __P((CLIENT *, char *)); /* string */ -__END_DECLS - - -/* - * If a creation fails, the following allows the user to figure out why. - */ -struct rpc_createerr { - enum clnt_stat cf_stat; - struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */ -}; - -extern struct rpc_createerr rpc_createerr; - - -#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */ -#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */ - -#endif /* !_RPC_CLNT_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h b/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h deleted file mode 100644 index c07a81902b..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/pmap_clnt.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)pmap_clnt.h 1.11 88/02/08 SMI - * from: @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC - * $Id: pmap_clnt.h,v 1.3 2004/10/28 21:58:22 emoy Exp $ - */ - -/* - * pmap_clnt.h - * Supplies C routines to get to portmap services. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -/* - * Usage: - * success = pmap_set(program, version, protocol, port); - * success = pmap_unset(program, version); - * port = pmap_getport(address, program, version, protocol); - * head = pmap_getmaps(address); - * clnt_stat = pmap_rmtcall(address, program, version, procedure, - * xdrargs, argsp, xdrres, resp, tout, port_ptr) - * (works for udp only.) - * clnt_stat = clnt_broadcast(program, version, procedure, - * xdrargs, argsp, xdrres, resp, eachresult) - * (like pmap_rmtcall, except the call is broadcasted to all - * locally connected nets. For each valid response received, - * the procedure eachresult is called. Its form is: - * done = eachresult(resp, raddr) - * bool_t done; - * caddr_t resp; - * struct sockaddr_in raddr; - * where resp points to the results of the call and raddr is the - * address if the responder to the broadcast. - */ - -#ifndef _RPC_PMAPCLNT_H -#define _RPC_PMAPCLNT_H -#include <sys/cdefs.h> - -__BEGIN_DECLS -#ifdef __LP64__ -extern bool_t pmap_set __P((unsigned int, unsigned int, int, int)); -extern bool_t pmap_unset __P((unsigned int, unsigned int)); -extern enum clnt_stat pmap_rmtcall __P((struct sockaddr_in *, - unsigned int, unsigned int, unsigned int, - xdrproc_t, caddr_t, - xdrproc_t, caddr_t, - struct timeval, unsigned int *)); -extern enum clnt_stat clnt_broadcast __P((unsigned int, unsigned int, unsigned int, - xdrproc_t, char *, - xdrproc_t, char *, - bool_t (*)())); -extern unsigned short pmap_getport __P((struct sockaddr_in *, - unsigned int, unsigned int, unsigned int)); -#else -extern bool_t pmap_set __P((unsigned long, unsigned long, int, int)); -extern bool_t pmap_unset __P((unsigned long, unsigned long)); -extern enum clnt_stat pmap_rmtcall __P((struct sockaddr_in *, - unsigned long, unsigned long, unsigned long, - xdrproc_t, caddr_t, - xdrproc_t, caddr_t, - struct timeval, unsigned long *)); -extern enum clnt_stat clnt_broadcast __P((unsigned long, unsigned long, unsigned long, - xdrproc_t, char *, - xdrproc_t, char *, - bool_t (*)())); -extern unsigned short pmap_getport __P((struct sockaddr_in *, - unsigned long, unsigned long, unsigned int)); -#endif -extern struct pmaplist *pmap_getmaps __P((struct sockaddr_in *)); -extern int getrpcport __P((char *, int, int, int)); -__END_DECLS - -#endif /* !_RPC_PMAPCLNT_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h b/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h deleted file mode 100644 index c5dc139e41..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/pmap_prot.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)pmap_prot.h 1.14 88/02/08 SMI - * from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC - * $Id: pmap_prot.h,v 1.3 2004/10/28 21:58:22 emoy Exp $ - */ - -/* - * pmap_prot.h - * Protocol for the local binder service, or pmap. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * The following procedures are supported by the protocol: - * - * PMAPPROC_NULL() returns () - * takes nothing, returns nothing - * - * PMAPPROC_SET(struct pmap) returns (bool_t) - * TRUE is success, FALSE is failure. Registers the tuple - * [prog, vers, prot, port]. - * - * PMAPPROC_UNSET(struct pmap) returns (bool_t) - * TRUE is success, FALSE is failure. Un-registers pair - * [prog, vers]. prot and port are ignored. - * - * PMAPPROC_GETPORT(struct pmap) returns (long unsigned). - * 0 is failure. Otherwise returns the port number where the pair - * [prog, vers] is registered. It may lie! - * - * PMAPPROC_DUMP() RETURNS (struct pmaplist *) - * - * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>) - * RETURNS (port, string<>); - * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs); - * Calls the procedure on the local machine. If it is not registered, - * this procedure is quite; ie it does not return error information!!! - * This procedure only is supported on rpc/udp and calls via - * rpc/udp. This routine only passes null authentication parameters. - * This file has no interface to xdr routines for PMAPPROC_CALLIT. - * - * The service supports remote procedure calls on udp/ip or tcp/ip socket 111. - */ - -#ifndef _RPC_PMAPPROT_H -#define _RPC_PMAPPROT_H -#include <sys/cdefs.h> - -#define PMAPPORT ((unsigned short)111) -#ifdef __LP64__ -#define PMAPPROG ((unsigned int)100000) -#define PMAPVERS ((unsigned int)2) -#define PMAPVERS_PROTO ((unsigned int)2) -#define PMAPVERS_ORIG ((unsigned int)1) -#define PMAPPROC_NULL ((unsigned int)0) -#define PMAPPROC_SET ((unsigned int)1) -#define PMAPPROC_UNSET ((unsigned int)2) -#define PMAPPROC_GETPORT ((unsigned int)3) -#define PMAPPROC_DUMP ((unsigned int)4) -#define PMAPPROC_CALLIT ((unsigned int)5) -#else -#define PMAPPROG ((unsigned long)100000) -#define PMAPVERS ((unsigned long)2) -#define PMAPVERS_PROTO ((unsigned long)2) -#define PMAPVERS_ORIG ((unsigned long)1) -#define PMAPPROC_NULL ((unsigned long)0) -#define PMAPPROC_SET ((unsigned long)1) -#define PMAPPROC_UNSET ((unsigned long)2) -#define PMAPPROC_GETPORT ((unsigned long)3) -#define PMAPPROC_DUMP ((unsigned long)4) -#define PMAPPROC_CALLIT ((unsigned long)5) -#endif - -struct pmap { -#ifdef __LP64__ - unsigned int pm_prog; - unsigned int pm_vers; - unsigned int pm_prot; - unsigned int pm_port; -#else - long unsigned pm_prog; - long unsigned pm_vers; - long unsigned pm_prot; - long unsigned pm_port; -#endif -}; - -struct pmaplist { - struct pmap pml_map; - struct pmaplist *pml_next; -}; - -__BEGIN_DECLS -extern bool_t xdr_pmap __P((XDR *, struct pmap *)); -extern bool_t xdr_pmaplist __P((XDR *, struct pmaplist **)); -__END_DECLS - -#endif /* !_RPC_PMAPPROT_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h b/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h deleted file mode 100644 index 9ffbd1cb45..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/pmap_rmt.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)pmap_rmt.h 1.2 88/02/08 SMI - * from: @(#)pmap_rmt.h 2.1 88/07/29 4.0 RPCSRC - * $Id: pmap_rmt.h,v 1.3 2004/10/28 21:58:23 emoy Exp $ - */ - -/* - * Structures and XDR routines for parameters to and replies from - * the portmapper remote-call-service. - * - * Copyright (C) 1986, Sun Microsystems, Inc. - */ - -#ifndef _RPC_PMAPRMT_H -#define _RPC_PMAPRMT_H -#include <sys/cdefs.h> - -struct rmtcallargs { -#ifdef __LP64__ - unsigned int prog, vers, proc, arglen; -#else - unsigned long prog, vers, proc, arglen; -#endif - caddr_t args_ptr; - xdrproc_t xdr_args; -}; - -struct rmtcallres { -#ifdef __LP64__ - unsigned int *port_ptr; - unsigned int resultslen; -#else - unsigned long *port_ptr; - unsigned long resultslen; -#endif - caddr_t results_ptr; - xdrproc_t xdr_results; -}; - -__BEGIN_DECLS -extern bool_t xdr_rmtcall_args __P((XDR *, struct rmtcallargs *)); -extern bool_t xdr_rmtcallres __P((XDR *, struct rmtcallres *)); -__END_DECLS - -#endif /* !_RPC_PMAPRMT_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/rpc.h b/tools/darwin/depends/libnfs/rpcinc/rpc.h deleted file mode 100644 index da89dff563..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/rpc.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)rpc.h 1.9 88/02/08 SMI - * from: @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC - * $Id: rpc.h,v 1.2 1999/10/14 21:56:53 wsanchez Exp $ - */ - -/* - * rpc.h, Just includes the billions of rpc header files necessary to - * do remote procedure calling. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ -#ifndef _RPC_RPC_H -#define _RPC_RPC_H - -#include <rpc/types.h> /* some typedefs */ -#include <netinet/in.h> - -/* external data representation interfaces */ -#include <rpc/xdr.h> /* generic (de)serializer */ - -/* Client side only authentication */ -#include <rpc/auth.h> /* generic authenticator (client side) */ - -/* Client side (mostly) remote procedure call */ -#include <rpc/clnt.h> /* generic rpc stuff */ - -/* semi-private protocol headers */ -#include <rpc/rpc_msg.h> /* protocol for rpc messages */ -#include <rpc/auth_unix.h> /* protocol for unix style cred */ -/* - * Uncomment-out the next line if you are building the rpc library with - * DES Authentication (see the README file in the secure_rpc/ directory). - */ -/*#include <rpc/auth_des.h> protocol for des style cred */ - -/* Server side only remote procedure callee */ -#include <rpc/svc.h> /* service manager and multiplexer */ -#include <rpc/svc_auth.h> /* service side authenticator */ - -#include <netdb.h> - -#endif /* !_RPC_RPC_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h b/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h deleted file mode 100644 index ec2d929c61..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/rpc_msg.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)rpc_msg.h 1.7 86/07/16 SMI - * from: @(#)rpc_msg.h 2.1 88/07/29 4.0 RPCSRC - * $Id: rpc_msg.h,v 1.3 2004/10/28 21:58:24 emoy Exp $ - */ - -/* - * rpc_msg.h - * rpc message definition - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -#ifndef _RPC_RPCMSG_H -#define _RPC_RPCMSG_H - -#ifdef __LP64__ -#define RPC_MSG_VERSION ((unsigned int) 2) -#else -#define RPC_MSG_VERSION ((unsigned long) 2) -#endif -#define RPC_SERVICE_PORT ((unsigned short) 2048) - -/* - * Bottom up definition of an rpc message. - * NOTE: call and reply use the same overall stuct but - * different parts of unions within it. - */ - -enum msg_type { - CALL=0, - REPLY=1 -}; - -enum reply_stat { - MSG_ACCEPTED=0, - MSG_DENIED=1 -}; - -enum accept_stat { - SUCCESS=0, - PROG_UNAVAIL=1, - PROG_MISMATCH=2, - PROC_UNAVAIL=3, - GARBAGE_ARGS=4, - SYSTEM_ERR=5 -}; - -enum reject_stat { - RPC_MISMATCH=0, - AUTH_ERROR=1 -}; - -/* - * Reply part of an rpc exchange - */ - -/* - * Reply to an rpc request that was accepted by the server. - * Note: there could be an error even though the request was - * accepted. - */ -struct accepted_reply { - struct opaque_auth ar_verf; - enum accept_stat ar_stat; - union { - struct { -#ifdef __LP64__ - unsigned int low; - unsigned int high; -#else - unsigned long low; - unsigned long high; -#endif - } AR_versions; - struct { - caddr_t where; - xdrproc_t proc; - } AR_results; - /* and many other null cases */ - } ru; -#define ar_results ru.AR_results -#define ar_vers ru.AR_versions -}; - -/* - * Reply to an rpc request that was rejected by the server. - */ -struct rejected_reply { - enum reject_stat rj_stat; - union { - struct { -#ifdef __LP64__ - unsigned int low; - unsigned int high; -#else - unsigned long low; - unsigned long high; -#endif - } RJ_versions; - enum auth_stat RJ_why; /* why authentication did not work */ - } ru; -#define rj_vers ru.RJ_versions -#define rj_why ru.RJ_why -}; - -/* - * Body of a reply to an rpc request. - */ -struct reply_body { - enum reply_stat rp_stat; - union { - struct accepted_reply RP_ar; - struct rejected_reply RP_dr; - } ru; -#define rp_acpt ru.RP_ar -#define rp_rjct ru.RP_dr -}; - -/* - * Body of an rpc request call. - */ -struct call_body { -#ifdef __LP64__ - unsigned int cb_rpcvers; /* must be equal to two */ - unsigned int cb_prog; - unsigned int cb_vers; - unsigned int cb_proc; -#else - unsigned long cb_rpcvers; /* must be equal to two */ - unsigned long cb_prog; - unsigned long cb_vers; - unsigned long cb_proc; -#endif - struct opaque_auth cb_cred; - struct opaque_auth cb_verf; /* protocol specific - provided by client */ -}; - -/* - * The rpc message - */ -struct rpc_msg { -#ifdef __LP64__ - unsigned int rm_xid; -#else - unsigned long rm_xid; -#endif - enum msg_type rm_direction; - union { - struct call_body RM_cmb; - struct reply_body RM_rmb; - } ru; -#define rm_call ru.RM_cmb -#define rm_reply ru.RM_rmb -}; -#define acpted_rply ru.RM_rmb.ru.RP_ar -#define rjcted_rply ru.RM_rmb.ru.RP_dr - -__BEGIN_DECLS -/* - * XDR routine to handle a rpc message. - * xdr_callmsg(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; - */ -extern bool_t xdr_callmsg __P((XDR *, struct rpc_msg *)); - -/* - * XDR routine to pre-serialize the static part of a rpc message. - * xdr_callhdr(xdrs, cmsg) - * XDR *xdrs; - * struct rpc_msg *cmsg; - */ -extern bool_t xdr_callhdr __P((XDR *, struct rpc_msg *)); - -/* - * XDR routine to handle a rpc reply. - * xdr_replymsg(xdrs, rmsg) - * XDR *xdrs; - * struct rpc_msg *rmsg; - */ -extern bool_t xdr_replymsg __P((XDR *, struct rpc_msg *)); - -/* - * Fills in the error part of a reply message. - * _seterr_reply(msg, error) - * struct rpc_msg *msg; - * struct rpc_err *error; - */ -extern void _seterr_reply __P((struct rpc_msg *, struct rpc_err *)); -__END_DECLS - -#endif /* !_RPC_RPCMSG_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/svc.h b/tools/darwin/depends/libnfs/rpcinc/svc.h deleted file mode 100644 index d671045f17..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/svc.h +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)svc.h 1.20 88/02/08 SMI - * from: @(#)svc.h 2.2 88/07/29 4.0 RPCSRC - * $Id: svc.h,v 1.4 2004/11/25 19:41:19 emoy Exp $ - */ - -/* - * svc.h, Server-side remote procedure call interface. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -#ifndef _RPC_SVC_H -#define _RPC_SVC_H -#include <sys/cdefs.h> - -/* - * This interface must manage two items concerning remote procedure calling: - * - * 1) An arbitrary number of transport connections upon which rpc requests - * are received. The two most notable transports are TCP and UDP; they are - * created and registered by routines in svc_tcp.c and svc_udp.c, respectively; - * they in turn call xprt_register and xprt_unregister. - * - * 2) An arbitrary number of locally registered services. Services are - * described by the following four data: program number, version number, - * "service dispatch" function, a transport handle, and a boolean that - * indicates whether or not the exported program should be registered with a - * local binder service; if true the program's number and version and the - * port number from the transport handle are registered with the binder. - * These data are registered with the rpc svc system via svc_register. - * - * A service's dispatch function is called whenever an rpc request comes in - * on a transport. The request's program and version numbers must match - * those of the registered service. The dispatch function is passed two - * parameters, struct svc_req * and SVCXPRT *, defined below. - */ - -enum xprt_stat { - XPRT_DIED, - XPRT_MOREREQS, - XPRT_IDLE -}; - -/* - * Server side transport handle - */ -typedef struct { - int xp_sock; - unsigned short xp_port; /* associated port number */ - struct xp_ops { -#ifdef __cplusplus - bool_t (*xp_recv)(...); /* receive incomming requests */ - enum xprt_stat (*xp_stat)(...); /* get transport status */ - bool_t (*xp_getargs)(...); /* get arguments */ - bool_t (*xp_reply)(...); /* send reply */ - bool_t (*xp_freeargs)(...);/* free mem allocated for args */ - void (*xp_destroy)(...); /* destroy this struct */ -#else - /* DO NOT REMOVE THE COMMENTED OUT ...: fixincludes needs to see them */ - bool_t (*xp_recv)(/*...*/); /* receive incomming requests */ - enum xprt_stat (*xp_stat)(/*...*/); /* get transport status */ - bool_t (*xp_getargs)(/*...*/); /* get arguments */ - bool_t (*xp_reply)(/*...*/); /* send reply */ - bool_t (*xp_freeargs)(/*...*/);/* free mem allocated for args */ - void (*xp_destroy)(/*...*/); /* destroy this struct */ -#endif - } *xp_ops; - int xp_addrlen; /* length of remote address */ - struct sockaddr_in xp_raddr; /* remote address */ - struct opaque_auth xp_verf; /* raw response verifier */ - caddr_t xp_p1; /* private */ - caddr_t xp_p2; /* private */ -} SVCXPRT; - -/* - * Approved way of getting address of caller - */ -#define svc_getcaller(x) (&(x)->xp_raddr) - -/* - * Operations defined on an SVCXPRT handle - * - * SVCXPRT *xprt; - * struct rpc_msg *msg; - * xdrproc_t xargs; - * caddr_t argsp; - */ -#define SVC_RECV(xprt, msg) \ - (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) -#define svc_recv(xprt, msg) \ - (*(xprt)->xp_ops->xp_recv)((xprt), (msg)) - -#define SVC_STAT(xprt) \ - (*(xprt)->xp_ops->xp_stat)(xprt) -#define svc_stat(xprt) \ - (*(xprt)->xp_ops->xp_stat)(xprt) - -#define SVC_GETARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) -#define svc_getargs(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_getargs)((xprt), (xargs), (argsp)) - -#define SVC_REPLY(xprt, msg) \ - (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) -#define svc_reply(xprt, msg) \ - (*(xprt)->xp_ops->xp_reply) ((xprt), (msg)) - -#define SVC_FREEARGS(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) -#define svc_freeargs(xprt, xargs, argsp) \ - (*(xprt)->xp_ops->xp_freeargs)((xprt), (xargs), (argsp)) - -#define SVC_DESTROY(xprt) \ - (*(xprt)->xp_ops->xp_destroy)(xprt) -#define svc_destroy(xprt) \ - (*(xprt)->xp_ops->xp_destroy)(xprt) - - -/* - * Service request - */ -struct svc_req { -#ifdef __LP64__ - unsigned int rq_prog; /* service program number */ - unsigned int rq_vers; /* service protocol version */ - unsigned int rq_proc; /* the desired procedure */ -#else - unsigned long rq_prog; /* service program number */ - unsigned long rq_vers; /* service protocol version */ - unsigned long rq_proc; /* the desired procedure */ -#endif - struct opaque_auth rq_cred; /* raw creds from the wire */ - caddr_t rq_clntcred; /* read only cooked cred */ - SVCXPRT *rq_xprt; /* associated transport */ -}; - - -/* - * Service registration - * - * svc_register(xprt, prog, vers, dispatch, protocol) - * SVCXPRT *xprt; - * u_long prog; - * u_long vers; - * void (*dispatch)(...); // fixincludes needs the ..., even in a comment - * int protocol; like TCP or UDP, zero means do not register - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern bool_t svc_register __P((SVCXPRT *, unsigned int, unsigned int, void (*)(), int)); -#else -extern bool_t svc_register __P((SVCXPRT *, unsigned long, unsigned long, void (*)(), int)); -#endif -__END_DECLS - -/* - * Service un-registration - * - * svc_unregister(prog, vers) - * u_long prog; - * u_long vers; - */ -__BEGIN_DECLS -#ifdef __LP64__ -extern void svc_unregister __P((unsigned int, unsigned int)); -#else -extern void svc_unregister __P((unsigned long, unsigned long)); -#endif -__END_DECLS - -/* - * Transport registration. - * - * xprt_register(xprt) - * SVCXPRT *xprt; - */ -__BEGIN_DECLS -extern void xprt_register __P((SVCXPRT *)); -__END_DECLS - -/* - * Transport un-register - * - * xprt_unregister(xprt) - * SVCXPRT *xprt; - */ -__BEGIN_DECLS -extern void xprt_unregister __P((SVCXPRT *)); -__END_DECLS - - - - -/* - * When the service routine is called, it must first check to see if it - * knows about the procedure; if not, it should call svcerr_noproc - * and return. If so, it should deserialize its arguments via - * SVC_GETARGS (defined above). If the deserialization does not work, - * svcerr_decode should be called followed by a return. Successful - * decoding of the arguments should be followed the execution of the - * procedure's code and a call to svc_sendreply. - * - * Also, if the service refuses to execute the procedure due to too- - * weak authentication parameters, svcerr_weakauth should be called. - * Note: do not confuse access-control failure with weak authentication! - * - * NB: In pure implementations of rpc, the caller always waits for a reply - * msg. This message is sent when svc_sendreply is called. - * Therefore pure service implementations should always call - * svc_sendreply even if the function logically returns void; use - * xdr.h - xdr_void for the xdr routine. HOWEVER, tcp based rpc allows - * for the abuse of pure rpc via batched calling or pipelining. In the - * case of a batched call, svc_sendreply should NOT be called since - * this would send a return message, which is what batching tries to avoid. - * It is the service/protocol writer's responsibility to know which calls are - * batched and which are not. Warning: responding to batch calls may - * deadlock the caller and server processes! - */ - -__BEGIN_DECLS -extern bool_t svc_sendreply __P((SVCXPRT *, xdrproc_t, char *)); -extern void svcerr_decode __P((SVCXPRT *)); -extern void svcerr_weakauth __P((SVCXPRT *)); -extern void svcerr_noproc __P((SVCXPRT *)); -#ifdef __LP64__ -extern void svcerr_progvers __P((SVCXPRT *, unsigned int, unsigned int)); -#else -extern void svcerr_progvers __P((SVCXPRT *, unsigned long, unsigned long)); -#endif -extern void svcerr_auth __P((SVCXPRT *, enum auth_stat)); -extern void svcerr_noprog __P((SVCXPRT *)); -extern void svcerr_systemerr __P((SVCXPRT *)); -__END_DECLS - -/* - * Lowest level dispatching -OR- who owns this process anyway. - * Somebody has to wait for incoming requests and then call the correct - * service routine. The routine svc_run does infinite waiting; i.e., - * svc_run never returns. - * Since another (co-existant) package may wish to selectively wait for - * incoming calls or other events outside of the rpc architecture, the - * routine svc_getreq is provided. It must be passed readfds, the - * "in-place" results of a select system call (see select, section 2). - */ - -/* - * Global keeper of rpc service descriptors in use - * dynamic; must be inspected before each call to select - */ -#ifdef FD_SETSIZE -extern fd_set svc_fdset; -#define svc_fds svc_fdset.fds_bits[0] /* compatibility */ -#else -extern int svc_fds; -#endif /* def FD_SETSIZE */ - -/* - * a small program implemented by the svc_rpc implementation itself; - * also see clnt.h for protocol numbers. - */ -extern void rpctest_service(); - -__BEGIN_DECLS -extern void svc_getreq __P((int)); -extern void svc_getreqset __P((fd_set *)); -extern void svc_run __P((void)); -__END_DECLS - -/* - * Socket to use on svcxxx_create call to get default socket - */ -#define RPC_ANYSOCK -1 - -/* - * These are the existing service side transport implementations - */ - -/* - * Memory based rpc for testing and timing. - */ -__BEGIN_DECLS -extern SVCXPRT *svcraw_create __P((void)); -__END_DECLS - - -/* - * Udp based rpc. - */ -__BEGIN_DECLS -extern SVCXPRT *svcudp_create __P((int)); -extern SVCXPRT *svcudp_bufcreate __P((int, unsigned int, unsigned int)); -__END_DECLS - - -/* - * Tcp based rpc. - */ -__BEGIN_DECLS -extern SVCXPRT *svctcp_create __P((int, unsigned int, unsigned int)); -__END_DECLS - -/* - * Any open file descriptor based rpc. - */ -__BEGIN_DECLS -extern SVCXPRT *svcfd_create __P((int, u_int, u_int)); -__END_DECLS - -#endif /* !_RPC_SVC_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/svc_auth.h b/tools/darwin/depends/libnfs/rpcinc/svc_auth.h deleted file mode 100644 index 3dc09591f2..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/svc_auth.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)svc_auth.h 1.6 86/07/16 SMI - * from: @(#)svc_auth.h 2.1 88/07/29 4.0 RPCSRC - * $Id: svc_auth.h,v 1.2 1999/10/14 21:56:54 wsanchez Exp $ - */ - -/* - * svc_auth.h, Service side of rpc authentication. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -#ifndef _RPC_SVCAUTH_H -#define _RPC_SVCAUTH_H - -/* - * Server side authenticator - */ -__BEGIN_DECLS -extern enum auth_stat _authenticate __P((struct svc_req *, struct rpc_msg *)); -__END_DECLS - -#endif /* !_RPC_SVCAUTH_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/types.h b/tools/darwin/depends/libnfs/rpcinc/types.h deleted file mode 100644 index 0fe5adc1c0..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/types.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)types.h 1.18 87/07/24 SMI - * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC - * $Id: types.h,v 1.4 2003/10/16 22:15:15 majka Exp $ - */ - -/* - * Rpc additions to <sys/types.h> - */ -#ifndef _RPC_TYPES_H -#define _RPC_TYPES_H - -#define bool_t int -#define enum_t int -#define __dontcare__ -1 - -#ifndef FALSE -# define FALSE (0) -#endif -#ifndef TRUE -# define TRUE (1) -#endif - -#ifndef NULL -#ifdef __GNUG__ -#define NULL __null -#else /* ! __GNUG__ */ -#ifndef __cplusplus -#define NULL ((void *)0) -#else /* __cplusplus */ -#define NULL 0 -#endif /* ! __cplusplus */ -#endif /* __GNUG__ */ -#endif /* ! NULL */ - -#define mem_alloc(bsize) calloc(1, bsize) -#define mem_free(ptr, bsize) free(ptr) - -#ifndef makedev /* ie, we haven't already included it */ -#include <sys/types.h> -#endif -#include <sys/time.h> - -#ifdef __LP64__ -typedef int rpc_int; -typedef unsigned int rpc_uint; -#else -typedef long rpc_int; -typedef unsigned long rpc_uint; -#endif - -#endif /* !_RPC_TYPES_H */ diff --git a/tools/darwin/depends/libnfs/rpcinc/xdr.h b/tools/darwin/depends/libnfs/rpcinc/xdr.h deleted file mode 100644 index 9492ccfbbf..0000000000 --- a/tools/darwin/depends/libnfs/rpcinc/xdr.h +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights - * Reserved. This file contains Original Code and/or Modifications of - * Original Code as defined in and that are subject to the Apple Public - * Source License Version 1.1 (the "License"). You may not use this file - * except in compliance with the License. Please obtain a copy of the - * License at http://www.apple.com/publicsource and read it before using - * this file. - * - * The Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)xdr.h 1.19 87/04/22 SMI - * from: @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC - * $FreeBSD: src/include/rpc/xdr.h,v 1.23 2003/03/07 13:19:40 nectar Exp $ - */ - -/* - * xdr.h, External Data Representation Serialization Routines. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -#ifndef _RPC_XDR_H -#define _RPC_XDR_H -#include <sys/cdefs.h> - -/* - * XDR provides a conventional way for converting between C data - * types and an external bit-string representation. Library supplied - * routines provide for the conversion on built-in C data types. These - * routines and utility routines defined here are used to help implement - * a type encode/decode routine for each user-defined type. - * - * Each data type provides a single procedure which takes two arguments: - * - * bool_t - * xdrproc(xdrs, argresp) - * XDR *xdrs; - * <type> *argresp; - * - * xdrs is an instance of a XDR handle, to which or from which the data - * type is to be converted. argresp is a pointer to the structure to be - * converted. The XDR handle contains an operation field which indicates - * which of the operations (ENCODE, DECODE * or FREE) is to be performed. - * - * XDR_DECODE may allocate space if the pointer argresp is null. This - * data can be freed with the XDR_FREE operation. - * - * We write only one procedure per data type to make it easy - * to keep the encode and decode procedures for a data type consistent. - * In many cases the same code performs all operations on a user defined type, - * because all the hard work is done in the component type routines. - * decode as a series of calls on the nested data types. - */ - -/* - * Xdr operations. XDR_ENCODE causes the type to be encoded into the - * stream. XDR_DECODE causes the type to be extracted from the stream. - * XDR_FREE can be used to release the space allocated by an XDR_DECODE - * request. - */ -enum xdr_op { - XDR_ENCODE=0, - XDR_DECODE=1, - XDR_FREE=2 -}; - -/* - * This is the number of bytes per unit of external data. - */ -#define BYTES_PER_XDR_UNIT (4) -#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ - * BYTES_PER_XDR_UNIT) - -/* - * The XDR handle. - * Contains operation which is being applied to the stream, - * an operations vector for the particular implementation (e.g. see xdr_mem.c), - * and two private fields for the use of the particular implementation. - */ -typedef struct __rpc_xdr { - enum xdr_op x_op; /* operation; fast additional param */ - const struct xdr_ops { -#ifdef __LP64__ - /* get an int from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, int *); - /* put an int to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const int *); -#else - /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); - /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); -#endif - /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, unsigned int); - /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, unsigned int); - /* returns bytes off from beginning */ - unsigned int (*x_getpostn)(struct __rpc_xdr *); - /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, unsigned int); - /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, unsigned int); - /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); - } *x_ops; - char * x_public; /* users' data */ - void * x_private; /* pointer to private data */ - char * x_base; /* private used for position info */ - unsigned int x_handy; /* extra private word */ -} XDR; - -/* - * A xdrproc_t exists for each data type which is to be encoded or decoded. - * - * The second argument to the xdrproc_t is a pointer to an opaque pointer. - * The opaque pointer generally points to a structure of the data type - * to be decoded. If this pointer is 0, then the type routines should - * allocate dynamic storage of the appropriate size and return it. - */ -#ifdef _KERNEL -typedef bool_t (*xdrproc_t)(XDR *, void *, unsigned int); -#else -/* - * XXX can't actually prototype it, because some take three args!!! - */ -typedef bool_t (*xdrproc_t)(XDR *, ...); -#endif - -/* - * Operations defined on a XDR handle - * - * XDR *xdrs; - * long *longp; - * char * addr; - * unsigned int len; - * unsigned int pos; - */ -#define XDR_GETLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) -#define xdr_getlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) - -#define XDR_PUTLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) -#define xdr_putlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) - - -#ifdef __LP64__ -static __inline int -xdr_getint32(XDR *xdrs, int32_t *ip) -{ - int32_t l; - - if (!xdr_getlong(xdrs, &l)) - return (FALSE); - *ip = l; - return (TRUE); -} - -static __inline int -xdr_putint32(XDR *xdrs, int32_t *ip) -{ - int32_t l; - - l = *ip; - return xdr_putlong(xdrs, &l); -} -#else -static __inline int -xdr_getint32(XDR *xdrs, int32_t *ip) -{ - int32_t l; - - if (!xdr_getlong(xdrs, (long *)&l)) - return (FALSE); - *ip = l; - return (TRUE); -} - -static __inline int -xdr_putint32(XDR *xdrs, int32_t *ip) -{ - int32_t l; - - l = *ip; - return xdr_putlong(xdrs, (long *)&l); -} -#endif - -#define XDR_GETINT32(xdrs, int32p) xdr_getint32(xdrs, int32p) -#define XDR_PUTINT32(xdrs, int32p) xdr_putint32(xdrs, int32p) - -#define XDR_GETBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) -#define xdr_getbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) - -#define XDR_PUTBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) -#define xdr_putbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) - -#define XDR_GETPOS(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) -#define xdr_getpos(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) - -#define XDR_SETPOS(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) -#define xdr_setpos(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) - -#define XDR_INLINE(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) -#define xdr_inline(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) - -#define XDR_DESTROY(xdrs) \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs) -#define xdr_destroy(xdrs) \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs) - -#define XDR_CONTROL(xdrs, req, op) \ - if ((xdrs)->x_ops->x_control) \ - (*(xdrs)->x_ops->x_control)(xdrs, req, op) -#define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op) - -/* - * Solaris strips the '_t' from these types -- not sure why. - * But, let's be compatible. - */ -#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp) -#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp) -#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp) -#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp) -#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp) - -/* - * Support struct for discriminated unions. - * You create an array of xdrdiscrim structures, terminated with - * an entry with a null procedure pointer. The xdr_union routine gets - * the discriminant value and then searches the array of structures - * for a matching value. If a match is found the associated xdr routine - * is called to handle that part of the union. If there is - * no match, then a default routine may be called. - * If there is no match and no default routine it is an error. - */ -#define NULL_xdrproc_t ((xdrproc_t)0) -struct xdr_discrim { - int value; - xdrproc_t proc; -}; - -/* - * In-line routines for fast encode/decode of primitive data types. - * Caveat emptor: these use single memory cycles to get the - * data from the underlying buffer, and will fail to operate - * properly if the data is not aligned. The standard way to use these - * is to say: - * if ((buf = XDR_INLINE(xdrs, count)) == NULL) - * return (FALSE); - * <<< macro calls >>> - * where ``count'' is the number of bytes of data occupied - * by the primitive data types. - * - * N.B. and frozen for all time: each data type here uses 4 bytes - * of external representation. - */ -#define IXDR_GET_INT32(buf) ((int32_t)ntohl((u_int32_t)*(buf)++)) -#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v)) -#define IXDR_GET_U_INT32(buf) ((u_int32_t)IXDR_GET_INT32(buf)) -#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v))) - -#ifdef __LP64__ -#define IXDR_GET_LONG(buf) (ntohl((u_int32_t)*(buf)++)) -#define IXDR_PUT_LONG(buf, v) (*(buf)++ = htonl((u_int32_t)v)) -#else -#define IXDR_GET_LONG(buf) ((long)ntohl((u_int32_t)*(buf)++)) -#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)htonl((u_int32_t)v)) -#endif - -#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) -#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf)) -#ifdef __LP64__ -#define IXDR_GET_U_LONG(buf) ((unsigned int)IXDR_GET_LONG(buf)) -#else -#define IXDR_GET_U_LONG(buf) ((unsigned long)IXDR_GET_LONG(buf)) -#endif -#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf)) -#define IXDR_GET_U_SHORT(buf) ((unsigned short)IXDR_GET_LONG(buf)) - -#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), (v)) - -/* - * These are the "generic" xdr routines. - */ -__BEGIN_DECLS -extern bool_t xdr_void(void); -extern bool_t xdr_int(XDR *, int *); -extern bool_t xdr_u_int(XDR *, unsigned int *); -#ifdef __LP64__ -extern bool_t xdr_long(XDR *, int *); -extern bool_t xdr_u_long(XDR *, unsigned int *); -#else -extern bool_t xdr_long(XDR *, long *); -extern bool_t xdr_u_long(XDR *, unsigned long *); -#endif -extern bool_t xdr_short(XDR *, short *); -extern bool_t xdr_u_short(XDR *, unsigned short *); -extern bool_t xdr_int16_t(XDR *, int16_t *); -extern bool_t xdr_u_int16_t(XDR *, u_int16_t *); -extern bool_t xdr_int32_t(XDR *, int32_t *); -extern bool_t xdr_u_int32_t(XDR *, u_int32_t *); -extern bool_t xdr_int64_t(XDR *, int64_t *); -extern bool_t xdr_u_int64_t(XDR *, u_int64_t *); -extern bool_t xdr_bool(XDR *, bool_t *); -extern bool_t xdr_enum(XDR *, enum_t *); -extern bool_t xdr_array(XDR *, char **, unsigned int *, unsigned int, unsigned int, xdrproc_t); -extern bool_t xdr_bytes(XDR *, char **, unsigned int *, unsigned int); -extern bool_t xdr_opaque(XDR *, char *, unsigned int); -extern bool_t xdr_string(XDR *, char **, unsigned int); -extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t); -extern bool_t xdr_char(XDR *, char *); -extern bool_t xdr_u_char(XDR *, unsigned char *); -extern bool_t xdr_vector(XDR *, char *, unsigned int, unsigned int, xdrproc_t); -extern bool_t xdr_float(XDR *, float *); -extern bool_t xdr_double(XDR *, double *); -extern bool_t xdr_quadruple(XDR *, long double *); -extern bool_t xdr_reference(XDR *, char **, unsigned int, xdrproc_t); -extern bool_t xdr_pointer(XDR *, char **, unsigned int, xdrproc_t); -extern bool_t xdr_wrapstring(XDR *, char **); -extern void xdr_free(xdrproc_t, void *); -extern bool_t xdr_hyper(XDR *, quad_t *); -extern bool_t xdr_u_hyper(XDR *, u_quad_t *); -extern bool_t xdr_longlong_t(XDR *, quad_t *); -extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *); -__END_DECLS - -/* - * Common opaque bytes objects used by many rpc protocols; - * declared here due to commonality. - */ -#define MAX_NETOBJ_SZ 1024 -struct netobj { - unsigned int n_len; - char *n_bytes; -}; -typedef struct netobj netobj; -extern bool_t xdr_netobj(XDR *, struct netobj *); - -/* - * These are the public routines for the various implementations of - * xdr streams. - */ -__BEGIN_DECLS -/* XDR using memory buffers */ -extern void xdrmem_create(XDR *, char *, unsigned int, enum xdr_op); - -/* XDR using stdio library */ -#ifdef _STDIO_H_ -extern void xdrstdio_create(XDR *, FILE *, enum xdr_op); -#endif - -/* XDR pseudo records for tcp */ -extern void xdrrec_create(XDR *, unsigned int, unsigned int, void *, - int (*)(void *, void *, int), - int (*)(void *, void *, int)); - -/* make end of xdr record */ -extern bool_t xdrrec_endofrecord(XDR *, int); - -/* move to beginning of next record */ -extern bool_t xdrrec_skiprecord(XDR *); - -/* true if no more input */ -extern bool_t xdrrec_eof(XDR *); -extern unsigned int xdrrec_readbytes(XDR *, caddr_t, unsigned int); -__END_DECLS - -#endif /* !_RPC_XDR_H */ diff --git a/tools/darwin/depends/libnfs/timeval.patch b/tools/darwin/depends/libnfs/timeval.patch new file mode 100644 index 0000000000..7f453d6c6f --- /dev/null +++ b/tools/darwin/depends/libnfs/timeval.patch @@ -0,0 +1,15 @@ +--- include/nfsc/libnfs.h.orig 2013-05-28 21:59:32.000000000 +0200 ++++ include/nfsc/libnfs.h 2013-05-28 21:59:56.000000000 +0200 +@@ -18,12 +18,7 @@ + * This is the highlevel interface to access NFS resources using a posix-like interface + */ + #include <stdint.h> +-#if defined(ANDROID) + #include <sys/time.h> +-#endif +-#if defined(AROS) +-#include <sys/time.h> +-#endif + + struct nfs_context; + struct rpc_context; diff --git a/tools/darwin/depends/libsdl/03-fix_external_screen_crash.patch b/tools/darwin/depends/libsdl/03-fix_external_screen_crash.patch new file mode 100644 index 0000000000..b474e3a3b3 --- /dev/null +++ b/tools/darwin/depends/libsdl/03-fix_external_screen_crash.patch @@ -0,0 +1,11 @@ +--- src/video/quartz/SDL_QuartzWindow.m.orig 2013-10-31 04:29:45.000000000 -0700 ++++ src/video/quartz/SDL_QuartzWindow.m 2013-10-31 04:30:05.000000000 -0700 +@@ -87,7 +87,7 @@ + SDL_VideoDevice *this = (SDL_VideoDevice*)current_video; + + /* make sure pixels are fully opaque */ +- if (! ( SDL_VideoSurface->flags & SDL_OPENGL ) ) ++ if ( SDL_VideoSurface && ! ( SDL_VideoSurface->flags & SDL_OPENGL ) ) + QZ_SetPortAlphaOpaque (); + + /* save current visible SDL surface */ diff --git a/tools/darwin/depends/libsdl/Makefile b/tools/darwin/depends/libsdl/Makefile index 45df4c544d..6f9c579e86 100644 --- a/tools/darwin/depends/libsdl/Makefile +++ b/tools/darwin/depends/libsdl/Makefile @@ -24,6 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE) echo $(SOURCE) > .gitignore cd $(SOURCE); patch -p0 < ../01-SDL_SetWidthHeight.patch cd $(SOURCE); patch -p0 < ../02-mmx.patch + cd $(SOURCE); patch -p0 < ../03-fix_external_screen_crash.patch cd $(SOURCE); $(CONFIGURE) $(LIBDYLIB): $(SOURCE) diff --git a/tools/darwin/depends/xbmc-pvr-addons/Makefile b/tools/darwin/depends/xbmc-pvr-addons/Makefile index 97446e0df6..1ba43ecaf5 100644 --- a/tools/darwin/depends/xbmc-pvr-addons/Makefile +++ b/tools/darwin/depends/xbmc-pvr-addons/Makefile @@ -5,7 +5,7 @@ XBMC_ADDONSDIR=../../../../addons # lib name, version LIBNAME=xbmc-pvr-addons -VERSION=590f862065d0f07d399fe4443a72dc37394becb4 +VERSION=56a77af4e56da9a2658b3748d19bc2db9c491791 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz diff --git a/tools/rbp/depends/libnfs/Makefile b/tools/rbp/depends/libnfs/Makefile index fb55937a1d..be37912514 100644 --- a/tools/rbp/depends/libnfs/Makefile +++ b/tools/rbp/depends/libnfs/Makefile @@ -3,7 +3,7 @@ include ../depends.mk # lib name, version LIBNAME=libnfs -VERSION=1.3.0 +VERSION=1.6.0 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz @@ -24,6 +24,7 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE) $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) echo $(SOURCE) > .gitignore cd $(SOURCE); ./bootstrap + cd $(SOURCE); patch -p0 < ../timeval.patch cd $(SOURCE); $(CONFIGURE) $(SO_NAME): $(SOURCE) diff --git a/tools/rbp/depends/libnfs/timeval.patch b/tools/rbp/depends/libnfs/timeval.patch new file mode 100644 index 0000000000..7f453d6c6f --- /dev/null +++ b/tools/rbp/depends/libnfs/timeval.patch @@ -0,0 +1,15 @@ +--- include/nfsc/libnfs.h.orig 2013-05-28 21:59:32.000000000 +0200 ++++ include/nfsc/libnfs.h 2013-05-28 21:59:56.000000000 +0200 +@@ -18,12 +18,7 @@ + * This is the highlevel interface to access NFS resources using a posix-like interface + */ + #include <stdint.h> +-#if defined(ANDROID) + #include <sys/time.h> +-#endif +-#if defined(AROS) +-#include <sys/time.h> +-#endif + + struct nfs_context; + struct rpc_context; diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 17eccbe15a..b8a791878a 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -3254,7 +3254,18 @@ bool CApplication::ProcessEventServer(float frameTime) { CPoint pos; if (es->GetMousePos(pos.x, pos.y) && g_Mouse.IsEnabled()) + { + XBMC_Event newEvent; + newEvent.type = XBMC_MOUSEMOTION; + newEvent.motion.xrel = 0; + newEvent.motion.yrel = 0; + newEvent.motion.state = 0; + newEvent.motion.which = 0x10; // just a different value to distinguish between mouse and event client device. + newEvent.motion.x = pos.x; + newEvent.motion.y = pos.y; + OnEvent(newEvent); // had to call this to update g_Mouse position return OnAction(CAction(ACTION_MOUSE_MOVE, pos.x, pos.y)); + } } #endif return false; diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 58b766d46d..bf442658ff 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -3977,7 +3977,11 @@ void CGUIInfoManager::SetCurrentMovie(CFileItem &item) CVideoDatabase dbs; if (dbs.Open()) { - dbs.LoadVideoInfo(item.GetPath(), *m_currentFile->GetVideoInfoTag()); + CStdString path = item.GetPath(); + CStdString videoInfoTagPath(item.GetVideoInfoTag()->m_strFileNameAndPath); + if (videoInfoTagPath.Find("removable://") == 0) + path = videoInfoTagPath; + dbs.LoadVideoInfo(path, *m_currentFile->GetVideoInfoTag()); dbs.Close(); } } diff --git a/xbmc/NfoFile.cpp b/xbmc/NfoFile.cpp index 76c5caee42..04700e9a38 100644 --- a/xbmc/NfoFile.cpp +++ b/xbmc/NfoFile.cpp @@ -72,6 +72,7 @@ CNfoFile::NFOResult CNfoFile::Create(const CStdString& strPath, const ScraperPtr { int infos=0; m_headofdoc = strstr(m_headofdoc,"<episodedetails"); + bNfo = GetDetails(details); while (m_headofdoc && details.m_iEpisode != episode) { m_headofdoc = strstr(m_headofdoc+1,"<episodedetails"); diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp index a503ee5f30..e5cd0532b5 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp @@ -1632,6 +1632,15 @@ bool CUtil::Command(const CStdStringArray& arrArgs, bool waitExit) int n = 0; if (child == 0) { + if (!waitExit) + { + // fork again in order not to leave a zombie process + child = fork(); + if (child == -1) + _exit(2); + else if (child != 0) + _exit(0); + } close(0); close(1); close(2); @@ -1646,7 +1655,7 @@ bool CUtil::Command(const CStdStringArray& arrArgs, bool waitExit) } else { - if (waitExit) waitpid(child, &n, 0); + waitpid(child, &n, 0); } return (waitExit) ? (WEXITSTATUS(n) == 0) : true; diff --git a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.cpp b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.cpp index b89b0e90ce..85e84d5e64 100644 --- a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.cpp +++ b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.cpp @@ -106,7 +106,8 @@ CCoreAudioAEStream::CCoreAudioAEStream(enum AEDataFormat dataFormat, unsigned in m_fadeRunning (false), m_frameSize (0 ), m_doRemap (true ), - m_firstInput (true ) + m_firstInput (true ), + m_flushRequested (false) { m_ssrcData.data_out = NULL; @@ -331,7 +332,7 @@ unsigned int CCoreAudioAEStream::AddData(void *data, unsigned int size) unsigned int addsize = size; unsigned int channelsInBuffer = m_chLayoutCountStream; - if (!m_valid || size == 0 || data == NULL || !m_Buffer) + if (!m_valid || size == 0 || data == NULL || !m_Buffer || m_flushRequested) return 0; // if the stream is draining @@ -439,11 +440,18 @@ unsigned int CCoreAudioAEStream::AddData(void *data, unsigned int size) return size; } +// this is only called on the context of the coreaudio thread! unsigned int CCoreAudioAEStream::GetFrames(uint8_t *buffer, unsigned int size) { // if we have been deleted if (!m_valid || m_delete || !m_Buffer || m_paused) return 0; + + if (m_flushRequested) + { + InternalFlush(); + return 0; + } unsigned int readsize = std::min(m_Buffer->GetReadSize(), size); m_Buffer->Read(buffer, readsize); @@ -611,7 +619,8 @@ bool CCoreAudioAEStream::IsDrained() void CCoreAudioAEStream::Flush() { - InternalFlush(); + if (m_Buffer) + m_flushRequested = true; } float CCoreAudioAEStream::GetVolume() @@ -664,6 +673,7 @@ void CCoreAudioAEStream::InternalFlush() } } + m_flushRequested = false; //if (m_Buffer) // m_Buffer->Reset(); } diff --git a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.h b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.h index befbb559e7..17405834d2 100644 --- a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.h +++ b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAEStream.h @@ -172,5 +172,6 @@ private: bool m_doRemap; void Upmix(void *input, unsigned int channelsInput, void *output, unsigned int channelsOutput, unsigned int frames, AEDataFormat dataFormat); bool m_firstInput; + bool m_flushRequested; }; diff --git a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioMixMap.cpp b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioMixMap.cpp index 263044ba19..017f325ebc 100644 --- a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioMixMap.cpp +++ b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioMixMap.cpp @@ -26,6 +26,7 @@ #include <AudioToolbox/AudioToolbox.h> +#include <sstream> CCoreAudioMixMap::CCoreAudioMixMap() : m_isValid(false) @@ -65,17 +66,20 @@ void CCoreAudioMixMap::Rebuild(AudioChannelLayout& inLayout, AudioChannelLayout& // Try and get a predefined mixmap ret = AudioFormatGetProperty(kAudioFormatProperty_MatrixMixMap, sizeof(layouts), layouts, &propSize, m_pMap); - if (!ret) + if (ret) { - // Nothing else to do...a map already exists - m_isValid = true; - return; + // If we for some reason don't find a predefined matrix let's build a diagonal matrix, + // basically guessing here, but we need to have a mixmap that matches the output and input + CLog::Log(LOGDEBUG, "CCoreAudioMixMap::CreateMap: No pre-defined mapping from %d to %d channels, building diagonal matrix.", m_inChannels, m_outChannels); + for (UInt32 chan = 0; chan < std::min(m_inChannels, m_outChannels); ++chan) + { + Float32 *vol = m_pMap + (chan * m_outChannels + chan); + CLog::Log(LOGDEBUG, "CCoreAudioMixMap::Rebuild %d = %f", chan, *vol); + *vol = 1.; + } } - // No predefined mixmap was available. Going to have to build it manually - CLog::Log(LOGDEBUG, "CCoreAudioMixMap::CreateMap: Unable to locate pre-defined mixing matrix"); - - m_isValid = false; + m_isValid = true; } CCoreAudioMixMap *CCoreAudioMixMap::CreateMixMap(CAUOutputDevice *audioUnit, AEAudioFormat &format, AudioChannelLayoutTag layoutTag) @@ -183,18 +187,8 @@ CCoreAudioMixMap *CCoreAudioMixMap::CreateMixMap(CAUOutputDevice *audioUnit, AE // deviceLayout.CopyLayout(guiLayout); // TODO: Skip matrix mixer if input/output are compatible - - AudioChannelLayout* layoutCandidates[] = {(AudioChannelLayout*)deviceLayout, (AudioChannelLayout*)userLayout, NULL}; - - // Try to construct a mapping matrix for the mixer. - // Work through the layout candidates and see if any will work CCoreAudioMixMap *mixMap = new CCoreAudioMixMap(); - for (AudioChannelLayout** pLayout = layoutCandidates; *pLayout != NULL; pLayout++) - { - mixMap->Rebuild(*sourceLayout, **pLayout); - if (mixMap->IsValid()) - break; - } + mixMap->Rebuild(*sourceLayout, *(AudioChannelLayout*)deviceLayout); return mixMap; } @@ -232,21 +226,44 @@ bool CCoreAudioMixMap::SetMixingMatrix(CAUMatrixMixer *mixerUnit, } // Configure the mixing matrix + // The return from kAudioFormatProperty_MatrixMixMap (See Rebuild above) + // is a Float32* which is laid out like this: + // + // mapping 2 chan -> 2 chan + // 1 0 0 1 + // + // or better represented in a tow dimensional array: + // + // 1 0 + // 0 1 + // + // mapping 6 chan -> 6 chan: + // 1 0 0 0 0 0 + // 0 1 0 0 0 0 + // 0 0 1 0 0 0 + // .... + Float32* val = (Float32*)*mixMap; for (UInt32 i = 0; i < inputFormat->mChannelsPerFrame; ++i) { UInt32 j = 0; + std::stringstream layoutStr; for (; j < fmt->mChannelsPerFrame; ++j) { + Float32 *vol = val + (i * mixMap->m_outChannels + j); + layoutStr << *vol << ", "; AudioUnitSetParameter(mixerUnit->GetUnit(), - kMatrixMixerParam_Volume, kAudioUnitScope_Global, ( (i + channelOffset) << 16 ) | j, *val++, 0); + kMatrixMixerParam_Volume, kAudioUnitScope_Global, ( (i + channelOffset) << 16 ) | j, *vol, 0); } // zero out additional outputs from this input for (; j < dims[1]; ++j) { AudioUnitSetParameter(mixerUnit->GetUnit(), kMatrixMixerParam_Volume, kAudioUnitScope_Global, ( (i + channelOffset) << 16 ) | j, 0.0f, 0); + layoutStr << "0, "; } + + CLog::Log(LOGDEBUG, "CCoreAudioMixMap::SetMixingMatrix channel %d = [%s]", i, layoutStr.str().c_str()); } CLog::Log(LOGDEBUG, "CCoreAudioGraph::Open: " diff --git a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioRingBuffer.h b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioRingBuffer.h index 999808aa88..cd31a2c757 100644 --- a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioRingBuffer.h +++ b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioRingBuffer.h @@ -232,7 +232,7 @@ public: */ unsigned int GetReadSize() { - return m_iWritten > m_iRead ? m_iWritten - m_iRead : 0; + return m_iWritten - m_iRead; } /** diff --git a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioUnit.cpp b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioUnit.cpp index fc2cf56b21..4eebb0b206 100644 --- a/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioUnit.cpp +++ b/xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioUnit.cpp @@ -300,18 +300,18 @@ void CCoreAudioUnit::GetFormatDesc(AEAudioFormat format, case AE_FMT_TRUEHD: case AE_FMT_EAC3: streamDesc->mFormatFlags |= kAudioFormatFlagsNativeEndian; - streamDesc->mFormatFlags |= kAudioFormatFlagIsSignedInteger; + streamDesc->mFormatFlags |= kAudioFormatFlagsAudioUnitCanonical; break; case AE_FMT_S16LE: - streamDesc->mFormatFlags |= kAudioFormatFlagIsSignedInteger; + streamDesc->mFormatFlags |= kAudioFormatFlagsAudioUnitCanonical; break; case AE_FMT_S16BE: streamDesc->mFormatFlags |= kAudioFormatFlagIsBigEndian; - streamDesc->mFormatFlags |= kAudioFormatFlagIsSignedInteger; + streamDesc->mFormatFlags |= kAudioFormatFlagsAudioUnitCanonical; break; default: streamDesc->mFormatFlags |= kAudioFormatFlagsNativeEndian; - streamDesc->mFormatFlags |= kAudioFormatFlagIsSignedInteger; + streamDesc->mFormatFlags |= kAudioFormatFlagsAudioUnitCanonical; break; } streamDesc->mChannelsPerFrame = format.m_channelLayout.Count(); // Number of interleaved audiochannels @@ -334,7 +334,7 @@ void CCoreAudioUnit::GetFormatDesc(AEAudioFormat format, case AE_FMT_FLOAT: coreaudioDesc->mFormatFlags |= kAudioFormatFlagIsFloat; default: - coreaudioDesc->mFormatFlags |= kAudioFormatFlagIsSignedInteger; + coreaudioDesc->mFormatFlags |= kAudioFormatFlagsAudioUnitCanonical; break; } coreaudioDesc->mBitsPerChannel = bps; //sizeof(Float32)<<3; diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp index 983cd9a744..00474c38d3 100644 --- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp @@ -242,8 +242,6 @@ void CSoftAE::InternalOpenSink() { if (m_masterStream->m_initChannelLayout == AE_CH_LAYOUT_2_0) m_transcode = false; - m_encoderInitFrameSizeMul = 1.0 / (newFormat.m_channelLayout.Count() * - (CAEUtil::DataFormatToBits(newFormat.m_dataFormat) >> 3)); m_encoderInitSampleRateMul = 1.0 / newFormat.m_sampleRate; } } @@ -348,7 +346,6 @@ void CSoftAE::InternalOpenSink() m_sinkFormat = newFormat; m_sinkFormatSampleRateMul = 1.0 / (double)newFormat.m_sampleRate; - m_sinkFormatFrameSizeMul = 1.0 / (double)newFormat.m_frameSize; m_sinkBlockSize = newFormat.m_frames * newFormat.m_frameSize; // check if sink controls volume, if so, init the volume. m_sinkHandlesVolume = m_sink->HasVolume(); @@ -376,6 +373,7 @@ void CSoftAE::InternalOpenSink() m_convertFn = NULL; m_bytesPerSample = CAEUtil::DataFormatToBits(m_sinkFormat.m_dataFormat) >> 3; m_frameSize = m_sinkFormat.m_frameSize; + m_frameSizeMul = 1.0 / (double)m_frameSize; neededBufferSize = m_sinkFormat.m_frames * m_sinkFormat.m_frameSize; } else @@ -428,6 +426,7 @@ void CSoftAE::InternalOpenSink() m_bytesPerSample = CAEUtil::DataFormatToBits(AE_FMT_FLOAT) >> 3; m_frameSize = m_bytesPerSample * m_chLayout.Count(); + m_frameSizeMul = 1.0 / (double)m_frameSize; } CLog::Log(LOGDEBUG, "CSoftAE::InternalOpenSink - Internal Buffer Size: %d", (int)neededBufferSize); @@ -891,11 +890,11 @@ double CSoftAE::GetDelay() if (m_transcode && m_encoder && !m_rawPassthrough) { - delayBuffer = (double)m_buffer.Used() * m_encoderInitFrameSizeMul * m_encoderInitSampleRateMul; + delayBuffer = (double)m_buffer.Used() * m_frameSizeMul * m_encoderInitSampleRateMul; delayTranscoder = m_encoder->GetDelay((double)m_encodedBuffer.Used() * m_encoderFrameSizeMul); } else - delayBuffer = (double)m_buffer.Used() * m_sinkFormatFrameSizeMul *m_sinkFormatSampleRateMul; + delayBuffer = (double)m_buffer.Used() * m_frameSizeMul *m_sinkFormatSampleRateMul; return delayBuffer + delaySink + delayTranscoder; } @@ -910,11 +909,11 @@ double CSoftAE::GetCacheTime() if (m_transcode && m_encoder && !m_rawPassthrough) { - timeBuffer = (double)m_buffer.Used() * m_encoderInitFrameSizeMul * m_encoderInitSampleRateMul; + timeBuffer = (double)m_buffer.Used() * m_frameSizeMul * m_encoderInitSampleRateMul; timeTranscoder = m_encoder->GetDelay((double)m_encodedBuffer.Used() * m_encoderFrameSizeMul); } else - timeBuffer = (double)m_buffer.Used() * m_sinkFormatFrameSizeMul *m_sinkFormatSampleRateMul; + timeBuffer = (double)m_buffer.Used() * m_frameSizeMul *m_sinkFormatSampleRateMul; return timeBuffer + timeSink + timeTranscoder; } @@ -929,11 +928,11 @@ double CSoftAE::GetCacheTotal() if (m_transcode && m_encoder && !m_rawPassthrough) { - timeBuffer = (double)m_buffer.Size() * m_encoderInitFrameSizeMul * m_encoderInitSampleRateMul; + timeBuffer = (double)m_buffer.Size() * m_frameSizeMul * m_encoderInitSampleRateMul; timeTranscoder = m_encoder->GetDelay((double)m_encodedBuffer.Size() * m_encoderFrameSizeMul); } else - timeBuffer = (double)m_buffer.Size() * m_sinkFormatFrameSizeMul *m_sinkFormatSampleRateMul; + timeBuffer = (double)m_buffer.Size() * m_frameSizeMul *m_sinkFormatSampleRateMul; return timeBuffer + timeSink + timeTranscoder; } diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h index 3ddf72768a..5a4dd44a78 100644 --- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h +++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.h @@ -157,19 +157,18 @@ private: bool m_muted; CAEChannelInfo m_chLayout; unsigned int m_frameSize; + double m_frameSizeMul; /* the sink, its format information, and conversion function */ AESinkInfoList m_sinkInfoList; IAESink *m_sink; AEAudioFormat m_sinkFormat; double m_sinkFormatSampleRateMul; - double m_sinkFormatFrameSizeMul; unsigned int m_sinkBlockSize; bool m_sinkHandlesVolume; AEAudioFormat m_encoderFormat; double m_encoderFrameSizeMul; double m_encoderInitSampleRateMul; - double m_encoderInitFrameSizeMul; unsigned int m_bytesPerSample; CAEConvert::AEConvertFrFn m_convertFn; diff --git a/xbmc/cores/AudioEngine/Utils/AEConvert.cpp b/xbmc/cores/AudioEngine/Utils/AEConvert.cpp index 2e4da191c8..e57530e31b 100644 --- a/xbmc/cores/AudioEngine/Utils/AEConvert.cpp +++ b/xbmc/cores/AudioEngine/Utils/AEConvert.cpp @@ -922,17 +922,21 @@ unsigned int CAEConvert::Float_S24NE3(float *data, const unsigned int samples, u return samples * 3; } +//float can't store INT32_MAX, it gets rounded up to INT32_MAX + 1 +//INT32_MAX - 127 is the maximum value that can exactly be stored in both 32 bit float and int +#define MUL32 ((float)(INT32_MAX - 127)) + unsigned int CAEConvert::Float_S32LE(float *data, const unsigned int samples, uint8_t *dest) { int32_t *dst = (int32_t*)dest; #ifdef __SSE__ - const __m128 mul = _mm_set_ps1((float)INT32_MAX); + const __m128 mul = _mm_set_ps1(MUL32); unsigned int count = samples; /* work around invalid alignment */ while ((((uintptr_t)data & 0xF) || ((uintptr_t)dest & 0xF)) && count > 0) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); ++data; ++dst; --count; @@ -955,7 +959,7 @@ unsigned int CAEConvert::Float_S32LE(float *data, const unsigned int samples, ui const uint32_t odd = samples - even; if (odd == 1) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapLE32(dst[0]); } else @@ -988,7 +992,7 @@ unsigned int CAEConvert::Float_S32LE(float *data, const unsigned int samples, ui /* no SIMD */ for (uint32_t i = 0; i < samples; ++i, ++data, ++dst) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapLE32(dst[0]); } #endif @@ -1002,7 +1006,7 @@ unsigned int CAEConvert::Float_S32LE_Neon(float *data, const unsigned int sample int32_t *dst = (int32_t*)dest; for (float *end = data + (samples & ~0x3); data < end; data += 4, dst += 4) { - float32x4_t val = vmulq_n_f32(vld1q_f32((const float32_t *)data), INT32_MAX); + float32x4_t val = vmulq_n_f32(vld1q_f32((const float32_t *)data), MUL32); int32x4_t ret = vcvtq_s32_f32(val); #ifdef __BIG_ENDIAN__ ret = vrev64q_s32(ret); @@ -1012,7 +1016,7 @@ unsigned int CAEConvert::Float_S32LE_Neon(float *data, const unsigned int sample if (samples & 0x2) { - float32x2_t val = vmul_n_f32(vld1_f32((const float32_t *)data), INT32_MAX); + float32x2_t val = vmul_n_f32(vld1_f32((const float32_t *)data), MUL32); int32x2_t ret = vcvt_s32_f32(val); #ifdef __BIG_ENDIAN__ ret = vrev64_s32(ret); @@ -1024,7 +1028,7 @@ unsigned int CAEConvert::Float_S32LE_Neon(float *data, const unsigned int sample if (samples & 0x1) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapLE32(dst[0]); } #endif @@ -1035,13 +1039,13 @@ unsigned int CAEConvert::Float_S32BE(float *data, const unsigned int samples, ui { int32_t *dst = (int32_t*)dest; #ifdef __SSE__ - const __m128 mul = _mm_set_ps1((float)INT32_MAX); + const __m128 mul = _mm_set_ps1(MUL32); unsigned int count = samples; /* work around invalid alignment */ while ((((uintptr_t)data & 0xF) || ((uintptr_t)dest & 0xF)) && count > 0) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); ++data; ++dst; --count; @@ -1064,7 +1068,7 @@ unsigned int CAEConvert::Float_S32BE(float *data, const unsigned int samples, ui const uint32_t odd = samples - even; if (odd == 1) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapBE32(dst[0]); } else @@ -1096,7 +1100,7 @@ unsigned int CAEConvert::Float_S32BE(float *data, const unsigned int samples, ui /* no SIMD */ for (uint32_t i = 0; i < samples; ++i, ++data, ++dst) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapBE32(dst[0]); } #endif @@ -1110,7 +1114,7 @@ unsigned int CAEConvert::Float_S32BE_Neon(float *data, const unsigned int sample int32_t *dst = (int32_t*)dest; for (float *end = data + (samples & ~0x3); data < end; data += 4, dst += 4) { - float32x4_t val = vmulq_n_f32(vld1q_f32((const float32_t *)data), INT32_MAX); + float32x4_t val = vmulq_n_f32(vld1q_f32((const float32_t *)data), MUL32); int32x4_t ret = vcvtq_s32_f32(val); #ifndef __BIG_ENDIAN__ ret = vrev64q_s32(ret); @@ -1120,7 +1124,7 @@ unsigned int CAEConvert::Float_S32BE_Neon(float *data, const unsigned int sample if (samples & 0x2) { - float32x2_t val = vmul_n_f32(vld1_f32((const float32_t *)data), INT32_MAX); + float32x2_t val = vmul_n_f32(vld1_f32((const float32_t *)data), MUL32); int32x2_t ret = vcvt_s32_f32(val); #ifndef __BIG_ENDIAN__ ret = vrev64_s32(ret); @@ -1132,7 +1136,7 @@ unsigned int CAEConvert::Float_S32BE_Neon(float *data, const unsigned int sample if (samples & 0x1) { - dst[0] = safeRound(data[0] * (float)INT32_MAX); + dst[0] = safeRound(data[0] * MUL32); dst[0] = Endian_SwapBE32(dst[0]); } #endif diff --git a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp index 1cf52d3d4a..fff9e9fe09 100644 --- a/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp +++ b/xbmc/cores/VideoRenderers/LinuxRendererGL.cpp @@ -68,6 +68,9 @@ #include "osx/CocoaInterface.h" #include <CoreVideo/CoreVideo.h> #include <OpenGL/CGLIOSurface.h> + #ifdef TARGET_DARWIN_OSX + #include "osx/DarwinUtils.h" + #endif #endif #ifdef HAS_GLX @@ -313,6 +316,19 @@ bool CLinuxRendererGL::Configure(unsigned int width, unsigned int height, unsign m_pboSupported = glewIsSupported("GL_ARB_pixel_buffer_object") && g_guiSettings.GetBool("videoplayer.usepbo"); +#ifdef TARGET_DARWIN_OSX + // on osx 10.9 mavericks we get a strange ripple + // effect when rendering with pbo + // when used on intel gpu - we have to quirk it here + if (DarwinIsMavericks()) + { + CStdString rendervendor = g_Windowing.GetRenderVendor(); + rendervendor.MakeLower(); + if (rendervendor.find("intel") != std::string::npos) + m_pboSupported = false; + } +#endif + return true; } diff --git a/xbmc/cores/amlplayer/AMLPlayer.cpp b/xbmc/cores/amlplayer/AMLPlayer.cpp index ebf8f1c75f..6b9a73a9b8 100644 --- a/xbmc/cores/amlplayer/AMLPlayer.cpp +++ b/xbmc/cores/amlplayer/AMLPlayer.cpp @@ -677,18 +677,18 @@ void CAMLPlayer::Seek(bool bPlus, bool bLargeStep) // try chapter seeking first, chapter_index is ones based. int chapter_index = GetChapter(); - if (bLargeStep) + if (bLargeStep && chapter_index > 0) { - // seek to next chapter - if (bPlus && (chapter_index < GetChapterCount())) + if (!bPlus) { - SeekChapter(chapter_index + 1); + // seek to previous chapter + SeekChapter(chapter_index - 1); return; } - // seek to previous chapter - if (!bPlus && chapter_index) + else if (chapter_index < GetChapterCount()) { - SeekChapter(chapter_index - 1); + // seek to next chapter + SeekChapter(chapter_index + 1); return; } } diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp index 985a01c40e..880b710855 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp @@ -319,6 +319,8 @@ void CDVDAudioCodecFFmpeg::BuildChannelMap() { CLog::Log(LOGINFO, "CDVDAudioCodecFFmpeg::GetChannelMap - FFmpeg reported %d channels, but the layout contains %d ignoring", m_pCodecContext->channels, bits); layout = m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels); + while(layout == 0 && m_pCodecContext->channels > 2) + layout = m_dllAvUtil.av_get_default_channel_layout(--m_pCodecContext->channels); } m_channelLayout.Reset(); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp index f70a4f972c..5af76d0e10 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -147,6 +147,10 @@ CVDPAU::CVDPAU() dl_vdp_device_create_x11 = NULL; dl_vdp_get_proc_address = NULL; dl_vdp_preemption_callback_register = NULL; + past[0] = NULL; + past[1] = NULL; + current = NULL; + future = NULL; } bool CVDPAU::Open(AVCodecContext* avctx, const enum PixelFormat, unsigned int surfaces) diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h index b3b7ae38f1..76414b2f9e 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h @@ -120,6 +120,16 @@ public: virtual bool OnMouseClick(const CPoint &point) = 0; virtual bool IsInMenu() = 0; virtual double GetTimeStampCorrection() = 0; + virtual bool GetState(std::string &xmlstate) { return false; } + virtual bool SetState(const std::string &xmlstate) { return false; } + }; + + class ISeekable + { + public: + virtual ~ISeekable() {}; + virtual bool CanSeek() = 0; + virtual bool CanPause() = 0; }; enum ENextStream diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h index 6897d0f459..a7d8f6bf2f 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h @@ -81,6 +81,8 @@ public: virtual bool OnMouseMove(const CPoint &point) { return false; } virtual bool OnMouseClick(const CPoint &point) { return false; } virtual double GetTimeStampCorrection() { return 0.0; } + virtual bool GetState(std::string &xmlstate) { return false; } + virtual bool SetState(const std::string &xmlstate) { return false; } void UserInput(bd_vk_key_e vk); diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp index 72ea5f8704..fb5001af91 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.cpp @@ -47,7 +47,24 @@ bool CDVDInputStreamFFmpeg::Open(const char* strFile, const std::string& content if (!CDVDInputStream::Open(strFile, content)) return false; + m_can_pause = true; + m_can_seek = true; + + if(strnicmp(strFile, "udp://", 6) == 0 + || strnicmp(strFile, "rtp://", 6) == 0) + { + m_can_pause = false; + m_can_seek = false; + } + + if(strnicmp(strFile, "tcp://", 6) == 0) + { + m_can_pause = true; + m_can_seek = false; + } + m_aborted = false; + return true; } diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h index 614923319c..cf80e8f3a2 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamFFmpeg.h @@ -22,7 +22,9 @@ #include "DVDInputStream.h" -class CDVDInputStreamFFmpeg : public CDVDInputStream +class CDVDInputStreamFFmpeg + : public CDVDInputStream + , public CDVDInputStream::ISeekable { public: CDVDInputStreamFFmpeg(); @@ -38,6 +40,11 @@ public: virtual void Abort() { m_aborted = true; } bool Aborted() { return m_aborted; } + bool CanSeek() { return m_can_seek; } + bool CanPause() { return m_can_pause; } + protected: bool m_aborted; + bool m_can_pause; + bool m_can_seek; }; diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp index 9cd8cf9a65..102b862cec 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.cpp @@ -1144,7 +1144,7 @@ bool CDVDInputStreamNavigator::IsSubtitleStreamEnabled() return false; } -bool CDVDInputStreamNavigator::GetNavigatorState(std::string &xmlstate) +bool CDVDInputStreamNavigator::GetState(std::string &xmlstate) { if( !m_dvdnav ) return false; @@ -1165,7 +1165,7 @@ bool CDVDInputStreamNavigator::GetNavigatorState(std::string &xmlstate) return true; } -bool CDVDInputStreamNavigator::SetNavigatorState(std::string &xmlstate) +bool CDVDInputStreamNavigator::SetState(const std::string &xmlstate) { if( !m_dvdnav ) return false; diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h index 0c16642b4c..45b2632077 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamNavigator.h @@ -108,8 +108,8 @@ public: int GetAudioStreamCount(); bool SetActiveAudioStream(int iId); - bool GetNavigatorState(std::string &xmlstate); - bool SetNavigatorState(std::string &xmlstate); + bool GetState(std::string &xmlstate); + bool SetState(const std::string &xmlstate); int GetChapter() { return m_iPart; } // the current part in the current title int GetChapterCount() { return m_iPartCount; } // the number of parts in the current title diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp index a218fcdb00..461ceedbdc 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.cpp @@ -315,8 +315,9 @@ CDVDInputStream::ENextStream CDVDInputStreamPVRManager::NextStream() m_eof = IsEOF(); - if (m_pOtherStream) - return m_pOtherStream->NextStream(); + CDVDInputStream::ENextStream next; + if (m_pOtherStream && ((next = m_pOtherStream->NextStream()) != NEXTSTREAM_NONE)) + return next; else if(m_pFile->SkipNext()) { if (m_eof) diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h index 79389a4d4e..89f05a75b3 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamPVRManager.h @@ -39,6 +39,7 @@ class CDVDInputStreamPVRManager : public CDVDInputStream , public CDVDInputStream::IChannel , public CDVDInputStream::IDisplayTime + , public CDVDInputStream::ISeekable { public: CDVDInputStreamPVRManager(IDVDPlayer* pPlayer); diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index e5a1e711da..35a82db2a4 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -936,16 +936,15 @@ void CDVDPlayer::Process() return; } - if(m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { - CLog::Log(LOGNOTICE, "DVDPlayer: playing a dvd with menu's"); + CLog::Log(LOGNOTICE, "DVDPlayer: playing a file with menu's"); m_PlayerOptions.starttime = 0; - if(m_PlayerOptions.state.size() > 0) - ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(m_PlayerOptions.state); - else - ((CDVDInputStreamNavigator*)m_pInputStream)->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn); + ptr->SetState(m_PlayerOptions.state); + else if(CDVDInputStreamNavigator* nav = dynamic_cast<CDVDInputStreamNavigator*>(m_pInputStream)) + nav->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn); g_settings.m_currentVideoSettings.m_SubtitleCached = true; } @@ -2147,13 +2146,14 @@ void CDVDPlayer::HandleMessages() CDVDMsgPlayerSetState* pMsgPlayerSetState = (CDVDMsgPlayerSetState*)pMsg; - if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { - std::string s = pMsgPlayerSetState->GetState(); - ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(s); - m_dvd.state = DVDSTATE_NORMAL; - m_dvd.iDVDStillStartTime = 0; - m_dvd.iDVDStillTime = 0; + if(ptr->SetState(pMsgPlayerSetState->GetState())) + { + m_dvd.state = DVDSTATE_NORMAL; + m_dvd.iDVDStillStartTime = 0; + m_dvd.iDVDStillTime = 0; + } } g_infoManager.SetDisplayAfterSeek(); @@ -2419,14 +2419,18 @@ void CDVDPlayer::Seek(bool bPlus, bool bLargeStep) if (!m_State.canseek) return; - if(((bPlus && GetChapter() < GetChapterCount()) - || (!bPlus && GetChapter() > 1)) && bLargeStep) + if (bLargeStep && GetChapter() > 0) { - if(bPlus) - SeekChapter(GetChapter() + 1); - else + if (!bPlus) + { SeekChapter(GetChapter() - 1); - return; + return; + } + else if (GetChapter() < GetChapterCount()) + { + SeekChapter(GetChapter() + 1); + return; + } } int64_t seek; @@ -3618,18 +3622,18 @@ bool CDVDPlayer::OnAction(const CAction &action) switch (action.GetID()) { case ACTION_NEXT_ITEM: - if(GetChapterCount() > 0) + if (GetChapter() > 0 && GetChapter() < GetChapterCount()) { - m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter()+1)); + m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter() + 1)); g_infoManager.SetDisplayAfterSeek(); return true; } else break; case ACTION_PREV_ITEM: - if(GetChapterCount() > 0) + if (GetChapter() > 0) { - m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter()-1)); + m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter() - 1)); g_infoManager.SetDisplayAfterSeek(); return true; } @@ -3713,7 +3717,7 @@ void CDVDPlayer::GetChapterName(CStdString& strChapterName) int CDVDPlayer::SeekChapter(int iChapter) { - if (GetChapterCount() > 0) + if (GetChapter() > 0) { if (iChapter < 0) iChapter = 0; @@ -3724,14 +3728,7 @@ int CDVDPlayer::SeekChapter(int iChapter) m_messenger.Put(new CDVDMsgPlayerSeekChapter(iChapter)); SynchronizeDemuxer(100); } - else - { - // Do a regular big jump. - if (GetChapter() > 0 && iChapter > GetChapter()) - Seek(true, true); - else - Seek(false, true); - } + return 0; } @@ -3833,6 +3830,9 @@ void CDVDPlayer::UpdatePlayState(double timeout) state.time_src = ETIMESOURCE_CLOCK; } + state.canpause = true; + state.canseek = true; + if(m_pInputStream) { // override from input stream if needed @@ -3850,9 +3850,12 @@ void CDVDPlayer::UpdatePlayState(double timeout) state.time_total = pDisplayTime->GetTotalTime(); state.time_src = ETIMESOURCE_INPUT; } - - if (dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) + + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { + if(!ptr->GetState(state.player_state)) + state.player_state = ""; + if(m_dvd.state == DVDSTATE_STILL) { state.time = XbmcThreads::SystemClockMillis() - m_dvd.iDVDStillStartTime; @@ -3861,16 +3864,10 @@ void CDVDPlayer::UpdatePlayState(double timeout) } } - if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) - { - CDVDInputStreamPVRManager* pvrinputstream = static_cast<CDVDInputStreamPVRManager*>(m_pInputStream); - state.canpause = pvrinputstream->CanPause(); - state.canseek = pvrinputstream->CanSeek(); - } - else + if (CDVDInputStream::ISeekable* ptr = dynamic_cast<CDVDInputStream::ISeekable*>(m_pInputStream)) { - state.canseek = state.time_total > 0 ? true : false; - state.canpause = true; + state.canpause = ptr->CanPause(); + state.canseek = ptr->CanSeek(); } } @@ -3880,12 +3877,8 @@ void CDVDPlayer::UpdatePlayState(double timeout) state.time_total = m_Edl.RemoveCutTime(llrint(state.time_total)); } - state.player_state = ""; - if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) - { - if(!((CDVDInputStreamNavigator*)m_pInputStream)->GetNavigatorState(state.player_state)) - state.player_state = ""; - } + if(state.time_total <= 0) + state.canseek = false; if (state.time_src == ETIMESOURCE_CLOCK) state.time_offset = m_offset_pts; diff --git a/xbmc/cores/omxplayer/OMXPlayer.cpp b/xbmc/cores/omxplayer/OMXPlayer.cpp index d3805eba43..78cb5aab52 100644 --- a/xbmc/cores/omxplayer/OMXPlayer.cpp +++ b/xbmc/cores/omxplayer/OMXPlayer.cpp @@ -951,15 +951,15 @@ void COMXPlayer::Process() return; } - if(m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { CLog::Log(LOGNOTICE, "OMXPlayer: playing a file with menu's"); m_PlayerOptions.starttime = 0; if(m_PlayerOptions.state.size() > 0) - ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(m_PlayerOptions.state); - else - ((CDVDInputStreamNavigator*)m_pInputStream)->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn); + ptr->SetState(m_PlayerOptions.state); + else if(CDVDInputStreamNavigator* nav = dynamic_cast<CDVDInputStreamNavigator*>(m_pInputStream)) + nav->EnableSubtitleStream(g_settings.m_currentVideoSettings.m_SubtitleOn); g_settings.m_currentVideoSettings.m_SubtitleCached = true; } @@ -2237,13 +2237,14 @@ void COMXPlayer::HandleMessages() CDVDMsgPlayerSetState* pMsgPlayerSetState = (CDVDMsgPlayerSetState*)pMsg; - if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { - std::string s = pMsgPlayerSetState->GetState(); - ((CDVDInputStreamNavigator*)m_pInputStream)->SetNavigatorState(s); - m_dvd.state = DVDSTATE_NORMAL; - m_dvd.iDVDStillStartTime = 0; - m_dvd.iDVDStillTime = 0; + if(ptr->SetState(pMsgPlayerSetState->GetState())) + { + m_dvd.state = DVDSTATE_NORMAL; + m_dvd.iDVDStillStartTime = 0; + m_dvd.iDVDStillTime = 0; + } } g_infoManager.SetDisplayAfterSeek(); @@ -2506,14 +2507,18 @@ void COMXPlayer::Seek(bool bPlus, bool bLargeStep) if (!m_State.canseek) return; - if(((bPlus && GetChapter() < GetChapterCount()) - || (!bPlus && GetChapter() > 1)) && bLargeStep) + if (bLargeStep && GetChapter() > 0) { - if(bPlus) - SeekChapter(GetChapter() + 1); - else + if (!bPlus) + { SeekChapter(GetChapter() - 1); - return; + return; + } + else if (GetChapter() < GetChapterCount()) + { + SeekChapter(GetChapter() + 1); + return; + } } int64_t seek; @@ -3731,18 +3736,18 @@ bool COMXPlayer::OnAction(const CAction &action) switch (action.GetID()) { case ACTION_NEXT_ITEM: - if(GetChapterCount() > 0) + if (GetChapter() > 0 && GetChapter() < GetChapterCount()) { - m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter()+1)); + m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter() + 1)); g_infoManager.SetDisplayAfterSeek(); return true; } else break; case ACTION_PREV_ITEM: - if(GetChapterCount() > 0) + if (GetChapter() > 0) { - m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter()-1)); + m_messenger.Put(new CDVDMsgPlayerSeekChapter(GetChapter() - 1)); g_infoManager.SetDisplayAfterSeek(); return true; } @@ -3826,7 +3831,7 @@ void COMXPlayer::GetChapterName(CStdString& strChapterName) int COMXPlayer::SeekChapter(int iChapter) { - if (GetChapterCount() > 0) + if (GetChapter() > 0) { if (iChapter < 0) iChapter = 0; @@ -3837,14 +3842,7 @@ int COMXPlayer::SeekChapter(int iChapter) m_messenger.Put(new CDVDMsgPlayerSeekChapter(iChapter)); SynchronizeDemuxer(100); } - else - { - // Do a regular big jump. - if (GetChapter() > 0 && iChapter > GetChapter()) - Seek(true, true); - else - Seek(false, true); - } + return 0; } @@ -3950,6 +3948,9 @@ void COMXPlayer::UpdatePlayState(double timeout) } + state.canpause = true; + state.canseek = true; + if(m_pInputStream) { // override from input stream if needed @@ -3967,9 +3968,12 @@ void COMXPlayer::UpdatePlayState(double timeout) state.time_total = pDisplayTime->GetTotalTime(); state.time_src = ETIMESOURCE_INPUT; } - - if (dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) + + if (CDVDInputStream::IMenus* ptr = dynamic_cast<CDVDInputStream::IMenus*>(m_pInputStream)) { + if(!ptr->GetState(state.player_state)) + state.player_state = ""; + if(m_dvd.state == DVDSTATE_STILL) { state.time = XbmcThreads::SystemClockMillis() - m_dvd.iDVDStillStartTime; @@ -3978,16 +3982,10 @@ void COMXPlayer::UpdatePlayState(double timeout) } } - if (m_pInputStream->IsStreamType(DVDSTREAM_TYPE_PVRMANAGER)) - { - CDVDInputStreamPVRManager* pvrinputstream = static_cast<CDVDInputStreamPVRManager*>(m_pInputStream); - state.canpause = pvrinputstream->CanPause(); - state.canseek = pvrinputstream->CanSeek(); - } - else + if (CDVDInputStream::ISeekable* ptr = dynamic_cast<CDVDInputStream::ISeekable*>(m_pInputStream)) { - state.canseek = state.time_total > 0 ? true : false; - state.canpause = true; + state.canpause = ptr->CanPause(); + state.canseek = ptr->CanSeek(); } } @@ -3997,12 +3995,8 @@ void COMXPlayer::UpdatePlayState(double timeout) state.time_total = m_Edl.RemoveCutTime(llrint(state.time_total)); } - state.player_state = ""; - if (m_pInputStream && m_pInputStream->IsStreamType(DVDSTREAM_TYPE_DVD)) - { - if(!((CDVDInputStreamNavigator*)m_pInputStream)->GetNavigatorState(state.player_state)) - state.player_state = ""; - } + if(state.time_total <= 0) + state.canseek = false; if (state.time_src == ETIMESOURCE_CLOCK) state.time_offset = m_offset_pts; diff --git a/xbmc/dialogs/GUIDialogKaiToast.cpp b/xbmc/dialogs/GUIDialogKaiToast.cpp index 36db00148a..85410c57bc 100644 --- a/xbmc/dialogs/GUIDialogKaiToast.cpp +++ b/xbmc/dialogs/GUIDialogKaiToast.cpp @@ -32,6 +32,9 @@ #define POPUP_ICON_WARNING 404 #define POPUP_ICON_ERROR 405 +CGUIDialogKaiToast::TOASTQUEUE CGUIDialogKaiToast::m_notifications; +CCriticalSection CGUIDialogKaiToast::m_critical; + CGUIDialogKaiToast::CGUIDialogKaiToast(void) : CGUIDialog(WINDOW_DIALOG_KAI_TOAST, "DialogKaiToast.xml") { @@ -76,9 +79,7 @@ void CGUIDialogKaiToast::OnWindowLoaded() void CGUIDialogKaiToast::QueueNotification(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/) { - CGUIDialogKaiToast *toast = (CGUIDialogKaiToast *)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST); - if (toast) - toast->AddToQueue(eType, aCaption, aDescription, displayTime, withSound, messageTime); + AddToQueue("", eType, aCaption, aDescription, displayTime, withSound, messageTime); } void CGUIDialogKaiToast::QueueNotification(const CStdString& aCaption, const CStdString& aDescription) @@ -88,34 +89,15 @@ void CGUIDialogKaiToast::QueueNotification(const CStdString& aCaption, const CSt void CGUIDialogKaiToast::QueueNotification(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/) { - CGUIDialogKaiToast *toast = (CGUIDialogKaiToast *)g_windowManager.GetWindow(WINDOW_DIALOG_KAI_TOAST); - if (toast) - toast->AddToQueue(aImageFile, aCaption, aDescription, displayTime, withSound, messageTime); -} - -void CGUIDialogKaiToast::AddToQueue(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/) -{ - CGUIImage *image = NULL; - - if (eType == Info) - image = (CGUIImage *)GetControl(POPUP_ICON_INFO); - else if (eType == Warning) - image = (CGUIImage *)GetControl(POPUP_ICON_WARNING); - else if (eType == Error) - image = (CGUIImage *)GetControl(POPUP_ICON_ERROR); - - CStdString strImage; - if (image) - strImage = image->GetFileName(); - - AddToQueue(strImage, aCaption, aDescription, displayTime, withSound, messageTime); + AddToQueue(aImageFile, Default, aCaption, aDescription, displayTime, withSound, messageTime); } -void CGUIDialogKaiToast::AddToQueue(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/) +void CGUIDialogKaiToast::AddToQueue(const CStdString& aImageFile, const eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime /*= TOAST_DISPLAY_TIME*/, bool withSound /*= true*/, unsigned int messageTime /*= TOAST_MESSAGE_TIME*/) { CSingleLock lock(m_critical); Notification toast; + toast.eType = eType; toast.imagefile = aImageFile; toast.caption = aCaption; toast.description = aDescription; @@ -152,10 +134,28 @@ bool CGUIDialogKaiToast::DoWork() CGUIImage *image = (CGUIImage *)GetControl(POPUP_ICON); if (image) { - if (!toast.imagefile.IsEmpty()) - image->SetFileName(toast.imagefile); - else - image->SetFileName(m_defaultIcon); + CStdString strTypeImage = toast.imagefile; + + if (strTypeImage.IsEmpty()) + { + CGUIImage *typeImage = NULL; + + if (toast.eType == Info) + typeImage = (CGUIImage *)GetControl(POPUP_ICON_INFO); + else if (toast.eType == Warning) + typeImage = (CGUIImage *)GetControl(POPUP_ICON_WARNING); + else if (toast.eType == Error) + typeImage = (CGUIImage *)GetControl(POPUP_ICON_ERROR); + else + typeImage = image; + + if (typeImage) + strTypeImage = typeImage->GetFileName(); + else + strTypeImage = m_defaultIcon; + } + + image->SetFileName(strTypeImage); } // Play the window specific init sound for each notification queued diff --git a/xbmc/dialogs/GUIDialogKaiToast.h b/xbmc/dialogs/GUIDialogKaiToast.h index 820c5bd0c3..95bea21b24 100644 --- a/xbmc/dialogs/GUIDialogKaiToast.h +++ b/xbmc/dialogs/GUIDialogKaiToast.h @@ -33,17 +33,20 @@ public: CGUIDialogKaiToast(void); virtual ~CGUIDialogKaiToast(void); + enum eMessageType { Default = 0, Info, Warning, Error }; + struct Notification { CStdString caption; CStdString description; CStdString imagefile; + eMessageType eType; unsigned int displayTime; unsigned int messageTime; bool withSound; }; - enum eMessageType { Info = 0, Warning, Error }; + typedef std::queue<Notification> TOASTQUEUE; static void QueueNotification(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime = TOAST_DISPLAY_TIME, bool withSound = true, unsigned int messageTime = TOAST_MESSAGE_TIME); static void QueueNotification(const CStdString& aCaption, const CStdString& aDescription); @@ -56,8 +59,7 @@ public: void ResetTimer(); protected: - void AddToQueue(eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime); - void AddToQueue(const CStdString& aImageFile, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime); + static void AddToQueue(const CStdString& aImageFile, const eMessageType eType, const CStdString& aCaption, const CStdString& aDescription, unsigned int displayTime, bool withSound, unsigned int messageTime); unsigned int m_timer; @@ -65,8 +67,7 @@ protected: unsigned int m_toastMessageTime; CStdString m_defaultIcon; - - typedef std::queue<Notification> TOASTQUEUE; - TOASTQUEUE m_notifications; - CCriticalSection m_critical; + + static TOASTQUEUE m_notifications; + static CCriticalSection m_critical; }; diff --git a/xbmc/filesystem/CDDAFile.cpp b/xbmc/filesystem/CDDAFile.cpp index d94aee7571..e041a30105 100644 --- a/xbmc/filesystem/CDDAFile.cpp +++ b/xbmc/filesystem/CDDAFile.cpp @@ -40,6 +40,7 @@ CFileCDDA::CFileCDDA(void) m_lsnCurrent = CDIO_INVALID_LSN; m_lsnEnd = CDIO_INVALID_LSN; m_cdio = CLibcdio::GetInstance(); + m_iSectorCount = 52; } CFileCDDA::~CFileCDDA(void) @@ -120,7 +121,8 @@ unsigned int CFileCDDA::Read(void* lpBuf, int64_t uiBufSize) if (!m_pCdIo || !g_mediaManager.IsDiscInDrive()) return 0; - int iSectorCount = (int)uiBufSize / CDIO_CD_FRAMESIZE_RAW; + // limit number of sectors that fits in buffer by m_iSectorCount + int iSectorCount = std::min((int)uiBufSize / CDIO_CD_FRAMESIZE_RAW, m_iSectorCount); if (iSectorCount <= 0) return 0; @@ -129,14 +131,32 @@ unsigned int CFileCDDA::Read(void* lpBuf, int64_t uiBufSize) if (m_lsnCurrent + iSectorCount > m_lsnEnd) iSectorCount = m_lsnEnd - m_lsnCurrent; - int iret = m_cdio->cdio_read_audio_sectors(m_pCdIo, lpBuf, m_lsnCurrent, iSectorCount); - - if ( iret != DRIVER_OP_SUCCESS) + // The loop tries to solve read error problem by lowering number of sectors to read (iSectorCount). + // When problem is solved the proper number of sectors is stored in m_iSectorCount + int big_iSectorCount = iSectorCount; + while (iSectorCount > 0) { - CLog::Log(LOGERROR, "file cdda: Reading %d sectors of audio data starting at lsn %d failed with error code %i", iSectorCount, m_lsnCurrent, iret); - return 0; + int iret = m_cdio->cdio_read_audio_sectors(m_pCdIo, lpBuf, m_lsnCurrent, iSectorCount); + + if (iret == DRIVER_OP_SUCCESS) + { + // If lower iSectorCount solved the problem limit it's value + if (iSectorCount < big_iSectorCount) + { + m_iSectorCount = iSectorCount; + } + break; + } + + // iSectorCount is low so it cannot solve read problem + if (iSectorCount <= 10) + { + CLog::Log(LOGERROR, "file cdda: Reading %d sectors of audio data starting at lsn %d failed with error code %i", iSectorCount, m_lsnCurrent, iret); + return 0; + } + + iSectorCount = 10; } - m_lsnCurrent += iSectorCount; return iSectorCount*CDIO_CD_FRAMESIZE_RAW; diff --git a/xbmc/filesystem/CDDAFile.h b/xbmc/filesystem/CDDAFile.h index 748e5fc003..de51763627 100644 --- a/xbmc/filesystem/CDDAFile.h +++ b/xbmc/filesystem/CDDAFile.h @@ -53,6 +53,7 @@ protected: lsn_t m_lsnStart; // Start of m_iTrack in logical sector number lsn_t m_lsnCurrent; // Position inside the track in logical sector number lsn_t m_lsnEnd; // End of m_iTrack in logical sector number + int m_iSectorCount; // max number of sectors to read at once boost::shared_ptr<MEDIA_DETECT::CLibcdio> m_cdio; }; } diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp index ff8250c039..8667fc6381 100644 --- a/xbmc/filesystem/CurlFile.cpp +++ b/xbmc/filesystem/CurlFile.cpp @@ -197,6 +197,7 @@ CCurlFile::CReadState::CReadState() m_bufferSize = 0; m_cancelled = false; m_bFirstLoop = true; + m_sendRange = true; m_headerdone = false; } @@ -255,8 +256,13 @@ void CCurlFile::CReadState::SetResume(void) * request header. If we don't the server may provide different content causing seeking to fail. * This only affects HTTP-like items, for FTP it's a null operation. */ - if (m_filePos == 0) + if (m_sendRange && m_filePos == 0) g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RANGE, "0-"); + else + { + g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RANGE, NULL); + m_sendRange = false; + } g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RESUME_FROM_LARGE, m_filePos); } @@ -866,6 +872,7 @@ bool CCurlFile::Open(const CURL& url) // setup common curl options SetCommonOptions(m_state); SetRequestHeaders(m_state); + m_state->m_sendRange = m_seekable; m_httpresponse = m_state->Connect(m_bufferSize); if( m_httpresponse < 0 || m_httpresponse >= 400) @@ -1046,6 +1053,7 @@ int64_t CCurlFile::Seek(int64_t iFilePosition, int iWhence) SetRequestHeaders(m_state); m_state->m_filePos = nextPos; + m_state->m_sendRange = true; if (oldstate) m_state->m_fileSize = oldstate->m_fileSize; @@ -1287,6 +1295,16 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want) msg->data.result == CURLE_RECV_ERROR) && !m_bFirstLoop) CURLresult = msg->data.result; + else if ( (msg->data.result == CURLE_HTTP_RANGE_ERROR || + msg->data.result == CURLE_HTTP_RETURNED_ERROR) && + m_bFirstLoop && + m_filePos == 0 && + m_sendRange) + { + // If server returns a range or http error, retry with range disabled + CURLresult = msg->data.result; + m_sendRange = false; + } else return false; } diff --git a/xbmc/filesystem/CurlFile.h b/xbmc/filesystem/CurlFile.h index d25fb5898c..a48207a738 100644 --- a/xbmc/filesystem/CurlFile.h +++ b/xbmc/filesystem/CurlFile.h @@ -101,6 +101,7 @@ namespace XFILE int64_t m_fileSize; int64_t m_filePos; bool m_bFirstLoop; + bool m_sendRange; /* returned http header */ CHttpHeader m_httpheader; diff --git a/xbmc/filesystem/iso9660.cpp b/xbmc/filesystem/iso9660.cpp index 7f2ad2f8dd..f52c6a64ee 100644 --- a/xbmc/filesystem/iso9660.cpp +++ b/xbmc/filesystem/iso9660.cpp @@ -902,15 +902,13 @@ long iso9660::ReadFile(HANDLE hFile, byte *pBuffer, long lSize) if ( pContext->m_bUseMode2 ) sectorSize = MODE2_DATA_SIZE; - while (lSize > 0 && pContext->m_dwFilePos <= pContext->m_dwFileSize) + while (lSize > 0 && pContext->m_dwFilePos < pContext->m_dwFileSize) { pContext->m_dwCurrentBlock = (DWORD) (pContext->m_dwFilePos / sectorSize); int64_t iOffsetInBuffer = pContext->m_dwFilePos - (sectorSize * pContext->m_dwCurrentBlock); pContext->m_dwCurrentBlock += pContext->m_dwStartBlock; - //char szBuf[256]; - //sprintf(szBuf,"pos:%i cblk:%i sblk:%i off:%i",(long)m_dwFilePos, (long)m_dwCurrentBlock,(long)m_dwStartBlock,(long)iOffsetInBuffer); - //DBG(szBuf); + // CLog::Log(LOGDEBUG, "pos:%li cblk:%li sblk:%li off:%li",(long)pContext->m_dwFilePos, (long)pContext->m_dwCurrentBlock,(long)pContext->m_dwStartBlock,(long)iOffsetInBuffer); byte* pSector; bError = !ReadSectorFromCache(pContext, pContext->m_dwCurrentBlock, &pSector); diff --git a/xbmc/guilib/GUISliderControl.cpp b/xbmc/guilib/GUISliderControl.cpp index 32927a24dc..9406a116f4 100644 --- a/xbmc/guilib/GUISliderControl.cpp +++ b/xbmc/guilib/GUISliderControl.cpp @@ -174,7 +174,8 @@ bool CGUISliderControl::OnAction(const CAction &action) case ACTION_SELECT_ITEM: // switch between the two sliders - SwitchRangeSelector(); + if (m_rangeSelection) + SwitchRangeSelector(); return true; default: diff --git a/xbmc/guilib/GUITextLayout.cpp b/xbmc/guilib/GUITextLayout.cpp index 053ffdd2b4..3847a08085 100644 --- a/xbmc/guilib/GUITextLayout.cpp +++ b/xbmc/guilib/GUITextLayout.cpp @@ -354,6 +354,7 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v { uint32_t newStyle = 0; color_t newColor = currentColor; + bool colorTagChange = false; bool newLine = false; // have a [ - check if it's an ON or OFF switch bool on(true); @@ -401,21 +402,36 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v { // color size_t finish = text.Find(L']', pos + 5); if (on && finish != CStdString::npos && (size_t)text.Find(L"[/COLOR]",finish) != CStdString::npos) - { // create new color - newColor = colors.size(); - colors.push_back(g_colorManager.GetColor(text.Mid(pos + 5, finish - pos - 5))); + { + color_t color = g_colorManager.GetColor(text.Mid(pos + 5, finish - pos - 5)); + vecColors::const_iterator it = std::find(colors.begin(), colors.end(), color); + if (it == colors.end()) + { // create new color + if (colors.size() <= 0xFF) + { + newColor = colors.size(); + colors.push_back(color); + } + else // we have only 8 bits for color index, fallback to first color if reach max. + newColor = 0; + } + else + // reuse existing color + newColor = it - colors.begin(); colorStack.push(newColor); + colorTagChange = true; } else if (!on && finish == pos + 5 && colorStack.size() > 1) { // revert to previous color colorStack.pop(); newColor = colorStack.top(); + colorTagChange = true; } if (finish != CStdString::npos) pos = finish + 1; } - if (newStyle || newColor != currentColor || newLine) + if (newStyle || colorTagChange || newLine) { // we have a new style or a new color, so format up the previous segment CStdStringW subText = text.Mid(startPos, endPos - startPos); if (currentStyle & FONT_STYLE_UPPERCASE) diff --git a/xbmc/guilib/JpegIO.cpp b/xbmc/guilib/JpegIO.cpp index f6f2c441e8..6c4410c36e 100644 --- a/xbmc/guilib/JpegIO.cpp +++ b/xbmc/guilib/JpegIO.cpp @@ -367,8 +367,9 @@ bool CJpegIO::Read(unsigned char* buffer, unsigned int bufSize, unsigned int min m_cinfo.scale_denom = 8; m_cinfo.out_color_space = JCS_RGB; unsigned int maxtexsize = g_Windowing.GetMaxTextureSize(); - for (m_cinfo.scale_num = 1; m_cinfo.scale_num <= 8; m_cinfo.scale_num++) + for (unsigned int scale = 1; scale <= 8; scale++) { + m_cinfo.scale_num = scale; jpeg_calc_output_dimensions(&m_cinfo); if ((m_cinfo.output_width > maxtexsize) || (m_cinfo.output_height > maxtexsize)) { diff --git a/xbmc/interfaces/AnnouncementManager.cpp b/xbmc/interfaces/AnnouncementManager.cpp index 4151888be8..6f916f172d 100644 --- a/xbmc/interfaces/AnnouncementManager.cpp +++ b/xbmc/interfaces/AnnouncementManager.cpp @@ -120,7 +120,11 @@ void CAnnouncementManager::Announce(AnnouncementFlag flag, const char *sender, c CVideoDatabase videodatabase; if (videodatabase.Open()) { - if (videodatabase.LoadVideoInfo(item->GetPath(), *item->GetVideoInfoTag())) + CStdString path = item->GetPath(); + CStdString videoInfoTagPath(item->GetVideoInfoTag()->m_strFileNameAndPath); + if (videoInfoTagPath.Find("removable://") == 0) + path = videoInfoTagPath; + if (videodatabase.LoadVideoInfo(path, *item->GetVideoInfoTag())) id = item->GetVideoInfoTag()->m_iDbId; videodatabase.Close(); diff --git a/xbmc/linux/XTimeUtils.cpp b/xbmc/linux/XTimeUtils.cpp index 71749a6b45..69a1e0901e 100644 --- a/xbmc/linux/XTimeUtils.cpp +++ b/xbmc/linux/XTimeUtils.cpp @@ -83,7 +83,12 @@ BOOL FileTimeToLocalFileTime(const FILETIME* lpFileTime, LPFILETIME lpLocalFileT l.u.LowPart = lpFileTime->dwLowDateTime; l.u.HighPart = lpFileTime->dwHighDateTime; - l.QuadPart -= (uint64_t) timezone * 10000000; + time_t ft; + struct tm tm_ft; + FileTimeToTimeT(lpFileTime, &ft); + localtime_r(&ft, &tm_ft); + + l.QuadPart += tm_ft.tm_gmtoff * 10000000; lpLocalFileTime->dwLowDateTime = l.u.LowPart; lpLocalFileTime->dwHighDateTime = l.u.HighPart; diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp index 8fe4226634..81181a06ce 100644 --- a/xbmc/main/main.cpp +++ b/xbmc/main/main.cpp @@ -66,13 +66,6 @@ int main(int argc, char* argv[]) if (setrlimit(RLIMIT_CORE, &rlim) == -1) CLog::Log(LOGDEBUG, "Failed to set core size limit (%s)", strerror(errno)); #endif - // Prevent child processes from becoming zombies on exit if not waited upon. See also Util::Command - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - - sa.sa_flags = SA_NOCLDWAIT; - sa.sa_handler = SIG_IGN; - sigaction(SIGCHLD, &sa, NULL); #endif setlocale(LC_NUMERIC, "C"); g_advancedSettings.Initialize(); diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index faeaf7b4a5..73adccdc8d 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -4364,23 +4364,23 @@ bool CMusicDatabase::GetScraperForPath(const CStdString& strPath, ADDON::Scraper } if (m_pDS->eof() && params.GetAlbumId() != -1) // check album { - strSQL = PrepareSQL("select * from content where strPath='musicdb://3/%i/'",params.GetGenreId()); + strSQL = PrepareSQL("select * from content where strPath='musicdb://3/%i/'",params.GetAlbumId()); m_pDS->query(strSQL.c_str()); + if (m_pDS->eof()) // general albums setting + { + strSQL = PrepareSQL("select * from content where strPath='musicdb://3/'"); + m_pDS->query(strSQL.c_str()); + } } if (m_pDS->eof() && params.GetArtistId() != -1) // check artist { strSQL = PrepareSQL("select * from content where strPath='musicdb://2/%i/'",params.GetArtistId()); m_pDS->query(strSQL.c_str()); - } - if (m_pDS->eof()) // general albums setting - { - strSQL = PrepareSQL("select * from content where strPath='musicdb://3/'"); - m_pDS->query(strSQL.c_str()); - } - if (m_pDS->eof()) // general artist setting - { - strSQL = PrepareSQL("select * from content where strPath='musicdb://2/'"); - m_pDS->query(strSQL.c_str()); + if (m_pDS->eof()) // general artist setting + { + strSQL = PrepareSQL("select * from content where strPath='musicdb://2/'"); + m_pDS->query(strSQL.c_str()); + } } } diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp index 2ee3313c19..40ca351db5 100644 --- a/xbmc/music/windows/GUIWindowMusicBase.cpp +++ b/xbmc/music/windows/GUIWindowMusicBase.cpp @@ -81,7 +81,7 @@ using namespace MUSIC_INFO; CGUIWindowMusicBase::CGUIWindowMusicBase(int id, const CStdString &xmlFile) : CGUIMediaWindow(id, xmlFile) { - + m_dlgProgress = NULL; } CGUIWindowMusicBase::~CGUIWindowMusicBase () diff --git a/xbmc/network/EventClient.cpp b/xbmc/network/EventClient.cpp index 5936576c5c..51c820192a 100644 --- a/xbmc/network/EventClient.cpp +++ b/xbmc/network/EventClient.cpp @@ -794,12 +794,8 @@ bool CEventClient::GetMousePos(float& x, float& y) CSingleLock lock(m_critSection); if (m_bMouseMoved) { - x = (float)((m_iMouseX / 65535.0f) * - (g_graphicsContext.GetViewWindow().x2 - -g_graphicsContext.GetViewWindow().x1)); - y = (float)((m_iMouseY / 65535.0f) * - (g_graphicsContext.GetViewWindow().y2 - -g_graphicsContext.GetViewWindow().y1)); + x = (float)((m_iMouseX / 65535.0f) * g_graphicsContext.GetWidth()); + y = (float)((m_iMouseY / 65535.0f) * g_graphicsContext.GetHeight()); m_bMouseMoved = false; return true; } diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp index 4a0ea86819..58c0e8e9d5 100644 --- a/xbmc/network/WebServer.cpp +++ b/xbmc/network/WebServer.cpp @@ -22,6 +22,7 @@ #ifdef HAS_WEB_SERVER #include "filesystem/File.h" #include "utils/log.h" +#include "utils/StringUtils.h" #include "utils/URIUtils.h" #include "utils/Variant.h" #include "utils/Base64.h" @@ -54,15 +55,21 @@ CWebServer::CWebServer() int CWebServer::FillArgumentMap(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) { + if (cls == NULL || key == NULL) + return MHD_NO; + map<string, string> *arguments = (map<string, string> *)cls; - arguments->insert(pair<string,string>(key,value)); + arguments->insert(pair<string, string>(key, value != NULL ? value : StringUtils::Empty)); return MHD_YES; } int CWebServer::FillArgumentMultiMap(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) { + if (cls == NULL || key == NULL) + return MHD_NO; + multimap<string, string> *arguments = (multimap<string, string> *)cls; - arguments->insert(pair<string,string>(key,value)); + arguments->insert(pair<string, string>(key, value != NULL ? value : StringUtils::Empty)); return MHD_YES; } diff --git a/xbmc/osx/DarwinUtils.h b/xbmc/osx/DarwinUtils.h index 8f325a54e1..367ac4da58 100644 --- a/xbmc/osx/DarwinUtils.h +++ b/xbmc/osx/DarwinUtils.h @@ -32,6 +32,7 @@ extern "C" { #endif bool DarwinIsAppleTV2(void); + bool DarwinIsMavericks(void); bool DarwinHasRetina(void); const char *GetDarwinOSReleaseString(void); const char *GetDarwinVersionString(void); diff --git a/xbmc/osx/DarwinUtils.mm b/xbmc/osx/DarwinUtils.mm index 5aff49e057..d8646a16e3 100644 --- a/xbmc/osx/DarwinUtils.mm +++ b/xbmc/osx/DarwinUtils.mm @@ -135,6 +135,23 @@ bool DarwinIsAppleTV2(void) return (platform == AppleTV2); } +bool DarwinIsMavericks(void) +{ + static int isMavericks = -1; +#if defined(TARGET_DARWIN_OSX) + // there is no NSAppKitVersionNumber10_9 out there anywhere + // so we detect mavericks by one of these newly added app nap + // methods - and fix the ugly mouse rect problem which was hitting + // us when mavericks came out + if (isMavericks == -1) + { + CLog::Log(LOGDEBUG, "Detected Mavericks..."); + isMavericks = [NSProcessInfo instancesRespondToSelector:@selector(beginActivityWithOptions:reason:)] == TRUE ? 1 : 0; + } +#endif + return isMavericks == 1; +} + bool DarwinHasRetina(void) { static enum iosPlatform platform = iDeviceUnknown; diff --git a/xbmc/osx/atv2/XBMCController.h b/xbmc/osx/atv2/XBMCController.h index 141857f29c..dbb08f619a 100644 --- a/xbmc/osx/atv2/XBMCController.h +++ b/xbmc/osx/atv2/XBMCController.h @@ -62,6 +62,7 @@ - (void) setGlView:(id)view; - (BOOL) ATVClientEventFromBREvent:(id)event Repeatable:(bool *)isRepeatable ButtonState:(bool *)isPressed Result:(int *)xbmc_ir_key; - (void) setUserEvent:(int) eventId withHoldTime:(unsigned int) holdTime; +- (unsigned int) appleModKeyToXbmcModKey: (unsigned int) appleModifier; - (void) startKeyPressTimer:(int) keyId; - (void) stopKeyPressTimer; - (void) setSystemSleepTimeout:(id) timeout; diff --git a/xbmc/osx/atv2/XBMCController.mm b/xbmc/osx/atv2/XBMCController.mm index 4bf21e82fb..875dc46afc 100644 --- a/xbmc/osx/atv2/XBMCController.mm +++ b/xbmc/osx/atv2/XBMCController.mm @@ -183,9 +183,11 @@ typedef enum { kBREventRemoteActionTouchHold = 46, + // keypresses, for originator kBREventOriginatorKeyboard kBREventRemoteActionKeyPress = 47, kBREventRemoteActionKeyPress42, - + + kBREventRemoteActionKeyTab = 53, // Custom remote actions for old remote actions kBREventRemoteActionHoldLeft = 0xfeed0001, @@ -194,6 +196,22 @@ typedef enum { kBREventRemoteActionHoldDown, } BREventRemoteAction; +typedef enum { + kBREventModifierCommandLeft = 0x10000, + kBREventModifierShiftLeft = 0x20000, + kBREventModifierOptionLeft = 0x80000, + kBREventModifierCtrlLeft = 0x100000, + kBREventModifierShiftRight = 0x200000, + kBREventModifierOptionRight = 0x400000, + kBREventModifierCommandRight = 0x1000000, +}BREventModifier; + +typedef enum { + kBREventOriginatorRemote = 1, + kBREventOriginatorKeyboard = 2, + kBREventOriginatorGesture = 3, +}BREventOriginiator; + XBMCController *g_xbmcController; @@ -419,7 +437,8 @@ static void XBMCController$ATVClientEventFromBREvent(XBMCController* self, SEL _ return; int remoteAction = [f_event remoteAction]; - CLog::Log(LOGDEBUG,"XBMCPureController: Button press remoteAction = %i", remoteAction); + unsigned int originator = [f_event originator]; + CLog::Log(LOGDEBUG,"XBMCPureController: Button press remoteAction = %i originator = %i", remoteAction, originator); *isRepeatable = false; *isPressed = false; @@ -480,7 +499,10 @@ static void XBMCController$ATVClientEventFromBREvent(XBMCController* self, SEL _ // tap play case kBREventRemoteActionPlay: case 65673: - *result = ATV_BUTTON_PLAY; + if (originator == kBREventOriginatorKeyboard) // on bt keyboard play == return! + *result = ATV_BTKEYPRESS; + else + *result = ATV_BUTTON_PLAY; return ; // hold play @@ -488,19 +510,28 @@ static void XBMCController$ATVClientEventFromBREvent(XBMCController* self, SEL _ case kBREventRemoteActionCenterHold: case kBREventRemoteActionCenterHold42: case 65668: - *result = ATV_BUTTON_PLAY_H; + if (originator == kBREventOriginatorKeyboard) // invalid on bt keyboard + *result = ATV_INVALID_BUTTON; + else + *result = ATV_BUTTON_PLAY_H; return ; // menu case kBREventRemoteActionMenu: case 65670: - *result = ATV_BUTTON_MENU; + if (originator == kBREventOriginatorKeyboard) // on bt keyboard menu == esc! + *result = ATV_BTKEYPRESS; + else + *result = ATV_BUTTON_MENU; return ; // hold menu case kBREventRemoteActionMenuHold: case 786496: - *result = ATV_BUTTON_MENU_H; + if (originator == kBREventOriginatorKeyboard) // invalid on bt keyboard + *result = ATV_INVALID_BUTTON; + else + *result = ATV_BUTTON_MENU_H; return ; // learned play @@ -541,14 +572,29 @@ static void XBMCController$ATVClientEventFromBREvent(XBMCController* self, SEL _ // tap play on new Al IR remote case kBREventRemoteActionALPlay: case 786637: - *result = ATV_ALUMINIUM_PLAY; + if (originator == kBREventOriginatorKeyboard) // on bt keyboard alplay == space! + *result = ATV_BTKEYPRESS; + else + *result = ATV_ALUMINIUM_PLAY; return ; case kBREventRemoteActionKeyPress: case kBREventRemoteActionKeyPress42: - *result = ATV_BTKEYPRESS; + *isRepeatable = true; + if (originator == kBREventOriginatorKeyboard) // only valid on bt keyboard + *result = ATV_BTKEYPRESS; + else + *result = ATV_INVALID_BUTTON; return ; - + + case kBREventRemoteActionKeyTab: + *isRepeatable = true; + if (originator == kBREventOriginatorKeyboard) // only valid on bt keyboard + *result = ATV_BTKEYPRESS; + else + *result = ATV_INVALID_BUTTON; + return ; + // PageUp case kBREventRemoteActionPageUp: *result = ATV_BUTTON_PAGEUP; @@ -684,6 +730,33 @@ static void XBMCController$setUserEvent(XBMCController* self, SEL _cmd, int even CWinEventsIOS::MessagePush(&newEvent); } +static unsigned int XBMCController$appleModKeyToXbmcModKey(XBMCController* self, SEL _cmd, unsigned int appleModifier) +{ + unsigned int xbmcModifier = XBMCKMOD_NONE; + // shift left + if (appleModifier & kBREventModifierShiftLeft) + xbmcModifier |= XBMCKMOD_LSHIFT; + // shift right + if (appleModifier & kBREventModifierShiftRight) + xbmcModifier |= XBMCKMOD_RSHIFT; + // left ctrl + if (appleModifier & kBREventModifierCtrlLeft) + xbmcModifier |= XBMCKMOD_LCTRL; + // left alt/option + if (appleModifier & kBREventModifierOptionLeft) + xbmcModifier |= XBMCKMOD_LALT; + // right alt/altgr/option + if (appleModifier & kBREventModifierOptionRight) + xbmcModifier |= XBMCKMOD_RALT; + // left command + if (appleModifier & kBREventModifierCommandLeft) + xbmcModifier |= XBMCKMOD_LMETA; + // right command + if (appleModifier & kBREventModifierCommandRight) + xbmcModifier |= XBMCKMOD_RMETA; + + return xbmcModifier; +} static BOOL XBMCController$brEventAction(XBMCController* self, SEL _cmd, BREvent* event) { @@ -702,14 +775,16 @@ static BOOL XBMCController$brEventAction(XBMCController* self, SEL _cmd, BREvent if ( xbmc_ir_key != ATV_INVALID_BUTTON ) { - if (xbmc_ir_key == ATV_BTKEYPRESS && [event value] == 1) + if (xbmc_ir_key == ATV_BTKEYPRESS) { XBMC_Event newEvent; memset(&newEvent, 0, sizeof(newEvent)); NSDictionary *dict = [event eventDictionary]; NSString *key_nsstring = [dict objectForKey:@"kBRKeyEventCharactersKey"]; - + unsigned int modifier = [[dict objectForKey:@"kBRKeyEventModifiersKey"] unsignedIntValue]; + bool fireTheKey = false; + if (key_nsstring != nil && [key_nsstring length] == 1) { //ns_string contains the letter you want to input @@ -718,7 +793,7 @@ static BOOL XBMCController$brEventAction(XBMCController* self, SEL _cmd, BREvent const char* wstr = [key_nsstring cStringUsingEncoding:NSUTF16StringEncoding]; //NSLog(@"%s, key: wstr[0] = %d, wstr[1] = %d", __PRETTY_FUNCTION__, wstr[0], wstr[1]); - if (wstr[0] != 92) + if (wstr[0] != 92) { if (wstr[0] == 62 && wstr[1] == -9) { @@ -731,14 +806,49 @@ static BOOL XBMCController$brEventAction(XBMCController* self, SEL _cmd, BREvent newEvent.key.keysym.sym = (XBMCKey)wstr[0]; newEvent.key.keysym.unicode = wstr[0] | (wstr[1] << 8); } - newEvent.type = XBMC_KEYDOWN; - CWinEventsIOS::MessagePush(&newEvent); - - newEvent.type = XBMC_KEYUP; - CWinEventsIOS::MessagePush(&newEvent); - is_handled = TRUE; + fireTheKey = true; + } + } + else // this must be one of those duped functions when using the bt keyboard + { + int remoteAction = [event remoteAction]; + fireTheKey = true; + switch (remoteAction) + { + case kBREventRemoteActionALPlay:// play maps to space + case 786637: + newEvent.key.keysym.sym = XBMCK_SPACE; + newEvent.key.keysym.unicode = XBMCK_SPACE; + break; + case kBREventRemoteActionMenu:// menu maps to escape! + case 65670: + newEvent.key.keysym.sym = XBMCK_ESCAPE; + newEvent.key.keysym.unicode = XBMCK_ESCAPE; + break; + case kBREventRemoteActionKeyTab: + newEvent.key.keysym.sym = XBMCK_TAB; + newEvent.key.keysym.unicode = XBMCK_TAB; + break; + case kBREventRemoteActionPlay:// play maps to return + case 65673: + newEvent.key.keysym.sym = XBMCK_RETURN; + newEvent.key.keysym.unicode = XBMCK_RETURN; + break; + default: // unsupported duped function + fireTheKey = false; + break; } } + + if (fireTheKey && (!isRepeatable || [event value] == 1)) // some keys might be repeatable - only fire once here + { + newEvent.key.keysym.mod = (XBMCMod)[self appleModKeyToXbmcModKey:modifier]; + newEvent.type = XBMC_KEYDOWN; + CWinEventsIOS::MessagePush(&newEvent); + newEvent.type = XBMC_KEYUP; + CWinEventsIOS::MessagePush(&newEvent); + is_handled = TRUE; + } } else { @@ -1270,6 +1380,8 @@ static __attribute__((constructor)) void initControllerRuntimeClasses() class_addMethod(XBMCControllerCls, @selector(presentFramebuffer), (IMP)&XBMCController$presentFramebuffer, "B@:"); // XBMCController::setUserEvent class_addMethod(XBMCControllerCls, @selector(setUserEvent:withHoldTime:), (IMP)&XBMCController$setUserEvent, "v@:iI"); + // XBMCController::appleModKeyToXbmcModKey + class_addMethod(XBMCControllerCls, @selector(appleModKeyToXbmcModKey:), (IMP)&XBMCController$appleModKeyToXbmcModKey, "I@:I"); // XBMCController::startKeyPressTimer class_addMethod(XBMCControllerCls, @selector(startKeyPressTimer:), (IMP)&XBMCController$startKeyPressTimer, "v@:i"); // XBMCController::stopKeyPressTimer diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp index 9fda1d003a..e671285972 100644 --- a/xbmc/pictures/GUIWindowPictures.cpp +++ b/xbmc/pictures/GUIWindowPictures.cpp @@ -61,6 +61,7 @@ CGUIWindowPictures::CGUIWindowPictures(void) { m_thumbLoader.SetObserver(this); m_slideShowStarted = false; + m_dlgProgress = NULL; } void CGUIWindowPictures::OnInitWindow() diff --git a/xbmc/pictures/PictureThumbLoader.cpp b/xbmc/pictures/PictureThumbLoader.cpp index f8a18cab76..882cbd2c33 100644 --- a/xbmc/pictures/PictureThumbLoader.cpp +++ b/xbmc/pictures/PictureThumbLoader.cpp @@ -133,7 +133,8 @@ void CPictureThumbLoader::ProcessFoldersAndArchives(CFileItem *pItem) return; } } - if ((pItem->m_bIsFolder || pItem->IsCBR() || pItem->IsCBZ()) && !pItem->m_bIsShareOrDrive && !pItem->IsParentFolder()) + if ((pItem->m_bIsFolder || pItem->IsCBR() || pItem->IsCBZ()) && !pItem->m_bIsShareOrDrive + && !pItem->IsParentFolder() && !pItem->GetPath().Equals("add")) { // first check for a folder.jpg CStdString thumb = "folder.jpg"; diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp index 81d96709ba..8e56d9bfa0 100644 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp @@ -242,7 +242,11 @@ void CGUIWindowPVRGuide::UpdateViewTimeline(bool bUpdateSelectedFile) CDateTime gridStart = CDateTime::GetCurrentDateTime().GetAsUTCDateTime(); CDateTime firstDate(g_EpgContainer.GetFirstEPGDate()); CDateTime lastDate(g_EpgContainer.GetLastEPGDate()); - m_parent->m_guideGrid->SetStartEnd(firstDate > gridStart ? firstDate : gridStart, lastDate); + if (!firstDate.IsValid() || firstDate < gridStart) + firstDate = gridStart; + if (!lastDate.IsValid() || lastDate < firstDate) + lastDate = firstDate; + m_parent->m_guideGrid->SetStartEnd(firstDate, lastDate); m_parent->SetLabel(m_iControlButton, g_localizeStrings.Get(19222) + ": " + g_localizeStrings.Get(19032)); m_parent->SetLabel(CONTROL_LABELGROUP, g_localizeStrings.Get(19032)); diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp index 5c1207632d..62c61001ae 100644 --- a/xbmc/rendering/gles/RenderSystemGLES.cpp +++ b/xbmc/rendering/gles/RenderSystemGLES.cpp @@ -138,11 +138,7 @@ bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen g_matrices.MatrixMode(MM_PROJECTION); g_matrices.LoadIdentity(); -#ifdef TARGET_RASPBERRY_PI - g_matrices.Ortho(0.0f, width-1, height-1, 0.0f, +1.0f, 1.0f); -#else g_matrices.Ortho(0.0f, width-1, height-1, 0.0f, -1.0f, 1.0f); -#endif g_matrices.MatrixMode(MM_MODELVIEW); g_matrices.LoadIdentity(); diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp index 51c7c78807..b03a71c06f 100644 --- a/xbmc/utils/StringUtils.cpp +++ b/xbmc/utils/StringUtils.cpp @@ -46,6 +46,7 @@ const char* ADDON_GUID_RE = "^(\\{){0,1}[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a- /* empty string for use in returns by ref */ const CStdString StringUtils::EmptyString = ""; +const std::string StringUtils::Empty = ""; CStdString StringUtils::m_lastUUID = ""; string StringUtils::Format(const char *fmt, ...) diff --git a/xbmc/utils/StringUtils.h b/xbmc/utils/StringUtils.h index 4b286dde7c..d1bac6bff1 100644 --- a/xbmc/utils/StringUtils.h +++ b/xbmc/utils/StringUtils.h @@ -106,6 +106,7 @@ public: static bool IsInteger(const CStdString& str); static CStdString SizeToString(int64_t size); static const CStdString EmptyString; + static const std::string Empty; static size_t FindWords(const char *str, const char *wordLowerCase); static int FindEndBracket(const CStdString &str, char opener, char closer, int startPos = 0); static int DateStringToYYYYMMDD(const CStdString &dateString); diff --git a/xbmc/utils/TimeSmoother.cpp b/xbmc/utils/TimeSmoother.cpp index 1ffcff54f7..ac3ce5d93d 100644 --- a/xbmc/utils/TimeSmoother.cpp +++ b/xbmc/utils/TimeSmoother.cpp @@ -83,8 +83,12 @@ unsigned int CTimeSmoother::GetNextFrameTime(unsigned int currentTime) // ensure we jump at least 1 period ahead of the last time we were called if (frameTime < m_lastFrameTime + m_period) frameTime = m_lastFrameTime + m_period; + // Return an unsigned int in ms, so wrap into that, and round. + // Don't use MathUtils::round_int as that's restricted to -2^30..2^30 + if (frameTime >= UINT_MAX) + frameTime = fmod(frameTime, UINT_MAX); m_lastFrameTime = frameTime; - return MathUtils::round_int(frameTime); + return (unsigned int)floor(frameTime + 0.5); } return currentTime; } diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp index af6ea5ad0c..ee02408b98 100644 --- a/xbmc/video/VideoInfoScanner.cpp +++ b/xbmc/video/VideoInfoScanner.cpp @@ -1774,7 +1774,10 @@ namespace VIDEO void CVideoInfoScanner::FetchActorThumbs(vector<SActorInfo>& actors, const CStdString& strPath) { CFileItemList items; - CDirectory::GetDirectory(URIUtils::AddFileToFolder(strPath, ".actors"), items, ".png|.jpg|.tbn", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_NO_FILE_INFO); + CStdString actorsDir = URIUtils::AddFileToFolder(strPath, ".actors"); + if (CDirectory::Exists(actorsDir)) + CDirectory::GetDirectory(actorsDir, items, ".png|.jpg|.tbn", DIR_FLAG_NO_FILE_DIRS | + DIR_FLAG_NO_FILE_INFO); for (vector<SActorInfo>::iterator i = actors.begin(); i != actors.end(); ++i) { if (i->thumb.IsEmpty()) @@ -1811,7 +1814,10 @@ namespace VIDEO CNfoFile::NFOResult result=CNfoFile::NO_NFO; if (!strNfoFile.IsEmpty() && CFile::Exists(strNfoFile)) { - result = m_nfoReader.Create(strNfoFile,info,pItem->GetVideoInfoTag()->m_iEpisode); + if (info->Content() == CONTENT_TVSHOWS && !pItem->m_bIsFolder) + result = m_nfoReader.Create(strNfoFile,info,pItem->GetVideoInfoTag()->m_iEpisode); + else + result = m_nfoReader.Create(strNfoFile,info); CStdString type; switch(result) diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index 4c5b868e0e..9d8f5f52d5 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -98,6 +98,7 @@ CGUIWindowVideoBase::CGUIWindowVideoBase(int id, const CStdString &xmlFile) m_thumbLoader.SetObserver(this); m_thumbLoader.SetStreamDetailsObserver(this); m_stackingAvailable = true; + m_dlgProgress = NULL; } CGUIWindowVideoBase::~CGUIWindowVideoBase() diff --git a/xbmc/windowing/osx/WinSystemOSX.h b/xbmc/windowing/osx/WinSystemOSX.h index cb2918b269..3a5f510e71 100644 --- a/xbmc/windowing/osx/WinSystemOSX.h +++ b/xbmc/windowing/osx/WinSystemOSX.h @@ -42,6 +42,7 @@ public: virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction); virtual bool DestroyWindow(); virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + bool ResizeWindowInternal(int newWidth, int newHeight, int newLeft, int newTop, void *additional); virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); virtual void UpdateResolutions(); virtual void NotifyAppFocusChange(bool bGaining); diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm index e1686fa673..380e50ab5a 100644 --- a/xbmc/windowing/osx/WinSystemOSX.mm +++ b/xbmc/windowing/osx/WinSystemOSX.mm @@ -663,6 +663,23 @@ bool CWinSystemOSX::DestroyWindow() } extern "C" void SDL_SetWidthHeight(int w, int h); +bool CWinSystemOSX::ResizeWindowInternal(int newWidth, int newHeight, int newLeft, int newTop, void *additional) +{ + bool ret = ResizeWindow(newWidth, newHeight, newLeft, newTop); + + if( DarwinIsMavericks() ) + { + NSView * last_view = (NSView *)additional; + if (last_view && [last_view window]) + { + NSWindow* lastWindow = [last_view window]; + [lastWindow setContentSize:NSMakeSize(m_nWidth, m_nHeight)]; + [lastWindow update]; + [last_view setFrameSize:NSMakeSize(m_nWidth, m_nHeight)]; + } + } + return ret; +} bool CWinSystemOSX::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) { if (!m_glContext) @@ -709,6 +726,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl static NSView* last_view = NULL; static NSSize last_view_size; static NSPoint last_view_origin; + static NSInteger last_window_level = NSNormalWindowLevel; bool was_fullscreen = m_bFullScreen; static int lastDisplayNr = res.iScreen; NSOpenGLContext* cur_context; @@ -778,6 +796,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl last_view_origin = [last_view frame].origin; last_window_screen = [[last_view window] screen]; last_window_origin = [[last_view window] frame].origin; + last_window_level = [[last_view window] level]; if (g_guiSettings.GetBool("videoscreen.fakefullscreen")) { @@ -822,7 +841,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl [newContext setView:blankView]; // Hide the menu bar. - if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay) + if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay || DarwinIsMavericks() ) SetMenuBarVisible(false); // Blank other displays if requested. @@ -856,7 +875,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl CGDisplayCapture(GetDisplayID(res.iScreen)); // If we don't hide menu bar, it will get events and interrupt the program. - if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay) + if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay || DarwinIsMavericks() ) SetMenuBarVisible(false); } @@ -884,13 +903,13 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl [NSCursor unhide]; // Show menubar. - if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay) + if (GetDisplayID(res.iScreen) == kCGDirectMainDisplay || DarwinIsMavericks() ) SetMenuBarVisible(true); if (g_guiSettings.GetBool("videoscreen.fakefullscreen")) { // restore the windowed window level - [[last_view window] setLevel:NSNormalWindowLevel]; + [[last_view window] setLevel:last_window_level]; // Get rid of the new window we created. if (windowedFullScreenwindow != NULL) @@ -943,7 +962,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl ShowHideNSWindow([last_view window], needtoshowme); // need to make sure SDL tracks any window size changes - ResizeWindow(m_nWidth, m_nHeight, -1, -1); + ResizeWindowInternal(m_nWidth, m_nHeight, -1, -1, last_view); return true; } @@ -1420,7 +1439,7 @@ void CWinSystemOSX::NotifyAppFocusChange(bool bGaining) // find the screenID NSDictionary* screenInfo = [[window screen] deviceDescription]; NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"]; - if ((CGDirectDisplayID)[screenID longValue] == kCGDirectMainDisplay) + if ((CGDirectDisplayID)[screenID longValue] == kCGDirectMainDisplay || DarwinIsMavericks() ) { SetMenuBarVisible(false); } @@ -1485,6 +1504,7 @@ void CWinSystemOSX::EnableSystemScreenSaver(bool bEnable) IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &assertionID); } + UpdateSystemActivity(UsrActivity); } else if (assertionID != 0) { |