NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 49 50 51 52 53 … 93 Next »
Plugin in top of video (VideoPlugin) Question

 
  • 0 Vote(s) - 0 Average
Plugin in top of video (VideoPlugin) Question
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#1
2005-09-14, 03:22 PM
The addition of the VideoPlugin1-9 functionality in 93.10 is arguably the coolest thing Sub has done this year.

However, now that I (I'm a plugin) can be shown over a playing video (like an OSD), or from a menu, how would I know that I'm a menu or an OSD when gbPVR shows me?

Still kind of new to the plugin development, I'm wondering if one of you all would know.

TIA, dc
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#2
2005-09-14, 04:59 PM
If you're plugin implements IVideoPlugin, then the instance that is used for view mode with have IVideoPlugin.setVideoMode() called when it is first created.
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#3
2005-09-14, 08:03 PM
Outstanding, thank you Sub.

Of course, another question ... This implies the "menu version" of my plugin and the "OSD version" are different instances of the same thing (class) from a GB-PVR perspective. Am I assuming correctly?

And, of course ... is the IVideoPlugin interface documented somewhere? ... honest, I've been looking ...

If not, I'd be happy to try to help -- actually I'd be willing to [try to] do it for all the public interfaces and classes -- over time, if you would be willing to review and answer silly questions (like what the other two methods for IVideoPlugin do/expect). Docs are what we viewers can give back cause we want you adding features ... if the above would work, let me know how you would want to communicate ...

thank, dc
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#4
2005-09-14, 08:51 PM
Quote:Of course, another question ... This implies the "menu version" of my plugin and the "OSD version" are different instances of the same thing (class) from a GB-PVR perspective. Am I assuming correctly?
Yes, I think so.

Its a bit hazy in my memory at the moment, but I'm fairly sure what I've told you is correct.

Quote:And, of course ... is the IVideoPlugin interface documented somewhere? ... honest, I've been looking ...
Only in the code:
/// <summary>
/// Summary description for IVideoPlugin.
/// </summary>
public interface IVideoPlugin
{
/// <summary>This is called to inform a plugin it is running in video mode.</summary>
void setVideoMode();

/// <summary>This is polled by when showing video. Return true if you need you plugin to be shown.</summary>
bool needsToBeShown();

/// <summary>This is polled by when showing video and the plugin is currently visible. Return true if you need you plugin to be hidden.</summary>
bool needsToBeHidden();

}

Quote:If not, I'd be happy to try to help -- actually I'd be willing to [try to] do it for all the public interfaces and classes -- over time, if you would be willing to review and answer silly questions (like what the other two methods for IVideoPlugin do/expect). Docs are what we viewers can give back cause we want you adding features ... if the above would work, let me know how you would want to communicate ...
I'm happy to answer any questions. Feel free to PM or ask here.
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#5
2005-09-27, 02:07 AM
I've finally got a chance to write and share after much experimentation, testing and reading trace logs (hope you remembered I said I'd do this). Was going to PM but what the heck, there's lots of others out there too ...

Attached is basis for a doc regarding this interface I'd like to post up on the Wiki. If you could, I'd appreciate your review to ensure I'm not lying about anything. I did find that the "menu version" and "OSD version" are the same instance of the plugin ... kind of nice that way, have to dual-purpose it, but saves two of all the common code.

Also found that pressing F11/Go actually starts VideoPlugin0 ... this is an excellent feature, a one button custom OSD.

There are also a couple of questions at the end for your consideration.

I really like this interface, thinking it opens GBPVR to a whole new type of plugin for those developer types to develop. Maybe we'll even see the often asked for Caller ID (not from me, but ...). My personal plugin just lets me send commands to my home automation computer (Homeseer) -- nice to turn off/on the lights with the MVP remote. I'll post it someday when I'm not so embarrassed by the coding -- and figure out a couple of things about OSD on the PC platform.

Thanks for your help (and great/stable software ... WAF is 9+ out of 10).

Dave C.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#6
2005-09-27, 02:33 AM
Looks good. In answer to your questions:
Quote:What happens when it is being shown and NeedsToBeShown returns False and NeedsToBeHidden returns False?
I dont know. I hadnt intended to call NeedsToBeShown() on plugins which are visible, so it probably comes under the bug category. I've never tested this IVideoPlugin, and there isnt publically available plugins that use it, so its had very very little focus. If we start to see new plugins using this interface, then I'll look at what improvements and changes need to be made.

Quote:How does one mimic the transparency in the ProgressBar or TV Guide OSD when used on the PC?
Set the background of your image to PluginHelperFactory.getPluginHelper().GetOSDTransparentColor(). The colour returned will vary depending on the type of client, since they all happen to use different mask colours.

Quote:This behavior requires a series of steps to start:
Select a video from Recordings list box (part of the core)
A popup comes saying Play, Delete, Exit
Call this “Image A”
Select Play, the video plays
Invoke the Video Plugin (1+Go) from the remote
The plugin renders its buttons, just like on the PC
Select a button (this sets NeedsToBeHidden to True, and NeedsToBeShown is always = NOT(NeedsToBeHidden)
After all this, the Video is playing by itself. Then, when the SkipForward or SkipBackward button is pressed:
For a brief moment, the screen shows (from the “bottom”) the playing video, “Image A” as described above, and then – on top – the Progress Bar thing.
After the brief moment (about as long as GBPVR takes to do the Skip), the screen returns to normal with the video playing underneath the Progress Bar (then eventually the progress bar goes away like it usually does).
It probably just a matter of the OSD being made visible before the first frame is sent to the MVP. For a brief second you see the last image in the MVPs frame buffer. If we start to see more people creating video plugins, then I'll revisit this.

Quote:Also of note – but I see no consistency in this – is when the above happens, from time to time the request to Skip (forward or back) sends the video back in time to where it started when the video was started – almost like GBPVR is doing a “PlaybackPositionManager.getLastPlaybackPosition” and starting there. Pretty sure that is not by design.
I dont know. I havnt noticed this myself. It'll just be a bug somewhere.
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#7
2005-09-27, 01:26 PM
Thanks for the feedback Sub ... hope it made sense to the others that looked at it too ...

As for the open stuff ...
Quote:I hadnt intended to call NeedsToBeShown() on plugins which are visible
Ah, makes sense -- if you ever change this, please advise thru the change log (have to update the Wiki). Not really a big deal.

Transparency -- thanks very much, knew it was something special. Reven helped me out a lot (pointed in right direction), so I knew there was something magic required.

As for the other two concerns -- kind of a Catch-22 here -- it did occur to me that if the TV Guide OSD did not cause this behavior it was likely my plug causing it somehow. Will test.
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#8
2006-01-19, 01:49 AM
I've been playing with IVideoPlugin, and have noticed a couple of odd behaviors:

1. IPluginHelper.ReturnToMainMenu() doesn't work when the plugin is running in video mode. The command appears to have no effect. This is true for the TV Guide, too (at least pressing ESC while the guide is up does not bring me back to the main menu). It works fine when the same plugin is running as a Menu Task.

2. OnMouseWheel does not get invoked when the plugin is running in video mode. The plugin never receives mouse wheel events. It works fine when the same plugin is running as a menu task.

Also, the IVP document (which is great, DaveC!) doesn't mention that hiding the plugin (by returning true in needsToBeHidden() ) actually deactivates it, in the process calling the plugin's Deactivate() method. After this, of course, the plugin no longer receives any input from keyboard or mouse.

Finally, I'm getting odd behavior if several video plugins demand to be displayed at the same time (they all return true in needsToBeShown() ). I guess that's not very surprising. It seems to depend on the order they're listed in in config.xml. Sometimes, several plugins will receive keyboard input, and GBPVR will try to display both of them (though if they try to write in the same area of the screen, only one of them shows up). At other times, only one plugin will appear.

I don't suppose there's any way for a VideoPlugin to find out whether any other plugin is active? Or even to activate another plugin?
DaveC
Offline

Junior Member

Posts: 40
Threads: 3
Joined: Jan 2005
#9
2006-01-19, 02:00 PM
Hi Snarky ... thanks for the kind words, just for that I'll try to help cause I'm no expert at such things ...

Snarky Wrote:1. IPluginHelper.ReturnToMainMenu() doesn't work when the plugin is running in video mode. The command appears to have no effect. This is true for the TV Guide, too (at least pressing ESC while the guide is up does not bring me back to the main menu). It works fine when the same plugin is running as a Menu Task.
Your observation is correct ... I did this once (unintentionally) and proved to be less than stable/functional. I do not think it was ever intended to do this -- a plug in OSD mode is really subordinate to the video playing (under control of gbpvr core) and not a "standalone" thing. That would mean that the osd plug has no "rights" to stop the video, which going back to main would have to do.
Snarky Wrote:2. OnMouseWheel does not get invoked when the plugin is running in video mode. The plugin never receives mouse wheel events. It works fine when the same plugin is running as a menu task.
Cool note ... I develop with the MVP as a target, thus no mouse, so I never saw this.
Snarky Wrote:... hiding the plugin (by returning true in needsToBeHidden() ) actually deactivates it, in the process calling the plugin's Deactivate() method. After this, of course, the plugin no longer receives any input from keyboard or mouse.
I should update the doc to include that ... after my head was in the "OSD is a subordinate thing" space I guess I just assumed that behavior and never thought to write it down. This is how the core behaves by design -- I suppose you could never deactivate and keep rendering a transparent screen, but that would mess with all the other OSD's and like be considered bad behavior for a plug (like your next comment suggested).
Snarky Wrote:I don't suppose there's any way for a VideoPlugin to find out whether any other plugin is active? Or even to activate another plugin?
Sorry, can't help with that one -- never been down that road.

What are you cooking up?

dc
Snarky
Offline

Junior Member

Posts: 43
Threads: 7
Joined: Oct 2005
#10
2006-01-20, 12:46 AM
DaveC Wrote:Your observation is correct ... I did this once (unintentionally) and proved to be less than stable/functional. I do not think it was ever intended to do this -- a plug in OSD mode is really subordinate to the video playing (under control of gbpvr core) and not a "standalone" thing. That would mean that the osd plug has no "rights" to stop the video, which going back to main would have to do.
I can see how that makes sense. As a workaround, I'll try to get the plugin to send an ESC keystroke in its Deactivate() method. I think that should be possible...

Quote:Cool note ... I develop with the MVP as a target, thus no mouse, so I never saw this.
I basically just added the IVideoPlugin interface to Hello World, in order to test that everything worked. This was the one thing that didn't.

Quote:I should update the doc to include that ... after my head was in the "OSD is a subordinate thing" space I guess I just assumed that behavior and never thought to write it down. This is how the core behaves by design -- I suppose you could never deactivate and keep rendering a transparent screen, but that would mess with all the other OSD's and like be considered bad behavior for a plug (like your next comment suggested).
It took some trial and error for me to discover the model of how it works, but I think it makes complete sense. Since you were listing which methods were called by the different events, I thought it was worth to mention.

Quote:Sorry, can't help with that one -- never been down that road.

What are you cooking up?
Right now I'm just playing around. Eventually I'm thinking of a simple plugin that can run as a constant overlay with minimal interference with other functionality. For instance a ticker (running off an RSS feed) that is constantly scrolling along the bottom of the screen, but cedes control to other plugins when they want to pop up (like the Video Guide or the Caller ID plugin).
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  PIP plugin for Kodi sgilani 2 2,825 2022-10-17, 12:44 AM
Last Post: sgilani
  Video streaming URL and parameters? cncb 1 1,813 2021-10-22, 06:58 PM
Last Post: sub
  Web API only_new Question Gazavant 6 2,654 2021-04-04, 06:54 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,249 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 6,518 2021-03-07, 09:20 PM
Last Post: Syler
  New Systems Plugin kirschey 10 3,351 2020-11-14, 08:01 PM
Last Post: sub
  Another Artwork question scJohn 15 8,131 2019-09-10, 05:33 PM
Last Post: nonob
  WEB API GuidService/Listing question(s) scJohn 6 4,261 2017-08-09, 02:18 PM
Last Post: scJohn
  Resuming a video imilne 28 14,528 2016-10-30, 09:27 PM
Last Post: mvallevand
  skin question pBS 2 3,336 2016-06-18, 07:03 PM
Last Post: pBS

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

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

Linear Mode
Threaded Mode