Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

imagefactory for xbmc #1106

Closed
wants to merge 14 commits into
from

Conversation

Projects
None yet
2 participants
Member

wsoltys commented Jun 29, 2012

starting this pr to get a feeling if its worth to proceed. The code is far from being ready but you get the idea.
The reason for starting this is that I think this could be helpful for slowly getting rid of imagelib. this way we could add different third party libs if needed (extra for raw images?).
In the beginning only turbojpeg and imagelib would be in.
So what is the overall feeling? Proceed or dismiss?

Member

jmarshallnz commented Jun 29, 2012

It's a good idea I think. Note that you may wish to hold off a little until my musicthumb stuff is in - I hope to clean it up this weekend. Once done, quite a few of the current CPicture loading/caching routines can go away, and also an additional function in CxImage will be required (basically it drops down to loading an image off disk or loading an image from RAM).

In fact, I'd be very tempted to keep only the latter and have the wrapper for reading from a file inside XBMC instead (saves wrapping any future libs) - basically it drops down to 2 routines: one that given an image in mem decodes that image to a texture, and a second that does the opposite.

Member

wsoltys commented Jun 30, 2012

sounds good.

Member

jmarshallnz commented Jul 8, 2012

Ok, my changes are in. I think there's a couple more changes that could happen:

  1. Remove LoadFromFile() in CxImage/JpegIO, and move the CFile reading into CBaseTexture::LoadFromFile() instead (or into your image wrapper), which then calls LoadFromMemory().
  2. At that point you just have 2 functions in the image loader (LoadFromMemory, CreateThumbnailFromSurface) along with a cleanup function for CxImage (FreeImage).
  3. Potentially you could move the writing out of CreateThumbnailFromSurface - this would mean JpegIO and CxImage don't need to know about our filesystem which means CxImage doesn't need wrapping anymore.
Member

wsoltys commented Jul 8, 2012

mmh guess I'll need a lot more time to get that thing done as I didn't looked deep enough into imagelib ;)
I'm not sure what to do with the ImageInfo stuff introduced by ImageLib. Currently I would assume to use that inside the factory as other libs might expose this infos too which means to alter jpegio to fill this struct.

Member

jmarshallnz commented Jul 8, 2012

I'd tend to leave that CxImage only - JpegIO is more efficient as the first thing it does is read the size of the image, that way we can allocate the texture buffer and pass it in, avoiding a memcpy(). I don't think CxImage can do this, thus the reason it needs to use it's own buffer.

Member

wsoltys commented Jul 8, 2012

but what about all the other stuff like alpha and exif which is also stored in this ImageInfo struct? It seems to me that this is all left out of the jpegio class.

Member

jmarshallnz commented Jul 8, 2012

alpha is the alpha plane, so that's just set to 0xff across the texture passed into JpegIO.

The Exif orientation (the only bit we need for textures) is read, but you're correct that the rest isn't exposed, though that could be hooked up I think.

Member

wsoltys commented Dec 19, 2012

closing this for now but really far with the new version. Will open up a new pr for it after frodo.

@wsoltys wsoltys closed this Dec 19, 2012

tru added a commit to RasPlex/plex-home-theatre that referenced this pull request Apr 18, 2014

Refactored PlayQueueManager.
This makes it possible to handle Local and Remote playQueues with the
same API and also show the PlayQueue on the HomeWindow at all times. It
now also restores the PlayQueue when the sessions ends.

Clicking the PlayQueue from the home window also takes it to
PlexPlayQueue.xml

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