Texture cache changes to prepare for various new features #918

Merged
merged 22 commits into from May 4, 2012

Conversation

Projects
None yet
3 participants
Member

jmarshallnz commented May 2, 2012

This basically is work to better cache images at load time and also prepare for the texture cache holding more than one size of the same image.

Also contains fixes for attempts at caching the same image in 2 different threads (results in corrupt jpg) and fixes for addon thumbs.

In addition, http:// art is considered stable (i.e. non-changing) which is most likely the case anyway, so this should reduce load on thetvdb/themoviedb, whose URLs are stable. There's a routine in place to invalidate this (thus forcing a check, not necessarily a re-cache if nothing has changed) which the addon repos use.

Would like this one in before the video_thumbs_to_cache (PR on the way) as it is hopefully the last time that the texturedb will need dropping.

Jonathan Marshall added some commits May 2, 2012

add updateable flag to AddCachedTexture, and set lasthashcheck empty …
…if the flag isn't set, to ensure we no longer check images over and over
use CPicture::CacheTexture rather than CreateThumbnailFromSurface for…
… creating embedded video thumbs, so that future orientation info can be used
use IN_PROGRESS to indicate the allocated state of a texture in progr…
…ess, and split out the removal of inprogress from allocated or failed textures
split AddCachedTexture into Add and SetCachedTextureValid, so that Ad…
…dCachedTexture can just delete and re-add to simplify queries
Collaborator

theuni commented on 1f7c67f May 2, 2012

need api bump? anything the scrapers might want to do differently?

Owner

jmarshallnz replied May 2, 2012

nope - anything in there atm can be regenerated easily enough (addon thumbs, picture thumbs) thus the dropping of the table.

Music + video thumbs are to come.

Member

theuni commented May 2, 2012

it all starts to run together after a reading a few, but no complaints on first pass.

Member

jmarshallnz commented May 2, 2012

Thanks for the review :)

Collaborator

Memphiz commented on 54c2d6e May 2, 2012

If item.GetThumnnailImage succeeds we don't call the "SetCachedImage" for that item. Is this right? (not familiar with all this - just looking at code and thinking stuff...)

Owner

jmarshallnz replied May 2, 2012

Yup - that's right. The item already has a thumb (it could be from the library, it could be from the filesystem class etc) so no point looking further for it, or storing the fact in the texturedb (the thumb for instance may be set by the filesystem class and may regularly change).

Collaborator

Memphiz commented on 9ecf56f May 2, 2012

The orientation info of videos is already in ^^ - future reached haha.

Owner

jmarshallnz replied May 2, 2012

Heh - I can hook it up assuming it gets this far. Do you have a test video?

Collaborator

Memphiz replied May 2, 2012

Yes there are testmovies for each orientation on the teamftp under my folder.

Owner

jmarshallnz replied May 4, 2012

Ok, taken a look - unfortunately they don't decode for some odd reason, so I can't really hook it up anyway. The orientation mapping should be:

90 -> 5, 180 -> 2, 270 -> 7.

Owner

Memphiz commented May 2, 2012

Nice presentation of a PR here (in the meaning of small commits only which are nice to read). I didn't get the full picture of things, but i didn't spot anything obvious.

Member

jmarshallnz commented May 4, 2012

Thanks for the review :)

@ghost ghost assigned jmarshallnz May 4, 2012

jmarshallnz added a commit that referenced this pull request May 4, 2012

Merge pull request #918 from jmarshallnz/more_texture_cache_shenanigans
Texture cache changes to prepare for various new features

@jmarshallnz jmarshallnz merged commit 62797cd into xbmc:master May 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment