Esempio n. 1
0
        // savevmr9bitmap

        public void GetVideoWindows(out Rectangle rSource, out Rectangle rDest)
        {
            Geometry m_geometry = new Geometry();
            // get the window where the video/tv should be shown
            float x  = GUIGraphicsContext.VideoWindow.X;
            float y  = GUIGraphicsContext.VideoWindow.Y;
            float nw = GUIGraphicsContext.VideoWindow.Width;
            float nh = GUIGraphicsContext.VideoWindow.Height;

            GUIGraphicsContext.Correct(ref x, ref y);

            //sanity checks
            if (nw > GUIGraphicsContext.OverScanWidth)
            {
                nw = GUIGraphicsContext.OverScanWidth;
            }
            if (nh > GUIGraphicsContext.OverScanHeight)
            {
                nh = GUIGraphicsContext.OverScanHeight;
            }

            //are we supposed to show video in fullscreen or in a preview window?
            if (GUIGraphicsContext.IsFullScreenVideo || !GUIGraphicsContext.ShowBackground)
            {
                //yes fullscreen, then use the entire screen
                x  = GUIGraphicsContext.OverScanLeft;
                y  = GUIGraphicsContext.OverScanTop;
                nw = GUIGraphicsContext.OverScanWidth;
                nh = GUIGraphicsContext.OverScanHeight;
            }

            //calculate the video window according to the current aspect ratio settings
            float fVideoWidth  = (float)VideoWidth;
            float fVideoHeight = (float)VideoHeight;

            m_geometry.ImageWidth   = (int)fVideoWidth;
            m_geometry.ImageHeight  = (int)fVideoHeight;
            m_geometry.ScreenWidth  = (int)nw;
            m_geometry.ScreenHeight = (int)nh;
            m_geometry.ARType       = GUIGraphicsContext.ARType;
            m_geometry.PixelRatio   = GUIGraphicsContext.PixelRatio;
            m_geometry.GetWindow(VideoAspectRatioX, VideoAspectRatioY, out rSource, out rDest);
            rDest.X   += (int)x;
            rDest.Y   += (int)y;
            m_geometry = null;
        }
 public override void SetVideoWindow()
 {
   if (GUIGraphicsContext.Vmr9Active)
   {
     _updateNeeded = false;
     m_bStarted = true;
     return;
   }
   if (GUIGraphicsContext.IsFullScreenVideo != m_bFullScreen)
   {
     m_bFullScreen = GUIGraphicsContext.IsFullScreenVideo;
     _updateNeeded = true;
   }
   if (!_updateNeeded)
   {
     return;
   }
   _updateNeeded = false;
   m_bStarted = true;
   float x = m_iPositionX;
   float y = m_iPositionY;
   int nw = m_iWidth;
   int nh = m_iHeight;
   if (nw > GUIGraphicsContext.OverScanWidth)
   {
     nw = GUIGraphicsContext.OverScanWidth;
   }
   if (nh > GUIGraphicsContext.OverScanHeight)
   {
     nh = GUIGraphicsContext.OverScanHeight;
   }
   //lock ( typeof(VideoPlayerVMR7) )
   {
     if (GUIGraphicsContext.IsFullScreenVideo)
     {
       x = m_iPositionX = GUIGraphicsContext.OverScanLeft;
       y = m_iPositionY = GUIGraphicsContext.OverScanTop;
       nw = m_iWidth = GUIGraphicsContext.OverScanWidth;
       nh = m_iHeight = GUIGraphicsContext.OverScanHeight;
     }
     if (x < 0 || y < 0)
     {
       return;
     }
     if (nw <= 0 || nh <= 0)
     {
       return;
     }
     int aspectX, aspectY;
     if (basicVideo != null)
     {
       basicVideo.GetVideoSize(out m_iVideoWidth, out m_iVideoHeight);
     }
     aspectX = m_iVideoWidth;
     aspectY = m_iVideoHeight;
     if (basicVideo != null)
     {
       basicVideo.GetPreferredAspectRatio(out aspectX, out aspectY);
     }
     m_aspectX = aspectX;
     m_aspectY = aspectY;
     GUIGraphicsContext.VideoSize = new Size(m_iVideoWidth, m_iVideoHeight);
     Rectangle rSource, rDest;
     Geometry m_geometry = new Geometry();
     m_geometry.ImageWidth = m_iVideoWidth;
     m_geometry.ImageHeight = m_iVideoHeight;
     m_geometry.ScreenWidth = nw;
     m_geometry.ScreenHeight = nh;
     m_geometry.ARType = GUIGraphicsContext.ARType;
     m_geometry.PixelRatio = GUIGraphicsContext.PixelRatio;
     m_geometry.GetWindow(aspectX, aspectY, out rSource, out rDest);
     rDest.X += (int)x;
     rDest.Y += (int)y;
     Log.Info("overlay: video WxH  : {0}x{1}", m_iVideoWidth, m_iVideoHeight);
     Log.Info("overlay: video AR   : {0}:{1}", aspectX, aspectY);
     Log.Info("overlay: screen WxH : {0}x{1}", nw, nh);
     Log.Info("overlay: AR type    : {0}", GUIGraphicsContext.ARType);
     Log.Info("overlay: PixelRatio : {0}", GUIGraphicsContext.PixelRatio);
     Log.Info("overlay: src        : ({0},{1})-({2},{3})",
              rSource.X, rSource.Y, rSource.X + rSource.Width, rSource.Y + rSource.Height);
     Log.Info("overlay: dst        : ({0},{1})-({2},{3})",
              rDest.X, rDest.Y, rDest.X + rDest.Width, rDest.Y + rDest.Height);
     SetSourceDestRectangles(rSource, rDest);
     SetVideoPosition(rDest);
     _sourceRectangle = rSource;
     _videoRectangle = rDest;
   }
 }
    public override void SetVideoWindow()
    {
      if (GUIGraphicsContext.IsFullScreenVideo != _isFullscreen)
      {
        _isFullscreen = GUIGraphicsContext.IsFullScreenVideo;
        _updateNeeded = true;
      }

      if (!_updateNeeded)
      {
        return;
      }
      _updateNeeded = false;
      _isStarted = true;
      float x = _positionX;
      float y = _positionY;
      int nw = _width;
      int nh = _height;
      if (nw > GUIGraphicsContext.OverScanWidth)
      {
        nw = GUIGraphicsContext.OverScanWidth;
      }
      if (nh > GUIGraphicsContext.OverScanHeight)
      {
        nh = GUIGraphicsContext.OverScanHeight;
      }
      if (GUIGraphicsContext.IsFullScreenVideo)
      {
        x = _positionX = GUIGraphicsContext.OverScanLeft;
        y = _positionY = GUIGraphicsContext.OverScanTop;
        nw = _width = GUIGraphicsContext.OverScanWidth;
        nh = _height = GUIGraphicsContext.OverScanHeight;
      }
      /*			Log.Info("{0},{1}-{2},{3}  vidwin:{4},{5}-{6},{7} fs:{8}", x,y,nw,nh, 
              GUIGraphicsContext.VideoWindow.Left,
              GUIGraphicsContext.VideoWindow.Top,
              GUIGraphicsContext.VideoWindow.Right,
              GUIGraphicsContext.VideoWindow.Bottom,
              GUIGraphicsContext.IsFullScreenVideo);*/
      if (nw <= 0 || nh <= 0)
      {
        return;
      }
      if (x < 0 || y < 0)
      {
        return;
      }
      int aspectX, aspectY;
      if (_basicVideo != null)
      {
        _basicVideo.GetVideoSize(out _videoWidth, out _videoHeight);
      }
      aspectX = _videoWidth;
      aspectY = _videoHeight;
      if (_basicVideo != null)
      {
        _basicVideo.GetPreferredAspectRatio(out aspectX, out aspectY);
      }
      GUIGraphicsContext.VideoSize = new Size(_videoWidth, _videoHeight);
      _aspectX = aspectX;
      _aspectY = aspectY;
      Geometry m_geometry = new Geometry();
      Rectangle rSource, rDest;
      m_geometry.ImageWidth = _videoWidth;
      m_geometry.ImageHeight = _videoHeight;
      m_geometry.ScreenWidth = nw;
      m_geometry.ScreenHeight = nh;
      m_geometry.ARType = GUIGraphicsContext.ARType;
      m_geometry.PixelRatio = GUIGraphicsContext.PixelRatio;
      m_geometry.GetWindow(aspectX, aspectY, out rSource, out rDest);
      rDest.X += (int)x;
      rDest.Y += (int)y;
      Log.Info("overlay: video WxH  : {0}x{1}", _videoWidth, _videoHeight);
      Log.Info("overlay: video AR   : {0}:{1}", aspectX, aspectY);
      Log.Info("overlay: screen WxH : {0}x{1}", nw, nh);
      Log.Info("overlay: AR type    : {0}", GUIGraphicsContext.ARType);
      Log.Info("overlay: PixelRatio : {0}", GUIGraphicsContext.PixelRatio);
      Log.Info("overlay: src        : ({0},{1})-({2},{3})",
               rSource.X, rSource.Y, rSource.X + rSource.Width, rSource.Y + rSource.Height);
      Log.Info("overlay: dst        : ({0},{1})-({2},{3})",
               rDest.X, rDest.Y, rDest.X + rDest.Width, rDest.Y + rDest.Height);
      Log.Info("TSStreamBufferPlayer:Window ({0},{1})-({2},{3}) - ({4},{5})-({6},{7})",
               rSource.X, rSource.Y, rSource.Right, rSource.Bottom,
               rDest.X, rDest.Y, rDest.Right, rDest.Bottom);
      if (rSource.Y == 0)
      {
        rSource.Y += 5;
        rSource.Height -= 10;
      }
      SetSourceDestRectangles(rSource, rDest);
      SetVideoPosition(rDest);
      _sourceRectangle = rSource;
      _videoRectangle = rDest;
    }
