コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        if (_newFrame)
        {
            _img.BlitToTexture(BlittedImage);
            _newFrame = false;
        }

        /*
         *      position=m_Texture.Player.GetPosition ()/1000;
         *      duration=m_Texture.Player.GetDuration ()/1000;
         *
         *      if (Input.GetKeyDown (KeyCode.LeftArrow)) {
         *              var p = (position - 5000) ;
         *              if (p < 0)
         *                      p = 0;
         *              m_Texture.Player.Seek (p * 1000);
         *      }
         *      if (Input.GetKeyDown (KeyCode.RightArrow)) {
         *              var p = (position + 5000);
         *              if (p >=duration)
         *                      p = duration;
         *              m_Texture.Player.Seek (p * 1000);
         *      }
         *      if (Input.GetKeyDown (KeyCode.S))
         *              m_Texture.Stop ();
         *
         *      if (Input.GetKeyDown (KeyCode.P))
         *              m_Texture.Play ();
         */
    }
コード例 #2
0
ファイル: GStreamerTest1.cs プロジェクト: mrayy/TxKit
    void OnFrameGrabbed(GstBaseTexture src, int index)
    {
        //m_Texture.Player.CopyFrame (_img);
        m_Texture.Player.CopyFrameCropped(_img, (int)BlitRect.x, (int)BlitRect.y, (int)BlitRect.width, (int)BlitRect.height);
        _img.BlitToTexture(BlittedImage);
//		Debug.Log(String.Format("Frame Copied {0}x{1}",_img.Width,_img.Height));
    }
コード例 #3
0
    void OnFrameBlitted(GstBaseTexture src, int index)
    {
        //m_Texture.Player.CopyFrame (_img);
        float w = m_Texture.Player.FrameSizeImage.x;
        float h = m_Texture.Player.FrameSizeImage.y;

        m_Texture.Player.CopyFrameCropped(_img, (int)(BlitRect.x * w), (int)(BlitRect.y * h), (int)(BlitRect.width * w), (int)(BlitRect.height * h));
        _newFrame = true;
        if (_newFrame)
        {
            _img.BlitToTexture(BlittedImage);
            _newFrame = false;
        }

        //		Debug.Log(String.Format("Frame Copied {0}x{1}",_img.Width,_img.Height));
    }
コード例 #4
0
    void OnFrameBlitted(GstBaseTexture src, int index)
    {
        m_Texture.Player.CopyFrame(_img_left);
        m_Texture.Player.CopyFrame(_img_right);
        float w = m_Texture.Player.FrameSizeImage.x;
        float h = m_Texture.Player.FrameSizeImage.y;

        m_Texture.Player.CopyFrameCropped(_img_left, 0, 0, (int)(w / 2), (int)(h));
        m_Texture.Player.CopyFrameCropped(_img_right, (int)(w / 2), 0, (int)(w / 2), (int)(h));
        _newFrame = true;
        if (_newFrame)
        {
            _img_left.BlitToTexture(blittedImageLeft);
            _img_right.BlitToTexture(blittedImageRight);
            _newFrame = false;
        }
    }
コード例 #5
0
    void OnFrameBlitted(GstBaseTexture src, int index)
    {
        m_Texture.Player.CopyFrame(_img_left);
        m_Texture.Player.CopyFrame(_img_right);
        float w = m_Texture.Player.FrameSizeImage.x;
        float h = m_Texture.Player.FrameSizeImage.y;

        m_Texture.Player.CopyFrameCropped(_img_left, 0, 0, (int)(w / 2), (int)(h));
        m_Texture.Player.CopyFrameCropped(_img_right, (int)(w / 2), 0, (int)(w / 2), (int)(h));
        _newFrame = true;

        //can be moved update function in case of performance issues
        if (_newFrame)
        {
            _img_left.BlitToTexture(blittedImageLeft);
            _img_right.BlitToTexture(blittedImageRight);
            _newFrame = false;
        }
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        if (_faceCaptured)
        {
            _faceImage.BlitToTexture(FaceImage);
            _faceCaptured = false;
        }
        if (_captured)
        {
            _image.BlitToTexture(BlitImage);
            if (target != null)
            {
                target.texture = BlitImage;
            }
            _captured = false;
        }

        if (FaceDetectedImg != null)
        {
            FaceDetectedImg.enabled = _faceDetected;
        }
    }