public virtual void EncodePointer(System.IntPtr ptr)
 {
     if (_audioCapture == null || (_audioDeviceIndex >= 0 || _noAudio))
     {
         AVProMovieCapturePlugin.EncodeFrame(_handle, ptr);
     }
     else
     {
         AVProMovieCapturePlugin.EncodeFrameWithAudio(_handle, ptr, _audioCapture.BufferPtr, (uint)_audioCapture.BufferLength);
         _audioCapture.FlushBuffer();
     }
 }
Exemplo n.º 2
0
 public virtual void EncodePointer(System.IntPtr ptr)
 {
     if (!IsRecordingUnityAudio())
     {
         AVProMovieCapturePlugin.EncodeFrame(_handle, ptr);
     }
     else
     {
         int           audioDataLength = 0;
         System.IntPtr audioDataPtr    = _audioCapture.ReadData(out audioDataLength);
         if (audioDataLength > 0)
         {
             AVProMovieCapturePlugin.EncodeFrameWithAudio(_handle, ptr, audioDataPtr, (uint)audioDataLength);
         }
         else
         {
             AVProMovieCapturePlugin.EncodeFrame(_handle, ptr);
         }
     }
 }
Exemplo n.º 3
0
 public virtual void EncodePointer(System.IntPtr ptr)
 {
     if (_audioCapture == null || (_audioDeviceIndex >= 0 || _noAudio) && !_isRealTime)
     {
         AVProMovieCapturePlugin.EncodeFrame(_handle, ptr);
     }
     else
     {
         int           audioDataLength = 0;
         System.IntPtr audioDataPtr    = _audioCapture.ReadData(out audioDataLength);
         if (audioDataLength > 0)
         {
             AVProMovieCapturePlugin.EncodeFrameWithAudio(_handle, ptr, audioDataPtr, (uint)audioDataLength);
         }
         else
         {
             AVProMovieCapturePlugin.EncodeFrame(_handle, ptr);
         }
     }
 }
    protected void EncodeTexture(Texture2D texture)
    {
        Color32[] bytes        = texture.GetPixels32();
        GCHandle  _frameHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned);

        if (_audioCapture == null || (_audioDeviceIndex >= 0 || _noAudio))
        {
            AVProMovieCapturePlugin.EncodeFrame(_handle, _frameHandle.AddrOfPinnedObject());
        }
        else
        {
            AVProMovieCapturePlugin.EncodeFrameWithAudio(_handle, _frameHandle.AddrOfPinnedObject(), _audioCapture.BufferPtr, (uint)_audioCapture.BufferLength);
            _audioCapture.FlushBuffer();
        }

        if (_frameHandle.IsAllocated)
        {
            _frameHandle.Free();
        }
    }