Esempio n. 4
0
    public override void SetVideoWindow()
    {
      if (GUIGraphicsContext.IsFullScreenVideo != _isFullscreen)
      {
        _isFullscreen = GUIGraphicsContext.IsFullScreenVideo;
        _updateNeeded = true;
      }

      if (!_updateNeeded && !GUIGraphicsContext.UpdateVideoWindow)
      {
        return;
      }

      _updateNeeded = false;
      GUIGraphicsContext.UpdateVideoWindow = false;

      float x = _positionX;
      float y = _positionY;
      int nw = _width;
      int nh = _height;

      if (nw > GUIGraphicsContext.OverScanWidth)
      {
        nw = GUIGraphicsContext.OverScanWidth;
      }
      
      if (nh > GUIGraphicsContext.OverScanHeight)
      {
        nh = GUIGraphicsContext.OverScanHeight;
      }
      
      if (GUIGraphicsContext.IsFullScreenVideo)
      {
        x = _positionX = GUIGraphicsContext.OverScanLeft;
        y = _positionY = GUIGraphicsContext.OverScanTop;
        nw = _width = GUIGraphicsContext.OverScanWidth;
        nh = _height = GUIGraphicsContext.OverScanHeight;
      }

      if (nw <= 0 || nh <= 0 || x < 0 || y < 0)
      {
        return;
      }

      int aspectX, aspectY;

      if (_basicVideo != null)
      {
        _basicVideo.GetVideoSize(out _videoWidth, out _videoHeight);
      }
      aspectX = _videoWidth;
      aspectY = _videoHeight;

      if (_basicVideo != null)
      {
        _basicVideo.GetPreferredAspectRatio(out aspectX, out aspectY);
      }

      _aspectX = aspectX;
      _aspectY = aspectY;

      GUIGraphicsContext.VideoSize = new Size(_videoWidth, _videoHeight);
      GUIGraphicsContext.ScaleVideoWindow(ref nw, ref nh, ref x, ref y);

      Rectangle rSource, rDest;

      Geometry m_geometry = new Geometry();
      m_geometry.ImageWidth = _videoWidth;
      m_geometry.ImageHeight = _videoHeight;
      m_geometry.ScreenWidth = nw;
      m_geometry.ScreenHeight = nh;
      m_geometry.ARType = GUIGraphicsContext.ARType;
      m_geometry.PixelRatio = GUIGraphicsContext.PixelRatio;
      m_geometry.GetWindow(aspectX, aspectY, out rSource, out rDest);

      rDest.X += (int)x;
      rDest.Y += (int)y;

      Log.Info("overlay: video WxH  : {0}x{1}", _videoWidth, _videoHeight);
      Log.Info("overlay: video AR   : {0}:{1}", aspectX, aspectY);
      Log.Info("overlay: screen WxH : {0}x{1}", nw, nh);
      Log.Info("overlay: AR type    : {0}", GUIGraphicsContext.ARType);
      Log.Info("overlay: PixelRatio : {0}", GUIGraphicsContext.PixelRatio);
      Log.Info("overlay: src        : ({0},{1})-({2},{3})",
        rSource.X, rSource.Y, rSource.X + rSource.Width, rSource.Y + rSource.Height);
      Log.Info("overlay: dst        : ({0},{1})-({2},{3})",
        rDest.X, rDest.Y, rDest.X + rDest.Width, rDest.Y + rDest.Height);

      SetSourceDestRectangles(rSource, rDest);
      SetVideoPosition(rDest);
      _sourceRectangle = rSource;
      _videoRectangle = rDest;
    }
