NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 20 21 22 23 24 … 93 Next »
WizTools - 1.x Plugin Development Toolkit

 
  • 0 Vote(s) - 0 Average
WizTools - 1.x Plugin Development Toolkit
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#121
2008-01-04, 01:04 AM
Thanks.

The forceRefresh worked like a charm. I wasn't able to get the UiStatic to work but I'll come back to it. If I have any questions, I'll ask in a different thread instead cluttering up JavaWiz'. Smile
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#122
2008-01-04, 02:14 AM
whurlston Wrote:I'll ask in a different thread instead cluttering up JavaWiz'. Smile

Nah. This thread deserves the attention!

And moving on to give it more...

I did some more testing over the afternoon to see how memory use was looking, and I'm still not certain that what I'm seeing is appropriate.

I think this is directed more towards JavaWiz than sub though. I think.

Anyway, my complicated method of checking memory usage has been to open and close a popup repeatedly, and watch what happens to memory. (As an aside, I'm watching private PVRX2 bytes in perfmon, not the workingset value in task manager).

Memory use is indeed going up, and not being returned, even after sitting for some time subsequent to closing the popup.

I'm calling the popup object's dispose, which in turn calls the controlmanager's dispose. I tried calling dispose on each individual control, but it got really cranky with me when I did so. Besides, if I'm reading the verbose logs correctly, calling dispose on the control manager in turn disposes each of its objects. (Although why WizUiButton.Dispose() is being called for the labels I'm not sure. I'm guessing it's just a display thing.)

My next trick was to take everything out of new and initialise (so no objects created by me in the popup at all), but memory use continued to climb.

I then went and tried the same thing with the sample plugin popup and the MovieWiz popup. And saw the same thing.

And then came here. Wink

JavaWiz - would you mind taking a look at what happens on your end? The memory usage that I'm seeing may still be something unique to me or my plug-in, which would be nice to have confirmed if possible.

And if it isn't, well, I'd feel better knowing that too!
pastro
Offline

Posting Freak

Posts: 1,885
Threads: 128
Joined: Jul 2006
#123
2008-01-04, 02:23 AM
Ommina Wrote:Nah. This thread deserves the attention!

And moving on to give it more...

I did some more testing over the afternoon to see how memory use was looking, and I'm still not certain that what I'm seeing is appropriate.

I think this is directed more towards JavaWiz than sub though. I think.

Anyway, my complicated method of checking memory usage has been to open and close a popup repeatedly, and watch what happens to memory. (As an aside, I'm watching private PVRX2 bytes in perfmon, not the workingset value in task manager).

Memory use is indeed going up, and not being returned, even after sitting for some time subsequent to closing the popup.

I'm calling the popup object's dispose, which in turn calls the controlmanager's dispose. I tried calling dispose on each individual control, but it got really cranky with me when I did so. Besides, if I'm reading the verbose logs correctly, calling dispose on the control manager in turn disposes each of its objects. (Although why WizUiButton.Dispose() is being called for the labels I'm not sure. I'm guessing it's just a display thing.)

My next trick was to take everything out of new and initialise (so no objects created by me in the popup at all), but memory use continued to climb.

I then went and tried the same thing with the sample plugin popup and the MovieWiz popup. And saw the same thing.

And then came here. Wink

JavaWiz - would you mind taking a look at what happens on your end? The memory usage that I'm seeing may still be something unique to me or my plug-in, which would be nice to have confirmed if possible.

And if it isn't, well, I'd feel better knowing that too!

What version of the wizuihelper.dll are you using? There was an issue with pre 1.0.15.0 that caused memory issues.
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
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#124
2008-01-04, 02:27 AM
15.2 - dated January 2.

Thanks for reminding me though, I'll go back and look at the previous posts concerning memory and see if there is something I've forgotten.

(memory? forgotten? Get it? Oh fine.)
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#125
2008-01-04, 02:46 AM
Ommina Wrote:JavaWiz - would you mind taking a look at what happens on your end? The memory usage that I'm seeing may still be something unique to me or my plug-in, which would be nice to have confirmed if possible.

And if it isn't, well, I'd feel better knowing that too!
I'll take a look at the popup code and to see if I can find any problems...
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#126
2008-01-04, 03:05 AM
Sub-

Couple questions about memory management:

1) What is the difference between skinHelper2.DisposeResources() and PluginHelperFactory.getPluginHelper().DisposeResources(disposeList) ?

Should both be called in the Dispose method or only the plugin call?

2) Should the Dispose() call element.image.Dispose(), or does the call to the PluginHelper.DisposeResources do that under the covers. (see example below)

3) It looks like the UiButton.Dispose() method is empty. Shouldn't it call the PluginHelper dispose with the normal and selected UIElements?


Currently all the WizControls call the xxx.image.Dispose() method for each GBPVRUiElement object as well as calling the PluginHelper dispose method at the end of the routine.

For example, here is the dispose method for the text box:
Code:
[SIZE=2][COLOR=#0000ff]public [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]override [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] Dispose()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#008000]WizInfo.LogMessage("WizUiTextBox", "Dispose()", "Called for " + this.PlacementName);[/COLOR][/SIZE]
[SIZE=2]mRenderingRequired = [/SIZE][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#2b91af]ArrayList[/COLOR][/SIZE][SIZE=2] disposeList = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]ArrayList[/COLOR][/SIZE][SIZE=2]();[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].normalUiElement != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]    this[/COLOR][/SIZE][SIZE=2].normalUiElement.image.Dispose();[/SIZE]
[SIZE=2]    disposeList.Add([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].normalUiElement);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].selectedUiElement != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]    this[/COLOR][/SIZE][SIZE=2].selectedUiElement.image.Dispose();[/SIZE]
[SIZE=2]    disposeList.Add([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].selectedUiElement);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#2b91af]PluginHelperFactory[/COLOR][/SIZE][SIZE=2].getPluginHelper().DisposeResources(disposeList);[/SIZE]
[SIZE=2]normalUiElement = [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]selectedUiElement = [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
Is that the proper way to dispose of the objects?
Ommina
Offline

Senior Member

Posts: 330
Threads: 39
Joined: Feb 2006
#127
2008-01-04, 04:53 AM
JavaWiz Wrote:I'll take a look at the popup code and to see if I can find any problems...

Thanks for taking a peek! As I said, though, it may still be something that I've done here, to unless you're seeing similar behaviour there, I wouldn't spend too much time on it.

I'm going to spend some more time stripping the popup down (pop up down?) to see if I can find something that makes a difference. I'll post back if I have anything interesting to report. Or more silly jokes.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#128
2008-01-04, 12:18 PM
I am getting rather confused by how an image is displayed, I have looked at the popup example which has an image but still cant work out what is actualy calling the image. Can some one show me how I display an image.

Thanks
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#129
2008-01-04, 03:57 PM
I'm not sure if this applies with the way WizTools does things but here is an approximately what I'd do to display a graphic somewhere on the screen, consisting of some image file and some rendered text.

declare a member variable for a UiStatic:
Code:
private UiStatic nowPlayingStatic = null;
create it in your one-time initialisation function:
Code:
Hashtable args = new Hashtable();
args["@ArtistSong"] = "";
args["@Time"] = "";
args["@AlbumArt"] = "";
nowPlayingStatic = new UiStatic(skinHelper2, "Playing", args);
Your skin.xml would have a "Playing" CompositeImage and Placement defined so that the UiStatic know what the graphic should look like and where on the screen it will go.

Update the static somewhere in your plugin when you know the song has changed (like OnKeyDown), or possibling always set every time needsRendering() is called. The UiStatic take care of only redrawing the CompositeImage when it needs to be (redrawing the "Playing" composite image etc).

Code:
Hashtable args = new Hashtable();
args["@ArtistSong"] = media.Artist + "-" + media.Title;
args["@Time"] = currentSong.ToString();
args["@AlbumArt"] = media.GetImage();
nowPlayingStatic.SetArgs(args);


In your GetRenderList() function, add the static to the render list.

Code:
...
ArrayList renderList = new ArrayList()
... add other stuff to the render list.
renderList.AddRange(nowPlayingStatic.GetRenderList());

Let me know if you have problems.
idkpmiller
Offline

Posting Freak

Posts: 817
Threads: 141
Joined: May 2006
#130
2008-01-05, 06:41 AM
Hi Sub,

Thanks for the assistance, I getting the following error:

2008-01-05 18:56:49.718 VERBOSE [1] System.NullReferenceException: Object reference not set to an instance of an object.
at GBPVRX2.SkinHelper2.getNamedImage(Image image, String name, Hashtable parameters, XmlNode fromNode)
at GBPVRX2.SkinHelper2.getNamedImage(String name, Hashtable parameters)
at GBPVRX2.UiSupport.UiStatic..ctor(SkinHelper2 skinHelper, String compositeImageName, Hashtable args)
at GameZone.GameZone.GameZoneTask.Activate() in H:\GB-PVR\project\GameZone 2\GameZone 2\GameZone 2\GameZoneTask.vb:line 1081
at GBPVRX2.MenuTask.xd2a3a83a17aec615.OnKeyDown(KeyEventArgs e)
at GBPVRX2.x0061b801bdf12d35.xdae9991ab918b397(Object xdf2e3583f942db7b, KeyEventArgs xc4f45905cb1fc7ba)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)


in my skin.xml I have:

Code:
<Placement name="selectedemulator" loc="5.0,75.0" />

Code:
<CompositeImage name="selectedemulator" size="75.0,5.0">
          <DrawText text="@text" loc="0,0" size="100,100" textStyle="LabelText" align="Left" />
           <DrawImage fileName="gamezone.jpg" loc="0,0" size="100,100" />
</CompositeImage>


In declarations I have:

Code:
Private sel_emu_label As UiStatic

In Activate()

Code:
Dim args = New Hashtable()
                args("@text") = ""
                args("@Image") = ""
                sel_emu_label = New UiStatic(skinHelper, "selectedemulator", args)



In an update labels function I have:

Code:
Dim args As New Hashtable()
                args("@text") = selectedEmulator
                args("@Image") = getEmulatorImage("gamezone")
                sel_emu_label.SetArgs(args)

in GetRenderList I have added:

Code:
renderList.AddRange(sel_emu_label.GetRenderList)


Any ideas what I have done wrong?

Cheers
Let the Games begin...Round 2!
GameZone v2.9.6 - PVRx2 1.4.7 compatible!

[Image: 1299379.png]
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (31): « Previous 1 … 11 12 13 14 15 … 31 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 3,106 2022-10-17, 12:44 AM
Last Post: sgilani
  New Systems Plugin kirschey 10 3,577 2020-11-14, 08:01 PM
Last Post: sub
  Test/Development environment for npvr.db3 scJohn 10 4,614 2020-09-04, 09:14 PM
Last Post: scJohn
  VIdeo playback from plugin mvallevand 5 3,655 2015-08-06, 10:43 PM
Last Post: sub
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 3,018 2014-11-14, 02:05 AM
Last Post: Benoire
  API docs to help with plugin development? McBainUK 3 2,895 2013-06-08, 06:14 PM
Last Post: sub
  Refreshing TV Guide Data (after System plugin EPG update) imilne 13 6,340 2013-03-24, 08:03 PM
Last Post: imilne
  sabnzbd plugin to show processed files Wakalaka 1 2,035 2013-03-12, 06:48 AM
Last Post: psycik
  Integrated Development Environment (IDE) for plugins osx-addict 5 2,876 2012-10-18, 08:35 PM
Last Post: osx-addict
  Plugin problems with started from the command line mvallevand 11 5,273 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