Permalink
Browse files

MP1-4781V8 : madVR V336 (WIP 3D subtitle for Auto3D plugins)

  • Loading branch information...
Sebastiii committed Oct 4, 2017
1 parent 42ad307 commit 218e886b26b95a5c63fe79541ae55b2a10803958
Showing with 46 additions and 3 deletions.
  1. +46 −3 mediaportal/Core/Player/PlaneScene.cs
@@ -1312,10 +1312,53 @@ public void RenderSubtitle(long frameStart, int left, int top, int right, int bo
if (GUIGraphicsContext.SubDeviceMadVr != IntPtr.Zero)
{
ISubEngine engine = SubEngine.GetInstance();
if (engine != null)
if (GUIGraphicsContext.Render3DMode != GUIGraphicsContext.eRender3DMode.SideBySide &&
GUIGraphicsContext.Render3DMode != GUIGraphicsContext.eRender3DMode.TopAndBottom)
{
engine.SetTime(frameStart);
engine.Render(_subsRect, _destinationRect, xOffsetInPixels);
// for a 2D movie we render the subtitles here
if (engine != null)
{
engine.SetTime(frameStart);
engine.Render(_subsRect, _destinationRect, xOffsetInPixels);
}
}
else if (GUIGraphicsContext.Render3DMode == GUIGraphicsContext.eRender3DMode.SideBySide ||
GUIGraphicsContext.Render3DMode == GUIGraphicsContext.eRender3DMode.TopAndBottom)
{
// for a 3D movie we render the left/top frame subtitle here
// if Render3DSubtitle is turned off, rendering takes place in InternalPresentImage()
// this helps to avoid doubling of subtitles that are generated by external tools
if (GUIGraphicsContext.Render3DSubtitle)
{
Rectangle subRect = _subsRect;
Rectangle dstRect = _destinationRect;
if (GUIGraphicsContext.Render3DMode == GUIGraphicsContext.eRender3DMode.SideBySide)
{
dstRect.Width /= 2;
dstRect.Y = 0;
}
else if (GUIGraphicsContext.Render3DMode == GUIGraphicsContext.eRender3DMode.TopAndBottom)
{
dstRect.Height /= 2;
}
subRect.X += GUIGraphicsContext.Render3DSubtitleDistance;
dstRect.X += GUIGraphicsContext.Render3DSubtitleDistance;
engine.SetTime(frameStart);
engine.Render(_subsRect, dstRect, xOffsetInPixels);
}
else
{
// for a 2D movie we render the subtitles here
if (engine != null)
{
engine.SetTime(frameStart);
engine.Render(_subsRect, _destinationRect, xOffsetInPixels);
}
}
}
}
}

0 comments on commit 218e886

Please sign in to comment.