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
Support
other features (of release or svn versions)
Feature request - integrate patched Core.dll (FrameGrabber) for AtmoLight
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="azzuro" data-source="post: 1035076" data-attributes="member: 50482"><p>this is the code line from Atmolightplugin.cs</p><p>[CODE=C#] void AtmolightPlugin_OnNewFrame(short width, short height, short arWidth, short arHeight, uint pSurface)</p><p>{</p><p>if (currentEffect != ContentEffect.MP_Live_view)</p><p>return;</p><p>if (width == 0 || height == 0)</p><p>return;</p><p>if (rgbSurface==null)</p><p>rgbSurface = GUIGraphicsContext.DX9Device.CreateRenderTarget(captureWidth,captureHeight, Format.A8R8G8B8,MultiSampleType.None, 0, true);</p><p>unsafe</p><p>{</p><p>try</p><p>{</p><p>VideoSurfaceToRGBSurfaceExt(new IntPtr(pSurface), width, height, (IntPtr)rgbSurface.UnmanagedComPointer, captureWidth, captureHeight);</p><p>Microsoft.DirectX.GraphicsStream stream = SurfaceLoader.SaveToStream(ImageFileFormat.Bmp, rgbSurface);</p><p>BinaryReader reader = new BinaryReader(stream);</p><p>stream.Position = 0; // ensure that what start at the beginning of the stream.</p><p>reader.ReadBytes(14); // skip bitmap file info header</p><p>byte[] bmiInfoHeader = reader.ReadBytes(4 + 4 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4);</p><p>byte[] pixelData = reader.ReadBytes((int)(stream.Length - stream.Position));</p><p>atmoLiveViewCtrl.setPixelData(bmiInfoHeader, pixelData);</p><p>stream.Close();</p><p>stream.Dispose();</p><p>}</p><p>catch (Exception ex)</p><p>{</p><p>Log.Error(ex);</p><p>rgbSurface.Dispose();</p><p>rgbSurface = null;</p><p>}</p><p>}</p><p>} [/CODE]</p></blockquote><p></p>
[QUOTE="azzuro, post: 1035076, member: 50482"] this is the code line from Atmolightplugin.cs [CODE=C#] void AtmolightPlugin_OnNewFrame(short width, short height, short arWidth, short arHeight, uint pSurface) { if (currentEffect != ContentEffect.MP_Live_view) return; if (width == 0 || height == 0) return; if (rgbSurface==null) rgbSurface = GUIGraphicsContext.DX9Device.CreateRenderTarget(captureWidth,captureHeight, Format.A8R8G8B8,MultiSampleType.None, 0, true); unsafe { try { VideoSurfaceToRGBSurfaceExt(new IntPtr(pSurface), width, height, (IntPtr)rgbSurface.UnmanagedComPointer, captureWidth, captureHeight); Microsoft.DirectX.GraphicsStream stream = SurfaceLoader.SaveToStream(ImageFileFormat.Bmp, rgbSurface); BinaryReader reader = new BinaryReader(stream); stream.Position = 0; // ensure that what start at the beginning of the stream. reader.ReadBytes(14); // skip bitmap file info header byte[] bmiInfoHeader = reader.ReadBytes(4 + 4 + 4 + 2 + 2 + 4 + 4 + 4 + 4 + 4 + 4); byte[] pixelData = reader.ReadBytes((int)(stream.Length - stream.Position)); atmoLiveViewCtrl.setPixelData(bmiInfoHeader, pixelData); stream.Close(); stream.Dispose(); } catch (Exception ex) { Log.Error(ex); rgbSurface.Dispose(); rgbSurface = null; } } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
other features (of release or svn versions)
Feature request - integrate patched Core.dll (FrameGrabber) for AtmoLight
Contact us
RSS
Top
Bottom