NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 32 33 34 35 36 … 93 Next »
video inset in plugins

 
  • 0 Vote(s) - 0 Average
video inset in plugins
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#11
2008-04-12, 02:25 AM
Its just a guess but maybeyoure' doing somthing CPU intensive on every call to GetRenderList(), like redrawing something, rather than just adding items to the list that you've already drawn earlier.
FarNorthSAT
Offline

Member

Posts: 51
Threads: 5
Joined: Aug 2007
#12
2008-04-12, 03:54 AM
Sub,

Heres is my code below... is the peice of code here the problem:

[SIZE=2]IfMe.activePopup IsNotNothingThen
renderList.AddRange(DirectCast(Me.activePopup, IUiTask).GetRenderList())

EndIf


[/SIZE]
PublicFunction GetRenderList() As ArrayList Implements IUiTask.GetRenderList
Dim renderList AsNew ArrayList()
IfNot initialized Then
Return renderList
EndIf
If screenNameElement IsNotNothingThen
renderList.Add(screenNameElement)
EndIf
Dim pluginControlList As ArrayList = ctlMgr.ControlList
ForEach ctl As AWizUiControl In pluginControlList
renderList.AddRange(ctl.GetRenderList())
Next
IfMe.activePopup IsNotNothingThen
renderList.AddRange(DirectCast(Me.activePopup, IUiTask).GetRenderList())

EndIf
If forceInsetUpdate = TrueThen
Dim frect AsNew RectangleF(3.5F, 72.0F, 25.0F, 22.0F)
forceInsetUpdate =
False
PluginHelperFactory.getPluginHelper().ShowInsetAtLocation(frect)
EndIf
Return renderList
EndFunction
GBPVR v1.3.11

Intel Core 2 Quad Q6600
2 GB RAM, 50GB system drive
1 TB recording drive (Raid 0)
2 x Hauppauge NOVA-S plus
Geforce 8800 GT
Windows XP Pro (Home network -Domain)

sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#13
2008-04-12, 04:11 AM
No, I cant see any obvious problem there.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#14
2008-04-16, 02:05 AM
You might try a slightly different approach. I do not try to determine if the inset is to be displayed at render time. If inset is defined (in skin), it is displayed unless there is a popup being shown (because I don't want the inset overlaying the popup).

My code samples are in C#, but it looks like you have enought vb code builit to understand how to translate. In my plugins, I do the following:

Define Inset location object
Code:
[SIZE=2][COLOR=#2b91af]RectangleF[/COLOR][/SIZE][SIZE=2] mInsetRectangle = [/SIZE][SIZE=2][COLOR=#0000ff]new [/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]RectangleF[/COLOR][/SIZE][SIZE=2]();[/SIZE]
[SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][SIZE=2] mbInsetRectangleSet = [/SIZE][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][SIZE=2];[/SIZE]
In the activate method, retrive the location from the skin element, note the setPopup(null); call, this is important as it enables the inset at plugin activate time.
Quote:try
{
mInsetRectangle = WizInfo.getPlacementRectangle(skinHelper, "InsetRect");
mbInsetRectangleSet = true;
}
catch (Exception e)
{ WizInfo.LogErrorMessage("MovieWiz", "Activate()", e.Message); }
setPopup(null);

The setPopup() method. This method actually controls the display of the inset. If a popup is present, the inset is hidden, otherwise it is visible.
Code:
[SIZE=2][COLOR=#0000ff]private [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] setPopup([/SIZE][SIZE=2][COLOR=#2b91af]IMenuTask[/COLOR][/SIZE][SIZE=2] popup)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff]   if[/COLOR][/SIZE][SIZE=2] (([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup != popup) && ([/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup [/SIZE][SIZE=2][COLOR=#0000ff]is[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]IUiPopup[/COLOR][/SIZE][SIZE=2]))[/SIZE]
[SIZE=2]   {[/SIZE]
        [SIZE=2](([/SIZE][SIZE=2][COLOR=#2b91af]IUiPopup[/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][SIZE=2].activePopup).Dispose();[/SIZE]
[SIZE=2]   }[/SIZE]
[SIZE=2][COLOR=#0000ff]   if[/COLOR][/SIZE][SIZE=2] (mbInsetRectangleSet)[/SIZE]
[SIZE=2][COLOR=#0000ff]       if[/COLOR][/SIZE][SIZE=2] (popup != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][SIZE=2] && isPlayingVideo())[/SIZE]
[SIZE=2]      {[/SIZE]
[SIZE=2]          txtVideoThumbnail.Visible = [/SIZE][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#2b91af]          PluginHelperFactory[/COLOR][/SIZE][SIZE=2].getPluginHelper().HideInset();[/SIZE]
[SIZE=2]      }[/SIZE]
[SIZE=2][COLOR=#0000ff]      else[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] (isPlayingVideo())[/SIZE]
[SIZE=2]      {[/SIZE]
[SIZE=2]          txtVideoThumbnail.Visible = [/SIZE][SIZE=2][COLOR=#0000ff]false[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2][COLOR=#2b91af]          PluginHelperFactory[/COLOR][/SIZE][SIZE=2].getPluginHelper().ShowInsetAtLocation(mInsetRectangle);[/SIZE]
[SIZE=2]      }[/SIZE]
[SIZE=2][COLOR=#0000ff]   this[/COLOR][/SIZE][SIZE=2].activePopup = popup;[/SIZE]
[SIZE=2]   mMoreRenderingRequired = [/SIZE][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][SIZE=2];[/SIZE]
[SIZE=2]}[/SIZE]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#15
2008-04-17, 01:49 AM
I've found a better way of doing the inset. There should only be 1 call for
PluginHelperFactory.getPluginHelper().ShowInsetAtLocation() during a plugin active session. Changes noted below:

In activate:
Code:
[FONT=Courier New]if (!initialized)[/FONT]
[FONT=Courier New]{[/FONT]
[FONT=Courier New]....[/FONT]
[FONT=Courier New]// Attempt to get Inset location[/FONT]
[SIZE=2][COLOR=#0000ff][FONT=Courier New]try[/FONT][/COLOR][/SIZE]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]   mInsetRectangle = [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#2b91af]WizInfo[/COLOR][/SIZE][SIZE=2].getPlacementRectangle(skinHelper,[/SIZE][SIZE=2][COLOR=#a31515]"InsetRect"[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New]);[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]   mbInsetRectangleSet = [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New];[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]catch[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]Exception[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] e)[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]{ }[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]initialized = true;[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
[SIZE=2][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (mbInsetRectangleSet)[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]// Position the inset, and hide if no video playing[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().ShowInsetAtLocation(mInsetRectangle);[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (!isPlayingVideo())[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]   PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().HideInset();[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
[/SIZE]

In the code used for handling Form Keypresses (in Wiz Skeleton the method is Form_OnKeyDown()), the following code should detect the Home Key (or Menu on the remote):
Code:
[FONT=Courier New][SIZE=2][COLOR=#0000ff]case[/COLOR][/SIZE][SIZE=2][COLOR=#2b91af]Keys[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].Home:[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (mbInsetRectangleSet && isPlayingVideo())[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]   if[/COLOR][/SIZE][SIZE=2] ([/SIZE][SIZE=2][COLOR=#2b91af]PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().IsInsetVisible())[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]       // Playing video, inset showing, make fullscreen[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]       PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().SwitchInsetToFullscreen();[/FONT][/SIZE]
[SIZE=2][COLOR=#0000ff][FONT=Courier New]   else[/FONT][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff][FONT=Courier New]       // Playing video, inset NOT showing, show inset[/FONT][/COLOR][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]       PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().HideInset();[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]   handled = [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New];[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
[FONT=Courier New]break;[/FONT]

In setPopup, if you do not want to show the inset when a popup is being displayed:
Code:
[FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (mbInsetRectangleSet)[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][SIZE=2] (popup != [/SIZE][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] && isPlayingVideo())[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]   PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().HideInset();[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (isPlayingVideo())[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#2b91af]   PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().SwitchInsetToFullscreen();[/FONT][/SIZE]

The isPlayingVideo() routine:

Code:
[FONT=Courier New][SIZE=2][COLOR=#0000ff]private [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]bool[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] isPlayingVideo()[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]  bool[/COLOR][/SIZE][SIZE=2] playing = [/SIZE][SIZE=2][COLOR=#2b91af]PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().IsPlayingTV();[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]  if[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] (!playing)[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]      playing = [/FONT][/SIZE][FONT=Courier New][SIZE=2][COLOR=#2b91af]PluginHelperFactory[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New].getPluginHelper().IsPlayingVideo();[/FONT][/SIZE]
[FONT=Courier New][SIZE=2][COLOR=#0000ff]  return[/COLOR][/SIZE][/FONT][SIZE=2][FONT=Courier New] playing;[/FONT][/SIZE]
[SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#16
2008-04-17, 01:53 AM
Its probably best not to have that "case Keys.Home:" handling. Instead, the 'home' key should just do its default behaviour, ie return to the menu (with inset visible) and if the user presses 'home' again it'll switch back to fullscreen. By leaving this handling out it should behave the same was as other screens.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#17
2008-04-17, 02:02 AM
sub Wrote:Its probably best not to have that "case Keys.Home:" handling. Instead, the 'home' key should just do its default behaviour, ie return to the menu (with inset visible) and if the user presses 'home' again it'll switch back to fullscreen. By leaving this handling out it should behave the same was as other screens.
So the behavior should be as follows:
  • If a plugin launches a video, and the home key is pressed, the inset should appear in that plugin
  • If a video and the video is playing in the plugin inset and the home key is pressed, it should return to the main menu with the video inset.
Is that right?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,788
Threads: 769
Joined: Nov 2003
#18
2008-04-17, 02:06 AM
Yes. If a plugin launches a video, and the home key is press, the inset should appear in that plugin. If the home key is pressed again, it should return to the main menu (with inset visible). If the home key is pressed again, it should return to full screen video.

You shouldnt have to code explicitly to return to the main menu though. If you dont handle the 'home' key, it should return there automatically.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#19
2008-04-17, 02:08 AM
sub Wrote:Yes. If a plugin launches a video, and the home key is press, the inset should appear in that plugin. If the home key is pressed again, it should return to the main menu (with inset visible). If the home key is pressed again, it should return to full screen video.

You shouldnt have to code explicitly to return to the main menu though. If you dont handle the 'home' key, it should return there automatically.
Got it. Thanks. I'll update the skeleton plugin code to reflect those suggestions.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Video streaming URL and parameters? cncb 1 1,915 2021-10-22, 06:58 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,364 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 6,884 2021-03-07, 09:20 PM
Last Post: Syler
  Plugins and NPVR. Where do we start? sub 80 69,946 2020-11-26, 10:02 PM
Last Post: mandai
  Resuming a video imilne 28 15,011 2016-10-30, 09:27 PM
Last Post: mvallevand
  How to tell when video playback has finished in web client? cncb 6 4,368 2015-09-29, 08:07 PM
Last Post: cncb
  VIdeo playback from plugin mvallevand 5 3,594 2015-08-06, 10:43 PM
Last Post: sub
  I want to start developing plugins...but how? OrenShapir 6 4,147 2014-11-18, 10:38 PM
Last Post: mvallevand
  Inset Video - Stop mvallevand 2 2,120 2013-08-07, 09:57 PM
Last Post: mvallevand
  Tuner plugins and client id mvallevand 2 2,107 2013-07-03, 01:39 AM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode