NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 27 28 29 30 31 … 93 Next »
1.x plugin development

 
  • 0 Vote(s) - 0 Average
1.x plugin development
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#61
2007-08-30, 12:06 AM
Hey, I added the following code:

Code:
public override void Dispose()
        {
            ArrayList DisposeList = new ArrayList();
            DisposeList.Add(theImage);
            PluginHelperFactory.getPluginHelper().DisposeResources(DisposeList);

            SkinHelper2.disableAnimation();
            skinHelper2.DisposeResources();
            
            base.Dispose();
        }

And it does help, but there's still some leakage...

I have tested again with the original, unaltered WeatherPlugin sample, and it seems to be there as well.... Seems like something in the framework isn't releasing some objects....

When I run the original sample, and I press the "Add" button / Esc about 20-30 times, I see memory consumption go up, but never being entirely released....

Could be something in the framework?? I added the following logging-code before initializing and after disposing the popup, and all indications are that there's memory not being freed somewhere...

Code:
case "Add":
                    // do something...
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                    Logger.Verbose("In use (Pre): " + GC.GetTotalMemory(false));
                    setPopup(new AddCityPopup(this));
                    return;

Code:
// close popup
            AddCityPopup r = (AddCityPopup)popup;

            setPopup(null);
            r.Dispose();
            r = null;
            popup = null;

            GC.Collect();
            GC.WaitForPendingFinalizers();

            Logger.Verbose("In use (Post): " + GC.GetTotalMemory(false));

I'll get on with building some more functionality and wait till you get back from your trip to learn more...

Regards,
//Ton
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#62
2007-09-05, 06:29 PM
On anoter note, I have finally gotten the updating of the thumbnails to work (using "IconView'", see below) ...

I sneeked a look at your code (using Reflector) and found (somewhere between all the obfusicated code) a (for me) unknown parameter-setting in th "GetImage" override:

Code:
parameters["FORCE_RERENDER"] = "true";

That did the trick... I'm using a slightly different approach then yours, in that I keep track of the last GetImage call, and wait 200 ms between calls.

I also keep the images in cache (but just the thumbnails). It seems a little more responsive then your solution, as far as I can see....

The only thing I found is that the same "trick" won't work on the "DetailedListView". It doesn't seem to do anything woith the "FORCE_RERENDER" flag (I have currently implemented DetailListView with a thumbnail image and the simple "ListView" with just text).

Is there anything I still need to do or is this a limitation in the DetailListView???

Regards,

//Ton
//Ton
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,707
Threads: 767
Joined: Nov 2003
#63
2007-09-05, 06:46 PM
The "FORCE_RERENDER" thing is just to make sure that the hash code of the hashtable of arguments is different, in effect forcing the list to rerender that element. You should be able to do the same thing with any old string.

I'll currently wait up to 500ms for thumbnails to load. 200ms would be a little more responsive on the PC, but a bit slower on the MVP where the remote screen updates are pretty expensive and take quite a while.
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#64
2007-09-05, 07:16 PM (This post was last modified: 2007-09-05, 08:33 PM by Ton.)
Okay... thought it was something like that...

I'll post my code later anyway, so you can have a look at it if you have some spare time ;-) (just kidding)

I still think there's a (small) memory-leak with the popup somewhere, but now that I cleaned up the rest of my code (disposing the images and graphics), it's not worrying me anymore...

Strange thing is that all I do is change the "ViewMode" and the list elements don't seem to honour the "FORCE_RERENDER" flag....

Here's what I have sofar....

