home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
Submit: code patches (MediaPortal/TV-Server/etc.)
Framegrabber improvement - Capture from UI when Video is minimized or running in Mini-display
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="popy" data-source="post: 1127929" data-attributes="member: 114134"><p>thx for your feedback.</p><p></p><p></p><p></p><p>yes, you missed something <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" /></p><p>now there are 2 events. the old "<strong>NewFrameHandler</strong>" completly without GUI frame data (just for legacy).</p><p>And then tehre is the new one "<strong>NewFrameHandlerWithGUI</strong>" with GUI framedata.</p><p>I have updated the OP where i try to describe the two events <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p><p></p><p>A big problem is that the OnFrameGUI functions in Mediaportal.cs gets called when no video is running. But they DONT gets called when a video is running fullscreen or not, that doesnt matter. So thats the reason why i have added the code:</p><p></p><p>[code] //Do we have any subcribers for event NewFrameHandlerWithGUI</p><p> if (OnNewFrameWithGUI != null)</p><p> {</p><p> try</p><p> {</p><p> if (GUIGraphicsContext.IsFullScreenVideo)</p><p> {</p><p> //we are in fullscreen mode -> use video surface</p><p> //raise event to any subcribers for event NewFrameHandlerWithGUI</p><p> OnNewFrameWithGUI(width, height, arWidth, arHeight, pSurface);</p><p> }</p><p> else</p><p> {</p><p> //If we are not in fullscreen, call OnFrameGUI without parameter to use the actual GUI backbuffer</p><p> OnFrameGUI();</p><p> }</p><p> }</p><p> catch (Exception)</p><p> {</p><p> }</p><p> }[/code]</p><p></p><p>in the original function " public void OnFrame(Int16 width, Int16 height, Int16 arWidth, Int16 arHeight, uint pSurface)" which gets called everytime when a video frame will be renderd (called from PlaneScene.cs).</p><p></p><p>So when a video is running minimized and there is a subscriber for the new event "OnNewFrameWithGUI" the GUI data is used (call OnFrameGUI()<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" />. when the video is running in fullscreen the current video framedata is used.</p><p></p><p>Ill hope it makes sense <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p><strong>Do you have any better idea how to get GUI data when video is minimized?</strong></p><p>Ill think it has something todo that the GUI is rendered in another thread when a video is running.</p><p></p><p></p><p></p><p>Thats the expected behaviour.</p><p></p><p></p><p></p><p>Ok, i am with you.</p><p>Removing the option is the better way and dont confuse the user.</p><p></p><p></p><p></p><p>Ill think the better option, from a users view, is to keep legacy support (keep OnNewFrame support) and add a new event handler which is called with an source parameter so th plugin can decide.</p><p></p><p>The VIdeoModeSwitcher DONT uses the OnNewFrame event, it uses the "GetCurrentImage" function from framegrabber.cs.</p><p></p><p>Will work now on the new discussed implementation.</p><p></p><p>pOpY</p></blockquote><p></p>
[QUOTE="popy, post: 1127929, member: 114134"] thx for your feedback. yes, you missed something :p now there are 2 events. the old "[B]NewFrameHandler[/B]" completly without GUI frame data (just for legacy). And then tehre is the new one "[B]NewFrameHandlerWithGUI[/B]" with GUI framedata. I have updated the OP where i try to describe the two events ;) A big problem is that the OnFrameGUI functions in Mediaportal.cs gets called when no video is running. But they DONT gets called when a video is running fullscreen or not, that doesnt matter. So thats the reason why i have added the code: [code] //Do we have any subcribers for event NewFrameHandlerWithGUI if (OnNewFrameWithGUI != null) { try { if (GUIGraphicsContext.IsFullScreenVideo) { //we are in fullscreen mode -> use video surface //raise event to any subcribers for event NewFrameHandlerWithGUI OnNewFrameWithGUI(width, height, arWidth, arHeight, pSurface); } else { //If we are not in fullscreen, call OnFrameGUI without parameter to use the actual GUI backbuffer OnFrameGUI(); } } catch (Exception) { } }[/code] in the original function " public void OnFrame(Int16 width, Int16 height, Int16 arWidth, Int16 arHeight, uint pSurface)" which gets called everytime when a video frame will be renderd (called from PlaneScene.cs). So when a video is running minimized and there is a subscriber for the new event "OnNewFrameWithGUI" the GUI data is used (call OnFrameGUI();). when the video is running in fullscreen the current video framedata is used. Ill hope it makes sense :) [B]Do you have any better idea how to get GUI data when video is minimized?[/B] Ill think it has something todo that the GUI is rendered in another thread when a video is running. Thats the expected behaviour. Ok, i am with you. Removing the option is the better way and dont confuse the user. Ill think the better option, from a users view, is to keep legacy support (keep OnNewFrame support) and add a new event handler which is called with an source parameter so th plugin can decide. The VIdeoModeSwitcher DONT uses the OnNewFrame event, it uses the "GetCurrentImage" function from framegrabber.cs. Will work now on the new discussed implementation. pOpY [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Submit: code patches (MediaPortal/TV-Server/etc.)
Framegrabber improvement - Capture from UI when Video is minimized or running in Mini-display
Contact us
RSS
Top
Bottom