Esempio n. 5
0
    // savevmr9bitmap

    public void GetVideoWindows(out Rectangle rSource, out Rectangle rDest)
    {
      Geometry m_geometry = new Geometry();
      // get the window where the video/tv should be shown
      float x = GUIGraphicsContext.VideoWindow.X;
      float y = GUIGraphicsContext.VideoWindow.Y;
      float nw = GUIGraphicsContext.VideoWindow.Width;
      float nh = GUIGraphicsContext.VideoWindow.Height;

      GUIGraphicsContext.Correct(ref x, ref y);

      //sanity checks
      if (nw > GUIGraphicsContext.OverScanWidth)
      {
        nw = GUIGraphicsContext.OverScanWidth;
      }
      if (nh > GUIGraphicsContext.OverScanHeight)
      {
        nh = GUIGraphicsContext.OverScanHeight;
      }

      //are we supposed to show video in fullscreen or in a preview window?
      if (GUIGraphicsContext.IsFullScreenVideo || !GUIGraphicsContext.ShowBackground)
      {
        //yes fullscreen, then use the entire screen
        x = GUIGraphicsContext.OverScanLeft;
        y = GUIGraphicsContext.OverScanTop;
        nw = GUIGraphicsContext.OverScanWidth;
        nh = GUIGraphicsContext.OverScanHeight;
      }

      //calculate the video window according to the current aspect ratio settings
      float fVideoWidth = (float)VideoWidth;
      float fVideoHeight = (float)VideoHeight;
      m_geometry.ImageWidth = (int)fVideoWidth;
      m_geometry.ImageHeight = (int)fVideoHeight;
      m_geometry.ScreenWidth = (int)nw;
      m_geometry.ScreenHeight = (int)nh;
      m_geometry.ARType = GUIGraphicsContext.ARType;
      m_geometry.PixelRatio = GUIGraphicsContext.PixelRatio;
      m_geometry.GetWindow(VideoAspectRatioX, VideoAspectRatioY, out rSource, out rDest);
      rDest.X += (int)x;
      rDest.Y += (int)y;
      m_geometry = null;
    }
Esempio n. 6
0
    public override void SetVideoWindow()
    {
      if (_videoWin == null)
      {
        return;
      }
      if (GUIGraphicsContext.IsFullScreenVideo != _fullScreen)
      {
        _fullScreen = GUIGraphicsContext.IsFullScreenVideo;
        _updateNeeded = true;
      }

      if (!_updateNeeded)
      {
        return;
      }

      _started = true;
      _updateNeeded = false;
      float x = _positionX;
      float y = _positionY;

      int nw = _width;
      int nh = _height;
      if (nw > GUIGraphicsContext.OverScanWidth)
      {
        nw = GUIGraphicsContext.OverScanWidth;
      }
      if (nh > GUIGraphicsContext.OverScanHeight)
      {
        nh = GUIGraphicsContext.OverScanHeight;
      }
      lock (typeof (DVDPlayer))
      {
        if (GUIGraphicsContext.IsFullScreenVideo)
        {
          x = _positionX = GUIGraphicsContext.OverScanLeft;
          y = _positionY = GUIGraphicsContext.OverScanTop;
          nw = _width = GUIGraphicsContext.OverScanWidth;
          nh = _height = GUIGraphicsContext.OverScanHeight;
        }
        if (nw <= 0 || nh <= 0)
        {
          return;
        }

        Rectangle source, destination;

        int aspectX, aspectY;
        if (_basicVideo != null)
        {
          _basicVideo.GetVideoSize(out _videoWidth, out _videoHeight);
        }
        aspectX = _videoWidth;
        aspectY = _videoHeight;
        if (_basicVideo != null)
        {
          _basicVideo.GetPreferredAspectRatio(out aspectX, out aspectY);
        }
        GUIGraphicsContext.VideoSize = new Size(_videoWidth, _videoHeight);

        Geometry m_geometry = new Geometry();
        m_geometry.ImageWidth = _videoWidth;
        m_geometry.ImageHeight = _videoHeight;
        m_geometry.ScreenWidth = nw;
        m_geometry.ScreenHeight = nh;
        m_geometry.ARType = GUIGraphicsContext.ARType;
        using (Settings xmlreader = new MPSettings())
        {
          bool bUseAR = xmlreader.GetValueAsBool("dvdplayer", "pixelratiocorrection", false);
          if (bUseAR)
          {
            m_geometry.PixelRatio = GUIGraphicsContext.PixelRatio;
          }
          else
          {
            m_geometry.PixelRatio = 1.0f;
          }
        }
        m_geometry.GetWindow(aspectX, aspectY, out source, out destination);
        destination.X += (int)x;
        destination.Y += (int)y;


        Log.Info("overlay: video WxH  : {0}x{1}", _videoWidth, _videoHeight);
        Log.Info("overlay: video AR   : {0}:{1}", aspectX, aspectY);
        Log.Info("overlay: screen WxH : {0}x{1}", nw, nh);
        Log.Info("overlay: AR type    : {0}", GUIGraphicsContext.ARType);
        Log.Info("overlay: PixelRatio : {0}", GUIGraphicsContext.PixelRatio);
        Log.Info("overlay: src        : ({0},{1})-({2},{3})",
                 source.X, source.Y, source.X + source.Width, source.Y + source.Height);
        Log.Info("overlay: dst        : ({0},{1})-({2},{3})",
                 destination.X, destination.Y, destination.X + destination.Width, destination.Y + destination.Height);


        SetSourceDestRectangles(source, destination);
        SetVideoPosition(destination);

        //hr=_videoWin.SetWindowPosition( destination.X, destination.Y, destination.Width, destination.Height );
        //hr=_dvdCtrl.SelectVideoModePreference(_videoPref);        
        DirectShowUtil.SetARMode(_graphBuilder, arMode);

        _sourceRectangle = source;
        _videoRectangle = destination;
      }
    }
        /// <summary>
        /// This method calculates the rectangle on screen where the video should be presented
        /// this depends on if we are in fullscreen mode or preview mode
        /// and on the current aspect ration settings
        /// </summary>
        /// <param name="videoSize">Size of video stream</param>
        /// <returns>
        /// true : video window is visible
        /// false: video window is not visible
        /// </returns>
        public bool SetVideoWindow(Size videoSize)
        {
            try
            {
                if (!GUIGraphicsContext.IsPlayingVideo)
                {
                    return(false);
                }

                GUIGraphicsContext.VideoSize = videoSize;
                // get the window where the video/tv should be shown
                float x  = GUIGraphicsContext.VideoWindow.X;
                float y  = GUIGraphicsContext.VideoWindow.Y;
                float nw = GUIGraphicsContext.VideoWindow.Width;
                float nh = GUIGraphicsContext.VideoWindow.Height;

                //sanity checks
                if (nw > GUIGraphicsContext.OverScanWidth)
                {
                    nw = GUIGraphicsContext.OverScanWidth;
                }
                if (nh > GUIGraphicsContext.OverScanHeight)
                {
                    nh = GUIGraphicsContext.OverScanHeight;
                }

                //are we supposed to show video in fullscreen or in a preview window?
                if (GUIGraphicsContext.IsFullScreenVideo || !GUIGraphicsContext.ShowBackground)
                {
                    //yes fullscreen, then use the entire screen
                    x  = GUIGraphicsContext.OverScanLeft;
                    y  = GUIGraphicsContext.OverScanTop;
                    nw = GUIGraphicsContext.OverScanWidth;
                    nh = GUIGraphicsContext.OverScanHeight;
                }

                //sanity check
                if (nw <= 10 || nh <= 10 || x < 0 || y < 0)
                {
                    return(false);
                }

                GUIGraphicsContext.VideoReceived();

                //did the video window,aspect ratio change? if not
                //then we dont need to recalculate and just return the previous settings
                if (!updateCrop && x == _rectPrevious.X && y == _rectPrevious.Y &&
                    nw == _rectPrevious.Width && nh == _rectPrevious.Height &&
                    GUIGraphicsContext.ARType == _aspectRatioType &&
                    GUIGraphicsContext.Overlay == _lastOverlayVisible && _shouldRenderTexture &&
                    _prevVideoWidth == videoSize.Width && _prevVideoHeight == videoSize.Height &&
                    _prevArVideoWidth == _arVideoWidth && _prevArVideoHeight == _arVideoHeight)
                {
                    //not changed, return previous settings
                    return(_shouldRenderTexture);
                }

                //settings (position,size,aspect ratio) changed.
                //Store these settings and start calucating the new video window
                _rectPrevious       = new Rectangle((int)x, (int)y, (int)nw, (int)nh);
                _subsRect           = _rectPrevious;
                _aspectRatioType    = GUIGraphicsContext.ARType;
                _lastOverlayVisible = GUIGraphicsContext.Overlay;
                _prevVideoWidth     = videoSize.Width;
                _prevVideoHeight    = videoSize.Height;
                _prevArVideoWidth   = _arVideoWidth;
                _prevArVideoHeight  = _arVideoHeight;

                //calculate the video window according to the current aspect ratio settings
                float fVideoWidth  = (float)videoSize.Width;
                float fVideoHeight = (float)videoSize.Height;
                _geometry.ImageWidth   = (int)fVideoWidth;
                _geometry.ImageHeight  = (int)fVideoHeight;
                _geometry.ScreenWidth  = (int)nw;
                _geometry.ScreenHeight = (int)nh;
                _geometry.ARType       = GUIGraphicsContext.ARType;
                _geometry.PixelRatio   = GUIGraphicsContext.PixelRatio;

                _geometry.GetWindow(_arVideoWidth, _arVideoHeight, out _sourceRect, out _destinationRect,
                                    out _useNonLinearStretch, _cropSettings);
                updateCrop          = false;
                _destinationRect.X += (int)x;
                _destinationRect.Y += (int)y;

                //sanity check
                if (_destinationRect.Width < 10)
                {
                    return(false);
                }
                if (_destinationRect.Height < 10)
                {
                    return(false);
                }
                if (_sourceRect.Width < 10)
                {
                    return(false);
                }
                if (_sourceRect.Height < 10)
                {
                    return(false);
                }

                Log.Debug("PlaneScene: crop T, B  : {0}, {1}", _cropSettings.Top, _cropSettings.Bottom);
                Log.Debug("PlaneScene: crop L, R  : {0}, {1}", _cropSettings.Left, _cropSettings.Right);

                Log.Info("PlaneScene: video WxH  : {0}x{1}", videoSize.Width, videoSize.Height);
                Log.Debug("PlaneScene: video AR   : {0}:{1}", _arVideoWidth, _arVideoHeight);
                Log.Info("PlaneScene: screen WxH : {0}x{1}", nw, nh);
                Log.Debug("PlaneScene: AR type    : {0}", GUIGraphicsContext.ARType);
                Log.Debug("PlaneScene: PixelRatio : {0}", GUIGraphicsContext.PixelRatio);
                Log.Debug("PlaneScene: src        : ({0},{1})-({2},{3})",
                          _sourceRect.X, _sourceRect.Y, _sourceRect.X + _sourceRect.Width, _sourceRect.Y + _sourceRect.Height);
                Log.Debug("PlaneScene: dst        : ({0},{1})-({2},{3})",
                          _destinationRect.X, _destinationRect.Y, _destinationRect.X + _destinationRect.Width,
                          _destinationRect.Y + _destinationRect.Height);

                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(ex);
                return(false);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Places the video window
        /// </summary>
        public void SetVideoWindow()
        {
            if (_videoHeight < 0)
              {
            return;
              }
              if (_mplayerBackgroundPanel == null)
            return;
              if (_mplayerOuterPanel == null)
            return;
              if (_mplayerInnerPanel == null)
            return;
              if (GUIGraphicsContext.IsFullScreenVideo != _isFullScreen)
              {
            _isFullScreen = GUIGraphicsContext.IsFullScreenVideo;
            _needUpdate = true;
              }
              if (!_needUpdate)
            return;
              _needUpdate = false;

              if (_isFullScreen)
              {
            _positionX = GUIGraphicsContext.OverScanTop;
            _positionY = GUIGraphicsContext.OverScanLeft;
            _renderWidth = GUIGraphicsContext.OverScanWidth;
            _renderHeight = GUIGraphicsContext.OverScanHeight;

              }
              _mplayerBackgroundPanel.Location = new Point(GUIGraphicsContext.OverScanTop, GUIGraphicsContext.OverScanLeft);
              _mplayerBackgroundPanel.ClientSize = new Size(GUIGraphicsContext.OverScanWidth, GUIGraphicsContext.OverScanHeight);
              _mplayerBackgroundPanel.Size = new Size(GUIGraphicsContext.OverScanWidth, GUIGraphicsContext.OverScanHeight);
              Geometry mGeometry = new Geometry
                             {
                               ImageWidth = _videoWidth,
                               ImageHeight = _videoHeight,
                               ScreenWidth = _renderWidth,
                               ScreenHeight = _renderHeight,
                               ARType = GUIGraphicsContext.ARType,
                               PixelRatio = GUIGraphicsContext.PixelRatio
                             };

              mGeometry.GetWindow(_videoWidth, _videoHeight, out _sourceRectangle, out _videoRectangle);

              _positionX += _videoRectangle.X;
              _positionY += _videoRectangle.Y;
              _renderWidth = _videoRectangle.Width;
              _renderHeight = _videoRectangle.Height;
              _mplayerOuterPanel.Location = new Point(_positionX, _positionY);
              _mplayerOuterPanel.ClientSize = new Size(_renderWidth, _renderHeight);
              _mplayerOuterPanel.Size = new Size(_renderWidth, _renderHeight);

              int sourceY = (int)-(((double)_videoRectangle.Height) / _sourceRectangle.Height * _sourceRectangle.Top);
              int sourceHeight = (int)(((double)_videoRectangle.Height) / _sourceRectangle.Height * _videoHeight);
              int sourceX = (int)-(((double)_videoRectangle.Width) / _sourceRectangle.Width * _sourceRectangle.Left);
              int sourceWidth = (int)(((double)_videoRectangle.Width) / _sourceRectangle.Width * _videoWidth);
              _mplayerInnerPanel.Location = new Point(sourceX, sourceY);
              _mplayerInnerPanel.ClientSize = new Size(sourceWidth, sourceHeight);
              _mplayerInnerPanel.Size = new Size(sourceWidth, sourceHeight);
              if (_isFullScreen)
              {
            _mplayerBackgroundPanel.Visible = true;
            Log.Info("MPlayer: Fullscreen (Destination): (" + _positionX + "," + _positionY + "," + _renderWidth + "," + _renderHeight + ") : " + GUIGraphicsContext.ARType);
            Log.Info("MPlayer: Fullscreen (Source): (" + _sourceRectangle.X + "," + _sourceRectangle.Y + "," + _sourceRectangle.Width + "," + _sourceRectangle.Height + ") : " + GUIGraphicsContext.ARType);
            _osdHandler.ActivateOSD(false);
              }
              else
              {
            _mplayerBackgroundPanel.Visible = false;
            Log.Info("MPlayer: Video Window (Destination): (" + _positionX + "," + _positionY + "," + _renderWidth + "," + _renderHeight + ")");
            Log.Info("MPlayer: Video Window (Source): (" + _sourceRectangle.X + "," + _sourceRectangle.Y + "," + _sourceRectangle.Width + "," + _sourceRectangle.Height + ") : " + GUIGraphicsContext.ARType);
            _osdHandler.DeactivateOSD(true);
              }
              _mplayerOuterPanel.BringToFront();
              if (_openGl)
              {
            _player.SendPausingKeepCommand("switch_ratio " + _aspectRatio);
              }
        }