I still have to cleanup the Exif code (and am hoping you'll pick up the class file and re-orientation code for your next version of the Picure Library)...
//Ton
Ton
Offline

Member

Posts: 233
Threads: 16
Joined: Aug 2005
#65
2007-09-14, 07:13 AM
Well, I've been doing some testing and the way I have it set up now works great for the IconViiew, but not for the DetailListView....

What I do is:

- override GetImage
- On the initial call, I return null and add the file-name to an internal "rerenderstack" and set the "FORCE_RERENDER" to true
- On the second call, I load the image, resize it to a thumbnail, add it to my internal ImageCache (ArrayList) and return the thumbnauil. Lastly, I set "FOCE_RERENDER" to false
- On subsequent calls, I just return the thumbnail from cache

I then have logic in place that will allow only one "GetImage" call (for actually loading the image in cache and returning the intial picture) per 200 ms. Also, I have "needsRendering()" return true once every 200 ms when there are still images to be rendered....

The above works great when I use the IconView (the thumbnails pop in one by one and it's very responsive to the keyboard). It also works fine on the "FilmStrip" view, but there the images are forced to come in one by one.
When I use "DetailedListView" (which I have set up to also show a thumbnail), it only seems to re-render the image when the focus of an listitem changes (i.e. selecting / un-selecting). It looks like that is the only place where a GetImage() is actually called (making me think it doesn't look at the "FORCE_RERENDER" flag in that particular piece of code...

I would appreciate if you could have a look at it...

Regards,
//Ton
pastro
Offline

Posting Freak

Posts: 1,885
Threads: 128
Joined: Jul 2006
#66
2007-09-17, 08:11 PM
Is there an equivilent for CommonGBPVRUtilities in PVRX2? I'm using some of the skinutilities and they only use the old skinhelper.
If not, is the easiest way to still use them is to maintain a skinhelper2 and a skinhelper with two different skin files?
GBpvr PC: Intel Celeron 1.8 Ghz. 768 Mb WinXp Home Sp2
Video: Diamond 128 Mb 9550
Capture Cards: PVR-150 & PVR-150 MCE w/fm + 2x MVP
Author of: BurnDVDX2 and Skiptool
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#67
2007-09-23, 04:51 AM
pastro Wrote:Is there an equivilent for CommonGBPVRUtilities in PVRX2? I'm using some of the skinutilities and they only use the old skinhelper.
If not, is the easiest way to still use them is to maintain a skinhelper2 and a skinhelper with two different skin files?
I have been adding the functions I need to the WizUiHelper.DLL. Are there specific functions you are looking for, I may be able to add them here.
pastro
Offline

Posting Freak

Posts: 1,885
Threads: 128
Joined: Jul 2006
#68
2007-09-23, 06:07 AM
JavaWiz Wrote:I have been adding the functions I need to the WizUiHelper.DLL. Are there specific functions you are looking for, I may be able to add them here.

That would be great if you get the time.

These are the two.
[SIZE=2]ScreenBoxParams getBoxSettings(SkinHelper skinHelper, string elementName);
[SIZE=2]string TextString(SkinHelper skinHelper, string PropertyName, string DefaultValue);
[/SIZE][/SIZE]
GBpvr PC: Intel Celeron 1.8 Ghz. 768 Mb WinXp Home Sp2
Video: Diamond 128 Mb 9550
Capture Cards: PVR-150 & PVR-150 MCE w/fm + 2x MVP
Author of: BurnDVDX2 and Skiptool
Jeff
Offline

Posting Freak

Posts: 1,933
Threads: 69
Joined: Oct 2004
#69
2007-09-23, 02:58 PM
I think getBoxSettings should be replaced in PVRX2 with skinHelper2.getPlacementRect(string elementName) since it conceptually does the same thing and is now the standard way to do things. I've added the following methods to the next rev of CommonGBPVRUtilties.dll

public static string ButtonName(GBPVRX2.SkinHelper2 skinHelper, string PropertyName)

public static string ButtonDescription(GBPVRX2.SkinHelper2 skinHelper, string PropertyName)

public static string TextString(GBPVRX2.SkinHelper2 skinHelper, string PropertyName, string DefaultValue)


Jeff
pastro
Offline

Posting Freak

Posts: 1,885
Threads: 128
Joined: Jul 2006
#70
2007-09-23, 03:06 PM
Jeff Wrote:I think getBoxSettings should be replaced in PVRX2 with skinHelper2.getPlacementRect(string elementName) since it conceptually does the same thing and is now the standard way to do things. I've added the following methods to the next rev of CommonGBPVRUtilties.dll

public static string ButtonName(GBPVRX2.SkinHelper2 skinHelper, string PropertyName)

public static string ButtonDescription(GBPVRX2.SkinHelper2 skinHelper, string PropertyName)

public static string TextString(GBPVRX2.SkinHelper2 skinHelper, string PropertyName, string DefaultValue)



Jeff
Thanks Jeff.
Is that available now? I'd like to remove the dependancy on the legacy skin.
GBpvr PC: Intel Celeron 1.8 Ghz. 768 Mb WinXp Home Sp2
Video: Diamond 128 Mb 9550
Capture Cards: PVR-150 & PVR-150 MCE w/fm + 2x MVP
Author of: BurnDVDX2 and Skiptool
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (9): « Previous 1 … 5 6 7 8 9 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,864 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,376 2020-11-14, 08:01 PM
Last Post: sub
  Test/Development environment for npvr.db3 scJohn 10 4,344 2020-09-04, 09:14 PM
Last Post: scJohn
  VIdeo playback from plugin mvallevand 5 3,482 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,914 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,781 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,121 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 1,959 2013-03-12, 06:48 AM
Last Post: psycik
  Integrated Development Environment (IDE) for plugins osx-addict 5 2,770 2012-10-18, 08:35 PM
Last Post: osx-addict
  Plugin problems with started from the command line mvallevand 11 5,005 2012-08-12, 07:56 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode